返回结果

This commit is contained in:
caozehui
2025-01-07 14:54:44 +08:00
parent ba0c577514
commit 689cc39bbc
3 changed files with 162 additions and 110 deletions

View File

@@ -10,46 +10,85 @@
<!-- </el-table-column>--> <!-- </el-table-column>-->
<template v-if="phaseT === 0"> <template v-if="phaseT === 0">
<el-table-column :label="`A${unit}`"> <el-table-column :label="`A${unit}`">
<el-table-column prop="aStd" width="72" label="标准值"/> <el-table-column prop="aStd" width="100" label="标准值"/>
<el-table-column prop="aData" width="72" label="被检值"/> <el-table-column prop="aData" width="100" label="被检值"/>
<el-table-column prop="aError" width="85" label="误差值"> <el-table-column prop="isDataA" label="检测结果">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.isDataA === 1">{{scope.row.aError}}</span> <el-tooltip effect="dark" placement="bottom">
<el-tag type="danger" v-if="scope.row.isDataA === 2">{{scope.row.aError}}</el-tag> <template #content>
<span v-if="scope.row.isDataA === 4">/</span> 最大误差{{scope.row.maxError}} {{unit}}<br/>
误差值{{scope.row.aError}} {{unit}}
</template>
<span v-if="scope.row.isDataA === 1">符合</span>
<el-tag type="danger" v-if="scope.row.isDataA === 2">不符合</el-tag>
<span v-if="scope.row.isDataA === 4">/</span>
</el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="aError" width="92" label="误差值">-->
<!-- <template #default="scope">-->
<!-- <span v-if="scope.row.isDataA === 1">{{scope.row.aError}}</span>-->
<!-- <el-tag type="danger" v-if="scope.row.isDataA === 2">{{scope.row.aError}}</el-tag>-->
<!-- <span v-if="scope.row.isDataA === 4">/</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table-column> </el-table-column>
<el-table-column :label="`B${unit}`"> <el-table-column :label="`B${unit}`">
<el-table-column prop="bStd" width="72" label="标准值"/> <el-table-column prop="bStd" width="100" label="标准值"/>
<el-table-column prop="bData" width="72" label="被检值"/> <el-table-column prop="bData" width="100" label="被检值"/>
<el-table-column prop="bError" width="85" label="误差值"> <el-table-column prop="isDataB" label="检测结果">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.isDataB === 1">{{scope.row.bError}}</span> <el-tooltip effect="dark" placement="bottom">
<el-tag type="danger" v-if="scope.row.isDataB === 2">{{scope.row.bError}}</el-tag> <template #content>
<span v-if="scope.row.isDataB === 4">/</span> 最大误差{{scope.row.maxError}} {{unit}}<br/>
误差值{{scope.row.bError}} {{unit}}
</template>
<span v-if="scope.row.isDataB === 1">符合</span>
<el-tag type="danger" v-if="scope.row.isDataB === 2">不符合</el-tag>
<span v-if="scope.row.isDataB === 4">/</span>
</el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="bError" width="92" label="误差值">-->
<!-- <template #default="scope">-->
<!-- <span v-if="scope.row.isDataB === 1">{{scope.row.bError}}</span>-->
<!-- <el-tag type="danger" v-if="scope.row.isDataB === 2">{{scope.row.bError}}</el-tag>-->
<!-- <span v-if="scope.row.isDataB === 4">/</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table-column> </el-table-column>
<el-table-column :label="`C${unit}`"> <el-table-column :label="`C${unit}`">
<el-table-column prop="cStd" width="72" label="标准值"/> <el-table-column prop="cStd" width="100" label="标准值"/>
<el-table-column prop="cData" width="72" label="被检值"/> <el-table-column prop="cData" width="100" label="被检值"/>
<el-table-column prop="cError" width="85" label="误差值"> <el-table-column prop="isDataC" label="检测结果">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.isDataC === 1">{{scope.row.cError}}</span> <el-tooltip effect="dark" placement="bottom">
<el-tag type="danger" v-if="scope.row.isDataC === 2">{{scope.row.cError}}</el-tag> <template #content>
<span v-if="scope.row.isDataC === 4">/</span> 最大误差{{scope.row.maxError}} {{unit}}<br/>
误差值{{scope.row.cError}} {{unit}}
</template>
<span v-if="scope.row.isDataC === 1">符合</span>
<el-tag type="danger" v-if="scope.row.isDataC === 2">不符合</el-tag>
<span v-if="scope.row.isDataC === 4">/</span>
</el-tooltip>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="cError" width="92" label="误差值">-->
<!-- <template #default="scope">-->
<!-- <span v-if="scope.row.isDataC === 1">{{scope.row.cError}}</span>-->
<!-- <el-tag type="danger" v-if="scope.row.isDataC === 2">{{scope.row.cError}}</el-tag>-->
<!-- <span v-if="scope.row.isDataC === 4">/</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table-column> </el-table-column>
<el-table-column prop="maxError" :label="`最大误差(${unit}`"/> <!-- <el-table-column prop="maxError" :label="`最大误差(${unit}`"/>-->
<el-table-column prop="result" label="检测结果" width="88"> <!-- <el-table-column prop="result" label="检测结果" width="88">-->
<template #default="scope"> <!-- <template #default="scope">-->
<el-tag type="danger" v-if="scope.row.result === 2">不符合</el-tag> <!-- <el-tag type="danger" v-if="scope.row.result === 2">不符合</el-tag>-->
<span v-if="scope.row.result === 1">符合</span> <!-- <span v-if="scope.row.result === 1">符合</span>-->
<span v-if="scope.row.result === 4">/</span> <!-- <span v-if="scope.row.result === 4">/</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</template> </template>
<template v-if="phaseT === 1"> <template v-if="phaseT === 1">
@@ -57,15 +96,28 @@
<el-table-column prop="tStd" label="标准值"/> <el-table-column prop="tStd" label="标准值"/>
<el-table-column prop="tData" label="被检值"/> <el-table-column prop="tData" label="被检值"/>
<el-table-column prop="tError" label="误差值"/> <el-table-column prop="tError" label="误差值"/>
<el-table-column prop="result" label="检测结果">
<template #default="scope">
<el-tooltip effect="dark" placement="bottom">
<template #content>
最大误差{{scope.row.maxError}} {{unit}}<br/>
误差值{{scope.row.tError}} {{unit}}
</template>
<span v-if="scope.row.isDataT === 1">符合</span>
<el-tag type="danger" v-if="scope.row.isDataT === 2">不符合</el-tag>
<span v-if="scope.row.isDataT === 4">/</span>
</el-tooltip>
</template>
</el-table-column>
</el-table-column> </el-table-column>
<el-table-column prop="maxError" label="最大误差"/> <!-- <el-table-column prop="maxError" label="最大误差"/>-->
<el-table-column prop="result" label="检测结果"> <!-- <el-table-column prop="result" label="检测结果">-->
<template #default="scope"> <!-- <template #default="scope">-->
<span v-if="scope.row.result === 1">符合</span> <!-- <span v-if="scope.row.result === 1">符合</span>-->
<el-tag type="danger" v-if="scope.row.result === 2">不符合</el-tag> <!-- <el-tag type="danger" v-if="scope.row.result === 2">不符合</el-tag>-->
<span v-if="scope.row.result === 4">/</span> <!-- <span v-if="scope.row.result === 4">/</span>-->
</template> <!-- </template>-->
</el-table-column> <!-- </el-table-column>-->
</template> </template>
</el-table> </el-table>
@@ -94,6 +146,7 @@ const phaseT = computed(() => {
return result; return result;
}) })
</script> </script>
<style scoped> <style scoped>

