This commit is contained in:
caozehui
2024-12-31 14:27:36 +08:00
parent 65e54ee2b5
commit 081aeacff7
9 changed files with 325 additions and 228 deletions

View File

@@ -68,7 +68,7 @@ import {reactive, ref} from 'vue'
import DataCheckResultTable from './dataCheckResultTable.vue'
import DataCheckRawDataTable from './dataCheckRawDataTable.vue'
import {CheckData} from "@/api/check/interface";
import {getFormData, getTreeData, getCheckData} from "@/api/check/test";
import {getFormData, getTreeData, getTableData} from "@/api/check/test";
import {useDictStore} from "@/stores/modules/dict";
import {useCheckStore} from "@/stores/modules/check";
@@ -95,7 +95,7 @@ const formContent = reactive<CheckData.DataCheck>({
monitorIdx: '',
})
let deviceId: string = ''
let scriptType: string = ''
let scriptType: string | null = null
// 通道下拉列表
let chnList: any[] = []
@@ -134,19 +134,9 @@ const handleChnChange = (data: any) => {
// treeDataUnQualified=[]
// treeDataAll=[]
switchItem.value = 0
}
// watch(() => formContent.monitorIdx, (newVal, oldVal) => {
// if (newVal) {
// console.log("通道号下拉框", newVal, oldVal);
//
// // 后端请求,查询该通道号下的测试项(可以只查询不合格测试项,也可以全部测试项、不合格测试项都查询)
// // const result = await getTreeData({deviceId, formContent.monitorIdx, scriptType})
// // treeDataUnQualified=[]
// // treeDataAll=[]
//
// }
// })
// 点击左侧树节点触发事件
const handleNodeClick = (data: any) => {
@@ -160,141 +150,234 @@ watch(checkedScriptId, (newVal, oldVal) => {
if (newVal) {
console.log("左侧树被选中的叶子节点id", newVal);
// 发起请求,查询该测试项的检测结果
// const result = await getCheckData({deviceId, formContent.monitorIdx, scriptType})
// const result = await getTableData({deviceId, formContent.monitorIdx, scriptType})
Object.assign(checkResultTableData, [{
chnNum: '1',
standardValue: 57.74,
L1: 57.73,
L1_errValue: 0.01,
L2: 57.73,
L2_errValue: 0.01,
L3: 57.73,
L3_errValue: 0.01,
A: 57.73,
A_errValue: 0.01,
B: 57.73,
B_errValue: 0.01,
C: 57.73,
C_errValue: 0.01,
maxErrVaule: 0.05774,
result: '合格',
}])
// Object.assign(checkResultTableData, [{
// chnNum: '1',
// standardValue: 57.74,
// T: 57.73,
// T_errValue: 0.01,
// maxErrVaule: 0.05774,
// result: '合格',
// }])
Object.assign(rawTableData, [
{
updateTime: "2024-10-10 09:30:00",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:03",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:06",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:09",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:12",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:15",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:18",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:21",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:24",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:27",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:30",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:33",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:36",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:39",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:42",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:45",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:48",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:51",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:54",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
},
{
updateTime: "2024-10-10 09:30:57",
L1: 57.73,
L2: 57.73,
L3: 57.73,
A: 57.73,
B: 57.73,
C: 57.73,
}
])
// Object.assign(rawTableData, [
// {
// updateTime: "2024-10-10 09:30:00",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:03",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:06",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:09",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:12",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:15",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:18",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:21",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:24",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:27",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:30",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:33",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:36",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:39",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:42",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:45",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:48",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:51",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:54",
// T: 57.73,
// },
// {
// updateTime: "2024-10-10 09:30:57",
// T: 57.73,
// }
// ])
}
})
@@ -313,12 +396,13 @@ watch(switchItem, (newVal, oldVal) => {
defaultExpandedKeys = [node?.id]
})
const open = async (_deviceId: string, chnNum: number, _scriptType?: string) => {
const open = async (_deviceId: string, chnNum: string, _scriptType: string | null) => {
console.log(_deviceId, chnNum, _scriptType);
deviceId = _deviceId
scriptType = _scriptType
switchItem.value = 0
// 发起后端请求,查询详细信息 当chnNum为-1时查询所有通道号
//const resFormContent = await getFormData({checkStore.planId,deviceId, chnNum.toString(),scriptType})
//const resFormContent = await getFormData({checkStore.planId,deviceId, chnNum,scriptType})
// 数据处理
let resFormContent = {
@@ -326,7 +410,7 @@ const open = async (_deviceId: string, chnNum: number, _scriptType?: string) =>
errorSysName: 'Q/GDW 10650.2-2021',
dataRule: '505f063f9f91ab108d895a9fe96b5dce',
deviceName: '被检设备1',
chnList:[
chnList: [
{value: '1', label: '1'},
{value: '2', label: '0'},
{value: '3', label: '1'},
@@ -337,69 +421,58 @@ const open = async (_deviceId: string, chnNum: number, _scriptType?: string) =>
label: item.label == '1' ? `${item.value}` : `${item.value}(不符合)`
}))
let dataRuleName = dictStore.getDictData('Data_Rule').find(item=>item.id==resFormContent.dataRule)?.name
let dataRuleName = dictStore.getDictData('Data_Rule').find(item => item.id == resFormContent.dataRule)?.name
Object.assign(formContent, {...resFormContent,dataRule:dataRuleName,monitorIdx: chnList[0].value})
Object.assign(formContent, {...resFormContent, dataRule: dataRuleName, monitorIdx: chnList[0].value})
// const result2 = await getTreeData({deviceId, formContent.monitorIdx, checkItemId})
treeDataAll = [{
"id": "1",
"pid": "0",
"scriptName": "频率准确度检测",
"children": [
{
"id": "1-1",
"pid": "1",
"scriptName": "额定工作条件下的检测",
"children": [
{
"id": "1-1-1",
"pid": "1-1",
"scriptName": "输入:频率 42.5Hz..."
},
{
"id": "1-1-2",
"pid": "1-1",
"scriptName": "输入:频率 50.0Hz..."
},
{
"id": "1-1-3",
"pid": "1-1",
"scriptName": "输入:频率 50.05Hz...."
}
]
},
{
"id": "1-2",
"pid": "1",
"scriptName": "电压对频率测量的影响",
"children": [
{
"id": "1-2-1",
"pid": "1-2",
"scriptName": "输入:频率 50.05Hz Ua =10%Un..."
},
{
"id": "1-2-1",
"pid": "1-2",
"scriptName": "输入:频率 51.05Hz Ua =10%Un..."
},
{
"id": "1-2-2",
"pid": "1-2",
"scriptName": "输入:频率 52.05Hz Ua =10%Un..."
}
]
},
{
"id": "1-3",
"pid": "1",
"scriptName": "谐波对频率测量的影响",
"children": [
{
"id": "1-3-1",
"pid": "1-3",
"scriptName": "输入:频率 50.05Hz Ua =100%Un..."
}
]
@@ -408,27 +481,22 @@ const open = async (_deviceId: string, chnNum: number, _scriptType?: string) =>
}]
treeDataUnQualified = [{
"id": "1",
"pid": "0",
"scriptName": "频率准确度检测",
"children": [
{
"id": "1-2",
"pid": "1",
"scriptName": "电压对频率测量的影响",
"children": [
{
"id": "1-2-1",
"pid": "1-2",
"scriptName": "输入:频率 50.05Hz Ua =10%Un..."
},
{
"id": "1-2-1",
"pid": "1-2",
"scriptName": "输入:频率 51.05Hz Ua =10%Un..."
},
{
"id": "1-2-2",
"pid": "1-2",
"scriptName": "输入:频率 52.05Hz Ua =10%Un..."
}
]