ls-pro-common 1.0.26 → 1.0.29
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/IconSelector.d.ts +19 -0
- package/es/components/IconSelector.js +293 -0
- package/es/components/InputTable.js +19 -9
- package/es/hooks/useDtl/index.js +63 -36
- package/es/hooks/useSingle/index.js +44 -27
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/lib/components/DtlLayout.d.ts +2 -0
- package/lib/components/DtlLayout.js +8 -1
- package/lib/components/IconSelector.d.ts +19 -0
- package/lib/components/IconSelector.js +322 -0
- package/lib/components/InputTable.js +19 -9
- package/lib/hooks/useDtl/index.js +63 -36
- package/lib/hooks/useSingle/index.js +44 -27
- package/lib/index.d.ts +2 -1
- package/lib/index.js +8 -0
- 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:
|
|
@@ -812,53 +812,48 @@ function useDtl(dtlParam) {
|
|
|
812
812
|
return _context9.abrupt("return");
|
|
813
813
|
|
|
814
814
|
case 3:
|
|
815
|
-
obj = (0, _objectSpread2.default)({}, masterObject);
|
|
816
|
-
|
|
817
|
-
_context9.t0 = beforeAudit;
|
|
815
|
+
obj = (0, _objectSpread2.default)({}, masterObject);
|
|
818
816
|
|
|
819
|
-
if (
|
|
820
|
-
_context9.next =
|
|
817
|
+
if (masterObject[mstKeyField]) {
|
|
818
|
+
_context9.next = 7;
|
|
821
819
|
break;
|
|
822
820
|
}
|
|
823
821
|
|
|
824
|
-
|
|
825
|
-
return
|
|
822
|
+
(0, _utils.showWarn)('当前数据未保存,不能审核');
|
|
823
|
+
return _context9.abrupt("return");
|
|
826
824
|
|
|
827
|
-
case
|
|
828
|
-
_context9.
|
|
829
|
-
_context9.
|
|
825
|
+
case 7:
|
|
826
|
+
_context9.prev = 7;
|
|
827
|
+
_context9.next = 10;
|
|
828
|
+
return (0, _utils.showConfirm)('确认要审核此数据?', '审核提示');
|
|
830
829
|
|
|
831
830
|
case 10:
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
break;
|
|
835
|
-
}
|
|
836
|
-
|
|
837
|
-
return _context9.abrupt("return");
|
|
831
|
+
_context9.next = 16;
|
|
832
|
+
break;
|
|
838
833
|
|
|
839
834
|
case 12:
|
|
840
835
|
_context9.prev = 12;
|
|
841
|
-
_context9.
|
|
842
|
-
|
|
836
|
+
_context9.t0 = _context9["catch"](7);
|
|
837
|
+
console.log('终止审核', _context9.t0);
|
|
838
|
+
return _context9.abrupt("return");
|
|
843
839
|
|
|
844
|
-
case
|
|
845
|
-
|
|
846
|
-
_context9.t2 = afterAudit;
|
|
840
|
+
case 16:
|
|
841
|
+
_context9.t1 = beforeAudit;
|
|
847
842
|
|
|
848
|
-
if (!_context9.
|
|
843
|
+
if (!_context9.t1) {
|
|
849
844
|
_context9.next = 22;
|
|
850
845
|
break;
|
|
851
846
|
}
|
|
852
847
|
|
|
853
848
|
_context9.next = 20;
|
|
854
|
-
return
|
|
849
|
+
return beforeAudit(obj);
|
|
855
850
|
|
|
856
851
|
case 20:
|
|
857
|
-
_context9.
|
|
858
|
-
_context9.
|
|
852
|
+
_context9.t2 = _context9.sent;
|
|
853
|
+
_context9.t1 = _context9.t2 === false;
|
|
859
854
|
|
|
860
855
|
case 22:
|
|
861
|
-
if (!_context9.
|
|
856
|
+
if (!_context9.t1) {
|
|
862
857
|
_context9.next = 24;
|
|
863
858
|
break;
|
|
864
859
|
}
|
|
@@ -866,25 +861,54 @@ function useDtl(dtlParam) {
|
|
|
866
861
|
return _context9.abrupt("return");
|
|
867
862
|
|
|
868
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:
|
|
869
893
|
if ((result === null || result === void 0 ? void 0 : (_result$flag8 = result.flag) === null || _result$flag8 === void 0 ? void 0 : _result$flag8.retCode) === '0') {
|
|
870
|
-
(0, _utils.showSuccess)(result.flag.retMsg);
|
|
894
|
+
(0, _utils.showSuccess)(result.flag.retMsg || '审核成功');
|
|
871
895
|
Object.assign(masterObject, result.data);
|
|
872
896
|
}
|
|
873
897
|
|
|
874
|
-
_context9.next =
|
|
898
|
+
_context9.next = 42;
|
|
875
899
|
break;
|
|
876
900
|
|
|
877
|
-
case
|
|
878
|
-
_context9.prev =
|
|
879
|
-
_context9.
|
|
880
|
-
console.log(_context9.
|
|
901
|
+
case 39:
|
|
902
|
+
_context9.prev = 39;
|
|
903
|
+
_context9.t5 = _context9["catch"](24);
|
|
904
|
+
console.log('审核异常', _context9.t5);
|
|
881
905
|
|
|
882
|
-
case
|
|
906
|
+
case 42:
|
|
883
907
|
case "end":
|
|
884
908
|
return _context9.stop();
|
|
885
909
|
}
|
|
886
910
|
}
|
|
887
|
-
}, _callee9, null, [[12,
|
|
911
|
+
}, _callee9, null, [[7, 12], [24, 39]]);
|
|
888
912
|
}));
|
|
889
913
|
|
|
890
914
|
return function onAudit() {
|
|
@@ -935,6 +959,7 @@ function useDtl(dtlParam) {
|
|
|
935
959
|
onClick: function onClick() {
|
|
936
960
|
return onAddDtl();
|
|
937
961
|
},
|
|
962
|
+
disabled: btnDisabled('add'),
|
|
938
963
|
icon: /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null)
|
|
939
964
|
}, "\u65B0\u589E") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.edit) && !isAudit() ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
940
965
|
key: "edit",
|
|
@@ -956,12 +981,14 @@ function useDtl(dtlParam) {
|
|
|
956
981
|
onClick: function onClick() {
|
|
957
982
|
onImport();
|
|
958
983
|
},
|
|
984
|
+
disabled: btnDisabled('import'),
|
|
959
985
|
icon: /*#__PURE__*/_react.default.createElement(_icons.ImportOutlined, null)
|
|
960
986
|
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.export) ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
961
987
|
key: "export",
|
|
962
988
|
onClick: function onClick() {
|
|
963
989
|
onExport();
|
|
964
990
|
},
|
|
991
|
+
disabled: btnDisabled('export'),
|
|
965
992
|
icon: /*#__PURE__*/_react.default.createElement(_icons.ExportOutlined, null)
|
|
966
993
|
}, "\u5BFC\u51FA") : false].filter(function (o) {
|
|
967
994
|
return o !== false;
|
|
@@ -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)('确认要审核选中的数据?', '审核提示');
|
|
345
|
+
|
|
346
|
+
case 10:
|
|
347
|
+
_context4.next = 16;
|
|
348
|
+
break;
|
|
349
|
+
|
|
350
|
+
case 12:
|
|
351
|
+
_context4.prev = 12;
|
|
352
|
+
_context4.t0 = _context4["catch"](7);
|
|
353
|
+
console.log(_context4.t0);
|
|
354
|
+
return _context4.abrupt("return");
|
|
342
355
|
|
|
343
|
-
|
|
356
|
+
case 16:
|
|
357
|
+
_context4.t1 = beforeAudit;
|
|
344
358
|
|
|
345
|
-
if (!_context4.
|
|
346
|
-
_context4.next =
|
|
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);
|
|
@@ -688,6 +702,7 @@ function useSingle(inParam) {
|
|
|
688
702
|
onClick: function onClick() {
|
|
689
703
|
return onAdd(null);
|
|
690
704
|
},
|
|
705
|
+
disabled: btnDisabled('add'),
|
|
691
706
|
icon: /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null)
|
|
692
707
|
}, "\u65B0\u589E") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.edit) && checkRight(4) ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
693
708
|
key: "edit",
|
|
@@ -718,6 +733,7 @@ function useSingle(inParam) {
|
|
|
718
733
|
|
|
719
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);
|
|
720
735
|
},
|
|
736
|
+
disabled: btnDisabled('import'),
|
|
721
737
|
icon: /*#__PURE__*/_react.default.createElement(_icons.ImportOutlined, null)
|
|
722
738
|
}, "\u5BFC\u5165") : false, (toolConfig === null || toolConfig === void 0 ? void 0 : toolConfig.export) && checkRight(256) ? /*#__PURE__*/_react.default.createElement(_button.default, {
|
|
723
739
|
key: "export",
|
|
@@ -726,6 +742,7 @@ function useSingle(inParam) {
|
|
|
726
742
|
|
|
727
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);
|
|
728
744
|
},
|
|
745
|
+
disabled: btnDisabled('export'),
|
|
729
746
|
icon: /*#__PURE__*/_react.default.createElement(_icons.ExportOutlined, null)
|
|
730
747
|
}, "\u5BFC\u51FA") : false].filter(function (o) {
|
|
731
748
|
return o !== false;
|
package/lib/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import DtlLayout from './components/DtlLayout';
|
|
|
2
2
|
import InputTable from './components/InputTable';
|
|
3
3
|
import Page404 from './components/404';
|
|
4
4
|
import Loading from './components/Loading';
|
|
5
|
+
import IconSelector from './components/IconSelector';
|
|
5
6
|
import BaseService from './service/BaseService';
|
|
6
7
|
import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
|
|
7
8
|
import * as utils from './utils';
|
|
@@ -13,4 +14,4 @@ import usePermission from './hooks/usePermission';
|
|
|
13
14
|
import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
|
|
14
15
|
import type { DtlLyaoutProps } from './components/DtlLayout';
|
|
15
16
|
export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps };
|
|
16
|
-
export { DtlLayout, InputTable, Page404, Loading, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
|
17
|
+
export { DtlLayout, InputTable, Page404, Loading, IconSelector, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
package/lib/index.js
CHANGED
|
@@ -19,6 +19,12 @@ Object.defineProperty(exports, "DtlLayout", {
|
|
|
19
19
|
return _DtlLayout.default;
|
|
20
20
|
}
|
|
21
21
|
});
|
|
22
|
+
Object.defineProperty(exports, "IconSelector", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function get() {
|
|
25
|
+
return _IconSelector.default;
|
|
26
|
+
}
|
|
27
|
+
});
|
|
22
28
|
Object.defineProperty(exports, "InputTable", {
|
|
23
29
|
enumerable: true,
|
|
24
30
|
get: function get() {
|
|
@@ -107,6 +113,8 @@ var _ = _interopRequireDefault(require("./components/404"));
|
|
|
107
113
|
|
|
108
114
|
var _Loading = _interopRequireDefault(require("./components/Loading"));
|
|
109
115
|
|
|
116
|
+
var _IconSelector = _interopRequireDefault(require("./components/IconSelector"));
|
|
117
|
+
|
|
110
118
|
var _BaseService = _interopRequireDefault(require("./service/BaseService"));
|
|
111
119
|
|
|
112
120
|
var _http = _interopRequireWildcard(require("./http"));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ls-pro-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.29",
|
|
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",
|