You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
505 lines
15 KiB
505 lines
15 KiB
<script setup lang="ts">
|
|
import IconDeleteBtn from "@/components/button/IconDeleteBtn.vue";
|
|
import IconInfoBtn from "@/components/button/IconInfoBtn.vue";
|
|
import { onMounted, ref, watch } from "vue";
|
|
import FormComponent from "@/components/run/experiment/FormComponent.vue";
|
|
import ViewComponent from "@/components/run/experiment/ViewComponent.vue";
|
|
|
|
// const store = commonStore();
|
|
const detailDialog = ref(false);
|
|
const viewComponent = ref(false);
|
|
const selectedExperiment = ref<{
|
|
name: string;
|
|
description: string;
|
|
createdDate: string;
|
|
createdID: string;
|
|
} | null>(null);
|
|
const tableHeader = [
|
|
{
|
|
label: "Experiment Name",
|
|
width: "20%",
|
|
style: "word-break: keep-all;",
|
|
},
|
|
{
|
|
label: "Description",
|
|
width: "20%",
|
|
style: "word-break: keep-all;",
|
|
},
|
|
{
|
|
label: "Created Date",
|
|
width: "20%",
|
|
style: "word-break: keep-all;",
|
|
},
|
|
{
|
|
label: "Created ID",
|
|
width: "20%",
|
|
style: "word-break: keep-all;",
|
|
},
|
|
{
|
|
label: "Action",
|
|
width: "20%",
|
|
style: "word-break: keep-all;",
|
|
},
|
|
];
|
|
|
|
const searchOptions = [
|
|
{ searchType: "All", searchText: "" },
|
|
{ searchType: "Experiment Name", searchText: "name" },
|
|
{ searchType: "Description", searchText: "description" },
|
|
{ searchType: "Created Date", searchText: "createdDate" },
|
|
{ searchType: "Created ID", searchText: "createdID" },
|
|
];
|
|
const pageSizeOptions = [
|
|
{ text: "10 페이지", value: 10 },
|
|
{ text: "50 페이지", value: 50 },
|
|
{ text: "100 페이지", value: 100 },
|
|
];
|
|
|
|
const data = ref({
|
|
params: {
|
|
pageNum: 1,
|
|
pageSize: 10,
|
|
searchType: "",
|
|
searchText: "",
|
|
},
|
|
results: [],
|
|
totalDataLength: 0,
|
|
pageLength: 0,
|
|
modalMode: "",
|
|
selectedData: null,
|
|
allSelected: false,
|
|
selected: [],
|
|
isModalVisible: false,
|
|
isConfirmDialogVisible: false,
|
|
userOption: [],
|
|
});
|
|
|
|
const getCodeList = () => {
|
|
// UserService.search(data.value.params).then((d) => {
|
|
// if (d.status === 200) {
|
|
// data.value.userOption = d.data.userList;
|
|
// }
|
|
// });
|
|
};
|
|
|
|
const getData = () => {
|
|
const params = { ...data.value.params };
|
|
if (params.searchType === "" || params.searchText === "") {
|
|
delete params.searchType;
|
|
delete params.searchText;
|
|
}
|
|
data.value.results = [
|
|
{
|
|
name: "Baseline Model Training",
|
|
description: "기본 모델 구조로 학습 성능 측정",
|
|
createdDate: "2025-04-28",
|
|
createdID: "ADMIN_001",
|
|
},
|
|
{
|
|
name: "Batch Size Tuning",
|
|
description: "배치 사이즈 변경에 따른 학습 성능",
|
|
createdDate: "2025-04-20",
|
|
createdID: "ADMIN_001",
|
|
},
|
|
{
|
|
name: "Learning Rate Sweep",
|
|
description: "러닝레이트 변경에 따른 손실 ",
|
|
createdDate: "2025-04-20",
|
|
createdID: "ADMIN_001",
|
|
},
|
|
{
|
|
name: "Optimizer Comparison",
|
|
description: "Adam, SGD 등 옵티마이저 종류",
|
|
createdDate: "2025-04-20",
|
|
createdID: "ADMIN_001",
|
|
},
|
|
{
|
|
name: "Model Architecture A vs B",
|
|
description: "서로 다른 모델 구조",
|
|
createdDate: "2025-01-28",
|
|
createdID: "ADMIN_001",
|
|
},
|
|
];
|
|
data.value.totalDataLength = data.value.results.length;
|
|
setPaginationLength();
|
|
// DeviceService.search(params).then((d) => {
|
|
// if (d.status === 200) {
|
|
// data.value.results = d.data.deviceList;
|
|
// data.value.totalDataLength = d.data.totalCount;
|
|
// setTimeout(() => {
|
|
// setPaginationLength();
|
|
// }, 200);
|
|
// } else {
|
|
// store.setSnackbarMsg({
|
|
// text: "디바이스 조회 실패",
|
|
// color: "error",
|
|
// });
|
|
// }
|
|
// });
|
|
// DeviceService.search().then((d) => {
|
|
// data.value.totalDataLength = d.data.totalCount;
|
|
// setTimeout(() => {
|
|
// setPaginationLength();
|
|
// }, 200);
|
|
// });
|
|
};
|
|
|
|
const setPaginationLength = () => {
|
|
if (data.value.totalDataLength % data.value.params.pageSize === 0) {
|
|
data.value.pageLength =
|
|
data.value.totalDataLength / data.value.params.pageSize;
|
|
} else {
|
|
data.value.pageLength = Math.ceil(
|
|
data.value.totalDataLength / data.value.params.pageSize,
|
|
);
|
|
}
|
|
};
|
|
|
|
const saveData = (formData) => {
|
|
if (data.value.modalMode === "create") {
|
|
// DeviceService.add(formData).then((d) => {
|
|
// if (d.status === 200) {
|
|
// data.value.isModalVisible = false;
|
|
// store.setSnackbarMsg({
|
|
// text: "등록 되었습니다.",
|
|
// result: 200,
|
|
// });
|
|
// changePageNum(1);
|
|
// } else {
|
|
// store.setSnackbarMsg({
|
|
// text: d,
|
|
// result: 500,
|
|
// });
|
|
// }
|
|
// });
|
|
} else {
|
|
// DeviceService.update(formData.deviceKey, formData).then((d) => {
|
|
// if (d.status === 200) {
|
|
// data.value.isModalVisible = false;
|
|
// store.setSnackbarMsg({
|
|
// text: "수정 되었습니다.",
|
|
// result: 200,
|
|
// });
|
|
// changePageNum();
|
|
// } else {
|
|
// store.setSnackbarMsg({
|
|
// text: d,
|
|
// result: 500,
|
|
// });
|
|
// }
|
|
// });
|
|
}
|
|
};
|
|
|
|
const removeData = (value) => {
|
|
let removeList = value ? value : data.value.selected;
|
|
const remove = (code) => {
|
|
// return DeviceService.delete(code).then((d) => {
|
|
// if (d.status !== 200) {
|
|
// store.setSnackbarMsg({
|
|
// text: d,
|
|
// result: 500,
|
|
// });
|
|
// }
|
|
// });
|
|
};
|
|
|
|
if (removeList.length === 1) {
|
|
remove(removeList[0].deviceKey).then(() => {
|
|
// store.setSnackbarMsg({
|
|
|
|
// text: "삭제되었습니다.",
|
|
// result: 200,
|
|
// });
|
|
changePageNum();
|
|
data.value.isConfirmDialogVisible = false;
|
|
data.value.selected = [];
|
|
data.value.allSelected = false;
|
|
});
|
|
} else {
|
|
Promise.all(removeList.map((item) => remove(item.deviceKey))).finally(
|
|
() => {
|
|
// store.setSnackbarMsg({
|
|
// text: "모두 삭제되었습니다.",
|
|
// result: 200,
|
|
// });
|
|
changePageNum();
|
|
data.value.isConfirmDialogVisible = false;
|
|
data.value.selected = [];
|
|
data.value.allSelected = false;
|
|
},
|
|
);
|
|
}
|
|
};
|
|
|
|
const handleRemoveData = () => {
|
|
if (data.value.selected.length === 0) {
|
|
// store.setSnackbarMsg({
|
|
// text: "삭제 할 데이터를 선택해주세요. ",
|
|
// result: 500,
|
|
// });
|
|
return;
|
|
}
|
|
if (data.value.allSelected || data.value.selected.length !== 1) {
|
|
data.value.isConfirmDialogVisible = true;
|
|
return;
|
|
}
|
|
//리스트로 삭제 할때
|
|
removeData(undefined);
|
|
};
|
|
|
|
const changePageNum = (page) => {
|
|
data.value.params.pageNum = page;
|
|
getData();
|
|
};
|
|
|
|
const openDetail = (item: {
|
|
name: string;
|
|
description: string;
|
|
createdDate: string;
|
|
createdID: string;
|
|
}) => {
|
|
selectedExperiment.value = item;
|
|
viewComponent.value = true;
|
|
};
|
|
const closeDetail = () => {
|
|
viewComponent.value = false;
|
|
selectedExperiment.value = null;
|
|
};
|
|
const openCreateModal = () => {
|
|
data.value.selectedData = null;
|
|
data.value.modalMode = "create";
|
|
data.value.isModalVisible = true;
|
|
};
|
|
|
|
const closeModal = () => {
|
|
data.value.isModalVisible = false;
|
|
data.value.selectedData = null;
|
|
};
|
|
|
|
const getSelectedAllData = () => {
|
|
data.value.selected = data.value.allSelected
|
|
? data.value.results.map((item) => {
|
|
return {
|
|
deviceKey: item.deviceKey,
|
|
};
|
|
})
|
|
: [];
|
|
};
|
|
|
|
onMounted(() => {
|
|
getData();
|
|
getCodeList();
|
|
});
|
|
</script>
|
|
|
|
<template>
|
|
<div class="w-100" v-if="!viewComponent">
|
|
<!-- <v-dialog v-model="data.isModalVisible" max-width="600" persistent>
|
|
<FormComponent
|
|
:edit-data="data.selectedData"
|
|
:mode="data.modalMode"
|
|
@close-modal="closeModal"
|
|
@handle-data="saveData"
|
|
:user-option="data.userOption"
|
|
/>
|
|
</v-dialog>
|
|
<v-dialog v-model="data.isConfirmDialogVisible" persistent max-width="300">
|
|
<ConfirmDialogComponent
|
|
@cancel="data.isConfirmDialogVisible = false"
|
|
@delete="removeData(undefined)"
|
|
@init="((data.selected = []), (data.allSelected = false))"
|
|
/>
|
|
</v-dialog> -->
|
|
<v-container fluid class="h-100 pa-5 d-flex flex-column align-center">
|
|
<v-card
|
|
flat
|
|
class="bg-shades-transparent d-flex flex-column align-center justify-center w-100"
|
|
>
|
|
<v-card flat class="bg-shades-transparent w-100">
|
|
<v-card-item class="text-h5 font-weight-bold pt-0 pa-5 pl-0">
|
|
<div class="d-flex flex-row justify-start align-center">
|
|
<div class="text-primary">Experiment</div>
|
|
</div>
|
|
</v-card-item>
|
|
</v-card>
|
|
<v-card flat class="bg-shades-transparent w-100">
|
|
<v-card flat class="bg-shades-transparent mb-4">
|
|
<div class="d-flex justify-center flex-wrap align-center">
|
|
<v-responsive
|
|
max-width="180"
|
|
min-width="180"
|
|
class="mr-3 mt-3 mb-3"
|
|
>
|
|
<v-select
|
|
v-model="data.params.searchType"
|
|
label="검색조건"
|
|
density="compact"
|
|
:items="searchOptions"
|
|
item-title="searchType"
|
|
item-value="searchText"
|
|
hide-details
|
|
></v-select>
|
|
</v-responsive>
|
|
<v-responsive min-width="540" max-width="540">
|
|
<v-text-field
|
|
v-model="data.params.searchText"
|
|
label="검색어"
|
|
density="compact"
|
|
clearable
|
|
required
|
|
class="mt-3 mb-3"
|
|
hide-details
|
|
@keyup.enter="changePageNum(1)"
|
|
></v-text-field>
|
|
</v-responsive>
|
|
|
|
<div class="ml-3">
|
|
<v-btn
|
|
size="large"
|
|
color="primary"
|
|
:rounded="5"
|
|
@click="changePageNum(1)"
|
|
>
|
|
<v-icon> mdi-magnify</v-icon>
|
|
</v-btn>
|
|
</div>
|
|
</div>
|
|
</v-card>
|
|
|
|
<v-sheet
|
|
class="bg-shades-transparent d-flex flex-wrap align-center mb-2"
|
|
>
|
|
<v-sheet class="d-flex flex-wrap me-auto bg-shades-transparent">
|
|
<v-sheet
|
|
class="d-flex align-center mr-3 mb-2 bg-shades-transparent"
|
|
>
|
|
<v-chip color="primary"
|
|
>총 {{ data.totalDataLength.toLocaleString() }}개
|
|
</v-chip>
|
|
</v-sheet>
|
|
<v-sheet class="bg-shades-transparent">
|
|
<v-responsive max-width="140" min-width="140" class="mb-2">
|
|
<v-select
|
|
v-model="data.params.pageSize"
|
|
density="compact"
|
|
:items="pageSizeOptions"
|
|
item-title="text"
|
|
item-value="value"
|
|
variant="outlined"
|
|
color="primary"
|
|
hide-details
|
|
@update:model-value="changePageNum(1)"
|
|
></v-select>
|
|
</v-responsive>
|
|
</v-sheet>
|
|
</v-sheet>
|
|
<v-sheet class="justify-end mb-2">
|
|
<v-btn color="primary" @click="openCreateModal"
|
|
>Create Experiment
|
|
</v-btn>
|
|
</v-sheet>
|
|
</v-sheet>
|
|
|
|
<v-card class="rounded-lg pa-8">
|
|
<v-col cols="12">
|
|
<v-sheet>
|
|
<v-table
|
|
density="comfortable"
|
|
fixed-header
|
|
height="625"
|
|
col-md-12
|
|
col-12
|
|
overflow-x-auto
|
|
>
|
|
<colgroup>
|
|
<col
|
|
v-for="(item, i) in tableHeader"
|
|
:key="i"
|
|
:style="`width:${item.width}`"
|
|
/>
|
|
</colgroup>
|
|
<thead>
|
|
<tr>
|
|
<!-- <th>
|
|
<v-checkbox
|
|
v-model="data.allSelected"
|
|
style="min-width: 36px"
|
|
:indeterminate="data.allSelected === true"
|
|
hide-details
|
|
@change="getSelectedAllData"
|
|
></v-checkbox>
|
|
</th> -->
|
|
<th
|
|
v-for="(item, i) in tableHeader"
|
|
:key="i"
|
|
class="text-center font-weight-bold"
|
|
:style="`${item.style}`"
|
|
>
|
|
{{ item.label }}
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody class="text-body-2">
|
|
<tr
|
|
v-for="(item, i) in data.results"
|
|
:key="i"
|
|
class="text-center"
|
|
>
|
|
<!-- <td>
|
|
<v-checkbox
|
|
v-model="data.selected"
|
|
hide-details
|
|
:value="{
|
|
deviceKey: item.deviceKey,
|
|
}"
|
|
></v-checkbox>
|
|
</td> -->
|
|
<td>{{ item.name }}</td>
|
|
<td>{{ item.description }}</td>
|
|
<td>{{ item.createdDate }}</td>
|
|
<td>{{ item.createdID }}</td>
|
|
<td style="white-space: nowrap">
|
|
<IconInfoBtn @on-click="openDetail(item)" />
|
|
<IconDeleteBtn
|
|
@on-click="
|
|
removeData([{ deviceKey: item.deviceKey }])
|
|
"
|
|
/>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</v-table>
|
|
</v-sheet>
|
|
<v-card-actions class="text-center mt-8 justify-center">
|
|
<v-pagination
|
|
v-model="data.params.pageNum"
|
|
:length="data.pageLength"
|
|
:total-visible="10"
|
|
color="primary"
|
|
rounded="circle"
|
|
@update:model-value="getData"
|
|
></v-pagination>
|
|
</v-card-actions>
|
|
</v-col>
|
|
</v-card>
|
|
</v-card>
|
|
</v-card>
|
|
</v-container>
|
|
<v-dialog v-model="data.isModalVisible" max-width="600" persistent>
|
|
<FormComponent
|
|
:edit-data="data.selectedData"
|
|
:mode="data.modalMode"
|
|
@close-modal="closeModal"
|
|
@handle-data="saveData"
|
|
:user-option="data.userOption"
|
|
/>
|
|
</v-dialog>
|
|
</div>
|
|
<div class="w-100" v-else>
|
|
<ViewComponent :experiment="selectedExperiment" @close="closeDetail" />
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped></style>
|