From f74fedc213f001e34dc745c1e257a0277850302b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=BE=E5=90=8C=E5=AD=A6?= Date: Thu, 25 Sep 2025 11:16:57 +0800 Subject: [PATCH] =?UTF-8?q?UPDATE:=20=E4=BC=98=E5=8C=96=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/device/interface/standardDevice.ts | 3 ++- frontend/src/components/ImportZip/index.vue | 4 ++-- frontend/src/views/home/components/tree.vue | 1 - .../plan/planList/components/childrenPlan.vue | 13 ++++------- .../plan/planList/components/devSelect.vue | 8 +++---- .../plan/planList/components/planPopup.vue | 23 +++++++++++-------- frontend/src/views/plan/planList/index.vue | 6 ++--- 7 files changed, 28 insertions(+), 30 deletions(-) diff --git a/frontend/src/api/device/interface/standardDevice.ts b/frontend/src/api/device/interface/standardDevice.ts index 4a345d9..9b50c01 100644 --- a/frontend/src/api/device/interface/standardDevice.ts +++ b/frontend/src/api/device/interface/standardDevice.ts @@ -1,4 +1,4 @@ -import type {ReqPage, ResPage} from '@/api/interface' +import type { ReqPage, ResPage } from '@/api/interface' // 标准设备模块 export namespace StandardDevice { @@ -34,6 +34,7 @@ export namespace StandardDevice { createTime?: string | null; //创建时间 updateBy?: string | null; //更新用户 updateTime?: string | null; //更新时间 + disabled?: boolean; } diff --git a/frontend/src/components/ImportZip/index.vue b/frontend/src/components/ImportZip/index.vue index 80dcec2..7a8e5de 100644 --- a/frontend/src/components/ImportZip/index.vue +++ b/frontend/src/components/ImportZip/index.vue @@ -115,8 +115,8 @@ const handleImportResponse = (res: any) => { if (!parameter.value.progressBar) { if (res.code === 'A0000') { ElMessage.success('导入成功') + emit('result', true) dialogVisible.value = false - emit('result', res.data) } else { ElMessage.error(res.message) fileDisabled.value = false @@ -195,8 +195,8 @@ const initSSE = () => { progressData.value.status = 'success' eventSource.value!.close() ElMessage.success('导入成功') - dialogVisible.value = false emit('result', true) + dialogVisible.value = false } } diff --git a/frontend/src/views/home/components/tree.vue b/frontend/src/views/home/components/tree.vue index 0902670..622df27 100644 --- a/frontend/src/views/home/components/tree.vue +++ b/frontend/src/views/home/components/tree.vue @@ -53,7 +53,6 @@ content="子计划信息" > 新增子计划 - + 编辑子计划 []>([ fixed: 'right', render: (scope: { row: { checkState: number } }) => { return scope.row.checkState === 0 ? ( - + 未检 ) : scope.row.checkState === 1 ? ( - + 检测中 ) : ( @@ -478,6 +472,7 @@ const addTab = (type: string) => { //收到子组件回复后新增子计划tab const addNewChildTab = async () => { await props.refreshTable!() //刷新检测计划列表 + proTable.value?.getTableList() // 刷新当前设备列表 renderTabs() } diff --git a/frontend/src/views/plan/planList/components/devSelect.vue b/frontend/src/views/plan/planList/components/devSelect.vue index e08edd3..d4e6765 100644 --- a/frontend/src/views/plan/planList/components/devSelect.vue +++ b/frontend/src/views/plan/planList/components/devSelect.vue @@ -412,13 +412,13 @@ const convertToTree = (data: Device[], groupBy?: string | undefined) => { const groupNode: Tree = { id: `${groupBy}_${groupName}`, label: groupName, - disabled: props.disabled, children: (items as any[]).map((item: any) => ({ + ...item, label: item.name, children: [], - disabled: item.disabled ? item.disabled : props.disabled, - ...item - })) + disabled: item.disabled ? item.disabled : props.disabled + })), + disabled: props.disabled } treeData.push(groupNode) }) diff --git a/frontend/src/views/plan/planList/components/planPopup.vue b/frontend/src/views/plan/planList/components/planPopup.vue index 2db6774..6a6cb0b 100644 --- a/frontend/src/views/plan/planList/components/planPopup.vue +++ b/frontend/src/views/plan/planList/components/planPopup.vue @@ -13,6 +13,7 @@ @@ -83,7 +84,7 @@ { } } i.checked = boundPqDevIds.includes(i.id) - if (i.assign) { - i.disabled = i.checkState != 0 || i.assign == 1 || allDisabled.value - } else { - i.disabled = allDisabled.value + i.disabled = i.checkState != 0 + if (allDisabled.value) { + i.disabled = true } }) // 排序逻辑 @@ -1117,14 +1117,16 @@ function pqToArray() { if (planType.value === 0) { pqStandardDevArray.value = sourceArray5.map(item => ({ label: item.name, - value: item.id + value: item.id, + disabled: item.disabled || false })) } else if (planType.value === 1) { pqStandardDevArray.value = sourceArray5 .filter(item => formContent.standardDevIds.includes(item.id)) .map(item => ({ label: item.name, - value: item.id + value: item.id, + disabled: item.disabled || false })) formContent.standardDevIds = [] formContent.standardDevMap = new Map() @@ -1134,7 +1136,8 @@ function pqToArray() { const boundStandardDevAllList = Array.isArray(result.data) ? result.data : [] pqStandardDevArray.value = boundStandardDevAllList.map(item => ({ label: item.name, - value: item.id + value: item.id, + disabled: item.disabled || false })) }) } diff --git a/frontend/src/views/plan/planList/index.vue b/frontend/src/views/plan/planList/index.vue index 6edeb53..79d5f37 100644 --- a/frontend/src/views/plan/planList/index.vue +++ b/frontend/src/views/plan/planList/index.vue @@ -41,7 +41,7 @@ @@ -342,11 +342,11 @@ const columns = reactive[]>([ fieldNames: { label: 'label', value: 'id' }, render: scope => { return scope.row.testState === 0 ? ( - + 未检 ) : scope.row.testState === 1 ? ( - + 检测中 ) : (