From 8f89252d8b6fcae0bf4a7685eede36a8b128acb1 Mon Sep 17 00:00:00 2001 From: GYYM <704080176@qq.com> Date: Thu, 14 Nov 2024 11:45:25 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A3=80=E6=B5=8B=E9=A6=96?= =?UTF-8?q?=E9=A1=B5=E5=B8=83=E5=B1=80=EF=BC=9B=E6=A0=B9=E6=8D=AE=E4=B8=8D?= =?UTF-8?q?=E5=90=8C=E7=9A=84=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E7=9A=84=E8=A1=A8=E6=A0=BC=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/plan/planData.ts | 4 +- frontend/src/views/home/components/table.vue | 74 ++++++++++++++++--- frontend/src/views/home/tabs/dashboard.vue | 13 +++- .../views/plan/planList/components/temp.vue | 47 ++++++++++-- frontend/src/views/plan/planList/index.vue | 34 ++++++--- 5 files changed, 136 insertions(+), 36 deletions(-) diff --git a/frontend/src/api/plan/planData.ts b/frontend/src/api/plan/planData.ts index 7d11bd8..50b5caf 100644 --- a/frontend/src/api/plan/planData.ts +++ b/frontend/src/api/plan/planData.ts @@ -184,7 +184,7 @@ const planData = ref([ 'id': '2', 'name': '检测计划2', 'pattern':'1', - "testSourceName":'高精度设备-PQV520-1,高精度设备-PQV520-2', + "testSourceName":'高精度设备-PQV520-1', 'father_Plan_Id':'1', 'dataSource_Id':'2', 'script_Id':'2', @@ -193,7 +193,7 @@ const planData = ref([ 'report_State':'2', 'result':'0', "testSourceList":[ - '高精度设备-PQV520-1','高精度设备-PQV520-2', + '高精度设备-PQV520-2','高精度设备-PQV520-3','高精度设备-PQV520-3' ] }, { diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 0321b91..a552162 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -71,11 +71,11 @@ > 报告批量生成批量生成 设备批量归档批量归档 @@ -86,9 +86,40 @@ type="primary" link :icon="View" - @click="openDrawer('报告查看', scope.row)" + @click="openDrawer('查看', scope.row)" + v-if="form.activeTabs === 3 && form.activeChildTabs === 0" + >查看 +
+ + +
查看...
+
+ +
+
+ + 报告查看生成 + 归档 { proTable.value?.getTableList(); }; //顶部功能切换时修改activeTabs -const changeActiveTabs = (val: number) => { +const changeActiveTabs = (val: number,val2: number) => { form.value.activeTabs = val; + form.value.activeChildTabs= val2; tableHeaderInit(val) - console.log(form,val,666) + console.log(form,val,val2,666) }; //根据当前功能,初始化表头下拉框中的默认值和禁用值 @@ -600,7 +633,7 @@ function tableHeaderInit(val: number) { disableCheckStatus("归档") disableCheckReportStatus("未生成报告") disablecheckResultList("未出结果") - operationShow.value = false; + operationShow.value = true; break; case 5://设备浏览 operationShow.value = true; @@ -663,14 +696,35 @@ const handleTest = () => { } }; + // 打开 drawer(新增、查看、编辑) const openDrawer = (title: string, row: any) => { - if (title === '报告查看') - console.log(title); + if (title === '查看') + { + console.log(title); + const link = document.createElement('a'); + const fileUrl = 'G:/南网数研院非结构化数据生成程序MMS_JSON修改记录.docx'; // 文件路径 + link.href = fileUrl; + link.target = '_blank'; // 在新标签页中打开 + link.download = 'file.docx'; // 设置下载文件的名称 + link.click(); + } else if (title === '误差体系编辑') console.log(title); + if (title === '归档') + { + const loading = ElLoading.service({ + lock: true, + text: '归档中...', + background: 'rgba(0, 0, 0, 0.7)', + }) + setTimeout(() => { + loading.close() + ElMessage.success("归档成功"); + }, 2000) + } } onMounted(() => { diff --git a/frontend/src/views/home/tabs/dashboard.vue b/frontend/src/views/home/tabs/dashboard.vue index 6b8fdc6..befa365 100644 --- a/frontend/src/views/home/tabs/dashboard.vue +++ b/frontend/src/views/home/tabs/dashboard.vue @@ -112,7 +112,8 @@ import Table from "../components/table.vue"; import { data } from "@/api/plan/static.json"; const treeRef = ref(); const form: any = ref({ - activeTabs: 0, //功能选择 + activeTabs: 0, //功能选择,例如报告生成 + activeChildTabs: 0,//子功能选择,例如未检设备报告生成,或已检设备更换误差体系生成 checkStatus: 0, //检测状态 checkReportStatus: 0, //检测报告状态 checkResult: 0, //检测结果 @@ -132,6 +133,7 @@ const handleChange = (val: string[]) => { const handleTabsChange = (val) => { form.value.activeTabs = 0; form.value.activeTabs = 3; + form.value.activeChildTabs = Number(val); console.log(val) } localStorage.setItem("color", "red"); @@ -207,7 +209,7 @@ watch( () => form.value, (val, oldVal) => { if (val) { - tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs); + tableRef1.value && tableRef1.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs); } }, { @@ -219,7 +221,8 @@ watch( () => form.value, (val, oldVal) => { if (val) { - tableRef2.value && tableRef2.value.changeActiveTabs(form.value.activeTabs); + tableRef2.value && tableRef2.value.changeActiveTabs(form.value.activeTabs,form.value.activeChildTabs); + console.log(form.value.activeTabs,form.value.activeChildTabs); } }, { @@ -281,6 +284,7 @@ const planDetail = () => { const handleCheckFunction = (val: any) => { console.log("test",val); editableTabsValue.value = '0'; + form.value.activeChildTabs = 0; tabsList.value.map((item: any, index: any) => { if (val == item.value) { item.checked = true; @@ -293,7 +297,7 @@ const handleCheckFunction = (val: any) => { switch (val) { case 0://自动检测 - tabLabel1.value = "自动检测"; + tabLabel1.value = "设备检测"; break; case 1://手动检测 tabLabel1.value = "手动检测"; @@ -398,6 +402,7 @@ onMounted(() => { .item_text { p { + width: 40px; margin: 0; font-weight: 800; color: var(--el-color-primary); diff --git a/frontend/src/views/plan/planList/components/temp.vue b/frontend/src/views/plan/planList/components/temp.vue index 9bbec88..6c93399 100644 --- a/frontend/src/views/plan/planList/components/temp.vue +++ b/frontend/src/views/plan/planList/components/temp.vue @@ -1,24 +1,55 @@ + + + + + +