ls-pro-common 1.0.24 → 1.0.27
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/common.js +1 -1
- package/dist/common.min.js +1 -1
- package/es/components/DtlLayout.d.ts +2 -0
- package/es/components/DtlLayout.js +8 -1
- package/es/components/InputTable.d.ts +4 -0
- package/es/components/InputTable.js +119 -42
- package/es/hooks/useDtl/index.js +81 -50
- package/es/hooks/useSingle/index.js +63 -42
- package/es/http/index.js +1 -1
- package/es/utils/index.d.ts +9 -0
- package/es/utils/index.js +22 -0
- package/lib/components/DtlLayout.d.ts +2 -0
- package/lib/components/DtlLayout.js +8 -1
- package/lib/components/InputTable.d.ts +4 -0
- package/lib/components/InputTable.js +120 -43
- package/lib/hooks/useDtl/index.js +81 -50
- package/lib/hooks/useSingle/index.js +63 -42
- package/lib/http/index.js +1 -1
- package/lib/utils/index.d.ts +9 -0
- package/lib/utils/index.js +29 -2
- package/package.json +3 -3
|
@@ -164,7 +164,7 @@ function useDtl(dtlParam) {
|
|
|
164
164
|
break;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
167
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '操作成功');
|
|
168
168
|
Object.assign(masterObject, result.data);
|
|
169
169
|
setEditItem({});
|
|
170
170
|
return _context.abrupt("return", true);
|
|
@@ -273,7 +273,7 @@ function useDtl(dtlParam) {
|
|
|
273
273
|
break;
|
|
274
274
|
}
|
|
275
275
|
|
|
276
|
-
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
276
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '删除成功');
|
|
277
277
|
return _context2.abrupt("return", true);
|
|
278
278
|
|
|
279
279
|
case 28:
|
|
@@ -632,6 +632,8 @@ function useDtl(dtlParam) {
|
|
|
632
632
|
|
|
633
633
|
var onLoadDtl = /*#__PURE__*/function () {
|
|
634
634
|
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(params, sort, filter) {
|
|
635
|
+
var _tableRef$current, _tableRef$current$cle;
|
|
636
|
+
|
|
635
637
|
var current, pageSize, rest, param, key, result;
|
|
636
638
|
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
637
639
|
while (1) {
|
|
@@ -670,23 +672,25 @@ function useDtl(dtlParam) {
|
|
|
670
672
|
}
|
|
671
673
|
}
|
|
672
674
|
|
|
675
|
+
setSelectedRows([]);
|
|
676
|
+
(_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);
|
|
673
677
|
_context7.t0 = beforeLoad;
|
|
674
678
|
|
|
675
679
|
if (!_context7.t0) {
|
|
676
|
-
_context7.next =
|
|
680
|
+
_context7.next = 17;
|
|
677
681
|
break;
|
|
678
682
|
}
|
|
679
683
|
|
|
680
|
-
_context7.next =
|
|
684
|
+
_context7.next = 15;
|
|
681
685
|
return beforeLoad(param);
|
|
682
686
|
|
|
683
|
-
case
|
|
687
|
+
case 15:
|
|
684
688
|
_context7.t1 = _context7.sent;
|
|
685
689
|
_context7.t0 = _context7.t1 === false;
|
|
686
690
|
|
|
687
|
-
case
|
|
691
|
+
case 17:
|
|
688
692
|
if (!_context7.t0) {
|
|
689
|
-
_context7.next =
|
|
693
|
+
_context7.next = 19;
|
|
690
694
|
break;
|
|
691
695
|
}
|
|
692
696
|
|
|
@@ -695,17 +699,17 @@ function useDtl(dtlParam) {
|
|
|
695
699
|
success: true
|
|
696
700
|
});
|
|
697
701
|
|
|
698
|
-
case
|
|
699
|
-
_context7.next =
|
|
702
|
+
case 19:
|
|
703
|
+
_context7.next = 21;
|
|
700
704
|
return dtlService.load(param);
|
|
701
705
|
|
|
702
|
-
case
|
|
706
|
+
case 21:
|
|
703
707
|
result = _context7.sent;
|
|
704
708
|
result.data = result.rows;
|
|
705
709
|
result.success = true;
|
|
706
710
|
return _context7.abrupt("return", result);
|
|
707
711
|
|
|
708
|
-
case
|
|
712
|
+
case 25:
|
|
709
713
|
case "end":
|
|
710
714
|
return _context7.stop();
|
|
711
715
|
}
|
|
@@ -808,53 +812,48 @@ function useDtl(dtlParam) {
|
|
|
808
812
|
return _context9.abrupt("return");
|
|
809
813
|
|
|
810
814
|
case 3:
|
|
811
|
-
obj = (0, _objectSpread2.default)({}, masterObject);
|
|
815
|
+
obj = (0, _objectSpread2.default)({}, masterObject);
|
|
812
816
|
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
if (!_context9.t0) {
|
|
816
|
-
_context9.next = 10;
|
|
817
|
+
if (masterObject[mstKeyField]) {
|
|
818
|
+
_context9.next = 7;
|
|
817
819
|
break;
|
|
818
820
|
}
|
|
819
821
|
|
|
820
|
-
|
|
821
|
-
return
|
|
822
|
+
(0, _utils.showWarn)('当前数据未保存,不能审核');
|
|
823
|
+
return _context9.abrupt("return");
|
|
822
824
|
|
|
823
|
-
case
|
|
824
|
-
_context9.
|
|
825
|
-
_context9.
|
|
825
|
+
case 7:
|
|
826
|
+
_context9.prev = 7;
|
|
827
|
+
_context9.next = 10;
|
|
828
|
+
return (0, _utils.showConfirm)('确认要审核此数据?', '审核提示');
|
|
826
829
|
|
|
827
830
|
case 10:
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
break;
|
|
831
|
-
}
|
|
832
|
-
|
|
833
|
-
return _context9.abrupt("return");
|
|
831
|
+
_context9.next = 16;
|
|
832
|
+
break;
|
|
834
833
|
|
|
835
834
|
case 12:
|
|
836
835
|
_context9.prev = 12;
|
|
837
|
-
_context9.
|
|
838
|
-
|
|
836
|
+
_context9.t0 = _context9["catch"](7);
|
|
837
|
+
console.log('终止审核', _context9.t0);
|
|
838
|
+
return _context9.abrupt("return");
|
|
839
839
|
|
|
840
|
-
case
|
|
841
|
-
|
|
842
|
-
_context9.t2 = afterAudit;
|
|
840
|
+
case 16:
|
|
841
|
+
_context9.t1 = beforeAudit;
|
|
843
842
|
|
|
844
|
-
if (!_context9.
|
|
843
|
+
if (!_context9.t1) {
|
|
845
844
|
_context9.next = 22;
|
|
846
845
|
break;
|
|
847
846
|
}
|
|
848
847
|
|
|
849
848
|
_context9.next = 20;
|
|
850
|
-
return
|
|
849
|
+
return beforeAudit(obj);
|
|
851
850
|
|
|
852
851
|
case 20:
|
|
853
|
-
_context9.
|
|
854
|
-
_context9.
|
|
852
|
+
_context9.t2 = _context9.sent;
|
|
853
|
+
_context9.t1 = _context9.t2 === false;
|
|
855
854
|
|
|
856
855
|
case 22:
|
|
857
|
-
if (!_context9.
|
|
856
|
+
if (!_context9.t1) {
|
|
858
857
|
_context9.next = 24;
|
|
859
858
|
break;
|
|
860
859
|
}
|
|
@@ -862,25 +861,54 @@ function useDtl(dtlParam) {
|
|
|
862
861
|
return _context9.abrupt("return");
|
|
863
862
|
|
|
864
863
|
case 24:
|
|
864
|
+
_context9.prev = 24;
|
|
865
|
+
_context9.next = 27;
|
|
866
|
+
return mstService.audit([obj]);
|
|
867
|
+
|
|
868
|
+
case 27:
|
|
869
|
+
result = _context9.sent;
|
|
870
|
+
_context9.t3 = afterAudit;
|
|
871
|
+
|
|
872
|
+
if (!_context9.t3) {
|
|
873
|
+
_context9.next = 34;
|
|
874
|
+
break;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
_context9.next = 32;
|
|
878
|
+
return afterAudit(result, [obj]);
|
|
879
|
+
|
|
880
|
+
case 32:
|
|
881
|
+
_context9.t4 = _context9.sent;
|
|
882
|
+
_context9.t3 = _context9.t4 === false;
|
|
883
|
+
|
|
884
|
+
case 34:
|
|
885
|
+
if (!_context9.t3) {
|
|
886
|
+
_context9.next = 36;
|
|
887
|
+
break;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
return _context9.abrupt("return");
|
|
891
|
+
|
|
892
|
+
case 36:
|
|
865
893
|
if ((result === null || result === void 0 ? void 0 : (_result$flag8 = result.flag) === null || _result$flag8 === void 0 ? void 0 : _result$flag8.retCode) === '0') {
|
|
866
|
-
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
894
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '审核成功');
|
|
867
895
|
Object.assign(masterObject, result.data);
|
|
868
896
|
}
|
|
869
897
|
|
|
870
|
-
_context9.next =
|
|
898
|
+
_context9.next = 42;
|
|
871
899
|
break;
|
|
872
900
|
|
|
873
|
-
case
|
|
874
|
-
_context9.prev =
|
|
875
|
-
_context9.
|
|
876
|
-
console.log(_context9.
|
|
901
|
+
case 39:
|
|
902
|
+
_context9.prev = 39;
|
|
903
|
+
_context9.t5 = _context9["catch"](24);
|
|
904
|
+
console.log('审核异常', _context9.t5);
|
|
877
905
|
|
|
878
|
-
case
|
|
906
|
+
case 42:
|
|
879
907
|
case "end":
|
|
880
908
|
return _context9.stop();
|
|
881
909
|
}
|
|
882
910
|
}
|
|
883
|
-
}, _callee9, null, [[12,
|
|
911
|
+
}, _callee9, null, [[7, 12], [24, 39]]);
|
|
884
912
|
}));
|
|
885
913
|
|
|
886
914
|
return function onAudit() {
|
|
@@ -904,25 +932,25 @@ function useDtl(dtlParam) {
|
|
|
904
932
|
};
|
|
905
933
|
|
|
906
934
|
var onExport = function onExport() {
|
|
907
|
-
var _tableRef$
|
|
935
|
+
var _tableRef$current2, _tableRef$current2$sh;
|
|
908
936
|
|
|
909
937
|
if (!masterObject[mstKeyField]) {
|
|
910
938
|
(0, _utils.showWarn)('主表没保存,无法导出数据');
|
|
911
939
|
return;
|
|
912
940
|
}
|
|
913
941
|
|
|
914
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
942
|
+
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);
|
|
915
943
|
};
|
|
916
944
|
|
|
917
945
|
var onImport = function onImport() {
|
|
918
|
-
var _tableRef$
|
|
946
|
+
var _tableRef$current3, _tableRef$current3$sh;
|
|
919
947
|
|
|
920
948
|
if (!masterObject[mstKeyField]) {
|
|
921
949
|
(0, _utils.showWarn)('主表没保存,无法导入数据');
|
|
922
950
|
return;
|
|
923
951
|
}
|
|
924
952
|
|
|
925
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
953
|
+
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);
|
|
926
954
|
};
|
|
927
955
|
|
|
928
956
|
var tableTools = (0, _react.useMemo)(function () {
|
|
@@ -931,6 +959,7 @@ function useDtl(dtlParam) {
|
|
|
931
959
|
onClick: function onClick() {
|
|
932
960
|
return onAddDtl();
|
|
933
961
|
},
|
|
962
|
+
disabled: btnDisabled('add'),
|
|
934
963
|
icon: /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null)
|
|
935
964
|
}, "\u65B0\u589E") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.edit) && !isAudit() ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
936
965
|
key: "edit",
|
|
@@ -952,12 +981,14 @@ function useDtl(dtlParam) {
|
|
|
952
981
|
onClick: function onClick() {
|
|
953
982
|
onImport();
|
|
954
983
|
},
|
|
984
|
+
disabled: btnDisabled('import'),
|
|
955
985
|
icon: /*#__PURE__*/_react.default.createElement(_icons.ImportOutlined, null)
|
|
956
|
-
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.
|
|
986
|
+
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.export) ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
957
987
|
key: "export",
|
|
958
988
|
onClick: function onClick() {
|
|
959
989
|
onExport();
|
|
960
990
|
},
|
|
991
|
+
disabled: btnDisabled('export'),
|
|
961
992
|
icon: /*#__PURE__*/_react.default.createElement(_icons.ExportOutlined, null)
|
|
962
993
|
}, "\u5BFC\u51FA") : false].filter(function (o) {
|
|
963
994
|
return o !== false;
|
|
@@ -207,7 +207,7 @@ function useSingle(inParam) {
|
|
|
207
207
|
|
|
208
208
|
|
|
209
209
|
var onRemove = function onRemove(row) {
|
|
210
|
-
if (!row
|
|
210
|
+
if (!row && !selectedRows.length) {
|
|
211
211
|
(0, _utils.showWarn)('请选择需要删除的数据');
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
@@ -281,7 +281,7 @@ function useSingle(inParam) {
|
|
|
281
281
|
|
|
282
282
|
case 20:
|
|
283
283
|
if ((result === null || result === void 0 ? void 0 : (_result$flag = result.flag) === null || _result$flag === void 0 ? void 0 : _result$flag.retCode) === '0') {
|
|
284
|
-
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
284
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '删除成功');
|
|
285
285
|
|
|
286
286
|
if (tableRef.current) {
|
|
287
287
|
tableRef.current.reload(false);
|
|
@@ -338,69 +338,83 @@ function useSingle(inParam) {
|
|
|
338
338
|
|
|
339
339
|
obj[statusField] = auditStatus;
|
|
340
340
|
return obj;
|
|
341
|
-
});
|
|
341
|
+
});
|
|
342
|
+
_context4.prev = 7;
|
|
343
|
+
_context4.next = 10;
|
|
344
|
+
return (0, _utils.showConfirm)('确认要审核选中的数据?', '审核提示');
|
|
342
345
|
|
|
343
|
-
|
|
346
|
+
case 10:
|
|
347
|
+
_context4.next = 16;
|
|
348
|
+
break;
|
|
344
349
|
|
|
345
|
-
|
|
346
|
-
|
|
350
|
+
case 12:
|
|
351
|
+
_context4.prev = 12;
|
|
352
|
+
_context4.t0 = _context4["catch"](7);
|
|
353
|
+
console.log(_context4.t0);
|
|
354
|
+
return _context4.abrupt("return");
|
|
355
|
+
|
|
356
|
+
case 16:
|
|
357
|
+
_context4.t1 = beforeAudit;
|
|
358
|
+
|
|
359
|
+
if (!_context4.t1) {
|
|
360
|
+
_context4.next = 22;
|
|
347
361
|
break;
|
|
348
362
|
}
|
|
349
363
|
|
|
350
|
-
_context4.next =
|
|
364
|
+
_context4.next = 20;
|
|
351
365
|
return beforeAudit(rows);
|
|
352
366
|
|
|
353
|
-
case
|
|
354
|
-
_context4.
|
|
355
|
-
_context4.
|
|
367
|
+
case 20:
|
|
368
|
+
_context4.t2 = _context4.sent;
|
|
369
|
+
_context4.t1 = _context4.t2 === false;
|
|
356
370
|
|
|
357
|
-
case
|
|
358
|
-
if (!_context4.
|
|
359
|
-
_context4.next =
|
|
371
|
+
case 22:
|
|
372
|
+
if (!_context4.t1) {
|
|
373
|
+
_context4.next = 24;
|
|
360
374
|
break;
|
|
361
375
|
}
|
|
362
376
|
|
|
363
377
|
return _context4.abrupt("return");
|
|
364
378
|
|
|
365
|
-
case
|
|
366
|
-
_context4.prev =
|
|
367
|
-
_context4.next =
|
|
379
|
+
case 24:
|
|
380
|
+
_context4.prev = 24;
|
|
381
|
+
_context4.next = 27;
|
|
368
382
|
return service.audit(rows);
|
|
369
383
|
|
|
370
|
-
case
|
|
384
|
+
case 27:
|
|
371
385
|
result = _context4.sent;
|
|
372
386
|
|
|
373
387
|
if (!afterAudit) {
|
|
374
|
-
_context4.next =
|
|
388
|
+
_context4.next = 31;
|
|
375
389
|
break;
|
|
376
390
|
}
|
|
377
391
|
|
|
378
392
|
afterAudit(result, rows);
|
|
379
393
|
return _context4.abrupt("return");
|
|
380
394
|
|
|
381
|
-
case
|
|
395
|
+
case 31:
|
|
382
396
|
if ((result === null || result === void 0 ? void 0 : (_result$flag2 = result.flag) === null || _result$flag2 === void 0 ? void 0 : _result$flag2.retCode) === '0') {
|
|
383
|
-
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
397
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '审核成功');
|
|
384
398
|
|
|
385
399
|
if (tableRef.current) {
|
|
386
400
|
tableRef.current.reload(false);
|
|
387
401
|
}
|
|
388
402
|
}
|
|
389
403
|
|
|
390
|
-
_context4.next =
|
|
404
|
+
_context4.next = 37;
|
|
391
405
|
break;
|
|
392
406
|
|
|
393
|
-
case
|
|
394
|
-
_context4.prev =
|
|
395
|
-
_context4.
|
|
396
|
-
console.log(_context4.
|
|
407
|
+
case 34:
|
|
408
|
+
_context4.prev = 34;
|
|
409
|
+
_context4.t3 = _context4["catch"](24);
|
|
410
|
+
console.log(_context4.t3);
|
|
397
411
|
|
|
398
|
-
case
|
|
412
|
+
case 37:
|
|
399
413
|
case "end":
|
|
400
414
|
return _context4.stop();
|
|
401
415
|
}
|
|
402
416
|
}
|
|
403
|
-
}, _callee4, null, [[
|
|
417
|
+
}, _callee4, null, [[7, 12], [24, 34]]);
|
|
404
418
|
}));
|
|
405
419
|
|
|
406
420
|
return function onAudit(_x3) {
|
|
@@ -466,7 +480,7 @@ function useSingle(inParam) {
|
|
|
466
480
|
break;
|
|
467
481
|
}
|
|
468
482
|
|
|
469
|
-
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
483
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '操作成功');
|
|
470
484
|
|
|
471
485
|
if (tableRef.current) {
|
|
472
486
|
tableRef.current.reload(false);
|
|
@@ -503,6 +517,8 @@ function useSingle(inParam) {
|
|
|
503
517
|
|
|
504
518
|
var onLoad = /*#__PURE__*/function () {
|
|
505
519
|
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(params, sort, filter) {
|
|
520
|
+
var _tableRef$current, _tableRef$current$cle;
|
|
521
|
+
|
|
506
522
|
var current, pageSize, rest, param, key, result;
|
|
507
523
|
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
508
524
|
while (1) {
|
|
@@ -526,23 +542,25 @@ function useSingle(inParam) {
|
|
|
526
542
|
param.where = rest;
|
|
527
543
|
}
|
|
528
544
|
|
|
545
|
+
setSelectedRows([]);
|
|
546
|
+
(_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);
|
|
529
547
|
_context6.t0 = beforeLoad;
|
|
530
548
|
|
|
531
549
|
if (!_context6.t0) {
|
|
532
|
-
_context6.next =
|
|
550
|
+
_context6.next = 13;
|
|
533
551
|
break;
|
|
534
552
|
}
|
|
535
553
|
|
|
536
|
-
_context6.next =
|
|
554
|
+
_context6.next = 11;
|
|
537
555
|
return beforeLoad(param);
|
|
538
556
|
|
|
539
|
-
case
|
|
557
|
+
case 11:
|
|
540
558
|
_context6.t1 = _context6.sent;
|
|
541
559
|
_context6.t0 = _context6.t1 === false;
|
|
542
560
|
|
|
543
|
-
case
|
|
561
|
+
case 13:
|
|
544
562
|
if (!_context6.t0) {
|
|
545
|
-
_context6.next =
|
|
563
|
+
_context6.next = 15;
|
|
546
564
|
break;
|
|
547
565
|
}
|
|
548
566
|
|
|
@@ -552,17 +570,17 @@ function useSingle(inParam) {
|
|
|
552
570
|
total: 0
|
|
553
571
|
});
|
|
554
572
|
|
|
555
|
-
case
|
|
556
|
-
_context6.next =
|
|
573
|
+
case 15:
|
|
574
|
+
_context6.next = 17;
|
|
557
575
|
return service.load(param);
|
|
558
576
|
|
|
559
|
-
case
|
|
577
|
+
case 17:
|
|
560
578
|
result = _context6.sent;
|
|
561
579
|
result.data = result.rows;
|
|
562
580
|
result.success = true;
|
|
563
581
|
return _context6.abrupt("return", result);
|
|
564
582
|
|
|
565
|
-
case
|
|
583
|
+
case 21:
|
|
566
584
|
case "end":
|
|
567
585
|
return _context6.stop();
|
|
568
586
|
}
|
|
@@ -684,6 +702,7 @@ function useSingle(inParam) {
|
|
|
684
702
|
onClick: function onClick() {
|
|
685
703
|
return onAdd(null);
|
|
686
704
|
},
|
|
705
|
+
disabled: btnDisabled('add'),
|
|
687
706
|
icon: /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null)
|
|
688
707
|
}, "\u65B0\u589E") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.edit) && checkRight(4) ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
689
708
|
key: "edit",
|
|
@@ -710,18 +729,20 @@ function useSingle(inParam) {
|
|
|
710
729
|
}, "\u5BA1\u6838") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.import) && checkRight(128) ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
711
730
|
key: "import",
|
|
712
731
|
onClick: function onClick() {
|
|
713
|
-
var _tableRef$
|
|
732
|
+
var _tableRef$current2, _tableRef$current2$sh;
|
|
714
733
|
|
|
715
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
734
|
+
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$sh = _tableRef$current2.showImport) === null || _tableRef$current2$sh === void 0 ? void 0 : _tableRef$current2$sh.call(_tableRef$current2);
|
|
716
735
|
},
|
|
736
|
+
disabled: btnDisabled('import'),
|
|
717
737
|
icon: /*#__PURE__*/_react.default.createElement(_icons.ImportOutlined, null)
|
|
718
|
-
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.
|
|
738
|
+
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.export) && checkRight(256) ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
719
739
|
key: "export",
|
|
720
740
|
onClick: function onClick() {
|
|
721
|
-
var _tableRef$
|
|
741
|
+
var _tableRef$current3, _tableRef$current3$sh;
|
|
722
742
|
|
|
723
|
-
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$
|
|
743
|
+
tableRef === null || tableRef === void 0 ? void 0 : (_tableRef$current3 = tableRef.current) === null || _tableRef$current3 === void 0 ? void 0 : (_tableRef$current3$sh = _tableRef$current3.showExport) === null || _tableRef$current3$sh === void 0 ? void 0 : _tableRef$current3$sh.call(_tableRef$current3);
|
|
724
744
|
},
|
|
745
|
+
disabled: btnDisabled('export'),
|
|
725
746
|
icon: /*#__PURE__*/_react.default.createElement(_icons.ExportOutlined, null)
|
|
726
747
|
}, "\u5BFC\u51FA") : false].filter(function (o) {
|
|
727
748
|
return o !== false;
|
package/lib/http/index.js
CHANGED
|
@@ -42,7 +42,7 @@ request.interceptors.request.use(function (url, options) {
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
var param = {
|
|
45
|
-
resCode: (0, _utils.getUrlQuery)('resourceId') || (0, _utils.getResourceProps)('resourceId')
|
|
45
|
+
resCode: (0, _utils.getUrlQuery)('resCode') || (0, _utils.getUrlQuery)('resourceId') || (0, _utils.getResourceProps)('resourceId')
|
|
46
46
|
};
|
|
47
47
|
return {
|
|
48
48
|
url: (0, _utils.setUrlQuery)(url, param),
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -82,12 +82,15 @@ export declare const treeEach: (list: any[], fn: (item: any, index: any, list: a
|
|
|
82
82
|
* @returns 返回符合条件的第一条对象
|
|
83
83
|
*/
|
|
84
84
|
export declare const treeFind: (list: any[], key: string, val: any, children?: string) => any;
|
|
85
|
+
export declare const isDev: boolean;
|
|
85
86
|
export declare type UserType = {
|
|
86
87
|
id?: string;
|
|
87
88
|
userId?: string;
|
|
88
89
|
userName?: string;
|
|
89
90
|
loginName?: string;
|
|
90
91
|
companyId?: string;
|
|
92
|
+
companyCode?: string;
|
|
93
|
+
companyName?: string;
|
|
91
94
|
email?: string;
|
|
92
95
|
employeeAttr?: string;
|
|
93
96
|
expireTime?: string;
|
|
@@ -99,7 +102,13 @@ export declare type UserType = {
|
|
|
99
102
|
phoneNumber?: string;
|
|
100
103
|
remarks?: string;
|
|
101
104
|
};
|
|
105
|
+
/** @name 用户信息 */
|
|
102
106
|
export declare const getUserInfo: () => UserType | null;
|
|
107
|
+
/** @name 用户名 */
|
|
103
108
|
export declare const getUserName: () => string | undefined;
|
|
109
|
+
/** @name 登录名 */
|
|
104
110
|
export declare const getLoginName: () => string | undefined;
|
|
111
|
+
/** @name 公司Id */
|
|
105
112
|
export declare const getCompanyId: () => string | undefined;
|
|
113
|
+
/** @name 微前端原生路径 */
|
|
114
|
+
export declare const appPath: (path?: string) => any;
|
package/lib/utils/index.js
CHANGED
|
@@ -5,6 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.appPath = void 0;
|
|
8
9
|
Object.defineProperty(exports, "dateFormat", {
|
|
9
10
|
enumerable: true,
|
|
10
11
|
get: function get() {
|
|
@@ -24,7 +25,7 @@ Object.defineProperty(exports, "getUrlQuery", {
|
|
|
24
25
|
return _utils.getUrlQuery;
|
|
25
26
|
}
|
|
26
27
|
});
|
|
27
|
-
exports.setTitle = exports.setCookie = exports.setCache = exports.rangeToSearch = exports.isLogin = exports.getUserName = exports.getUserInfo = void 0;
|
|
28
|
+
exports.setTitle = exports.setCookie = exports.setCache = exports.rangeToSearch = exports.isLogin = exports.isDev = exports.getUserName = exports.getUserInfo = void 0;
|
|
28
29
|
Object.defineProperty(exports, "setUrlQuery", {
|
|
29
30
|
enumerable: true,
|
|
30
31
|
get: function get() {
|
|
@@ -307,10 +308,16 @@ var treeFind = function treeFind(list, key, val) {
|
|
|
307
308
|
};
|
|
308
309
|
|
|
309
310
|
exports.treeFind = treeFind;
|
|
311
|
+
var isDev = location.href.includes("//localhost");
|
|
312
|
+
/** @name 用户信息 */
|
|
313
|
+
|
|
314
|
+
exports.isDev = isDev;
|
|
310
315
|
|
|
311
316
|
var getUserInfo = function getUserInfo() {
|
|
312
317
|
return getCache('user');
|
|
313
318
|
};
|
|
319
|
+
/** @name 用户名 */
|
|
320
|
+
|
|
314
321
|
|
|
315
322
|
exports.getUserInfo = getUserInfo;
|
|
316
323
|
|
|
@@ -319,6 +326,8 @@ var getUserName = function getUserName() {
|
|
|
319
326
|
|
|
320
327
|
return (_getUserInfo = getUserInfo()) === null || _getUserInfo === void 0 ? void 0 : _getUserInfo.userName;
|
|
321
328
|
};
|
|
329
|
+
/** @name 登录名 */
|
|
330
|
+
|
|
322
331
|
|
|
323
332
|
exports.getUserName = getUserName;
|
|
324
333
|
|
|
@@ -327,6 +336,8 @@ var getLoginName = function getLoginName() {
|
|
|
327
336
|
|
|
328
337
|
return (_getUserInfo2 = getUserInfo()) === null || _getUserInfo2 === void 0 ? void 0 : _getUserInfo2.loginName;
|
|
329
338
|
};
|
|
339
|
+
/** @name 公司Id */
|
|
340
|
+
|
|
330
341
|
|
|
331
342
|
exports.getLoginName = getLoginName;
|
|
332
343
|
|
|
@@ -335,5 +346,21 @@ var getCompanyId = function getCompanyId() {
|
|
|
335
346
|
|
|
336
347
|
return (_getUserInfo3 = getUserInfo()) === null || _getUserInfo3 === void 0 ? void 0 : _getUserInfo3.companyId;
|
|
337
348
|
};
|
|
349
|
+
/** @name 微前端原生路径 */
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
exports.getCompanyId = getCompanyId;
|
|
353
|
+
|
|
354
|
+
var appPath = function appPath() {
|
|
355
|
+
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
356
|
+
|
|
357
|
+
// @ts-ignore
|
|
358
|
+
if (window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__) {
|
|
359
|
+
// @ts-ignore
|
|
360
|
+
return window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
return path ? path : './';
|
|
364
|
+
};
|
|
338
365
|
|
|
339
|
-
exports.
|
|
366
|
+
exports.appPath = appPath;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ls-pro-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.27",
|
|
4
4
|
"description": "ls-pro-common",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antd",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@ant-design/icons": "^4.3.0",
|
|
31
|
-
"ls-pro-table": "2.62.
|
|
32
|
-
"ls-pro-form": "1.52.
|
|
31
|
+
"ls-pro-table": "2.62.25",
|
|
32
|
+
"ls-pro-form": "1.52.24",
|
|
33
33
|
"@babel/runtime": "^7.16.3",
|
|
34
34
|
"classnames": "^2.2.6",
|
|
35
35
|
"moment": "^2.27.0",
|