diff --git a/frontend/src/api/check/test/index.ts b/frontend/src/api/check/test/index.ts index b81df15..53d7055 100644 --- a/frontend/src/api/check/test/index.ts +++ b/frontend/src/api/check/test/index.ts @@ -1,8 +1,12 @@ import http from "@/api"; import {CheckData} from "@/api/check/interface"; -export const getBigTestItem = (planId: string) => { - return http.get(`/adPlan/getBigTestItem?planId=${planId}`); +export const getBigTestItem = (params: { + reCheckType:number, + planId: string, + devId: string, +}) => { + return http.post(`/adPlan/getBigTestItem`, params, {loading: false}); } /** diff --git a/frontend/src/stores/modules/check.ts b/frontend/src/stores/modules/check.ts index ed7316e..5339256 100644 --- a/frontend/src/stores/modules/check.ts +++ b/frontend/src/stores/modules/check.ts @@ -11,7 +11,8 @@ export const useCheckStore = defineStore("check", { devices: Array(), plan: Object(), selectTestItems: Object({preTest: true, timeTest: true, channelsTest: false, test: true}), - checkType:1 + checkType:1, // 0:手动检测 1:自动检测 + reCheckType: 1 // 0:不合格项复检 1:全部复检 }), getters: {}, @@ -36,6 +37,9 @@ export const useCheckStore = defineStore("check", { }, setCheckType(checkType: number) { this.checkType = checkType + }, + setReCheckType(reCheckType: number) { + this.reCheckType = reCheckType } } }); \ No newline at end of file diff --git a/frontend/src/views/home/components/table.vue b/frontend/src/views/home/components/table.vue index 8ecb224..f4c011a 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -954,10 +954,12 @@ const handleTest = async (val: string) => { }) .then(() => { ElMessage.success('不合格项复检') + checkStore.setReCheckType(0) selectTestItemPopupRef.value?.open() }) .catch((action: Action) => { ElMessage.success('全部复检') + checkStore.setReCheckType(1) selectTestItemPopupRef.value?.open() }) } else { @@ -987,10 +989,30 @@ const handleTest = async (val: string) => { channelsTest.value?.open(channelsSelection.value, props.plan) return } else { - // 一键检测 checkStore.setCheckType(1) checkStore.initSelectTestItems() - openTestDialog() + // 一键检测 + if (testType === 'reTest') { + ElMessageBox.confirm('请选择复检检测方式', '设备复检', + { + distinguishCancelAndClose: true, + confirmButtonText: '不合格项复检', + cancelButtonText: '全部复检', + type: 'warning', + }) + .then(() => { + ElMessage.success('不合格项复检') + checkStore.setReCheckType(0) + openTestDialog() + }) + .catch((action: Action) => { + ElMessage.success('全部复检') + checkStore.setReCheckType(1) + openTestDialog() + }) + } else { + openTestDialog() + } } } if (val === '批量下载') { diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index 3727f90..74359e7 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -160,8 +160,7 @@