From 4f622da52c535ab5e587e118eb8f522612d68143 Mon Sep 17 00:00:00 2001 From: caozehui <2427765068@qq.com> Date: Tue, 18 Feb 2025 15:58:38 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=A3=80=E6=B5=8B=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E5=AF=BC=E5=85=A5=E3=80=81=E5=AF=BC=E5=87=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E9=80=82=E5=BA=94=E4=BA=8C=E6=A5=BC=E8=A3=85=E5=A4=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/api/plan/plan.ts | 12 ++++++------ frontend/src/components/ImportExcel/index.vue | 4 +++- frontend/src/views/home/components/test.vue | 11 +++++++---- frontend/src/views/plan/planList/index.vue | 18 +++++++++--------- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/frontend/src/api/plan/plan.ts b/frontend/src/api/plan/plan.ts index 9fcd542..374a511 100644 --- a/frontend/src/api/plan/plan.ts +++ b/frontend/src/api/plan/plan.ts @@ -63,17 +63,17 @@ export const getPlanListByPattern = (params: Plan.ReqPlan) => { } // 导出检测计划 -export const exportPlan = (params: Device.ReqPqDevParams) => { - return http.download(`/adPlan/export`, params) +export const exportCNPlan = (params: Device.ReqPqDevParams) => { + return http.download(`/adPlan/exportCNPlan`, params) } // 下载模板 -export const downloadTemplate = () => { - return http.download(`/adPlan/downloadTemplate`) +export const downloadCNPlanTemplate = () => { + return http.download(`/adPlan/downloadCNPlanTemplate`) } // 导入检测计划 -export const importPlan = (params: Device.ReqPqDevParams) => { - return http.upload(`/adPlan/import`, params) +export const importCNPlan = (params: Device.ReqPqDevParams) => { + return http.uploadExcel(`/adPlan/importCNPlan`, params) } // 装置检测报告生成 diff --git a/frontend/src/components/ImportExcel/index.vue b/frontend/src/components/ImportExcel/index.vue index 7123b20..06f6460 100644 --- a/frontend/src/components/ImportExcel/index.vue +++ b/frontend/src/components/ImportExcel/index.vue @@ -97,6 +97,8 @@ const uploadExcel = async (param: UploadRequestOptions) => { async function handleImportResponse(res: any) { + console.log(res) + if (res.type === 'application/json') { const fileReader = new FileReader() fileReader.onloadend = () => { @@ -118,7 +120,7 @@ async function handleImportResponse(res: any) { const url = window.URL.createObjectURL(blob) const link = document.createElement('a') link.href = url - link.download = '终端入网检测失败列表' + link.download = '导入失败数据' document.body.appendChild(link) link.click() link.remove() diff --git a/frontend/src/views/home/components/test.vue b/frontend/src/views/home/components/test.vue index bbb5f90..e613ef0 100644 --- a/frontend/src/views/home/components/test.vue +++ b/frontend/src/views/home/components/test.vue @@ -320,10 +320,7 @@ watch(testStatus, function (newValue, oldValue) { if (oldValue == 'error') { testLogList.push({type: 'info', log: `${new Date().toLocaleString()}:开始重新检测!`}) - - initCheckResult() - activeIndex = 0 - percentage.value = 0 + handleReCheck() } emit('update:testStatus', 'test_init') //startTimer() // todo 可移除 @@ -1334,11 +1331,17 @@ const handleResumeTest = () => { }; const handleReCheck = () => { + initCheckResult() activeIndex = 0 percentage.value = 0 + timeCount.value = 0 + timeView.value = '00:00:00' + timeDifference.value = 0 testLogList.length = 0 errorCheckItem.length = 0 count = 0 + + showTestLog() } // 获取当前执行的大测试项序号 diff --git a/frontend/src/views/plan/planList/index.vue b/frontend/src/views/plan/planList/index.vue index d823493..a74b926 100644 --- a/frontend/src/views/plan/planList/index.vue +++ b/frontend/src/views/plan/planList/index.vue @@ -37,7 +37,7 @@ - + @@ -46,7 +46,7 @@ import ProTable from '@/components/ProTable/index.vue' import type { ProTableInstance, ColumnProps } from '@/components/ProTable/interface' import { ScaleToOriginal, CirclePlus, Delete, EditPen, View, Upload, Download, List, Tools } from '@element-plus/icons-vue' -import {getPlanList,deletePlan,exportPlan,downloadTemplate,importPlan } from '@/api/plan/plan.ts' +import {getPlanList,deletePlan,exportCNPlan,downloadCNPlanTemplate,importCNPlan } from '@/api/plan/plan.ts' import { computed, onMounted, reactive, ref } from 'vue' import type { Plan } from '@/api/plan/interface' import PlanPopup from '@/views/plan/planList/components/planPopup.vue' // 导入子组件 @@ -66,7 +66,7 @@ import { useModeStore } from '@/stores/modules/mode'; // 引入模式 store import { useHandleData } from '@/hooks/useHandleData' import { dictTestState,dictReportState,dictResult } from '@/api/plan/planData.ts' import {getTestSourceById} from '@/api/device/testSource/index' -import ImportExcel from "@/components/ImportExcel/index.vue"; +import ImportExcel from '@/components/ImportExcel/index.vue' import {useDownload} from "@/hooks/useDownload"; import {getTestConfig } from '@/api/system/base/index' import {type Base } from '@/api/system/base/interface' @@ -88,7 +88,7 @@ const planPopup = ref() const devTransferPopup = ref() const modeStore = useModeStore(); -const deviceImportExcel = ref | null>(null) +const planImportExcel = ref | null>(null) const getTableList = async(params: any) => { let newParams = JSON.parse(JSON.stringify(params)) @@ -336,21 +336,21 @@ function handleFiles(event: Event) { // 点击导入按钮 const importClick = () => { const params = { - title: '被检设备', + title: '检测计划', showCover: false, patternId: dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id ?? '', - tempApi: downloadTemplate, - importApi: importPlan, + tempApi: downloadCNPlanTemplate, + importApi: importCNPlan, getTableList: proTable.value?.getTableList, } - deviceImportExcel.value?.acceptParams(params) + planImportExcel.value?.acceptParams(params) } // 点击导出按钮 const exportClick = () => { ElMessageBox.confirm('确认导出检测计划?', '温馨提示', { type: 'warning' }).then(() =>{ const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id - useDownload(exportPlan,'检测计划导出数据', {...proTable.value?.searchParam,pattern:patternId}, false,'.xlsx') + useDownload(exportCNPlan,'检测计划导出数据', {...proTable.value?.searchParam,pattern:patternId}, false,'.xlsx') }) }