From 38f01dc619fb9b7326abc345a216793750758c9a Mon Sep 17 00:00:00 2001
From: lxp <1928192722@qq.com>
Date: 星期五, 14 三月 2025 20:09:45 +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 |   99 +++++++++++++------------------------------------
 1 files changed, 26 insertions(+), 73 deletions(-)

diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index 07953d4..74628ad 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -1,7 +1,8 @@
 <template>
   <div>
     <!-- 琛ㄦ牸 -->
-    <el-table ref="multipleTable" v-loading="tableLoading" :border="border" :data="tableData"
+    <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' }" :height="height"
       :highlight-current-row="highlightCurrentRow" :row-class-name="rowClassName" :row-style="rowStyle"
       :row-key="rowKey" :span-method="spanMethod" :stripe="stripe" style="width: 100%" tooltip-effect="dark"
@@ -72,16 +73,13 @@
                 @click="o.clickFun(scope.row)" :key="key">
                 {{ o.name }}
               </el-button>
-              <el-upload :action="javaApi +
-                o.url +
-                '?id=' +
-                (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)
-                " size="mini" ref="upload" :multiple="o.multiple ? o.multiple : false" :limit="1"
+              <el-upload :action="javaApi + o.url" size="mini" ref="upload" :multiple="o.multiple ? o.multiple : false"
                 :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept
                   ? o.accept
                   : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
                   " v-if="o.type == 'upload' && o.url" style="display: inline-block; width: 50px"
-                v-show="o.showHide ? o.showHide(scope.row) : true" :headers="uploadHeader" :on-error="onError"
+                :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"
                 :on-exceed="onExceed" :on-success="handleSuccessUp" :show-file-list="false" :key="key">
                 <el-button :size="o.size ? o.size : 'small'" type="text"
                   :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button>
@@ -113,54 +111,6 @@
               scope.row[item.prop] | formatters(item.formatData)
             }}</span>
           </div>
-        </template>
-      </el-table-column>
-      <!-- 鎿嶄綔鍒� -->
-      <el-table-column v-if="table.operator" :label="(table.operatorConfig && table.operatorConfig.label) || '鎿嶄綔'"
-        :width="table.operatorConfig &&
-          (table.operatorConfig.width
-            ? table.operatorConfig.width
-            : calcOperationWidth())
-          " :min-width="(table.operatorConfig && table.operatorConfig.width) ||
-          table.operatorConfig.minWidth ||
-          100
-          " align="center" :fixed="table.operatorConfig ? table.operatorConfig.fixed : 'right'"
-        :show-overflow-tooltip="true">
-        <template slot-scope="scope">
-          <template v-for="(o, index) in table.operator">
-            <el-button :key="index" v-if="o.type != 'upload'" @click.stop="o.clickFun(scope.row)"
-              :type="o.type || 'text'" :icon="o.icon" :size="o.size || 'small'"
-              :disabled="o.disabled ? o.disabled(scope.row) : false" v-show="o.showFun ? o.showFun(scope.row) : true"
-              :class="[
-                'commonButton',
-                {
-                  del: o.name === '鍒犻櫎' || o.name === '浣滃簾',
-                },
-              ]">{{ o.name }}
-            </el-button>
-            <el-upload :action="javaApi + o.url" size="mini" ref="upload" :multiple="o.multiple ? o.multiple : false"
-              :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept
-                  ? o.accept
-                  : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
-                " v-if="o.type == 'upload' && o.url" style="display: inline-block; width: 50px"
-              v-show="o.showHide ? o.showHide(scope.row) : true" :data="o.data ? o.data(scope.row) : {}" :before-upload="o.beforeUpload ? o.beforeUpload(scope.row) : () => true
-                " :headers="uploadHeader" :on-error="onError" :on-exceed="onExceed" :on-success="handleSuccessUp"
-              :show-file-list="false" :key="index">
-              <el-button :size="o.size ? o.size : 'small'" type="text"
-                :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button>
-            </el-upload>
-            <el-upload action="#" :on-change="(file, fileList) => o.clickFun(scope.row, file, fileList)
-              " :multiple="o.multiple ? o.multiple : false" :limit="o.limit ? o.limit : 1"
-              :disabled="o.disabled ? o.disabled(scope.row) : false" :accept="o.accept
-                  ? o.accept
-                  : '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.ppt,.pptx,.pdf,.zip,.rar'
-                " v-if="o.type == 'upload' && !o.url" style="display: inline-block; width: 50px"
-              v-show="o.showHide ? o.showHide(scope.row) : true" :auto-upload="false" :on-exceed="onExceed"
-              :show-file-list="false" :key="index">
-              <el-button :size="o.size ? o.size : 'small'" type="text"
-                :disabled="o.disabled ? o.disabled(scope.row) : false">{{ o.name }}</el-button>
-            </el-upload>
-          </template>
         </template>
       </el-table-column>
     </el-table>
@@ -241,7 +191,7 @@
   props: {
     isSelection: {
       type: Boolean,
-      default: false,
+      default: undefined,
     },
     height: {
       type: String,
@@ -287,18 +237,11 @@
         return {};
       },
     },
-    // column: {
-    //   type: Array,
-    //   default() {
-    //     return [];
-    //   },
-    // },
-    table: {
-      type: Object,
+    column: {
+      type: Array,
       default() {
-        return {};
+        return [];
       },
-      required: true,
     },
     rowClassName: {
       type: Function,
@@ -316,7 +259,7 @@
     },
     rowKey: {
       type: String,
-      default: undefined,
+      default: "id",
     },
     page: {
       type: Object,
@@ -333,19 +276,28 @@
   data() {
     return {
       spanList: [],
-      btnWidth: '120px'
+      btnWidth: "120px",
     };
   },
   watch: {
-    table(val) {
-      this.doLayout();
-    },
+    // column(val) {
+    //   this.doLayout();
+    // },
+  },
+  updated() {
+    this.$nextTick(() => {
+      this.$refs.multipleTable.doLayout();
+    });
   },
   mounted() {
     this.calculateSpanInfo();
-    this.column = this.table.column;
   },
   methods: {
+    doLayout() {
+      this.$nextTick(() => {
+        this.$refs.multipleTable && this.$refs.multipleTable.doLayout();
+      });
+    },
     getWidth(row, row0) {
       let count = 0;
       row.forEach((a) => {
@@ -355,7 +307,7 @@
           count += a.name.length;
         }
       });
-      this.btnWidth = count * 15 + 70 + "px"
+      this.btnWidth = count * 15 + 70 + "px";
       return count * 15 + 70 + "px";
     },
     iconFn(row) {
@@ -417,6 +369,7 @@
       if (!linkEvent) {
         return this.$message.warning("璇烽厤缃甽ingk浜嬩欢");
       }
+      console.log(linkEvent);
       linkEvent.vueComponent[linkEvent.method](row);
     },
     // 鍚堝苟鍗曞厓鏍�

--
Gitblit v1.9.3