From 0600ab29100da647a5cd34c935c16f59b3e772e5 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期一, 17 三月 2025 11:14:39 +0800
Subject: [PATCH] Merge branch 'dev' of http://114.132.189.42:9002/r/center-lims-before-ruoyi into dev

---
 src/components/Table/lims-table.vue |   52 ++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 36 insertions(+), 16 deletions(-)

diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index 2d5fce6..5be37a4 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -4,6 +4,8 @@
     <el-table
       ref="multipleTable"
       v-loading="tableLoading"
+      element-loading-text="鍔犺浇涓�..."
+      element-loading-spinner="el-icon-loading"
       :border="border"
       :data="tableData"
       :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }"
@@ -52,10 +54,8 @@
         "
         :sortable="item.sortable ? true : false"
         :type="item.type"
-        :width="
-          item.dataType === 'action' ? getWidth(item.operation) : item.width
-        "
         align="center"
+        :width="item.dataType == 'action' ? btnWidth : item.width"
       >
         <!-- <div class="123" v-if="item.type == ''"> -->
         <template
@@ -134,7 +134,10 @@
           </div>
 
           <!-- 鎸夐挳 -->
-          <div v-else-if="item.dataType == 'action'">
+          <div
+            v-else-if="item.dataType == 'action'"
+            :style="`width:${getWidth(item.operation, scope.row)}`"
+          >
             <template v-for="(o, key) in item.operation">
               <el-button
                 v-show="o.type != 'upload'"
@@ -151,16 +154,10 @@
                 {{ o.name }}
               </el-button>
               <el-upload
-                :action="
-                  javaApi +
-                  o.url +
-                  '?id=' +
-                  (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)
-                "
+                :action="javaApi + o.url"
                 size="mini"
                 ref="upload"
                 :multiple="o.multiple ? o.multiple : false"
-                :limit="1"
                 :disabled="o.disabled ? o.disabled(scope.row) : false"
                 :accept="
                   o.accept
@@ -169,6 +166,10 @@
                 "
                 v-if="o.type == 'upload' && o.url"
                 style="display: inline-block; width: 50px"
+                :data="o.data ? o.data(scope.row) : {}"
+                :before-upload="
+                  o.beforeUpload ? o.beforeUpload(scope.row) : () => true
+                "
                 v-show="o.showHide ? o.showHide(scope.row) : true"
                 :headers="uploadHeader"
                 :on-error="onError"
@@ -320,7 +321,7 @@
   props: {
     isSelection: {
       type: Boolean,
-      default: false,
+      default: undefined,
     },
     height: {
       type: String,
@@ -388,7 +389,7 @@
     },
     rowKey: {
       type: String,
-      default: undefined,
+      default: "id",
     },
     page: {
       type: Object,
@@ -405,21 +406,38 @@
   data() {
     return {
       spanList: [],
+      btnWidth: "120px",
     };
+  },
+  watch: {
+    // column(val) {
+    //   this.doLayout();
+    // },
+  },
+  updated() {
+    this.$nextTick(() => {
+      this.$refs.multipleTable.doLayout();
+    });
   },
   mounted() {
     this.calculateSpanInfo();
   },
   methods: {
-    getWidth(row) {
+    doLayout() {
+      this.$nextTick(() => {
+        this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
+      });
+    },
+    getWidth(row, row0) {
       let count = 0;
       row.forEach((a) => {
-        if (a.showHide !== undefined && a.showHide()) {
+        if (a.showHide !== undefined && a.showHide(row0)) {
           count += a.name.length;
         } else if (!a.showHide) {
           count += a.name.length;
         }
       });
+      this.btnWidth = count * 15 + 70 + "px";
       return count * 15 + 70 + "px";
     },
     iconFn(row) {
@@ -459,6 +477,7 @@
           this.$message.success("涓婁紶鎴愬姛");
         }
       }
+      this.$refs.upload.clearFiles();
     },
     onError(err, file, fileList) {
       this.$message.error("涓婁紶澶辫触");
@@ -480,6 +499,7 @@
       if (!linkEvent) {
         return this.$message.warning("璇烽厤缃甽ingk浜嬩欢");
       }
+      console.log(linkEvent);
       linkEvent.vueComponent[linkEvent.method](row);
     },
     // 鍚堝苟鍗曞厓鏍�
@@ -591,7 +611,7 @@
 }
 
 >>> .el-table__body-wrapper::-webkit-scrollbar {
-  height: 14px;
+  height: 6px;
   /* 璁剧疆婊氬姩鏉″搴� */
 }
 </style>

--
Gitblit v1.9.3