gaoluyang
6 天以前 c7b4b9a2f4c0f05aeb60a9e3f5fba5d9a3676f3f
src/components/PIMTable/PIMTable.vue
@@ -5,18 +5,20 @@
    :border="border"
    :data="tableData"
    :header-cell-style="{ background: '#F0F1F5', color: '#333333' }"
    height="calc(100vh - 18.5em)"
    :height="height"
    :highlight-current-row="highlightCurrentRow"
    :row-class-name="rowClassName"
    :row-style="rowStyle"
    :row-key="rowKey"
    style="width: 100%"
    tooltip-effect="dark"
    @row-click="rowClick"
    @current-change="currentChange"
    :expand-row-keys="expandRowKeys"
    :show-summary="isShowSummary"
    :summary-method="summaryMethod"
    @row-click="rowClick"
    @current-change="currentChange"
    @selection-change="handleSelectionChange"
    @expand-change="expandChange"
    class="lims-table"
  >
    <el-table-column
@@ -122,7 +124,6 @@
          <template v-for="(o, key) in item.operation" :key="key">
            <el-button
              v-show="o.type != 'upload'"
              size="small"
              v-if="o.showHide ? o.showHide(scope.row) : true"
              :disabled="o.disabled ? o.disabled(scope.row) : false"
              :plain="o.plain"
@@ -147,7 +148,6 @@
                (o.uploadIdFun ? o.uploadIdFun(scope.row) : scope.row.id)
              "
              ref="uploadRef"
              size="small"
              :multiple="o.multiple ? o.multiple : false"
              :limit="1"
              :disabled="o.disabled ? o.disabled(scope.row) : false"
@@ -176,7 +176,6 @@
              :show-file-list="false"
            >
              <el-button
                :size="o.size ? o.size : 'small'"
                link
                type="primary"
                :disabled="o.disabled ? o.disabled(scope.row) : false"
@@ -205,8 +204,8 @@
    </el-table-column>
  </el-table>
  <pagination
    v-show="total > 0"
    :total="total"
    v-if="page.total > 0"
    :total="page.total"
    :layout="page.layout"
    :page="page.current"
    :limit="page.size"
@@ -224,7 +223,7 @@
const uploadHeader = proxy.uploadHeader;
const javaApi = proxy.javaApi;
const emit = defineEmits(["pagination"]);
const emit = defineEmits(["pagination", "expand-change", "selection-change"]);
// Filters
const typeFn = (val, row) => {
@@ -241,9 +240,13 @@
    type: Boolean,
    default: false,
  },
  handleSelectionChange: {
    type: Function,
    default: () => {},
  height: {
    type: [Number, String],
    default: "calc(100vh - 22em)",
  },
  expandRowKeys: {
    type: Array,
    default: () => [],
  },
  summaryMethod: {
    type: Function,
@@ -295,7 +298,7 @@
  },
  rowKey: {
    type: String,
    default: undefined,
    default: 'id',
  },
  page: {
    type: Object,
@@ -405,6 +408,14 @@
const paginationSearch = ({ page, limit }) => {
  emit("pagination", { page: page, limit: limit });
};
const expandChange = (row, expandedRows) => {
  emit("expand-change", row, expandedRows);
};
const handleSelectionChange = (newSelection) => {
  emit("selection-change", newSelection);
};
</script>
<style scoped lang="scss">