From b3f2fb5aef5945a5b7790d41cdb9504d1650c1e5 Mon Sep 17 00:00:00 2001
From: zss <zss@example.com>
Date: 星期三, 18 三月 2026 17:04:40 +0800
Subject: [PATCH] 能耗成本核算---按日月汇总统计页面对接

---
 src/components/PIMTable/PIMTable.vue |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/src/components/PIMTable/PIMTable.vue b/src/components/PIMTable/PIMTable.vue
index 976086b..629e972 100644
--- a/src/components/PIMTable/PIMTable.vue
+++ b/src/components/PIMTable/PIMTable.vue
@@ -41,7 +41,8 @@
                      :align="item.align"
                      :sortable="!!item.sortable"
                      :type="item.type"
-                     :width="item.width">
+                     :width="item.width"
+                     :class-name="item.className || ''">
       <template #header="scope">
         <div class="pim-table-header-cell">
           <div class="pim-table-header-title">
@@ -85,9 +86,9 @@
               typeof dataTypeFn(scope.row[item.prop], item.formatData) ===
               'string'
             "
-                  :title="formatters(scope.row[item.prop], item.formatData)"
+                  :title="formatters(scope.row[item.prop], item.formatData, scope.row)"
                   :type="formatType(scope.row[item.prop], item.formatType)">
-            {{ formatters(scope.row[item.prop], item.formatData) }}
+            {{ formatters(scope.row[item.prop], item.formatData, scope.row) }}
           </el-tag>
           <el-tag v-for="(tag, index) in dataTypeFn(
               scope.row[item.prop],
@@ -98,14 +99,14 @@
               'object'
             "
                   :key="index"
-                  :title="formatters(scope.row[item.prop], item.formatData)"
+                  :title="formatters(scope.row[item.prop], item.formatData, scope.row)"
                   :type="formatType(tag, item.formatType)">
             {{ item.tagGroup ? tag[item.tagGroup.label] ?? tag : tag }}
           </el-tag>
           <el-tag v-else
-                  :title="formatters(scope.row[item.prop], item.formatData)"
+                  :title="formatters(scope.row[item.prop], item.formatData, scope.row)"
                   :type="formatType(scope.row[item.prop], item.formatType)">
-            {{ formatters(scope.row[item.prop], item.formatData) }}
+            {{ formatters(scope.row[item.prop], item.formatData, scope.row) }}
           </el-tag>
         </div>
         <!-- 鎸夐挳 -->
@@ -171,6 +172,7 @@
         <!-- 鍙偣鍑荤殑鏂囧瓧 -->
         <div v-else-if="item.dataType == 'link'"
              class="cell link"
+             :class="item.className || ''"
              style="width: 100%"
              @click="goLink(scope.row, item.linkMethod)">
           <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span>
@@ -178,10 +180,11 @@
         <!-- 榛樿绾睍绀烘暟鎹� -->
         <div v-else
              class="cell"
+             :class="item.className || ''"
              style="width: 100%">
           <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span>
           <span v-else>{{
-            formatters(scope.row[item.prop], item.formatData)
+            formatters(scope.row[item.prop], item.formatData, scope.row)
           }}</span>
         </div>
       </template>
@@ -217,8 +220,8 @@
     return typeof val === "function" ? val(row) : val;
   };
 
-  const formatters = (val, format) => {
-    return typeof format === "function" ? format(val) : val;
+  const formatters = (val, format, row) => {
+    return typeof format === "function" ? format(val, row) : val;
   };
 
   // Props锛堜娇鐢� defineProps 鐨勯潪 TS 褰㈠紡锛�

--
Gitblit v1.9.3