Commit 5192e4c82b04c3e870ee9724d55c2e18878a0c5c

Authored by Aaron
1 parent 78b336b2
Exists in master and in 1 other branch legacy

优化静态表格维护传值

Showing 1 changed file with 11 additions and 2 deletions   Show diff stats
packages/scheme/index.vue
... ... @@ -398,8 +398,17 @@ export default {
398 398 methods: {
399 399 // 向上反馈组件值
400 400 emit() {
401   - this.$emit("input", this.tableData);
402   - this.$emit("change", this.tableData);
  401 + if (!(this.option.searchAPI || _$http && this.option.url)) {
  402 + const resultData = this.tableDataStatic;
  403 + const begin = (this.currentPage - 1) * this.pageSize;
  404 + const end = this.currentPage * this.pageSize;
  405 + const value = resultData.slice(begin, end);
  406 + this.$emit("input", value);
  407 + this.$emit("change", value);
  408 + } else {
  409 + this.$emit("input", this.tableData);
  410 + this.$emit("change", this.tableData);
  411 + }
403 412 },
404 413 // 动态改变表格列
405 414 dynamicChange() {
... ...