gaoluyang
2025-02-13 edc00525eeb2dd3a92b321e116ad97620adafee4
src/components/Table/lims-table.vue
@@ -6,7 +6,7 @@
          v-loading="tableLoading"
          :border="border"
          :data="tableData"
          :header-cell-style="{ background: '#0e3372', color: '#cccccc' }"
          :header-cell-style="{ background: '#f8f8f9', color: '#515a6e' }"
          :height="height"
          :highlight-current-row="highlightCurrentRow"
          :row-class-name="rowClassName"
@@ -25,7 +25,7 @@
        <template>
          <el-table-column align="center" label="序号" type="index" width="60" />
        </template>
        <template v-for="(item, index) in column">
          <el-table-column :column-key="item.columnKey" :filter-method="item.filterHandler"
            :filter-multiple="item.filterMultiple" :filtered-value="item.filteredValue"
@@ -39,7 +39,7 @@
                      slot-scope="scope">
              <slot v-if="item.theadSlot" :index="index" :name="item.theadSlot" :row="scope.row" />
            </template>
            <template slot-scope="scope">
              <!-- 插槽 -->
              <div v-if="item.dataType == 'slot'">
@@ -49,7 +49,7 @@
              <div v-else-if="item.dataType == 'progress'">
                <el-progress :percentage="Number(scope.row[item.prop])" />
              </div>
              <!-- tag -->
              <div v-else-if="item.dataType == 'tag'">
                <el-tag v-if="typeof dataTypeFn(scope.row[item.prop], item.formatData) == 'string'"
@@ -62,7 +62,7 @@
                <el-tag v-else :title="scope.row[item.prop] | formatters(item.formatData)"
                        :type="formatType(scope.row[item.prop], item.formatType)">{{ scope.row[item.prop] | formatters(item.formatData) }}</el-tag>
              </div>
              <!-- 按钮 -->
              <div v-else-if="item.dataType == 'action'">
                <template v-for="(o, key) in item.operation">
@@ -105,13 +105,13 @@
      <pagination
      v-show="page.total>0"
      :total="page.total"
      :page.sync="page.pageNum"
      :limit.sync="page.pageSize"
      :page.sync="page.current"
      :limit.sync="page.size"
      @pagination="pagination"
    />
    </div>
  </template>
  <script>
  // 注:以下是所有配置项,其中最常使用的就是label、width、prop、dataType、slot
  // label :列名,就是表头上的标签叫什么些什么,类型 string
@@ -223,7 +223,7 @@
      },
      border: {
        type: Boolean,
        default: true
        default: false
      },
      highlightCurrentRow: {
        type: Boolean,
@@ -244,7 +244,7 @@
      rowClassName: {
        type: Function,
        default: () => {
        }
      },
      rowStyle: {
@@ -263,17 +263,17 @@
        default: undefined
      },
      page:{
        type:object,
        type:Object,
        default() {
          return {
            total:0,
            pageNum:0,
            pageSize:10
            current:0,
            size:10
          };
        }
      }
    },
    methods: {
      formatType(val, format) {
        if (typeof (format) === 'function') {
@@ -297,10 +297,9 @@
    }
  };
  </script>
  <style scoped>
  .el-table >>> .el-table__empty-text {
    text-align: center
  }
  </style>