From 7a76c2da8aef531bdca32c4f309a7b2bb5802380 Mon Sep 17 00:00:00 2001 From: sjl <1716605279@qq.com> Date: Fri, 21 Feb 2025 14:57:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/views/plan/planList/index.vue | 26 +++++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/frontend/src/views/plan/planList/index.vue b/frontend/src/views/plan/planList/index.vue index a74b926..cded017 100644 --- a/frontend/src/views/plan/planList/index.vue +++ b/frontend/src/views/plan/planList/index.vue @@ -13,7 +13,7 @@ 合并 新增 - 统计分析 + 统计分析 删除 @@ -24,7 +24,7 @@ 编辑 删除 - 统计分析 + 统计分析 @@ -89,13 +89,19 @@ const devTransferPopup = ref() const modeStore = useModeStore(); const planImportExcel = ref | null>(null) - +const planList = ref([]); const getTableList = async(params: any) => { let newParams = JSON.parse(JSON.stringify(params)) const patternId = dictStore.getDictData('Pattern').find(item=>item.name=== modeStore.currentMode)?.id//获取数据字典中对应的id newParams.pattern = patternId - return getPlanList(newParams) + try { + const result = await getPlanList(newParams); + planList.value = result.data as Plan.ResPlan[]; + return result; + } catch (error) { + return { data: [] }; // 返回空数据或处理错误 + } } @@ -396,8 +402,16 @@ const showDeviceOpen = (row: Partial = {}) => { const myDict = new Map(); -const statisticalAnalysisMore = async (id: string[]) =>{ - useDownload(staticsAnalyse,'分析结果', id, false,'.xlsx') +const statisticalAnalysisMore = async (ids: string[], rows: Plan.ReqPlan[]) => { + const hasInvalidState = rows.some(row => row.testState != 2); + if (hasInvalidState) { + ElMessage({ + type: 'error', + message: '存在检测状态不为检测完成的计划,无法进行统计分析。', + }); + return; + } + useDownload(staticsAnalyse,'分析结果', ids, false,'.xlsx') } const statisticalAnalysis = async (row: Partial = {}) => {