ls-pro-common 1.0.14 → 1.0.17
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 +18 -0
- package/dist/common.js +1 -1
- package/dist/common.min.css +18 -0
- package/dist/common.min.js +1 -1
- package/es/components/404.d.ts +3 -0
- package/es/components/404.jpg +0 -0
- package/es/components/404.js +9 -0
- package/es/components/Loading.d.ts +3 -0
- package/es/components/Loading.js +9 -0
- package/es/components/common.less +21 -0
- package/es/index.d.ts +3 -1
- package/es/index.js +3 -1
- package/es/utils/index.d.ts +3 -1
- package/es/utils/index.js +7 -2
- package/lib/components/404.d.ts +3 -0
- package/lib/components/404.jpg +0 -0
- package/lib/components/404.js +22 -0
- package/lib/components/Loading.d.ts +3 -0
- package/lib/components/Loading.js +24 -0
- package/lib/components/common.less +21 -0
- package/lib/index.d.ts +3 -1
- package/lib/index.js +16 -0
- package/lib/utils/index.d.ts +3 -1
- package/lib/utils/index.js +7 -2
- package/package.json +2 -2
|
Binary file
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import './common.less';
|
|
3
|
+
export default (function () {
|
|
4
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
5
|
+
className: "page404"
|
|
6
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
7
|
+
src: require('./404.jpg')
|
|
8
|
+
}), " \u60A8\u8BBF\u95EE\u7684\u8D44\u6E90\u4E0D\u5B58\u5728~~");
|
|
9
|
+
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "antd/es/spin/style";
|
|
2
|
+
import _Spin from "antd/es/spin";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import './common.less';
|
|
5
|
+
export default (function () {
|
|
6
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
+
className: "loading"
|
|
8
|
+
}, /*#__PURE__*/React.createElement(_Spin, null), "\u52A0\u8F7D\u4E2D... ");
|
|
9
|
+
});
|
|
@@ -61,4 +61,25 @@
|
|
|
61
61
|
.flex {
|
|
62
62
|
width: 0;
|
|
63
63
|
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.page404 {
|
|
67
|
+
width : 100%;
|
|
68
|
+
height : 100%;
|
|
69
|
+
text-align : center;
|
|
70
|
+
padding-top : 20%;
|
|
71
|
+
vertical-align: middle;
|
|
72
|
+
|
|
73
|
+
img {
|
|
74
|
+
vertical-align: middle;
|
|
75
|
+
padding-right : 20px;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.loading {
|
|
80
|
+
height : 100%;
|
|
81
|
+
width : 100%;
|
|
82
|
+
text-align : center;
|
|
83
|
+
padding-top: 20%;
|
|
84
|
+
background : #fff;
|
|
64
85
|
}
|
package/es/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import DtlLayout from './components/DtlLayout';
|
|
2
2
|
import InputTable from './components/InputTable';
|
|
3
|
+
import Page404 from './components/404';
|
|
4
|
+
import Loading from './components/Loading';
|
|
3
5
|
import BaseService from './service/BaseService';
|
|
4
6
|
import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
|
|
5
7
|
import * as utils from './utils';
|
|
@@ -10,4 +12,4 @@ import useDtl from './hooks/useDtl';
|
|
|
10
12
|
import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
|
|
11
13
|
import type { DtlLyaoutProps } from './components/DtlLayout';
|
|
12
14
|
export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps };
|
|
13
|
-
export { DtlLayout, InputTable, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl };
|
|
15
|
+
export { DtlLayout, InputTable, Page404, Loading, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl };
|
package/es/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import DtlLayout from './components/DtlLayout';
|
|
2
2
|
import InputTable from './components/InputTable';
|
|
3
|
+
import Page404 from './components/404';
|
|
4
|
+
import Loading from './components/Loading';
|
|
3
5
|
import BaseService from './service/BaseService';
|
|
4
6
|
import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
|
|
5
7
|
import * as utils from './utils';
|
|
@@ -7,4 +9,4 @@ import * as utils from './utils';
|
|
|
7
9
|
|
|
8
10
|
import useSingle from './hooks/useSingle';
|
|
9
11
|
import useDtl from './hooks/useDtl';
|
|
10
|
-
export { DtlLayout, InputTable, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl };
|
|
12
|
+
export { DtlLayout, InputTable, Page404, Loading, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl };
|
package/es/utils/index.d.ts
CHANGED
|
@@ -27,11 +27,13 @@ export declare const isLogin: () => boolean;
|
|
|
27
27
|
* 设置本地缓存
|
|
28
28
|
* @param { String } key 关键字
|
|
29
29
|
* @param { Object } data 值
|
|
30
|
+
* @param { Boolean } session 保存到 sessionStorage 还是 localStorage,默认 localStorage
|
|
30
31
|
*/
|
|
31
|
-
export declare const setCache: (key: string, data: any) => void;
|
|
32
|
+
export declare const setCache: (key: string, data: any, session?: boolean) => void;
|
|
32
33
|
/**
|
|
33
34
|
* 读取本地缓存
|
|
34
35
|
* @param { String } key 关键字
|
|
36
|
+
* @param { boolean } session 从 sessionStorage 取数还是从 localStorage 中取数 默认从 localStorage
|
|
35
37
|
* @returns 关键字对应的值
|
|
36
38
|
*/
|
|
37
39
|
export declare const getCache: any;
|
package/es/utils/index.js
CHANGED
|
@@ -58,23 +58,28 @@ export var isLogin = function isLogin() {
|
|
|
58
58
|
* 设置本地缓存
|
|
59
59
|
* @param { String } key 关键字
|
|
60
60
|
* @param { Object } data 值
|
|
61
|
+
* @param { Boolean } session 保存到 sessionStorage 还是 localStorage,默认 localStorage
|
|
61
62
|
*/
|
|
62
63
|
|
|
63
64
|
export var setCache = function setCache(key, data) {
|
|
65
|
+
var session = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
66
|
+
|
|
64
67
|
if (_typeof(data) === 'object') {
|
|
65
68
|
data = JSON.stringify(data);
|
|
66
69
|
}
|
|
67
70
|
|
|
68
|
-
localStorage.setItem(key, data);
|
|
71
|
+
session ? sessionStorage.setItem(key, data) : localStorage.setItem(key, data);
|
|
69
72
|
};
|
|
70
73
|
/**
|
|
71
74
|
* 读取本地缓存
|
|
72
75
|
* @param { String } key 关键字
|
|
76
|
+
* @param { boolean } session 从 sessionStorage 取数还是从 localStorage 中取数 默认从 localStorage
|
|
73
77
|
* @returns 关键字对应的值
|
|
74
78
|
*/
|
|
75
79
|
|
|
76
80
|
export var getCache = function getCache(key) {
|
|
77
|
-
var
|
|
81
|
+
var session = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
82
|
+
var data = session ? sessionStorage.getItem(key) : localStorage.getItem(key);
|
|
78
83
|
|
|
79
84
|
if (data && (data.startsWith('{') || data.startsWith('['))) {
|
|
80
85
|
data = JSON.parse(data);
|
|
Binary file
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
require("./common.less");
|
|
13
|
+
|
|
14
|
+
var _default = function _default() {
|
|
15
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
16
|
+
className: "page404"
|
|
17
|
+
}, /*#__PURE__*/_react.default.createElement("img", {
|
|
18
|
+
src: require('./404.jpg')
|
|
19
|
+
}), " \u60A8\u8BBF\u95EE\u7684\u8D44\u6E90\u4E0D\u5B58\u5728~~");
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.default = _default;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
require("antd/es/spin/style");
|
|
11
|
+
|
|
12
|
+
var _spin = _interopRequireDefault(require("antd/es/spin"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
require("./common.less");
|
|
17
|
+
|
|
18
|
+
var _default = function _default() {
|
|
19
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
20
|
+
className: "loading"
|
|
21
|
+
}, /*#__PURE__*/_react.default.createElement(_spin.default, null), "\u52A0\u8F7D\u4E2D... ");
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
exports.default = _default;
|
|
@@ -61,4 +61,25 @@
|
|
|
61
61
|
.flex {
|
|
62
62
|
width: 0;
|
|
63
63
|
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.page404 {
|
|
67
|
+
width : 100%;
|
|
68
|
+
height : 100%;
|
|
69
|
+
text-align : center;
|
|
70
|
+
padding-top : 20%;
|
|
71
|
+
vertical-align: middle;
|
|
72
|
+
|
|
73
|
+
img {
|
|
74
|
+
vertical-align: middle;
|
|
75
|
+
padding-right : 20px;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.loading {
|
|
80
|
+
height : 100%;
|
|
81
|
+
width : 100%;
|
|
82
|
+
text-align : center;
|
|
83
|
+
padding-top: 20%;
|
|
84
|
+
background : #fff;
|
|
64
85
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import DtlLayout from './components/DtlLayout';
|
|
2
2
|
import InputTable from './components/InputTable';
|
|
3
|
+
import Page404 from './components/404';
|
|
4
|
+
import Loading from './components/Loading';
|
|
3
5
|
import BaseService from './service/BaseService';
|
|
4
6
|
import request, { httpGet, httpPut, httpPost, httpDelete, getDict, fetchOptions } from './http';
|
|
5
7
|
import * as utils from './utils';
|
|
@@ -10,4 +12,4 @@ import useDtl from './hooks/useDtl';
|
|
|
10
12
|
import type { ApiResponse, TableToolbar, BaseApiType, MethodType } from './typing';
|
|
11
13
|
import type { DtlLyaoutProps } from './components/DtlLayout';
|
|
12
14
|
export type { ApiResponse, TableToolbar, BaseApiType, MethodType, DtlLyaoutProps };
|
|
13
|
-
export { DtlLayout, InputTable, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl };
|
|
15
|
+
export { DtlLayout, InputTable, Page404, Loading, BaseService, request, httpDelete, httpGet, httpPost, httpPut, getDict, fetchOptions, utils, useSingle, useDtl };
|
package/lib/index.js
CHANGED
|
@@ -25,6 +25,18 @@ Object.defineProperty(exports, "InputTable", {
|
|
|
25
25
|
return _InputTable.default;
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
+
Object.defineProperty(exports, "Loading", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function get() {
|
|
31
|
+
return _Loading.default;
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "Page404", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function get() {
|
|
37
|
+
return _.default;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
28
40
|
Object.defineProperty(exports, "fetchOptions", {
|
|
29
41
|
enumerable: true,
|
|
30
42
|
get: function get() {
|
|
@@ -85,6 +97,10 @@ var _DtlLayout = _interopRequireDefault(require("./components/DtlLayout"));
|
|
|
85
97
|
|
|
86
98
|
var _InputTable = _interopRequireDefault(require("./components/InputTable"));
|
|
87
99
|
|
|
100
|
+
var _ = _interopRequireDefault(require("./components/404"));
|
|
101
|
+
|
|
102
|
+
var _Loading = _interopRequireDefault(require("./components/Loading"));
|
|
103
|
+
|
|
88
104
|
var _BaseService = _interopRequireDefault(require("./service/BaseService"));
|
|
89
105
|
|
|
90
106
|
var _http = _interopRequireWildcard(require("./http"));
|
package/lib/utils/index.d.ts
CHANGED
|
@@ -27,11 +27,13 @@ export declare const isLogin: () => boolean;
|
|
|
27
27
|
* 设置本地缓存
|
|
28
28
|
* @param { String } key 关键字
|
|
29
29
|
* @param { Object } data 值
|
|
30
|
+
* @param { Boolean } session 保存到 sessionStorage 还是 localStorage,默认 localStorage
|
|
30
31
|
*/
|
|
31
|
-
export declare const setCache: (key: string, data: any) => void;
|
|
32
|
+
export declare const setCache: (key: string, data: any, session?: boolean) => void;
|
|
32
33
|
/**
|
|
33
34
|
* 读取本地缓存
|
|
34
35
|
* @param { String } key 关键字
|
|
36
|
+
* @param { boolean } session 从 sessionStorage 取数还是从 localStorage 中取数 默认从 localStorage
|
|
35
37
|
* @returns 关键字对应的值
|
|
36
38
|
*/
|
|
37
39
|
export declare const getCache: any;
|
package/lib/utils/index.js
CHANGED
|
@@ -117,21 +117,25 @@ var isLogin = function isLogin() {
|
|
|
117
117
|
* 设置本地缓存
|
|
118
118
|
* @param { String } key 关键字
|
|
119
119
|
* @param { Object } data 值
|
|
120
|
+
* @param { Boolean } session 保存到 sessionStorage 还是 localStorage,默认 localStorage
|
|
120
121
|
*/
|
|
121
122
|
|
|
122
123
|
|
|
123
124
|
exports.isLogin = isLogin;
|
|
124
125
|
|
|
125
126
|
var setCache = function setCache(key, data) {
|
|
127
|
+
var session = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
128
|
+
|
|
126
129
|
if ((0, _typeof2.default)(data) === 'object') {
|
|
127
130
|
data = JSON.stringify(data);
|
|
128
131
|
}
|
|
129
132
|
|
|
130
|
-
localStorage.setItem(key, data);
|
|
133
|
+
session ? sessionStorage.setItem(key, data) : localStorage.setItem(key, data);
|
|
131
134
|
};
|
|
132
135
|
/**
|
|
133
136
|
* 读取本地缓存
|
|
134
137
|
* @param { String } key 关键字
|
|
138
|
+
* @param { boolean } session 从 sessionStorage 取数还是从 localStorage 中取数 默认从 localStorage
|
|
135
139
|
* @returns 关键字对应的值
|
|
136
140
|
*/
|
|
137
141
|
|
|
@@ -139,7 +143,8 @@ var setCache = function setCache(key, data) {
|
|
|
139
143
|
exports.setCache = setCache;
|
|
140
144
|
|
|
141
145
|
var getCache = function getCache(key) {
|
|
142
|
-
var
|
|
146
|
+
var session = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
147
|
+
var data = session ? sessionStorage.getItem(key) : localStorage.getItem(key);
|
|
143
148
|
|
|
144
149
|
if (data && (data.startsWith('{') || data.startsWith('['))) {
|
|
145
150
|
data = JSON.parse(data);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ls-pro-common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "ls-pro-common",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"antd",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@ant-design/icons": "^4.3.0",
|
|
31
|
-
"ls-pro-table": "2.62.
|
|
31
|
+
"ls-pro-table": "2.62.20",
|
|
32
32
|
"ls-pro-form": "1.52.20",
|
|
33
33
|
"@babel/runtime": "^7.16.3",
|
|
34
34
|
"classnames": "^2.2.6",
|