vxe-gantt 4.6.4 → 4.6.6
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 +265 -163
- package/dist/style.css +1 -1
- package/dist/style.min.css +1 -1
- package/es/gantt/src/gantt.js +263 -161
- 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/lib/gantt/src/gantt.js +336 -204
- package/lib/gantt/src/gantt.min.js +1 -1
- package/lib/index.umd.js +356 -210
- 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/package.json +3 -3
- package/packages/gantt/src/gantt.ts +254 -153
- package/styles/theme/base.scss +1 -1
package/dist/all.esm.js
CHANGED
|
@@ -6,7 +6,7 @@ import DomZIndex from 'dom-zindex';
|
|
|
6
6
|
import { VxeTable } from 'vxe-table';
|
|
7
7
|
|
|
8
8
|
const { setConfig: setConfig$1, setIcon } = VxeUI;
|
|
9
|
-
VxeUI.ganttVersion = "4.6.
|
|
9
|
+
VxeUI.ganttVersion = "4.6.6";
|
|
10
10
|
const ymdFormat = 'yyyy-MM-dd';
|
|
11
11
|
const ymdhmsFormat = 'yyyy-MM-dd HH:mm:ss';
|
|
12
12
|
setConfig$1({
|
|
@@ -115,7 +115,7 @@ setIcon({
|
|
|
115
115
|
});
|
|
116
116
|
|
|
117
117
|
const { log } = VxeUI;
|
|
118
|
-
const ganttVersion = `gantt v${"4.6.
|
|
118
|
+
const ganttVersion = `gantt v${"4.6.6"}`;
|
|
119
119
|
function createComponentLog(name) {
|
|
120
120
|
const uiVersion = VxeUI.uiVersion ? `ui v${VxeUI.uiVersion}` : '';
|
|
121
121
|
const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
|
|
@@ -4221,7 +4221,7 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4221
4221
|
const proxyOpts = computeProxyOpts.value;
|
|
4222
4222
|
const pagerOpts = computePagerOpts.value;
|
|
4223
4223
|
const toolbarOpts = computeToolbarOpts.value;
|
|
4224
|
-
const { beforeQuery, afterQuery, beforeQueryFooter, afterQueryFooter, beforeDelete, afterDelete, beforeSave, afterSave, ajax = {} } = proxyOpts;
|
|
4224
|
+
const { beforeQuery: oldBeforeQuery, afterQuery: oldAfterQuery, beforeQueryFooter: oldBeforeQueryFooter, afterQueryFooter: oldAfterQueryFooter, beforeDelete: oldBeforeDelete, afterDelete: oldAfterDelete, beforeSave: oldBeforeSave, afterSave: oldAfterSave, ajax = {} } = proxyOpts;
|
|
4225
4225
|
const resConfigs = (proxyOpts.response || proxyOpts.props || {});
|
|
4226
4226
|
const $xeTable = refTable.value;
|
|
4227
4227
|
if (!$xeTable) {
|
|
@@ -4272,10 +4272,12 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4272
4272
|
case 'initial':
|
|
4273
4273
|
case 'reload':
|
|
4274
4274
|
case 'query': {
|
|
4275
|
-
const
|
|
4276
|
-
const
|
|
4277
|
-
const
|
|
4278
|
-
|
|
4275
|
+
const bqMethod = ajax.beforeQuery;
|
|
4276
|
+
const qMethod = ajax.query;
|
|
4277
|
+
const aqMethod = ajax.afterQuery;
|
|
4278
|
+
const qsMethod = ajax.querySuccess;
|
|
4279
|
+
const qeMethod = ajax.queryError;
|
|
4280
|
+
if (qMethod) {
|
|
4279
4281
|
const isInited = code === 'initial';
|
|
4280
4282
|
const isReload = code === 'reload';
|
|
4281
4283
|
if (!isInited && reactData.tableLoading) {
|
|
@@ -4357,73 +4359,91 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4357
4359
|
sorts: sortList,
|
|
4358
4360
|
filters: filterList,
|
|
4359
4361
|
form: formData,
|
|
4360
|
-
options:
|
|
4362
|
+
options: qMethod
|
|
4361
4363
|
};
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
Promise.
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4371
|
-
|
|
4372
|
-
|
|
4373
|
-
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
4374
|
-
const totalProp = resConfigs.total;
|
|
4375
|
-
const total = (XEUtils.isFunction(totalProp) ? totalProp(reParams) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
4376
|
-
tablePage.total = XEUtils.toNumber(total);
|
|
4377
|
-
const resultProp = resConfigs.result;
|
|
4378
|
-
tableData = (XEUtils.isFunction(resultProp) ? resultProp(reParams) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
4379
|
-
// 检验当前页码,不能超出当前最大页数
|
|
4380
|
-
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
4381
|
-
if (tablePage.currentPage > pageCount) {
|
|
4382
|
-
tablePage.currentPage = pageCount;
|
|
4383
|
-
}
|
|
4364
|
+
const handleQuery = () => {
|
|
4365
|
+
reactData.sortData = sortList;
|
|
4366
|
+
reactData.filterData = filterList;
|
|
4367
|
+
reactData.tableLoading = true;
|
|
4368
|
+
return Promise.all([
|
|
4369
|
+
Promise.resolve((oldBeforeQuery || qMethod)(commitParams, ...args)),
|
|
4370
|
+
operPromise
|
|
4371
|
+
]).then(([rest]) => {
|
|
4372
|
+
reactData.tableLoading = false;
|
|
4373
|
+
if (aqMethod) {
|
|
4374
|
+
aqMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
4384
4375
|
}
|
|
4385
4376
|
else {
|
|
4386
|
-
|
|
4387
|
-
if (
|
|
4388
|
-
|
|
4389
|
-
|
|
4390
|
-
|
|
4391
|
-
|
|
4392
|
-
|
|
4393
|
-
|
|
4394
|
-
|
|
4395
|
-
|
|
4396
|
-
|
|
4397
|
-
|
|
4398
|
-
|
|
4377
|
+
let tableData = [];
|
|
4378
|
+
if (rest) {
|
|
4379
|
+
const reParams = { data: rest, $table: $xeTable, $grid: null, $gantt: $xeGantt };
|
|
4380
|
+
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
4381
|
+
const totalProp = resConfigs.total;
|
|
4382
|
+
const total = (XEUtils.isFunction(totalProp) ? totalProp(reParams) : XEUtils.get(rest, totalProp || 'page.total')) || 0;
|
|
4383
|
+
tablePage.total = XEUtils.toNumber(total);
|
|
4384
|
+
const resultProp = resConfigs.result;
|
|
4385
|
+
tableData = (XEUtils.isFunction(resultProp) ? resultProp(reParams) : XEUtils.get(rest, resultProp || 'result')) || [];
|
|
4386
|
+
// 检验当前页码,不能超出当前最大页数
|
|
4387
|
+
const pageCount = Math.max(Math.ceil(total / tablePage.pageSize), 1);
|
|
4388
|
+
if (tablePage.currentPage > pageCount) {
|
|
4389
|
+
tablePage.currentPage = pageCount;
|
|
4390
|
+
}
|
|
4391
|
+
}
|
|
4392
|
+
else {
|
|
4393
|
+
const listProp = resConfigs.list;
|
|
4394
|
+
if (XEUtils.isArray(rest)) {
|
|
4395
|
+
tableData = rest;
|
|
4396
|
+
}
|
|
4397
|
+
else if (listProp) {
|
|
4398
|
+
tableData = (XEUtils.isFunction(listProp) ? listProp(reParams) : XEUtils.get(rest, listProp)) || [];
|
|
4399
|
+
}
|
|
4400
|
+
}
|
|
4401
|
+
if (showFooter) {
|
|
4402
|
+
const fdProp = resConfigs.footerData;
|
|
4403
|
+
const footerList = fdProp ? (XEUtils.isFunction(fdProp) ? fdProp(reParams) : XEUtils.get(rest, fdProp)) : [];
|
|
4404
|
+
if (XEUtils.isArray(footerList)) {
|
|
4405
|
+
reactData.footerData = footerList;
|
|
4406
|
+
}
|
|
4407
|
+
}
|
|
4399
4408
|
}
|
|
4400
|
-
}
|
|
4401
|
-
}
|
|
4402
|
-
if ($xeTable) {
|
|
4403
|
-
$xeTable.loadData(tableData);
|
|
4404
|
-
}
|
|
4405
|
-
else {
|
|
4406
|
-
nextTick(() => {
|
|
4407
|
-
const $xeTable = refTable.value;
|
|
4408
4409
|
if ($xeTable) {
|
|
4409
4410
|
$xeTable.loadData(tableData);
|
|
4410
4411
|
}
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
|
|
4418
|
-
|
|
4419
|
-
|
|
4420
|
-
|
|
4421
|
-
|
|
4422
|
-
|
|
4423
|
-
|
|
4424
|
-
|
|
4425
|
-
|
|
4426
|
-
|
|
4412
|
+
else {
|
|
4413
|
+
nextTick(() => {
|
|
4414
|
+
const $xeTable = refTable.value;
|
|
4415
|
+
if ($xeTable) {
|
|
4416
|
+
$xeTable.loadData(tableData);
|
|
4417
|
+
}
|
|
4418
|
+
});
|
|
4419
|
+
}
|
|
4420
|
+
if (oldAfterQuery) {
|
|
4421
|
+
oldAfterQuery(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
4422
|
+
}
|
|
4423
|
+
}
|
|
4424
|
+
if (qsMethod) {
|
|
4425
|
+
qsMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
4426
|
+
}
|
|
4427
|
+
return { status: true };
|
|
4428
|
+
}).catch((rest) => {
|
|
4429
|
+
reactData.tableLoading = false;
|
|
4430
|
+
if (aqMethod) {
|
|
4431
|
+
aqMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
4432
|
+
}
|
|
4433
|
+
if (qeMethod) {
|
|
4434
|
+
qeMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
4435
|
+
}
|
|
4436
|
+
return { status: false };
|
|
4437
|
+
});
|
|
4438
|
+
};
|
|
4439
|
+
if (bqMethod) {
|
|
4440
|
+
return Promise.resolve(bqMethod(commitParams, ...args)).then(status => {
|
|
4441
|
+
if (status !== false) {
|
|
4442
|
+
return handleQuery();
|
|
4443
|
+
}
|
|
4444
|
+
});
|
|
4445
|
+
}
|
|
4446
|
+
return handleQuery();
|
|
4427
4447
|
}
|
|
4428
4448
|
else {
|
|
4429
4449
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.query']);
|
|
@@ -4431,39 +4451,66 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4431
4451
|
break;
|
|
4432
4452
|
}
|
|
4433
4453
|
case 'queryFooter': {
|
|
4434
|
-
const
|
|
4435
|
-
const
|
|
4436
|
-
const
|
|
4437
|
-
|
|
4454
|
+
const bqfMethod = ajax.beforeQueryFooter;
|
|
4455
|
+
const qfMethod = ajax.queryFooter;
|
|
4456
|
+
const aqfMethod = ajax.afterQueryFooter;
|
|
4457
|
+
const qfSuccessMethod = ajax.queryFooterSuccess;
|
|
4458
|
+
const qfErrorMethod = ajax.queryFooterError;
|
|
4459
|
+
if (qfMethod) {
|
|
4438
4460
|
let filterList = [];
|
|
4439
4461
|
if ($xeTable) {
|
|
4440
4462
|
filterList = $xeTable.getCheckedFilters();
|
|
4441
4463
|
}
|
|
4464
|
+
let pageParams = {};
|
|
4465
|
+
if (pagerConfig) {
|
|
4466
|
+
if (isEnableConf(pagerOpts)) {
|
|
4467
|
+
pageParams = Object.assign({}, tablePage);
|
|
4468
|
+
}
|
|
4469
|
+
}
|
|
4442
4470
|
const commitParams = {
|
|
4443
4471
|
$table: $xeTable,
|
|
4444
4472
|
$grid: null,
|
|
4445
4473
|
$gantt: $xeGantt,
|
|
4446
4474
|
code,
|
|
4447
4475
|
button,
|
|
4476
|
+
page: pageParams,
|
|
4448
4477
|
filters: filterList,
|
|
4449
4478
|
form: formData,
|
|
4450
|
-
options:
|
|
4479
|
+
options: qfMethod
|
|
4451
4480
|
};
|
|
4452
|
-
|
|
4453
|
-
|
|
4454
|
-
|
|
4455
|
-
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
|
|
4460
|
-
|
|
4461
|
-
|
|
4462
|
-
|
|
4463
|
-
|
|
4464
|
-
|
|
4465
|
-
|
|
4466
|
-
|
|
4481
|
+
const handleQueryFooter = () => {
|
|
4482
|
+
return Promise.resolve((oldBeforeQueryFooter || qfMethod)(commitParams, ...args)).then(rest => {
|
|
4483
|
+
if (aqfMethod) {
|
|
4484
|
+
aqfMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
4485
|
+
}
|
|
4486
|
+
else {
|
|
4487
|
+
reactData.footerData = XEUtils.isArray(rest) ? rest : [];
|
|
4488
|
+
if (oldAfterQueryFooter) {
|
|
4489
|
+
oldAfterQueryFooter(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
4490
|
+
}
|
|
4491
|
+
}
|
|
4492
|
+
if (qfSuccessMethod) {
|
|
4493
|
+
qfSuccessMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
4494
|
+
}
|
|
4495
|
+
return { status: true };
|
|
4496
|
+
}).catch((rest) => {
|
|
4497
|
+
if (aqfMethod) {
|
|
4498
|
+
aqfMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
4499
|
+
}
|
|
4500
|
+
if (qfErrorMethod) {
|
|
4501
|
+
qfErrorMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
4502
|
+
}
|
|
4503
|
+
return { status: false };
|
|
4504
|
+
});
|
|
4505
|
+
};
|
|
4506
|
+
if (bqfMethod) {
|
|
4507
|
+
return Promise.resolve(bqfMethod(commitParams, ...args)).then(status => {
|
|
4508
|
+
if (status !== false) {
|
|
4509
|
+
return handleQueryFooter();
|
|
4510
|
+
}
|
|
4511
|
+
});
|
|
4512
|
+
}
|
|
4513
|
+
return handleQueryFooter();
|
|
4467
4514
|
}
|
|
4468
4515
|
else {
|
|
4469
4516
|
errLog('vxe.error.notFunc', ['proxy-config.ajax.queryFooter']);
|
|
@@ -4471,10 +4518,12 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4471
4518
|
break;
|
|
4472
4519
|
}
|
|
4473
4520
|
case 'delete': {
|
|
4474
|
-
const
|
|
4521
|
+
const bdMethod = ajax.beforeDelete;
|
|
4522
|
+
const dMethod = ajax.delete;
|
|
4523
|
+
const adMethod = ajax.afterDelete;
|
|
4475
4524
|
const deleteSuccessMethods = ajax.deleteSuccess;
|
|
4476
4525
|
const deleteErrorMethods = ajax.deleteError;
|
|
4477
|
-
if (
|
|
4526
|
+
if (dMethod) {
|
|
4478
4527
|
const selectRecords = $xeGantt.getCheckboxRecords();
|
|
4479
4528
|
const removeRecords = selectRecords.filter(row => !$xeTable.isInsertByRow(row));
|
|
4480
4529
|
const body = { removeRecords };
|
|
@@ -4486,49 +4535,69 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4486
4535
|
button,
|
|
4487
4536
|
body,
|
|
4488
4537
|
form: formData,
|
|
4489
|
-
options:
|
|
4538
|
+
options: dMethod
|
|
4490
4539
|
};
|
|
4491
4540
|
if (selectRecords.length) {
|
|
4492
4541
|
return handleDeleteRow(code, 'vxe.grid.deleteSelectRecord', () => {
|
|
4493
4542
|
if (!removeRecords.length) {
|
|
4494
4543
|
return $xeTable.remove(selectRecords);
|
|
4495
4544
|
}
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
.
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
VxeUI.modal.message({ content: getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' });
|
|
4545
|
+
const handleDelete = () => {
|
|
4546
|
+
reactData.tableLoading = true;
|
|
4547
|
+
return Promise.resolve((oldBeforeDelete || dMethod)(commitParams, ...args))
|
|
4548
|
+
.then(rest => {
|
|
4549
|
+
reactData.tableLoading = false;
|
|
4550
|
+
if (adMethod) {
|
|
4551
|
+
adMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
4504
4552
|
}
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
reactData.tableLoading = false;
|
|
4522
|
-
if (isRespMsg) {
|
|
4523
|
-
if (VxeUI.modal) {
|
|
4524
|
-
VxeUI.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
4553
|
+
else {
|
|
4554
|
+
$xeTable.setPendingRow(removeRecords, false);
|
|
4555
|
+
if (isRespMsg) {
|
|
4556
|
+
if (VxeUI.modal) {
|
|
4557
|
+
VxeUI.modal.message({ content: getRespMsg(rest, 'vxe.grid.delSuccess'), status: 'success' });
|
|
4558
|
+
}
|
|
4559
|
+
}
|
|
4560
|
+
if (oldAfterDelete) {
|
|
4561
|
+
oldAfterDelete(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
4562
|
+
}
|
|
4563
|
+
else {
|
|
4564
|
+
internalData.uFoot = true;
|
|
4565
|
+
$xeGantt.commitProxy('query');
|
|
4566
|
+
internalData.uFoot = false;
|
|
4567
|
+
updateQueryFooter();
|
|
4568
|
+
}
|
|
4525
4569
|
}
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4570
|
+
if (deleteSuccessMethods) {
|
|
4571
|
+
deleteSuccessMethods(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
4572
|
+
}
|
|
4573
|
+
return { status: true };
|
|
4574
|
+
})
|
|
4575
|
+
.catch(rest => {
|
|
4576
|
+
reactData.tableLoading = false;
|
|
4577
|
+
if (adMethod) {
|
|
4578
|
+
adMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
4579
|
+
}
|
|
4580
|
+
else {
|
|
4581
|
+
if (isRespMsg) {
|
|
4582
|
+
if (VxeUI.modal) {
|
|
4583
|
+
VxeUI.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
4584
|
+
}
|
|
4585
|
+
}
|
|
4586
|
+
}
|
|
4587
|
+
if (deleteErrorMethods) {
|
|
4588
|
+
deleteErrorMethods(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
4589
|
+
}
|
|
4590
|
+
return { status: false };
|
|
4591
|
+
});
|
|
4592
|
+
};
|
|
4593
|
+
if (bdMethod) {
|
|
4594
|
+
return Promise.resolve(bdMethod(commitParams, ...args)).then(status => {
|
|
4595
|
+
if (status !== false) {
|
|
4596
|
+
return handleDelete();
|
|
4597
|
+
}
|
|
4598
|
+
});
|
|
4599
|
+
}
|
|
4600
|
+
return handleDelete();
|
|
4532
4601
|
});
|
|
4533
4602
|
}
|
|
4534
4603
|
else {
|
|
@@ -4545,10 +4614,12 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4545
4614
|
break;
|
|
4546
4615
|
}
|
|
4547
4616
|
case 'save': {
|
|
4548
|
-
const
|
|
4549
|
-
const
|
|
4550
|
-
const
|
|
4551
|
-
|
|
4617
|
+
const bSaveMethod = ajax.beforeSave;
|
|
4618
|
+
const sMethod = ajax.save;
|
|
4619
|
+
const aSaveMethod = ajax.afterSave;
|
|
4620
|
+
const sSuccessMethod = ajax.saveSuccess;
|
|
4621
|
+
const sErrorMethod = ajax.saveError;
|
|
4622
|
+
if (sMethod) {
|
|
4552
4623
|
const body = $xeTable.getRecordset();
|
|
4553
4624
|
const { insertRecords, removeRecords, updateRecords, pendingRecords } = body;
|
|
4554
4625
|
const commitParams = {
|
|
@@ -4559,7 +4630,7 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4559
4630
|
button,
|
|
4560
4631
|
body,
|
|
4561
4632
|
form: formData,
|
|
4562
|
-
options:
|
|
4633
|
+
options: sMethod
|
|
4563
4634
|
};
|
|
4564
4635
|
// 排除掉新增且标记为删除的数据
|
|
4565
4636
|
if (insertRecords.length) {
|
|
@@ -4580,42 +4651,62 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4580
4651
|
return;
|
|
4581
4652
|
}
|
|
4582
4653
|
if (body.insertRecords.length || removeRecords.length || updateRecords.length || body.pendingRecords.length) {
|
|
4583
|
-
|
|
4584
|
-
|
|
4585
|
-
.
|
|
4586
|
-
|
|
4587
|
-
|
|
4588
|
-
|
|
4589
|
-
|
|
4590
|
-
VxeUI.modal.message({ content: getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' });
|
|
4654
|
+
const handleSave = () => {
|
|
4655
|
+
reactData.tableLoading = true;
|
|
4656
|
+
return Promise.resolve((oldBeforeSave || sMethod)(commitParams, ...args))
|
|
4657
|
+
.then(rest => {
|
|
4658
|
+
reactData.tableLoading = false;
|
|
4659
|
+
if (aSaveMethod) {
|
|
4660
|
+
aSaveMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'success' }), ...args);
|
|
4591
4661
|
}
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
|
|
4596
|
-
|
|
4597
|
-
|
|
4598
|
-
|
|
4599
|
-
|
|
4600
|
-
|
|
4601
|
-
|
|
4602
|
-
|
|
4603
|
-
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
|
|
4607
|
-
|
|
4608
|
-
reactData.tableLoading = false;
|
|
4609
|
-
if (isRespMsg) {
|
|
4610
|
-
if (VxeUI.modal) {
|
|
4611
|
-
VxeUI.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
4662
|
+
else {
|
|
4663
|
+
$xeTable.clearPendingRow();
|
|
4664
|
+
if (isRespMsg) {
|
|
4665
|
+
if (VxeUI.modal) {
|
|
4666
|
+
VxeUI.modal.message({ content: getRespMsg(rest, 'vxe.grid.saveSuccess'), status: 'success' });
|
|
4667
|
+
}
|
|
4668
|
+
}
|
|
4669
|
+
if (oldAfterSave) {
|
|
4670
|
+
oldAfterSave(Object.assign(Object.assign({}, commitParams), { response: rest }), ...args);
|
|
4671
|
+
}
|
|
4672
|
+
else {
|
|
4673
|
+
internalData.uFoot = true;
|
|
4674
|
+
$xeGantt.commitProxy('query');
|
|
4675
|
+
internalData.uFoot = false;
|
|
4676
|
+
updateQueryFooter();
|
|
4677
|
+
}
|
|
4612
4678
|
}
|
|
4613
|
-
|
|
4614
|
-
|
|
4615
|
-
|
|
4616
|
-
|
|
4617
|
-
|
|
4618
|
-
|
|
4679
|
+
if (sSuccessMethod) {
|
|
4680
|
+
sSuccessMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
4681
|
+
}
|
|
4682
|
+
return { status: true };
|
|
4683
|
+
})
|
|
4684
|
+
.catch(rest => {
|
|
4685
|
+
reactData.tableLoading = false;
|
|
4686
|
+
if (aSaveMethod) {
|
|
4687
|
+
aSaveMethod(Object.assign(Object.assign({}, commitParams), { response: rest, status: 'error' }), ...args);
|
|
4688
|
+
}
|
|
4689
|
+
else {
|
|
4690
|
+
if (isRespMsg) {
|
|
4691
|
+
if (VxeUI.modal) {
|
|
4692
|
+
VxeUI.modal.message({ id: code, content: getRespMsg(rest, 'vxe.grid.operError'), status: 'error' });
|
|
4693
|
+
}
|
|
4694
|
+
}
|
|
4695
|
+
}
|
|
4696
|
+
if (sErrorMethod) {
|
|
4697
|
+
sErrorMethod(Object.assign(Object.assign({}, commitParams), { response: rest }));
|
|
4698
|
+
}
|
|
4699
|
+
return { status: false };
|
|
4700
|
+
});
|
|
4701
|
+
};
|
|
4702
|
+
if (bSaveMethod) {
|
|
4703
|
+
return Promise.resolve(bSaveMethod(commitParams, ...args)).then(status => {
|
|
4704
|
+
if (status !== false) {
|
|
4705
|
+
return handleSave();
|
|
4706
|
+
}
|
|
4707
|
+
});
|
|
4708
|
+
}
|
|
4709
|
+
return handleSave();
|
|
4619
4710
|
}
|
|
4620
4711
|
else {
|
|
4621
4712
|
if (isActiveMsg) {
|
|
@@ -4773,6 +4864,17 @@ var VxeGanttComponent = defineVxeComponent({
|
|
|
4773
4864
|
}
|
|
4774
4865
|
return null;
|
|
4775
4866
|
},
|
|
4867
|
+
getCustomPagerData() {
|
|
4868
|
+
const { pagerConfig } = props;
|
|
4869
|
+
const { tablePage } = reactData;
|
|
4870
|
+
const pagerOpts = computePagerOpts.value;
|
|
4871
|
+
if (pagerConfig && isEnableConf(pagerOpts)) {
|
|
4872
|
+
return {
|
|
4873
|
+
pSize: tablePage.pageSize
|
|
4874
|
+
};
|
|
4875
|
+
}
|
|
4876
|
+
return {};
|
|
4877
|
+
},
|
|
4776
4878
|
// setProxyInfo (options) {
|
|
4777
4879
|
// if (props.proxyConfig && options) {
|
|
4778
4880
|
// const { pager, form } = options
|