ls-pro-common 3.0.11 → 3.0.12
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.css +1 -0
- package/dist/common.js +1 -1
- package/dist/common.min.css +1 -0
- package/dist/common.min.js +1 -1
- package/es/components/DtlLayout.d.ts +1 -1
- package/es/components/InputTable.js +13 -14
- package/es/components/common.less +42 -41
- package/es/hooks/useGetState.d.ts +1 -0
- package/es/hooks/useGetState.js +17 -0
- package/es/http/index.js +5 -1
- 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 +9 -1
- package/lib/components/DtlLayout.d.ts +1 -1
- package/lib/components/InputTable.js +13 -14
- package/lib/components/common.less +42 -41
- package/lib/hooks/useGetState.d.ts +1 -0
- package/lib/hooks/useGetState.js +24 -0
- package/lib/http/index.js +5 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +8 -1
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/index.js +12 -3
- package/package.json +2 -2
|
@@ -5,8 +5,8 @@ import _Popover from "antd/es/popover";
|
|
|
5
5
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
6
6
|
import "antd/es/button/style";
|
|
7
7
|
import _Button from "antd/es/button";
|
|
8
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
9
8
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
9
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
10
10
|
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
11
11
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
12
12
|
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
@@ -24,18 +24,15 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
24
24
|
var _useContext = useContext(ProFormContext),
|
|
25
25
|
formRef = _useContext.formRef;
|
|
26
26
|
var tableRef = useRef();
|
|
27
|
+
var selectRowRef = useRef([]);
|
|
27
28
|
var _useState = useState(false),
|
|
28
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
30
|
visible = _useState2[0],
|
|
30
31
|
setVisible = _useState2[1];
|
|
31
|
-
var _useState3 = useState(
|
|
32
|
+
var _useState3 = useState(''),
|
|
32
33
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var _useState5 = useState(''),
|
|
36
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
37
|
-
text = _useState6[0],
|
|
38
|
-
setText = _useState6[1];
|
|
34
|
+
text = _useState4[0],
|
|
35
|
+
setText = _useState4[1];
|
|
39
36
|
var inputRef = useRef();
|
|
40
37
|
useImperativeHandle(ref, function () {
|
|
41
38
|
return inputRef.current;
|
|
@@ -123,9 +120,11 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
123
120
|
;
|
|
124
121
|
if (Object.keys(rest).length && !isV2) {
|
|
125
122
|
data.where = rest;
|
|
123
|
+
} else {
|
|
124
|
+
data = _objectSpread(_objectSpread({}, data), rest);
|
|
126
125
|
}
|
|
127
126
|
if (!keepSelect) {
|
|
128
|
-
|
|
127
|
+
selectRowRef.current = [];
|
|
129
128
|
(_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);
|
|
130
129
|
}
|
|
131
130
|
if (beforeLoad) {
|
|
@@ -297,7 +296,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
297
296
|
useEffect(function () {
|
|
298
297
|
if (!text) {
|
|
299
298
|
var _tableRef$current2, _tableRef$current2$cl;
|
|
300
|
-
|
|
299
|
+
selectRowRef.current = [];
|
|
301
300
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$cl = _tableRef$current2.clearSelected) === null || _tableRef$current2$cl === void 0 ? void 0 : _tableRef$current2$cl.call(_tableRef$current2);
|
|
302
301
|
}
|
|
303
302
|
}, [text]);
|
|
@@ -330,7 +329,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
330
329
|
rowSelection: {
|
|
331
330
|
type: multiple ? 'checkbox' : 'radio',
|
|
332
331
|
onChange: function onChange(keys, rows) {
|
|
333
|
-
|
|
332
|
+
selectRowRef.current = rows;
|
|
334
333
|
}
|
|
335
334
|
},
|
|
336
335
|
tableAlertRender: false,
|
|
@@ -344,7 +343,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
344
343
|
toolBarRender: function toolBarRender() {
|
|
345
344
|
return [/*#__PURE__*/React.createElement(_Button, {
|
|
346
345
|
onClick: function onClick() {
|
|
347
|
-
handleValue(
|
|
346
|
+
handleValue(selectRowRef.current || []);
|
|
348
347
|
}
|
|
349
348
|
}, "\u786E\u8BA4")];
|
|
350
349
|
},
|
|
@@ -386,7 +385,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
386
385
|
maxHeight: '95vh',
|
|
387
386
|
overflow: 'auto'
|
|
388
387
|
}
|
|
389
|
-
},
|
|
388
|
+
}, tableDom),
|
|
390
389
|
trigger: "click",
|
|
391
390
|
overlayInnerStyle: {
|
|
392
391
|
width: 'max-content'
|
|
@@ -433,7 +432,7 @@ var InputTable = /*#__PURE__*/React.forwardRef(function (prop, ref) {
|
|
|
433
432
|
maxHeight: '95vh',
|
|
434
433
|
overflow: 'auto'
|
|
435
434
|
}
|
|
436
|
-
},
|
|
435
|
+
}, tableDom),
|
|
437
436
|
trigger: "click",
|
|
438
437
|
overlayInnerStyle: {
|
|
439
438
|
width: 'max-content'
|
|
@@ -3,47 +3,47 @@ body {
|
|
|
3
3
|
--bg-color: #F9FAFB;
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
--ant-primary-color: #1869ED;
|
|
7
|
-
--ant-primary-color-hover: #418efa;
|
|
8
|
-
--ant-primary-color-active: #0a4cc7;
|
|
9
|
-
--ant-primary-color-outline: rgba(24, 105, 237, 0.4);
|
|
10
|
-
--ant-primary-1: #e6f4ff;
|
|
11
|
-
--ant-primary-2: #bddfff;
|
|
12
|
-
--ant-primary-3: #94c8ff;
|
|
13
|
-
--ant-primary-4: #6baeff;
|
|
14
|
-
--ant-primary-5: #418efa;
|
|
15
|
-
--ant-primary-6: #1869ED;
|
|
16
|
-
--ant-primary-7: #0a4cc7;
|
|
17
|
-
--ant-primary-color-deprecated-pure: #bed5fa;
|
|
18
|
-
--ant-primary-color-deprecated-l-35: #bed5fa;
|
|
19
|
-
--ant-primary-color-deprecated-l-20: #77a6f4;
|
|
20
|
-
--ant-primary-color-deprecated-t-20: #4687f1;
|
|
21
|
-
--ant-primary-color-deprecated-t-50: #8cb4f6;
|
|
22
|
-
--ant-primary-color-deprecated-f-12: rgba(24, 105, 237, 0.12);
|
|
6
|
+
--ant-primary-color : #1869ED;
|
|
7
|
+
--ant-primary-color-hover : #418efa;
|
|
8
|
+
--ant-primary-color-active : #0a4cc7;
|
|
9
|
+
--ant-primary-color-outline : rgba(24, 105, 237, 0.4);
|
|
10
|
+
--ant-primary-1 : #e6f4ff;
|
|
11
|
+
--ant-primary-2 : #bddfff;
|
|
12
|
+
--ant-primary-3 : #94c8ff;
|
|
13
|
+
--ant-primary-4 : #6baeff;
|
|
14
|
+
--ant-primary-5 : #418efa;
|
|
15
|
+
--ant-primary-6 : #1869ED;
|
|
16
|
+
--ant-primary-7 : #0a4cc7;
|
|
17
|
+
--ant-primary-color-deprecated-pure : #bed5fa;
|
|
18
|
+
--ant-primary-color-deprecated-l-35 : #bed5fa;
|
|
19
|
+
--ant-primary-color-deprecated-l-20 : #77a6f4;
|
|
20
|
+
--ant-primary-color-deprecated-t-20 : #4687f1;
|
|
21
|
+
--ant-primary-color-deprecated-t-50 : #8cb4f6;
|
|
22
|
+
--ant-primary-color-deprecated-f-12 : rgba(24, 105, 237, 0.12);
|
|
23
23
|
--ant-primary-color-active-deprecated-f-30: rgba(230, 244, 255, 0.3);
|
|
24
24
|
--ant-primary-color-active-deprecated-d-02: #dcf0ff;
|
|
25
|
-
--ant-success-color: #52c41a;
|
|
26
|
-
--ant-success-color-hover: #73d13d;
|
|
27
|
-
--ant-success-color-active: #389e0d;
|
|
28
|
-
--ant-success-color-outline: rgba(82, 196, 26, 0.2);
|
|
29
|
-
--ant-success-color-deprecated-bg: #f6ffed;
|
|
30
|
-
--ant-success-color-deprecated-border: #b7eb8f;
|
|
31
|
-
--ant-error-color: #ff4d4f;
|
|
32
|
-
--ant-error-color-hover: #ff7875;
|
|
33
|
-
--ant-error-color-active: #d9363e;
|
|
34
|
-
--ant-error-color-outline: rgba(255, 77, 79, 0.2);
|
|
35
|
-
--ant-error-color-deprecated-bg: #fff2f0;
|
|
36
|
-
--ant-error-color-deprecated-border: #ffccc7;
|
|
37
|
-
--ant-warning-color: #faad14;
|
|
38
|
-
--ant-warning-color-hover: #ffc53d;
|
|
39
|
-
--ant-warning-color-active: #d48806;
|
|
40
|
-
--ant-warning-color-outline: rgba(250, 173, 20, 0.2);
|
|
41
|
-
--ant-warning-color-deprecated-bg: #fffbe6;
|
|
42
|
-
--ant-warning-color-deprecated-border: #ffe58f;
|
|
43
|
-
--ant-info-color: #1869ED;
|
|
44
|
-
--ant-info-color-deprecated-bg: #e6f4ff;
|
|
45
|
-
--ant-info-color-deprecated-border: #94c8ff;
|
|
46
|
-
|
|
25
|
+
--ant-success-color : #52c41a;
|
|
26
|
+
--ant-success-color-hover : #73d13d;
|
|
27
|
+
--ant-success-color-active : #389e0d;
|
|
28
|
+
--ant-success-color-outline : rgba(82, 196, 26, 0.2);
|
|
29
|
+
--ant-success-color-deprecated-bg : #f6ffed;
|
|
30
|
+
--ant-success-color-deprecated-border : #b7eb8f;
|
|
31
|
+
--ant-error-color : #ff4d4f;
|
|
32
|
+
--ant-error-color-hover : #ff7875;
|
|
33
|
+
--ant-error-color-active : #d9363e;
|
|
34
|
+
--ant-error-color-outline : rgba(255, 77, 79, 0.2);
|
|
35
|
+
--ant-error-color-deprecated-bg : #fff2f0;
|
|
36
|
+
--ant-error-color-deprecated-border : #ffccc7;
|
|
37
|
+
--ant-warning-color : #faad14;
|
|
38
|
+
--ant-warning-color-hover : #ffc53d;
|
|
39
|
+
--ant-warning-color-active : #d48806;
|
|
40
|
+
--ant-warning-color-outline : rgba(250, 173, 20, 0.2);
|
|
41
|
+
--ant-warning-color-deprecated-bg : #fffbe6;
|
|
42
|
+
--ant-warning-color-deprecated-border : #ffe58f;
|
|
43
|
+
--ant-info-color : #1869ED;
|
|
44
|
+
--ant-info-color-deprecated-bg : #e6f4ff;
|
|
45
|
+
--ant-info-color-deprecated-border : #94c8ff;
|
|
46
|
+
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
* ::-webkit-scrollbar-thumb {
|
|
@@ -164,8 +164,9 @@ body.theme-yellow {
|
|
|
164
164
|
// }
|
|
165
165
|
|
|
166
166
|
.dtl-title {
|
|
167
|
-
font-size: 16px;
|
|
167
|
+
font-size : 16px;
|
|
168
168
|
font-weight: 700;
|
|
169
|
+
position : relative;
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
.dtl-btns {
|
|
@@ -332,7 +333,7 @@ a:hover {
|
|
|
332
333
|
|
|
333
334
|
.ant-pro-card-header-border {
|
|
334
335
|
border-bottom: 1px solid #dbeafa;
|
|
335
|
-
}
|
|
336
|
+
}
|
|
336
337
|
}
|
|
337
338
|
|
|
338
339
|
.has-background {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (initVal: any): any[];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
2
|
+
import { useState, useRef } from "react";
|
|
3
|
+
export default function (initVal) {
|
|
4
|
+
var _useState = useState(initVal),
|
|
5
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
6
|
+
state = _useState2[0],
|
|
7
|
+
setState = _useState2[1];
|
|
8
|
+
var ref = useRef(initVal);
|
|
9
|
+
var shangeState = function shangeState(newVal) {
|
|
10
|
+
ref.current = newVal;
|
|
11
|
+
setState(newVal);
|
|
12
|
+
};
|
|
13
|
+
var getState = function getState() {
|
|
14
|
+
return ref.current;
|
|
15
|
+
};
|
|
16
|
+
return [state, shangeState, getState];
|
|
17
|
+
}
|
package/es/http/index.js
CHANGED
|
@@ -121,7 +121,11 @@ request.interceptors.response.use( /*#__PURE__*/function () {
|
|
|
121
121
|
_faultCode = (_data$flag8 = _data.flag) === null || _data$flag8 === void 0 ? void 0 : _data$flag8.faultCode;
|
|
122
122
|
if (_retCode && !status.includes(_retCode)) {
|
|
123
123
|
if (_retCode === 'timeout' || _retCode === '4011') {
|
|
124
|
-
|
|
124
|
+
if (!getCookie("token")) {
|
|
125
|
+
(window.top || window).location.href = location.pathname === '/' ? '/login' : '/login?redirect=' + encodeURIComponent(location.href);
|
|
126
|
+
} else {
|
|
127
|
+
reLogin();
|
|
128
|
+
}
|
|
125
129
|
} else {
|
|
126
130
|
if (_faultCode) {
|
|
127
131
|
httpError(_retMsg, _retCode, _faultCode, options.url);
|
package/es/index.d.ts
CHANGED
|
@@ -22,10 +22,11 @@ import * as utils from './utils';
|
|
|
22
22
|
import useSingle from './hooks/useSingle';
|
|
23
23
|
import useDtl from './hooks/useDtl';
|
|
24
24
|
import usePermission from './hooks/usePermission';
|
|
25
|
+
import useGetState from './hooks/useGetState';
|
|
25
26
|
/** Type */
|
|
26
27
|
import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
|
|
27
28
|
import type { DtlLyaoutProps } from './components/DtlLayout';
|
|
28
29
|
import type { DescritionCardProps } from './components/DescritionCard';
|
|
29
30
|
import type { PermissionProps } from './components/Permission';
|
|
30
31
|
export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps, DescritionCardProps, PermissionProps };
|
|
31
|
-
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, IconBack, IconText, IconBell, IconQuestion, IconSearch, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
|
32
|
+
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, IconBack, IconText, IconBell, IconQuestion, IconSearch, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission, useGetState };
|
package/es/index.js
CHANGED
|
@@ -22,4 +22,5 @@ import * as utils from './utils';
|
|
|
22
22
|
import useSingle from './hooks/useSingle';
|
|
23
23
|
import useDtl from './hooks/useDtl';
|
|
24
24
|
import usePermission from './hooks/usePermission';
|
|
25
|
-
|
|
25
|
+
import useGetState from './hooks/useGetState';
|
|
26
|
+
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, IconBack, IconText, IconBell, IconQuestion, IconSearch, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission, useGetState };
|
package/es/utils/index.d.ts
CHANGED
|
@@ -91,6 +91,12 @@ export declare const setCache: (key: string, data: any, session?: boolean) => vo
|
|
|
91
91
|
* @returns 关键字对应的值
|
|
92
92
|
*/
|
|
93
93
|
export declare const getCache: (key: string, session?: boolean) => string | null;
|
|
94
|
+
/**
|
|
95
|
+
* 读取本地缓存,优先从sessionStorage 取,取不到时再从 localStorage取
|
|
96
|
+
* @param key
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
export declare const getCacheSessionFirst: (key: string) => string | null;
|
|
94
100
|
/**
|
|
95
101
|
*
|
|
96
102
|
* @param key 关键字,不传清除所有
|
package/es/utils/index.js
CHANGED
|
@@ -189,6 +189,14 @@ export var getCache = function getCache(key) {
|
|
|
189
189
|
}
|
|
190
190
|
return data;
|
|
191
191
|
};
|
|
192
|
+
/**
|
|
193
|
+
* 读取本地缓存,优先从sessionStorage 取,取不到时再从 localStorage取
|
|
194
|
+
* @param key
|
|
195
|
+
* @returns
|
|
196
|
+
*/
|
|
197
|
+
export var getCacheSessionFirst = function getCacheSessionFirst(key) {
|
|
198
|
+
return getCache(key, true) || getCache(key);
|
|
199
|
+
};
|
|
192
200
|
/**
|
|
193
201
|
*
|
|
194
202
|
* @param key 关键字,不传清除所有
|
|
@@ -314,7 +322,7 @@ export var reLogin = function reLogin() {
|
|
|
314
322
|
maskClosable: false,
|
|
315
323
|
afterClose: function afterClose() {
|
|
316
324
|
timeout = false;
|
|
317
|
-
location.href = location.pathname === '/' ? '/login' : '/login?redirect=' + encodeURIComponent(location.href);
|
|
325
|
+
(window.top || window).location.href = location.pathname === '/' ? '/login' : '/login?redirect=' + encodeURIComponent(location.href);
|
|
318
326
|
}
|
|
319
327
|
});
|
|
320
328
|
};
|
|
@@ -14,8 +14,8 @@ var _popover = _interopRequireDefault(require("antd/es/popover"));
|
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
require("antd/es/button/style");
|
|
16
16
|
var _button = _interopRequireDefault(require("antd/es/button"));
|
|
17
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
18
17
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
18
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
19
19
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
20
20
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
21
21
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
@@ -32,18 +32,15 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
32
32
|
var _useContext = (0, _react.useContext)(_lsProForm.ProFormContext),
|
|
33
33
|
formRef = _useContext.formRef;
|
|
34
34
|
var tableRef = (0, _react.useRef)();
|
|
35
|
+
var selectRowRef = (0, _react.useRef)([]);
|
|
35
36
|
var _useState = (0, _react.useState)(false),
|
|
36
37
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
37
38
|
visible = _useState2[0],
|
|
38
39
|
setVisible = _useState2[1];
|
|
39
|
-
var _useState3 = (0, _react.useState)(
|
|
40
|
+
var _useState3 = (0, _react.useState)(''),
|
|
40
41
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var _useState5 = (0, _react.useState)(''),
|
|
44
|
-
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
45
|
-
text = _useState6[0],
|
|
46
|
-
setText = _useState6[1];
|
|
42
|
+
text = _useState4[0],
|
|
43
|
+
setText = _useState4[1];
|
|
47
44
|
var inputRef = (0, _react.useRef)();
|
|
48
45
|
(0, _react.useImperativeHandle)(ref, function () {
|
|
49
46
|
return inputRef.current;
|
|
@@ -131,9 +128,11 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
131
128
|
;
|
|
132
129
|
if (Object.keys(rest).length && !isV2) {
|
|
133
130
|
data.where = rest;
|
|
131
|
+
} else {
|
|
132
|
+
data = (0, _objectSpread2.default)((0, _objectSpread2.default)({}, data), rest);
|
|
134
133
|
}
|
|
135
134
|
if (!keepSelect) {
|
|
136
|
-
|
|
135
|
+
selectRowRef.current = [];
|
|
137
136
|
(_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);
|
|
138
137
|
}
|
|
139
138
|
if (beforeLoad) {
|
|
@@ -305,7 +304,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
305
304
|
(0, _react.useEffect)(function () {
|
|
306
305
|
if (!text) {
|
|
307
306
|
var _tableRef$current2, _tableRef$current2$cl;
|
|
308
|
-
|
|
307
|
+
selectRowRef.current = [];
|
|
309
308
|
(_tableRef$current2 = tableRef.current) === null || _tableRef$current2 === void 0 ? void 0 : (_tableRef$current2$cl = _tableRef$current2.clearSelected) === null || _tableRef$current2$cl === void 0 ? void 0 : _tableRef$current2$cl.call(_tableRef$current2);
|
|
310
309
|
}
|
|
311
310
|
}, [text]);
|
|
@@ -338,7 +337,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
338
337
|
rowSelection: {
|
|
339
338
|
type: multiple ? 'checkbox' : 'radio',
|
|
340
339
|
onChange: function onChange(keys, rows) {
|
|
341
|
-
|
|
340
|
+
selectRowRef.current = rows;
|
|
342
341
|
}
|
|
343
342
|
},
|
|
344
343
|
tableAlertRender: false,
|
|
@@ -352,7 +351,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
352
351
|
toolBarRender: function toolBarRender() {
|
|
353
352
|
return [/*#__PURE__*/_react.default.createElement(_button.default, {
|
|
354
353
|
onClick: function onClick() {
|
|
355
|
-
handleValue(
|
|
354
|
+
handleValue(selectRowRef.current || []);
|
|
356
355
|
}
|
|
357
356
|
}, "\u786E\u8BA4")];
|
|
358
357
|
},
|
|
@@ -394,7 +393,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
394
393
|
maxHeight: '95vh',
|
|
395
394
|
overflow: 'auto'
|
|
396
395
|
}
|
|
397
|
-
},
|
|
396
|
+
}, tableDom),
|
|
398
397
|
trigger: "click",
|
|
399
398
|
overlayInnerStyle: {
|
|
400
399
|
width: 'max-content'
|
|
@@ -441,7 +440,7 @@ var InputTable = /*#__PURE__*/_react.default.forwardRef(function (prop, ref) {
|
|
|
441
440
|
maxHeight: '95vh',
|
|
442
441
|
overflow: 'auto'
|
|
443
442
|
}
|
|
444
|
-
},
|
|
443
|
+
}, tableDom),
|
|
445
444
|
trigger: "click",
|
|
446
445
|
overlayInnerStyle: {
|
|
447
446
|
width: 'max-content'
|
|
@@ -3,47 +3,47 @@ body {
|
|
|
3
3
|
--bg-color: #F9FAFB;
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
--ant-primary-color: #1869ED;
|
|
7
|
-
--ant-primary-color-hover: #418efa;
|
|
8
|
-
--ant-primary-color-active: #0a4cc7;
|
|
9
|
-
--ant-primary-color-outline: rgba(24, 105, 237, 0.4);
|
|
10
|
-
--ant-primary-1: #e6f4ff;
|
|
11
|
-
--ant-primary-2: #bddfff;
|
|
12
|
-
--ant-primary-3: #94c8ff;
|
|
13
|
-
--ant-primary-4: #6baeff;
|
|
14
|
-
--ant-primary-5: #418efa;
|
|
15
|
-
--ant-primary-6: #1869ED;
|
|
16
|
-
--ant-primary-7: #0a4cc7;
|
|
17
|
-
--ant-primary-color-deprecated-pure: #bed5fa;
|
|
18
|
-
--ant-primary-color-deprecated-l-35: #bed5fa;
|
|
19
|
-
--ant-primary-color-deprecated-l-20: #77a6f4;
|
|
20
|
-
--ant-primary-color-deprecated-t-20: #4687f1;
|
|
21
|
-
--ant-primary-color-deprecated-t-50: #8cb4f6;
|
|
22
|
-
--ant-primary-color-deprecated-f-12: rgba(24, 105, 237, 0.12);
|
|
6
|
+
--ant-primary-color : #1869ED;
|
|
7
|
+
--ant-primary-color-hover : #418efa;
|
|
8
|
+
--ant-primary-color-active : #0a4cc7;
|
|
9
|
+
--ant-primary-color-outline : rgba(24, 105, 237, 0.4);
|
|
10
|
+
--ant-primary-1 : #e6f4ff;
|
|
11
|
+
--ant-primary-2 : #bddfff;
|
|
12
|
+
--ant-primary-3 : #94c8ff;
|
|
13
|
+
--ant-primary-4 : #6baeff;
|
|
14
|
+
--ant-primary-5 : #418efa;
|
|
15
|
+
--ant-primary-6 : #1869ED;
|
|
16
|
+
--ant-primary-7 : #0a4cc7;
|
|
17
|
+
--ant-primary-color-deprecated-pure : #bed5fa;
|
|
18
|
+
--ant-primary-color-deprecated-l-35 : #bed5fa;
|
|
19
|
+
--ant-primary-color-deprecated-l-20 : #77a6f4;
|
|
20
|
+
--ant-primary-color-deprecated-t-20 : #4687f1;
|
|
21
|
+
--ant-primary-color-deprecated-t-50 : #8cb4f6;
|
|
22
|
+
--ant-primary-color-deprecated-f-12 : rgba(24, 105, 237, 0.12);
|
|
23
23
|
--ant-primary-color-active-deprecated-f-30: rgba(230, 244, 255, 0.3);
|
|
24
24
|
--ant-primary-color-active-deprecated-d-02: #dcf0ff;
|
|
25
|
-
--ant-success-color: #52c41a;
|
|
26
|
-
--ant-success-color-hover: #73d13d;
|
|
27
|
-
--ant-success-color-active: #389e0d;
|
|
28
|
-
--ant-success-color-outline: rgba(82, 196, 26, 0.2);
|
|
29
|
-
--ant-success-color-deprecated-bg: #f6ffed;
|
|
30
|
-
--ant-success-color-deprecated-border: #b7eb8f;
|
|
31
|
-
--ant-error-color: #ff4d4f;
|
|
32
|
-
--ant-error-color-hover: #ff7875;
|
|
33
|
-
--ant-error-color-active: #d9363e;
|
|
34
|
-
--ant-error-color-outline: rgba(255, 77, 79, 0.2);
|
|
35
|
-
--ant-error-color-deprecated-bg: #fff2f0;
|
|
36
|
-
--ant-error-color-deprecated-border: #ffccc7;
|
|
37
|
-
--ant-warning-color: #faad14;
|
|
38
|
-
--ant-warning-color-hover: #ffc53d;
|
|
39
|
-
--ant-warning-color-active: #d48806;
|
|
40
|
-
--ant-warning-color-outline: rgba(250, 173, 20, 0.2);
|
|
41
|
-
--ant-warning-color-deprecated-bg: #fffbe6;
|
|
42
|
-
--ant-warning-color-deprecated-border: #ffe58f;
|
|
43
|
-
--ant-info-color: #1869ED;
|
|
44
|
-
--ant-info-color-deprecated-bg: #e6f4ff;
|
|
45
|
-
--ant-info-color-deprecated-border: #94c8ff;
|
|
46
|
-
|
|
25
|
+
--ant-success-color : #52c41a;
|
|
26
|
+
--ant-success-color-hover : #73d13d;
|
|
27
|
+
--ant-success-color-active : #389e0d;
|
|
28
|
+
--ant-success-color-outline : rgba(82, 196, 26, 0.2);
|
|
29
|
+
--ant-success-color-deprecated-bg : #f6ffed;
|
|
30
|
+
--ant-success-color-deprecated-border : #b7eb8f;
|
|
31
|
+
--ant-error-color : #ff4d4f;
|
|
32
|
+
--ant-error-color-hover : #ff7875;
|
|
33
|
+
--ant-error-color-active : #d9363e;
|
|
34
|
+
--ant-error-color-outline : rgba(255, 77, 79, 0.2);
|
|
35
|
+
--ant-error-color-deprecated-bg : #fff2f0;
|
|
36
|
+
--ant-error-color-deprecated-border : #ffccc7;
|
|
37
|
+
--ant-warning-color : #faad14;
|
|
38
|
+
--ant-warning-color-hover : #ffc53d;
|
|
39
|
+
--ant-warning-color-active : #d48806;
|
|
40
|
+
--ant-warning-color-outline : rgba(250, 173, 20, 0.2);
|
|
41
|
+
--ant-warning-color-deprecated-bg : #fffbe6;
|
|
42
|
+
--ant-warning-color-deprecated-border : #ffe58f;
|
|
43
|
+
--ant-info-color : #1869ED;
|
|
44
|
+
--ant-info-color-deprecated-bg : #e6f4ff;
|
|
45
|
+
--ant-info-color-deprecated-border : #94c8ff;
|
|
46
|
+
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
* ::-webkit-scrollbar-thumb {
|
|
@@ -164,8 +164,9 @@ body.theme-yellow {
|
|
|
164
164
|
// }
|
|
165
165
|
|
|
166
166
|
.dtl-title {
|
|
167
|
-
font-size: 16px;
|
|
167
|
+
font-size : 16px;
|
|
168
168
|
font-weight: 700;
|
|
169
|
+
position : relative;
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
.dtl-btns {
|
|
@@ -332,7 +333,7 @@ a:hover {
|
|
|
332
333
|
|
|
333
334
|
.ant-pro-card-header-border {
|
|
334
335
|
border-bottom: 1px solid #dbeafa;
|
|
335
|
-
}
|
|
336
|
+
}
|
|
336
337
|
}
|
|
337
338
|
|
|
338
339
|
.has-background {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (initVal: any): any[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = _default;
|
|
8
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
|
+
var _react = require("react");
|
|
10
|
+
function _default(initVal) {
|
|
11
|
+
var _useState = (0, _react.useState)(initVal),
|
|
12
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
13
|
+
state = _useState2[0],
|
|
14
|
+
setState = _useState2[1];
|
|
15
|
+
var ref = (0, _react.useRef)(initVal);
|
|
16
|
+
var shangeState = function shangeState(newVal) {
|
|
17
|
+
ref.current = newVal;
|
|
18
|
+
setState(newVal);
|
|
19
|
+
};
|
|
20
|
+
var getState = function getState() {
|
|
21
|
+
return ref.current;
|
|
22
|
+
};
|
|
23
|
+
return [state, shangeState, getState];
|
|
24
|
+
}
|
package/lib/http/index.js
CHANGED
|
@@ -134,7 +134,11 @@ request.interceptors.response.use( /*#__PURE__*/function () {
|
|
|
134
134
|
_faultCode = (_data$flag8 = _data.flag) === null || _data$flag8 === void 0 ? void 0 : _data$flag8.faultCode;
|
|
135
135
|
if (_retCode && !status.includes(_retCode)) {
|
|
136
136
|
if (_retCode === 'timeout' || _retCode === '4011') {
|
|
137
|
-
(0, _utils.
|
|
137
|
+
if (!(0, _utils.getCookie)("token")) {
|
|
138
|
+
(window.top || window).location.href = location.pathname === '/' ? '/login' : '/login?redirect=' + encodeURIComponent(location.href);
|
|
139
|
+
} else {
|
|
140
|
+
(0, _utils.reLogin)();
|
|
141
|
+
}
|
|
138
142
|
} else {
|
|
139
143
|
if (_faultCode) {
|
|
140
144
|
(0, _utils.httpError)(_retMsg, _retCode, _faultCode, options.url);
|
package/lib/index.d.ts
CHANGED
|
@@ -22,10 +22,11 @@ import * as utils from './utils';
|
|
|
22
22
|
import useSingle from './hooks/useSingle';
|
|
23
23
|
import useDtl from './hooks/useDtl';
|
|
24
24
|
import usePermission from './hooks/usePermission';
|
|
25
|
+
import useGetState from './hooks/useGetState';
|
|
25
26
|
/** Type */
|
|
26
27
|
import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
|
|
27
28
|
import type { DtlLyaoutProps } from './components/DtlLayout';
|
|
28
29
|
import type { DescritionCardProps } from './components/DescritionCard';
|
|
29
30
|
import type { PermissionProps } from './components/Permission';
|
|
30
31
|
export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps, DescritionCardProps, PermissionProps };
|
|
31
|
-
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, IconBack, IconText, IconBell, IconQuestion, IconSearch, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission };
|
|
32
|
+
export { DtlLayout, InputTable, Page404, Loading, IconSelector, ImageSelector, InputMultiLine, AreaCascader, AreaCascaderPanel, DescritionCard, Permission, GroupTip, IconBack, IconText, IconBell, IconQuestion, IconSearch, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl, usePermission, useGetState };
|
package/lib/index.js
CHANGED
|
@@ -161,6 +161,12 @@ Object.defineProperty(exports, "useDtl", {
|
|
|
161
161
|
return _useDtl.default;
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
|
+
Object.defineProperty(exports, "useGetState", {
|
|
165
|
+
enumerable: true,
|
|
166
|
+
get: function get() {
|
|
167
|
+
return _useGetState.default;
|
|
168
|
+
}
|
|
169
|
+
});
|
|
164
170
|
Object.defineProperty(exports, "usePermission", {
|
|
165
171
|
enumerable: true,
|
|
166
172
|
get: function get() {
|
|
@@ -197,4 +203,5 @@ var utils = _interopRequireWildcard(require("./utils"));
|
|
|
197
203
|
exports.utils = utils;
|
|
198
204
|
var _useSingle = _interopRequireDefault(require("./hooks/useSingle"));
|
|
199
205
|
var _useDtl = _interopRequireDefault(require("./hooks/useDtl"));
|
|
200
|
-
var _usePermission = _interopRequireDefault(require("./hooks/usePermission"));
|
|
206
|
+
var _usePermission = _interopRequireDefault(require("./hooks/usePermission"));
|
|
207
|
+
var _useGetState = _interopRequireDefault(require("./hooks/useGetState"));
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -91,6 +91,12 @@ export declare const setCache: (key: string, data: any, session?: boolean) => vo
|
|
|
91
91
|
* @returns 关键字对应的值
|
|
92
92
|
*/
|
|
93
93
|
export declare const getCache: (key: string, session?: boolean) => string | null;
|
|
94
|
+
/**
|
|
95
|
+
* 读取本地缓存,优先从sessionStorage 取,取不到时再从 localStorage取
|
|
96
|
+
* @param key
|
|
97
|
+
* @returns
|
|
98
|
+
*/
|
|
99
|
+
export declare const getCacheSessionFirst: (key: string) => string | null;
|
|
94
100
|
/**
|
|
95
101
|
*
|
|
96
102
|
* @param key 关键字,不传清除所有
|
package/lib/utils/index.js
CHANGED
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "debounce", {
|
|
|
17
17
|
return _lodash.debounce;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
exports.getLoginName = exports.getFullScreenElement = exports.getCookie = exports.getCompanyId = exports.getCache = exports.formatMoney = exports.formatDate = exports.exitLoading = exports.exitAlert = exports.deepClone = void 0;
|
|
20
|
+
exports.getLoginName = exports.getFullScreenElement = exports.getCookie = exports.getCompanyId = exports.getCacheSessionFirst = exports.getCache = exports.formatMoney = exports.formatDate = exports.exitLoading = exports.exitAlert = exports.deepClone = void 0;
|
|
21
21
|
Object.defineProperty(exports, "getResourceProps", {
|
|
22
22
|
enumerable: true,
|
|
23
23
|
get: function get() {
|
|
@@ -254,12 +254,21 @@ var getCache = function getCache(key) {
|
|
|
254
254
|
}
|
|
255
255
|
return data;
|
|
256
256
|
};
|
|
257
|
+
/**
|
|
258
|
+
* 读取本地缓存,优先从sessionStorage 取,取不到时再从 localStorage取
|
|
259
|
+
* @param key
|
|
260
|
+
* @returns
|
|
261
|
+
*/
|
|
262
|
+
exports.getCache = getCache;
|
|
263
|
+
var getCacheSessionFirst = function getCacheSessionFirst(key) {
|
|
264
|
+
return getCache(key, true) || getCache(key);
|
|
265
|
+
};
|
|
257
266
|
/**
|
|
258
267
|
*
|
|
259
268
|
* @param key 关键字,不传清除所有
|
|
260
269
|
* @param session 是否session storage , 默认 localStorage
|
|
261
270
|
*/
|
|
262
|
-
exports.
|
|
271
|
+
exports.getCacheSessionFirst = getCacheSessionFirst;
|
|
263
272
|
var clearCache = function clearCache(key) {
|
|
264
273
|
var session = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
265
274
|
if (key) {
|
|
@@ -388,7 +397,7 @@ var reLogin = function reLogin() {
|
|
|
388
397
|
maskClosable: false,
|
|
389
398
|
afterClose: function afterClose() {
|
|
390
399
|
timeout = false;
|
|
391
|
-
location.href = location.pathname === '/' ? '/login' : '/login?redirect=' + encodeURIComponent(location.href);
|
|
400
|
+
(window.top || window).location.href = location.pathname === '/' ? '/login' : '/login?redirect=' + encodeURIComponent(location.href);
|
|
392
401
|
}
|
|
393
402
|
});
|
|
394
403
|
};
|