From e4025e39cb6ab11798aa61f23cd3b1c7cc3c067a Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Wed, 25 Dec 2024 13:22:54 +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/src/api/check/interface/index.ts | 2 +- frontend/src/api/plan/autoTest.json | 407 ++++++++---------- .../dataCheckSingleChannelSingleTestPopup.vue | 135 +++--- frontend/src/views/home/components/test.vue | 2 +- .../dictTree/components/treePopup.vue | 2 +- 5 files changed, 277 insertions(+), 271 deletions(-) diff --git a/frontend/src/api/check/interface/index.ts b/frontend/src/api/check/interface/index.ts index 02fa7ce..8890c11 100644 --- a/frontend/src/api/check/interface/index.ts +++ b/frontend/src/api/check/interface/index.ts @@ -1,6 +1,6 @@ export namespace CheckData { export interface DataCheck { - testScriptName: string, + scriptName: string, errorSysName: string, dataRule: string, deviceName: string, diff --git a/frontend/src/api/plan/autoTest.json b/frontend/src/api/plan/autoTest.json index 7812c02..b5702b3 100644 --- a/frontend/src/api/plan/autoTest.json +++ b/frontend/src/api/plan/autoTest.json @@ -1,227 +1,194 @@ { - "code": "A0000", - "data": [ + "code": "A0000", + "data": [ + { + "id": "1", + "pid": "0", + "name": "频率准确度检测", + "children": [ { - "id": "0", - "name": "频率准确度检测", - "children": [ - { - "pid": 0, - "id": "0-1", - "name": "额定工作条件下的检测", - "children": [ - { - "scriptIdx":1, - "isChildNode":true, - "pid": "0-1", - "id": "0-1-1", - "name": "输入:频率 42.5Hz..." - }, - { - "scriptIdx":2, - "isChildNode":true, - "pid": "0-1", - "id": "0-1-2", - "name": "输入:频率 50.0Hz..." - }, - { - "scriptIdx":3, - "isChildNode":true, - "pid": "0-1", - "id": "0-1-3", - "name": "输入:频率 50.05Hz...." - } - ] - }, - { - "pid": 0, - "id": "0-2", - "name": "电压对频率测量的影响", - "children": [ - { - "scriptIdx":4, - "isChildNode":true, - "pid": "0-2", - "id": "0-2-1", - "name": "输入:频率 50.05Hz Ua =10%Un..." - }, - { - "scriptIdx":5, - "isChildNode":true, - "pid": "0-2", - "id": "0-2-1", - "name": "输入:频率 51.05Hz Ua =10%Un..." - }, - { - "scriptIdx":6, - "isChildNode":true, - "pid": "0-2", - "id": "0-2-2", - "name": "输入:频率 52.05Hz Ua =10%Un..." - } - ] - }, - { - "pid": 0, - "id": "0-3", - "name": "谐波对频率测量的影响", - "children": [ - { - "scriptIdx":7, - "isChildNode":true, - "pid": "0-3", - "id": "0-3-1", - "name": "输入:频率 50.05Hz Ua =100%Un..." - } - ] - } - ] + "id": "1-1", + "pid": "1", + "name": "额定工作条件下的检测", + "children": [ + { + "id": "1-1-1", + "pid": "1-1", + "name": "输入:频率 42.5Hz..." + }, + { + "id": "1-1-2", + "pid": "1-1", + "name": "输入:频率 50.0Hz..." + }, + { + "id": "1-1-3", + "pid": "1-1", + "name": "输入:频率 50.05Hz...." + } + ] }, { - "id": "1", - "name": "电压准确度检测", - "children": [ - { - "pid": 1, - "id": "1-1", - "name": "额定工作条件下的检测", - "children": [ - { - "scriptIdx":8, - "isChildNode":true, - "pid": "1-1", - "id": "1-1-1", - "name": "输入:频率 42.5Hz..." - }, - { - "scriptIdx":9, - "isChildNode":true, - "pid": "1-1", - "id": "1-1-2", - "name": "输入:频率 50.0Hz..." - }, - { - "scriptIdx":10, - "isChildNode":true, - "pid": "1-1", - "id": "1-1-3", - "name": "输入:频率 50.05Hz..." - } - ] - }, - { - "pid": 0, - "id": "1-2", - "name": "电压对频率测量的影响", - "children": [ - { - "scriptIdx":11, - "isChildNode":true, - "pid": "1-2", - "id": "1-2-1", - "name": "输入:频率 50.05Hz Ua =10%Un..." - }, - { - "scriptIdx":12, - "isChildNode":true, - "pid": "1-2", - "id": "1-2-1", - "name": "输入:频率 51.05Hz Ua =10%Un..." - }, - { - "scriptIdx":13, - "isChildNode":true, - "pid": "1-2", - "id": "1-2-2", - "name": "输入:频率 52.05Hz Ua =10%Un..." - } - ] - }, - { - "pid": 0, - "id": "0-3", - "name": "谐波对频率测量的影响", - "children": [ - { - "scriptIdx":14, - "isChildNode":true, - "pid": "0-3", - "id": "0-3-1", - "name": "输入:频率 50.05Hz Ua =100%Un..." - } - ] - } - ] + "id": "1-2", + "pid": "1", + "name": "电压对频率测量的影响", + "children": [ + { + "id": "1-2-1", + "pid": "1-2", + "name": "输入:频率 50.05Hz Ua =10%Un..." + }, + { + "id": "1-2-1", + "pid": "1-2", + "name": "输入:频率 51.05Hz Ua =10%Un..." + }, + { + "id": "1-2-2", + "pid": "1-2", + "name": "输入:频率 52.05Hz Ua =10%Un..." + } + ] }, - { - "id": "2", - "name": "谐波准确度检测", - "children": [ - { - "pid": 2, - "id": "2-1", - "name": "额定工作条件下的检测", - "children": [ - { - "scriptIdx":15, - "pid": "2-1", - "id": "2-1-1", - "name": "输入:频率 42.5Hz..." - }, - { - "scriptIdx":16, - "pid": "2-1", - "id": "2-1-2", - "name": "输入:频率 50.0Hz..." - }, - { - "scriptIdx":17, - "pid": "2-1", - "id": "2-1-3", - "name": "输入:频率 50.05Hz..." - } - ] - }, - { - "pid": 2, - "id": "2-2", - "name": "电压对频率测量的影响", - "children": [ - { - "scriptIdx":18, - "pid": "2-2", - "id": "2-2-1", - "name": "输入:频率 50.05Hz Ua =10%Un..." - }, - { - "scriptIdx":19, - "pid": "2-2", - "id": "2-2-1", - "name": "输入:频率 51.05Hz Ua =10%Un..." - }, - { - "scriptIdx":20, - "pid": "2-2", - "id": "2-2-2", - "name": "输入:频率 52.05Hz Ua =10%Un..." - } - ] - }, - { - "pid": 2, - "id": "2-3", - "name": "谐波对频率测量的影响", - "children": [ - { - "scriptIdx":21, - "pid": "2-3", - "id": "2-3-1", - "name": "输入:频率 50.05Hz Ua =100%Un..." - } - ] - } - ] + "id": "1-3", + "pid": "1", + "name": "谐波对频率测量的影响", + "children": [ + { + "id": "1-3-1", + "pid": "1-3", + "name": "输入:频率 50.05Hz Ua =100%Un..." + } + ] } - ] - } \ No newline at end of file + ] + }, + { + "id": "2", + "pid": "0", + "name": "电压准确度检测", + "children": [ + { + "pid": "2", + "id": "2-1", + "name": "额定工作条件下的检测", + "children": [ + { + "id": "2-1-1", + "pid": "2-1", + "name": "输入:频率 42.5Hz..." + }, + { + "id": "2-1-2", + "pid": "2-1", + "name": "输入:频率 50.0Hz..." + }, + { + "id": "2-1-3", + "pid": "2-1", + "name": "输入:频率 50.05Hz..." + } + ] + }, + { + "pid": "2", + "id": "2-2", + "name": "电压对频率测量的影响", + "children": [ + { + "id": "2-2-1", + "pid": "2-2", + "name": "输入:频率 50.05Hz Ua =10%Un..." + }, + { + "id": "2-2-1", + "pid": "2-2", + "name": "输入:频率 51.05Hz Ua =10%Un..." + }, + { + "id": "2-2-2", + "pid": "2-2", + "name": "输入:频率 52.05Hz Ua =10%Un..." + } + ] + }, + { + "pid": "2", + "id": "2-3", + "name": "谐波对频率测量的影响", + "children": [ + { + "id": "2-3-1", + "pid": "2-3", + "name": "输入:频率 50.05Hz Ua =100%Un..." + } + ] + } + ] + }, + { + "id": "3", + "pid": "0", + "name": "谐波准确度检测", + "children": [ + { + "id": "3-1", + "pid": "3", + "name": "额定工作条件下的检测", + "children": [ + { + "id": "3-1-1", + "pid": "3-1", + "name": "输入:频率 42.5Hz..." + }, + { + "id": "3-1-2", + "pid": "3-1", + "name": "输入:频率 50.0Hz..." + }, + { + "id": "3-1-3", + "pid": "3-1", + "name": "输入:频率 50.05Hz..." + } + ] + }, + { + "id": "3-2", + "pid": "3", + "name": "电压对频率测量的影响", + "children": [ + { + "id": "3-2-1", + "pid": "3-2", + "name": "输入:频率 50.05Hz Ua =10%Un..." + }, + { + "id": "3-2-1", + "pid": "3-2", + "name": "输入:频率 51.05Hz Ua =10%Un..." + }, + { + "id": "3-2-2", + "pid": "3-2", + "name": "输入:频率 52.05Hz Ua =10%Un..." + } + ] + }, + { + "id": "3-3", + "pid": "3", + "name": "谐波对频率测量的影响", + "children": [ + { + "id": "3-3-1", + "pid": "3-3", + "name": "输入:频率 50.05Hz Ua =100%Un..." + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue index 9708690..de52d08 100644 --- a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue @@ -5,7 +5,7 @@
- + @@ -29,12 +29,12 @@
- +
-
@@ -67,68 +67,36 @@ import DataCheckResultTable from './dataCheckResultTable.vue' import DataCheckRawDataTable from './dataCheckRawDataTable.vue' import {CheckData} from "@/api/check/interface"; import {data as treeData} from "@/api/plan/autoTest.json"; -import {getCheckItemDetail} from "@/api/check/test"; const {appendToBody} = withDefaults(defineProps<{ appendToBody: boolean }>(), {appendToBody: false}) - const formContent = reactive({ - testScriptName: 'Q/GDW 10650.4-2021 模拟式', - errorSysName: 'Q/GDW 10650.2-2021', - dataRule: '所有值', - deviceName: '被检设备1', - monitorIdx: '1', + scriptName: '', + errorSysName: '', + dataRule: '', + deviceName: '', + monitorIdx: '', }) const activeName = ref('resultTab') +// 左侧树被选中的叶子节点id +const checkedScriptId = ref('') const checkItemSwitch = ref(0) const currentScriptDsc = ref('电压准确度检测:频率:42.5Hz Ua=46.192V 0° Ub=46.192V -120° Uc=46.192V 120° Ia=1A 0° Ib=1A -120° Ic=1A 120°'); + const defaultProps = { children: "children", label: "name", pid: "pid", }; -const monitorIdxList = [ - { - value: '1', - }, - { - value: '2 (不合格)', - }, - { - value: '3', - }, - { - value: '4 (不合格)', - }, -] - -// 改变通道号下拉框触发事件 -const handleChnNumChange = (data: any) => { - console.log(data); -} - -// 切换不合格测试项、全部测试项 触发事件 -const handleCheckItemSwitch = (data: any) => { - // 0 不合格测试项、1 全部测试项 - if (data === 0) { - - } else { - - } -} - -// 点击左侧树节点触发事件 -const handleNodeClick = (data: any) => { - console.log(data); -}; - +let monitorIdxList: any[] = [] +// 检测结果表格数据 const checkResultTableData = reactive([ { chnNum: '1', @@ -143,7 +111,7 @@ const checkResultTableData = reactive([ result: '合格', } ]) - +// 原始数据表格数据 const rawTableData = reactive([ { updateTime: "2024-10-10 09:30:00", @@ -267,6 +235,44 @@ const rawTableData = reactive([ } ]) +const defaultExpandedKeys = computed(() => { + +}) + +// 切换不合格测试项、全部测试项 触发事件 +const handleCheckItemSwitch = (data: any) => { + // 0 不合格测试项、1 全部测试项 + if (data === 0) { + + } else { + + } +} + +// 改变通道号下拉框触发事件 +const handleChnNumChange = (data: any) => { + formContent.monitorIdx = data.value +} +watch(() => formContent.monitorIdx, (newVal, oldVal) => { + if (newVal) { + console.log("通道号下拉框", newVal, oldVal); + } +}) + +// 点击左侧树节点触发事件 +const handleNodeClick = (data: any) => { + if (!data.children) { + checkedScriptId.value = data.id + } +}; +watch(checkedScriptId, (newVal, oldVal) => { + if (newVal) { + console.log("左侧树被选中的叶子节点id", newVal, oldVal); + // checkResultTableData + } +}) + + const resultTableRef = ref() const rawDataTableRef = ref() @@ -274,7 +280,14 @@ const visible = ref(false) const close = () => { //数据清空 - + Object.assign(formContent, { + scriptName: '', + errorSysName: '', + dataRule: '', + deviceName: '', + monitorIdx: '', + }) + checkedScriptId.value = '' activeName.value = 'rawDataTab' visible.value = false; @@ -290,12 +303,38 @@ const open = async (deviceId: string, chnNum: number, checkItemId?: string) => { // 数据处理 + monitorIdxList = [ + {value: '1',}, + { + value: '2 (不合格)', + }, + { + value: '3', + }, + { + value: '4 (不合格)', + },] + Object.assign(formContent, { + scriptName: 'Q/GDW 10650.4-2021 模拟式', + errorSysName: 'Q/GDW 10650.2-2021', + dataRule: '所有值', + deviceName: '被检设备1', + monitorIdx: monitorIdxList[0].value, + }) + checkedScriptId.value = treeData[0].children[0].children[0].id // checkResultTableData=[]; - //formContent.value = ... visible.value = true; } +const getDefaultLeafNodeId = (treeData: any[]): string => { + let leafNodeId = '' + if (treeData.length > 0) { + const firstNode = treeData[0] + } + return leafNodeId +} + defineExpose({ open }) diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index ffbf556..5487192 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -248,9 +248,9 @@ watch(testStatus, function (newValue, oldValue) { watch(webMsgSend, function (newValue, oldValue) { if (activeIndex.value <= checkTotal.value) { - console.log('检测开始') switch (newValue.requestId) { case 'Test_Freq': + console.log('检测开始') updateCheckResultView("Freq") break; case 'Test_VOL': diff --git a/frontend/src/views/system/dictionary/dictTree/components/treePopup.vue b/frontend/src/views/system/dictionary/dictTree/components/treePopup.vue index 13f8751..66b0040 100644 --- a/frontend/src/views/system/dictionary/dictTree/components/treePopup.vue +++ b/frontend/src/views/system/dictionary/dictTree/components/treePopup.vue @@ -43,7 +43,7 @@ pid: '', pids: '', name: '', - code: ' ', + code: '', sort: 100, remark: '', state: 0,