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.
- package/es/grid/src/grid.js +21 -29
- package/es/style.css +1 -1
- package/es/table/src/methods.js +21 -28
- package/es/table/src/table.js +0 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +21 -29
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +2283 -1217
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/src/methods.js +24 -30
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +0 -2
- 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 +21 -29
- package/packages/table/src/methods.ts +22 -31
- package/packages/table/src/table.ts +0 -2
- /package/es/{iconfont.1740397933178.ttf → iconfont.1740398494462.ttf} +0 -0
- /package/es/{iconfont.1740397933178.woff → iconfont.1740398494462.woff} +0 -0
- /package/es/{iconfont.1740397933178.woff2 → iconfont.1740398494462.woff2} +0 -0
- /package/lib/{iconfont.1740397933178.ttf → iconfont.1740398494462.ttf} +0 -0
- /package/lib/{iconfont.1740397933178.woff → iconfont.1740398494462.woff} +0 -0
- /package/lib/{iconfont.1740397933178.woff2 → iconfont.1740398494462.woff2} +0 -0
package/es/grid/src/grid.js
CHANGED
|
@@ -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 $
|
|
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 ($
|
|
746
|
-
const { sortOpts } = $
|
|
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 ($
|
|
763
|
-
filterList = $
|
|
762
|
+
if ($xetable) {
|
|
763
|
+
filterList = $xetable.getCheckedFilters();
|
|
764
764
|
}
|
|
765
765
|
}
|
|
766
766
|
else {
|
|
767
|
-
if ($
|
|
767
|
+
if ($xetable) {
|
|
768
768
|
if (isReload) {
|
|
769
|
-
$
|
|
769
|
+
$xetable.clearAll();
|
|
770
770
|
}
|
|
771
771
|
else {
|
|
772
|
-
sortList = $
|
|
773
|
-
filterList = $
|
|
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
|
-
|
|
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 = $
|
|
854
|
-
const removeRecords = selectRecords.filter((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 $
|
|
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
|
-
$
|
|
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
|
-
$
|
|
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: $
|
|
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 $
|
|
1208
|
+
const $xetable = $refs.xTable;
|
|
1217
1209
|
if (proxyConfig) {
|
|
1218
1210
|
return {
|
|
1219
|
-
data:
|
|
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: $
|
|
1217
|
+
pendingRecords: $xetable ? $xetable.getPendingRecords() : []
|
|
1226
1218
|
};
|
|
1227
1219
|
}
|
|
1228
1220
|
return null;
|