引入暂停、继续检测接口
This commit is contained in:
@@ -45,4 +45,4 @@ export const getTableData = (params: {
|
||||
index: number,
|
||||
}) => {
|
||||
return http.post("/result/resultData/", params, {loading: false});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@ export const startTest = (params) => {
|
||||
* 暂停正式检测
|
||||
* @param params
|
||||
*/
|
||||
export const pauseTest = (params) => {
|
||||
return http.post(`/test/pauseTest`, params, {loading: false})
|
||||
export const pauseTest = () => {
|
||||
return http.get(`/test/closePreTest`, params, {loading: false})
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -30,5 +30,5 @@ export const pauseTest = (params) => {
|
||||
* @param 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')
|
||||
handlePauseTest()
|
||||
break;
|
||||
case 'Pause_Fail':
|
||||
ElMessage.error('暂停失败')
|
||||
break;
|
||||
// case 'Pause_Fail':
|
||||
// ElMessage.error('暂停失败')
|
||||
// break;
|
||||
case 'Resume_Success':
|
||||
ElMessage.success('开始继续检测')
|
||||
emit('update:testStatus', 'process')
|
||||
handleResumeTest()
|
||||
break;
|
||||
case 'Resume_Fail':
|
||||
ElMessage.error('无法继续检测')
|
||||
break;
|
||||
// case 'Resume_Fail':
|
||||
// ElMessage.error('无法继续检测')
|
||||
// break;
|
||||
case 'FREQ_Start':
|
||||
activeIndex = getActiveIndex('FREQ')
|
||||
updateCheckResultView("FREQ", true)
|
||||
|
||||
@@ -77,7 +77,7 @@ import timeTest from './timeTest.vue'
|
||||
import {Device} from '@/api/device/interface/device';
|
||||
import socketClient from '@/utils/webSocketClient';
|
||||
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';
|
||||
@@ -378,18 +378,29 @@ watch(ActiveStatue, function (newValue, oldValue) {
|
||||
})
|
||||
|
||||
const sendPause = () => {
|
||||
console.log('发送暂停指令')
|
||||
console.log('发起暂停请求')
|
||||
|
||||
Object.assign(webMsgSend.value, {
|
||||
requestId: 'Pause_Success'
|
||||
}) // todo 可移除
|
||||
pauseTest().then(res => {
|
||||
Object.assign(webMsgSend.value, {
|
||||
requestId: 'Pause_Success'
|
||||
})
|
||||
})
|
||||
}
|
||||
const sendResume = () => {
|
||||
console.log('发送继续检测指令')
|
||||
console.log('发起继续检测请求')
|
||||
|
||||
Object.assign(webMsgSend.value, {
|
||||
requestId: 'Resume_Success'
|
||||
}) // todo 可移除
|
||||
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, {
|
||||
requestId: 'Resume_Success'
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const sendReCheck = () => {
|
||||
|
||||
Reference in New Issue
Block a user