vxe-table 3.13.15 → 3.14.0-beta.0
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/edit/mixin.js +3 -1
- package/es/table/src/methods.js +275 -160
- 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 +1595 -2542
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/edit/mixin.js +3 -1
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/src/methods.js +289 -166
- 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/edit/mixin.ts +3 -1
- package/packages/table/src/methods.ts +286 -164
- package/packages/table/src/table.ts +55 -53
- /package/es/{iconfont.1740723810366.ttf → iconfont.1740732119954.ttf} +0 -0
- /package/es/{iconfont.1740723810366.woff → iconfont.1740732119954.woff} +0 -0
- /package/es/{iconfont.1740723810366.woff2 → iconfont.1740732119954.woff2} +0 -0
- /package/lib/{iconfont.1740723810366.ttf → iconfont.1740732119954.ttf} +0 -0
- /package/lib/{iconfont.1740723810366.woff → iconfont.1740732119954.woff} +0 -0
- /package/lib/{iconfont.1740723810366.woff2 → iconfont.1740732119954.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;
|
|
@@ -677,7 +679,7 @@ export default {
|
|
|
677
679
|
const { $refs, toolbar, toolbarConfig, toolbarOpts, proxyOpts, tablePage, pagerConfig, editRules, isRespMsg, isActiveMsg, validConfig, pagerOpts } = this;
|
|
678
680
|
const { beforeQuery, afterQuery, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts;
|
|
679
681
|
const resConfigs = proxyOpts.response || proxyOpts.props || {};
|
|
680
|
-
const $
|
|
682
|
+
const $xeTable = $refs.xTable;
|
|
681
683
|
const formData = this.getFormData();
|
|
682
684
|
let button;
|
|
683
685
|
let code;
|
|
@@ -742,8 +744,8 @@ export default {
|
|
|
742
744
|
}
|
|
743
745
|
if (isInited) {
|
|
744
746
|
let defaultSort = null;
|
|
745
|
-
if ($
|
|
746
|
-
const { sortOpts } = $
|
|
747
|
+
if ($xeTable) {
|
|
748
|
+
const { sortOpts } = $xeTable;
|
|
747
749
|
defaultSort = sortOpts.defaultSort;
|
|
748
750
|
}
|
|
749
751
|
// 如果使用默认排序
|
|
@@ -759,18 +761,18 @@ export default {
|
|
|
759
761
|
};
|
|
760
762
|
});
|
|
761
763
|
}
|
|
762
|
-
if ($
|
|
763
|
-
filterList = $
|
|
764
|
+
if ($xeTable) {
|
|
765
|
+
filterList = $xeTable.getCheckedFilters();
|
|
764
766
|
}
|
|
765
767
|
}
|
|
766
768
|
else {
|
|
767
|
-
if ($
|
|
769
|
+
if ($xeTable) {
|
|
768
770
|
if (isReload) {
|
|
769
|
-
$
|
|
771
|
+
$xeTable.clearAll();
|
|
770
772
|
}
|
|
771
773
|
else {
|
|
772
|
-
sortList = $
|
|
773
|
-
filterList = $
|
|
774
|
+
sortList = $xeTable.getSortColumns();
|
|
775
|
+
filterList = $xeTable.getCheckedFilters();
|
|
774
776
|
}
|
|
775
777
|
}
|
|
776
778
|
}
|
|
@@ -793,6 +795,7 @@ export default {
|
|
|
793
795
|
const applyArgs = [commitParams].concat(args);
|
|
794
796
|
return Promise.resolve((beforeQuery || ajaxMethods)(...applyArgs))
|
|
795
797
|
.then(rest => {
|
|
798
|
+
let tableData = [];
|
|
796
799
|
this.tableLoading = false;
|
|
797
800
|
if (rest) {
|
|
798
801
|
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
@@ -800,7 +803,7 @@ export default {
|
|
|
800
803
|
const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $grid: this }) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
801
804
|
tablePage.total = XEUtils.toNumber(total);
|
|
802
805
|
const resultProp = resConfigs.result;
|
|
803
|
-
|
|
806
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $grid: this }) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
804
807
|
// 检验当前页码,不能超出当前最大页数
|
|
805
808
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
806
809
|
if (tablePage.currentPage > pageCount) {
|
|
@@ -809,11 +812,18 @@ export default {
|
|
|
809
812
|
}
|
|
810
813
|
else {
|
|
811
814
|
const listProp = resConfigs.list;
|
|
812
|
-
|
|
815
|
+
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: this }) : XEUtils.get(rest, listProp)) : rest) || [];
|
|
813
816
|
}
|
|
814
817
|
}
|
|
818
|
+
if ($xeTable) {
|
|
819
|
+
$xeTable.loadData(tableData);
|
|
820
|
+
}
|
|
815
821
|
else {
|
|
816
|
-
|
|
822
|
+
$xeTable.$nextTick(() => {
|
|
823
|
+
if ($xeTable) {
|
|
824
|
+
$xeTable.loadData(tableData);
|
|
825
|
+
}
|
|
826
|
+
});
|
|
817
827
|
}
|
|
818
828
|
if (afterQuery) {
|
|
819
829
|
afterQuery(...applyArgs);
|
|
@@ -842,21 +852,21 @@ export default {
|
|
|
842
852
|
const deleteSuccessMethods = ajax.deleteSuccess;
|
|
843
853
|
const deleteErrorMethods = ajax.deleteError;
|
|
844
854
|
if (ajaxMethods) {
|
|
845
|
-
const selectRecords = $
|
|
846
|
-
const removeRecords = selectRecords.filter((row) => !$
|
|
855
|
+
const selectRecords = $xeTable.getCheckboxRecords();
|
|
856
|
+
const removeRecords = selectRecords.filter((row) => !$xeTable.isInsertByRow(row));
|
|
847
857
|
const body = { removeRecords };
|
|
848
858
|
const commitParams = { $grid: this, code, button, body, form: formData, options: ajaxMethods };
|
|
849
859
|
const applyArgs = [commitParams].concat(args);
|
|
850
860
|
if (selectRecords.length) {
|
|
851
861
|
return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
852
862
|
if (!removeRecords.length) {
|
|
853
|
-
return $
|
|
863
|
+
return $xeTable.remove(selectRecords);
|
|
854
864
|
}
|
|
855
865
|
this.tableLoading = true;
|
|
856
866
|
return Promise.resolve((beforeDelete || ajaxMethods)(...applyArgs))
|
|
857
867
|
.then(rest => {
|
|
858
868
|
this.tableLoading = false;
|
|
859
|
-
$
|
|
869
|
+
$xeTable.setPendingRow(removeRecords, false);
|
|
860
870
|
if (isRespMsg) {
|
|
861
871
|
// 检测弹窗模块
|
|
862
872
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -946,7 +956,7 @@ export default {
|
|
|
946
956
|
return Promise.resolve((beforeSave || ajaxMethods)(...applyArgs))
|
|
947
957
|
.then(rest => {
|
|
948
958
|
this.tableLoading = false;
|
|
949
|
-
$
|
|
959
|
+
$xeTable.clearPendingRow();
|
|
950
960
|
if (isRespMsg) {
|
|
951
961
|
// 检测弹窗模块
|
|
952
962
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -1008,7 +1018,7 @@ export default {
|
|
|
1008
1018
|
const gCommandOpts = commands.get(code);
|
|
1009
1019
|
if (gCommandOpts) {
|
|
1010
1020
|
if (gCommandOpts.commandMethod) {
|
|
1011
|
-
gCommandOpts.commandMethod({ code, button, $grid: this, $table: $
|
|
1021
|
+
gCommandOpts.commandMethod({ code, button, $grid: this, $table: $xeTable }, ...args);
|
|
1012
1022
|
}
|
|
1013
1023
|
else {
|
|
1014
1024
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -1205,16 +1215,16 @@ export default {
|
|
|
1205
1215
|
},
|
|
1206
1216
|
getProxyInfo() {
|
|
1207
1217
|
const { $refs, sortData, proxyConfig } = this;
|
|
1208
|
-
const $
|
|
1218
|
+
const $xeTable = $refs.xTable;
|
|
1209
1219
|
if (proxyConfig) {
|
|
1210
1220
|
return {
|
|
1211
|
-
data:
|
|
1221
|
+
data: $xeTable ? $xeTable.getFullData() : [],
|
|
1212
1222
|
filter: this.filterData,
|
|
1213
1223
|
form: this.getFormData(),
|
|
1214
1224
|
sort: sortData.length ? sortData[0] : {},
|
|
1215
1225
|
sorts: sortData,
|
|
1216
1226
|
pager: this.tablePage,
|
|
1217
|
-
pendingRecords: $
|
|
1227
|
+
pendingRecords: $xeTable ? $xeTable.getPendingRecords() : []
|
|
1218
1228
|
};
|
|
1219
1229
|
}
|
|
1220
1230
|
return null;
|