Merge branch 'master' of http://192.168.1.22:3000/frontend/pqs-9100_client
This commit is contained in:
@@ -4,24 +4,24 @@ import { ElNotification } from "element-plus";
|
||||
* @description 全局代码错误捕捉
|
||||
* */
|
||||
const errorHandler = (error: any) => {
|
||||
// 过滤 HTTP 请求错误
|
||||
if (error.status || error.status == 0) return false;
|
||||
let errorMap: { [key: string]: string } = {
|
||||
InternalError: "Javascript引擎内部错误",
|
||||
ReferenceError: "未找到对象",
|
||||
TypeError: "使用了错误的类型或对象",
|
||||
RangeError: "使用内置对象时,参数超范围",
|
||||
SyntaxError: "语法错误",
|
||||
EvalError: "错误的使用了Eval",
|
||||
URIError: "URI错误"
|
||||
};
|
||||
let errorName = errorMap[error.name] || "未知错误";
|
||||
ElNotification({
|
||||
title: errorName,
|
||||
message: error,
|
||||
type: "error",
|
||||
duration: 3000
|
||||
});
|
||||
// // 过滤 HTTP 请求错误
|
||||
// if (error.status || error.status == 0) return false;
|
||||
// let errorMap: { [key: string]: string } = {
|
||||
// InternalError: "Javascript引擎内部错误",
|
||||
// ReferenceError: "未找到对象",
|
||||
// TypeError: "使用了错误的类型或对象",
|
||||
// RangeError: "使用内置对象时,参数超范围",
|
||||
// SyntaxError: "语法错误",
|
||||
// EvalError: "错误的使用了Eval",
|
||||
// URIError: "URI错误"
|
||||
// };
|
||||
// let errorName = errorMap[error.name] || "未知错误";
|
||||
// ElNotification({
|
||||
// title: errorName,
|
||||
// message: error,
|
||||
// type: "error",
|
||||
// duration: 3000
|
||||
// });
|
||||
};
|
||||
|
||||
export default errorHandler;
|
||||
|
||||
@@ -154,8 +154,7 @@
|
||||
v-if="form.activeTabs === 4"
|
||||
>数据查看</el-button
|
||||
> -->
|
||||
<el-button
|
||||
:type="scope.row.check_State === '检测完成' ? 'primary' : 'info'"
|
||||
<el-button type='primary'
|
||||
link
|
||||
:icon="Notebook"
|
||||
@click="openDrawer('归档', scope.row)"
|
||||
@@ -264,6 +263,7 @@ import { useDownload } from '@/hooks/useDownload'
|
||||
import {downloadDevData} from '@/api/plan/plan.ts'
|
||||
import {documentedPqDev} from "@/api/device/device";
|
||||
import { getPqDev } from '@/api/device/device/index.ts'
|
||||
import {ResultEnum} from "@/enums/httpEnum";
|
||||
const dictStore = useDictStore()
|
||||
const checkStore = useCheckStore()
|
||||
const webMsgSend = ref();//webSocket推送的数据
|
||||
@@ -1014,7 +1014,11 @@ const handleTest = async (val:string) => {
|
||||
// loading.close()
|
||||
// ElMessage.success("归档成功");
|
||||
// }, 2000)
|
||||
documentedPqDev(checkStore.devices.map(item => {item.deviceId}))
|
||||
documentedPqDev(checkStore.devices.map(item => {item.deviceId})).then((res) => {
|
||||
if(res.code === ResultEnum.SUCCESS){
|
||||
ElMessage.success("归档成功!");
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -1052,7 +1056,11 @@ const openDrawer = async (title: string, row: any) => {
|
||||
|
||||
if (title === '归档')
|
||||
{
|
||||
await documentedPqDev([row.id])
|
||||
await documentedPqDev([row.id]).then((res) => {
|
||||
if(res.code === ResultEnum.SUCCESS){
|
||||
ElMessage.success("归档成功!");
|
||||
}
|
||||
})
|
||||
emit('batchGenerateClicked'); // 触发事件
|
||||
// const loading = ElLoading.service({
|
||||
// lock: true,
|
||||
|
||||
@@ -880,7 +880,13 @@ const updateCheckResultView = (scriptCode: string, isStart: boolean, devices: Ch
|
||||
// chnResult: [1, 1, 1, 1],
|
||||
// deviceId: "ae5a7628260349c0a5e7c86c81fbd417",
|
||||
// deviceName: "240004"
|
||||
// }]
|
||||
// }
|
||||
// {
|
||||
// chnResult: [1, 1, 1, 1],
|
||||
// deviceId: "2957b271f39d4240a1c5e275c453676c",
|
||||
// deviceName: "测试003"
|
||||
// },
|
||||
// ]
|
||||
let temp = null
|
||||
if (isStart) {
|
||||
temp = getLoadingResult(scriptType)
|
||||
@@ -1074,6 +1080,62 @@ const startTimer = () => {
|
||||
}, 6000)
|
||||
break;
|
||||
case 1:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'V_Start'
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'V_End'
|
||||
})
|
||||
}, 2000);
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'FREQ_Start'
|
||||
// })
|
||||
// }, 1000)
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'FREQ_End'
|
||||
// })
|
||||
// }, 2000);
|
||||
break;
|
||||
case 2:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'I_Start'
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'I_End'
|
||||
})
|
||||
}, 2000)
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'V_Start'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'V_End'
|
||||
// })
|
||||
// }, 2000);
|
||||
break;
|
||||
case 3:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'IMBV_Start'
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'IMBV_End'
|
||||
})
|
||||
}, 2000)
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HV_Start',
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HV_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
break;
|
||||
case 4:
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'FREQ_Start'
|
||||
@@ -1084,18 +1146,16 @@ const startTimer = () => {
|
||||
requestId: 'FREQ_End'
|
||||
})
|
||||
}, 2000);
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HI_Start'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HI_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
break;
|
||||
case 2:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'V_Start'
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'V_End'
|
||||
})
|
||||
}, 2000);
|
||||
break;
|
||||
case 3:
|
||||
case 5:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'HV_Start',
|
||||
})
|
||||
@@ -1104,8 +1164,16 @@ const startTimer = () => {
|
||||
requestId: 'HV_End'
|
||||
})
|
||||
}, 2000)
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HP_Start',
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HP_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
break;
|
||||
case 4:
|
||||
case 6:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'HI_Start'
|
||||
})
|
||||
@@ -1114,18 +1182,16 @@ const startTimer = () => {
|
||||
requestId: 'HI_End'
|
||||
})
|
||||
}, 2000)
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HSV_Start'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HSV_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
break;
|
||||
case 5:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'HP_Start',
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'HP_End'
|
||||
})
|
||||
}, 2000)
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'HSV_Start'
|
||||
})
|
||||
@@ -1134,8 +1200,16 @@ const startTimer = () => {
|
||||
requestId: 'HSV_End'
|
||||
})
|
||||
}, 2000)
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HSI_Start'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'HSI_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
break;
|
||||
case 7:
|
||||
case 8:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'HSI_Start'
|
||||
})
|
||||
@@ -1144,57 +1218,55 @@ const startTimer = () => {
|
||||
requestId: 'HSI_End'
|
||||
})
|
||||
}, 2000)
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'VOLTAGE_Start'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'VOLTAGE_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
break;
|
||||
case 8:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'VOLTAGE_Start'
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'VOLTAGE_End'
|
||||
})
|
||||
}, 2000)
|
||||
break;
|
||||
case 9:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'I_Start'
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'I_End'
|
||||
})
|
||||
}, 2000)
|
||||
break;
|
||||
case 10:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'IMBV_Start'
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'IMBV_End'
|
||||
})
|
||||
}, 2000)
|
||||
break;
|
||||
case 11:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'IMBA_Start'
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'IMBA_End'
|
||||
})
|
||||
}, 2000)
|
||||
break;
|
||||
case 12:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'F_Start'
|
||||
})
|
||||
setTimeout(() => {
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'F_End'
|
||||
})
|
||||
}, 2000)
|
||||
break;
|
||||
// case 9:
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'I_Start'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'I_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
// break;
|
||||
// case 10:
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'IMBV_Start'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'IMBV_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
// break;
|
||||
// case 11:
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'IMBA_Start'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'IMBA_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
// break;
|
||||
// case 12:
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'F_Start'
|
||||
// })
|
||||
// setTimeout(() => {
|
||||
// emit('update:webMsgSend', {
|
||||
// requestId: 'F_End'
|
||||
// })
|
||||
// }, 2000)
|
||||
// break;
|
||||
case 13:
|
||||
emit('update:webMsgSend', {
|
||||
requestId: 'Quit'
|
||||
|
||||
Reference in New Issue
Block a user