vxe-table 3.13.7 → 3.13.9
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 +29 -21
- package/es/index.css +1 -1
- package/es/index.min.css +1 -1
- package/es/locale/lang/ja-JP.js +2 -2
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/table/module/edit/mixin.js +7 -5
- package/es/table/module/filter/panel.js +18 -9
- package/es/table/src/methods.js +29 -22
- package/es/table/src/table.js +2 -0
- package/es/table/style.css +0 -17
- package/es/table/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-table/style.css +0 -17
- package/es/vxe-table/style.min.css +1 -1
- package/lib/grid/src/grid.js +29 -21
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.css +1 -1
- package/lib/index.min.css +1 -1
- package/lib/index.umd.js +91 -73
- package/lib/index.umd.min.js +1 -1
- package/lib/locale/lang/ja-JP.js +2 -2
- package/lib/locale/lang/ja-JP.min.js +1 -1
- package/lib/locale/lang/ja-JP.umd.js +2 -2
- package/lib/style.css +1 -1
- package/lib/style.min.css +1 -1
- package/lib/table/module/edit/mixin.js +7 -5
- package/lib/table/module/edit/mixin.min.js +1 -1
- package/lib/table/module/filter/panel.js +20 -20
- package/lib/table/module/filter/panel.min.js +1 -1
- package/lib/table/src/methods.js +31 -25
- package/lib/table/src/methods.min.js +1 -1
- package/lib/table/src/table.js +2 -0
- package/lib/table/src/table.min.js +1 -1
- package/lib/table/style/style.css +0 -17
- package/lib/table/style/style.min.css +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/lib/vxe-table/style/style.css +0 -17
- package/lib/vxe-table/style/style.min.css +1 -1
- package/package.json +1 -1
- package/packages/grid/src/grid.ts +29 -21
- package/packages/locale/lang/ja-JP.ts +2 -2
- package/packages/table/module/edit/mixin.ts +7 -5
- package/packages/table/module/filter/panel.ts +25 -12
- package/packages/table/src/methods.ts +32 -23
- package/packages/table/src/table.ts +2 -0
- package/styles/components/table.scss +0 -19
- /package/es/{iconfont.1740188839037.ttf → iconfont.1740397933178.ttf} +0 -0
- /package/es/{iconfont.1740188839037.woff → iconfont.1740397933178.woff} +0 -0
- /package/es/{iconfont.1740188839037.woff2 → iconfont.1740397933178.woff2} +0 -0
- /package/lib/{iconfont.1740188839037.ttf → iconfont.1740397933178.ttf} +0 -0
- /package/lib/{iconfont.1740188839037.woff → iconfont.1740397933178.woff} +0 -0
- /package/lib/{iconfont.1740188839037.woff2 → iconfont.1740397933178.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,6 +793,7 @@ export default {
|
|
|
793
793
|
const applyArgs = [commitParams].concat(args);
|
|
794
794
|
return Promise.resolve((beforeQuery || ajaxMethods)(...applyArgs))
|
|
795
795
|
.then(rest => {
|
|
796
|
+
let tableData = [];
|
|
796
797
|
this.tableLoading = false;
|
|
797
798
|
if (rest) {
|
|
798
799
|
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
@@ -800,7 +801,7 @@ export default {
|
|
|
800
801
|
const total = (XEUtils.isFunction(totalProp) ? totalProp({ data: rest, $grid: this }) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
801
802
|
tablePage.total = XEUtils.toNumber(total);
|
|
802
803
|
const resultProp = resConfigs.result;
|
|
803
|
-
|
|
804
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp({ data: rest, $grid: this }) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
804
805
|
// 检验当前页码,不能超出当前最大页数
|
|
805
806
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
806
807
|
if (tablePage.currentPage > pageCount) {
|
|
@@ -809,11 +810,18 @@ export default {
|
|
|
809
810
|
}
|
|
810
811
|
else {
|
|
811
812
|
const listProp = resConfigs.list;
|
|
812
|
-
|
|
813
|
+
tableData = (listProp ? (XEUtils.isFunction(listProp) ? listProp({ data: rest, $grid: this }) : XEUtils.get(rest, listProp)) : rest) || [];
|
|
813
814
|
}
|
|
814
815
|
}
|
|
816
|
+
if ($xeTable) {
|
|
817
|
+
$xeTable.loadData(tableData);
|
|
818
|
+
}
|
|
815
819
|
else {
|
|
816
|
-
|
|
820
|
+
$xeTable.$nextTick(() => {
|
|
821
|
+
if ($xeTable) {
|
|
822
|
+
$xeTable.loadData(tableData);
|
|
823
|
+
}
|
|
824
|
+
});
|
|
817
825
|
}
|
|
818
826
|
if (afterQuery) {
|
|
819
827
|
afterQuery(...applyArgs);
|
|
@@ -842,21 +850,21 @@ export default {
|
|
|
842
850
|
const deleteSuccessMethods = ajax.deleteSuccess;
|
|
843
851
|
const deleteErrorMethods = ajax.deleteError;
|
|
844
852
|
if (ajaxMethods) {
|
|
845
|
-
const selectRecords = $
|
|
846
|
-
const removeRecords = selectRecords.filter((row) => !$
|
|
853
|
+
const selectRecords = $xeTable.getCheckboxRecords();
|
|
854
|
+
const removeRecords = selectRecords.filter((row) => !$xeTable.isInsertByRow(row));
|
|
847
855
|
const body = { removeRecords };
|
|
848
856
|
const commitParams = { $grid: this, code, button, body, form: formData, options: ajaxMethods };
|
|
849
857
|
const applyArgs = [commitParams].concat(args);
|
|
850
858
|
if (selectRecords.length) {
|
|
851
859
|
return this.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
852
860
|
if (!removeRecords.length) {
|
|
853
|
-
return $
|
|
861
|
+
return $xeTable.remove(selectRecords);
|
|
854
862
|
}
|
|
855
863
|
this.tableLoading = true;
|
|
856
864
|
return Promise.resolve((beforeDelete || ajaxMethods)(...applyArgs))
|
|
857
865
|
.then(rest => {
|
|
858
866
|
this.tableLoading = false;
|
|
859
|
-
$
|
|
867
|
+
$xeTable.setPendingRow(removeRecords, false);
|
|
860
868
|
if (isRespMsg) {
|
|
861
869
|
// 检测弹窗模块
|
|
862
870
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -946,7 +954,7 @@ export default {
|
|
|
946
954
|
return Promise.resolve((beforeSave || ajaxMethods)(...applyArgs))
|
|
947
955
|
.then(rest => {
|
|
948
956
|
this.tableLoading = false;
|
|
949
|
-
$
|
|
957
|
+
$xeTable.clearPendingRow();
|
|
950
958
|
if (isRespMsg) {
|
|
951
959
|
// 检测弹窗模块
|
|
952
960
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -1008,7 +1016,7 @@ export default {
|
|
|
1008
1016
|
const gCommandOpts = commands.get(code);
|
|
1009
1017
|
if (gCommandOpts) {
|
|
1010
1018
|
if (gCommandOpts.commandMethod) {
|
|
1011
|
-
gCommandOpts.commandMethod({ code, button, $grid: this, $table: $
|
|
1019
|
+
gCommandOpts.commandMethod({ code, button, $grid: this, $table: $xeTable }, ...args);
|
|
1012
1020
|
}
|
|
1013
1021
|
else {
|
|
1014
1022
|
if (process.env.NODE_ENV === 'development') {
|
|
@@ -1205,16 +1213,16 @@ export default {
|
|
|
1205
1213
|
},
|
|
1206
1214
|
getProxyInfo() {
|
|
1207
1215
|
const { $refs, sortData, proxyConfig } = this;
|
|
1208
|
-
const $
|
|
1216
|
+
const $xeTable = $refs.xTable;
|
|
1209
1217
|
if (proxyConfig) {
|
|
1210
1218
|
return {
|
|
1211
|
-
data:
|
|
1219
|
+
data: $xeTable ? $xeTable.getFullData() : [],
|
|
1212
1220
|
filter: this.filterData,
|
|
1213
1221
|
form: this.getFormData(),
|
|
1214
1222
|
sort: sortData.length ? sortData[0] : {},
|
|
1215
1223
|
sorts: sortData,
|
|
1216
1224
|
pager: this.tablePage,
|
|
1217
|
-
pendingRecords: $
|
|
1225
|
+
pendingRecords: $xeTable ? $xeTable.getPendingRecords() : []
|
|
1218
1226
|
};
|
|
1219
1227
|
}
|
|
1220
1228
|
return null;
|