From 1a456b2b519622483d89ec0b05238693673f32d0 Mon Sep 17 00:00:00 2001 From: lz-ui Date: Tue, 28 Oct 2025 14:36:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E6=B7=BB=E5=8A=A0D3=E9=A2=84=E6=B5=8B?= =?UTF-8?q?=E7=BB=93=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/operation/report/index.vue | 114 ++++++++++++++++++++++++++- 1 file changed, 112 insertions(+), 2 deletions(-) diff --git a/src/views/operation/report/index.vue b/src/views/operation/report/index.vue index 00f9049..78dd00e 100644 --- a/src/views/operation/report/index.vue +++ b/src/views/operation/report/index.vue @@ -135,7 +135,7 @@ - + + + + + + + + + + + + + + + + + + + + + @@ -228,6 +260,45 @@ const data = reactive({ const { queryParams } = toRefs(data) +function tableColumnActive(row, modelType, key) { + // 检查row是否为空对象或缺少必要属性 + if (!row || Object.keys(row).length === 0) { + return ''; + } + + // 确保reportResults存在且为数组 + if (!row.reportResults || !Array.isArray(row.reportResults)) { + return ''; + } + + // 查找对应modelType的数据 + const reportData = row.reportResults.find(item => item.modelType === modelType); + + // 如果没有找到对应数据,返回空字符串 + if (!reportData) { + return ''; + } + + console.log(reportData) + + // 根据key值获取对应字段的值并判断是否应该添加active类 + const value = reportData[key]; + if (value && value === '1') { + return 'table-column-active-1'; + } + if (value && value === '0.5') { + return 'table-column-active-11'; + } + if (value && value === '-1') { + return 'table-column-active-2'; + } + if (value && value === '-0.5') { + return 'table-column-active-22'; + } + + return '4'; +} + function rowPrediction(row, modelType) { return row.reportResults && row.reportResults.find(el => el.modelType === modelType) || {} @@ -381,4 +452,43 @@ onMounted(() => { // 列表查询 getList() }) - \ No newline at end of file + + + \ No newline at end of file