View File

@@ -40,7 +40,9 @@
:props="defaultProps" :props="defaultProps"
@node-click="handleNodeClick" class="custom-tree" ref="treeRef"> @node-click="handleNodeClick" class="custom-tree" ref="treeRef">
<template #default="{ node, data }"> <template #default="{ node, data }">
<span class="custom-tree-node" :style="data.fly===2? 'color: red;':''">{{ data.scriptTypeName }}</span> <el-tooltip effect="dark" :content="data.scriptTypeName" placement="top">
<span class="custom-tree-node" :style="data.fly===2? 'color: red;':''">{{ data.scriptTypeName }}</span>
</el-tooltip>
</template> </template>
</el-tree> </el-tree>
</div> </div>
@@ -579,9 +581,9 @@ defineExpose({
margin-top: 10px; margin-top: 10px;
.custom-tree-node { .custom-tree-node {
overflow-x: hidden !important; // 溢出部分隐藏 overflow-x: hidden !important;
white-space: nowrap !important; //禁止自动换行 white-space: nowrap !important;
text-overflow: ellipsis !important; // 使溢出部分以省略号显示 text-overflow: ellipsis !important;
} }
} }
} }

View File

@@ -300,7 +300,21 @@ watch(testStatus, function (newValue, oldValue) {
}) })
watch(webMsgSend, function (newValue, oldValue) { watch(webMsgSend, function (newValue, oldValue) {
if (newValue.code == 10552) { //todo 10552之后还会发送消息吗 if (newValue.code == 10550) {
ElMessageBox.alert(`${newValue.data}设备通讯失败,请检查设备连接情况!`, '预检测失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}设备通讯中断!`})
emit('update:testStatus', 'preTest_fail')
} else if (newValue.code == 10551) {
ElMessageBox.alert(`${newValue.data}设备触发报告异常!`, '预检测失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}设备触发报告异常!`})
emit('update:testStatus', 'preTest_fail')
} else if (newValue.code == 10552) { //todo 10552之后还会发送消息吗
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '预检测失败', { ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '预检测失败', {
confirmButtonText: '确定', confirmButtonText: '确定',
type: 'error', type: 'error',
@@ -331,41 +345,21 @@ watch(webMsgSend, function (newValue, oldValue) {
// } // }
// emit('update:testStatus', 'preTest_fail') // emit('update:testStatus', 'preTest_fail')
// break; // break;
case 'yjc_sbtxjy': case 'YJC_xyjy':
switch (newValue.operateCode) { switch (newValue.operateCode) {
case 'INIT_GATHER$01': case 'INIT_GATHER$03':
if (newValue.code == 10550) { if (newValue.code == 25001) {
ElMessageBox.alert(`${newValue.data}设备通讯失败,请检查设备连接情况!`, '预检测失败', { ElMessage.success('预检测成功!')
confirmButtonText: '确定', testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:预检测成功!`})
type: 'error',
}) activeIndex = getNextActiveIndex() + 2
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}设备通讯中断!`}) startTimer()
emit('update:testStatus', 'preTest_fail')
} emit('update:testStatus', 'process')
if (newValue.code == 10551) {
ElMessageBox.alert(`${newValue.data}设备触发报告异常!`, '预检测失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}设备触发报告异常!`})
emit('update:testStatus', 'preTest_fail')
} }
break; break;
} }
break; break;
case 'YJC_xujy':
switch (newValue.operateCode) {
case 'DATA_REQUEST$02':
ElMessage.success('预检测成功!')
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:预检测成功!`})
activeIndex = getNextActiveIndex() + 2
startTimer()
emit('update:testStatus', 'process')
break
}
break;
case 'Pause_Success': case 'Pause_Success':
ElMessage.success('暂停成功') ElMessage.success('暂停成功')
emit('update:testStatus', 'paused') emit('update:testStatus', 'paused')
@@ -388,7 +382,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'FREQ_End': case 'FREQ_End':
updatePercentage() updatePercentage()
updateCheckResultView("FREQ", false) updateCheckResultView("FREQ", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('FREQ') activeIndex = getNextActiveIndex('FREQ')
@@ -401,7 +395,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'V_End': case 'V_End':
updatePercentage() updatePercentage()
updateCheckResultView("V", false) updateCheckResultView("V", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('V') activeIndex = getNextActiveIndex('V')
@@ -414,7 +408,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'HV_End': case 'HV_End':
updatePercentage() updatePercentage()
updateCheckResultView("HV", false) updateCheckResultView("HV", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HV') activeIndex = getNextActiveIndex('HV')
@@ -427,7 +421,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'HI_End': case 'HI_End':
updatePercentage() updatePercentage()
updateCheckResultView("HI", false) updateCheckResultView("HI", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HI') activeIndex = getNextActiveIndex('HI')
@@ -440,7 +434,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'HP_End': case 'HP_End':
updatePercentage() updatePercentage()
updateCheckResultView("HP", false) updateCheckResultView("HP", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HP') activeIndex = getNextActiveIndex('HP')
@@ -453,7 +447,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'HSV_End': case 'HSV_End':
updatePercentage() updatePercentage()
updateCheckResultView("HSV", false) updateCheckResultView("HSV", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HSV') activeIndex = getNextActiveIndex('HSV')
@@ -466,7 +460,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'HSI_End': case 'HSI_End':
updatePercentage() updatePercentage()
updateCheckResultView("HSI", false) updateCheckResultView("HSI", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HSI') activeIndex = getNextActiveIndex('HSI')
@@ -479,7 +473,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'VOLTAGE_End': case 'VOLTAGE_End':
updatePercentage() updatePercentage()
updateCheckResultView("VOLTAGE", false) updateCheckResultView("VOLTAGE", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('VOLTAGE') activeIndex = getNextActiveIndex('VOLTAGE')
@@ -492,7 +486,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'I_End': case 'I_End':
updatePercentage() updatePercentage()
updateCheckResultView("I", false) updateCheckResultView("I", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('I') activeIndex = getNextActiveIndex('I')
@@ -505,7 +499,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'IMBV_End': case 'IMBV_End':
updatePercentage() updatePercentage()
updateCheckResultView("IMBV", false) updateCheckResultView("IMBV", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('IMBV') activeIndex = getNextActiveIndex('IMBV')
@@ -518,7 +512,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'IMBA_End': case 'IMBA_End':
updatePercentage() updatePercentage()
updateCheckResultView("IMBA", false) updateCheckResultView("IMBA", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('IMBA') activeIndex = getNextActiveIndex('IMBA')
@@ -531,7 +525,7 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
case 'F_End': case 'F_End':
updatePercentage() updatePercentage()
updateCheckResultView("F", false) updateCheckResultView("F", false, newValue.data)
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('F') activeIndex = getNextActiveIndex('F')
@@ -727,13 +721,12 @@ const updateLog = (isStart: boolean) => {
}) })
} }
if(activeIndex === checkTotal){ if (activeIndex === checkTotal) {
testLogList.push({ testLogList.push({
type: 'info', type: 'info',
log: currentTime.value + ' :检测结束,总用时' + getTimeDifference(timeDifference.value), log: currentTime.value + ' :检测结束,总用时' + getTimeDifference(timeDifference.value),
}) })
} }
} }
} }
@@ -752,13 +745,16 @@ const updateLog = (isStart: boolean) => {
// } // }
// } // }
const updateCheckResultView = (scriptCode: string, isStart: boolean) => { const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: any = null) => {
let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id
let temp = null let temp = null
if (isStart) { if (isStart) {
temp = getLoadingResult(scriptType) temp = getLoadingResult(scriptType)
} else { } else {
temp = getCheckResult(scriptType) temp = {
scriptType,
devices,
}
} }
updateCheckResult(temp) updateCheckResult(temp)
}; };
@@ -816,30 +812,30 @@ const getCheckResult = (scriptType: string) => {
// } // }
// }) // })
// } else { // } else {
devices = deviceList.map(item => { devices = deviceList.map(item => {
let tempChnResult: CheckData.ChnCheckResultEnum[] = [] let tempChnResult: CheckData.ChnCheckResultEnum[] = []
// if (item.deviceId === randomUnConnectedDeviceId && activeIndex >= randomUnConnectedRaw) { // if (item.deviceId === randomUnConnectedDeviceId && activeIndex >= randomUnConnectedRaw) {
// for (let i = 0; i < item.chnNum; i++) { // for (let i = 0; i < item.chnNum; i++) {
// tempChnResult.push(CheckData.ChnCheckResultEnum.UNCONNECTED) // tempChnResult.push(CheckData.ChnCheckResultEnum.UNCONNECTED)
// //errorCheckItem.push({scriptType,type:'warning'}) // //errorCheckItem.push({scriptType,type:'warning'})
// } // }
// } else { // } else {
for (let i = 0; i < item.chnNum; i++) { for (let i = 0; i < item.chnNum; i++) {
tempChnResult.push(CheckData.ChnCheckResultEnum.SUCCESS) tempChnResult.push(CheckData.ChnCheckResultEnum.SUCCESS)
} }
let randomNum = getRandomInt(item.chnNum * 2) let randomNum = getRandomInt(item.chnNum * 2)
if (randomNum < item.chnNum && activeIndex >= 4 && activeIndex <= 8) { if (randomNum < item.chnNum && activeIndex >= 4 && activeIndex <= 8) {
tempChnResult[randomNum] = CheckData.ChnCheckResultEnum.FAIL tempChnResult[randomNum] = CheckData.ChnCheckResultEnum.FAIL
errorCheckItem.push({scriptType, type: 'error'}) errorCheckItem.push({scriptType, type: 'error'})
} }
// } // }
return { return {
deviceId: item.deviceId, deviceId: item.deviceId,
deviceName: item.deviceName, deviceName: item.deviceName,
chnResult: tempChnResult, chnResult: tempChnResult,
} }
}) })
// } // }
let tempScriptChnItem: CheckData.ScriptChnItem = { let tempScriptChnItem: CheckData.ScriptChnItem = {
@@ -909,8 +905,9 @@ const startTimer = () => {
}, 4000); }, 4000);
setTimeout(() => { setTimeout(() => {
emit('update:webMsgSend', { emit('update:webMsgSend', {
requestId: 'YJC_xujy', requestId: 'YJC_xyjy',
operateCode: "DATA_REQUEST$02" operateCode: "INIT_GATHER$03",
code: "25001"
}) })
}, 6000) }, 6000)
break; break;