引入暂停、继续检测接口
This commit is contained in:
@@ -21,8 +21,8 @@ export const startTest = (params) => {
|
|||||||
* 暂停正式检测
|
* 暂停正式检测
|
||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const pauseTest = (params) => {
|
export const pauseTest = () => {
|
||||||
return http.post(`/test/pauseTest`, params, {loading: false})
|
return http.get(`/test/closePreTest`, params, {loading: false})
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -30,5 +30,5 @@ export const pauseTest = (params) => {
|
|||||||
* @param params
|
* @param params
|
||||||
*/
|
*/
|
||||||
export const resumeTest = (params) => {
|
export const resumeTest = (params) => {
|
||||||
return http.post(`/test/resumeTest`, params, {loading: false})
|
return http.post(`/prepare/restartTemTest/`, params, {loading: false})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -418,17 +418,17 @@ watch(webMsgSend, function (newValue, oldValue) {
|
|||||||
emit('update:testStatus', 'paused')
|
emit('update:testStatus', 'paused')
|
||||||
handlePauseTest()
|
handlePauseTest()
|
||||||
break;
|
break;
|
||||||
case 'Pause_Fail':
|
// case 'Pause_Fail':
|
||||||
ElMessage.error('暂停失败')
|
// ElMessage.error('暂停失败')
|
||||||
break;
|
// break;
|
||||||
case 'Resume_Success':
|
case 'Resume_Success':
|
||||||
ElMessage.success('开始继续检测')
|
ElMessage.success('开始继续检测')
|
||||||
emit('update:testStatus', 'process')
|
emit('update:testStatus', 'process')
|
||||||
handleResumeTest()
|
handleResumeTest()
|
||||||
break;
|
break;
|
||||||
case 'Resume_Fail':
|
// case 'Resume_Fail':
|
||||||
ElMessage.error('无法继续检测')
|
// ElMessage.error('无法继续检测')
|
||||||
break;
|
// break;
|
||||||
case 'FREQ_Start':
|
case 'FREQ_Start':
|
||||||
activeIndex = getActiveIndex('FREQ')
|
activeIndex = getActiveIndex('FREQ')
|
||||||
updateCheckResultView("FREQ", true)
|
updateCheckResultView("FREQ", true)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ import timeTest from './timeTest.vue'
|
|||||||
import {Device} from '@/api/device/interface/device';
|
import {Device} from '@/api/device/interface/device';
|
||||||
import socketClient from '@/utils/webSocketClient';
|
import socketClient from '@/utils/webSocketClient';
|
||||||
import {useCheckStore} from "@/stores/modules/check";
|
import {useCheckStore} from "@/stores/modules/check";
|
||||||
import {startPreTest, startTest, pauseTest, resumeTest} from '@/api/socket/socket'
|
import {startPreTest, pauseTest, resumeTest} from '@/api/socket/socket'
|
||||||
|
|
||||||
|
|
||||||
//import SvgIcon from '@/components/SvgIcon.vue';
|
//import SvgIcon from '@/components/SvgIcon.vue';
|
||||||
@@ -378,18 +378,29 @@ watch(ActiveStatue, function (newValue, oldValue) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const sendPause = () => {
|
const sendPause = () => {
|
||||||
console.log('发送暂停指令')
|
console.log('发起暂停请求')
|
||||||
|
|
||||||
|
pauseTest().then(res => {
|
||||||
Object.assign(webMsgSend.value, {
|
Object.assign(webMsgSend.value, {
|
||||||
requestId: 'Pause_Success'
|
requestId: 'Pause_Success'
|
||||||
}) // todo 可移除
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
const sendResume = () => {
|
const sendResume = () => {
|
||||||
console.log('发送继续检测指令')
|
console.log('发起继续检测请求')
|
||||||
|
|
||||||
|
resumeTest({
|
||||||
|
userPageId: "cdf",
|
||||||
|
devIds: checkStore.devices.map((item) => item.deviceId),
|
||||||
|
planId: checkStore.planId,
|
||||||
|
errorSysId: 'cb407009f9894a8a8933b5d9b1e2f71d',
|
||||||
|
scriptId: "a303b2224845fcc6f60198b8ca23dca9",
|
||||||
|
operateType: '2' // '1'为预检测、‘2‘为正式检测
|
||||||
|
}).then(res => {
|
||||||
Object.assign(webMsgSend.value, {
|
Object.assign(webMsgSend.value, {
|
||||||
requestId: 'Resume_Success'
|
requestId: 'Resume_Success'
|
||||||
}) // todo 可移除
|
})
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const sendReCheck = () => {
|
const sendReCheck = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user