正式检测-过载测试显示结果
This commit is contained in:
@@ -415,6 +415,39 @@ watch(webMsgSend, function(newValue, oldValue) {
|
|||||||
} else {
|
} else {
|
||||||
// ========== 根据请求ID处理不同类型的消息 ==========
|
// ========== 根据请求ID处理不同类型的消息 ==========
|
||||||
switch (newValue.requestId) {
|
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':
|
case 'server_error':
|
||||||
if (newValue.operateCode === 'server_error' && count === 0) {
|
if (newValue.operateCode === 'server_error' && count === 0) {
|
||||||
|
|||||||
@@ -133,7 +133,8 @@
|
|||||||
(ActiveStatue === 'success' ||
|
(ActiveStatue === 'success' ||
|
||||||
ActiveStatue === 'error' ||
|
ActiveStatue === 'error' ||
|
||||||
ActiveStatue === 'connect_timeout' ||
|
ActiveStatue === 'connect_timeout' ||
|
||||||
ActiveStatue === 'pause_timeout')
|
ActiveStatue === 'pause_timeout'||
|
||||||
|
ActiveStatue === 'test_init_fail')
|
||||||
"
|
"
|
||||||
@click="nextStep"
|
@click="nextStep"
|
||||||
>
|
>
|
||||||
@@ -472,7 +473,11 @@ watch(TestStatus, function (newValue, oldValue) {
|
|||||||
|
|
||||||
// 监听总体状态变化,处理步骤切换和错误状态
|
// 监听总体状态变化,处理步骤切换和错误状态
|
||||||
watch(ActiveStatue, function (newValue, oldValue) {
|
watch(ActiveStatue, function (newValue, oldValue) {
|
||||||
|
//初始化失败
|
||||||
|
if(newValue==='test_init_fail'){
|
||||||
|
stepsActiveIndex.value = stepsTotalNum.value + 1 // 跳到最后一步
|
||||||
|
nextStepText.value = '初始化失败'
|
||||||
|
}
|
||||||
|
|
||||||
// 处理错误状态
|
// 处理错误状态
|
||||||
if (newValue === 'error') {
|
if (newValue === 'error') {
|
||||||
|
|||||||
Reference in New Issue
Block a user