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