gaoluyang
2025-02-18 aa8e7c86a561d905b743a6ceacc8fb0fe7ac6810
src/components/Table/lims-table.vue
@@ -19,10 +19,7 @@
      @current-change="currentChange"
      @selection-change="handleSelectionChange"
    >
      <template v-if="isSelection">
        <el-table-column type="selection" width="55" />
      </template>
      <template>
      <el-table-column type="selection" width="55" v-if="isSelection" />
        <el-table-column
          align="center"
          label="序号"
@@ -30,10 +27,10 @@
          width="60"
          :index="indexMethod"
        />
      </template>
      <template v-for="(item, index) in column">
        <el-table-column
        v-for="(item, index) in column"
        :key="index"
          :column-key="item.columnKey"
          :filter-method="item.filterHandler"
          :filter-multiple="item.filterMultiple"
@@ -79,8 +76,11 @@
            </div>
            <!-- 图片 -->
            <div v-else-if="item.dataType == 'image'">
              <img :src="javaApi+'/img/'+item.prop"
                   alt="" style="width: 40px;height: 40px;margin-top: 10px;">
            <img
              :src="javaApi + '/img/' + item.prop"
              alt=""
              style="width: 40px; height: 40px; margin-top: 10px"
            />
            </div>
            <!-- tag -->
@@ -92,9 +92,7 @@
                "
                :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
              >{{ scope.row[item.prop] | formatters(item.formatData) }}</el-tag
              >
              <el-tag
                v-for="(tag, index) in dataTypeFn(
@@ -120,9 +118,7 @@
                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
              >{{ scope.row[item.prop] | formatters(item.formatData) }}</el-tag
              >
            </div>
@@ -139,6 +135,7 @@
                  :style="{ color: o.name === '删除' ? '#f56c6c' : o.color }"
                  :type="o.type | typeFn(scope.row)"
                  @click="o.clickFun(scope.row)"
                :key="key"
                >
                  {{ o.name }}
                </el-button>
@@ -162,6 +159,7 @@
                  :auto-upload="false"
                  :on-exceed="onExceed"
                  :show-file-list="false"
                :key="key"
                >
                  <el-button
                    :size="o.size ? o.size : 'small'"
@@ -173,7 +171,7 @@
              </template>
            </div>
            <!-- 默认纯展示数据 -->
            <div v-else>
          <div v-else class="cell" style="width: 100%">
              <span v-if="!item.formatData">{{ scope.row[item.prop] }}</span>
              <span v-else>{{
                scope.row[item.prop] | formatters(item.formatData)
@@ -181,7 +179,6 @@
            </div>
          </template>
        </el-table-column>
      </template>
    </el-table>
    <pagination
      v-show="page.total > 0"
@@ -392,4 +389,14 @@
.el-table >>> .el-table__empty-text {
  text-align: center;
}
.cell {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding-right: 4px;
  padding-left: 4px;
}
>>> .cell {
  padding: 0 !important;
}
</style>