diff --git a/frontend/src/api/check/test/index.ts b/frontend/src/api/check/test/index.ts index 53d16ab..80d7653 100644 --- a/frontend/src/api/check/test/index.ts +++ b/frontend/src/api/check/test/index.ts @@ -45,4 +45,4 @@ export const getTableData = (params: { index: number, }) => { return http.post("/result/resultData/", params, {loading: false}); -} \ No newline at end of file +} diff --git a/frontend/src/api/socket/socket.ts b/frontend/src/api/socket/socket.ts index 0236aaa..02d59f3 100644 --- a/frontend/src/api/socket/socket.ts +++ b/frontend/src/api/socket/socket.ts @@ -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}) } diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index 557f4bb..07e9458 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -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) diff --git a/frontend/src/views/home/components/testPopup.vue b/frontend/src/views/home/components/testPopup.vue index 9bfc4ea..bd1a595 100644 --- a/frontend/src/views/home/components/testPopup.vue +++ b/frontend/src/views/home/components/testPopup.vue @@ -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 = () => {