vxe-gantt 4.0.24 → 4.0.26
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/gantt/src/gantt-chart.js +2 -1
- package/es/gantt/src/gantt.js +164 -38
- package/es/gantt/style.css +11 -0
- package/es/gantt/style.min.css +1 -1
- package/es/style.css +1 -1
- package/es/style.min.css +1 -1
- package/es/ui/index.js +1 -1
- package/es/ui/src/log.js +1 -1
- package/es/vxe-gantt/style.css +11 -0
- package/es/vxe-gantt/style.min.css +1 -1
- package/lib/gantt/src/gantt-chart.js +3 -1
- package/lib/gantt/src/gantt-chart.min.js +1 -1
- package/lib/gantt/src/gantt.js +181 -50
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/gantt/style/style.css +11 -0
- package/lib/gantt/style/style.min.css +1 -1
- package/lib/index.umd.js +189 -54
- package/lib/index.umd.min.js +1 -1
- package/lib/style.css +1 -1
- package/lib/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-gantt/style/style.css +11 -0
- package/lib/vxe-gantt/style/style.min.css +1 -1
- package/package.json +3 -3
- package/packages/gantt/src/gantt-chart.ts +2 -1
- package/packages/gantt/src/gantt.ts +199 -72
- package/styles/components/gantt-module/gantt-chart.scss +6 -0
- package/styles/components/gantt.scss +3 -0
package/lib/gantt/src/gantt.js
CHANGED
|
@@ -35,6 +35,7 @@ const tableComponentMethodKeys = ['clearAll', 'syncData', 'updateData', 'loadDat
|
|
|
35
35
|
const defaultLayouts = [['Form'], ['Toolbar', 'Top', 'Gantt', 'Bottom', 'Pager']];
|
|
36
36
|
function createInternalData() {
|
|
37
37
|
return {
|
|
38
|
+
uFoot: false,
|
|
38
39
|
resizeTableWidth: 0
|
|
39
40
|
};
|
|
40
41
|
}
|
|
@@ -68,8 +69,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
68
69
|
taskViewConfig: Object,
|
|
69
70
|
taskBarConfig: Object,
|
|
70
71
|
taskSplitConfig: Object,
|
|
71
|
-
|
|
72
|
-
|
|
72
|
+
taskBarResizeConfig: Object,
|
|
73
|
+
taskBarDragConfig: Object,
|
|
73
74
|
size: {
|
|
74
75
|
type: String,
|
|
75
76
|
default: () => getConfig().gantt.size || getConfig().size
|
|
@@ -99,6 +100,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
99
100
|
filterData: [],
|
|
100
101
|
formData: {},
|
|
101
102
|
sortData: [],
|
|
103
|
+
footerData: [],
|
|
102
104
|
tZindex: 0,
|
|
103
105
|
tablePage: {
|
|
104
106
|
total: 0,
|
|
@@ -183,6 +185,12 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
183
185
|
const computeTaskBarOpts = (0, _vue.computed)(() => {
|
|
184
186
|
return Object.assign({}, getConfig().gantt.taskBarConfig, props.taskBarConfig);
|
|
185
187
|
});
|
|
188
|
+
const computeTaskBarDragOpts = (0, _vue.computed)(() => {
|
|
189
|
+
return Object.assign({}, getConfig().gantt.taskBarDragConfig, props.taskBarDragConfig);
|
|
190
|
+
});
|
|
191
|
+
const computeTaskBarResizeOpts = (0, _vue.computed)(() => {
|
|
192
|
+
return Object.assign({}, getConfig().gantt.taskBarResizeConfig, props.taskBarResizeConfig);
|
|
193
|
+
});
|
|
186
194
|
const computeTaskSplitOpts = (0, _vue.computed)(() => {
|
|
187
195
|
return Object.assign({}, getConfig().gantt.taskSplitConfig, props.taskSplitConfig);
|
|
188
196
|
});
|
|
@@ -272,13 +280,17 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
272
280
|
});
|
|
273
281
|
const computeTableExtendProps = (0, _vue.computed)(() => {
|
|
274
282
|
const rest = {};
|
|
283
|
+
const ganttProps = props;
|
|
275
284
|
tableComponentPropKeys.forEach(key => {
|
|
276
|
-
|
|
285
|
+
if (ganttProps[key] !== undefined) {
|
|
286
|
+
rest[key] = ganttProps[key];
|
|
287
|
+
}
|
|
277
288
|
});
|
|
278
289
|
return rest;
|
|
279
290
|
});
|
|
280
291
|
const computeTableProps = (0, _vue.computed)(() => {
|
|
281
292
|
const {
|
|
293
|
+
showFooter,
|
|
282
294
|
seqConfig,
|
|
283
295
|
pagerConfig,
|
|
284
296
|
editConfig,
|
|
@@ -286,7 +298,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
286
298
|
} = props;
|
|
287
299
|
const {
|
|
288
300
|
isZMax,
|
|
289
|
-
tablePage
|
|
301
|
+
tablePage,
|
|
302
|
+
footerData
|
|
290
303
|
} = reactData;
|
|
291
304
|
const taskViewOpts = computeTaskViewOpts.value;
|
|
292
305
|
const {
|
|
@@ -310,8 +323,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
310
323
|
tProps.border = border;
|
|
311
324
|
}
|
|
312
325
|
}
|
|
326
|
+
if (showFooter && !tProps.footerData) {
|
|
327
|
+
// 如果未设置自己的标位数据,则使用代理的
|
|
328
|
+
tProps.footerData = footerData;
|
|
329
|
+
} else if (proxyOpts.footer && footerData.length) {
|
|
330
|
+
// 如果代理标为数据,且未请求到数据,则用自己的
|
|
331
|
+
tProps.footerData = footerData;
|
|
332
|
+
}
|
|
313
333
|
if (isZMax) {
|
|
314
|
-
if (
|
|
334
|
+
if (tProps.maxHeight) {
|
|
315
335
|
tProps.maxHeight = '100%';
|
|
316
336
|
} else {
|
|
317
337
|
tProps.height = '100%';
|
|
@@ -431,6 +451,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
431
451
|
computeTaskViewScaleMapsOpts,
|
|
432
452
|
computeTaskViewOpts,
|
|
433
453
|
computeTaskBarOpts,
|
|
454
|
+
computeTaskBarDragOpts,
|
|
455
|
+
computeTaskBarResizeOpts,
|
|
434
456
|
computeTaskSplitOpts,
|
|
435
457
|
computeTaskScaleConfs,
|
|
436
458
|
computeTitleField,
|
|
@@ -693,9 +715,12 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
693
715
|
reactData.filterData = params.filterList;
|
|
694
716
|
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts)) {
|
|
695
717
|
reactData.tablePage.currentPage = 1;
|
|
718
|
+
internalData.uFoot = true;
|
|
696
719
|
$xeGantt.commitProxy('query').then(rest => {
|
|
697
720
|
$xeGantt.dispatchEvent('proxy-query', rest, params.$event);
|
|
698
721
|
});
|
|
722
|
+
internalData.uFoot = false;
|
|
723
|
+
updateQueryFooter();
|
|
699
724
|
}
|
|
700
725
|
}
|
|
701
726
|
};
|
|
@@ -716,11 +741,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
716
741
|
return;
|
|
717
742
|
}
|
|
718
743
|
if (proxyConfig && (0, _utils.isEnableConf)(proxyOpts)) {
|
|
744
|
+
internalData.uFoot = true;
|
|
719
745
|
$xeGantt.commitProxy('reload').then(rest => {
|
|
720
746
|
$xeGantt.dispatchEvent('proxy-query', Object.assign(Object.assign({}, rest), {
|
|
721
747
|
isReload: true
|
|
722
748
|
}), params.$event);
|
|
723
749
|
});
|
|
750
|
+
internalData.uFoot = false;
|
|
751
|
+
updateQueryFooter();
|
|
724
752
|
}
|
|
725
753
|
$xeGantt.dispatchEvent('form-submit', params, params.$event);
|
|
726
754
|
};
|
|
@@ -737,11 +765,14 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
737
765
|
if ($xeTable) {
|
|
738
766
|
$xeTable.clearScroll();
|
|
739
767
|
}
|
|
768
|
+
internalData.uFoot = true;
|
|
740
769
|
$xeGantt.commitProxy('reload').then(rest => {
|
|
741
770
|
$xeGantt.dispatchEvent('proxy-query', Object.assign(Object.assign({}, rest), {
|
|
742
771
|
isReload: true
|
|
743
772
|
}), $event);
|
|
744
773
|
});
|
|
774
|
+
internalData.uFoot = false;
|
|
775
|
+
updateQueryFooter();
|
|
745
776
|
}
|
|
746
777
|
$xeGantt.dispatchEvent('form-reset', params, $event);
|
|
747
778
|
};
|
|
@@ -899,6 +930,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
899
930
|
let itemValue = null;
|
|
900
931
|
if (itemRender) {
|
|
901
932
|
const {
|
|
933
|
+
startField,
|
|
934
|
+
endField,
|
|
902
935
|
defaultValue
|
|
903
936
|
} = itemRender;
|
|
904
937
|
if (_xeUtils.default.isFunction(defaultValue)) {
|
|
@@ -908,6 +941,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
908
941
|
} else if (!_xeUtils.default.isUndefined(defaultValue)) {
|
|
909
942
|
itemValue = defaultValue;
|
|
910
943
|
}
|
|
944
|
+
if (startField && endField) {
|
|
945
|
+
_xeUtils.default.set(fData, startField, null);
|
|
946
|
+
_xeUtils.default.set(fData, endField, null);
|
|
947
|
+
}
|
|
911
948
|
}
|
|
912
949
|
fData[field] = itemValue;
|
|
913
950
|
}
|
|
@@ -933,7 +970,13 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
933
970
|
if (!proxyInited) {
|
|
934
971
|
reactData.proxyInited = true;
|
|
935
972
|
if (proxyOpts.autoLoad !== false) {
|
|
936
|
-
(0, _vue.nextTick)().then(() =>
|
|
973
|
+
(0, _vue.nextTick)().then(() => {
|
|
974
|
+
internalData.uFoot = true;
|
|
975
|
+
const rest = $xeGantt.commitProxy('initial');
|
|
976
|
+
internalData.uFoot = false;
|
|
977
|
+
updateQueryFooter();
|
|
978
|
+
return rest;
|
|
979
|
+
}).then(rest => {
|
|
937
980
|
dispatchEvent('proxy-query', Object.assign(Object.assign({}, rest), {
|
|
938
981
|
isInited: true
|
|
939
982
|
}), new Event('initial'));
|
|
@@ -942,6 +985,15 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
942
985
|
}
|
|
943
986
|
}
|
|
944
987
|
};
|
|
988
|
+
const updateQueryFooter = () => {
|
|
989
|
+
const proxyOpts = computeProxyOpts.value;
|
|
990
|
+
const {
|
|
991
|
+
ajax
|
|
992
|
+
} = proxyOpts;
|
|
993
|
+
if (ajax && ajax.queryFooter) {
|
|
994
|
+
return $xeGantt.commitProxy('queryFooter');
|
|
995
|
+
}
|
|
996
|
+
};
|
|
945
997
|
const handleGlobalKeydownEvent = evnt => {
|
|
946
998
|
const zoomOpts = computeZoomOpts.value;
|
|
947
999
|
const isEsc = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ESCAPE);
|
|
@@ -966,6 +1018,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
966
1018
|
*/
|
|
967
1019
|
commitProxy(proxyTarget, ...args) {
|
|
968
1020
|
const {
|
|
1021
|
+
showFooter,
|
|
969
1022
|
proxyConfig,
|
|
970
1023
|
toolbarConfig,
|
|
971
1024
|
pagerConfig,
|
|
@@ -983,6 +1036,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
983
1036
|
const {
|
|
984
1037
|
beforeQuery,
|
|
985
1038
|
afterQuery,
|
|
1039
|
+
beforeQueryFooter,
|
|
1040
|
+
afterQueryFooter,
|
|
986
1041
|
beforeDelete,
|
|
987
1042
|
afterDelete,
|
|
988
1043
|
beforeSave,
|
|
@@ -1047,15 +1102,16 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1047
1102
|
case 'reload':
|
|
1048
1103
|
case 'query':
|
|
1049
1104
|
{
|
|
1050
|
-
const
|
|
1051
|
-
const
|
|
1052
|
-
const
|
|
1053
|
-
if (
|
|
1105
|
+
const qMethods = ajax.query;
|
|
1106
|
+
const qsMethods = ajax.querySuccess;
|
|
1107
|
+
const qeMethods = ajax.queryError;
|
|
1108
|
+
if (qMethods) {
|
|
1054
1109
|
const isInited = code === 'initial';
|
|
1055
1110
|
const isReload = code === 'reload';
|
|
1056
1111
|
if (!isInited && reactData.tableLoading) {
|
|
1057
1112
|
return (0, _vue.nextTick)();
|
|
1058
1113
|
}
|
|
1114
|
+
let operPromise = null;
|
|
1059
1115
|
let sortList = [];
|
|
1060
1116
|
let filterList = [];
|
|
1061
1117
|
let pageParams = {};
|
|
@@ -1117,7 +1173,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1117
1173
|
} else {
|
|
1118
1174
|
if ($xeTable) {
|
|
1119
1175
|
if (isReload) {
|
|
1120
|
-
$xeTable.clearAll();
|
|
1176
|
+
operPromise = $xeTable.clearAll();
|
|
1121
1177
|
} else {
|
|
1122
1178
|
sortList = $xeTable.getSortColumns();
|
|
1123
1179
|
filterList = $xeTable.getCheckedFilters();
|
|
@@ -1137,31 +1193,27 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1137
1193
|
sorts: sortList,
|
|
1138
1194
|
filters: filterList,
|
|
1139
1195
|
form: formData,
|
|
1140
|
-
options:
|
|
1196
|
+
options: qMethods
|
|
1141
1197
|
};
|
|
1142
1198
|
reactData.sortData = sortList;
|
|
1143
1199
|
reactData.filterData = filterList;
|
|
1144
1200
|
reactData.tableLoading = true;
|
|
1145
|
-
return Promise.resolve((beforeQuery ||
|
|
1201
|
+
return Promise.all([Promise.resolve((beforeQuery || qMethods)(commitParams, ...args)), operPromise]).then(([rest]) => {
|
|
1146
1202
|
let tableData = [];
|
|
1147
1203
|
reactData.tableLoading = false;
|
|
1148
1204
|
if (rest) {
|
|
1205
|
+
const reParams = {
|
|
1206
|
+
data: rest,
|
|
1207
|
+
$table: $xeTable,
|
|
1208
|
+
$grid: null,
|
|
1209
|
+
$gantt: $xeGantt
|
|
1210
|
+
};
|
|
1149
1211
|
if (pagerConfig && (0, _utils.isEnableConf)(pagerOpts)) {
|
|
1150
1212
|
const totalProp = resConfigs.total;
|
|
1151
|
-
const total = (_xeUtils.default.isFunction(totalProp) ? totalProp(
|
|
1152
|
-
data: rest,
|
|
1153
|
-
$table: $xeTable,
|
|
1154
|
-
$grid: null,
|
|
1155
|
-
$gantt: $xeGantt
|
|
1156
|
-
}) : _xeUtils.default.get(rest, totalProp || 'page.total')) || 0;
|
|
1213
|
+
const total = (_xeUtils.default.isFunction(totalProp) ? totalProp(reParams) : _xeUtils.default.get(rest, totalProp || 'page.total')) || 0;
|
|
1157
1214
|
tablePage.total = _xeUtils.default.toNumber(total);
|
|
1158
1215
|
const resultProp = resConfigs.result;
|
|
1159
|
-
tableData = (_xeUtils.default.isFunction(resultProp) ? resultProp(
|
|
1160
|
-
data: rest,
|
|
1161
|
-
$table: $xeTable,
|
|
1162
|
-
$grid: null,
|
|
1163
|
-
$gantt: $xeGantt
|
|
1164
|
-
}) : _xeUtils.default.get(rest, resultProp || 'result')) || [];
|
|
1216
|
+
tableData = (_xeUtils.default.isFunction(resultProp) ? resultProp(reParams) : _xeUtils.default.get(rest, resultProp || 'result')) || [];
|
|
1165
1217
|
// 检验当前页码,不能超出当前最大页数
|
|
1166
1218
|
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
1167
1219
|
if (tablePage.currentPage > pageCount) {
|
|
@@ -1169,18 +1221,25 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1169
1221
|
}
|
|
1170
1222
|
} else {
|
|
1171
1223
|
const listProp = resConfigs.list;
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1224
|
+
if (_xeUtils.default.isArray(rest)) {
|
|
1225
|
+
tableData = rest;
|
|
1226
|
+
} else if (listProp) {
|
|
1227
|
+
tableData = (_xeUtils.default.isFunction(listProp) ? listProp(reParams) : _xeUtils.default.get(rest, listProp)) || [];
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
if (showFooter) {
|
|
1231
|
+
const fdProp = resConfigs.footerData;
|
|
1232
|
+
const footerList = fdProp ? _xeUtils.default.isFunction(fdProp) ? fdProp(reParams) : _xeUtils.default.get(rest, fdProp) : [];
|
|
1233
|
+
if (_xeUtils.default.isArray(footerList)) {
|
|
1234
|
+
reactData.footerData = footerList;
|
|
1235
|
+
}
|
|
1178
1236
|
}
|
|
1179
1237
|
}
|
|
1180
1238
|
if ($xeTable) {
|
|
1181
1239
|
$xeTable.loadData(tableData);
|
|
1182
1240
|
} else {
|
|
1183
1241
|
(0, _vue.nextTick)(() => {
|
|
1242
|
+
const $xeTable = refTable.value;
|
|
1184
1243
|
if ($xeTable) {
|
|
1185
1244
|
$xeTable.loadData(tableData);
|
|
1186
1245
|
}
|
|
@@ -1189,8 +1248,8 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1189
1248
|
if (afterQuery) {
|
|
1190
1249
|
afterQuery(commitParams, ...args);
|
|
1191
1250
|
}
|
|
1192
|
-
if (
|
|
1193
|
-
|
|
1251
|
+
if (qsMethods) {
|
|
1252
|
+
qsMethods(Object.assign(Object.assign({}, commitParams), {
|
|
1194
1253
|
response: rest
|
|
1195
1254
|
}));
|
|
1196
1255
|
}
|
|
@@ -1199,8 +1258,56 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1199
1258
|
};
|
|
1200
1259
|
}).catch(rest => {
|
|
1201
1260
|
reactData.tableLoading = false;
|
|
1202
|
-
if (
|
|
1203
|
-
|
|
1261
|
+
if (qeMethods) {
|
|
1262
|
+
qeMethods(Object.assign(Object.assign({}, commitParams), {
|
|
1263
|
+
response: rest
|
|
1264
|
+
}));
|
|
1265
|
+
}
|
|
1266
|
+
return {
|
|
1267
|
+
status: false
|
|
1268
|
+
};
|
|
1269
|
+
});
|
|
1270
|
+
} else {
|
|
1271
|
+
(0, _log.errLog)('vxe.error.notFunc', ['[gantt] proxy-config.ajax.query']);
|
|
1272
|
+
}
|
|
1273
|
+
break;
|
|
1274
|
+
}
|
|
1275
|
+
case 'queryFooter':
|
|
1276
|
+
{
|
|
1277
|
+
const qfMethods = ajax.queryFooter;
|
|
1278
|
+
const qfSuccessMethods = ajax.queryFooterSuccess;
|
|
1279
|
+
const qfErrorMethods = ajax.queryFooterError;
|
|
1280
|
+
if (qfMethods) {
|
|
1281
|
+
let filterList = [];
|
|
1282
|
+
if ($xeTable) {
|
|
1283
|
+
filterList = $xeTable.getCheckedFilters();
|
|
1284
|
+
}
|
|
1285
|
+
const commitParams = {
|
|
1286
|
+
$table: $xeTable,
|
|
1287
|
+
$grid: null,
|
|
1288
|
+
$gantt: $xeGantt,
|
|
1289
|
+
code,
|
|
1290
|
+
button,
|
|
1291
|
+
filters: filterList,
|
|
1292
|
+
form: formData,
|
|
1293
|
+
options: qfMethods
|
|
1294
|
+
};
|
|
1295
|
+
return Promise.resolve((beforeQueryFooter || qfMethods)(commitParams, ...args)).then(rest => {
|
|
1296
|
+
reactData.footerData = _xeUtils.default.isArray(rest) ? rest : [];
|
|
1297
|
+
if (afterQueryFooter) {
|
|
1298
|
+
afterQueryFooter(commitParams, ...args);
|
|
1299
|
+
}
|
|
1300
|
+
if (qfSuccessMethods) {
|
|
1301
|
+
qfSuccessMethods(Object.assign(Object.assign({}, commitParams), {
|
|
1302
|
+
response: rest
|
|
1303
|
+
}));
|
|
1304
|
+
}
|
|
1305
|
+
return {
|
|
1306
|
+
status: true
|
|
1307
|
+
};
|
|
1308
|
+
}).catch(rest => {
|
|
1309
|
+
if (qfErrorMethods) {
|
|
1310
|
+
qfErrorMethods(Object.assign(Object.assign({}, commitParams), {
|
|
1204
1311
|
response: rest
|
|
1205
1312
|
}));
|
|
1206
1313
|
}
|
|
@@ -1209,16 +1316,16 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1209
1316
|
};
|
|
1210
1317
|
});
|
|
1211
1318
|
} else {
|
|
1212
|
-
(0, _log.errLog)('vxe.error.notFunc', ['proxy-config.ajax.
|
|
1319
|
+
(0, _log.errLog)('vxe.error.notFunc', ['[gantt] proxy-config.ajax.queryFooter']);
|
|
1213
1320
|
}
|
|
1214
1321
|
break;
|
|
1215
1322
|
}
|
|
1216
1323
|
case 'delete':
|
|
1217
1324
|
{
|
|
1218
|
-
const
|
|
1325
|
+
const dMethods = ajax.delete;
|
|
1219
1326
|
const deleteSuccessMethods = ajax.deleteSuccess;
|
|
1220
1327
|
const deleteErrorMethods = ajax.deleteError;
|
|
1221
|
-
if (
|
|
1328
|
+
if (dMethods) {
|
|
1222
1329
|
const selectRecords = $xeGantt.getCheckboxRecords();
|
|
1223
1330
|
const removeRecords = selectRecords.filter(row => !$xeTable.isInsertByRow(row));
|
|
1224
1331
|
const body = {
|
|
@@ -1232,7 +1339,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1232
1339
|
button,
|
|
1233
1340
|
body,
|
|
1234
1341
|
form: formData,
|
|
1235
|
-
options:
|
|
1342
|
+
options: dMethods
|
|
1236
1343
|
};
|
|
1237
1344
|
if (selectRecords.length) {
|
|
1238
1345
|
return handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
@@ -1240,7 +1347,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1240
1347
|
return $xeTable.remove(selectRecords);
|
|
1241
1348
|
}
|
|
1242
1349
|
reactData.tableLoading = true;
|
|
1243
|
-
return Promise.resolve((beforeDelete ||
|
|
1350
|
+
return Promise.resolve((beforeDelete || dMethods)(commitParams, ...args)).then(rest => {
|
|
1244
1351
|
reactData.tableLoading = false;
|
|
1245
1352
|
$xeTable.setPendingRow(removeRecords, false);
|
|
1246
1353
|
if (isRespMsg) {
|
|
@@ -1254,7 +1361,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1254
1361
|
if (afterDelete) {
|
|
1255
1362
|
afterDelete(commitParams, ...args);
|
|
1256
1363
|
} else {
|
|
1364
|
+
internalData.uFoot = true;
|
|
1257
1365
|
$xeGantt.commitProxy('query');
|
|
1366
|
+
internalData.uFoot = false;
|
|
1367
|
+
updateQueryFooter();
|
|
1258
1368
|
}
|
|
1259
1369
|
if (deleteSuccessMethods) {
|
|
1260
1370
|
deleteSuccessMethods(Object.assign(Object.assign({}, commitParams), {
|
|
@@ -1297,7 +1407,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1297
1407
|
}
|
|
1298
1408
|
}
|
|
1299
1409
|
} else {
|
|
1300
|
-
(0, _log.errLog)('vxe.error.notFunc', ['proxy-config.ajax.delete']);
|
|
1410
|
+
(0, _log.errLog)('vxe.error.notFunc', ['[gantt] proxy-config.ajax.delete']);
|
|
1301
1411
|
}
|
|
1302
1412
|
break;
|
|
1303
1413
|
}
|
|
@@ -1358,7 +1468,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1358
1468
|
if (afterSave) {
|
|
1359
1469
|
afterSave(commitParams, ...args);
|
|
1360
1470
|
} else {
|
|
1471
|
+
internalData.uFoot = true;
|
|
1361
1472
|
$xeGantt.commitProxy('query');
|
|
1473
|
+
internalData.uFoot = false;
|
|
1474
|
+
updateQueryFooter();
|
|
1362
1475
|
}
|
|
1363
1476
|
if (saveSuccessMethods) {
|
|
1364
1477
|
saveSuccessMethods(Object.assign(Object.assign({}, commitParams), {
|
|
@@ -1401,7 +1514,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1401
1514
|
}
|
|
1402
1515
|
});
|
|
1403
1516
|
} else {
|
|
1404
|
-
(0, _log.errLog)('vxe.error.notFunc', ['proxy-config.ajax.save']);
|
|
1517
|
+
(0, _log.errLog)('vxe.error.notFunc', ['[gantt] proxy-config.ajax.save']);
|
|
1405
1518
|
}
|
|
1406
1519
|
break;
|
|
1407
1520
|
}
|
|
@@ -1419,7 +1532,7 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1419
1532
|
$gantt: $xeGantt
|
|
1420
1533
|
}, ...args);
|
|
1421
1534
|
} else {
|
|
1422
|
-
(0, _log.errLog)('vxe.error.notCommands', [code]);
|
|
1535
|
+
(0, _log.errLog)('vxe.error.notCommands', [`[grid] ${code}`]);
|
|
1423
1536
|
}
|
|
1424
1537
|
}
|
|
1425
1538
|
}
|
|
@@ -1638,6 +1751,9 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1638
1751
|
* 获取需要排除的高度
|
|
1639
1752
|
*/
|
|
1640
1753
|
getExcludeHeight() {
|
|
1754
|
+
const {
|
|
1755
|
+
height
|
|
1756
|
+
} = props;
|
|
1641
1757
|
const {
|
|
1642
1758
|
isZMax
|
|
1643
1759
|
} = reactData;
|
|
@@ -1649,7 +1765,10 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1649
1765
|
const bottomWrapper = refBottomWrapper.value;
|
|
1650
1766
|
const pagerWrapper = refPagerWrapper.value;
|
|
1651
1767
|
const parentEl = el.parentElement;
|
|
1652
|
-
|
|
1768
|
+
let parentPaddingSize = 0;
|
|
1769
|
+
if (parentEl && (height === '100%' || height === 'auto')) {
|
|
1770
|
+
parentPaddingSize = isZMax ? 0 : (0, _dom.getPaddingTopBottomSize)(parentEl);
|
|
1771
|
+
}
|
|
1653
1772
|
return parentPaddingSize + (0, _dom.getPaddingTopBottomSize)(el) + (0, _dom.getOffsetHeight)(formWrapper) + (0, _dom.getOffsetHeight)(toolbarWrapper) + (0, _dom.getOffsetHeight)(topWrapper) + (0, _dom.getOffsetHeight)(bottomWrapper) + (0, _dom.getOffsetHeight)(pagerWrapper);
|
|
1654
1773
|
}
|
|
1655
1774
|
return 0;
|
|
@@ -1666,13 +1785,25 @@ var _default = exports.default = (0, _comp.defineVxeComponent)({
|
|
|
1666
1785
|
const {
|
|
1667
1786
|
code
|
|
1668
1787
|
} = params;
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
}), evnt);
|
|
1788
|
+
if (code) {
|
|
1789
|
+
const isUf = ['reload', 'delete', 'save'].includes(code);
|
|
1790
|
+
if (isUf) {
|
|
1791
|
+
internalData.uFoot = true;
|
|
1674
1792
|
}
|
|
1675
|
-
|
|
1793
|
+
const rest = $xeGantt.commitProxy(params, evnt).then(rest => {
|
|
1794
|
+
if (rest && rest.status && ['query', 'reload', 'delete', 'save'].includes(code)) {
|
|
1795
|
+
$xeGantt.dispatchEvent(code === 'delete' || code === 'save' ? `proxy-${code}` : 'proxy-query', Object.assign(Object.assign({}, rest), {
|
|
1796
|
+
isReload: code === 'reload'
|
|
1797
|
+
}), evnt);
|
|
1798
|
+
}
|
|
1799
|
+
});
|
|
1800
|
+
internalData.uFoot = false;
|
|
1801
|
+
if (isUf) {
|
|
1802
|
+
updateQueryFooter();
|
|
1803
|
+
}
|
|
1804
|
+
return rest;
|
|
1805
|
+
}
|
|
1806
|
+
return (0, _vue.nextTick)();
|
|
1676
1807
|
},
|
|
1677
1808
|
triggerToolbarBtnEvent(button, evnt) {
|
|
1678
1809
|
$xeGantt.triggerToolbarCommitEvent(button, evnt);
|