返回结果

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

View File

@@ -40,7 +40,9 @@
:props="defaultProps"
@node-click="handleNodeClick" class="custom-tree" ref="treeRef">
<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>
</el-tree>
</div>
@@ -579,9 +581,9 @@ defineExpose({
margin-top: 10px;
.custom-tree-node {
overflow-x: hidden !important; // 溢出部分隐藏
white-space: nowrap !important; //禁止自动换行
text-overflow: ellipsis !important; // 使溢出部分以省略号显示
overflow-x: hidden !important;
white-space: nowrap !important;
text-overflow: ellipsis !important;
}
}
}

View File

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