From a3051c0ea47944f9a1c37e5a3f63b5e17ad324d3 Mon Sep 17 00:00:00 2001 From: GYYM <704080176@qq.com> Date: Thu, 14 Nov 2024 18:40:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/.env.development | 2 +- frontend/src/api/plan/autoTest.json | 2 +- .../views/plan/autoTest/components/tree.vue | 14 +- frontend/src/views/plan/autoTest/index.vue | 154 +++++++++++++----- .../views/plan/planList/components/temp.vue | 14 +- frontend/src/views/plan/planList/index.vue | 16 +- 6 files changed, 146 insertions(+), 56 deletions(-) diff --git a/frontend/.env.development b/frontend/.env.development index 282bdb3..0e60d61 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -19,6 +19,6 @@ VITE_API_URL=/api # 开发环境跨域代理,支持配置多个 -VITE_PROXY=[["/api","http://192.168.1.124:18092/"]] +VITE_PROXY=[["/api","http://192.168.1.125:18092/"]] # VITE_PROXY=[["/api","http://192.168.1.125:18092/"]] # VITE_PROXY=[["/api","http://192.168.1.138:8080/"]]张文 diff --git a/frontend/src/api/plan/autoTest.json b/frontend/src/api/plan/autoTest.json index 1e087f3..b78f124 100644 --- a/frontend/src/api/plan/autoTest.json +++ b/frontend/src/api/plan/autoTest.json @@ -224,4 +224,4 @@ ] } ] -} \ No newline at end of file + } \ No newline at end of file diff --git a/frontend/src/views/plan/autoTest/components/tree.vue b/frontend/src/views/plan/autoTest/components/tree.vue index bf4a531..c59eec3 100644 --- a/frontend/src/views/plan/autoTest/components/tree.vue +++ b/frontend/src/views/plan/autoTest/components/tree.vue @@ -14,7 +14,6 @@ :props="defaultProps" node-key="id" default-expand-all - show-checkbox :default-checked-keys="defaultChecked" @node-click="handleNodeClick" @check-change="changeSelect" @@ -25,7 +24,9 @@ class="custom-tree-node" style="display: flex; align-items: center" > + + {{ node.label }} @@ -52,7 +53,16 @@ const treeList: any = ref([]); const getTreeData = (val: any) => { defaultChecked.value = []; data.value = val; - defaultChecked.value.push(data.value[0].children[0].children[0].id); + + if(data.value[0].children[0].hasOwnProperty("children")) + { + defaultChecked.value.push(data.value[0].children[0].children[0].id); + } + else + { + defaultChecked.value.push(data.value[0].children[0].id); + } + treeRef.value.setCurrentKey(defaultChecked.value); }; const filterText = ref(""); diff --git a/frontend/src/views/plan/autoTest/index.vue b/frontend/src/views/plan/autoTest/index.vue index 355f300..6fc3e9f 100644 --- a/frontend/src/views/plan/autoTest/index.vue +++ b/frontend/src/views/plan/autoTest/index.vue @@ -5,6 +5,7 @@
+ 返回首页 + + + + + + + 重新计算
@@ -124,21 +136,6 @@
- - - - - - -
@@ -160,7 +157,6 @@ import { ref, onMounted, reactive, nextTick } from "vue"; import Tree from "./components/tree.vue"; import { data } from "@/api/plan/autoTest.json"; -import ProTable from "@/components/ProTable/index.vue"; import { useTransition } from "@vueuse/core"; import { getPlanList } from "@/api/plan/planList"; import { ElMessage, ElMessageBox } from "element-plus"; @@ -179,6 +175,10 @@ import { Close, VideoPause, } from "@element-plus/icons-vue"; +import {dictPattern,dictTestState,dictReportState,dictResult,testPlanDataList,testSoureDataList,testScriptDataList,testErrSystDataList,planData,testFatherPlanList} from '@/api/plan/planData' +import { useRouter } from 'vue-router' +const router = useRouter() +const currentErrSysID = ref("2") const treeRef = ref(); const PopupVisible = ref(false) const showDataPopup = ref() @@ -262,7 +262,58 @@ const initLeftDeviceData = () => { // handlePrintText(item.name, index); }); }; -// 点击数据结果 + +const preTestData = [ + { + "id": 0, + "name": "预检测项目", + "children": [ + { + "scriptIdx":1, + "isChildNode":true, + "pid": "0-2", + "id": "0-2-2", + "name": "标准源通讯检测" + }, + { + "scriptIdx":2, + "isChildNode":true, + "pid": "0-3", + "id": "0-3-1", + "name": "设备通讯检测" + }, + { + "scriptIdx":3, + "isChildNode":true, + "pid": "0-3", + "id": "0-3-1", + "name": "协议校验" + }, + { + "scriptIdx":4, + "isChildNode":true, + "pid": "0-3", + "id": "0-3-1", + "name": "相序校验" + }, + { + "scriptIdx":5, + "isChildNode":true, + "pid": "0-3", + "id": "0-3-1", + "name": "守时校验" + }, + { + "scriptIdx":6, + "isChildNode":true, + "pid": "0-3", + "id": "0-3-1", + "name": "通道系数校准" + } + ] + } + ] +// 弹出检测结果页面 const handleClick = (item,index,vvs) => { //const data = "检测脚本为:"+item.name+";被检设备为:"+item.children.value.devID+";被检通道序号为:"+ item.children.monitorIndex; console.log(vvs,index,item.name,item.children) @@ -272,38 +323,41 @@ const handleClick = (item,index,vvs) => { //启动预检测 const handlePreTest = () => { ElMessage.success("启动预检测"); - let count = 0; - if (timer) { - clearInterval(timer); - count = 0; - leftDeviceData.value = []; - } - if (count == 5) { - count = 0; - } else { - timer = setInterval(async () => { - count++; - if (count > 15) return; - await nextTick(() => { - leftDeviceData.value.push({ - id: count, - name: "设备" + count + "预检测", - status: count % 2 == 0 ? 0 : 1, - }); - }); - }, 2000); - } + getTreeData(preTestData) + + // let count = 0; + // if (timer) { + // clearInterval(timer); + // count = 0; + // leftDeviceData.value = []; + // } + // if (count == 5) { + // count = 0; + // } + // else { + // timer = setInterval(async () => { + // count++; + // if (count > 15) return; + // await nextTick(() => { + // leftDeviceData.value.push({ + // id: count, + // name: "设备" + count + "预检测", + // status: count % 2 == 0 ? 0 : 1, + // }); + // }); + // }, 2000); + // } }; //进入检测流程 const handleAutoTest = () => { - router.push({ - path: "/plan/autoTest", - }); + ElMessage.success("启动正式检测"); + + getTreeData(data) }; //返回设备列表 const handleBackDeviceList = () => { router.push({ - path: "/plan/home/index", + path: "/home/index", }); }; @@ -430,9 +484,12 @@ const columns = reactive[]>([ }, // { prop: "operation", label: "操作", fixed: "right", width: 250 }, ]); -const getTreeData = () => { - treeRef.value && treeRef.value.getTreeData(data); + + +const getTreeData = (val) => { + treeRef.value && treeRef.value.getTreeData(val); }; + // ProTable 实例 const proTable = ref(); @@ -616,8 +673,9 @@ const getStatusList = () => { statusRef.value.scrollTop = statusRef.value.scrollHeight; }); }; + onMounted(() => { - getTreeData(); + });