From 6b9dd0a1b0c259a02c086f7834467e1fa2c2a5ea Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期五, 30 五月 2025 17:58:54 +0800
Subject: [PATCH] 调整基础信息供应商模块,客户信息模块并新增联动查询省市区联动,修改table表格方法

---
 src/components/Table/ETable.vue |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/components/Table/ETable.vue b/src/components/Table/ETable.vue
index 91f767a..7d30361 100644
--- a/src/components/Table/ETable.vue
+++ b/src/components/Table/ETable.vue
@@ -14,11 +14,13 @@
       @export="handleExport"
     >
       <el-table-column v-if="showSelection" type="selection" width="55" align="center" />
-      <el-table-column v-if="showIndex" label="搴忓彿" type="index" width="60" align="center" />
+      <el-table-column v-if="showIndex" label="搴忓彿" type="index" width="60" align="center"  />
       <template v-for="col in columns" :key="col.prop">
         <el-table-column
           v-bind="col"
-          :show-overflow-tooltip="col.showOverflowTooltip !== false"
+          :show-overflow-tooltip="shouldShowTooltip(col, tableData)"
+          :formatter="(row, column, cellValue) => cellValue == null || cellValue === '' ? '--' : cellValue"
+          align="center"
         >
           <template v-if="col.slot" #default>
             <slot></slot>
@@ -26,7 +28,7 @@
         </el-table-column>
       </template>
       <!-- 鎿嶄綔鍒� -->
-      <el-table-column v-if="showOperations" :label="operationsLabel" :width="operationsWidth" fixed="right">
+      <el-table-column v-if="showOperations" :label="operationsLabel" :width="operationsWidth" fixed="right" align="center">
         <template #default="scope">
           <slot name="operations" :row="scope.row">
             <el-button
@@ -52,7 +54,6 @@
   <script setup>
   import { defineEmits } from 'vue'
   import { ElMessage, ElMessageBox } from 'element-plus'
-
   const props = defineProps({
     // 鏈�澶у搴�
     maxWidth: {
@@ -136,6 +137,14 @@
       default: '纭鍒犻櫎璇ヨ褰曪紵'
     }
   })
+  // 妫�鏌ュ垪鏄惁闇�瑕佹樉绀簍ooltip
+  const shouldShowTooltip = (col, data) => {
+  // 濡傛灉娌℃湁prop锛岀洿鎺ヨ繑鍥瀎alse
+  if (!col.prop) return false;
+  // 妫�鏌ヨ鍒楀湪鎵�鏈夋暟鎹腑鏄惁鏈夐潪绌哄��
+  return data.some(row => row[col.prop] != null && row[col.prop] !== '');
+};
+// 澶勭悊閫夋嫨鍙樺寲銆佺紪杈戙�佸垹闄ゅ拰瀵煎嚭鎿嶄綔
   const emit = defineEmits(['selection-change', 'edit', 'delete', 'export'])
   const handleSelectionChange = (selection) => {
     emit('selection-change', selection)

--
Gitblit v1.9.3