vxe-table 3.22.9 → 3.22.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 +251 -165
- package/es/style.css +1 -1
- package/es/table/module/custom/panel.js +3 -3
- package/es/table/module/export/mixin.js +53 -33
- package/es/table/render/index.js +12 -2
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/lib/grid/src/grid.js +319 -209
- package/lib/grid/src/grid.min.js +1 -1
- package/lib/index.umd.js +436 -261
- 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/mixin.js +67 -40
- package/lib/table/module/export/mixin.min.js +1 -1
- package/lib/table/render/index.js +24 -2
- package/lib/table/render/index.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 +239 -157
- package/packages/table/module/custom/panel.ts +3 -3
- package/packages/table/module/export/mixin.ts +51 -30
- package/packages/table/render/index.ts +12 -2
- /package/es/{iconfont.1785242725062.ttf → iconfont.1785940479746.ttf} +0 -0
- /package/es/{iconfont.1785242725062.woff → iconfont.1785940479746.woff} +0 -0
- /package/es/{iconfont.1785242725062.woff2 → iconfont.1785940479746.woff2} +0 -0
- /package/lib/{iconfont.1785242725062.ttf → iconfont.1785940479746.ttf} +0 -0
- /package/lib/{iconfont.1785242725062.woff → iconfont.1785940479746.woff} +0 -0
- /package/lib/{iconfont.1785242725062.woff2 → iconfont.1785940479746.woff2} +0 -0
package/es/grid/src/grid.js
CHANGED
|
@@ -564,7 +564,7 @@ export default {
|
|
|
564
564
|
const proxyOpts = $xeGrid.computeProxyOpts;
|
|
565
565
|
const pagerOpts = $xeGrid.computePagerOpts;
|
|
566
566
|
const toolbarOpts = $xeGrid.computeToolbarOpts;
|
|
567
|
-
const { beforeQuery, afterQuery, beforeQueryFooter, afterQueryFooter, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts;
|
|
567
|
+
const { beforeQuery: oldBeforeQuery, afterQuery: oldAfterQuery, beforeQueryFooter: oldBeforeQueryFooter, afterQueryFooter: oldAfterQueryFooter, beforeDelete: oldBeforeDelete, afterDelete: oldAfterDelete, beforeSave: oldBeforeSave, afterSave: oldAfterSave, ajax = {} } = proxyOpts;
|
|
568
568
|
const resConfigs = (proxyOpts.response || proxyOpts.props || {});
|
|
569
569
|
const $xeTable = $xeGrid.$refs.refTable;
|
|
570
570
|
let formData = $xeGrid.getFormData();
|
|
@@ -613,10 +613,12 @@ export default {
|
|
|
613
613
|
case 'initial':
|
|
614
614
|
case 'reload':
|
|
615
615
|
case 'query': {
|
|
616
|
-
const
|
|
617
|
-
const
|
|
618
|
-
const
|
|
619
|
-
|
|
616
|
+
const bqMethod = ajax.beforeQuery;
|
|
617
|
+
const qMethod = ajax.query;
|
|
618
|
+
const aqMethod = ajax.afterQuery;
|
|
619
|
+
const qsMethod = ajax.querySuccess;
|
|
620
|
+
const qeMethod = ajax.queryError;
|
|
621
|
+
if (qMethod) {
|
|
620
622
|
const isInited = code === 'initial';
|
|
621
623
|
const isReload = code === 'reload';
|
|
622
624
|
if (!isInited && reactData.tableLoading) {
|
|
@@ -696,73 +698,91 @@ export default {
|
|
|
696
698
|
sorts: sortList,
|
|
697
699
|
filters: filterList,
|
|
698
700
|
form: formData,
|
|
699
|
-
options:
|
|
701
|
+
options: qMethod
|
|
700
702
|
};
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
Promise.
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
713
|
-
const totalProp = resConfigs.total;
|
|
714
|
-
const total = (XEUtils.isFunction(totalProp) ? totalProp(reParams) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
715
|
-
tablePage.total = XEUtils.toNumber(total);
|
|
716
|
-
const resultProp = resConfigs.result;
|
|
717
|
-
tableData = (XEUtils.isFunction(resultProp) ? resultProp(reParams) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
718
|
-
// 检验当前页码,不能超出当前最大页数
|
|
719
|
-
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
720
|
-
if (tablePage.currentPage > pageCount) {
|
|
721
|
-
tablePage.currentPage = pageCount;
|
|
722
|
-
}
|
|
703
|
+
const handleQuery = () => {
|
|
704
|
+
reactData.sortData = sortList;
|
|
705
|
+
reactData.filterData = filterList;
|
|
706
|
+
reactData.tableLoading = true;
|
|
707
|
+
return Promise.all([
|
|
708
|
+
Promise.resolve((oldBeforeQuery || qMethod)(commitParams, ...args)),
|
|
709
|
+
operPromise
|
|
710
|
+
]).then(([rest]) => {
|
|
711
|
+
reactData.tableLoading = false;
|
|
712
|
+
if (aqMethod) {
|
|
713
|
+
aqMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
723
714
|
}
|
|
724
715
|
else {
|
|
725
|
-
|
|
726
|
-
if (
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
716
|
+
let tableData = [];
|
|
717
|
+
if (rest) {
|
|
718
|
+
const reParams = { data: rest, $table: $xeTable, $grid: $xeGrid, $gantt: null };
|
|
719
|
+
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
720
|
+
const totalProp = resConfigs.total;
|
|
721
|
+
const total = (XEUtils.isFunction(totalProp) ? totalProp(reParams) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
722
|
+
tablePage.total = XEUtils.toNumber(total);
|
|
723
|
+
const resultProp = resConfigs.result;
|
|
724
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp(reParams) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
725
|
+
// 检验当前页码,不能超出当前最大页数
|
|
726
|
+
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
727
|
+
if (tablePage.currentPage > pageCount) {
|
|
728
|
+
tablePage.currentPage = pageCount;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
else {
|
|
732
|
+
const listProp = resConfigs.list;
|
|
733
|
+
if (XEUtils.isArray(rest)) {
|
|
734
|
+
tableData = rest;
|
|
735
|
+
}
|
|
736
|
+
else if (listProp) {
|
|
737
|
+
tableData = (XEUtils.isFunction(listProp) ? listProp(reParams) : XEUtils.get(rest, listProp)) || [];
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
if (showFooter) {
|
|
741
|
+
const fdProp = resConfigs.footerData;
|
|
742
|
+
const footerList = fdProp ? (XEUtils.isFunction(fdProp) ? fdProp(reParams) : XEUtils.get(rest, fdProp)) : [];
|
|
743
|
+
if (XEUtils.isArray(footerList)) {
|
|
744
|
+
reactData.footerData = footerList;
|
|
745
|
+
}
|
|
746
|
+
}
|
|
738
747
|
}
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
if ($xeTable) {
|
|
742
|
-
$xeTable.loadData(tableData);
|
|
743
|
-
}
|
|
744
|
-
else {
|
|
745
|
-
$xeGrid.$nextTick(() => {
|
|
746
|
-
const $xeTable = $xeGrid.$refs.refTable;
|
|
747
748
|
if ($xeTable) {
|
|
748
749
|
$xeTable.loadData(tableData);
|
|
749
750
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
751
|
+
else {
|
|
752
|
+
$xeGrid.$nextTick(() => {
|
|
753
|
+
const $xeTable = $xeGrid.$refs.refTable;
|
|
754
|
+
if ($xeTable) {
|
|
755
|
+
$xeTable.loadData(tableData);
|
|
756
|
+
}
|
|
757
|
+
});
|
|
758
|
+
}
|
|
759
|
+
if (oldAfterQuery) {
|
|
760
|
+
oldAfterQuery(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
if (qsMethod) {
|
|
764
|
+
qsMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
765
|
+
}
|
|
766
|
+
return { status: true };
|
|
767
|
+
}).catch((rest) => {
|
|
768
|
+
reactData.tableLoading = false;
|
|
769
|
+
if (aqMethod) {
|
|
770
|
+
aqMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
771
|
+
}
|
|
772
|
+
if (qeMethod) {
|
|
773
|
+
qeMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
774
|
+
}
|
|
775
|
+
return { status: false };
|
|
776
|
+
});
|
|
777
|
+
};
|
|
778
|
+
if (bqMethod) {
|
|
779
|
+
return Promise.resolve(bqMethod(commitParams, ...args)).then(status => {
|
|
780
|
+
if (status !== false) {
|
|
781
|
+
return handleQuery();
|
|
782
|
+
}
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
return handleQuery();
|
|
766
786
|
}
|
|
767
787
|
else {
|
|
768
788
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.query']);
|
|
@@ -770,39 +790,66 @@ export default {
|
|
|
770
790
|
break;
|
|
771
791
|
}
|
|
772
792
|
case 'queryFooter': {
|
|
773
|
-
const
|
|
774
|
-
const
|
|
775
|
-
const
|
|
776
|
-
|
|
793
|
+
const bqfMethod = ajax.beforeQueryFooter;
|
|
794
|
+
const qfMethod = ajax.queryFooter;
|
|
795
|
+
const aqfMethod = ajax.afterQueryFooter;
|
|
796
|
+
const qfSuccessMethod = ajax.queryFooterSuccess;
|
|
797
|
+
const qfErrorMethod = ajax.queryFooterError;
|
|
798
|
+
if (qfMethod) {
|
|
777
799
|
let filterList = [];
|
|
778
800
|
if ($xeTable) {
|
|
779
801
|
filterList = $xeTable.getCheckedFilters();
|
|
780
802
|
}
|
|
803
|
+
let pageParams = {};
|
|
804
|
+
if (pagerConfig) {
|
|
805
|
+
if (isEnableConf(pagerConfig)) {
|
|
806
|
+
pageParams = Object.assign({}, tablePage);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
781
809
|
const commitParams = {
|
|
782
810
|
$table: $xeTable,
|
|
783
811
|
$grid: $xeGrid,
|
|
784
812
|
$gantt: null,
|
|
785
813
|
code,
|
|
786
814
|
button,
|
|
815
|
+
page: pageParams,
|
|
787
816
|
filters: filterList,
|
|
788
817
|
form: formData,
|
|
789
|
-
options:
|
|
818
|
+
options: qfMethod
|
|
790
819
|
};
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
820
|
+
const handleQueryFooter = () => {
|
|
821
|
+
return Promise.resolve((oldBeforeQueryFooter || qfMethod)(commitParams, ...args)).then(rest => {
|
|
822
|
+
if (aqfMethod) {
|
|
823
|
+
aqfMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
824
|
+
}
|
|
825
|
+
else {
|
|
826
|
+
reactData.footerData = XEUtils.isArray(rest) ? rest : [];
|
|
827
|
+
if (oldAfterQueryFooter) {
|
|
828
|
+
oldAfterQueryFooter(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
if (qfSuccessMethod) {
|
|
832
|
+
qfSuccessMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
833
|
+
}
|
|
834
|
+
return { status: true };
|
|
835
|
+
}).catch((rest) => {
|
|
836
|
+
if (aqfMethod) {
|
|
837
|
+
aqfMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
838
|
+
}
|
|
839
|
+
if (qfErrorMethod) {
|
|
840
|
+
qfErrorMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
841
|
+
}
|
|
842
|
+
return { status: false };
|
|
843
|
+
});
|
|
844
|
+
};
|
|
845
|
+
if (bqfMethod) {
|
|
846
|
+
return Promise.resolve(bqfMethod(commitParams, ...args)).then(status => {
|
|
847
|
+
if (status !== false) {
|
|
848
|
+
return handleQueryFooter();
|
|
849
|
+
}
|
|
850
|
+
});
|
|
851
|
+
}
|
|
852
|
+
return handleQueryFooter();
|
|
806
853
|
}
|
|
807
854
|
else {
|
|
808
855
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.queryFooter']);
|
|
@@ -810,10 +857,12 @@ export default {
|
|
|
810
857
|
break;
|
|
811
858
|
}
|
|
812
859
|
case 'delete': {
|
|
813
|
-
const
|
|
814
|
-
const
|
|
815
|
-
const
|
|
816
|
-
|
|
860
|
+
const bdMethod = ajax.beforeDelete;
|
|
861
|
+
const dMethod = ajax.delete;
|
|
862
|
+
const adMethod = ajax.afterDelete;
|
|
863
|
+
const deleteSuccessMethod = ajax.deleteSuccess;
|
|
864
|
+
const deleteErrorMethod = ajax.deleteError;
|
|
865
|
+
if (dMethod) {
|
|
817
866
|
const selectRecords = $xeTable.getCheckboxRecords();
|
|
818
867
|
const removeRecords = selectRecords.filter((row) => !$xeTable.isInsertByRow(row));
|
|
819
868
|
const body = { removeRecords };
|
|
@@ -825,50 +874,69 @@ export default {
|
|
|
825
874
|
button,
|
|
826
875
|
body,
|
|
827
876
|
form: formData,
|
|
828
|
-
options:
|
|
877
|
+
options: dMethod
|
|
829
878
|
};
|
|
830
|
-
const applyArgs = [commitParams].concat(args);
|
|
831
879
|
if (selectRecords.length) {
|
|
832
880
|
return $xeGrid.handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
833
881
|
if (!removeRecords.length) {
|
|
834
882
|
return $xeTable.remove(selectRecords);
|
|
835
883
|
}
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
.
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' });
|
|
884
|
+
const handleDelete = () => {
|
|
885
|
+
reactData.tableLoading = true;
|
|
886
|
+
return Promise.resolve((oldBeforeDelete || dMethod)(commitParams, ...args))
|
|
887
|
+
.then(rest => {
|
|
888
|
+
reactData.tableLoading = false;
|
|
889
|
+
if (adMethod) {
|
|
890
|
+
adMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
844
891
|
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
reactData.tableLoading = false;
|
|
862
|
-
if (isRespMsg) {
|
|
863
|
-
if (VxeUI.modal) {
|
|
864
|
-
VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
892
|
+
else {
|
|
893
|
+
$xeTable.setPendingRow(removeRecords, false);
|
|
894
|
+
if (isRespMsg) {
|
|
895
|
+
if (VxeUI.modal) {
|
|
896
|
+
VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' });
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
if (oldAfterDelete) {
|
|
900
|
+
oldAfterDelete(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
901
|
+
}
|
|
902
|
+
else {
|
|
903
|
+
internalData.uFoot = true;
|
|
904
|
+
$xeGrid.commitProxy('query');
|
|
905
|
+
internalData.uFoot = false;
|
|
906
|
+
$xeGrid.updateQueryFooter();
|
|
907
|
+
}
|
|
865
908
|
}
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
909
|
+
if (deleteSuccessMethod) {
|
|
910
|
+
deleteSuccessMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
911
|
+
}
|
|
912
|
+
return { status: true };
|
|
913
|
+
})
|
|
914
|
+
.catch(rest => {
|
|
915
|
+
reactData.tableLoading = false;
|
|
916
|
+
if (adMethod) {
|
|
917
|
+
adMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
918
|
+
}
|
|
919
|
+
else {
|
|
920
|
+
if (isRespMsg) {
|
|
921
|
+
if (VxeUI.modal) {
|
|
922
|
+
VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
if (deleteErrorMethod) {
|
|
927
|
+
deleteErrorMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
928
|
+
}
|
|
929
|
+
return { status: false };
|
|
930
|
+
});
|
|
931
|
+
};
|
|
932
|
+
if (bdMethod) {
|
|
933
|
+
return Promise.resolve(bdMethod(commitParams, ...args)).then(status => {
|
|
934
|
+
if (status !== false) {
|
|
935
|
+
return handleDelete();
|
|
936
|
+
}
|
|
937
|
+
});
|
|
938
|
+
}
|
|
939
|
+
return handleDelete();
|
|
872
940
|
});
|
|
873
941
|
}
|
|
874
942
|
else {
|
|
@@ -885,10 +953,12 @@ export default {
|
|
|
885
953
|
break;
|
|
886
954
|
}
|
|
887
955
|
case 'save': {
|
|
888
|
-
const
|
|
889
|
-
const
|
|
890
|
-
const
|
|
891
|
-
|
|
956
|
+
const bSaveMethod = ajax.beforeSave;
|
|
957
|
+
const sMethod = ajax.save;
|
|
958
|
+
const aSaveMethod = ajax.afterSave;
|
|
959
|
+
const sSuccessMethod = ajax.saveSuccess;
|
|
960
|
+
const sErrorMethod = ajax.saveError;
|
|
961
|
+
if (sMethod) {
|
|
892
962
|
const body = $xeGrid.getRecordset();
|
|
893
963
|
const { insertRecords, removeRecords, updateRecords, pendingRecords } = body;
|
|
894
964
|
const commitParams = {
|
|
@@ -899,9 +969,8 @@ export default {
|
|
|
899
969
|
button,
|
|
900
970
|
body,
|
|
901
971
|
form: formData,
|
|
902
|
-
options:
|
|
972
|
+
options: sMethod
|
|
903
973
|
};
|
|
904
|
-
const applyArgs = [commitParams].concat(args);
|
|
905
974
|
// 排除掉新增且标记为删除的数据
|
|
906
975
|
if (insertRecords.length) {
|
|
907
976
|
body.pendingRecords = pendingRecords.filter((row) => insertRecords.indexOf(row) === -1);
|
|
@@ -921,42 +990,59 @@ export default {
|
|
|
921
990
|
return;
|
|
922
991
|
}
|
|
923
992
|
if (body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length) {
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
.
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
993
|
+
const handleSave = () => {
|
|
994
|
+
reactData.tableLoading = true;
|
|
995
|
+
return Promise.resolve((oldBeforeSave || sMethod)(commitParams, ...args))
|
|
996
|
+
.then(rest => {
|
|
997
|
+
reactData.tableLoading = false;
|
|
998
|
+
if (aSaveMethod) {
|
|
999
|
+
$xeTable.clearPendingRow();
|
|
1000
|
+
if (isRespMsg) {
|
|
1001
|
+
if (VxeUI.modal) {
|
|
1002
|
+
VxeUI.modal.message({ content: $xeGrid.getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' });
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
if (oldAfterSave) {
|
|
1006
|
+
oldAfterSave(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
1007
|
+
}
|
|
1008
|
+
else {
|
|
1009
|
+
internalData.uFoot = true;
|
|
1010
|
+
$xeGrid.commitProxy('query');
|
|
1011
|
+
internalData.uFoot = false;
|
|
1012
|
+
$xeGrid.updateQueryFooter();
|
|
1013
|
+
}
|
|
932
1014
|
}
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
afterSave(...applyArgs);
|
|
936
|
-
}
|
|
937
|
-
else {
|
|
938
|
-
internalData.uFoot = true;
|
|
939
|
-
$xeGrid.commitProxy('query');
|
|
940
|
-
internalData.uFoot = false;
|
|
941
|
-
$xeGrid.updateQueryFooter();
|
|
942
|
-
}
|
|
943
|
-
if (saveSuccessMethods) {
|
|
944
|
-
saveSuccessMethods(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
945
|
-
}
|
|
946
|
-
return { status: true };
|
|
947
|
-
})
|
|
948
|
-
.catch(rest => {
|
|
949
|
-
reactData.tableLoading = false;
|
|
950
|
-
if (isRespMsg) {
|
|
951
|
-
if (VxeUI.modal) {
|
|
952
|
-
VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
1015
|
+
if (sSuccessMethod) {
|
|
1016
|
+
sSuccessMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
953
1017
|
}
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
1018
|
+
return { status: true };
|
|
1019
|
+
})
|
|
1020
|
+
.catch(rest => {
|
|
1021
|
+
reactData.tableLoading = false;
|
|
1022
|
+
if (aSaveMethod) {
|
|
1023
|
+
aSaveMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
1024
|
+
}
|
|
1025
|
+
else {
|
|
1026
|
+
if (isRespMsg) {
|
|
1027
|
+
if (VxeUI.modal) {
|
|
1028
|
+
VxeUI.modal.message({ id: code, content: $xeGrid.getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
if (sErrorMethod) {
|
|
1033
|
+
sErrorMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
1034
|
+
}
|
|
1035
|
+
return { status: false };
|
|
1036
|
+
});
|
|
1037
|
+
};
|
|
1038
|
+
if (bSaveMethod) {
|
|
1039
|
+
return Promise.resolve(bSaveMethod(commitParams, ...args)).then(status => {
|
|
1040
|
+
if (status !== false) {
|
|
1041
|
+
return handleSave();
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
return handleSave();
|
|
960
1046
|
}
|
|
961
1047
|
else {
|
|
962
1048
|
if (isActiveMsg) {
|