正式检测-预检测阶段错误码处理、频率、三项电压不平衡表头修改
This commit is contained in:
@@ -12,7 +12,7 @@
|
|||||||
<el-table-column prop="dataC" :label="'C相'+(unit==''?'':'('+unit+')')"/>
|
<el-table-column prop="dataC" :label="'C相'+(unit==''?'':'('+unit+')')"/>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="phaseT === 1">
|
<template v-if="phaseT === 1">
|
||||||
<el-table-column prop="dataT" :label="currentScriptTypeName+(unit==''?'':'('+unit+')')"/>
|
<el-table-column prop="dataT" :label="tableHeader+(unit==''?'':'('+unit+')')"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table>
|
</el-table>
|
||||||
</div>
|
</div>
|
||||||
@@ -25,7 +25,7 @@ import { computed } from "vue";
|
|||||||
import {useDownload} from "@/hooks/useDownload";
|
import {useDownload} from "@/hooks/useDownload";
|
||||||
import {exportRawData} from "@/api/check/test"
|
import {exportRawData} from "@/api/check/test"
|
||||||
|
|
||||||
const {tableData} = defineProps<{
|
const {tableData,currentScriptTypeName} = defineProps<{
|
||||||
tableData: CheckData.RawDataItem[]
|
tableData: CheckData.RawDataItem[]
|
||||||
currentScriptTypeName: string
|
currentScriptTypeName: string
|
||||||
}>()
|
}>()
|
||||||
@@ -38,6 +38,14 @@ const phaseT = computed(() => {
|
|||||||
return tableData[0].dataT == '/' ? 0 : 1
|
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 = () => {
|
const exportData = () => {
|
||||||
useDownload(exportRawData, '原始数据.xlsx', {}, false, '.xlsx')
|
useDownload(exportRawData, '原始数据.xlsx', {}, false, '.xlsx')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,7 +63,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="phaseT === 1">
|
<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="stdT" :label="'标准值'+(unit==''?'':'('+unit+')')"/>
|
||||||
<el-table-column prop="dataT" :label="'被检值'+(unit==''?'':'('+unit+')')"/>
|
<el-table-column prop="dataT" :label="'被检值'+(unit==''?'':'('+unit+')')"/>
|
||||||
<el-table-column prop="isDataT" label="检测结果">
|
<el-table-column prop="isDataT" label="检测结果">
|
||||||
@@ -99,7 +99,7 @@
|
|||||||
import {defineProps} from 'vue';
|
import {defineProps} from 'vue';
|
||||||
import {CheckData} from "@/api/check/interface";
|
import {CheckData} from "@/api/check/interface";
|
||||||
|
|
||||||
const {tableData} = defineProps<{
|
const {tableData, currentScriptTypeName} = defineProps<{
|
||||||
tableData: CheckData.CheckResult[],
|
tableData: CheckData.CheckResult[],
|
||||||
currentScriptTypeName: string
|
currentScriptTypeName: string
|
||||||
}>();
|
}>();
|
||||||
@@ -113,6 +113,14 @@ const phaseT = computed(() => {
|
|||||||
return tableData[0].dataT == null || tableData[0].dataT == undefined ? 0 : 1
|
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) => {
|
// const maxErrorStr = computed((data) => {
|
||||||
// let result = tableData[0].maxError ?? '/'
|
// let result = tableData[0].maxError ?? '/'
|
||||||
// let idx = result.indexOf('~');
|
// let idx = result.indexOf('~');
|
||||||
|
|||||||
@@ -564,7 +564,9 @@ const toMaxErrorStr = (oldMaxErroe: any, unit: any) => {
|
|||||||
let result = oldMaxErroe ?? '/'
|
let result = oldMaxErroe ?? '/'
|
||||||
let idx = result.indexOf('~');
|
let idx = result.indexOf('~');
|
||||||
if (idx > 0) {
|
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;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -322,11 +322,70 @@ watch(testStatus, function (newValue, oldValue) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
watch(webMsgSend, function (newValue, oldValue) {
|
watch(webMsgSend, function (newValue, oldValue) {
|
||||||
if (newValue.code == 10550) {
|
if (newValue.code == 10520) {
|
||||||
// ElMessageBox.alert(`${newValue.data}设备通讯失败,请检查设备连接情况!`, '初始化失败', {
|
ElMessageBox.alert('报文解析异常!', '初始化失败', {
|
||||||
// confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
// type: 'error',
|
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}设备连接异常!`})
|
testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:${newValue.data}设备连接异常!`})
|
||||||
// emit('update:testStatus', 'test_init_fail')
|
// emit('update:testStatus', 'test_init_fail')
|
||||||
} else if (newValue.code == 10551) {
|
} else if (newValue.code == 10551) {
|
||||||
@@ -719,6 +778,7 @@ function getTimeDifference(timeDifference: number): string {
|
|||||||
return `: ${minutes} 分钟, ${seconds} 秒`
|
return `: ${minutes} 分钟, ${seconds} 秒`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(testLogList, () => {
|
watch(testLogList, () => {
|
||||||
scrollToBottom();
|
scrollToBottom();
|
||||||
}, {deep: true})
|
}, {deep: true})
|
||||||
@@ -1062,93 +1122,27 @@ const startTimer = () => {
|
|||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
todoItem('V')
|
todoItem('V')
|
||||||
// setTimeout(() => {
|
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'FREQ_Start'
|
|
||||||
// })
|
|
||||||
// }, 1000)
|
|
||||||
// setTimeout(() => {
|
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'FREQ_End'
|
|
||||||
// })
|
|
||||||
// }, 2000);
|
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
todoItem('I')
|
todoItem('I')
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'V_Start'
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'V_End'
|
|
||||||
// })
|
|
||||||
// }, 2000);
|
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
todoItem('IMBV')
|
todoItem('IMBV')
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HV_Start',
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HV_End'
|
|
||||||
// })
|
|
||||||
// }, 2000)
|
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
todoItem('FREQ')
|
todoItem('FREQ')
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HI_Start'
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HI_End'
|
|
||||||
// })
|
|
||||||
// }, 2000)
|
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
todoItem('HV')
|
todoItem('HV')
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HP_Start',
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HP_End'
|
|
||||||
// })
|
|
||||||
// }, 2000)
|
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
todoItem('HI')
|
todoItem('HI')
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HSV_Start'
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HSV_End'
|
|
||||||
// })
|
|
||||||
// }, 2000)
|
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
todoItem('HSV')
|
todoItem('HSV')
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HSI_Start'
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'HSI_End'
|
|
||||||
// })
|
|
||||||
// }, 2000)
|
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
todoItem('HSI')
|
todoItem('HSI')
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'VOLTAGE_Start'
|
|
||||||
// })
|
|
||||||
// setTimeout(() => {
|
|
||||||
// emit('update:webMsgSend', {
|
|
||||||
// requestId: 'VOLTAGE_End'
|
|
||||||
// })
|
|
||||||
// }, 2000)
|
|
||||||
break;
|
break;
|
||||||
// case 9:
|
// case 9:
|
||||||
// emit('update:webMsgSend', {
|
// emit('update:webMsgSend', {
|
||||||
|
|||||||
Reference in New Issue
Block a user