This commit is contained in:
caozehui
2025-01-04 16:33:23 +08:00
parent 23e72f38a6
commit bf823ddff0
3 changed files with 152 additions and 311 deletions

View File

@@ -35,8 +35,7 @@
</div> </div>
<div class="content-tree"> <div class="content-tree">
<el-tree v-if="switchItem === 0" :default-expanded-keys="defaultExpandedKeys" node-key="index" <el-tree v-if="switchItem === 0" :default-expanded-keys="defaultExpandedKeys" node-key="index"
:data="treeDataUnqualified" :props="defaultProps" @node-click="handleNodeClick" :data="treeDataUnqualified" :props="defaultProps" @node-click="handleNodeClick" class="custom-tree">
class="custom-tree">
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node">{{ data.scriptTypeName }}</span> <span class="custom-tree-node">{{ data.scriptTypeName }}</span>
</template> </template>
@@ -53,7 +52,7 @@
<div class="content-right"> <div class="content-right">
<div class="content-right-title"> <div class="content-right-title">
<el-divider>当前检测项目</el-divider> <el-divider>当前检测项目</el-divider>
<div> <div class="content-right-title-desc">
{{ currentDesc ? currentDesc : "无" }} {{ currentDesc ? currentDesc : "无" }}
</div> </div>
</div> </div>
@@ -112,10 +111,13 @@ let scriptType: string | null = null
let chnList: any[] = [] let chnList: any[] = []
// 不符合测试项、全部测试项切换 // 不符合测试项、全部测试项切换
const switchItem = ref<number>(0) let switchItem = 0
// 左侧树数据 // 左侧树数据
let treeDataUnqualified: CheckData.TreeItem[] = [] let treeDataUnqualified: CheckData.TreeItem[] = []
let treeDataAll: CheckData.TreeItem[] = [] let treeDataAll: CheckData.TreeItem[] = []
// const treeDataUnqualified=reactive<CheckData.TreeItem[]>([])
// const treeDataAll=reactive<CheckData.TreeItem[]>([])
// 左侧树被选中的叶子节点id // 左侧树被选中的叶子节点id
const checkIndex = ref<string>('') const checkIndex = ref<string>('')
@@ -129,7 +131,6 @@ const checkResultTableData = reactive<CheckData.CheckResult[]>([])
// 原始数据表格数据 // 原始数据表格数据
const rawTableData = reactive<CheckData.RawDataItem[]>([]) const rawTableData = reactive<CheckData.RawDataItem[]>([])
// 左侧树默认展开节点id // 左侧树默认展开节点id
let defaultExpandedKeys: string[] = [] let defaultExpandedKeys: string[] = []
@@ -154,298 +155,112 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => {
scriptId: checkStore.scriptId, scriptId: checkStore.scriptId,
devId: deviceId, devId: deviceId,
devNum: formContent.chnNum + '', devNum: formContent.chnNum + '',
scriptType, scriptType: null,
code: checkStore.planCode code: checkStore.planCode
}) })
treeDataAll = resTreeDataTemp treeDataAll = resTreeDataTemp
treeDataAll = [ // treeDataAll = [
{ // {
scriptTypeName: "频率准确度检测", // scriptTypeName: "频率准确度检测",
sourceDesc: null, // sourceDesc: null,
harmNum: null, // harmNum: null,
index: null, // index: null,
fly: null, // fly: null,
children: [ // children: [
{ // {
scriptTypeName: "额定条件下频率准确度测试", // scriptTypeName: "额定条件下频率准确度测试",
sourceDesc: null, // sourceDesc: null,
harmNum: null, // harmNum: null,
index: null, // index: null,
fly: null, // fly: null,
children: [ // children: [
{ // {
scriptTypeName: "频率=42.5Hz", // scriptTypeName: "频率=42.5Hz",
sourceDesc: "频率=42.5Hz", // sourceDesc: "频率=42.5Hz",
harmNum: null, // harmNum: null,
index: 11, // index: 11,
fly: 1, // fly: 1,
children: null // children: null
}, // },
{ // {
scriptTypeName: "频率=50Hz", // scriptTypeName: "频率=50Hz",
sourceDesc: "频率=50Hz", // sourceDesc: "频率=50Hz",
harmNum: null, // harmNum: null,
index: 12, // index: 12,
fly: 1, // fly: 1,
children: null // children: null
}, // },
{ // {
scriptTypeName: "频率=50.05Hz", // scriptTypeName: "频率=50.05Hz",
sourceDesc: "频率=50.05Hz", // sourceDesc: "频率=50.05Hz",
harmNum: null, // harmNum: null,
index: 13, // index: 13,
fly: 1, // fly: 1,
children: null // children: null
}, // },
{ // {
scriptTypeName: "频率=57.5Hz", // scriptTypeName: "频率=57.5Hz",
sourceDesc: "频率=57.5Hz", // sourceDesc: "频率=57.5Hz",
harmNum: null, // harmNum: null,
index: 14, // index: 14,
fly: 1, // fly: 1,
children: null // children: null
} // }
] // ]
}, // },
{ // {
scriptTypeName: "单影响量下频率准确度测试", // scriptTypeName: "单影响量下频率准确度测试",
sourceDesc: null, // sourceDesc: null,
harmNum: null, // harmNum: null,
index: null, // index: null,
fly: null, // fly: null,
children: [ // children: [
{ // {
scriptTypeName: "电压幅值对频率测量的影响", // scriptTypeName: "电压幅值对频率测量的影响",
sourceDesc: null, // sourceDesc: null,
harmNum: null, // harmNum: null,
index: null, // index: null,
fly: null, // fly: null,
children: [ // children: [
{ // {
scriptTypeName: "10%Un对频率=50.05Hz的影响", // scriptTypeName: "10%Un对频率=50.05Hz的影响",
sourceDesc: "10%Un对频率=50.05Hz的影响", // sourceDesc: "10%Un对频率=50.05Hz的影响",
harmNum: null, // harmNum: null,
index: null, // index: 15,
fly: 1, // fly: 2,
children: null // children: null
} // }
] // ]
}, // },
{ // {
scriptTypeName: "谐波对频率测量的影响", // scriptTypeName: "谐波对频率测量的影响",
sourceDesc: null, // sourceDesc: null,
harmNum: null, // harmNum: null,
index: null, // index: null,
fly: null, // fly: null,
children: [ // children: [
{ // {
scriptTypeName: "叠加多次谐波对频率=50.05Hz的影响", // scriptTypeName: "叠加多次谐波对频率=50.05Hz的影响",
sourceDesc: "叠加多次谐波对频率=50.05Hz的影响", // sourceDesc: "叠加多次谐波对频率=50.05Hz的影响",
harmNum: null, // harmNum: null,
index: null, // index: 16,
fly: 1, // fly: 1,
children: null // children: null
} // }
] // ]
} // }
] // ]
}, // },
] // ]
}, // }
{ // ]
scriptTypeName: "频率准确度检测",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "额定条件下频率准确度测试",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "频率=42.5Hz",
sourceDesc: "频率=42.5Hz",
harmNum: null,
index: 11,
fly: 1,
children: null
},
{
scriptTypeName: "频率=50Hz",
sourceDesc: "频率=50Hz",
harmNum: null,
index: 12,
fly: 1,
children: null
},
{
scriptTypeName: "频率=50.05Hz",
sourceDesc: "频率=50.05Hz",
harmNum: null,
index: 13,
fly: 1,
children: null
},
{
scriptTypeName: "频率=57.5Hz",
sourceDesc: "频率=57.5Hz",
harmNum: null,
index: 14,
fly: 1,
children: null
}
]
},
{
scriptTypeName: "单影响量下频率准确度测试",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "电压幅值对频率测量的影响",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "10%Un对频率=50.05Hz的影响",
sourceDesc: "10%Un对频率=50.05Hz的影响",
harmNum: null,
index: null,
fly: 1,
children: null
}
]
},
{
scriptTypeName: "谐波对频率测量的影响",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "叠加多次谐波对频率=50.05Hz的影响",
sourceDesc: "叠加多次谐波对频率=50.05Hz的影响",
harmNum: null,
index: null,
fly: 1,
children: null
}
]
}
]
},
]
},
{
scriptTypeName: "频率准确度检测",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "额定条件下频率准确度测试",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "频率=42.5Hz",
sourceDesc: "频率=42.5Hz",
harmNum: null,
index: 11,
fly: 1,
children: null
},
{
scriptTypeName: "频率=50Hz",
sourceDesc: "频率=50Hz",
harmNum: null,
index: 12,
fly: 1,
children: null
},
{
scriptTypeName: "频率=50.05Hz",
sourceDesc: "频率=50.05Hz",
harmNum: null,
index: 13,
fly: 1,
children: null
},
{
scriptTypeName: "频率=57.5Hz",
sourceDesc: "频率=57.5Hz",
harmNum: null,
index: 14,
fly: 1,
children: null
}
]
},
{
scriptTypeName: "单影响量下频率准确度测试",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "电压幅值对频率测量的影响",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "10%Un对频率=50.05Hz的影响",
sourceDesc: "10%Un对频率=50.05Hz的影响",
harmNum: null,
index: null,
fly: 1,
children: null
}
]
},
{
scriptTypeName: "谐波对频率测量的影响",
sourceDesc: null,
harmNum: null,
index: null,
fly: null,
children: [
{
scriptTypeName: "叠加多次谐波对频率=50.05Hz的影响",
sourceDesc: "叠加多次谐波对频率=50.05Hz的影响",
harmNum: null,
index: null,
fly: 1,
children: null
}
]
}
]
},
]
}
]
let treeDataTemp = JSON.parse(JSON.stringify(treeDataAll)) let treeDataTemp = JSON.parse(JSON.stringify(treeDataAll))
filterTree(treeDataTemp, 2) filterTree(treeDataTemp, 2)
treeDataUnqualified = treeDataTemp treeDataUnqualified = treeDataTemp
switchItem.value = 0 switchItem = 0
await handleSwitchChange(0) await handleSwitchChange(0)
} }
}) })
@@ -460,7 +275,7 @@ const handleSwitchChange = async (data: any) => {
// 默认操作 // 默认操作
const defaultOperate = () => { const defaultOperate = () => {
let node = null let node = null
if (switchItem.value === 0) { if (switchItem === 0) {
node = getDefaultNode(treeDataUnqualified) node = getDefaultNode(treeDataUnqualified)
} else { } else {
node = getDefaultNode(treeDataAll) node = getDefaultNode(treeDataAll)
@@ -674,10 +489,13 @@ const close = () => {
}) })
treeDataUnqualified = [] treeDataUnqualified = []
treeDataAll = [] treeDataAll = []
Object.assign(treeDataUnqualified, [])
Object.assign(treeDataAll, [])
defaultExpandedKeys = []
checkIndex.value = '' checkIndex.value = ''
activeTab.value = 'resultTab' activeTab.value = 'resultTab'
currentDesc.value = '' currentDesc.value = ''
switchItem.value = 0 switchItem = 0
visible.value = false; visible.value = false;
}; };
@@ -788,6 +606,7 @@ defineExpose({
.data-check-dialog { .data-check-dialog {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow-y: hidden;
.data-check-head { .data-check-head {
display: flex; display: flex;
@@ -833,12 +652,16 @@ defineExpose({
.content-right-title { .content-right-title {
.el-divider--horizontal { .el-divider--horizontal {
margin-bottom: 0px; //margin-top: 0px;
margin-bottom: 5px;
height: 20px;
} }
div {
.content-right-title-desc {
font-size: 16px; font-size: 16px;
height: 16px; height: 48px;
line-height: 16px; max-height: 48px;
overflow-y: auto;
} }
} }

View File

@@ -8,13 +8,13 @@
<el-button <el-button
type="primary" type="primary"
v-if="testStatus=='process' && activeIndex < checkTotal" v-if="testStatus=='process' && percentage < 100"
:icon="VideoPause" :icon="VideoPause"
@click="emit('sendPause')">停止检测 @click="emit('sendPause')">停止检测
</el-button> </el-button>
<el-button <el-button
type="primary" type="primary"
v-if="testStatus=='preTest_process' && activeIndex < checkTotal" v-if="testStatus=='preTest_process'"
:icon="VideoPause" :icon="VideoPause"
disabled>预检测中 disabled>预检测中
</el-button> </el-button>
@@ -32,11 +32,11 @@
</el-button> </el-button>
<el-button type="success" v-if="activeIndex >= checkTotal" :icon="Check" disabled>检测完成</el-button> <el-button type="success" v-if="percentage >= 100" :icon="Check" disabled>检测完成</el-button>
<el-button <el-button
type="warning" type="warning"
v-if="testStatus=='paused' && activeIndex < checkTotal" v-if="testStatus=='paused' && percentage < 100"
:icon="Refresh" :icon="Refresh"
@click="emit('sendResume')" @click="emit('sendResume')"
>继续检测 >继续检测
@@ -83,8 +83,7 @@
</template> </template>
<template v-else> <template v-else>
<el-table-column v-for="(item,index1) in deviceList" :key="item.deviceId" :label="item.deviceName" <el-table-column v-for="(item,index1) in deviceList" :key="item.deviceId" :label="item.deviceName" :min-width="110" align="center">
:min-width="110" align="center">
<template #default="{row}"> <template #default="{row}">
<el-tooltip <el-tooltip
:content="row.devices[index1].chnResult[0].color===CheckData.ButtonColorEnum.INFO ? '暂无数据' : '点击查看详情'" :content="row.devices[index1].chnResult[0].color===CheckData.ButtonColorEnum.INFO ? '暂无数据' : '点击查看详情'"
@@ -540,8 +539,8 @@ watch(webMsgSend, function (newValue, oldValue) {
} }
break; break;
case 'Quit': case 'Quit':
updatePercentage() //updatePercentage()
updateLog(false) //updateLog(false)
console.log('检测结束') console.log('检测结束')
break; break;
} }
@@ -603,7 +602,7 @@ const initScriptData = async () => {
}) })
scriptData.push(...temp) scriptData.push(...temp)
checkTotal = scriptData.length + 1 checkTotal = scriptData.length
} }
// 初始化设备列表 // 初始化设备列表
const initDeviceList = () => { const initDeviceList = () => {
@@ -704,7 +703,7 @@ const updateLog = (isStart: boolean) => {
//testLogList.length = 0; // 清空数组 //testLogList.length = 0; // 清空数组
} }
// debugger // debugger
if (activeIndex < checkTotal) { if (activeIndex <= checkTotal) {
if (isStart) { if (isStart) {
startData.value = new Date(); startData.value = new Date();
testLogList.push({ testLogList.push({
@@ -727,14 +726,17 @@ const updateLog = (isStart: boolean) => {
log: currentTime.value + ` ${scriptData[activeIndex - 1].scriptName}准确度检测结束:符合,用时` + getTimeDifference(timeDifferenceItem), log: currentTime.value + ` ${scriptData[activeIndex - 1].scriptName}准确度检测结束:符合,用时` + getTimeDifference(timeDifferenceItem),
}) })
} }
}
} else { if(activeIndex === checkTotal){
testLogList.push({ testLogList.push({
type: 'info', type: 'info',
log: currentTime.value + ' :检测结束,总用时' + getTimeDifference(timeDifference.value), log: currentTime.value + ' :检测结束,总用时' + getTimeDifference(timeDifference.value),
}) })
} }
}
}
scrollToBottom(); scrollToBottom();
} }

View File

@@ -371,6 +371,22 @@ const detectionOptions = ref([
const sendReCheck = () => { const sendReCheck = () => {
console.log('发送重新检测指令') console.log('发送重新检测指令')
// startPreTest({
// userPageId: "cdf",
// devIds:deviceIds,
// planId:planId,
// errorSysId:'cb407009f9894a8a8933b5d9b1e2f71d',
// scriptId:"a303b2224845fcc6f60198b8ca23dca9",
// operateType:'1' // '0'为预检测、1为正式检测
// }).then(res => {
// console.log(res)
/* if (res.code === 20000) {
TestStatus.value = 'start'
webMsgSend.value = ''
} else {
ElMessage.error(res.message)
}*/
// })
TestStatus.value = 'start' TestStatus.value = 'start'
} }