vxe-table 4.20.9 → 4.20.11
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/dist/all.esm.js +339 -204
- package/dist/style.css +1 -1
- package/es/grid/src/grid.js +252 -161
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +3 -3
- package/es/table/module/export/hook.js +53 -33
- package/es/table/render/index.js +12 -2
- package/es/table/src/table.js +17 -3
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +321 -204
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +442 -259
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/table/module/custom/panel.js +3 -3
- package/lib/table/module/custom/panel.min.js +1 -1
- package/lib/table/module/export/hook.js +67 -40
- package/lib/table/module/export/hook.min.js +1 -1
- package/lib/table/render/index.js +24 -2
- package/lib/table/render/index.min.js +1 -1
- package/lib/table/src/table.js +3 -3
- 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 +2 -2
- package/packages/grid/src/grid.ts +243 -153
- package/packages/table/module/custom/panel.ts +3 -3
- package/packages/table/module/export/hook.ts +51 -30
- package/packages/table/render/index.ts +12 -2
- package/packages/table/src/table.ts +17 -3
- /package/es/{iconfont.1785242738274.ttf → iconfont.1786329229929.ttf} +0 -0
- /package/es/{iconfont.1785242738274.woff → iconfont.1786329229929.woff} +0 -0
- /package/es/{iconfont.1785242738274.woff2 → iconfont.1786329229929.woff2} +0 -0
- /package/lib/{iconfont.1785242738274.ttf → iconfont.1786329229929.ttf} +0 -0
- /package/lib/{iconfont.1785242738274.woff → iconfont.1786329229929.woff} +0 -0
- /package/lib/{iconfont.1785242738274.woff2 → iconfont.1786329229929.woff2} +0 -0
package/dist/all.esm.js
CHANGED
|
@@ -44,7 +44,7 @@ function eqEmptyValue(cellValue) {
|
|
|
44
44
|
return cellValue === '' || XEUtils.eqNull(cellValue);
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
const version = "4.20.
|
|
47
|
+
const version = "4.20.11";
|
|
48
48
|
VxeUI.version = version;
|
|
49
49
|
VxeUI.tableVersion = version;
|
|
50
50
|
VxeUI.setConfig({
|
|
@@ -758,7 +758,7 @@ function wheelScrollTopTo(diffNum, cb) {
|
|
|
758
758
|
}
|
|
759
759
|
|
|
760
760
|
const { log } = VxeUI;
|
|
761
|
-
const tableVersion = `table v${"4.20.
|
|
761
|
+
const tableVersion = `table v${"4.20.11"}`;
|
|
762
762
|
function createComponentLog(name) {
|
|
763
763
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
764
764
|
const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
|
|
@@ -6964,7 +6964,7 @@ var TableCustomPanelComponent = defineVxeComponent({
|
|
|
6964
6964
|
}, VxeUIRadioGroupComponent
|
|
6965
6965
|
? [
|
|
6966
6966
|
h(VxeUIRadioGroupComponent, {
|
|
6967
|
-
modelValue: column.renderAlign || '',
|
|
6967
|
+
modelValue: column.renderAlign || 'left',
|
|
6968
6968
|
type: 'button',
|
|
6969
6969
|
strict: false,
|
|
6970
6970
|
disabled: isHidden,
|
|
@@ -6985,7 +6985,7 @@ var TableCustomPanelComponent = defineVxeComponent({
|
|
|
6985
6985
|
: (VxeUIRadioGroupComponent
|
|
6986
6986
|
? [
|
|
6987
6987
|
h(VxeUIRadioGroupComponent, {
|
|
6988
|
-
modelValue: column.renderHeaderAlign || '',
|
|
6988
|
+
modelValue: column.renderHeaderAlign || 'left',
|
|
6989
6989
|
type: 'button',
|
|
6990
6990
|
strict: false,
|
|
6991
6991
|
disabled: isHidden,
|
|
@@ -7006,7 +7006,7 @@ var TableCustomPanelComponent = defineVxeComponent({
|
|
|
7006
7006
|
: (VxeUIRadioGroupComponent
|
|
7007
7007
|
? [
|
|
7008
7008
|
h(VxeUIRadioGroupComponent, {
|
|
7009
|
-
modelValue: column.renderFooterAlign || '',
|
|
7009
|
+
modelValue: column.renderFooterAlign || 'left',
|
|
7010
7010
|
type: 'button',
|
|
7011
7011
|
strict: false,
|
|
7012
7012
|
disabled: isHidden,
|
|
@@ -12055,15 +12055,17 @@ hooks$4.add('tableExportModule', {
|
|
|
12055
12055
|
const { computeProxyOpts } = $xeGGWrapper.getComputeMaps();
|
|
12056
12056
|
const proxyOpts = computeProxyOpts.value;
|
|
12057
12057
|
const { sortData } = gridReactData;
|
|
12058
|
-
const { beforeQueryAll, afterQueryAll, ajax = {} } = proxyOpts;
|
|
12058
|
+
const { beforeQueryAll: oldBeforeQueryAll, afterQueryAll: oldAfterQueryAll, ajax = {} } = proxyOpts;
|
|
12059
12059
|
const resConfigs = proxyOpts.response || proxyOpts.props || {};
|
|
12060
|
-
const
|
|
12061
|
-
const
|
|
12062
|
-
const
|
|
12063
|
-
|
|
12060
|
+
const beforeQueryAllMethod = ajax.beforeQueryAll;
|
|
12061
|
+
const queryAllMethod = ajax.queryAll;
|
|
12062
|
+
const afterQueryAllMethod = ajax.afterQueryAll;
|
|
12063
|
+
const queryAllSuccessMethod = ajax.queryAllSuccess;
|
|
12064
|
+
const queryAllErrorMethod = ajax.queryAllError;
|
|
12065
|
+
if (!queryAllMethod) {
|
|
12064
12066
|
errLog$5('vxe.error.notFunc', ['proxy-config.ajax.queryAll']);
|
|
12065
12067
|
}
|
|
12066
|
-
if (
|
|
12068
|
+
if (queryAllMethod) {
|
|
12067
12069
|
const params = {
|
|
12068
12070
|
$table: $xeTable,
|
|
12069
12071
|
$grid: $xeGrid,
|
|
@@ -12074,37 +12076,55 @@ hooks$4.add('tableExportModule', {
|
|
|
12074
12076
|
form: gridReactData.formData,
|
|
12075
12077
|
options: handleOptions
|
|
12076
12078
|
};
|
|
12077
|
-
|
|
12078
|
-
.
|
|
12079
|
-
|
|
12080
|
-
|
|
12081
|
-
|
|
12082
|
-
if (XEUtils.isFunction(listProp)) {
|
|
12083
|
-
tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
12079
|
+
const handleQueryAll = () => {
|
|
12080
|
+
return Promise.resolve((oldBeforeQueryAll || queryAllMethod)(params))
|
|
12081
|
+
.then((rest) => {
|
|
12082
|
+
if (afterQueryAllMethod) {
|
|
12083
|
+
afterQueryAllMethod(Object.assign(Object.assign({}, params), { response: rest, status: 'success' }));
|
|
12084
12084
|
}
|
|
12085
12085
|
else {
|
|
12086
|
-
|
|
12086
|
+
const listProp = resConfigs.list;
|
|
12087
|
+
let tdData = [];
|
|
12088
|
+
if (listProp) {
|
|
12089
|
+
if (XEUtils.isFunction(listProp)) {
|
|
12090
|
+
tdData = listProp({ data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: $xeGantt });
|
|
12091
|
+
}
|
|
12092
|
+
else {
|
|
12093
|
+
tdData = XEUtils.isArray(rest) ? rest : XEUtils.get(rest, listProp);
|
|
12094
|
+
}
|
|
12095
|
+
}
|
|
12096
|
+
else {
|
|
12097
|
+
if (XEUtils.isArray(rest)) {
|
|
12098
|
+
tdData = rest;
|
|
12099
|
+
}
|
|
12100
|
+
}
|
|
12101
|
+
handleOptions.data = tdData;
|
|
12102
|
+
if (oldAfterQueryAll) {
|
|
12103
|
+
oldAfterQueryAll(Object.assign(Object.assign({}, params), { response: rest }));
|
|
12104
|
+
}
|
|
12087
12105
|
}
|
|
12088
|
-
|
|
12089
|
-
|
|
12090
|
-
if (XEUtils.isArray(rest)) {
|
|
12091
|
-
tdData = rest;
|
|
12106
|
+
if (queryAllSuccessMethod) {
|
|
12107
|
+
queryAllSuccessMethod(Object.assign(Object.assign({}, params), { response: rest }));
|
|
12092
12108
|
}
|
|
12093
|
-
|
|
12094
|
-
|
|
12095
|
-
|
|
12096
|
-
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12109
|
+
return handleExport(handleOptions);
|
|
12110
|
+
})
|
|
12111
|
+
.catch((rest) => {
|
|
12112
|
+
if (afterQueryAllMethod) {
|
|
12113
|
+
afterQueryAllMethod(Object.assign(Object.assign({}, params), { response: rest, status: 'error' }));
|
|
12114
|
+
}
|
|
12115
|
+
if (queryAllErrorMethod) {
|
|
12116
|
+
queryAllErrorMethod(Object.assign(Object.assign({}, params), { response: rest }));
|
|
12117
|
+
}
|
|
12118
|
+
});
|
|
12119
|
+
};
|
|
12120
|
+
if (beforeQueryAllMethod) {
|
|
12121
|
+
return Promise.resolve(beforeQueryAllMethod(params)).then(status => {
|
|
12122
|
+
if (status !== false) {
|
|
12123
|
+
return handleQueryAll();
|
|
12124
|
+
}
|
|
12125
|
+
});
|
|
12126
|
+
}
|
|
12127
|
+
return handleQueryAll();
|
|
12108
12128
|
}
|
|
12109
12129
|
}
|
|
12110
12130
|
}
|
|
@@ -14775,7 +14795,12 @@ renderer$2.mixin({
|
|
|
14775
14795
|
},
|
|
14776
14796
|
FormatNumberInput: {
|
|
14777
14797
|
renderTableDefault: handleNumberCell,
|
|
14778
|
-
tableFilterDefaultMethod
|
|
14798
|
+
tableFilterDefaultMethod({ option, row, column }) {
|
|
14799
|
+
const { data } = option;
|
|
14800
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
14801
|
+
/* eslint-disable eqeqeq */
|
|
14802
|
+
return cellValue == data;
|
|
14803
|
+
},
|
|
14779
14804
|
tableExportMethod(params) {
|
|
14780
14805
|
const { row, column } = params;
|
|
14781
14806
|
const cellValue = XEUtils.get(row, column.field);
|
|
@@ -14827,7 +14852,12 @@ renderer$2.mixin({
|
|
|
14827
14852
|
createTableFilterOptions: defaultFilterOptions,
|
|
14828
14853
|
renderTableFilter: defaultFilterRender,
|
|
14829
14854
|
renderTableFloatingFilter: defaultFloatingFilterRender,
|
|
14830
|
-
tableFilterDefaultMethod
|
|
14855
|
+
tableFilterDefaultMethod({ option, row, column }) {
|
|
14856
|
+
const { data } = option;
|
|
14857
|
+
const cellValue = XEUtils.get(row, column.field);
|
|
14858
|
+
/* eslint-disable eqeqeq */
|
|
14859
|
+
return cellValue == data;
|
|
14860
|
+
},
|
|
14831
14861
|
tableExportMethod(params) {
|
|
14832
14862
|
const { row, column } = params;
|
|
14833
14863
|
const cellValue = XEUtils.get(row, column.field);
|
|
@@ -18765,7 +18795,7 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
18765
18795
|
return;
|
|
18766
18796
|
}
|
|
18767
18797
|
internalData.rsePending = true;
|
|
18768
|
-
handleLazyRecalculate(
|
|
18798
|
+
handleLazyRecalculate(true, true, true, {
|
|
18769
18799
|
minRunDelay: 200
|
|
18770
18800
|
}).then(() => {
|
|
18771
18801
|
internalData.rsePending = false;
|
|
@@ -20704,6 +20734,18 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
20704
20734
|
}
|
|
20705
20735
|
const { editConfig } = props;
|
|
20706
20736
|
const { formatter, editRender, cellRender } = column;
|
|
20737
|
+
let etOpSize = null;
|
|
20738
|
+
let etOgSize = null;
|
|
20739
|
+
let clOpSize = null;
|
|
20740
|
+
let clOgSize = null;
|
|
20741
|
+
if (editRender) {
|
|
20742
|
+
etOpSize = editRender.options ? editRender.options.length : 0;
|
|
20743
|
+
etOgSize = editRender.optionGroups ? editRender.optionGroups.length : 0;
|
|
20744
|
+
}
|
|
20745
|
+
if (cellRender) {
|
|
20746
|
+
clOpSize = cellRender.options ? cellRender.options.length : 0;
|
|
20747
|
+
clOgSize = cellRender.optionGroups ? cellRender.optionGroups.length : 0;
|
|
20748
|
+
}
|
|
20707
20749
|
// formatter > tableCellFormatter
|
|
20708
20750
|
const renderOpts = formatter ? null : (editConfig && isEnableConf(editRender) ? editRender : (isEnableConf(cellRender) ? cellRender : null));
|
|
20709
20751
|
const compConf = renderOpts ? renderer$1.get(renderOpts.name) : null;
|
|
@@ -20722,7 +20764,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
20722
20764
|
formatData = fullAllDataRowIdData[rowid].formatData = {};
|
|
20723
20765
|
}
|
|
20724
20766
|
if (rowRest && formatData[colid]) {
|
|
20725
|
-
|
|
20767
|
+
const ftValue = formatData[colid].value;
|
|
20768
|
+
if (ftValue && ftValue[0] === cellValue && ftValue[1] === etOpSize && ftValue[2] === etOgSize && ftValue[3] === clOpSize && ftValue[4] === clOgSize) {
|
|
20726
20769
|
return formatData[colid].label;
|
|
20727
20770
|
}
|
|
20728
20771
|
}
|
|
@@ -20754,7 +20797,8 @@ var VxeTableComponent = defineVxeComponent({
|
|
|
20754
20797
|
cellLabel = tcFormatter(renderOpts, formatParams);
|
|
20755
20798
|
}
|
|
20756
20799
|
if (formatData) {
|
|
20757
|
-
|
|
20800
|
+
const ftValue = [cellValue, etOpSize, etOgSize, clOpSize, clOgSize];
|
|
20801
|
+
formatData[colid] = { value: ftValue, label: cellLabel };
|
|
20758
20802
|
}
|
|
20759
20803
|
}
|
|
20760
20804
|
return cellLabel;
|
|
@@ -31563,7 +31607,7 @@ var VxeGridComponent = defineVxeComponent({
|
|
|
31563
31607
|
const proxyOpts = computeProxyOpts.value;
|
|
31564
31608
|
const pagerOpts = computePagerOpts.value;
|
|
31565
31609
|
const toolbarOpts = computeToolbarOpts.value;
|
|
31566
|
-
const { beforeQuery, afterQuery, beforeQueryFooter, afterQueryFooter, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts;
|
|
31610
|
+
const { beforeQuery: oldBeforeQuery, afterQuery: oldAfterQuery, beforeQueryFooter: oldBeforeQueryFooter, afterQueryFooter: oldAfterQueryFooter, beforeDelete: oldBeforeDelete, afterDelete: oldAfterDelete, beforeSave: oldBeforeSave, afterSave: oldAfterSave, ajax = {} } = proxyOpts;
|
|
31567
31611
|
const resConfigs = (proxyOpts.response || proxyOpts.props || {});
|
|
31568
31612
|
const $xeTable = refTable.value;
|
|
31569
31613
|
if (!$xeTable) {
|
|
@@ -31614,10 +31658,12 @@ var VxeGridComponent = defineVxeComponent({
|
|
|
31614
31658
|
case 'initial':
|
|
31615
31659
|
case 'reload':
|
|
31616
31660
|
case 'query': {
|
|
31617
|
-
const
|
|
31618
|
-
const
|
|
31619
|
-
const
|
|
31620
|
-
|
|
31661
|
+
const bqMethod = ajax.beforeQuery;
|
|
31662
|
+
const qMethod = ajax.query;
|
|
31663
|
+
const aqMethod = ajax.afterQuery;
|
|
31664
|
+
const qsMethod = ajax.querySuccess;
|
|
31665
|
+
const qeMethod = ajax.queryError;
|
|
31666
|
+
if (qMethod) {
|
|
31621
31667
|
const isInited = code === 'initial';
|
|
31622
31668
|
const isReload = code === 'reload';
|
|
31623
31669
|
if (!isInited && reactData.tableLoading) {
|
|
@@ -31699,73 +31745,91 @@ var VxeGridComponent = defineVxeComponent({
|
|
|
31699
31745
|
sorts: sortList,
|
|
31700
31746
|
filters: filterList,
|
|
31701
31747
|
form: formData,
|
|
31702
|
-
options:
|
|
31748
|
+
options: qMethod
|
|
31703
31749
|
};
|
|
31704
|
-
|
|
31705
|
-
|
|
31706
|
-
|
|
31707
|
-
|
|
31708
|
-
Promise.
|
|
31709
|
-
|
|
31710
|
-
|
|
31711
|
-
|
|
31712
|
-
|
|
31713
|
-
|
|
31714
|
-
|
|
31715
|
-
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
31716
|
-
const totalProp = resConfigs.total;
|
|
31717
|
-
const total = (XEUtils.isFunction(totalProp) ? totalProp(reParams) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
31718
|
-
tablePage.total = XEUtils.toNumber(total);
|
|
31719
|
-
const resultProp = resConfigs.result;
|
|
31720
|
-
tableData = (XEUtils.isFunction(resultProp) ? resultProp(reParams) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
31721
|
-
// 检验当前页码,不能超出当前最大页数
|
|
31722
|
-
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
31723
|
-
if (tablePage.currentPage > pageCount) {
|
|
31724
|
-
tablePage.currentPage = pageCount;
|
|
31725
|
-
}
|
|
31750
|
+
const handleQuery = () => {
|
|
31751
|
+
reactData.sortData = sortList;
|
|
31752
|
+
reactData.filterData = filterList;
|
|
31753
|
+
reactData.tableLoading = true;
|
|
31754
|
+
return Promise.all([
|
|
31755
|
+
Promise.resolve((oldBeforeQuery || qMethod)(commitParams, ...args)),
|
|
31756
|
+
operPromise
|
|
31757
|
+
]).then(([rest]) => {
|
|
31758
|
+
reactData.tableLoading = false;
|
|
31759
|
+
if (aqMethod) {
|
|
31760
|
+
aqMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
31726
31761
|
}
|
|
31727
31762
|
else {
|
|
31728
|
-
|
|
31729
|
-
if (
|
|
31730
|
-
|
|
31731
|
-
|
|
31732
|
-
|
|
31733
|
-
|
|
31734
|
-
|
|
31735
|
-
|
|
31736
|
-
|
|
31737
|
-
|
|
31738
|
-
|
|
31739
|
-
|
|
31740
|
-
|
|
31763
|
+
let tableData = [];
|
|
31764
|
+
if (rest) {
|
|
31765
|
+
const listProp = resConfigs.list;
|
|
31766
|
+
const resultProp = resConfigs.result;
|
|
31767
|
+
const reParams = { data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null };
|
|
31768
|
+
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
31769
|
+
const totalProp = resConfigs.total;
|
|
31770
|
+
const total = (XEUtils.isFunction(totalProp) ? totalProp(reParams) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
31771
|
+
tablePage.total = XEUtils.toNumber(total);
|
|
31772
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp(reParams) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
31773
|
+
// 检验当前页码,不能超出当前最大页数
|
|
31774
|
+
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
31775
|
+
if (tablePage.currentPage > pageCount) {
|
|
31776
|
+
tablePage.currentPage = pageCount;
|
|
31777
|
+
}
|
|
31778
|
+
}
|
|
31779
|
+
else {
|
|
31780
|
+
if (XEUtils.isArray(rest)) {
|
|
31781
|
+
tableData = rest;
|
|
31782
|
+
}
|
|
31783
|
+
else if (listProp) {
|
|
31784
|
+
tableData = (XEUtils.isFunction(listProp) ? listProp(reParams) : XEUtils.get(rest, listProp)) || [];
|
|
31785
|
+
}
|
|
31786
|
+
}
|
|
31787
|
+
if (showFooter) {
|
|
31788
|
+
const fdProp = resConfigs.footerData;
|
|
31789
|
+
const footerList = fdProp ? (XEUtils.isFunction(fdProp) ? fdProp(reParams) : XEUtils.get(rest, fdProp)) : [];
|
|
31790
|
+
if (XEUtils.isArray(footerList)) {
|
|
31791
|
+
reactData.footerData = footerList;
|
|
31792
|
+
}
|
|
31793
|
+
}
|
|
31741
31794
|
}
|
|
31742
|
-
}
|
|
31743
|
-
}
|
|
31744
|
-
if ($xeTable) {
|
|
31745
|
-
$xeTable.loadData(tableData);
|
|
31746
|
-
}
|
|
31747
|
-
else {
|
|
31748
|
-
nextTick(() => {
|
|
31749
|
-
const $xeTable = refTable.value;
|
|
31750
31795
|
if ($xeTable) {
|
|
31751
31796
|
$xeTable.loadData(tableData);
|
|
31752
31797
|
}
|
|
31753
|
-
|
|
31754
|
-
|
|
31755
|
-
|
|
31756
|
-
|
|
31757
|
-
|
|
31758
|
-
|
|
31759
|
-
|
|
31760
|
-
|
|
31761
|
-
|
|
31762
|
-
|
|
31763
|
-
|
|
31764
|
-
|
|
31765
|
-
|
|
31766
|
-
|
|
31767
|
-
|
|
31768
|
-
|
|
31798
|
+
else {
|
|
31799
|
+
nextTick(() => {
|
|
31800
|
+
const $xeTable = refTable.value;
|
|
31801
|
+
if ($xeTable) {
|
|
31802
|
+
$xeTable.loadData(tableData);
|
|
31803
|
+
}
|
|
31804
|
+
});
|
|
31805
|
+
}
|
|
31806
|
+
if (oldAfterQuery) {
|
|
31807
|
+
oldAfterQuery(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
31808
|
+
}
|
|
31809
|
+
}
|
|
31810
|
+
if (qsMethod) {
|
|
31811
|
+
qsMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
31812
|
+
}
|
|
31813
|
+
return { status: true };
|
|
31814
|
+
}).catch((rest) => {
|
|
31815
|
+
reactData.tableLoading = false;
|
|
31816
|
+
if (aqMethod) {
|
|
31817
|
+
aqMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
31818
|
+
}
|
|
31819
|
+
if (qeMethod) {
|
|
31820
|
+
qeMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
31821
|
+
}
|
|
31822
|
+
return { status: false };
|
|
31823
|
+
});
|
|
31824
|
+
};
|
|
31825
|
+
if (bqMethod) {
|
|
31826
|
+
return Promise.resolve(bqMethod(commitParams, ...args)).then(status => {
|
|
31827
|
+
if (status !== false) {
|
|
31828
|
+
return handleQuery();
|
|
31829
|
+
}
|
|
31830
|
+
});
|
|
31831
|
+
}
|
|
31832
|
+
return handleQuery();
|
|
31769
31833
|
}
|
|
31770
31834
|
else {
|
|
31771
31835
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.query']);
|
|
@@ -31773,39 +31837,66 @@ var VxeGridComponent = defineVxeComponent({
|
|
|
31773
31837
|
break;
|
|
31774
31838
|
}
|
|
31775
31839
|
case 'queryFooter': {
|
|
31776
|
-
const
|
|
31777
|
-
const
|
|
31778
|
-
const
|
|
31779
|
-
|
|
31840
|
+
const bqfMethod = ajax.beforeQueryFooter;
|
|
31841
|
+
const qfMethod = ajax.queryFooter;
|
|
31842
|
+
const aqfMethod = ajax.afterQueryFooter;
|
|
31843
|
+
const qfSuccessMethod = ajax.queryFooterSuccess;
|
|
31844
|
+
const qfErrorMethod = ajax.queryFooterError;
|
|
31845
|
+
if (qfMethod) {
|
|
31780
31846
|
let filterList = [];
|
|
31781
31847
|
if ($xeTable) {
|
|
31782
31848
|
filterList = $xeTable.getCheckedFilters();
|
|
31783
31849
|
}
|
|
31850
|
+
let pageParams = {};
|
|
31851
|
+
if (pagerConfig) {
|
|
31852
|
+
if (isEnableConf(pagerOpts)) {
|
|
31853
|
+
pageParams = Object.assign({}, tablePage);
|
|
31854
|
+
}
|
|
31855
|
+
}
|
|
31784
31856
|
const commitParams = {
|
|
31785
31857
|
$table: $xeTable,
|
|
31786
31858
|
$grid: $xeGrid,
|
|
31787
31859
|
$gantt: null,
|
|
31788
31860
|
code,
|
|
31789
31861
|
button,
|
|
31862
|
+
page: pageParams,
|
|
31790
31863
|
filters: filterList,
|
|
31791
31864
|
form: formData,
|
|
31792
|
-
options:
|
|
31865
|
+
options: qfMethod
|
|
31793
31866
|
};
|
|
31794
|
-
|
|
31795
|
-
|
|
31796
|
-
|
|
31797
|
-
|
|
31798
|
-
|
|
31799
|
-
|
|
31800
|
-
|
|
31801
|
-
|
|
31802
|
-
|
|
31803
|
-
|
|
31804
|
-
|
|
31805
|
-
|
|
31806
|
-
|
|
31807
|
-
|
|
31808
|
-
|
|
31867
|
+
const handleQueryFooter = () => {
|
|
31868
|
+
return Promise.resolve((oldBeforeQueryFooter || qfMethod)(commitParams, ...args)).then(rest => {
|
|
31869
|
+
if (aqfMethod) {
|
|
31870
|
+
aqfMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
31871
|
+
}
|
|
31872
|
+
else {
|
|
31873
|
+
reactData.footerData = XEUtils.isArray(rest) ? rest : [];
|
|
31874
|
+
if (oldAfterQueryFooter) {
|
|
31875
|
+
oldAfterQueryFooter(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
31876
|
+
}
|
|
31877
|
+
}
|
|
31878
|
+
if (qfSuccessMethod) {
|
|
31879
|
+
qfSuccessMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
31880
|
+
}
|
|
31881
|
+
return { status: true };
|
|
31882
|
+
}).catch((rest) => {
|
|
31883
|
+
if (aqfMethod) {
|
|
31884
|
+
aqfMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
31885
|
+
}
|
|
31886
|
+
if (qfErrorMethod) {
|
|
31887
|
+
qfErrorMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
31888
|
+
}
|
|
31889
|
+
return { status: false };
|
|
31890
|
+
});
|
|
31891
|
+
};
|
|
31892
|
+
if (bqfMethod) {
|
|
31893
|
+
return Promise.resolve(bqfMethod(commitParams, ...args)).then(status => {
|
|
31894
|
+
if (status !== false) {
|
|
31895
|
+
return handleQueryFooter();
|
|
31896
|
+
}
|
|
31897
|
+
});
|
|
31898
|
+
}
|
|
31899
|
+
return handleQueryFooter();
|
|
31809
31900
|
}
|
|
31810
31901
|
else {
|
|
31811
31902
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.queryFooter']);
|
|
@@ -31813,10 +31904,12 @@ var VxeGridComponent = defineVxeComponent({
|
|
|
31813
31904
|
break;
|
|
31814
31905
|
}
|
|
31815
31906
|
case 'delete': {
|
|
31816
|
-
const
|
|
31907
|
+
const bdMethod = ajax.beforeDelete;
|
|
31908
|
+
const dMethod = ajax.delete;
|
|
31909
|
+
const adMethod = ajax.afterDelete;
|
|
31817
31910
|
const deleteSuccessMethods = ajax.deleteSuccess;
|
|
31818
31911
|
const deleteErrorMethods = ajax.deleteError;
|
|
31819
|
-
if (
|
|
31912
|
+
if (dMethod) {
|
|
31820
31913
|
const selectRecords = $xeGrid.getCheckboxRecords();
|
|
31821
31914
|
const removeRecords = selectRecords.filter(row => !$xeTable.isInsertByRow(row));
|
|
31822
31915
|
const body = { removeRecords };
|
|
@@ -31828,49 +31921,69 @@ var VxeGridComponent = defineVxeComponent({
|
|
|
31828
31921
|
button,
|
|
31829
31922
|
body,
|
|
31830
31923
|
form: formData,
|
|
31831
|
-
options:
|
|
31924
|
+
options: dMethod
|
|
31832
31925
|
};
|
|
31833
31926
|
if (selectRecords.length) {
|
|
31834
31927
|
return handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
31835
31928
|
if (!removeRecords.length) {
|
|
31836
31929
|
return $xeTable.remove(selectRecords);
|
|
31837
31930
|
}
|
|
31838
|
-
|
|
31839
|
-
|
|
31840
|
-
.
|
|
31841
|
-
|
|
31842
|
-
|
|
31843
|
-
|
|
31844
|
-
|
|
31845
|
-
VxeUI.modal.message({ content: getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' });
|
|
31931
|
+
const handleDelete = () => {
|
|
31932
|
+
reactData.tableLoading = true;
|
|
31933
|
+
return Promise.resolve((oldBeforeDelete || dMethod)(commitParams, ...args))
|
|
31934
|
+
.then(rest => {
|
|
31935
|
+
reactData.tableLoading = false;
|
|
31936
|
+
if (adMethod) {
|
|
31937
|
+
adMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
31846
31938
|
}
|
|
31847
|
-
|
|
31848
|
-
|
|
31849
|
-
|
|
31850
|
-
|
|
31851
|
-
|
|
31852
|
-
|
|
31853
|
-
|
|
31854
|
-
|
|
31855
|
-
|
|
31856
|
-
|
|
31857
|
-
|
|
31858
|
-
|
|
31859
|
-
|
|
31860
|
-
|
|
31861
|
-
|
|
31862
|
-
|
|
31863
|
-
reactData.tableLoading = false;
|
|
31864
|
-
if (isRespMsg) {
|
|
31865
|
-
if (VxeUI.modal) {
|
|
31866
|
-
VxeUI.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
31939
|
+
else {
|
|
31940
|
+
$xeTable.setPendingRow(removeRecords, false);
|
|
31941
|
+
if (isRespMsg) {
|
|
31942
|
+
if (VxeUI.modal) {
|
|
31943
|
+
VxeUI.modal.message({ content: getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' });
|
|
31944
|
+
}
|
|
31945
|
+
}
|
|
31946
|
+
if (oldAfterDelete) {
|
|
31947
|
+
oldAfterDelete(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
31948
|
+
}
|
|
31949
|
+
else {
|
|
31950
|
+
internalData.uFoot = true;
|
|
31951
|
+
$xeGrid.commitProxy('query');
|
|
31952
|
+
internalData.uFoot = false;
|
|
31953
|
+
updateQueryFooter();
|
|
31954
|
+
}
|
|
31867
31955
|
}
|
|
31868
|
-
|
|
31869
|
-
|
|
31870
|
-
|
|
31871
|
-
|
|
31872
|
-
|
|
31873
|
-
|
|
31956
|
+
if (deleteSuccessMethods) {
|
|
31957
|
+
deleteSuccessMethods(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
31958
|
+
}
|
|
31959
|
+
return { status: true };
|
|
31960
|
+
})
|
|
31961
|
+
.catch(rest => {
|
|
31962
|
+
reactData.tableLoading = false;
|
|
31963
|
+
if (adMethod) {
|
|
31964
|
+
adMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
31965
|
+
}
|
|
31966
|
+
else {
|
|
31967
|
+
if (isRespMsg) {
|
|
31968
|
+
if (VxeUI.modal) {
|
|
31969
|
+
VxeUI.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
31970
|
+
}
|
|
31971
|
+
}
|
|
31972
|
+
}
|
|
31973
|
+
if (deleteErrorMethods) {
|
|
31974
|
+
deleteErrorMethods(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
31975
|
+
}
|
|
31976
|
+
return { status: false };
|
|
31977
|
+
});
|
|
31978
|
+
};
|
|
31979
|
+
if (bdMethod) {
|
|
31980
|
+
return Promise.resolve(bdMethod(commitParams, ...args)).then(status => {
|
|
31981
|
+
if (status !== false) {
|
|
31982
|
+
return handleDelete();
|
|
31983
|
+
}
|
|
31984
|
+
});
|
|
31985
|
+
}
|
|
31986
|
+
return handleDelete();
|
|
31874
31987
|
});
|
|
31875
31988
|
}
|
|
31876
31989
|
else {
|
|
@@ -31887,10 +32000,12 @@ var VxeGridComponent = defineVxeComponent({
|
|
|
31887
32000
|
break;
|
|
31888
32001
|
}
|
|
31889
32002
|
case 'save': {
|
|
31890
|
-
const
|
|
31891
|
-
const
|
|
31892
|
-
const
|
|
31893
|
-
|
|
32003
|
+
const bSaveMethod = ajax.beforeSave;
|
|
32004
|
+
const sMethod = ajax.save;
|
|
32005
|
+
const aSaveMethod = ajax.afterSave;
|
|
32006
|
+
const sSuccessMethod = ajax.saveSuccess;
|
|
32007
|
+
const sErrorMethod = ajax.saveError;
|
|
32008
|
+
if (sMethod) {
|
|
31894
32009
|
const body = $xeTable.getRecordset();
|
|
31895
32010
|
const { insertRecords, removeRecords, updateRecords, pendingRecords } = body;
|
|
31896
32011
|
const commitParams = {
|
|
@@ -31901,7 +32016,7 @@ var VxeGridComponent = defineVxeComponent({
|
|
|
31901
32016
|
button,
|
|
31902
32017
|
body,
|
|
31903
32018
|
form: formData,
|
|
31904
|
-
options:
|
|
32019
|
+
options: sMethod
|
|
31905
32020
|
};
|
|
31906
32021
|
// 排除掉新增且标记为删除的数据
|
|
31907
32022
|
if (insertRecords.length) {
|
|
@@ -31922,42 +32037,62 @@ var VxeGridComponent = defineVxeComponent({
|
|
|
31922
32037
|
return;
|
|
31923
32038
|
}
|
|
31924
32039
|
if (body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length) {
|
|
31925
|
-
|
|
31926
|
-
|
|
31927
|
-
.
|
|
31928
|
-
|
|
31929
|
-
|
|
31930
|
-
|
|
31931
|
-
|
|
31932
|
-
VxeUI.modal.message({ content: getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' });
|
|
32040
|
+
const handleSave = () => {
|
|
32041
|
+
reactData.tableLoading = true;
|
|
32042
|
+
return Promise.resolve((oldBeforeSave || sMethod)(commitParams, ...args))
|
|
32043
|
+
.then(rest => {
|
|
32044
|
+
reactData.tableLoading = false;
|
|
32045
|
+
if (aSaveMethod) {
|
|
32046
|
+
aSaveMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
31933
32047
|
}
|
|
31934
|
-
|
|
31935
|
-
|
|
31936
|
-
|
|
31937
|
-
|
|
31938
|
-
|
|
31939
|
-
|
|
31940
|
-
|
|
31941
|
-
|
|
31942
|
-
|
|
31943
|
-
|
|
31944
|
-
|
|
31945
|
-
|
|
31946
|
-
|
|
31947
|
-
|
|
31948
|
-
|
|
31949
|
-
|
|
31950
|
-
reactData.tableLoading = false;
|
|
31951
|
-
if (isRespMsg) {
|
|
31952
|
-
if (VxeUI.modal) {
|
|
31953
|
-
VxeUI.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
32048
|
+
else {
|
|
32049
|
+
$xeTable.clearPendingRow();
|
|
32050
|
+
if (isRespMsg) {
|
|
32051
|
+
if (VxeUI.modal) {
|
|
32052
|
+
VxeUI.modal.message({ content: getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' });
|
|
32053
|
+
}
|
|
32054
|
+
}
|
|
32055
|
+
if (oldAfterSave) {
|
|
32056
|
+
oldAfterSave(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
32057
|
+
}
|
|
32058
|
+
else {
|
|
32059
|
+
internalData.uFoot = true;
|
|
32060
|
+
$xeGrid.commitProxy('query');
|
|
32061
|
+
internalData.uFoot = false;
|
|
32062
|
+
updateQueryFooter();
|
|
32063
|
+
}
|
|
31954
32064
|
}
|
|
31955
|
-
|
|
31956
|
-
|
|
31957
|
-
|
|
31958
|
-
|
|
31959
|
-
|
|
31960
|
-
|
|
32065
|
+
if (sSuccessMethod) {
|
|
32066
|
+
sSuccessMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
32067
|
+
}
|
|
32068
|
+
return { status: true };
|
|
32069
|
+
})
|
|
32070
|
+
.catch(rest => {
|
|
32071
|
+
reactData.tableLoading = false;
|
|
32072
|
+
if (aSaveMethod) {
|
|
32073
|
+
aSaveMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
32074
|
+
}
|
|
32075
|
+
else {
|
|
32076
|
+
if (isRespMsg) {
|
|
32077
|
+
if (VxeUI.modal) {
|
|
32078
|
+
VxeUI.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
32079
|
+
}
|
|
32080
|
+
}
|
|
32081
|
+
}
|
|
32082
|
+
if (sErrorMethod) {
|
|
32083
|
+
sErrorMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
32084
|
+
}
|
|
32085
|
+
return { status: false };
|
|
32086
|
+
});
|
|
32087
|
+
};
|
|
32088
|
+
if (bSaveMethod) {
|
|
32089
|
+
return Promise.resolve(bSaveMethod(commitParams, ...args)).then(status => {
|
|
32090
|
+
if (status !== false) {
|
|
32091
|
+
return handleSave();
|
|
32092
|
+
}
|
|
32093
|
+
});
|
|
32094
|
+
}
|
|
32095
|
+
return handleSave();
|
|
31961
32096
|
}
|
|
31962
32097
|
else {
|
|
31963
32098
|
if (isActiveMsg) {
|