ls-pro-common 1.0.62 → 1.0.63
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/CHANGELOG.md +746 -746
- package/README.md +22 -22
- package/dist/common.css +101 -22
- package/dist/common.js +1 -1
- package/dist/common.min.css +101 -22
- package/dist/common.min.js +1 -1
- package/es/components/IconSelector.d.ts +2 -8
- package/es/components/IconSelector.js +114 -207
- package/es/components/ImageSelector.d.ts +3 -0
- package/es/components/ImageSelector.js +128 -24
- package/es/components/InputMultiLine.js +1 -1
- package/es/components/InputTable.d.ts +5 -0
- package/es/components/InputTable.js +26 -4
- package/es/components/common.less +176 -119
- package/es/hooks/useDtl/index.d.ts +13 -0
- package/es/hooks/useDtl/index.js +388 -235
- package/es/hooks/usePermission/index.d.ts +1 -0
- package/es/hooks/usePermission/index.js +23 -1
- package/es/hooks/useSingle/index.d.ts +1 -0
- package/es/hooks/useSingle/index.js +3 -1
- package/es/http/index.js +26 -7
- package/es/service/BaseService.d.ts +8 -0
- package/es/service/BaseService.js +69 -26
- package/es/typing.d.ts +4 -0
- package/es/utils/index.d.ts +49 -0
- package/es/utils/index.js +142 -1
- package/lib/components/IconSelector.d.ts +2 -8
- package/lib/components/IconSelector.js +112 -214
- package/lib/components/ImageSelector.d.ts +3 -0
- package/lib/components/ImageSelector.js +125 -24
- package/lib/components/InputMultiLine.js +1 -1
- package/lib/components/InputTable.d.ts +5 -0
- package/lib/components/InputTable.js +26 -4
- package/lib/components/common.less +176 -119
- package/lib/hooks/useDtl/index.d.ts +13 -0
- package/lib/hooks/useDtl/index.js +388 -235
- package/lib/hooks/usePermission/index.d.ts +1 -0
- package/lib/hooks/usePermission/index.js +23 -0
- package/lib/hooks/useSingle/index.d.ts +1 -0
- package/lib/hooks/useSingle/index.js +3 -1
- package/lib/http/index.js +24 -6
- package/lib/service/BaseService.d.ts +8 -0
- package/lib/service/BaseService.js +69 -26
- package/lib/typing.d.ts +4 -0
- package/lib/utils/index.d.ts +49 -0
- package/lib/utils/index.js +163 -3
- package/package.json +2 -2
|
@@ -94,10 +94,13 @@ function useDtl(dtlParam) {
|
|
|
94
94
|
/** @name 从表编辑表单Ref */
|
|
95
95
|
|
|
96
96
|
var dtlFormRef = (0, _react.useRef)();
|
|
97
|
+
/**@name 判断是否已审核 */
|
|
98
|
+
|
|
97
99
|
var isAudit = (0, _react.useCallback)(function () {
|
|
98
100
|
if (!auditStatus || !statusField) return false;
|
|
99
101
|
return Number(masterObject[statusField] || 0) >= auditStatus;
|
|
100
102
|
}, [auditStatus, statusField, masterObject]);
|
|
103
|
+
/** @name 保存主表 */
|
|
101
104
|
|
|
102
105
|
var onSaveMst = /*#__PURE__*/function () {
|
|
103
106
|
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(values) {
|
|
@@ -194,262 +197,411 @@ function useDtl(dtlParam) {
|
|
|
194
197
|
return _ref.apply(this, arguments);
|
|
195
198
|
};
|
|
196
199
|
}();
|
|
197
|
-
/**
|
|
200
|
+
/** @name 主从一起保存 */
|
|
198
201
|
|
|
199
202
|
|
|
200
|
-
var
|
|
203
|
+
var onSaveMstDtl = /*#__PURE__*/function () {
|
|
201
204
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
202
|
-
var _result$flag2;
|
|
205
|
+
var _formRef$current, _formRef$current$getF, _tableRef$current, _tableRef$current$get, _tableRef$current2, _tableRef$current2$ge, _result$flag2;
|
|
203
206
|
|
|
204
|
-
var
|
|
207
|
+
var isDelete,
|
|
208
|
+
values,
|
|
209
|
+
mst,
|
|
210
|
+
dtlEditData,
|
|
211
|
+
dtlData,
|
|
212
|
+
param,
|
|
213
|
+
result,
|
|
214
|
+
_args2 = arguments;
|
|
205
215
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
206
216
|
while (1) {
|
|
207
217
|
switch (_context2.prev = _context2.next) {
|
|
208
218
|
case 0:
|
|
209
|
-
|
|
210
|
-
|
|
219
|
+
isDelete = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : false;
|
|
220
|
+
|
|
221
|
+
if (!isAudit()) {
|
|
222
|
+
_context2.next = 4;
|
|
223
|
+
break;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
(0, _utils.showWarn)('当前单据已审核,不能保存');
|
|
227
|
+
return _context2.abrupt("return", false);
|
|
228
|
+
|
|
229
|
+
case 4:
|
|
230
|
+
if (dtlParam.dtlName) {
|
|
231
|
+
_context2.next = 7;
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
(0, _utils.showWarn)('useDtl未传入dtlName参数,不能主从一起保存');
|
|
236
|
+
return _context2.abrupt("return");
|
|
237
|
+
|
|
238
|
+
case 7:
|
|
239
|
+
values = (_formRef$current = formRef.current) === null || _formRef$current === void 0 ? void 0 : (_formRef$current$getF = _formRef$current.getFieldsFormatValue) === null || _formRef$current$getF === void 0 ? void 0 : _formRef$current$getF.call(_formRef$current);
|
|
240
|
+
mst = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, masterObject), values);
|
|
241
|
+
dtlEditData = ((_tableRef$current = tableRef.current) === null || _tableRef$current === void 0 ? void 0 : (_tableRef$current$get = _tableRef$current.getChanged) === null || _tableRef$current$get === void 0 ? void 0 : _tableRef$current$get.call(_tableRef$current)) || {
|
|
242
|
+
insertRows: [],
|
|
243
|
+
updateRows: [],
|
|
244
|
+
deleteRows: []
|
|
245
|
+
};
|
|
246
|
+
dtlData = ((_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$ge = _tableRef$current2.getDatasource) === null || _tableRef$current2$ge === void 0 ? void 0 : _tableRef$current2$ge.call(_tableRef$current2)) || [];
|
|
247
|
+
param = {
|
|
248
|
+
master: mst,
|
|
249
|
+
opType: 'inserted',
|
|
250
|
+
billType: dtlParam.billType,
|
|
251
|
+
codeRuleDynamicField: dtlParam.codeRuleDynamicField,
|
|
252
|
+
details: {}
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
if (isDelete) {
|
|
256
|
+
param.opType = 'deleted';
|
|
257
|
+
param.details[dtlParam.dtlName] = {
|
|
258
|
+
insertRows: dtlData,
|
|
259
|
+
updateRows: [],
|
|
260
|
+
deleteRows: []
|
|
261
|
+
};
|
|
262
|
+
} else if (mst[mstKeyField] && mst.id) {
|
|
263
|
+
param.opType = 'updated';
|
|
264
|
+
param.details[dtlParam.dtlName] = (0, _objectSpread2.default)({}, dtlEditData);
|
|
265
|
+
} else {
|
|
266
|
+
param.details[dtlParam.dtlName] = {
|
|
267
|
+
insertRows: dtlData,
|
|
268
|
+
updateRows: [],
|
|
269
|
+
deleteRows: []
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
_context2.t0 = beforeSave;
|
|
274
|
+
|
|
275
|
+
if (!_context2.t0) {
|
|
276
|
+
_context2.next = 19;
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
_context2.next = 17;
|
|
281
|
+
return beforeSave(param, false);
|
|
282
|
+
|
|
283
|
+
case 17:
|
|
284
|
+
_context2.t1 = _context2.sent;
|
|
285
|
+
_context2.t0 = _context2.t1 === false;
|
|
286
|
+
|
|
287
|
+
case 19:
|
|
288
|
+
if (!_context2.t0) {
|
|
289
|
+
_context2.next = 21;
|
|
290
|
+
break;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
return _context2.abrupt("return", false);
|
|
294
|
+
|
|
295
|
+
case 21:
|
|
296
|
+
_context2.next = 23;
|
|
297
|
+
return mstService.saveMstDtl(param);
|
|
298
|
+
|
|
299
|
+
case 23:
|
|
300
|
+
result = _context2.sent;
|
|
301
|
+
_context2.t2 = afterSave;
|
|
302
|
+
|
|
303
|
+
if (!_context2.t2) {
|
|
304
|
+
_context2.next = 30;
|
|
305
|
+
break;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
_context2.next = 28;
|
|
309
|
+
return afterSave(result, param, false);
|
|
310
|
+
|
|
311
|
+
case 28:
|
|
312
|
+
_context2.t3 = _context2.sent;
|
|
313
|
+
_context2.t2 = _context2.t3 === false;
|
|
314
|
+
|
|
315
|
+
case 30:
|
|
316
|
+
if (!_context2.t2) {
|
|
317
|
+
_context2.next = 32;
|
|
318
|
+
break;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
return _context2.abrupt("return", false);
|
|
322
|
+
|
|
323
|
+
case 32:
|
|
324
|
+
if (!((result === null || result === void 0 ? void 0 : (_result$flag2 = result.flag) === null || _result$flag2 === void 0 ? void 0 : _result$flag2.retCode) === '0')) {
|
|
325
|
+
_context2.next = 37;
|
|
211
326
|
break;
|
|
212
327
|
}
|
|
213
328
|
|
|
329
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '操作成功');
|
|
330
|
+
Object.assign(masterObject, result.data);
|
|
331
|
+
setEditItem({});
|
|
332
|
+
return _context2.abrupt("return", true);
|
|
333
|
+
|
|
334
|
+
case 37:
|
|
214
335
|
return _context2.abrupt("return", false);
|
|
215
336
|
|
|
337
|
+
case 38:
|
|
338
|
+
case "end":
|
|
339
|
+
return _context2.stop();
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
}, _callee2);
|
|
343
|
+
}));
|
|
344
|
+
|
|
345
|
+
return function onSaveMstDtl() {
|
|
346
|
+
return _ref2.apply(this, arguments);
|
|
347
|
+
};
|
|
348
|
+
}();
|
|
349
|
+
/** 删除按钮事件 */
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
var onRemoveMst = /*#__PURE__*/function () {
|
|
353
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
354
|
+
var _result$flag3;
|
|
355
|
+
|
|
356
|
+
var ids, result;
|
|
357
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
358
|
+
while (1) {
|
|
359
|
+
switch (_context3.prev = _context3.next) {
|
|
360
|
+
case 0:
|
|
361
|
+
if (!(!masterObject || !masterObject[mstKeyField])) {
|
|
362
|
+
_context3.next = 2;
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
return _context3.abrupt("return", false);
|
|
367
|
+
|
|
216
368
|
case 2:
|
|
217
369
|
if (!isAudit()) {
|
|
218
|
-
|
|
370
|
+
_context3.next = 5;
|
|
219
371
|
break;
|
|
220
372
|
}
|
|
221
373
|
|
|
222
374
|
(0, _utils.showWarn)('当前单据已审核,不能删除');
|
|
223
|
-
return
|
|
375
|
+
return _context3.abrupt("return", false);
|
|
224
376
|
|
|
225
377
|
case 5:
|
|
226
|
-
|
|
378
|
+
_context3.next = 7;
|
|
227
379
|
return (0, _utils.showConfirm)('确认要删除当前数据?');
|
|
228
380
|
|
|
229
381
|
case 7:
|
|
230
382
|
if (!beforeRemove) {
|
|
231
|
-
|
|
383
|
+
_context3.next = 13;
|
|
232
384
|
break;
|
|
233
385
|
}
|
|
234
386
|
|
|
235
|
-
|
|
387
|
+
_context3.next = 10;
|
|
236
388
|
return beforeRemove([masterObject]);
|
|
237
389
|
|
|
238
390
|
case 10:
|
|
239
|
-
ids =
|
|
391
|
+
ids = _context3.sent;
|
|
240
392
|
|
|
241
393
|
if (!(ids === false)) {
|
|
242
|
-
|
|
394
|
+
_context3.next = 13;
|
|
243
395
|
break;
|
|
244
396
|
}
|
|
245
397
|
|
|
246
|
-
return
|
|
398
|
+
return _context3.abrupt("return", false);
|
|
247
399
|
|
|
248
400
|
case 13:
|
|
249
401
|
if (!ids) {
|
|
250
402
|
ids = [masterObject[mstKeyField]];
|
|
251
403
|
}
|
|
252
404
|
|
|
253
|
-
|
|
405
|
+
_context3.next = 16;
|
|
254
406
|
return mstService.remove(ids);
|
|
255
407
|
|
|
256
408
|
case 16:
|
|
257
|
-
result =
|
|
258
|
-
|
|
409
|
+
result = _context3.sent;
|
|
410
|
+
_context3.t0 = afterRemove;
|
|
259
411
|
|
|
260
|
-
if (!
|
|
261
|
-
|
|
412
|
+
if (!_context3.t0) {
|
|
413
|
+
_context3.next = 23;
|
|
262
414
|
break;
|
|
263
415
|
}
|
|
264
416
|
|
|
265
|
-
|
|
417
|
+
_context3.next = 21;
|
|
266
418
|
return afterRemove(result, masterObject);
|
|
267
419
|
|
|
268
420
|
case 21:
|
|
269
|
-
|
|
270
|
-
|
|
421
|
+
_context3.t1 = _context3.sent;
|
|
422
|
+
_context3.t0 = _context3.t1 === false;
|
|
271
423
|
|
|
272
424
|
case 23:
|
|
273
|
-
if (!
|
|
274
|
-
|
|
425
|
+
if (!_context3.t0) {
|
|
426
|
+
_context3.next = 25;
|
|
275
427
|
break;
|
|
276
428
|
}
|
|
277
429
|
|
|
278
|
-
return
|
|
430
|
+
return _context3.abrupt("return");
|
|
279
431
|
|
|
280
432
|
case 25:
|
|
281
|
-
if (!((result === null || result === void 0 ? void 0 : (_result$
|
|
282
|
-
|
|
433
|
+
if (!((result === null || result === void 0 ? void 0 : (_result$flag3 = result.flag) === null || _result$flag3 === void 0 ? void 0 : _result$flag3.retCode) === '0')) {
|
|
434
|
+
_context3.next = 28;
|
|
283
435
|
break;
|
|
284
436
|
}
|
|
285
437
|
|
|
286
438
|
(0, _utils.showSuccess)(result.flag.retMsg || '删除成功');
|
|
287
|
-
return
|
|
439
|
+
return _context3.abrupt("return", true);
|
|
288
440
|
|
|
289
441
|
case 28:
|
|
290
|
-
return
|
|
442
|
+
return _context3.abrupt("return", false);
|
|
291
443
|
|
|
292
444
|
case 29:
|
|
293
445
|
case "end":
|
|
294
|
-
return
|
|
446
|
+
return _context3.stop();
|
|
295
447
|
}
|
|
296
448
|
}
|
|
297
|
-
},
|
|
449
|
+
}, _callee3);
|
|
298
450
|
}));
|
|
299
451
|
|
|
300
452
|
return function onRemoveMst() {
|
|
301
|
-
return
|
|
453
|
+
return _ref3.apply(this, arguments);
|
|
302
454
|
};
|
|
303
455
|
}();
|
|
304
456
|
/** 新增按钮事件 */
|
|
305
457
|
|
|
306
458
|
|
|
307
459
|
var onAddDtl = /*#__PURE__*/function () {
|
|
308
|
-
var
|
|
460
|
+
var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
309
461
|
var item,
|
|
310
|
-
_formRef$
|
|
462
|
+
_formRef$current2,
|
|
311
463
|
mstVal,
|
|
312
464
|
mst,
|
|
313
|
-
|
|
465
|
+
_args4 = arguments;
|
|
314
466
|
|
|
315
|
-
return _regenerator.default.wrap(function
|
|
467
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
316
468
|
while (1) {
|
|
317
|
-
switch (
|
|
469
|
+
switch (_context4.prev = _context4.next) {
|
|
318
470
|
case 0:
|
|
319
|
-
item =
|
|
471
|
+
item = _args4.length > 0 && _args4[0] !== undefined ? _args4[0] : (0, _objectSpread2.default)({}, dtlItem);
|
|
320
472
|
|
|
321
473
|
if (!(!masterObject[mstKeyField] && formRef.current)) {
|
|
322
|
-
|
|
474
|
+
_context4.next = 16;
|
|
323
475
|
break;
|
|
324
476
|
}
|
|
325
477
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
return (_formRef$
|
|
478
|
+
_context4.prev = 2;
|
|
479
|
+
_context4.next = 5;
|
|
480
|
+
return (_formRef$current2 = formRef.current) === null || _formRef$current2 === void 0 ? void 0 : _formRef$current2.validateFields();
|
|
329
481
|
|
|
330
482
|
case 5:
|
|
331
483
|
mstVal = formRef.current.getFieldsValue();
|
|
332
|
-
|
|
484
|
+
_context4.next = 8;
|
|
333
485
|
return onSaveMst(mstVal);
|
|
334
486
|
|
|
335
487
|
case 8:
|
|
336
|
-
mst =
|
|
488
|
+
mst = _context4.sent;
|
|
337
489
|
|
|
338
490
|
if (!(mst !== true)) {
|
|
339
|
-
|
|
491
|
+
_context4.next = 11;
|
|
340
492
|
break;
|
|
341
493
|
}
|
|
342
494
|
|
|
343
|
-
return
|
|
495
|
+
return _context4.abrupt("return", false);
|
|
344
496
|
|
|
345
497
|
case 11:
|
|
346
|
-
|
|
498
|
+
_context4.next = 16;
|
|
347
499
|
break;
|
|
348
500
|
|
|
349
501
|
case 13:
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
return
|
|
502
|
+
_context4.prev = 13;
|
|
503
|
+
_context4.t0 = _context4["catch"](2);
|
|
504
|
+
return _context4.abrupt("return", false);
|
|
353
505
|
|
|
354
506
|
case 16:
|
|
355
|
-
|
|
507
|
+
_context4.t1 = beforeAdd;
|
|
356
508
|
|
|
357
|
-
if (!
|
|
358
|
-
|
|
509
|
+
if (!_context4.t1) {
|
|
510
|
+
_context4.next = 22;
|
|
359
511
|
break;
|
|
360
512
|
}
|
|
361
513
|
|
|
362
|
-
|
|
514
|
+
_context4.next = 20;
|
|
363
515
|
return beforeAdd(item);
|
|
364
516
|
|
|
365
517
|
case 20:
|
|
366
|
-
|
|
367
|
-
|
|
518
|
+
_context4.t2 = _context4.sent;
|
|
519
|
+
_context4.t1 = _context4.t2 === false;
|
|
368
520
|
|
|
369
521
|
case 22:
|
|
370
|
-
if (!
|
|
371
|
-
|
|
522
|
+
if (!_context4.t1) {
|
|
523
|
+
_context4.next = 24;
|
|
372
524
|
break;
|
|
373
525
|
}
|
|
374
526
|
|
|
375
|
-
return
|
|
527
|
+
return _context4.abrupt("return", false);
|
|
376
528
|
|
|
377
529
|
case 24:
|
|
378
530
|
setEditItem(item);
|
|
379
531
|
setShowEdit(true);
|
|
380
|
-
return
|
|
532
|
+
return _context4.abrupt("return", true);
|
|
381
533
|
|
|
382
534
|
case 27:
|
|
383
535
|
case "end":
|
|
384
|
-
return
|
|
536
|
+
return _context4.stop();
|
|
385
537
|
}
|
|
386
538
|
}
|
|
387
|
-
},
|
|
539
|
+
}, _callee4, null, [[2, 13]]);
|
|
388
540
|
}));
|
|
389
541
|
|
|
390
542
|
return function onAddDtl() {
|
|
391
|
-
return
|
|
543
|
+
return _ref4.apply(this, arguments);
|
|
392
544
|
};
|
|
393
545
|
}();
|
|
394
546
|
/** 编辑按钮事件 */
|
|
395
547
|
|
|
396
548
|
|
|
397
549
|
var onEditDtl = /*#__PURE__*/function () {
|
|
398
|
-
var
|
|
550
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
399
551
|
var item,
|
|
400
|
-
|
|
401
|
-
return _regenerator.default.wrap(function
|
|
552
|
+
_args5 = arguments;
|
|
553
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
402
554
|
while (1) {
|
|
403
|
-
switch (
|
|
555
|
+
switch (_context5.prev = _context5.next) {
|
|
404
556
|
case 0:
|
|
405
|
-
item =
|
|
557
|
+
item = _args5.length > 0 && _args5[0] !== undefined ? _args5[0] : (0, _objectSpread2.default)({}, selectedRows[0]);
|
|
406
558
|
|
|
407
559
|
if (selectedRows.length) {
|
|
408
|
-
|
|
560
|
+
_context5.next = 4;
|
|
409
561
|
break;
|
|
410
562
|
}
|
|
411
563
|
|
|
412
564
|
(0, _utils.showWarn)('请先选择需要更改的数据');
|
|
413
|
-
return
|
|
565
|
+
return _context5.abrupt("return", false);
|
|
414
566
|
|
|
415
567
|
case 4:
|
|
416
|
-
|
|
568
|
+
_context5.t0 = beforeEdit;
|
|
417
569
|
|
|
418
|
-
if (!
|
|
419
|
-
|
|
570
|
+
if (!_context5.t0) {
|
|
571
|
+
_context5.next = 10;
|
|
420
572
|
break;
|
|
421
573
|
}
|
|
422
574
|
|
|
423
|
-
|
|
575
|
+
_context5.next = 8;
|
|
424
576
|
return beforeEdit(item);
|
|
425
577
|
|
|
426
578
|
case 8:
|
|
427
|
-
|
|
428
|
-
|
|
579
|
+
_context5.t1 = _context5.sent;
|
|
580
|
+
_context5.t0 = _context5.t1 === false;
|
|
429
581
|
|
|
430
582
|
case 10:
|
|
431
|
-
if (!
|
|
432
|
-
|
|
583
|
+
if (!_context5.t0) {
|
|
584
|
+
_context5.next = 12;
|
|
433
585
|
break;
|
|
434
586
|
}
|
|
435
587
|
|
|
436
|
-
return
|
|
588
|
+
return _context5.abrupt("return", false);
|
|
437
589
|
|
|
438
590
|
case 12:
|
|
439
591
|
setEditItem(item);
|
|
440
592
|
setShowEdit(true);
|
|
441
|
-
return
|
|
593
|
+
return _context5.abrupt("return", true);
|
|
442
594
|
|
|
443
595
|
case 15:
|
|
444
596
|
case "end":
|
|
445
|
-
return
|
|
597
|
+
return _context5.stop();
|
|
446
598
|
}
|
|
447
599
|
}
|
|
448
|
-
},
|
|
600
|
+
}, _callee5);
|
|
449
601
|
}));
|
|
450
602
|
|
|
451
603
|
return function onEditDtl() {
|
|
452
|
-
return
|
|
604
|
+
return _ref5.apply(this, arguments);
|
|
453
605
|
};
|
|
454
606
|
}();
|
|
455
607
|
/** 删除按钮事件 */
|
|
@@ -463,31 +615,31 @@ function useDtl(dtlParam) {
|
|
|
463
615
|
return;
|
|
464
616
|
}
|
|
465
617
|
|
|
466
|
-
(0, _utils.showConfirm)('确认要删除选择的数据?').then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function
|
|
467
|
-
var _result$
|
|
618
|
+
(0, _utils.showConfirm)('确认要删除选择的数据?').then( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
619
|
+
var _result$flag4;
|
|
468
620
|
|
|
469
621
|
var ids, result;
|
|
470
|
-
return _regenerator.default.wrap(function
|
|
622
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
471
623
|
while (1) {
|
|
472
|
-
switch (
|
|
624
|
+
switch (_context6.prev = _context6.next) {
|
|
473
625
|
case 0:
|
|
474
626
|
if (!beforeRemove) {
|
|
475
|
-
|
|
627
|
+
_context6.next = 6;
|
|
476
628
|
break;
|
|
477
629
|
}
|
|
478
630
|
|
|
479
|
-
|
|
631
|
+
_context6.next = 3;
|
|
480
632
|
return beforeRemove(rows);
|
|
481
633
|
|
|
482
634
|
case 3:
|
|
483
|
-
ids =
|
|
635
|
+
ids = _context6.sent;
|
|
484
636
|
|
|
485
637
|
if (!(ids === false)) {
|
|
486
|
-
|
|
638
|
+
_context6.next = 6;
|
|
487
639
|
break;
|
|
488
640
|
}
|
|
489
641
|
|
|
490
|
-
return
|
|
642
|
+
return _context6.abrupt("return");
|
|
491
643
|
|
|
492
644
|
case 6:
|
|
493
645
|
if (!ids) {
|
|
@@ -496,35 +648,35 @@ function useDtl(dtlParam) {
|
|
|
496
648
|
});
|
|
497
649
|
}
|
|
498
650
|
|
|
499
|
-
|
|
651
|
+
_context6.next = 9;
|
|
500
652
|
return dtlService.remove(ids);
|
|
501
653
|
|
|
502
654
|
case 9:
|
|
503
|
-
result =
|
|
504
|
-
|
|
655
|
+
result = _context6.sent;
|
|
656
|
+
_context6.t0 = afterRemove;
|
|
505
657
|
|
|
506
|
-
if (!
|
|
507
|
-
|
|
658
|
+
if (!_context6.t0) {
|
|
659
|
+
_context6.next = 16;
|
|
508
660
|
break;
|
|
509
661
|
}
|
|
510
662
|
|
|
511
|
-
|
|
663
|
+
_context6.next = 14;
|
|
512
664
|
return afterRemove(result, rows);
|
|
513
665
|
|
|
514
666
|
case 14:
|
|
515
|
-
|
|
516
|
-
|
|
667
|
+
_context6.t1 = _context6.sent;
|
|
668
|
+
_context6.t0 = _context6.t1 === false;
|
|
517
669
|
|
|
518
670
|
case 16:
|
|
519
|
-
if (!
|
|
520
|
-
|
|
671
|
+
if (!_context6.t0) {
|
|
672
|
+
_context6.next = 18;
|
|
521
673
|
break;
|
|
522
674
|
}
|
|
523
675
|
|
|
524
|
-
return
|
|
676
|
+
return _context6.abrupt("return");
|
|
525
677
|
|
|
526
678
|
case 18:
|
|
527
|
-
if ((result === null || result === void 0 ? void 0 : (_result$
|
|
679
|
+
if ((result === null || result === void 0 ? void 0 : (_result$flag4 = result.flag) === null || _result$flag4 === void 0 ? void 0 : _result$flag4.retCode) === '0') {
|
|
528
680
|
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
529
681
|
|
|
530
682
|
if (tableRef.current) {
|
|
@@ -534,23 +686,23 @@ function useDtl(dtlParam) {
|
|
|
534
686
|
|
|
535
687
|
case 19:
|
|
536
688
|
case "end":
|
|
537
|
-
return
|
|
689
|
+
return _context6.stop();
|
|
538
690
|
}
|
|
539
691
|
}
|
|
540
|
-
},
|
|
692
|
+
}, _callee6);
|
|
541
693
|
})));
|
|
542
694
|
};
|
|
543
695
|
/** 新增,更改对应的保存事件 */
|
|
544
696
|
|
|
545
697
|
|
|
546
698
|
var onSaveDtl = /*#__PURE__*/function () {
|
|
547
|
-
var
|
|
548
|
-
var _result$
|
|
699
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(formData) {
|
|
700
|
+
var _result$flag5;
|
|
549
701
|
|
|
550
702
|
var data, result;
|
|
551
|
-
return _regenerator.default.wrap(function
|
|
703
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
552
704
|
while (1) {
|
|
553
|
-
switch (
|
|
705
|
+
switch (_context7.prev = _context7.next) {
|
|
554
706
|
case 0:
|
|
555
707
|
data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, editItem), formData);
|
|
556
708
|
|
|
@@ -558,59 +710,59 @@ function useDtl(dtlParam) {
|
|
|
558
710
|
data[relationField] = masterObject[mstKeyField];
|
|
559
711
|
}
|
|
560
712
|
|
|
561
|
-
|
|
713
|
+
_context7.t0 = beforeSave;
|
|
562
714
|
|
|
563
|
-
if (!
|
|
564
|
-
|
|
715
|
+
if (!_context7.t0) {
|
|
716
|
+
_context7.next = 8;
|
|
565
717
|
break;
|
|
566
718
|
}
|
|
567
719
|
|
|
568
|
-
|
|
720
|
+
_context7.next = 6;
|
|
569
721
|
return beforeSave(data, true);
|
|
570
722
|
|
|
571
723
|
case 6:
|
|
572
|
-
|
|
573
|
-
|
|
724
|
+
_context7.t1 = _context7.sent;
|
|
725
|
+
_context7.t0 = _context7.t1 === false;
|
|
574
726
|
|
|
575
727
|
case 8:
|
|
576
|
-
if (!
|
|
577
|
-
|
|
728
|
+
if (!_context7.t0) {
|
|
729
|
+
_context7.next = 10;
|
|
578
730
|
break;
|
|
579
731
|
}
|
|
580
732
|
|
|
581
|
-
return
|
|
733
|
+
return _context7.abrupt("return", false);
|
|
582
734
|
|
|
583
735
|
case 10:
|
|
584
|
-
|
|
736
|
+
_context7.next = 12;
|
|
585
737
|
return dtlService.save(data);
|
|
586
738
|
|
|
587
739
|
case 12:
|
|
588
|
-
result =
|
|
589
|
-
|
|
740
|
+
result = _context7.sent;
|
|
741
|
+
_context7.t2 = afterSave;
|
|
590
742
|
|
|
591
|
-
if (!
|
|
592
|
-
|
|
743
|
+
if (!_context7.t2) {
|
|
744
|
+
_context7.next = 19;
|
|
593
745
|
break;
|
|
594
746
|
}
|
|
595
747
|
|
|
596
|
-
|
|
748
|
+
_context7.next = 17;
|
|
597
749
|
return afterSave(result, data, true);
|
|
598
750
|
|
|
599
751
|
case 17:
|
|
600
|
-
|
|
601
|
-
|
|
752
|
+
_context7.t3 = _context7.sent;
|
|
753
|
+
_context7.t2 = _context7.t3 === false;
|
|
602
754
|
|
|
603
755
|
case 19:
|
|
604
|
-
if (!
|
|
605
|
-
|
|
756
|
+
if (!_context7.t2) {
|
|
757
|
+
_context7.next = 21;
|
|
606
758
|
break;
|
|
607
759
|
}
|
|
608
760
|
|
|
609
|
-
return
|
|
761
|
+
return _context7.abrupt("return", false);
|
|
610
762
|
|
|
611
763
|
case 21:
|
|
612
|
-
if (!((result === null || result === void 0 ? void 0 : (_result$
|
|
613
|
-
|
|
764
|
+
if (!((result === null || result === void 0 ? void 0 : (_result$flag5 = result.flag) === null || _result$flag5 === void 0 ? void 0 : _result$flag5.retCode) === '0')) {
|
|
765
|
+
_context7.next = 25;
|
|
614
766
|
break;
|
|
615
767
|
}
|
|
616
768
|
|
|
@@ -620,44 +772,44 @@ function useDtl(dtlParam) {
|
|
|
620
772
|
tableRef.current.reload(false);
|
|
621
773
|
}
|
|
622
774
|
|
|
623
|
-
return
|
|
775
|
+
return _context7.abrupt("return", true);
|
|
624
776
|
|
|
625
777
|
case 25:
|
|
626
|
-
return
|
|
778
|
+
return _context7.abrupt("return", false);
|
|
627
779
|
|
|
628
780
|
case 26:
|
|
629
781
|
case "end":
|
|
630
|
-
return
|
|
782
|
+
return _context7.stop();
|
|
631
783
|
}
|
|
632
784
|
}
|
|
633
|
-
},
|
|
785
|
+
}, _callee7);
|
|
634
786
|
}));
|
|
635
787
|
|
|
636
788
|
return function onSaveDtl(_x2) {
|
|
637
|
-
return
|
|
789
|
+
return _ref7.apply(this, arguments);
|
|
638
790
|
};
|
|
639
791
|
}();
|
|
640
792
|
/** 加载数据方法 */
|
|
641
793
|
|
|
642
794
|
|
|
643
795
|
var onLoadDtl = /*#__PURE__*/function () {
|
|
644
|
-
var
|
|
645
|
-
var _tableRef$
|
|
796
|
+
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(params, sort, filter) {
|
|
797
|
+
var _tableRef$current3, _tableRef$current3$cl;
|
|
646
798
|
|
|
647
799
|
var current, pageSize, rest, param, key, sortArr, _key, _key2, result;
|
|
648
800
|
|
|
649
|
-
return _regenerator.default.wrap(function
|
|
801
|
+
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
650
802
|
while (1) {
|
|
651
|
-
switch (
|
|
803
|
+
switch (_context8.prev = _context8.next) {
|
|
652
804
|
case 0:
|
|
653
805
|
current = params.current, pageSize = params.pageSize, rest = (0, _objectWithoutProperties2.default)(params, _excluded);
|
|
654
806
|
|
|
655
807
|
if (!(!masterObject || !masterObject[mstKeyField])) {
|
|
656
|
-
|
|
808
|
+
_context8.next = 3;
|
|
657
809
|
break;
|
|
658
810
|
}
|
|
659
811
|
|
|
660
|
-
return
|
|
812
|
+
return _context8.abrupt("return", {
|
|
661
813
|
data: [],
|
|
662
814
|
success: true
|
|
663
815
|
});
|
|
@@ -703,255 +855,255 @@ function useDtl(dtlParam) {
|
|
|
703
855
|
}
|
|
704
856
|
|
|
705
857
|
setSelectedRows([]);
|
|
706
|
-
(_tableRef$
|
|
707
|
-
|
|
858
|
+
(_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$cl = _tableRef$current3.clearSelected) === null || _tableRef$current3$cl === void 0 ? void 0 : _tableRef$current3$cl.call(_tableRef$current3);
|
|
859
|
+
_context8.t0 = beforeLoad;
|
|
708
860
|
|
|
709
|
-
if (!
|
|
710
|
-
|
|
861
|
+
if (!_context8.t0) {
|
|
862
|
+
_context8.next = 19;
|
|
711
863
|
break;
|
|
712
864
|
}
|
|
713
865
|
|
|
714
|
-
|
|
866
|
+
_context8.next = 17;
|
|
715
867
|
return beforeLoad(param);
|
|
716
868
|
|
|
717
869
|
case 17:
|
|
718
|
-
|
|
719
|
-
|
|
870
|
+
_context8.t1 = _context8.sent;
|
|
871
|
+
_context8.t0 = _context8.t1 === false;
|
|
720
872
|
|
|
721
873
|
case 19:
|
|
722
|
-
if (!
|
|
723
|
-
|
|
874
|
+
if (!_context8.t0) {
|
|
875
|
+
_context8.next = 21;
|
|
724
876
|
break;
|
|
725
877
|
}
|
|
726
878
|
|
|
727
|
-
return
|
|
879
|
+
return _context8.abrupt("return", {
|
|
728
880
|
data: [],
|
|
729
881
|
success: true
|
|
730
882
|
});
|
|
731
883
|
|
|
732
884
|
case 21:
|
|
733
|
-
|
|
885
|
+
_context8.next = 23;
|
|
734
886
|
return dtlService.load(param);
|
|
735
887
|
|
|
736
888
|
case 23:
|
|
737
|
-
result =
|
|
889
|
+
result = _context8.sent;
|
|
738
890
|
result.data = result.rows;
|
|
739
891
|
result.success = true;
|
|
740
|
-
return
|
|
892
|
+
return _context8.abrupt("return", result);
|
|
741
893
|
|
|
742
894
|
case 27:
|
|
743
895
|
case "end":
|
|
744
|
-
return
|
|
896
|
+
return _context8.stop();
|
|
745
897
|
}
|
|
746
898
|
}
|
|
747
|
-
},
|
|
899
|
+
}, _callee8);
|
|
748
900
|
}));
|
|
749
901
|
|
|
750
902
|
return function onLoadDtl(_x3, _x4, _x5) {
|
|
751
|
-
return
|
|
903
|
+
return _ref8.apply(this, arguments);
|
|
752
904
|
};
|
|
753
905
|
}();
|
|
754
906
|
|
|
755
907
|
var onExportDtl = /*#__PURE__*/function () {
|
|
756
|
-
var
|
|
908
|
+
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9(url, param) {
|
|
757
909
|
var _param$exportColumns;
|
|
758
910
|
|
|
759
|
-
var _result$
|
|
911
|
+
var _result$flag6, result, _result$flag7, _result$flag8;
|
|
760
912
|
|
|
761
|
-
return _regenerator.default.wrap(function
|
|
913
|
+
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
762
914
|
while (1) {
|
|
763
|
-
switch (
|
|
915
|
+
switch (_context9.prev = _context9.next) {
|
|
764
916
|
case 0:
|
|
765
917
|
if ((_param$exportColumns = param.exportColumns) === null || _param$exportColumns === void 0 ? void 0 : _param$exportColumns.length) {
|
|
766
|
-
|
|
918
|
+
_context9.next = 3;
|
|
767
919
|
break;
|
|
768
920
|
}
|
|
769
921
|
|
|
770
922
|
(0, _utils.showWarn)('请选择要导出的列');
|
|
771
|
-
return
|
|
923
|
+
return _context9.abrupt("return", false);
|
|
772
924
|
|
|
773
925
|
case 3:
|
|
774
926
|
if (param.findUrl) {
|
|
775
|
-
|
|
927
|
+
_context9.next = 6;
|
|
776
928
|
break;
|
|
777
929
|
}
|
|
778
930
|
|
|
779
931
|
(0, _utils.showWarn)('请配置业务接口 bizApi 属性');
|
|
780
|
-
return
|
|
932
|
+
return _context9.abrupt("return", false);
|
|
781
933
|
|
|
782
934
|
case 6:
|
|
783
|
-
|
|
784
|
-
|
|
935
|
+
_context9.prev = 6;
|
|
936
|
+
_context9.next = 9;
|
|
785
937
|
return (0, _http.httpPost)(url, param);
|
|
786
938
|
|
|
787
939
|
case 9:
|
|
788
|
-
result =
|
|
940
|
+
result = _context9.sent;
|
|
789
941
|
|
|
790
942
|
if (!(result.data && typeof result.data === 'string')) {
|
|
791
|
-
|
|
943
|
+
_context9.next = 13;
|
|
792
944
|
break;
|
|
793
945
|
}
|
|
794
946
|
|
|
795
947
|
window.open(result.data);
|
|
796
|
-
return
|
|
948
|
+
return _context9.abrupt("return", true);
|
|
797
949
|
|
|
798
950
|
case 13:
|
|
799
|
-
if (!(((_result$
|
|
800
|
-
|
|
951
|
+
if (!(((_result$flag6 = result.flag) === null || _result$flag6 === void 0 ? void 0 : _result$flag6.retCode) === '0')) {
|
|
952
|
+
_context9.next = 18;
|
|
801
953
|
break;
|
|
802
954
|
}
|
|
803
955
|
|
|
804
|
-
(0, _utils.showSuccess)(((_result$
|
|
805
|
-
return
|
|
956
|
+
(0, _utils.showSuccess)(((_result$flag7 = result.flag) === null || _result$flag7 === void 0 ? void 0 : _result$flag7.retMsg) || '导出成功');
|
|
957
|
+
return _context9.abrupt("return", true);
|
|
806
958
|
|
|
807
959
|
case 18:
|
|
808
|
-
(0, _utils.showError)(((_result$
|
|
809
|
-
return
|
|
960
|
+
(0, _utils.showError)(((_result$flag8 = result.flag) === null || _result$flag8 === void 0 ? void 0 : _result$flag8.retMsg) || '导出失败,请联系系统管理员');
|
|
961
|
+
return _context9.abrupt("return", false);
|
|
810
962
|
|
|
811
963
|
case 20:
|
|
812
|
-
|
|
964
|
+
_context9.next = 27;
|
|
813
965
|
break;
|
|
814
966
|
|
|
815
967
|
case 22:
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
console.log(
|
|
819
|
-
(0, _utils.showError)(
|
|
820
|
-
return
|
|
968
|
+
_context9.prev = 22;
|
|
969
|
+
_context9.t0 = _context9["catch"](6);
|
|
970
|
+
console.log(_context9.t0);
|
|
971
|
+
(0, _utils.showError)(_context9.t0.message);
|
|
972
|
+
return _context9.abrupt("return", false);
|
|
821
973
|
|
|
822
974
|
case 27:
|
|
823
975
|
case "end":
|
|
824
|
-
return
|
|
976
|
+
return _context9.stop();
|
|
825
977
|
}
|
|
826
978
|
}
|
|
827
|
-
},
|
|
979
|
+
}, _callee9, null, [[6, 22]]);
|
|
828
980
|
}));
|
|
829
981
|
|
|
830
982
|
return function onExportDtl(_x6, _x7) {
|
|
831
|
-
return
|
|
983
|
+
return _ref9.apply(this, arguments);
|
|
832
984
|
};
|
|
833
985
|
}();
|
|
834
986
|
/** 审核按钮事件 */
|
|
835
987
|
|
|
836
988
|
|
|
837
989
|
var onAudit = /*#__PURE__*/function () {
|
|
838
|
-
var
|
|
839
|
-
var obj, _result$
|
|
990
|
+
var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
991
|
+
var obj, _result$flag9, result;
|
|
840
992
|
|
|
841
|
-
return _regenerator.default.wrap(function
|
|
993
|
+
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
842
994
|
while (1) {
|
|
843
|
-
switch (
|
|
995
|
+
switch (_context10.prev = _context10.next) {
|
|
844
996
|
case 0:
|
|
845
997
|
if (!isAudit()) {
|
|
846
|
-
|
|
998
|
+
_context10.next = 3;
|
|
847
999
|
break;
|
|
848
1000
|
}
|
|
849
1001
|
|
|
850
1002
|
(0, _utils.showWarn)('当前数据已审核,不能再做审核操作!');
|
|
851
|
-
return
|
|
1003
|
+
return _context10.abrupt("return");
|
|
852
1004
|
|
|
853
1005
|
case 3:
|
|
854
1006
|
obj = (0, _objectSpread2.default)({}, masterObject);
|
|
855
1007
|
|
|
856
1008
|
if (masterObject[mstKeyField]) {
|
|
857
|
-
|
|
1009
|
+
_context10.next = 7;
|
|
858
1010
|
break;
|
|
859
1011
|
}
|
|
860
1012
|
|
|
861
1013
|
(0, _utils.showWarn)('当前数据未保存,不能审核');
|
|
862
|
-
return
|
|
1014
|
+
return _context10.abrupt("return");
|
|
863
1015
|
|
|
864
1016
|
case 7:
|
|
865
|
-
|
|
866
|
-
|
|
1017
|
+
_context10.prev = 7;
|
|
1018
|
+
_context10.next = 10;
|
|
867
1019
|
return (0, _utils.showConfirm)('确认要审核此数据?', '审核提示');
|
|
868
1020
|
|
|
869
1021
|
case 10:
|
|
870
|
-
|
|
1022
|
+
_context10.next = 16;
|
|
871
1023
|
break;
|
|
872
1024
|
|
|
873
1025
|
case 12:
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
console.log('终止审核',
|
|
877
|
-
return
|
|
1026
|
+
_context10.prev = 12;
|
|
1027
|
+
_context10.t0 = _context10["catch"](7);
|
|
1028
|
+
console.log('终止审核', _context10.t0);
|
|
1029
|
+
return _context10.abrupt("return");
|
|
878
1030
|
|
|
879
1031
|
case 16:
|
|
880
|
-
|
|
1032
|
+
_context10.t1 = beforeAudit;
|
|
881
1033
|
|
|
882
|
-
if (!
|
|
883
|
-
|
|
1034
|
+
if (!_context10.t1) {
|
|
1035
|
+
_context10.next = 22;
|
|
884
1036
|
break;
|
|
885
1037
|
}
|
|
886
1038
|
|
|
887
|
-
|
|
1039
|
+
_context10.next = 20;
|
|
888
1040
|
return beforeAudit(obj);
|
|
889
1041
|
|
|
890
1042
|
case 20:
|
|
891
|
-
|
|
892
|
-
|
|
1043
|
+
_context10.t2 = _context10.sent;
|
|
1044
|
+
_context10.t1 = _context10.t2 === false;
|
|
893
1045
|
|
|
894
1046
|
case 22:
|
|
895
|
-
if (!
|
|
896
|
-
|
|
1047
|
+
if (!_context10.t1) {
|
|
1048
|
+
_context10.next = 24;
|
|
897
1049
|
break;
|
|
898
1050
|
}
|
|
899
1051
|
|
|
900
|
-
return
|
|
1052
|
+
return _context10.abrupt("return");
|
|
901
1053
|
|
|
902
1054
|
case 24:
|
|
903
|
-
|
|
904
|
-
|
|
1055
|
+
_context10.prev = 24;
|
|
1056
|
+
_context10.next = 27;
|
|
905
1057
|
return mstService.audit([obj]);
|
|
906
1058
|
|
|
907
1059
|
case 27:
|
|
908
|
-
result =
|
|
909
|
-
|
|
1060
|
+
result = _context10.sent;
|
|
1061
|
+
_context10.t3 = afterAudit;
|
|
910
1062
|
|
|
911
|
-
if (!
|
|
912
|
-
|
|
1063
|
+
if (!_context10.t3) {
|
|
1064
|
+
_context10.next = 34;
|
|
913
1065
|
break;
|
|
914
1066
|
}
|
|
915
1067
|
|
|
916
|
-
|
|
1068
|
+
_context10.next = 32;
|
|
917
1069
|
return afterAudit(result, [obj]);
|
|
918
1070
|
|
|
919
1071
|
case 32:
|
|
920
|
-
|
|
921
|
-
|
|
1072
|
+
_context10.t4 = _context10.sent;
|
|
1073
|
+
_context10.t3 = _context10.t4 === false;
|
|
922
1074
|
|
|
923
1075
|
case 34:
|
|
924
|
-
if (!
|
|
925
|
-
|
|
1076
|
+
if (!_context10.t3) {
|
|
1077
|
+
_context10.next = 36;
|
|
926
1078
|
break;
|
|
927
1079
|
}
|
|
928
1080
|
|
|
929
|
-
return
|
|
1081
|
+
return _context10.abrupt("return");
|
|
930
1082
|
|
|
931
1083
|
case 36:
|
|
932
|
-
if ((result === null || result === void 0 ? void 0 : (_result$
|
|
1084
|
+
if ((result === null || result === void 0 ? void 0 : (_result$flag9 = result.flag) === null || _result$flag9 === void 0 ? void 0 : _result$flag9.retCode) === '0') {
|
|
933
1085
|
(0, _utils.showSuccess)(result.flag.retMsg || '审核成功');
|
|
934
1086
|
Object.assign(masterObject, result.data);
|
|
935
1087
|
}
|
|
936
1088
|
|
|
937
|
-
|
|
1089
|
+
_context10.next = 42;
|
|
938
1090
|
break;
|
|
939
1091
|
|
|
940
1092
|
case 39:
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
console.log('审核异常',
|
|
1093
|
+
_context10.prev = 39;
|
|
1094
|
+
_context10.t5 = _context10["catch"](24);
|
|
1095
|
+
console.log('审核异常', _context10.t5);
|
|
944
1096
|
|
|
945
1097
|
case 42:
|
|
946
1098
|
case "end":
|
|
947
|
-
return
|
|
1099
|
+
return _context10.stop();
|
|
948
1100
|
}
|
|
949
1101
|
}
|
|
950
|
-
},
|
|
1102
|
+
}, _callee10, null, [[7, 12], [24, 39]]);
|
|
951
1103
|
}));
|
|
952
1104
|
|
|
953
1105
|
return function onAudit() {
|
|
954
|
-
return
|
|
1106
|
+
return _ref10.apply(this, arguments);
|
|
955
1107
|
};
|
|
956
1108
|
}();
|
|
957
1109
|
|
|
@@ -971,25 +1123,25 @@ function useDtl(dtlParam) {
|
|
|
971
1123
|
};
|
|
972
1124
|
|
|
973
1125
|
var onExport = function onExport() {
|
|
974
|
-
var _tableRef$
|
|
1126
|
+
var _tableRef$current4, _tableRef$current4$sh;
|
|
975
1127
|
|
|
976
1128
|
if (!masterObject[mstKeyField]) {
|
|
977
1129
|
(0, _utils.showWarn)('主表没保存,无法导出数据');
|
|
978
1130
|
return;
|
|
979
1131
|
}
|
|
980
1132
|
|
|
981
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
1133
|
+
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current4 = tableRef.current) === null || _tableRef$current4 === void 0 ? void 0 : (_tableRef$current4$sh = _tableRef$current4.showExport) === null || _tableRef$current4$sh === void 0 ? void 0 : _tableRef$current4$sh.call(_tableRef$current4);
|
|
982
1134
|
};
|
|
983
1135
|
|
|
984
1136
|
var onImport = function onImport() {
|
|
985
|
-
var _tableRef$
|
|
1137
|
+
var _tableRef$current5, _tableRef$current5$sh;
|
|
986
1138
|
|
|
987
1139
|
if (!masterObject[mstKeyField]) {
|
|
988
1140
|
(0, _utils.showWarn)('主表没保存,无法导入数据');
|
|
989
1141
|
return;
|
|
990
1142
|
}
|
|
991
1143
|
|
|
992
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
1144
|
+
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current5 = tableRef.current) === null || _tableRef$current5 === void 0 ? void 0 : (_tableRef$current5$sh = _tableRef$current5.showImport) === null || _tableRef$current5$sh === void 0 ? void 0 : _tableRef$current5$sh.call(_tableRef$current5);
|
|
993
1145
|
};
|
|
994
1146
|
|
|
995
1147
|
var tableTools = (0, _react.useMemo)(function () {
|
|
@@ -1050,6 +1202,7 @@ function useDtl(dtlParam) {
|
|
|
1050
1202
|
onAddDtl: onAddDtl,
|
|
1051
1203
|
onEditDtl: onEditDtl,
|
|
1052
1204
|
onSaveMst: onSaveMst,
|
|
1205
|
+
onSaveMstDtl: onSaveMstDtl,
|
|
1053
1206
|
onRemoveMst: onRemoveMst,
|
|
1054
1207
|
onExportDtl: onExportDtl,
|
|
1055
1208
|
isAudit: isAudit,
|