ls-pro-common 1.0.25 → 1.0.28
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/hooks/useDtl/index.js +63 -36
- package/es/hooks/useSingle/index.js +45 -28
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/utils/index.d.ts +6 -0
- package/es/utils/index.js +21 -0
- 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/hooks/useDtl/index.js +63 -36
- package/lib/hooks/useSingle/index.js +45 -28
- package/lib/index.d.ts +2 -1
- package/lib/index.js +8 -0
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/index.js +26 -1
- package/package.json +3 -3
|
@@ -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)('确认要审核选中的数据?', '审核提示');
|
|
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/lib/utils/index.d.ts
CHANGED
|
@@ -102,7 +102,13 @@ export declare type UserType = {
|
|
|
102
102
|
phoneNumber?: string;
|
|
103
103
|
remarks?: string;
|
|
104
104
|
};
|
|
105
|
+
/** @name 用户信息 */
|
|
105
106
|
export declare const getUserInfo: () => UserType | null;
|
|
107
|
+
/** @name 用户名 */
|
|
106
108
|
export declare const getUserName: () => string | undefined;
|
|
109
|
+
/** @name 登录名 */
|
|
107
110
|
export declare const getLoginName: () => string | undefined;
|
|
111
|
+
/** @name 公司Id */
|
|
108
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() {
|
|
@@ -308,11 +309,15 @@ var treeFind = function treeFind(list, key, val) {
|
|
|
308
309
|
|
|
309
310
|
exports.treeFind = treeFind;
|
|
310
311
|
var isDev = location.href.includes("//localhost");
|
|
312
|
+
/** @name 用户信息 */
|
|
313
|
+
|
|
311
314
|
exports.isDev = isDev;
|
|
312
315
|
|
|
313
316
|
var getUserInfo = function getUserInfo() {
|
|
314
317
|
return getCache('user');
|
|
315
318
|
};
|
|
319
|
+
/** @name 用户名 */
|
|
320
|
+
|
|
316
321
|
|
|
317
322
|
exports.getUserInfo = getUserInfo;
|
|
318
323
|
|
|
@@ -321,6 +326,8 @@ var getUserName = function getUserName() {
|
|
|
321
326
|
|
|
322
327
|
return (_getUserInfo = getUserInfo()) === null || _getUserInfo === void 0 ? void 0 : _getUserInfo.userName;
|
|
323
328
|
};
|
|
329
|
+
/** @name 登录名 */
|
|
330
|
+
|
|
324
331
|
|
|
325
332
|
exports.getUserName = getUserName;
|
|
326
333
|
|
|
@@ -329,6 +336,8 @@ var getLoginName = function getLoginName() {
|
|
|
329
336
|
|
|
330
337
|
return (_getUserInfo2 = getUserInfo()) === null || _getUserInfo2 === void 0 ? void 0 : _getUserInfo2.loginName;
|
|
331
338
|
};
|
|
339
|
+
/** @name 公司Id */
|
|
340
|
+
|
|
332
341
|
|
|
333
342
|
exports.getLoginName = getLoginName;
|
|
334
343
|
|
|
@@ -337,5 +346,21 @@ var getCompanyId = function getCompanyId() {
|
|
|
337
346
|
|
|
338
347
|
return (_getUserInfo3 = getUserInfo()) === null || _getUserInfo3 === void 0 ? void 0 : _getUserInfo3.companyId;
|
|
339
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
|
+
};
|
|
340
365
|
|
|
341
|
-
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.28",
|
|
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",
|