This commit is contained in:
sjl
2025-01-21 09:05:35 +08:00
parent c6ef54f7d3
commit 55368ce9b8
2 changed files with 316 additions and 231 deletions

View File

@@ -142,6 +142,79 @@ const currentStepStatus = ref<'error' | 'finish' | 'wait' | 'success' | 'process
const webMsgSend = toRef(props, 'webMsgSend');
watch(webMsgSend,function (newValue,oldValue){
if (newValue.code == 10520) {
ElMessageBox.alert('报文解析异常!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10521) {
ElMessageBox.alert('程控源參数有误!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10522) {
ElMessageBox.alert('测试项解析有误!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10523) {
ElMessageBox.alert('源连接失败!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10524) {
ElMessageBox.alert('获取源控制权失败!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10525) {
ElMessageBox.alert('重置源失败!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10527) {
ElMessageBox.alert('源未进行初始化!', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10528) {
ElMessageBox.alert('目标源有误(该用户已控制其他源,在关闭前无法操作新的源)', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10529) {
ElMessageBox.alert('源状态有误,无法响应报文(例如源处于输出状态,无法响应初始化报文)', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10550) {
ElMessageBox.alert(`${newValue.data}设备连接异常!`, '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10551) {
ElMessageBox.alert(`${newValue.data}设备触发报告异常!`, '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else if (newValue.code == 10552) { //todo 10552之后还会发送消息吗
ElMessageBox.alert('存在已经初始化步骤,执行自动关闭,请重新发起检测', '初始化失败', {
confirmButtonText: '确定',
type: 'error',
})
TableInit();
} else {
switch (newValue.requestId){
case 'yjc_ytxjy':
switch (newValue.operateCode) {
@@ -388,6 +461,7 @@ watch(webMsgSend,function (newValue,oldValue){
break;
}
}
})
//出错系数检测初始化

View File

@@ -55,7 +55,7 @@ import {
downloadCNDevTemplate,
importCNDev,
} from '@/api/device/device/index.ts'
import { ElMessageBox } from 'element-plus'
import { ElMessage, ElMessageBox } from 'element-plus'
import { onBeforeMount, reactive, ref } from 'vue'
import { useModeStore, useAppSceneStore } from '@/stores/modules/mode'
@@ -193,11 +193,22 @@ const openDialog = (titleType: string, row: Partial<Device.ResPqDev> = {}) => {
// 批量删除设备
const batchDelete = async (id: string[]) => {
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id ?? ''//获取数据字典中对应的id
await useHandleData(deletePqDev, { 'ids': id, 'pattern': patternId }, '删除所选设备')
const result = await useHandleData(deletePqDev, { 'ids': id, 'pattern': patternId }, '删除所选设备')
console.log(result)
if(result.code != 'A0000'){
proTable.value?.clearSelection()
ElMessage.error('1')
console.log('1')
}else{
ElMessage.error('12')
console.log('12')
proTable.value?.clearSelection()
proTable.value?.getTableList()
}
}
// 删除设备
const handleDelete = async (params: Device.ResPqDev) => {
const patternId = dictStore.getDictData('Pattern').find(item => item.name === modeStore.currentMode)?.id//获取数据字典中对应的id