vxe-table 3.13.17 → 3.14.0-beta.1
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.
- package/es/grid/src/grid.js +41 -31
- package/es/style.css +1 -1
- package/es/table/module/keyboard/mixin.js +2 -2
- package/es/table/src/methods.js +282 -163
- package/es/table/src/table.js +52 -51
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +41 -32
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +1604 -2547
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/keyboard/mixin.js +2 -2
- package/lib/table/module/keyboard/mixin.min.js +1 -1
- package/lib/table/src/methods.js +298 -169
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +52 -51
- package/lib/table/src/table.min.js +1 -1
- package/lib/ui/index.js +1 -1
- package/lib/ui/index.min.js +1 -1
- package/lib/ui/src/log.js +1 -1
- package/lib/ui/src/log.min.js +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +41 -31
- package/packages/table/module/keyboard/mixin.ts +2 -2
- package/packages/table/src/methods.ts +300 -173
- package/packages/table/src/table.ts +55 -53
- /package/es/{iconfont.1741051533862.ttf → iconfont.1741051885975.ttf} +0 -0
- /package/es/{iconfont.1741051533862.woff → iconfont.1741051885975.woff} +0 -0
- /package/es/{iconfont.1741051533862.woff2 → iconfont.1741051885975.woff2} +0 -0
- /package/lib/{iconfont.1741051533862.ttf → iconfont.1741051885975.ttf} +0 -0
- /package/lib/{iconfont.1741051533862.woff → iconfont.1741051885975.woff} +0 -0
- /package/lib/{iconfont.1741051533862.woff2 → iconfont.1741051885975.woff2} +0 -0
package/es/grid/src/grid.js
CHANGED
|
@@ -442,28 +442,30 @@ export default {
|
|
|
442
442
|
});
|
|
443
443
|
return rest;
|
|
444
444
|
},
|
|
445
|
-
|
|
446
|
-
const { isZMax, seqConfig, pagerConfig, loading, editConfig, proxyConfig, proxyOpts, tableExtendProps, tableLoading, tablePage
|
|
447
|
-
const
|
|
445
|
+
computeTableProps() {
|
|
446
|
+
const { isZMax, seqConfig, pagerConfig, loading, editConfig, proxyConfig, proxyOpts, tableExtendProps, tableLoading, tablePage } = this;
|
|
447
|
+
const tProps = Object.assign({}, tableExtendProps);
|
|
448
448
|
if (isZMax) {
|
|
449
449
|
if (tableExtendProps.maxHeight) {
|
|
450
|
-
|
|
450
|
+
tProps.maxHeight = '100%';
|
|
451
451
|
}
|
|
452
452
|
else {
|
|
453
|
-
|
|
453
|
+
tProps.height = '100%';
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
456
|
if (proxyConfig) {
|
|
457
|
-
|
|
458
|
-
tableProps.data = tableData;
|
|
457
|
+
tProps.loading = loading || tableLoading;
|
|
459
458
|
if (proxyOpts.seq && isEnableConf(pagerConfig)) {
|
|
460
|
-
|
|
459
|
+
tProps.seqConfig = Object.assign({}, seqConfig, { startIndex: (tablePage.currentPage - 1) * tablePage.pageSize });
|
|
461
460
|
}
|
|
462
461
|
}
|
|
463
462
|
if (editConfig) {
|
|
464
|
-
|
|
463
|
+
tProps.editConfig = Object.assign({}, editConfig);
|
|
465
464
|
}
|
|
466
|
-
return
|
|
465
|
+
return tProps;
|
|
466
|
+
},
|
|
467
|
+
tableProps() {
|
|
468
|
+
return this.computeTableProps;
|
|
467
469
|
},
|
|
468
470
|
computeCurrLayoutConf() {
|
|
469
471
|
const $xeGrid = this;
|
|
@@ -690,7 +692,7 @@ export default {
|
|
|
690
692
|
const { $refs, toolbar, toolbarConfig, toolbarOpts, proxyOpts, tablePage, pagerConfig, editRules, isRespMsg, isActiveMsg, validConfig, pagerOpts } = this;
|
|
691
693
|
const { beforeQuery, afterQuery, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts;
|
|
692
694
|
const resConfigs = proxyOpts.response || proxyOpts.props || {};
|
|
693
|
-
const $
|
|
695
|
+
const $xeTable = $refs.xTable;
|
|
694
696
|
const formData = this.getFormData();
|
|
695
697
|
let button;
|
|
696
698
|
let code;
|
|
@@ -755,8 +757,8 @@ export default {
|
|
|
755
757
|
}
|
|
756
758
|
if (isInited) {
|
|
757
759
|
let defaultSort = null;
|
|
758
|
-
if ($
|
|
759
|
-
const { sortOpts } = $
|
|
760
|
+
if ($xeTable) {
|
|
761
|
+
const { sortOpts } = $xeTable;
|
|
760
762
|
defaultSort = sortOpts.defaultSort;
|
|
761
763
|
}
|
|
762
764
|
// 如果使用默认排序
|
|
@@ -772,18 +774,18 @@ export default {
|
|
|
772
774
|
};
|
|
773
775
|
});
|
|
774
776
|
}
|
|
775
|
-
if ($
|
|
776
|
-
filterList = $
|
|
777
|
+
if ($xeTable) {
|
|
778
|
+
filterList = $xeTable.getCheckedFilters();
|
|
777
779
|
}
|
|
778
780
|
}
|
|
779
781
|
else {
|
|
780
|
-
if ($
|
|
782
|
+
if ($xeTable) {
|
|
781
783
|
if (isReload) {
|
|
782
|
-
$
|
|
784
|
+
$xeTable.clearAll();
|
|
783
785
|
}
|
|
784
786
|
else {
|
|
785
|
-
sortList = $
|
|
786
|
-
filterList = $
|
|
787
|
+
sortList = $xeTable.getSortColumns();
|
|
788
|
+
filterList = $xeTable.getCheckedFilters();
|
|
787
789
|
}
|
|
788
790
|
}
|
|
789
791
|
}
|
|
@@ -806,6 +808,7 @@ export default {
|
|
|
806
808
|
const applyArgs = [commitParams].concat(args);
|
|
807
809
|
return Promise.resolve((beforeQuery || ajaxMethods)(...applyArgs))
|
|
808
810
|
.then(rest => {
|
|
811
|
+
let tableData = [];
|
|
809
812
|
this.tableLoading = false;
|
|
810
813
|
if (rest) {
|
|
811
814
|
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
@@ -813,7 +816,7 @@ export default {
|
|
|
813
816
|
const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $grid: this }) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
814
817
|
tablePage.total = XEUtils.toNumber(total);
|
|
815
818
|
const resultProp = resConfigs.result;
|
|
816
|
-
|
|
819
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $grid: this }) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
817
820
|
// 检验当前页码,不能超出当前最大页数
|
|
818
821
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
819
822
|
if (tablePage.currentPage > pageCount) {
|
|
@@ -822,11 +825,18 @@ export default {
|
|
|
822
825
|
}
|
|
823
826
|
else {
|
|
824
827
|
const listProp = resConfigs.list;
|
|
825
|
-
|
|
828
|
+
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: this }) : XEUtils.get(rest, listProp)) : rest) || [];
|
|
826
829
|
}
|
|
827
830
|
}
|
|
831
|
+
if ($xeTable) {
|
|
832
|
+
$xeTable.loadData(tableData);
|
|
833
|
+
}
|
|
828
834
|
else {
|
|
829
|
-
|
|
835
|
+
$xeTable.$nextTick(() => {
|
|
836
|
+
if ($xeTable) {
|
|
837
|
+
$xeTable.loadData(tableData);
|
|
838
|
+
}
|
|
839
|
+
});
|
|
830
840
|
}
|
|
831
841
|
if (afterQuery) {
|
|
832
842
|
afterQuery(...applyArgs);
|
|
@@ -855,21 +865,21 @@ export default {
|
|
|
855
865
|
const deleteSuccessMethods = ajax.deleteSuccess;
|
|
856
866
|
const deleteErrorMethods = ajax.deleteError;
|
|
857
867
|
if (ajaxMethods) {
|
|
858
|
-
const selectRecords = $
|
|
859
|
-
const removeRecords = selectRecords.filter((row) => !$
|
|
868
|
+
const selectRecords = $xeTable.getCheckboxRecords();
|
|
869
|
+
const removeRecords = selectRecords.filter((row) => !$xeTable.isInsertByRow(row));
|
|
860
870
|
const body = { removeRecords };
|
|
861
871
|
const commitParams = { $grid: this, code, button, body, form: formData, options: ajaxMethods };
|
|
862
872
|
const applyArgs = [commitParams].concat(args);
|
|
863
873
|
if (selectRecords.length) {
|
|
864
874
|
return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
865
875
|
if (!removeRecords.length) {
|
|
866
|
-
return $
|
|
876
|
+
return $xeTable.remove(selectRecords);
|
|
867
877
|
}
|
|
868
878
|
this.tableLoading = true;
|
|
869
879
|
return Promise.resolve((beforeDelete || ajaxMethods)(...applyArgs))
|
|
870
880
|
.then(rest => {
|
|
871
881
|
this.tableLoading = false;
|
|
872
|
-
$
|
|
882
|
+
$xeTable.setPendingRow(removeRecords, false);
|
|
873
883
|
if (isRespMsg) {
|
|
874
884
|
// 检测弹窗模块
|
|
875
885
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -959,7 +969,7 @@ export default {
|
|
|
959
969
|
return Promise.resolve((beforeSave || ajaxMethods)(...applyArgs))
|
|
960
970
|
.then(rest => {
|
|
961
971
|
this.tableLoading = false;
|
|
962
|
-
$
|
|
972
|
+
$xeTable.clearPendingRow();
|
|
963
973
|
if (isRespMsg) {
|
|
964
974
|
// 检测弹窗模块
|
|
965
975
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -1021,7 +1031,7 @@ export default {
|
|
|
1021
1031
|
const gCommandOpts = commands.get(code);
|
|
1022
1032
|
if (gCommandOpts) {
|
|
1023
1033
|
if (gCommandOpts.commandMethod) {
|
|
1024
|
-
gCommandOpts.commandMethod({ code, button, $grid: this, $table: $
|
|
1034
|
+
gCommandOpts.commandMethod({ code, button, $grid: this, $table: $xeTable }, ...args);
|
|
1025
1035
|
}
|
|
1026
1036
|
else {
|
|
1027
1037
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -1218,16 +1228,16 @@ export default {
|
|
|
1218
1228
|
},
|
|
1219
1229
|
getProxyInfo() {
|
|
1220
1230
|
const { $refs, sortData, proxyConfig } = this;
|
|
1221
|
-
const $
|
|
1231
|
+
const $xeTable = $refs.xTable;
|
|
1222
1232
|
if (proxyConfig) {
|
|
1223
1233
|
return {
|
|
1224
|
-
data:
|
|
1234
|
+
data: $xeTable ? $xeTable.getFullData() : [],
|
|
1225
1235
|
filter: this.filterData,
|
|
1226
1236
|
form: this.getFormData(),
|
|
1227
1237
|
sort: sortData.length ? sortData[0] : {},
|
|
1228
1238
|
sorts: sortData,
|
|
1229
1239
|
pager: this.tablePage,
|
|
1230
|
-
pendingRecords: $
|
|
1240
|
+
pendingRecords: $xeTable ? $xeTable.getPendingRecords() : []
|
|
1231
1241
|
};
|
|
1232
1242
|
}
|
|
1233
1243
|
return null;
|