正式检测-预检测阶段错误码处理、频率、三项电压不平衡表头修改

This commit is contained in:
caozehui
2025-01-20 15:24:29 +08:00
parent 6f97c48226
commit c6ef54f7d3
4 changed files with 112 additions and 100 deletions

View File

@@ -12,7 +12,7 @@
<el-table-column prop="dataC" :label="'C相'+(unit==''?'':''+unit+'')"/>
</template>
<template v-if="phaseT === 1">
<el-table-column prop="dataT" :label="currentScriptTypeName+(unit==''?'':''+unit+'')"/>
<el-table-column prop="dataT" :label="tableHeader+(unit==''?'':''+unit+'')"/>
</template>
</el-table>
</div>
@@ -25,7 +25,7 @@ import { computed } from "vue";
import {useDownload} from "@/hooks/useDownload";
import {exportRawData} from "@/api/check/test"
const {tableData} = defineProps<{
const {tableData,currentScriptTypeName} = defineProps<{
tableData: CheckData.RawDataItem[]
currentScriptTypeName: string
}>()
@@ -38,6 +38,14 @@ const phaseT = computed(() => {
return tableData[0].dataT == '/' ? 0 : 1
})
const tableHeader = computed(() => {
if (phaseT.value === 1){
let index = currentScriptTypeName.indexOf('=');
return currentScriptTypeName.substring(0, index);
}
return currentScriptTypeName
})
const exportData = () => {
useDownload(exportRawData, '原始数据.xlsx', {}, false, '.xlsx')
}

View File

@@ -63,7 +63,7 @@
</template>
<template v-if="phaseT === 1">
<el-table-column :label="currentScriptTypeName">
<el-table-column :label="tableHeader">
<el-table-column prop="stdT" :label="'标准值'+(unit==''?'':''+unit+'')"/>
<el-table-column prop="dataT" :label="'被检值'+(unit==''?'':''+unit+'')"/>
<el-table-column prop="isDataT" label="检测结果">
@@ -99,7 +99,7 @@
import {defineProps} from 'vue';
import {CheckData} from "@/api/check/interface";
const {tableData} = defineProps<{
const {tableData, currentScriptTypeName} = defineProps<{
tableData: CheckData.CheckResult[],
currentScriptTypeName: string
}>();
@@ -113,6 +113,14 @@ const phaseT = computed(() => {
return tableData[0].dataT == null || tableData[0].dataT == undefined ? 0 : 1
})
const tableHeader = computed(() => {
if (phaseT.value === 1){
let index = currentScriptTypeName.indexOf('=');
return currentScriptTypeName.substring(0, index);
}
return currentScriptTypeName
})
// const maxErrorStr = computed((data) => {
// let result = tableData[0].maxError ?? '/'
// let idx = result.indexOf('~');

View File

@@ -564,7 +564,9 @@ const toMaxErrorStr = (oldMaxErroe: any, unit: any) => {
let result = oldMaxErroe ?? '/'
let idx = result.indexOf('~');
if (idx > 0) {
result = result.substring(0, idx) + unit + result.substring(idx, result.length) + unit;
let left = result.substring(0, idx)
let right = result.substring(idx, result.length)
result = left + unit + right + unit;
}
return result;
}

View File

@@ -322,11 +322,70 @@ watch(testStatus, function (newValue, oldValue) {
})
watch(webMsgSend, function (newValue, oldValue) {
if (newValue.code == 10550) {
// ElMessageBox.alert(`${newValue.data}设备通讯失败,请检查设备连接情况!`, '初始化失败', {
// confirmButtonText: '确定',
// type: 'error',
// })
if (newValue.code == 10520) {
ElMessageBox.alert('报文解析异常!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}报文解析异常!`})
emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10521) {
ElMessageBox.alert('程控源參数有误!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}程控源參数有误!`})
emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10522) {
ElMessageBox.alert('测试项解析有误!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}测试项解析有误!`})
emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10523) {
ElMessageBox.alert('源连接失败!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}源连接失败!`})
emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10524) {
ElMessageBox.alert('获取源控制权失败!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}获取源控制权失败!`})
emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10525) {
ElMessageBox.alert('重置源失败!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}重置源失败!`})
emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10527) {
ElMessageBox.alert('源未进行初始化!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}源未进行初始化!`})
emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10528) {
ElMessageBox.alert('目标源有误(该用户已控制其他源,在关闭前无法操作新的源)', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}目标源有误(该用户已控制其他源,在关闭前无法操作新的源)`})
emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10529) {
ElMessageBox.alert('源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)`})
emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10550) {
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}${newValue.data}设备连接异常!`})
// emit('update:testStatus', 'test_init_fail')
} else if (newValue.code == 10551) {
@@ -719,6 +778,7 @@ function getTimeDifference(timeDifference: number): string {
return `: ${minutes} 分钟, ${seconds}`
}
}
watch(testLogList, () => {
scrollToBottom();
}, {deep: true})
@@ -1062,93 +1122,27 @@ const startTimer = () => {
break;
case 1:
todoItem('V')
// setTimeout(() => {
// emit('update:webMsgSend', {
// requestId: 'FREQ_Start'
// })
// }, 1000)
// setTimeout(() => {
// emit('update:webMsgSend', {
// requestId: 'FREQ_End'
// })
// }, 2000);
break;
case 2:
todoItem('I')
// emit('update:webMsgSend', {
// requestId: 'V_Start'
// })
// setTimeout(() => {
// emit('update:webMsgSend', {
// requestId: 'V_End'
// })
// }, 2000);
break;
case 3:
todoItem('IMBV')
// emit('update:webMsgSend', {
// requestId: 'HV_Start',
// })
// setTimeout(() => {
// emit('update:webMsgSend', {
// requestId: 'HV_End'
// })
// }, 2000)
break;
case 4:
todoItem('FREQ')
// emit('update:webMsgSend', {
// requestId: 'HI_Start'
// })
// setTimeout(() => {
// emit('update:webMsgSend', {
// requestId: 'HI_End'
// })
// }, 2000)
break;
case 5:
todoItem('HV')
// emit('update:webMsgSend', {
// requestId: 'HP_Start',
// })
// setTimeout(() => {
// emit('update:webMsgSend', {
// requestId: 'HP_End'
// })
// }, 2000)
break;
case 6:
todoItem('HI')
// emit('update:webMsgSend', {
// requestId: 'HSV_Start'
// })
// setTimeout(() => {
// emit('update:webMsgSend', {
// requestId: 'HSV_End'
// })
// }, 2000)
break;
case 7:
todoItem('HSV')
// emit('update:webMsgSend', {
// requestId: 'HSI_Start'
// })
// setTimeout(() => {
// emit('update:webMsgSend', {
// requestId: 'HSI_End'
// })
// }, 2000)
break;
case 8:
todoItem('HSI')
// emit('update:webMsgSend', {
// requestId: 'VOLTAGE_Start'
// })
// setTimeout(() => {
// emit('update:webMsgSend', {
// requestId: 'VOLTAGE_End'
// })
// }, 2000)
break;
// case 9:
// emit('update:webMsgSend', {