vxe-table 3.13.9 → 3.13.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -677,7 +677,7 @@ export default {
677
677
  const { $refs, toolbar, toolbarConfig, toolbarOpts, proxyOpts, tablePage, pagerConfig, editRules, isRespMsg, isActiveMsg, validConfig, pagerOpts } = this;
678
678
  const { beforeQuery, afterQuery, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts;
679
679
  const resConfigs = proxyOpts.response || proxyOpts.props || {};
680
- const $xeTable = $refs.xTable;
680
+ const $xetable = $refs.xTable;
681
681
  const formData = this.getFormData();
682
682
  let button;
683
683
  let code;
@@ -742,8 +742,8 @@ export default {
742
742
  }
743
743
  if (isInited) {
744
744
  let defaultSort = null;
745
- if ($xeTable) {
746
- const { sortOpts } = $xeTable;
745
+ if ($xetable) {
746
+ const { sortOpts } = $xetable;
747
747
  defaultSort = sortOpts.defaultSort;
748
748
  }
749
749
  // 如果使用默认排序
@@ -759,18 +759,18 @@ export default {
759
759
  };
760
760
  });
761
761
  }
762
- if ($xeTable) {
763
- filterList = $xeTable.getCheckedFilters();
762
+ if ($xetable) {
763
+ filterList = $xetable.getCheckedFilters();
764
764
  }
765
765
  }
766
766
  else {
767
- if ($xeTable) {
767
+ if ($xetable) {
768
768
  if (isReload) {
769
- $xeTable.clearAll();
769
+ $xetable.clearAll();
770
770
  }
771
771
  else {
772
- sortList = $xeTable.getSortColumns();
773
- filterList = $xeTable.getCheckedFilters();
772
+ sortList = $xetable.getSortColumns();
773
+ filterList = $xetable.getCheckedFilters();
774
774
  }
775
775
  }
776
776
  }
@@ -793,7 +793,6 @@ export default {
793
793
  const applyArgs = [commitParams].concat(args);
794
794
  return Promise.resolve((beforeQuery || ajaxMethods)(...applyArgs))
795
795
  .then(rest => {
796
- let tableData = [];
797
796
  this.tableLoading = false;
798
797
  if (rest) {
799
798
  if (pagerConfig && isEnableConf(pagerOpts)) {
@@ -801,7 +800,7 @@ export default {
801
800
  const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $grid: this }) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
802
801
  tablePage.total = XEUtils.toNumber(total);
803
802
  const resultProp = resConfigs.result;
804
- tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $grid: this }) : XEUtils.get(rest, resultProp || 'result')) || [];
803
+ this.tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $grid: this }) : XEUtils.get(rest, resultProp || 'result')) || [];
805
804
  // 检验当前页码,不能超出当前最大页数
806
805
  const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
807
806
  if (tablePage.currentPage > pageCount) {
@@ -810,18 +809,11 @@ export default {
810
809
  }
811
810
  else {
812
811
  const listProp = resConfigs.list;
813
- tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: this }) : XEUtils.get(rest, listProp)) : rest) || [];
812
+ this.tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: this }) : XEUtils.get(rest, listProp)) : rest) || [];
814
813
  }
815
814
  }
816
- if ($xeTable) {
817
- $xeTable.loadData(tableData);
818
- }
819
815
  else {
820
- $xeTable.$nextTick(() => {
821
- if ($xeTable) {
822
- $xeTable.loadData(tableData);
823
- }
824
- });
816
+ this.tableData = [];
825
817
  }
826
818
  if (afterQuery) {
827
819
  afterQuery(...applyArgs);
@@ -850,21 +842,21 @@ export default {
850
842
  const deleteSuccessMethods = ajax.deleteSuccess;
851
843
  const deleteErrorMethods = ajax.deleteError;
852
844
  if (ajaxMethods) {
853
- const selectRecords = $xeTable.getCheckboxRecords();
854
- const removeRecords = selectRecords.filter((row) => !$xeTable.isInsertByRow(row));
845
+ const selectRecords = $xetable.getCheckboxRecords();
846
+ const removeRecords = selectRecords.filter((row) => !$xetable.isInsertByRow(row));
855
847
  const body = { removeRecords };
856
848
  const commitParams = { $grid: this, code, button, body, form: formData, options: ajaxMethods };
857
849
  const applyArgs = [commitParams].concat(args);
858
850
  if (selectRecords.length) {
859
851
  return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
860
852
  if (!removeRecords.length) {
861
- return $xeTable.remove(selectRecords);
853
+ return $xetable.remove(selectRecords);
862
854
  }
863
855
  this.tableLoading = true;
864
856
  return Promise.resolve((beforeDelete || ajaxMethods)(...applyArgs))
865
857
  .then(rest => {
866
858
  this.tableLoading = false;
867
- $xeTable.setPendingRow(removeRecords, false);
859
+ $xetable.setPendingRow(removeRecords, false);
868
860
  if (isRespMsg) {
869
861
  // 检测弹窗模块
870
862
  if (process.env.NODE_ENV === 'development') {
@@ -954,7 +946,7 @@ export default {
954
946
  return Promise.resolve((beforeSave || ajaxMethods)(...applyArgs))
955
947
  .then(rest => {
956
948
  this.tableLoading = false;
957
- $xeTable.clearPendingRow();
949
+ $xetable.clearPendingRow();
958
950
  if (isRespMsg) {
959
951
  // 检测弹窗模块
960
952
  if (process.env.NODE_ENV === 'development') {
@@ -1016,7 +1008,7 @@ export default {
1016
1008
  const gCommandOpts = commands.get(code);
1017
1009
  if (gCommandOpts) {
1018
1010
  if (gCommandOpts.commandMethod) {
1019
- gCommandOpts.commandMethod({ code, button, $grid: this, $table: $xeTable }, ...args);
1011
+ gCommandOpts.commandMethod({ code, button, $grid: this, $table: $xetable }, ...args);
1020
1012
  }
1021
1013
  else {
1022
1014
  if (process.env.NODE_ENV === 'development') {
@@ -1213,16 +1205,16 @@ export default {
1213
1205
  },
1214
1206
  getProxyInfo() {
1215
1207
  const { $refs, sortData, proxyConfig } = this;
1216
- const $xeTable = $refs.xTable;
1208
+ const $xetable = $refs.xTable;
1217
1209
  if (proxyConfig) {
1218
1210
  return {
1219
- data: $xeTable ? $xeTable.getFullData() : [],
1211
+ data: this.tableData,
1220
1212
  filter: this.filterData,
1221
1213
  form: this.getFormData(),
1222
1214
  sort: sortData.length ? sortData[0] : {},
1223
1215
  sorts: sortData,
1224
1216
  pager: this.tablePage,
1225
- pendingRecords: $xeTable ? $xeTable.getPendingRecords() : []
1217
+ pendingRecords: $xetable ? $xetable.getPendingRecords() : []
1226
1218
  };
1227
1219
  }
1228
1220
  return null;