WXL
2024-07-16 cc73ea5320fed8a39e00bfc0fa02810199559122
src/components/SFtable/index.vue
@@ -1,6 +1,7 @@
<!-- 表格组件封装 -->
<template>
  <el-table
    ref="multipleTableson"
    :data="currentList"
    @selection-change="handleSelectionChange"
    :header-cell-style="{
@@ -34,7 +35,7 @@
      :formatter="formatData"
    >
    </el-table-column>
    <el-table-column
    <!-- <el-table-column
      label="是否可用"
      align="center"
      key="isavailable"
@@ -43,9 +44,8 @@
    >
      <template slot-scope="scope">
        <dict-tag :options="qyoptions" :value="scope.row.usestate" />
      </template>
    </el-table-column>
    </el-table-column> -->
    <el-table-column
      v-if="center"
      label="操作"
@@ -144,8 +144,14 @@
        }
        return "手动";
      }
      if (column.property === "createTime") {
        return dayjs(cellValue).format("YYYY.MM.DD HH:mm:ss");
      if (
        column.property === "createTime" ||
        column.property === "inhosptime"
      ) {
        if (cellValue === null) {
          return "";
        }
        return dayjs(cellValue).format("YYYY-MM-DD ");
      }
      return cellValue;
    },
@@ -153,6 +159,13 @@
    handleSelectionChange(selection) {
      this.$emit("handleSelectionChange", selection);
    },
    toggleRowSelection(row, selected) {
      this.$refs.multipleTableson.toggleRowSelection(row, selected);
    },
    clearSelection() {
      // 在这里编写清除选择的逻辑
      this.$refs.multipleTableson.clearSelection();
    },
  },
};
</script>