From 6f30bbf4f118d3357d1e6e503aa986227e2cc6ea Mon Sep 17 00:00:00 2001
From: licp <lichunping@guanfang.com.cn>
Date: 星期二, 20 八月 2024 09:33:40 +0800
Subject: [PATCH] 更新代码

---
 src/components/tool/value-table.vue |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/components/tool/value-table.vue b/src/components/tool/value-table.vue
index 200cd41..1892627 100644
--- a/src/components/tool/value-table.vue
+++ b/src/components/tool/value-table.vue
@@ -116,7 +116,7 @@
       <el-table ref="eltable" :data="tableData" style="width: 100%;" height="100%" tooltip-effect="dark" border
         @selection-change="selectChange" @select="select" v-loading="loading" @sort-change="sortChange"
         @row-click="rowClick" :show-summary="data.countFleid!=undefined && data.countFleid.length > 0"
-        :summary-method="getSummaries" :row-class-name="tableRowClassName" :row-key="record=>record.id"
+        :summary-method="getSummaries" :row-class-name="tableRowClassName" :row-key="record=>record[rowKey]"
         :current-row-key="data.currentId" :highlight-current-row="data.highlight===undefined||data.highlight"
         :span-method="spanMethod" :key="specialKey">
         <el-table-column type="selection" :width="selectionWidth" v-if="data.showSelect" :key="Math.random()">
@@ -359,6 +359,12 @@
       tableRowClassName: {
         type: Function
       },
+      rowKey: {
+        type: String,
+        default: ()=>{
+          return 'id'
+        }
+      },
       url: {
         type: String,
         default: () => null

--
Gitblit v1.9.3