|
|
|
@ -1,16 +1,20 @@
|
|
|
|
<script setup lang="ts">
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
|
|
import { onMounted, ref, watch } from "vue";
|
|
|
|
|
|
|
|
import { commonStore } from "@/stores/commonStore";
|
|
|
|
import IconDeleteBtn from "@/components/atoms/button/IconDeleteBtn.vue";
|
|
|
|
import IconDeleteBtn from "@/components/atoms/button/IconDeleteBtn.vue";
|
|
|
|
import IconModifyBtn from "@/components/atoms/button/IconModifyBtn.vue";
|
|
|
|
import IconModifyBtn from "@/components/atoms/button/IconModifyBtn.vue";
|
|
|
|
import IconInfoBtn from "@/components/atoms/button/IconInfoBtn.vue";
|
|
|
|
import IconInfoBtn from "@/components/atoms/button/IconInfoBtn.vue";
|
|
|
|
// import FormComponent from "@/components/device/FormComponent.vue";
|
|
|
|
|
|
|
|
import { onMounted, ref, watch } from "vue";
|
|
|
|
|
|
|
|
import ViewComponent from "@/components/templates/stepconfig/ViewComponent.vue";
|
|
|
|
import ViewComponent from "@/components/templates/stepconfig/ViewComponent.vue";
|
|
|
|
import StapComfigDialog from "@/components/atoms/organisms/StapComfigDialog.vue";
|
|
|
|
import StapComfigDialog from "@/components/atoms/organisms/WorklfowStepBaseDialog.vue";
|
|
|
|
import { AutoflowStepService } from "@/components/service/management/AutoflowStepService";
|
|
|
|
|
|
|
|
// const store = commonStore();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import { WorkflowStepService } from "@/components/service/management/workflowStepService";
|
|
|
|
|
|
|
|
import type { WorkflowStep } from "@/components/models/management/WorkflowStep";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const store = commonStore();
|
|
|
|
const openView = ref(false);
|
|
|
|
const openView = ref(false);
|
|
|
|
const openModify = ref(false);
|
|
|
|
type SearchType = "전체" | "제목" | "작성자";
|
|
|
|
|
|
|
|
|
|
|
|
const tableHeader = [
|
|
|
|
const tableHeader = [
|
|
|
|
{ label: "No", width: "5%", style: "word-break: keep-all;" },
|
|
|
|
{ label: "No", width: "5%", style: "word-break: keep-all;" },
|
|
|
|
{ label: "Step Name", width: "15%", style: "word-break: keep-all;" },
|
|
|
|
{ label: "Step Name", width: "15%", style: "word-break: keep-all;" },
|
|
|
|
@ -25,308 +29,279 @@ const tableHeader = [
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const searchOptions = [
|
|
|
|
const searchOptions = [
|
|
|
|
{ searchType: "전체", searchText: "" },
|
|
|
|
{ label: "전체", value: "전체" as SearchType },
|
|
|
|
{ searchType: "디바이스 별칭", searchText: "deviceAlias" },
|
|
|
|
{ label: "제목", value: "제목" as SearchType },
|
|
|
|
{ searchType: "디바이스 키", searchText: "deviceKey" },
|
|
|
|
{ label: "작성자", value: "작성자" as SearchType },
|
|
|
|
{ searchType: "사용자", searchText: "userId" },
|
|
|
|
|
|
|
|
{ searchType: "디바이스 이름", searchText: "deviceName" },
|
|
|
|
|
|
|
|
{ searchType: "디바이스 모델", searchText: "deviceModel" },
|
|
|
|
|
|
|
|
{ searchType: "디바이스 OS", searchText: "deviceOs" },
|
|
|
|
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
const SEARCH_TYPE_MAP: Record<SearchType | "", "ALL" | "TITLE" | "AUTHOR"> = {
|
|
|
|
|
|
|
|
"": "ALL",
|
|
|
|
|
|
|
|
전체: "ALL",
|
|
|
|
|
|
|
|
제목: "TITLE",
|
|
|
|
|
|
|
|
작성자: "AUTHOR",
|
|
|
|
|
|
|
|
};
|
|
|
|
const pageSizeOptions = [
|
|
|
|
const pageSizeOptions = [
|
|
|
|
{ text: "10 페이지", value: 10 },
|
|
|
|
{ text: "10 페이지", value: 10 },
|
|
|
|
{ text: "50 페이지", value: 50 },
|
|
|
|
{ text: "50 페이지", value: 50 },
|
|
|
|
{ text: "100 페이지", value: 100 },
|
|
|
|
{ text: "100 페이지", value: 100 },
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const workflowList = ["pipeline-a", "pipeline-b", "pipeline-c"];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const data = ref({
|
|
|
|
const data = ref({
|
|
|
|
params: {
|
|
|
|
params: {
|
|
|
|
pageNum: 1,
|
|
|
|
pageNum: 1,
|
|
|
|
pageSize: 10,
|
|
|
|
pageSize: 10,
|
|
|
|
searchType: "",
|
|
|
|
searchType: "전체" as SearchType,
|
|
|
|
searchText: "",
|
|
|
|
searchText: "",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
results: [],
|
|
|
|
results: [] as any[],
|
|
|
|
totalDataLength: 0,
|
|
|
|
totalElements: 0,
|
|
|
|
pageLength: 0,
|
|
|
|
pageLength: 0,
|
|
|
|
modalMode: "",
|
|
|
|
modalMode: "" as "create" | "edit" | "",
|
|
|
|
selectedData: null,
|
|
|
|
selectedData: null as any,
|
|
|
|
|
|
|
|
isStepVisible: false,
|
|
|
|
allSelected: false,
|
|
|
|
allSelected: false,
|
|
|
|
selected: [],
|
|
|
|
selected: [] as Array<{ deviceKey: number }>,
|
|
|
|
isModalVisible: false,
|
|
|
|
|
|
|
|
isConfirmDialogVisible: false,
|
|
|
|
isConfirmDialogVisible: false,
|
|
|
|
userOption: [],
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const getCodeList = () => {
|
|
|
|
const toRow = (s: any, no: number) => ({
|
|
|
|
// UserService.search(data.value.params).then((d) => {
|
|
|
|
no,
|
|
|
|
// if (d.status === 200) {
|
|
|
|
stepName: s.stepName ?? "-",
|
|
|
|
// data.value.userOption = d.data.userList;
|
|
|
|
type: s.stepType ?? "-",
|
|
|
|
// }
|
|
|
|
dataset: s.datasetName ?? "-",
|
|
|
|
// });
|
|
|
|
script: s.scriptName ?? "-",
|
|
|
|
};
|
|
|
|
hyperParameters: s.hyperParams ?? "-",
|
|
|
|
|
|
|
|
resource: s.resource ?? "-",
|
|
|
|
|
|
|
|
status: (s.status ?? "").toLowerCase() === "success" ? "success" : "warning",
|
|
|
|
|
|
|
|
workflow: s.workflowName ?? s.pipelineId ?? "-",
|
|
|
|
|
|
|
|
deviceKey: s.id,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const getData = () => {
|
|
|
|
const fetchList = async () => {
|
|
|
|
// 더미 데이터: No 7 → 1
|
|
|
|
const projectId = Number(localStorage.getItem("projectId"));
|
|
|
|
data.value.results = [
|
|
|
|
if (!projectId) {
|
|
|
|
{
|
|
|
|
console.warn("[WorkflowSteps] projectId 없음 — 프로젝트 먼저 선택");
|
|
|
|
no: 7,
|
|
|
|
data.value.results = [];
|
|
|
|
stepName: "Data Ingest",
|
|
|
|
data.value.totalElements = 0;
|
|
|
|
type: "Preprocessing",
|
|
|
|
data.value.pageLength = 0;
|
|
|
|
dataset: "raw_data",
|
|
|
|
return;
|
|
|
|
script: "ingest.py",
|
|
|
|
|
|
|
|
hyperParameters: "-",
|
|
|
|
|
|
|
|
resource: "CPU:1, MEM:2Gi",
|
|
|
|
|
|
|
|
status: "success",
|
|
|
|
|
|
|
|
workflow: "pipeline-a",
|
|
|
|
|
|
|
|
deviceKey: 7,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
no: 6,
|
|
|
|
|
|
|
|
stepName: "Data Preprocess",
|
|
|
|
|
|
|
|
type: "Preprocessing",
|
|
|
|
|
|
|
|
dataset: "raw_data",
|
|
|
|
|
|
|
|
script: "preprocess.py",
|
|
|
|
|
|
|
|
hyperParameters: "normalize=True",
|
|
|
|
|
|
|
|
resource: "CPU:2, MEM:4Gi",
|
|
|
|
|
|
|
|
status: "success",
|
|
|
|
|
|
|
|
workflow: "pipeline-a",
|
|
|
|
|
|
|
|
deviceKey: 6,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
no: 5,
|
|
|
|
|
|
|
|
stepName: "Model Training",
|
|
|
|
|
|
|
|
type: "Training",
|
|
|
|
|
|
|
|
dataset: "processed_data",
|
|
|
|
|
|
|
|
script: "train.py",
|
|
|
|
|
|
|
|
hyperParameters: "lr=0.01, epochs=10",
|
|
|
|
|
|
|
|
resource: "GPU:1, MEM:8Gi",
|
|
|
|
|
|
|
|
status: "warning",
|
|
|
|
|
|
|
|
workflow: "pipeline-a",
|
|
|
|
|
|
|
|
deviceKey: 5,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
no: 4,
|
|
|
|
|
|
|
|
stepName: "Model Evaluation",
|
|
|
|
|
|
|
|
type: "Evaluation",
|
|
|
|
|
|
|
|
dataset: "test_data",
|
|
|
|
|
|
|
|
script: "evaluate.py",
|
|
|
|
|
|
|
|
hyperParameters: "-",
|
|
|
|
|
|
|
|
resource: "CPU:1, MEM:4Gi",
|
|
|
|
|
|
|
|
status: "success",
|
|
|
|
|
|
|
|
workflow: "pipeline-a",
|
|
|
|
|
|
|
|
deviceKey: 4,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
no: 3,
|
|
|
|
|
|
|
|
stepName: "Model Validation",
|
|
|
|
|
|
|
|
type: "Validation",
|
|
|
|
|
|
|
|
dataset: "test_data",
|
|
|
|
|
|
|
|
script: "validate.py",
|
|
|
|
|
|
|
|
hyperParameters: "metrics=['accuracy']",
|
|
|
|
|
|
|
|
resource: "CPU:1, MEM:4Gi",
|
|
|
|
|
|
|
|
status: "success",
|
|
|
|
|
|
|
|
workflow: "pipeline-a",
|
|
|
|
|
|
|
|
deviceKey: 3,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
no: 2,
|
|
|
|
|
|
|
|
stepName: "Package Model",
|
|
|
|
|
|
|
|
type: "Packaging",
|
|
|
|
|
|
|
|
dataset: "trained_model",
|
|
|
|
|
|
|
|
script: "package.py",
|
|
|
|
|
|
|
|
hyperParameters: "format='tar.gz'",
|
|
|
|
|
|
|
|
resource: "CPU:1, MEM:2Gi",
|
|
|
|
|
|
|
|
status: "success",
|
|
|
|
|
|
|
|
workflow: "pipeline-a",
|
|
|
|
|
|
|
|
deviceKey: 2,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
no: 1,
|
|
|
|
|
|
|
|
stepName: "Deploy",
|
|
|
|
|
|
|
|
type: "Deployment",
|
|
|
|
|
|
|
|
dataset: "package",
|
|
|
|
|
|
|
|
script: "deploy.py",
|
|
|
|
|
|
|
|
hyperParameters: "env='prod'",
|
|
|
|
|
|
|
|
resource: "CPU:1, MEM:2Gi",
|
|
|
|
|
|
|
|
status: "success",
|
|
|
|
|
|
|
|
workflow: "pipeline-a",
|
|
|
|
|
|
|
|
deviceKey: 1,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
];
|
|
|
|
|
|
|
|
data.value.totalDataLength = data.value.results.length;
|
|
|
|
|
|
|
|
// 페이지 길이 재계산
|
|
|
|
|
|
|
|
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 setPaginationLength = () => {
|
|
|
|
const { pageNum, pageSize, searchType, searchText } = data.value.params;
|
|
|
|
if (data.value.totalDataLength % data.value.params.pageSize === 0) {
|
|
|
|
|
|
|
|
data.value.pageLength =
|
|
|
|
const mapped = SEARCH_TYPE_MAP[searchType] || "ALL";
|
|
|
|
data.value.totalDataLength / data.value.params.pageSize;
|
|
|
|
const keyword = (searchText || "").trim();
|
|
|
|
} else {
|
|
|
|
const needLocalFilter = mapped !== "ALL" && keyword.length > 0;
|
|
|
|
data.value.pageLength = Math.ceil(
|
|
|
|
|
|
|
|
data.value.totalDataLength / data.value.params.pageSize,
|
|
|
|
let reqPage = data.value.params.pageNum;
|
|
|
|
);
|
|
|
|
let reqSize = data.value.params.pageSize;
|
|
|
|
|
|
|
|
if (needLocalFilter) {
|
|
|
|
|
|
|
|
reqPage = 0;
|
|
|
|
|
|
|
|
reqSize = 1000;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
const payload = {
|
|
|
|
|
|
|
|
projectId,
|
|
|
|
|
|
|
|
page: reqPage,
|
|
|
|
|
|
|
|
size: reqSize,
|
|
|
|
|
|
|
|
keyword,
|
|
|
|
|
|
|
|
searchType: mapped,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WorkflowStepService.search(payload)
|
|
|
|
|
|
|
|
.then((res: any) => {
|
|
|
|
|
|
|
|
if (res.status !== 200) return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const result = res.data;
|
|
|
|
|
|
|
|
let list = result?.content ?? [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (needLocalFilter) {
|
|
|
|
|
|
|
|
const kw = keyword.toLowerCase();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (mapped === "TITLE") {
|
|
|
|
|
|
|
|
list = list.filter((w: any) =>
|
|
|
|
|
|
|
|
String(w?.workflowName ?? "")
|
|
|
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
|
|
|
.includes(kw),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else if (mapped === "AUTHOR") {
|
|
|
|
|
|
|
|
list = list.filter((w: any) =>
|
|
|
|
|
|
|
|
String(w?.regUserId ?? "")
|
|
|
|
|
|
|
|
.toLowerCase()
|
|
|
|
|
|
|
|
.includes(kw),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const uiSize = data.value.params.pageSize;
|
|
|
|
|
|
|
|
const totalElements = list.length;
|
|
|
|
|
|
|
|
const totalPages = Math.max(1, Math.ceil(totalElements / uiSize));
|
|
|
|
|
|
|
|
const safePage = Math.min(Math.max(1, pageNum), totalPages);
|
|
|
|
|
|
|
|
const start = (safePage - 1) * uiSize;
|
|
|
|
|
|
|
|
const pageSlice = list.slice(start, start + uiSize);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 이 페이지의 첫 행 번호(내림차순)
|
|
|
|
|
|
|
|
const firstNo = totalElements - start;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.value.results = pageSlice.map((w: any, i: number) =>
|
|
|
|
|
|
|
|
toRow(w, firstNo - i),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
data.value.totalElements = totalElements;
|
|
|
|
|
|
|
|
data.value.pageLength = totalPages;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const totalElements = result.totalElements;
|
|
|
|
|
|
|
|
const totalPages = result.totalPages;
|
|
|
|
|
|
|
|
const serverPage = result.pageable.pageNumber;
|
|
|
|
|
|
|
|
const serverSize = result.pageable.pageSize;
|
|
|
|
|
|
|
|
const offset =
|
|
|
|
|
|
|
|
typeof result.pageable.offset === "number"
|
|
|
|
|
|
|
|
? result.pageable.offset
|
|
|
|
|
|
|
|
: serverPage * serverSize;
|
|
|
|
|
|
|
|
const firstNo = totalElements - offset;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data.value.results = list.map((w: any, i: number) =>
|
|
|
|
|
|
|
|
toRow(w, firstNo - i),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
data.value.totalElements = totalElements;
|
|
|
|
|
|
|
|
data.value.pageLength = totalPages;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((err: any) => console.error("워크플로우 조회 에러:", err));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const saveData = (formData) => {
|
|
|
|
/** 검색 실행 (페이지 1로 리셋) */
|
|
|
|
if (data.value.modalMode === "create") {
|
|
|
|
const doSearch = () => {
|
|
|
|
// DeviceService.add(formData).then((d) => {
|
|
|
|
data.value.params.pageNum = 1;
|
|
|
|
// if (d.status === 200) {
|
|
|
|
fetchList();
|
|
|
|
// data.value.isModalVisible = false;
|
|
|
|
};
|
|
|
|
// store.setSnackbarMsg({
|
|
|
|
|
|
|
|
// text: "등록 되었습니다.",
|
|
|
|
/** 페이지 이동 */
|
|
|
|
// result: 200,
|
|
|
|
const changePageNum = (page: number) => {
|
|
|
|
// });
|
|
|
|
data.value.params.pageNum = page;
|
|
|
|
// changePageNum(1);
|
|
|
|
fetchList();
|
|
|
|
// } else {
|
|
|
|
};
|
|
|
|
// store.setSnackbarMsg({
|
|
|
|
|
|
|
|
// text: d,
|
|
|
|
/** 페이지 사이즈 변경 */
|
|
|
|
// result: 500,
|
|
|
|
const changePageSize = (size: number) => {
|
|
|
|
// });
|
|
|
|
data.value.params.pageSize = size;
|
|
|
|
// }
|
|
|
|
data.value.params.pageNum = 1;
|
|
|
|
// });
|
|
|
|
fetchList();
|
|
|
|
} else {
|
|
|
|
};
|
|
|
|
// DeviceService.update(formData.deviceKey, formData).then((d) => {
|
|
|
|
|
|
|
|
// if (d.status === 200) {
|
|
|
|
const saveStep = async (payload: WorkflowStep) => {
|
|
|
|
// data.value.isModalVisible = false;
|
|
|
|
try {
|
|
|
|
// store.setSnackbarMsg({
|
|
|
|
const { data: saved } = await WorkflowStepService.add(payload);
|
|
|
|
// text: "수정 되었습니다.",
|
|
|
|
await fetchList();
|
|
|
|
// result: 200,
|
|
|
|
} catch (e) {
|
|
|
|
// });
|
|
|
|
console.error("[STEP SAVE FAIL]", e);
|
|
|
|
// changePageNum();
|
|
|
|
} finally {
|
|
|
|
// } else {
|
|
|
|
data.value.isStepVisible = false;
|
|
|
|
// store.setSnackbarMsg({
|
|
|
|
|
|
|
|
// text: d,
|
|
|
|
|
|
|
|
// result: 500,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const removeData = (value) => {
|
|
|
|
const removeData = (value?: Array<{ deviceKey: number }>) => {
|
|
|
|
let removeList = value ? value : data.value.selected;
|
|
|
|
const removeList = value ?? data.value.selected;
|
|
|
|
const remove = (code) => {
|
|
|
|
if (!removeList || removeList.length === 0) return;
|
|
|
|
// return DeviceService.delete(code).then((d) => {
|
|
|
|
|
|
|
|
// if (d.status !== 200) {
|
|
|
|
|
|
|
|
// store.setSnackbarMsg({
|
|
|
|
|
|
|
|
// text: d,
|
|
|
|
|
|
|
|
// result: 500,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (removeList.length === 1) {
|
|
|
|
const ids = removeList.map((x) => x.deviceKey);
|
|
|
|
remove(removeList[0].deviceKey).then(() => {
|
|
|
|
const removeOne = (id: number) =>
|
|
|
|
// store.setSnackbarMsg({
|
|
|
|
WorkflowStepService.delete(id).then((res) => {
|
|
|
|
// text: "삭제되었습니다.",
|
|
|
|
if (res.status < 200 || res.status >= 300) return Promise.reject(res);
|
|
|
|
// result: 200,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
changePageNum();
|
|
|
|
|
|
|
|
data.value.isConfirmDialogVisible = false;
|
|
|
|
|
|
|
|
data.value.selected = [];
|
|
|
|
|
|
|
|
data.value.allSelected = false;
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const after = () => {
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
|
|
|
ids.length >= data.value.results.length &&
|
|
|
|
|
|
|
|
data.value.params.pageNum > 1
|
|
|
|
|
|
|
|
) {
|
|
|
|
|
|
|
|
data.value.params.pageNum -= 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fetchList();
|
|
|
|
|
|
|
|
data.value.isConfirmDialogVisible = false;
|
|
|
|
|
|
|
|
data.value.selected = [];
|
|
|
|
|
|
|
|
data.value.allSelected = false;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 단건/다건 처리
|
|
|
|
|
|
|
|
if (ids.length === 1) {
|
|
|
|
|
|
|
|
removeOne(ids[0])
|
|
|
|
|
|
|
|
.then(() => {
|
|
|
|
|
|
|
|
store.setSnackbarMsg({
|
|
|
|
|
|
|
|
color: "success",
|
|
|
|
|
|
|
|
text: "삭제되었습니다.",
|
|
|
|
|
|
|
|
result: 200,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
after();
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.catch((err) => {
|
|
|
|
|
|
|
|
console.error("삭제 실패:", err);
|
|
|
|
|
|
|
|
store.setSnackbarMsg({
|
|
|
|
|
|
|
|
color: "warning",
|
|
|
|
|
|
|
|
text: "삭제 실패",
|
|
|
|
|
|
|
|
result: 500,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
Promise.all(removeList.map((item) => remove(item.deviceKey))).finally(
|
|
|
|
Promise.all(ids.map(removeOne))
|
|
|
|
() => {
|
|
|
|
.then(() => {
|
|
|
|
// store.setSnackbarMsg({
|
|
|
|
store.setSnackbarMsg({
|
|
|
|
// text: "모두 삭제되었습니다.",
|
|
|
|
color: "success",
|
|
|
|
// result: 200,
|
|
|
|
text: "모두 삭제되었습니다.",
|
|
|
|
// });
|
|
|
|
result: 200,
|
|
|
|
changePageNum();
|
|
|
|
});
|
|
|
|
data.value.isConfirmDialogVisible = false;
|
|
|
|
})
|
|
|
|
data.value.selected = [];
|
|
|
|
.catch((err) => {
|
|
|
|
data.value.allSelected = false;
|
|
|
|
console.error("일부 삭제 실패:", err);
|
|
|
|
},
|
|
|
|
store.setSnackbarMsg({
|
|
|
|
);
|
|
|
|
color: "warning",
|
|
|
|
|
|
|
|
text: "일부 삭제 실패",
|
|
|
|
|
|
|
|
result: 500,
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
.finally(after);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleRemoveData = () => {
|
|
|
|
const getSelectedAllData = () => {
|
|
|
|
if (data.value.selected.length === 0) {
|
|
|
|
data.value.selected = data.value.allSelected
|
|
|
|
// store.setSnackbarMsg({
|
|
|
|
? data.value.results.map((item: any) => ({ deviceKey: item.deviceKey }))
|
|
|
|
// text: "삭제 할 데이터를 선택해주세요. ",
|
|
|
|
: [];
|
|
|
|
// result: 500,
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (data.value.allSelected || data.value.selected.length !== 1) {
|
|
|
|
|
|
|
|
data.value.isConfirmDialogVisible = true;
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
//리스트로 삭제 할때
|
|
|
|
|
|
|
|
removeData(undefined);
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const closeDetail = () => {
|
|
|
|
const closeDetail = () => {
|
|
|
|
openView.value = false;
|
|
|
|
openView.value = false;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const changePageNum = (page) => {
|
|
|
|
const openDetailModal = (selectedItem: any) => {
|
|
|
|
data.value.params.pageNum = page;
|
|
|
|
|
|
|
|
getData();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const openDetailModal = (selectedItem) => {
|
|
|
|
|
|
|
|
data.value.selectedData = selectedItem;
|
|
|
|
data.value.selectedData = selectedItem;
|
|
|
|
openView.value = true;
|
|
|
|
openView.value = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const handleSave = ({
|
|
|
|
const openCreateModal = () => {
|
|
|
|
workflow,
|
|
|
|
data.value.selectedData = null;
|
|
|
|
stepName,
|
|
|
|
data.value.modalMode = "create";
|
|
|
|
}: {
|
|
|
|
data.value.isStepVisible = true;
|
|
|
|
workflow: string;
|
|
|
|
|
|
|
|
stepName: string;
|
|
|
|
|
|
|
|
}) => {
|
|
|
|
|
|
|
|
if (data.value.selectedData) {
|
|
|
|
|
|
|
|
data.value.selectedData.workflow = workflow;
|
|
|
|
|
|
|
|
data.value.selectedData.stepName = stepName;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
const openModifyModal = (item: { workflow: string; stepName: string }) => {
|
|
|
|
|
|
|
|
|
|
|
|
const openModifyModal = (item: any) => {
|
|
|
|
data.value.selectedData = {
|
|
|
|
data.value.selectedData = {
|
|
|
|
workflow: item.workflow,
|
|
|
|
id: item.deviceKey,
|
|
|
|
stepName: item.stepName,
|
|
|
|
stepName: item.stepName,
|
|
|
|
|
|
|
|
status: item.status,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
openModify.value = true;
|
|
|
|
data.value.modalMode = "edit";
|
|
|
|
};
|
|
|
|
data.value.isStepVisible = true;
|
|
|
|
|
|
|
|
|
|
|
|
const openCreateModal = () => {
|
|
|
|
|
|
|
|
data.value.selectedData = null;
|
|
|
|
|
|
|
|
data.value.modalMode = "create";
|
|
|
|
|
|
|
|
data.value.isModalVisible = true;
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const closeModal = () => {
|
|
|
|
const closeModal = () => {
|
|
|
|
data.value.isModalVisible = false;
|
|
|
|
data.value.isStepVisible = false;
|
|
|
|
data.value.selectedData = null;
|
|
|
|
data.value.selectedData = null;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
const getSelectedAllData = () => {
|
|
|
|
/** 모달 닫히면 목록 새로고침하고 싶으면 아래 watch 사용 */
|
|
|
|
data.value.selected = data.value.allSelected
|
|
|
|
// watch(() => data.value.isStepVisible, (now, prev) => {
|
|
|
|
? data.value.results.map((item) => {
|
|
|
|
// if (prev && !now) fetchList();
|
|
|
|
return {
|
|
|
|
// });
|
|
|
|
deviceKey: item.deviceKey,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
: [];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
onMounted(() => {
|
|
|
|
getData();
|
|
|
|
fetchList();
|
|
|
|
getCodeList();
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
@ -344,6 +319,8 @@ onMounted(() => {
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</v-card-item>
|
|
|
|
</v-card-item>
|
|
|
|
</v-card>
|
|
|
|
</v-card>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 상단 검색 바 (워크플로우 화면과 동일 UX) -->
|
|
|
|
<v-card flat class="bg-shades-transparent w-100">
|
|
|
|
<v-card flat class="bg-shades-transparent w-100">
|
|
|
|
<v-card flat class="bg-shades-transparent mb-4">
|
|
|
|
<v-card flat class="bg-shades-transparent mb-4">
|
|
|
|
<div class="d-flex justify-center flex-wrap align-center">
|
|
|
|
<div class="d-flex justify-center flex-wrap align-center">
|
|
|
|
@ -354,14 +331,16 @@ onMounted(() => {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<v-select
|
|
|
|
<v-select
|
|
|
|
v-model="data.params.searchType"
|
|
|
|
v-model="data.params.searchType"
|
|
|
|
label="검색조건"
|
|
|
|
label="검색유형"
|
|
|
|
density="compact"
|
|
|
|
density="compact"
|
|
|
|
:items="searchOptions"
|
|
|
|
:items="searchOptions"
|
|
|
|
item-title="searchType"
|
|
|
|
item-title="label"
|
|
|
|
item-value="searchText"
|
|
|
|
item-value="value"
|
|
|
|
hide-details
|
|
|
|
hide-details
|
|
|
|
></v-select>
|
|
|
|
@update:model-value="doSearch"
|
|
|
|
|
|
|
|
/>
|
|
|
|
</v-responsive>
|
|
|
|
</v-responsive>
|
|
|
|
|
|
|
|
|
|
|
|
<v-responsive min-width="540" max-width="540">
|
|
|
|
<v-responsive min-width="540" max-width="540">
|
|
|
|
<v-text-field
|
|
|
|
<v-text-field
|
|
|
|
v-model="data.params.searchText"
|
|
|
|
v-model="data.params.searchText"
|
|
|
|
@ -371,8 +350,8 @@ onMounted(() => {
|
|
|
|
required
|
|
|
|
required
|
|
|
|
class="mt-3 mb-3"
|
|
|
|
class="mt-3 mb-3"
|
|
|
|
hide-details
|
|
|
|
hide-details
|
|
|
|
@keyup.enter="changePageNum(1)"
|
|
|
|
@keyup.enter="doSearch"
|
|
|
|
></v-text-field>
|
|
|
|
/>
|
|
|
|
</v-responsive>
|
|
|
|
</v-responsive>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="ml-3">
|
|
|
|
<div class="ml-3">
|
|
|
|
@ -380,14 +359,15 @@ onMounted(() => {
|
|
|
|
size="large"
|
|
|
|
size="large"
|
|
|
|
color="primary"
|
|
|
|
color="primary"
|
|
|
|
:rounded="5"
|
|
|
|
:rounded="5"
|
|
|
|
@click="changePageNum(1)"
|
|
|
|
@click="doSearch"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<v-icon> mdi-magnify</v-icon>
|
|
|
|
<v-icon>mdi-magnify</v-icon>
|
|
|
|
</v-btn>
|
|
|
|
</v-btn>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</v-card>
|
|
|
|
</v-card>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 총 개수 / 페이지사이즈 / 생성 버튼 -->
|
|
|
|
<v-sheet
|
|
|
|
<v-sheet
|
|
|
|
class="bg-shades-transparent d-flex flex-wrap align-center mb-2"
|
|
|
|
class="bg-shades-transparent d-flex flex-wrap align-center mb-2"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
@ -396,9 +376,10 @@ onMounted(() => {
|
|
|
|
class="d-flex align-center mr-3 mb-2 bg-shades-transparent"
|
|
|
|
class="d-flex align-center mr-3 mb-2 bg-shades-transparent"
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<v-chip color="primary"
|
|
|
|
<v-chip color="primary"
|
|
|
|
>총 {{ data.totalDataLength.toLocaleString() }}개
|
|
|
|
>총 {{ data.totalElements.toLocaleString() }}개</v-chip
|
|
|
|
</v-chip>
|
|
|
|
>
|
|
|
|
</v-sheet>
|
|
|
|
</v-sheet>
|
|
|
|
|
|
|
|
|
|
|
|
<v-sheet class="bg-shades-transparent">
|
|
|
|
<v-sheet class="bg-shades-transparent">
|
|
|
|
<v-responsive max-width="140" min-width="140" class="mb-2">
|
|
|
|
<v-responsive max-width="140" min-width="140" class="mb-2">
|
|
|
|
<v-select
|
|
|
|
<v-select
|
|
|
|
@ -410,13 +391,20 @@ onMounted(() => {
|
|
|
|
variant="outlined"
|
|
|
|
variant="outlined"
|
|
|
|
color="primary"
|
|
|
|
color="primary"
|
|
|
|
hide-details
|
|
|
|
hide-details
|
|
|
|
@update:model-value="changePageNum(1)"
|
|
|
|
@update:model-value="changePageSize"
|
|
|
|
></v-select>
|
|
|
|
/>
|
|
|
|
</v-responsive>
|
|
|
|
</v-responsive>
|
|
|
|
</v-sheet>
|
|
|
|
</v-sheet>
|
|
|
|
</v-sheet>
|
|
|
|
</v-sheet>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<v-sheet class="justify-end mb-2">
|
|
|
|
|
|
|
|
<v-btn color="info" @click="openCreateModal"
|
|
|
|
|
|
|
|
>Create Workflow Step</v-btn
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
</v-sheet>
|
|
|
|
</v-sheet>
|
|
|
|
</v-sheet>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 테이블 -->
|
|
|
|
<v-card class="rounded-lg pa-8">
|
|
|
|
<v-card class="rounded-lg pa-8">
|
|
|
|
<v-col cols="12">
|
|
|
|
<v-col cols="12">
|
|
|
|
<v-sheet>
|
|
|
|
<v-sheet>
|
|
|
|
@ -436,6 +424,7 @@ onMounted(() => {
|
|
|
|
:style="`width:${item.width}`"
|
|
|
|
:style="`width:${item.width}`"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</colgroup>
|
|
|
|
</colgroup>
|
|
|
|
|
|
|
|
|
|
|
|
<thead>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<tr>
|
|
|
|
<th>
|
|
|
|
<th>
|
|
|
|
@ -445,7 +434,7 @@ onMounted(() => {
|
|
|
|
:indeterminate="data.allSelected === true"
|
|
|
|
:indeterminate="data.allSelected === true"
|
|
|
|
hide-details
|
|
|
|
hide-details
|
|
|
|
@change="getSelectedAllData"
|
|
|
|
@change="getSelectedAllData"
|
|
|
|
></v-checkbox>
|
|
|
|
/>
|
|
|
|
</th>
|
|
|
|
</th>
|
|
|
|
<th
|
|
|
|
<th
|
|
|
|
v-for="(item, i) in tableHeader"
|
|
|
|
v-for="(item, i) in tableHeader"
|
|
|
|
@ -457,6 +446,7 @@ onMounted(() => {
|
|
|
|
</th>
|
|
|
|
</th>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</thead>
|
|
|
|
|
|
|
|
|
|
|
|
<tbody class="text-body-2">
|
|
|
|
<tbody class="text-body-2">
|
|
|
|
<tr
|
|
|
|
<tr
|
|
|
|
v-for="item in data.results"
|
|
|
|
v-for="item in data.results"
|
|
|
|
@ -485,16 +475,12 @@ onMounted(() => {
|
|
|
|
>
|
|
|
|
>
|
|
|
|
mdi-checkbox-marked-circle
|
|
|
|
mdi-checkbox-marked-circle
|
|
|
|
</v-icon>
|
|
|
|
</v-icon>
|
|
|
|
<v-icon v-else color="warning">
|
|
|
|
<v-icon v-else color="warning">mdi-alert-circle</v-icon>
|
|
|
|
mdi-alert-circle
|
|
|
|
|
|
|
|
</v-icon>
|
|
|
|
|
|
|
|
</td>
|
|
|
|
</td>
|
|
|
|
<td>{{ item.workflow }}</td>
|
|
|
|
<td>{{ item.workflow }}</td>
|
|
|
|
<td style="white-space: nowrap">
|
|
|
|
<td style="white-space: nowrap">
|
|
|
|
<IconInfoBtn @on-click="openDetailModal(item)" />
|
|
|
|
<IconInfoBtn @on-click="openDetailModal(item)" />
|
|
|
|
<IconModifyBtn @on-click="openModifyModal(item)" />
|
|
|
|
<IconModifyBtn @on-click="openModifyModal(item)" />
|
|
|
|
|
|
|
|
|
|
|
|
<!-- <IconModifyBtn @on-click="openModify = true" /> -->
|
|
|
|
|
|
|
|
<IconDeleteBtn
|
|
|
|
<IconDeleteBtn
|
|
|
|
@on-click="
|
|
|
|
@on-click="
|
|
|
|
removeData([{ deviceKey: item.deviceKey }])
|
|
|
|
removeData([{ deviceKey: item.deviceKey }])
|
|
|
|
@ -505,6 +491,8 @@ onMounted(() => {
|
|
|
|
</tbody>
|
|
|
|
</tbody>
|
|
|
|
</v-table>
|
|
|
|
</v-table>
|
|
|
|
</v-sheet>
|
|
|
|
</v-sheet>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 페이지네이션 -->
|
|
|
|
<v-card-actions class="text-center mt-8 justify-center">
|
|
|
|
<v-card-actions class="text-center mt-8 justify-center">
|
|
|
|
<v-pagination
|
|
|
|
<v-pagination
|
|
|
|
v-model="data.params.pageNum"
|
|
|
|
v-model="data.params.pageNum"
|
|
|
|
@ -512,8 +500,8 @@ onMounted(() => {
|
|
|
|
:total-visible="10"
|
|
|
|
:total-visible="10"
|
|
|
|
color="primary"
|
|
|
|
color="primary"
|
|
|
|
rounded="circle"
|
|
|
|
rounded="circle"
|
|
|
|
@update:model-value="getData"
|
|
|
|
@update:model-value="changePageNum"
|
|
|
|
></v-pagination>
|
|
|
|
/>
|
|
|
|
</v-card-actions>
|
|
|
|
</v-card-actions>
|
|
|
|
</v-col>
|
|
|
|
</v-col>
|
|
|
|
</v-card>
|
|
|
|
</v-card>
|
|
|
|
@ -521,15 +509,19 @@ onMounted(() => {
|
|
|
|
</v-card>
|
|
|
|
</v-card>
|
|
|
|
</v-container>
|
|
|
|
</v-container>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 상세 보기 -->
|
|
|
|
<div class="w-100" v-else>
|
|
|
|
<div class="w-100" v-else>
|
|
|
|
<ViewComponent @close="closeDetail" />
|
|
|
|
<ViewComponent @close="closeDetail" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<v-dialog v-model="openModify" max-width="600px">
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 생성/수정 모달 -->
|
|
|
|
|
|
|
|
<v-dialog v-model="data.isStepVisible" max-width="760" persistent>
|
|
|
|
<StapComfigDialog
|
|
|
|
<StapComfigDialog
|
|
|
|
v-model="openModify"
|
|
|
|
:editData="data.selectedData"
|
|
|
|
:selectedData="data.selectedData"
|
|
|
|
:mode="data.modalMode"
|
|
|
|
:workflowList="workflowList"
|
|
|
|
@saved="saveStep"
|
|
|
|
@save="handleSave"
|
|
|
|
@close-modal="closeModal"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</v-dialog>
|
|
|
|
</v-dialog>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|