正式检测-过载测试显示结果
This commit is contained in:
@@ -415,6 +415,39 @@ watch(webMsgSend, function(newValue, oldValue) {
|
||||
} else {
|
||||
// ========== 根据请求ID处理不同类型的消息 ==========
|
||||
switch (newValue.requestId) {
|
||||
// 源过载测试
|
||||
case 'overloadTest':
|
||||
if (newValue.code === 1) {
|
||||
ElMessageBox.alert('电压过载!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
testLogList.push({ type: 'error', log: `${new Date().toLocaleString()}:电压过载!` })
|
||||
emit('update:testStatus', 'test_init_fail')
|
||||
count++
|
||||
}
|
||||
if (newValue.code === 2) {
|
||||
ElMessageBox.alert('电流过载!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
testLogList.push({ type: 'error', log: `${new Date().toLocaleString()}:电流过载!` })
|
||||
emit('update:testStatus', 'test_init_fail')
|
||||
count++
|
||||
}
|
||||
if (newValue.code === 3) {
|
||||
ElMessageBox.alert('电压和电流过载!', '初始化失败', {
|
||||
confirmButtonText: '确定',
|
||||
type: 'error',
|
||||
})
|
||||
testLogList.push({ type: 'error', log: `${new Date().toLocaleString()}:电压和电流过载!` })
|
||||
emit('update:testStatus', 'test_init_fail')
|
||||
count++
|
||||
}
|
||||
if (newValue.code === 4) {
|
||||
testLogList.push({ type: 'info', log: `${new Date().toLocaleString()}:过载测试成功!` })
|
||||
}
|
||||
break;
|
||||
// 服务端错误
|
||||
case 'server_error':
|
||||
if (newValue.operateCode === 'server_error' && count === 0) {
|
||||
|
||||
Reference in New Issue
Block a user