This commit is contained in:
caozehui
2025-01-08 11:02:16 +08:00
parent 4a7535e4f5
commit a1d113562b
3 changed files with 45 additions and 64 deletions

View File

@@ -49,13 +49,6 @@
</el-tooltip> </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="100" label="标准值"/> <el-table-column prop="cStd" width="100" label="标准值"/>
@@ -73,13 +66,6 @@
</el-tooltip> </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">-->

View File

@@ -41,7 +41,7 @@
@node-click="handleNodeClick" class="custom-tree" ref="treeRef"> @node-click="handleNodeClick" class="custom-tree" ref="treeRef">
<template #default="{ node, data }"> <template #default="{ node, data }">
<el-tooltip effect="dark" :content="data.scriptTypeName" placement="top"> <el-tooltip effect="dark" :content="data.scriptTypeName" placement="top">
<span class="custom-tree-node" :style="data.fly===2? 'color: red;':''">{{ data.scriptTypeName }}</span> <span class="custom-tree-node" :style="data.fly===2? 'color: #F56C6C;':''">{{ data.scriptTypeName }}</span>
</el-tooltip> </el-tooltip>
</template> </template>
</el-tree> </el-tree>
@@ -219,7 +219,7 @@ watch(currentHarmNum, (newVal, oldVal) => {
if (newVal !== '-1') { if (newVal !== '-1') {
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal.toString()) let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(newVal.toString())
setCheckResultData(resCheckResult) setCheckResultData(resCheckResult)
setRawData(resTableData.resultData.get(newVal.toString())) setRawData(resTableData.rawData.get(newVal.toString()))
} }
}) })
@@ -229,7 +229,7 @@ watch(currentCheckItem, (newVal, oldVal) => {
let key = newVal.toString() === 'Voltage' ? '电压幅值' : '持续时间' let key = newVal.toString() === 'Voltage' ? '电压幅值' : '持续时间'
let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(key) let resCheckResult: CheckData.ResCheckResult = resTableData.resultData.get(key)
setCheckResultData(resCheckResult) setCheckResultData(resCheckResult)
setRawData(resTableData.resultData.get(key)) setRawData(resTableData.rawData.get(key))
} }
}) })
@@ -432,13 +432,13 @@ const setCheckResultData = (data: CheckData.ResCheckResult) => {
} }
const setRawData = (data: CheckData.RawDataItem[]) => { const setRawData = (data: CheckData.RawDataItem[]) => {
console.log("原始数据", data)
data.forEach((item: CheckData.RawDataItem) => { data.forEach((item: CheckData.RawDataItem) => {
item.dataA = item.dataA == null || item.dataA == undefined ? '' : Number(item.dataA).toFixed(fixed).replace(/-/g, "") item.dataA = item.dataA == null || item.dataA == undefined ? '' : Number(item.dataA).toFixed(fixed).replace(/-/g, "")
item.dataB = item.dataB == null || item.dataB == undefined ? '' : Number(item.dataB).toFixed(fixed).replace(/-/g, "") item.dataB = item.dataB == null || item.dataB == undefined ? '' : Number(item.dataB).toFixed(fixed).replace(/-/g, "")
item.dataC = item.dataC == null || item.dataC == undefined ? '' : Number(item.dataC).toFixed(fixed).replace(/-/g, "") item.dataC = item.dataC == null || item.dataC == undefined ? '' : Number(item.dataC).toFixed(fixed).replace(/-/g, "")
item.dataT = item.dataT == null || item.dataT == undefined ? '' : Number(item.dataT).toFixed(fixed).replace(/-/g, "") item.dataT = item.dataT == null || item.dataT == undefined ? '' : Number(item.dataT).toFixed(fixed).replace(/-/g, "")
}) })
console.log("原始数据", data)
Object.assign(rawTableData, data) Object.assign(rawTableData, data)
} }

View File

