zouyu
2026-02-03 1085f3fffcdc0afd9f140490f9d0078a8426667c
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" />
@@ -70,7 +70,7 @@
                :disabled="o.disabled ? o.disabled(scope.row) : false" :icon="iconFn(o)" :plain="o.plain"
                :style="{ color: o.name === '删除' ? '#f56c6c' : o.color }" :type="o.type | typeFn(scope.row)"
                @click="o.clickFun(scope.row)" :key="key">
                {{ o.name }}
                {{ typeof o.name === 'function'? o.name(scope.row) : o.name }}
              </el-button>
              <el-upload :action="javaApi + o.url + '?id=' + (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)"
                         :key="uploadKeys[scope.$index]"
@@ -260,6 +260,14 @@
        };
      },
    },
    showSummary: {
      type: Boolean,
      default: false
    },
    summaryMethod: {
      type: Function,
      default: null
    }
  },
  data() {
    return {
@@ -284,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
@@ -471,7 +483,7 @@
</script>
<style scoped>
.el-table>>>.el-table__empty-text {
.el-table ::v-deep .el-table__empty-text {
  text-align: center;
}
@@ -479,7 +491,7 @@
  color: rgb(64, 158, 255);
  cursor: pointer;
}
>>>.cell {
::v-deep .cell {
  padding: 0 !important;
}
.cell {