From 9703d35a3a0b533d987a2508627236f456ab9330 Mon Sep 17 00:00:00 2001 From: chendaofei <857448963@qq.com> Date: Sat, 4 Jan 2025 09:58:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=BC=8F=E6=A3=80=E6=B5=8B=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/home/components/preTest.vue | 4 +- frontend/src/views/home/components/test.vue | 60 +++++++++---------- .../src/views/home/components/testPopup.vue | 30 +++++----- 3 files changed, 48 insertions(+), 46 deletions(-) diff --git a/frontend/src/views/home/components/preTest.vue b/frontend/src/views/home/components/preTest.vue index b2e7ea7..85a517e 100644 --- a/frontend/src/views/home/components/preTest.vue +++ b/frontend/src/views/home/components/preTest.vue @@ -239,7 +239,7 @@ watch(webMsgSend,function (newValue,oldValue){ if(newValue.code == 10200) { step1InitLog.value.push({ type: 'info', - log: '源校验成功!', + log: '源初始化成功!', }) activeIndex.value = 1 step1.value = 'success' @@ -248,7 +248,7 @@ watch(webMsgSend,function (newValue,oldValue){ step1.value = 'process' step1InitLog.value = [{ type: 'wait', - log: '正在进行源校验!', + log: '正在进行源初始化!', }]; }else if(newValue.code == 10552){ ElMessage.error(newValue.code) diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index 93948dd..f7925ee 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -294,7 +294,7 @@ watch(testStatus, function (newValue, oldValue) { ElMessage.success('预检测开始!') testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:预检测开始!`}) emit('update:testStatus', 'preTest_process') - startTimer() // todo 可移除 + //startTimer() // todo 可移除 //emit('update:testStatus', 'process') // todo 可移除 } // if (newValue == 'paused' && oldValue == 'process') { @@ -309,25 +309,25 @@ watch(testStatus, function (newValue, oldValue) { watch(webMsgSend, function (newValue, oldValue) { if (activeIndex <= checkTotal) { switch (newValue.requestId) { - // case 'connect': - // switch (newValue.operateCode) { - // case "Source": - // ElMessageBox.alert('源通讯失败,请检查源连接情况!', '预检测失败', { - // confirmButtonText: '确定', - // type: 'error', - // }) - // testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源通讯失败!`}) - // break; - // case "Dev": - // ElMessageBox.alert('设备通讯失败,请检查设备连接情况!', '预检测失败', { - // confirmButtonText: '确定', - // type: 'error', - // }) - // testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:设备通讯失败!`}) - // break; - // } - // emit('update:testStatus', 'preTest_fail') - // break; + case 'connect': + switch (newValue.operateCode) { + case "Source": + ElMessageBox.alert('源通讯失败,请检查源连接情况!', '预检测失败', { + confirmButtonText: '确定', + type: 'error', + }) + testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:源通讯失败!`}) + break; + case "Dev": + ElMessageBox.alert('设备通讯失败,请检查设备连接情况!', '预检测失败', { + confirmButtonText: '确定', + type: 'error', + }) + testLogList.push({type: 'error', log: `${new Date().toLocaleString()}:设备通讯失败!`}) + break; + } + emit('update:testStatus', 'preTest_fail') + break; case 'yjc_ytxjy': switch (newValue.operateCode) { case 'INIT_GATHER': @@ -440,7 +440,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('HV') - startTimer() + // startTimer() } break; case 'HI_Start': @@ -453,7 +453,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('HI') - startTimer() + // startTimer() } break; case 'HP_Start': @@ -466,7 +466,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('HP') - startTimer() + // startTimer() } break; case 'HSV_Start': @@ -479,7 +479,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('HSV') - startTimer() + //startTimer() } break; case 'HSI_Start': @@ -492,7 +492,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('HSI') - startTimer() + //startTimer() } break; case 'VOLTAGE_Start': @@ -505,7 +505,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('VOLTAGE') - startTimer() + // startTimer() } break; case 'I_Start': @@ -518,7 +518,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('I') - startTimer() + //startTimer() } break; case 'IMBV_Start': @@ -531,7 +531,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('IMBV') - startTimer() + //startTimer() } break; case 'IMBA_Start': @@ -544,7 +544,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('IMBA') - startTimer() + //startTimer() } break; case 'F_Start': @@ -557,7 +557,7 @@ watch(webMsgSend, function (newValue, oldValue) { updateLog(false) if (testStatus.value != 'paused') { activeIndex = getNextActiveIndex('F') - startTimer() + //startTimer() } break; case 'Quit': diff --git a/frontend/src/views/home/components/testPopup.vue b/frontend/src/views/home/components/testPopup.vue index e90a878..97070cc 100644 --- a/frontend/src/views/home/components/testPopup.vue +++ b/frontend/src/views/home/components/testPopup.vue @@ -253,20 +253,22 @@ const detectionOptions = ref([ // break; case 2: if (TestStatus.value == "waiting") { - // startTest({ - // userPageId: "cdf", - // devIds:deviceIds, - // planId:planId, - // operateType:'1' // '0'为预检测、‘1‘为正式检测 - // }).then(res => { - // console.log(res) - // if (res.code === 20000) { - // TestStatus.value = 'start' - // webMsgSend.value = '' - // } else { - // ElMessage.error(res.message) - // } - // }) + startPreTest({ + userPageId: "cdf", + devIds:deviceIds, + planId:planId, + errorSysId:'cb407009f9894a8a8933b5d9b1e2f71d', + scriptId:"a303b2224845fcc6f60198b8ca23dca9", + operateType:'1' // '0'为预检测、‘1‘为正式检测 + }).then(res => { + console.log(res) + /* if (res.code === 20000) { + TestStatus.value = 'start' + webMsgSend.value = '' + } else { + ElMessage.error(res.message) + }*/ + }) TestStatus.value = 'start' } else if (TestStatus.value == 'process') { // 发送暂停指令