index.js 1.34 KB
Newer Older
fukai 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
import Api from '~/service/Api';
import commonFunctions from '~/mixin/commonFunctions.js';
import Utils from "~/utils/index";
export default {
  mixins: [commonFunctions],
  methods: {
    // 表格多选
    handleSelectionChange(val) {
      this.multipleSelection = val.map((item) => {
        return item.inr
      })
      this.multipleSelectionObj = val.map((item) => {
        return item
      })
      this.multipleStatusSelection = val.map((item) => {
        return item.sta
      })
      this.multipleSelectionRow = val.map((item) => {
        return item
      })[0]
    },
    // pageSize改变
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.model.pagination.pageIndex = 1;
      this.model.pagination.pageSize = val;
      this.handleSearch();
    },
    // 页码改变
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
      this.model.pagination.pageIndex = val;
      this.handleSearch();
    },
    handleEdit(row) {
      this.handleSetDate(row);
      this.editdialog = true;
    },
    //前端处理分页
    handleSearch() {
      let start = (this.model.pagination.pageIndex - 1) * this.model.pagination.pageSize;
      let end = this.model.pagination.pageIndex * this.model.pagination.pageSize - 1;
      this.model.stmData.pageData = this.model.stmData.data.slice(start, end);
    },
  }
}