From f1b3a5d1e7824d44a280b65d82a81231ae699942 Mon Sep 17 00:00:00 2001
From: 张诺 <2864490065@qq.com>
Date: 星期二, 19 八月 2025 15:16:50 +0800
Subject: [PATCH] 禁用login 获取验证码功能 使页面不需要验证码即可登录

---
 src/components/Table/EtableModify.vue |   67 +++++++++++++++------------------
 1 files changed, 30 insertions(+), 37 deletions(-)

diff --git a/src/components/Table/EtableModify.vue b/src/components/Table/EtableModify.vue
index cf21bc2..5c6d032 100644
--- a/src/components/Table/EtableModify.vue
+++ b/src/components/Table/EtableModify.vue
@@ -30,14 +30,15 @@
       align="center"
     />
     <template v-for="col in columns" :key="col.prop">
-      <el-table-column
-        v-bind="col"
-        :show-overflow-tooltip="shouldShowTooltip(col, tableData)"
-        align="center"
-      >
+      <el-table-column v-bind="col" align="center">
         <template #default="scope">
           <template v-if="col.slot">
-            <slot></slot>
+            <slot
+              :name="col.prop"
+              :row="scope.row"
+              :column="scope.column"
+              :index="scope.$index"
+            ></slot>
           </template>
           <template v-else>
             <div
@@ -45,16 +46,21 @@
               @dblclick="handleCellEdit(scope.row, col.prop)"
               :class="{ editable: isColumnEditable(col.prop) }"
             >
+              <!-- 鏄剧ず鐘舵�侊細浣跨敤鏍煎紡鍖栫殑鍊� -->
               <span
                 v-if="!scope.row.editing || !scope.row.editing[col.prop]"
                 class="cell-text"
               >
                 {{
-                  scope.row[col.prop] == null || scope.row[col.prop] === ""
-                    ? "--"
-                    : scope.row[col.prop]
+                  formatCellValue(
+                    scope.row,
+                    scope.column,
+                    scope.row[col.prop],
+                    col
+                  )
                 }}
               </span>
+              <!-- 缂栬緫鐘舵�侊細浣跨敤鍘熷鍊硷紝涓嶇粡杩囨牸寮忓寲 -->
               <el-input
                 v-else
                 v-model="scope.row[col.prop]"
@@ -69,34 +75,6 @@
         </template>
       </el-table-column>
     </template>
-    <!-- 鎿嶄綔鍒� -->
-    <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
-            v-if="operations.includes('edit')"
-            link
-            type="primary"
-            size="small"
-            @click="handleEdit(scope.row)"
-            >缂栬緫</el-button
-          >
-          <!--            <el-button-->
-          <!--              v-if="operations.includes('delete')"-->
-          <!--              link-->
-          <!--              type="danger"-->
-          <!--              size="small"-->
-          <!--              @click="handleDelete(scope.row)"-->
-          <!--            >鍒犻櫎</el-button>-->
-        </slot>
-      </template>
-    </el-table-column>
   </el-table>
 </template>
 
@@ -217,7 +195,22 @@
   // 妫�鏌ヨ鍒楀湪鎵�鏈夋暟鎹腑鏄惁鏈夐潪绌哄��
   return data.some((row) => row[col.prop] != null && row[col.prop] !== "");
 };
+// 榛樿鐨勬牸寮忓寲鍑芥暟
+const defaultFormatter = (row, column, cellValue) => {
+  return cellValue == null || cellValue === "" || cellValue === 0
+    ? "0"
+    : cellValue;
+};
 
+// 鏍煎紡鍖栧崟鍏冩牸鍊�
+const formatCellValue = (row, column, cellValue, col) => {
+  // 濡傛灉鍒楁湁鑷畾涔夋牸寮忓寲鍣紝浣跨敤鑷畾涔夋牸寮忓寲鍣�
+  if (col.formatter && typeof col.formatter === "function") {
+    return col.formatter(row, column, cellValue);
+  }
+  // 鍚﹀垯浣跨敤榛樿鏍煎紡鍖栧櫒
+  return defaultFormatter(row, column, cellValue);
+};
 // 澶勭悊鍗曞厓鏍肩紪杈�
 const handleCellEdit = (row, prop) => {
   // 濡傛灉涓嶅厑璁哥紪杈戝崟鍏冩牸锛岀洿鎺ヨ繑鍥�

--
Gitblit v1.9.3