diff --git a/frontend/src/api/check/interface/index.ts b/frontend/src/api/check/interface/index.ts index 36189bb..02fa7ce 100644 --- a/frontend/src/api/check/interface/index.ts +++ b/frontend/src/api/check/interface/index.ts @@ -42,8 +42,9 @@ export namespace CheckData { // 用来描述检测脚本类型 export interface ScriptItem { id: string, + code: string, scriptItemName: string, - children?: ScriptItem[] + //children?: ScriptItem[] } // 用来描述 通道检测结果 diff --git a/frontend/src/api/check/test/index.ts b/frontend/src/api/check/test/index.ts index b3cd167..23ece4c 100644 --- a/frontend/src/api/check/test/index.ts +++ b/frontend/src/api/check/test/index.ts @@ -1,5 +1,5 @@ import http from "@/api"; -export const getCheckItemDetail = (params: { checkItemId: string, deviceId: string, chnNum: number }) => { +export const getCheckItemDetail = (params: { deviceId: string, chnNum: number, checkItemId?: string }) => { return http.post("/check/test/detail/", 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 b292381..2ba2729 100644 --- a/frontend/src/api/socket/socket.ts +++ b/frontend/src/api/socket/socket.ts @@ -1,7 +1,34 @@ -import type { Device } from '@/api/device/interface/device' import http from '@/api' -export const startTest = (params) => { - return http.post(`/prepare/startTest`, params,{ loading: false }) -} \ No newline at end of file +export const startPreTest = (params) => { + return http.post(`/prepare/startPreTest`, params, {loading: false}) +} + +export const closePreTest = (params) => { + return http.post(`/prepare/closePreTest`, params,{ loading: false }) +} + +/** + * 开始正式检测 + * @param params + */ +export const startTest = (params: { deviceIds: string[] }) => { + return http.post(`/test/startTest`, params, {loading: false}) +} + +/** + * 暂停正式检测 + * @param params + */ +export const pauseTest = (params: { deviceIds: string[] }) => { + return http.post(`/test/pauseTest`, params, {loading: false}) +} + +/** + * 继续正式检测 + * @param params + */ +export const resumeTest = (params: { deviceIds: string[] }) => { + return http.post(`/test/resumeTest`, params, {loading: false}) +} diff --git a/frontend/src/stores/modules/check.ts b/frontend/src/stores/modules/check.ts index b7022d2..c399b9c 100644 --- a/frontend/src/stores/modules/check.ts +++ b/frontend/src/stores/modules/check.ts @@ -7,7 +7,8 @@ export const useCheckStore = defineStore("check", { id: CHECK_STORE_KEY, state: () => ({ - devices: Array() + devices: Array(), + planId: String(""), }), getters: {}, @@ -19,6 +20,10 @@ export const useCheckStore = defineStore("check", { clearDevices() { this.devices = []; + }, + + setPlanId(planId: string) { + this.planId = planId } } }); \ No newline at end of file diff --git a/frontend/src/utils/webSocketClient.ts b/frontend/src/utils/webSocketClient.ts index 949cb30..0a84277 100644 --- a/frontend/src/utils/webSocketClient.ts +++ b/frontend/src/utils/webSocketClient.ts @@ -62,7 +62,7 @@ export default class SocketService { if (message?.type && this.callBackMapping[message.type]) { this.callBackMapping[message.type](message); } else { - console.log("抛弃") + console.log("抛弃====>"+message) /* 丢弃或继续写你的逻辑 */ } }; diff --git a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue index f26fd7f..9708690 100644 --- a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue @@ -67,6 +67,7 @@ import DataCheckResultTable from './dataCheckResultTable.vue' import DataCheckRawDataTable from './dataCheckRawDataTable.vue' import {CheckData} from "@/api/check/interface"; import {data as treeData} from "@/api/plan/autoTest.json"; +import {getCheckItemDetail} from "@/api/check/test"; const {appendToBody} = withDefaults(defineProps<{ appendToBody: boolean @@ -279,10 +280,14 @@ const close = () => { visible.value = false; }; -const open = (checkItemId: string, deviceId: string, chnNum?: number) => { - console.log(checkItemId, deviceId, chnNum); +const open = async (deviceId: string, chnNum: number, checkItemId?: string) => { // 发起后端请求,查询详细信息 - //const result = await getCheckItemDetail({checkItemId,deviceId, chnNum}) + // 当checkItemId为空时,默认显示全部测试项、全部不合格测试项 + // 当checkItemId不为空时,默认显示当前checkItemId的测试项、属于当前checkItemId的不合格测试项 + checkItemId = checkItemId ?? '' + console.log(deviceId, chnNum, checkItemId); + //const result = await getCheckItemDetail({deviceId, chnNum, checkItemId}) + // 数据处理 // checkResultTableData=[]; @@ -330,6 +335,7 @@ defineExpose({ padding: 10px 0; border: 1px solid #ccc; overflow: auto; + .content-tree { min-width: 100%; height: 100%; diff --git a/frontend/src/views/home/components/preTest.vue b/frontend/src/views/home/components/preTest.vue index ca21ee1..aa11a81 100644 --- a/frontend/src/views/home/components/preTest.vue +++ b/frontend/src/views/home/components/preTest.vue @@ -13,12 +13,12 @@
- - - - - + finish-status="success"> + + + + +
@@ -63,7 +63,7 @@ @@ -935,4 +989,5 @@ const handleFinishTest = () => { padding: 5px 0 !important; } + diff --git a/frontend/src/views/home/components/testPopup.vue b/frontend/src/views/home/components/testPopup.vue index 6612b96..177333b 100644 --- a/frontend/src/views/home/components/testPopup.vue +++ b/frontend/src/views/home/components/testPopup.vue @@ -14,10 +14,10 @@
- + - +