diff --git a/frontend/src/api/check/interface/index.ts b/frontend/src/api/check/interface/index.ts index 37c35cd..e666a3f 100644 --- a/frontend/src/api/check/interface/index.ts +++ b/frontend/src/api/check/interface/index.ts @@ -90,6 +90,11 @@ export namespace CheckData { deviceId: string; //装置序号Id deviceName: string; //设备名称 chnNum: number; //设备通道数 + + planId: string; //计划Id + devType: string; //设备类型 + devVolt:number; //设备电压 + devCurr:number; //设备电流 } // 用来描述检测脚本类型 @@ -173,6 +178,16 @@ export namespace CheckData { type: 'info' | 'warning' | 'error' log: string } + + /** + * 定义手动检测时,勾选的测试项 + */ + export interface SelectTestItem { + preTest: boolean, + timeTest: boolean, + channelsTest: boolean, + test: boolean + } } diff --git a/frontend/src/api/check/test/index.ts b/frontend/src/api/check/test/index.ts index 24328ef..b81df15 100644 --- a/frontend/src/api/check/test/index.ts +++ b/frontend/src/api/check/test/index.ts @@ -2,7 +2,7 @@ import http from "@/api"; import {CheckData} from "@/api/check/interface"; export const getBigTestItem = (planId: string) => { - return http.get(`/adPlan/getBigTestItem?planId=${planId}`, {loading: false}); + return http.get(`/adPlan/getBigTestItem?planId=${planId}`); } /** diff --git a/frontend/src/stores/modules/check.ts b/frontend/src/stores/modules/check.ts index 8320624..4211a01 100644 --- a/frontend/src/stores/modules/check.ts +++ b/frontend/src/stores/modules/check.ts @@ -1,6 +1,7 @@ import {defineStore} from "pinia"; import {CHECK_STORE_KEY} from "@/stores/constant"; import type {CheckData} from "@/api/check/interface"; +import type {Plan} from '@/api/plan/interface' export const useCheckStore = defineStore("check", { @@ -8,10 +9,8 @@ export const useCheckStore = defineStore("check", { state: () => ({ devices: Array(), - planId: String(""), - planCode: String(""), - scriptId: String(""), - errorSysId: String(""), + plan: Object(), + selectTestItems: Object({preTest: true, timeTest: true, channelsTest: true, test: true}), }), getters: {}, @@ -20,25 +19,19 @@ export const useCheckStore = defineStore("check", { addDevices(device: CheckData.Device[]) { this.devices.push(...device); }, - + setPlan(plan: Plan.ResPlan) { + this.plan = plan + }, clearDevices() { this.devices = []; }, - - setPlanId(planId: string) { - this.planId = planId + initSelectTestItems() { + this.selectTestItems.preTest = true + this.selectTestItems.channelsTest = true + this.selectTestItems.test = true }, - - setPlanCode(planCode: string) { - this.planCode = planCode - }, - - setScriptId(scriptId: string) { - this.scriptId = scriptId - }, - - setErrorSysId(errorSysId: string) { - this.errorSysId = errorSysId + setSelectTestItems(selectTestItems: CheckData.SelectTestItem) { + this.selectTestItems = selectTestItems } } }); \ No newline at end of file diff --git a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue index c6414c8..156cddf 100644 --- a/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue +++ b/frontend/src/views/home/components/dataCheckSingleChannelSingleTestPopup.vue @@ -206,11 +206,11 @@ watch(() => formContent.chnNum, async (newVal, oldVal) => { if (newVal) { // 发起请求,查询该测试项的检测结果 const {data: resTreeDataTemp}: { data: CheckData.TreeItem[] } = await getTreeData({ - scriptId: checkStore.scriptId, + scriptId: checkStore.plan.scriptId, devId: deviceId, devNum: formContent.chnNum + '', scriptType: originScriptType, - code: parseInt(checkStore.planCode) + code: parseInt(checkStore.plan.code) }) updateTreeFly(resTreeDataTemp, 4) updateTreeFly(resTreeDataTemp, 2) @@ -278,10 +278,10 @@ const updateTableData = async () => { // 发起请求,查询该测试项的检测结果 const {data} = await getTableData({ scriptType, - scriptId: checkStore.scriptId, + scriptId: checkStore.plan.scriptId, devId: deviceId, devNum: formContent.chnNum + '', - code: parseInt(checkStore.planCode), + code: parseInt(checkStore.plan.code), index: parseInt(checkIndex.value), }) @@ -372,7 +372,7 @@ const open = async (_deviceId: string, chnNum: string, _scriptType: string | nul // 发起后端请求,查询详细信息 当chnNum为-1时,查询所有通道号 const {data: resFormContent}: { data: any } = await getFormData({ - planId: checkStore.planId, + planId: checkStore.plan.id, deviceId, chnNum, scriptType @@ -471,10 +471,10 @@ const setCheckResultData = (data: CheckData.ResCheckResult | null) => { const exportRawDataHandler = () => { useDownload(exportRawData, '原始数据.xlsx', { scriptType, - scriptId: checkStore.scriptId, + scriptId: checkStore.plan.scriptId, devId: deviceId, devNum: formContent.chnNum + '', - code: parseInt(checkStore.planCode), + code: parseInt(checkStore.plan.code), index: parseInt(checkIndex.value), }, false, '.xlsx') } diff --git a/frontend/src/views/home/components/factorTest.vue b/frontend/src/views/home/components/factorTest.vue new file mode 100644 index 0000000..1ea9e8d --- /dev/null +++ b/frontend/src/views/home/components/factorTest.vue @@ -0,0 +1,978 @@ + + + + + \ No newline at end of file diff --git a/frontend/src/views/home/components/selectTestItemPopup.vue b/frontend/src/views/home/components/selectTestItemPopup.vue new file mode 100644 index 0000000..21e6002 --- /dev/null +++ b/frontend/src/views/home/components/selectTestItemPopup.vue @@ -0,0 +1,85 @@ + + + + + + \ 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 1040590..e3185b7 100644 --- a/frontend/src/views/home/components/table.vue +++ b/frontend/src/views/home/components/table.vue @@ -2,16 +2,16 @@
@@ -23,35 +23,35 @@ @@ -61,36 +61,29 @@ 重置重置 + 手动检测 自动检测 - - 不合格项复检 - - 全部复检 - + type='primary' + :icon='ChatLineRound' + @click="handleTest('一键检测')" + v-if='form.activeTabs === 0' + >一键检测 + + + - 归档 - + 归档 @@ -118,11 +109,11 @@