@@ -297,7 +297,7 @@ watch(testStatus, function (newValue, oldValue) {
percentage.value = 0 percentage.value = 0
} }
emit('update:testStatus', 'test_init') emit('update:testStatus', 'test_init')
//startTimer() // todo 可移除 startTimer() // todo 可移除
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`}) testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化开始!`})
} }
}) })
@@ -340,25 +340,25 @@ watch(webMsgSend, function (newValue, oldValue) {
break; break;
} }
break; break;
case 'connect': // case 'connect':
switch (newValue.operateCode) { // switch (newValue.operateCode) {
case "Source": // case "Source":
ElMessageBox.alert('源通讯失败,请检查源连接情况!', '初始化失败', { // ElMessageBox.alert('源通讯失败,请检查源连接情况!', '初始化失败', {
confirmButtonText: '确定', // confirmButtonText: '确定',
type: 'error', // type: 'error',
}) // })
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源通讯失败!`}) // testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源通讯失败!`})
break; // break;
case "Dev": // case "Dev":
ElMessageBox.alert('设备通讯失败,请检查设备连接情况!', '初始化失败', { // ElMessageBox.alert('设备通讯失败,请检查设备连接情况!', '初始化失败', {
confirmButtonText: '确定', // confirmButtonText: '确定',
type: 'error', // type: 'error',
}) // })
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:设备通讯失败!`}) // testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:设备通讯失败!`})
break; // break;
} // }
emit('update:testStatus', 'test_init_fail') // emit('update:testStatus', 'test_init_fail')
break; // break;
case 'yjc_ytxjy': case 'yjc_ytxjy':
switch (newValue.operateCode) { switch (newValue.operateCode) {
case 'INIT_GATHER': case 'INIT_GATHER':
@@ -386,7 +386,7 @@ watch(webMsgSend, function (newValue, oldValue) {
testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化成功!`}) testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:初始化成功!`})
activeIndex = getNextActiveIndex() + 2 activeIndex = getNextActiveIndex() + 2
//startTimer() startTimer()
emit('update:testStatus', 'process') emit('update:testStatus', 'process')
} }
@@ -419,7 +419,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('FREQ') activeIndex = getNextActiveIndex('FREQ')
//startTimer() startTimer()
} }
break; break;
case 'V_Start': case 'V_Start':
@@ -432,7 +432,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('V') activeIndex = getNextActiveIndex('V')
//startTimer() startTimer()
} }
break; break;
case 'HV_Start': case 'HV_Start':
@@ -445,7 +445,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HV') activeIndex = getNextActiveIndex('HV')
//startTimer() startTimer()
} }
break; break;
case 'HI_Start': case 'HI_Start':
@@ -458,7 +458,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HI') activeIndex = getNextActiveIndex('HI')
//startTimer() startTimer()
} }
break; break;
case 'HP_Start': case 'HP_Start':
@@ -471,7 +471,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HP') activeIndex = getNextActiveIndex('HP')
//startTimer() startTimer()
} }
break; break;
case 'HSV_Start': case 'HSV_Start':
@@ -484,7 +484,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HSV') activeIndex = getNextActiveIndex('HSV')
//startTimer() startTimer()
} }
break; break;
case 'HSI_Start': case 'HSI_Start':
@@ -497,7 +497,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('HSI') activeIndex = getNextActiveIndex('HSI')
//startTimer() startTimer()
} }
break; break;
case 'VOLTAGE_Start': case 'VOLTAGE_Start':
@@ -510,7 +510,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('VOLTAGE') activeIndex = getNextActiveIndex('VOLTAGE')
//startTimer() startTimer()
} }
break; break;
case 'I_Start': case 'I_Start':
@@ -523,7 +523,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('I') activeIndex = getNextActiveIndex('I')
//startTimer() startTimer()
} }
break; break;
case 'IMBV_Start': case 'IMBV_Start':
@@ -536,7 +536,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('IMBV') activeIndex = getNextActiveIndex('IMBV')
//startTimer() startTimer()
} }
break; break;
case 'IMBA_Start': case 'IMBA_Start':
@@ -549,7 +549,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('IMBA') activeIndex = getNextActiveIndex('IMBA')
//startTimer() startTimer()
} }
break; break;
case 'F_Start': case 'F_Start':
@@ -562,7 +562,7 @@ watch(webMsgSend, function (newValue, oldValue) {
updateLog(false) updateLog(false)
if (testStatus.value != 'paused') { if (testStatus.value != 'paused') {
activeIndex = getNextActiveIndex('F') activeIndex = getNextActiveIndex('F')
//startTimer() startTimer()
} }
break; break;
case 'Quit': case 'Quit':
@@ -633,13 +633,7 @@ const initScriptData = async () => {
} }
// 初始化设备列表 // 初始化设备列表
const initDeviceList = () => { const initDeviceList = () => {
checkStore.devices.forEach(item => { Object.assign(deviceList, checkStore.devices)
deviceList.push({
deviceId: item.deviceId,
deviceName: item.deviceName,
chnNum: item.chnNum,
})
})
} }
// 初始化检测结果 (详细到通道) // 初始化检测结果 (详细到通道)
@@ -667,6 +661,7 @@ const initCheckResult = () => {
}) })
Object.assign(checkResult, result) Object.assign(checkResult, result)
} }
// 更新检测结果(详细到通道) // 更新检测结果(详细到通道)
const updateCheckResult = (data: CheckData.ScriptChnItem) => { const updateCheckResult = (data: CheckData.ScriptChnItem) => {
const {scriptType} = {...data} const {scriptType} = {...data}
@@ -796,11 +791,11 @@ const setErrorCheckItem = (scriptType: string, devices: any[]) => {
const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: any[] = []) => { const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: any[] = []) => {
let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id let scriptType = scriptData.filter(item => item.code === scriptCode)[0]?.id
// devices = [{ devices = [{
// chnResult: [1, 1], chnResult: [1, 1],
// deviceId: "80b4b4f52a4c4064a18319525f8ac13c", deviceId: "80b4b4f52a4c4064a18319525f8ac13c",
// deviceName: "240002" deviceName: "240002"
// }] }]
let temp = null let temp = null
if (isStart) { if (isStart) {
temp = getLoadingResult(scriptType) temp = getLoadingResult(scriptType)
@@ -1132,7 +1127,7 @@ const handleResumeTest = () => {
type: 'info', type: 'info',
log: `${new Date().toLocaleString()}:继续检测`, log: `${new Date().toLocaleString()}:继续检测`,
}) })
//startTimer() startTimer()
console.log('开始继续检测') console.log('开始继续检测')
}; };