listPage.js 895 Bytes
Newer Older
姜雷 committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
import { mapGetters } from 'vuex';

export default {
  data() {
    return {
      filters: {},
      selected: {},
      selectedList: [],
      editType: 0,
      dialogEditVisible: false,
    };
  },
  computed: {
    ...mapGetters(['loading']),
  },
  created() {
    this.fetchList({
      pageNum: 1,
    });
  },
  methods: {
    fetchList() {},
    searchList() {
      this.changePage(1);
    },
    getFilters() {
      let filters = this.$getFilters(this.filters);
      return filters;
    },
    changePage(index) {
      const filters = this.getFilters();
      this.fetchList({
        ...filters,
        pageNum: index,
      });
    },
    handleSelectionChange(val) {
      this.selectedList = val;
    },
    resetEditDialog(done) {
      this.selected = {};
      done && typeof done == 'function'
        ? done()
        : (this.dialogEditVisible = false);
    },
  },
};