From fb6e16a425e9ade08dbcca96d6a2f1c9b2f25b1e Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期三, 14 一月 2026 17:51:56 +0800
Subject: [PATCH] fix: 合格率统计调整:铜、铝合并为【导体】统计数据。明细表格字段更改和导出按钮

---
 src/components/Table/lims-table.vue |   68 ++++++++++++++-------------------
 1 files changed, 29 insertions(+), 39 deletions(-)

diff --git a/src/components/Table/lims-table.vue b/src/components/Table/lims-table.vue
index e61c19d..1b698ca 100644
--- a/src/components/Table/lims-table.vue
+++ b/src/components/Table/lims-table.vue
@@ -4,7 +4,7 @@
     <el-table ref="multipleTable" v-loading="tableLoading" :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 style="width: 100%" tooltip-effect="dark" @row-click="rowClick"
+      :row-key="rowKey" :span-method="spanMethod" :show-summary="showSummary" :summary-method="summaryMethod" stripe style="width: 100%" tooltip-effect="dark" @row-click="rowClick"
       @current-change="currentChange" @selection-change="handleSelectionChange" class="lims-table">
       <el-table-column align="center" type="selection" width="55" v-if="isSelection" />
       <el-table-column align="center" label="搴忓彿" type="index" width="60" :index="indexMethod" />
@@ -12,8 +12,9 @@
       <el-table-column v-for="(item, index) in column" :key="index" :column-key="item.columnKey"
         :filter-method="item.filterHandler" :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue"
         :filters="item.filters" :fixed="item.fixed" :label="item.label" :prop="item.prop"
-        :show-overflow-tooltip="true"
-        :sortable="item.sortable ? true : false" :type="item.type" :width="item.dataType == 'action' ? btnWidth : getTitleWidth(item)" align="center">
+                       :show-overflow-tooltip="item.dataType === 'action' || item.dataType === 'slot' ? false : true"
+                       :min-width="item.dataType == 'action' ? btnWidth : item.width"
+        :sortable="item.sortable ? true : false" :type="item.type" :width="item.dataType == 'action' ? btnWidth : item.width" align="center">
         <!-- <div class="123" v-if="item.type == ''"> -->
         <template v-if="item.hasOwnProperty('colunmTemplate')" :slot="item.colunmTemplate" slot-scope="scope">
           <slot v-if="item.theadSlot" :index="index" :name="item.theadSlot" :row="scope.row" />
@@ -63,7 +64,7 @@
 
           <!-- 鎸夐挳 -->
           <div v-else-if="item.dataType == 'action'"
-               :style="`width:${getWidth(item.operation, scope.row)}`">
+               :style="`min-width:${getWidth(item.operation, scope.row)}`">
             <template v-for="(o, key) in item.operation">
               <el-button v-show="o.type != 'upload'" size="mini" v-if="o.showHide ? o.showHide(scope.row) : true"
                 :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain"
@@ -259,6 +260,14 @@
         };
       },
     },
+    showSummary: {
+      type: Boolean,
+      default: false
+    },
+    summaryMethod: {
+      type: Function,
+      default: null
+    }
   },
   data() {
     return {
@@ -283,9 +292,13 @@
   watch: {
     tableData: {
       handler() {
-        // 褰撹〃鏍兼暟鎹彉鍖栨椂锛屽垵濮嬪寲 uploadKeys
         this.tableData.forEach((_, index) => {
           this.$set(this.uploadKeys, index, Date.now());
+        });
+        this.$nextTick(() => {
+          if (this.$refs.multipleTable) {
+            this.$refs.multipleTable.doLayout();
+          }
         });
       },
       immediate: true
@@ -301,17 +314,19 @@
           count += a.name.length;
         }
       });
-      this.btnWidth = count * 15 + 50 + "px";
-      return count * 15 + 50 + "px";
+      this.btnWidth = count * 15 + 60 + "px";
+      return count * 15 + 60 + "px";
     },
     getTitleWidth(row) {
       if (row.label.includes('鏃堕棿') || row.label.includes('缂栧彿') || row.label.includes('鏍峰搧鍚嶇О') || row.label.includes('闆朵欢')) {
         return 160
+      } else if (row.label.includes('鎿嶄綔')) {
+        return row.width
       } else {
         const span = document.createElement('span');
         span.innerText = row.label;
         document.body.appendChild(span);
-        const width = `${span.offsetWidth + 30}px`;
+        const width = `${span.offsetWidth + 50}px`;
         document.body.removeChild(span);
 
         return width;
@@ -320,8 +335,6 @@
     iconFn(row) {
       if (row.name === "缂栬緫" || row.name === "淇敼") {
         return "el-icon-edit";
-      } else if (row.name === "鍒犻櫎") {
-        return "el-icon-delete";
       } else if (row.name === "鏌ョ湅") {
         return "el-icon-view";
       } else {
@@ -464,35 +477,13 @@
           };
         }
       }
-      // // 鐗规畩鐨勫悎骞惰
-      // if (
-      //   this.data.spanConfig != undefined &&
-      //   this.data.spanConfig.special &&
-      //   this.data.spanConfig.special.main &&
-      //   this.data.spanConfig.special.rows &&
-      //   this.data.spanConfig.special.rows.length > 0
-      // ) {
-      //   let i = null;
-      //   let obj = this.data.spanConfig.special.rows.find((item, index) => {
-      //     i = index;
-      //     return item.index == columnIndex;
-      //   });
-      //   if (obj) {
-      //     const _row = this.specialSpanList[i].arr[rowIndex];
-      //     const _col = _row > 0 ? 1 : 0;
-      //     return {
-      //       rowspan: _row,
-      //       colspan: _col,
-      //     };
-      //   }
-      // }
     },
   },
 };
 </script>
 
 <style scoped>
-.el-table>>>.el-table__empty-text {
+.el-table ::v-deep .el-table__empty-text {
   text-align: center;
 }
 
@@ -500,8 +491,8 @@
   color: rgb(64, 158, 255);
   cursor: pointer;
 }
->>>.cell {
-  padding: 0px !important;
+::v-deep .cell {
+  padding: 0 !important;
 }
 .cell {
   white-space: nowrap;
@@ -511,10 +502,6 @@
   padding-left: 10px !important;
 }
 
->>>.el-table__body-wrapper::-webkit-scrollbar {
-  height: 10px;
-  /* 璁剧疆婊氬姩鏉″搴� */
-}
 .lims-table .highlight-warning-row-border td:first-child {
   border-left: 4px solid #ffcd29;
 }
@@ -530,4 +517,7 @@
 .lims-table .highlight-danger-row-border td:last-child {
   border-right: 4px solid #f56c6c;
 }
+>>>.red-row td {
+  background: #FFCCCC !important;
+}
 </style>

--
Gitblit v1.9.3