ls-pro-common 3.0.29 → 3.0.31
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/es/components/IconBack.d.ts +5 -4
- package/es/components/IconBack.js +1 -1
- package/es/components/IconBell.d.ts +2 -4
- package/es/components/IconBell.js +1 -1
- package/es/components/IconQuestion.d.ts +2 -4
- package/es/components/IconQuestion.js +1 -1
- package/es/components/IconSearch.d.ts +2 -4
- package/es/components/IconSearch.js +1 -1
- package/es/components/IconText.d.ts +2 -4
- package/es/components/IconText.js +1 -1
- package/es/utils/index.d.ts +2 -2
- package/es/utils/index.js +2 -2
- package/lib/components/404.js +7 -15
- package/lib/components/AreaCascader.js +23 -32
- package/lib/components/AreaCascaderPanel.js +52 -61
- package/lib/components/DescritionCard.js +23 -32
- package/lib/components/DtlLayout.js +28 -37
- package/lib/components/GroupTip.js +11 -19
- package/lib/components/IconBack.d.ts +5 -4
- package/lib/components/IconBack.js +7 -15
- package/lib/components/IconBell.d.ts +2 -4
- package/lib/components/IconBell.js +7 -15
- package/lib/components/IconQuestion.d.ts +2 -4
- package/lib/components/IconQuestion.js +9 -17
- package/lib/components/IconSearch.d.ts +2 -4
- package/lib/components/IconSearch.js +7 -15
- package/lib/components/IconSelector.js +49 -57
- package/lib/components/IconText.d.ts +2 -4
- package/lib/components/IconText.js +12 -20
- package/lib/components/ImageSelector.js +93 -101
- package/lib/components/InputMultiLine.js +35 -44
- package/lib/components/InputTable.js +71 -80
- package/lib/components/Loading.js +11 -19
- package/lib/components/Permission.js +7 -15
- package/lib/hooks/useDtl/index.js +88 -96
- package/lib/hooks/useGetState.js +6 -13
- package/lib/hooks/usePermission/index.js +14 -21
- package/lib/hooks/useSingle/index.js +74 -82
- package/lib/http/index.js +42 -56
- package/lib/index.js +26 -207
- package/lib/service/BaseService.js +33 -41
- package/lib/typing.js +1 -5
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/index.js +83 -180
- package/package.json +2 -2
package/lib/utils/index.js
CHANGED
|
@@ -1,77 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
return _lodash.debounce;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
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
|
-
Object.defineProperty(exports, "getResourceProps", {
|
|
22
|
-
enumerable: true,
|
|
23
|
-
get: function get() {
|
|
24
|
-
return _lsProTable.getResourceProps;
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(exports, "getUrlQuery", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
get: function get() {
|
|
30
|
-
return _lsProTable.getUrlQuery;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
exports.setTitle = exports.setCookie = exports.setCache = exports.reLogin = exports.rangeToSearch = exports.printView = exports.printAsync = exports.openPageInMain = exports.on = exports.off = exports.nowAdd = exports.now = exports.isLogin = exports.isDev = exports.httpError = exports.handleTheme = exports.handleSizeCols = exports.getUserName = exports.getUserInfo = void 0;
|
|
34
|
-
Object.defineProperty(exports, "setUrlQuery", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
get: function get() {
|
|
37
|
-
return _lsProTable.setUrlQuery;
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
exports.statusList = exports.showWarn = exports.showSuccess = exports.showLoading = exports.showError = exports.showConfirm = exports.showAlert = void 0;
|
|
41
|
-
Object.defineProperty(exports, "throttle", {
|
|
42
|
-
enumerable: true,
|
|
43
|
-
get: function get() {
|
|
44
|
-
return _lodash.throttle;
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
Object.defineProperty(exports, "toGatewayUrl", {
|
|
48
|
-
enumerable: true,
|
|
49
|
-
get: function get() {
|
|
50
|
-
return _lsProTable.toGatewayUrl;
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
exports.yesnoList = exports.treeFind = exports.treeEach = exports.todayAdd = exports.today = void 0;
|
|
54
|
-
require("antd/es/spin/style");
|
|
55
|
-
var _spin = _interopRequireDefault(require("antd/es/spin"));
|
|
56
|
-
var _createForOfIteratorHelper2 = _interopRequireDefault(require("@babel/runtime/helpers/createForOfIteratorHelper"));
|
|
57
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
58
|
-
require("antd/es/modal/style");
|
|
59
|
-
var _modal = _interopRequireDefault(require("antd/es/modal"));
|
|
60
|
-
require("antd/es/message/style");
|
|
61
|
-
var _message2 = _interopRequireDefault(require("antd/es/message"));
|
|
62
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
63
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
64
|
-
var _icons = require("@ant-design/icons");
|
|
65
|
-
var _lsProTable = require("ls-pro-table");
|
|
66
|
-
var _http = require("../http");
|
|
67
|
-
var _react = _interopRequireDefault(require("react"));
|
|
68
|
-
var _lodash = require("lodash");
|
|
1
|
+
import "antd/es/spin/style";
|
|
2
|
+
import _Spin from "antd/es/spin";
|
|
3
|
+
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
4
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
5
|
+
import "antd/es/modal/style";
|
|
6
|
+
import _Modal from "antd/es/modal";
|
|
7
|
+
import "antd/es/message/style";
|
|
8
|
+
import _message from "antd/es/message";
|
|
9
|
+
import _typeof from "@babel/runtime/helpers/esm/typeof";
|
|
10
|
+
import ReactDOM from 'react-dom';
|
|
11
|
+
import { QuestionCircleOutlined } from '@ant-design/icons';
|
|
12
|
+
import { dateFormat, toGatewayUrl } from 'ls-pro-table/es/utils/index';
|
|
13
|
+
import { httpPost } from '../http';
|
|
14
|
+
import React from 'react';
|
|
15
|
+
export { throttle, debounce } from 'lodash';
|
|
16
|
+
export { getUrlQuery, setUrlQuery, toGatewayUrl, dateFormat, getResourceProps } from 'ls-pro-table/es/utils/index';
|
|
69
17
|
/**
|
|
70
18
|
* 设置文档title
|
|
71
19
|
* @param {*} title
|
|
72
20
|
* @returns
|
|
73
21
|
*/
|
|
74
|
-
var setTitle = function setTitle(title) {
|
|
22
|
+
export var setTitle = function setTitle(title) {
|
|
75
23
|
if (!title) return;
|
|
76
24
|
document.title = title;
|
|
77
25
|
};
|
|
@@ -81,23 +29,20 @@ var setTitle = function setTitle(title) {
|
|
|
81
29
|
* @param showTime 是否显示时间 默认true
|
|
82
30
|
* @returns YYYY-MM-DD hh:mm:ss
|
|
83
31
|
*/
|
|
84
|
-
|
|
85
|
-
var formatDate = _lsProTable.dateFormat;
|
|
32
|
+
export var formatDate = dateFormat;
|
|
86
33
|
/**
|
|
87
34
|
* 返回当前日期
|
|
88
35
|
* @returns YYYY-MM-DD
|
|
89
36
|
*/
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return (0, _lsProTable.dateFormat)(null, false);
|
|
37
|
+
export var today = function today() {
|
|
38
|
+
return dateFormat(null, false);
|
|
93
39
|
};
|
|
94
40
|
/**
|
|
95
41
|
* 返回当前日期时间
|
|
96
42
|
* @returns YYYY-MM-DD hh:mm:ss
|
|
97
43
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return (0, _lsProTable.dateFormat)(null, true);
|
|
44
|
+
export var now = function now() {
|
|
45
|
+
return dateFormat(null, true);
|
|
101
46
|
};
|
|
102
47
|
/**
|
|
103
48
|
* 时间加减
|
|
@@ -107,8 +52,7 @@ var now = function now() {
|
|
|
107
52
|
* @param addYear 添加年数,可以负责
|
|
108
53
|
* @returns YYYY-MM-DD hh:mm:ss
|
|
109
54
|
*/
|
|
110
|
-
|
|
111
|
-
var dateAdd = function dateAdd(dt, addDay) {
|
|
55
|
+
export var dateAdd = function dateAdd(dt, addDay) {
|
|
112
56
|
var addMonth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
113
57
|
var addYear = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
114
58
|
if (!dt) {
|
|
@@ -123,7 +67,7 @@ var dateAdd = function dateAdd(dt, addDay) {
|
|
|
123
67
|
if (addYear) {
|
|
124
68
|
dt.setFullYear(dt.getFullYear() + addYear);
|
|
125
69
|
}
|
|
126
|
-
return
|
|
70
|
+
return dateFormat(dt, true);
|
|
127
71
|
};
|
|
128
72
|
/**
|
|
129
73
|
* 当前时间加减
|
|
@@ -132,8 +76,7 @@ var dateAdd = function dateAdd(dt, addDay) {
|
|
|
132
76
|
* @param addYear 添加年数,可以负责
|
|
133
77
|
* @returns YYYY-MM-DD hh:mm:ss
|
|
134
78
|
*/
|
|
135
|
-
|
|
136
|
-
var nowAdd = function nowAdd(addDay) {
|
|
79
|
+
export var nowAdd = function nowAdd(addDay) {
|
|
137
80
|
var addMonth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
138
81
|
var addYear = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
139
82
|
return dateAdd(null, addDay, addMonth, addYear);
|
|
@@ -145,8 +88,7 @@ var nowAdd = function nowAdd(addDay) {
|
|
|
145
88
|
* @param addYear 添加年数,可以负责
|
|
146
89
|
* @returns YYYY-MM-DD
|
|
147
90
|
*/
|
|
148
|
-
|
|
149
|
-
var todayAdd = function todayAdd(addDay) {
|
|
91
|
+
export var todayAdd = function todayAdd(addDay) {
|
|
150
92
|
var addMonth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
151
93
|
var addYear = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
152
94
|
return nowAdd(addDay, addMonth, addYear).split(' ')[0];
|
|
@@ -157,8 +99,7 @@ var todayAdd = function todayAdd(addDay) {
|
|
|
157
99
|
* @param dec 小数位数,默认为2位小数
|
|
158
100
|
* @returns xx,xxx.xx
|
|
159
101
|
*/
|
|
160
|
-
|
|
161
|
-
var formatMoney = function formatMoney(num) {
|
|
102
|
+
export var formatMoney = function formatMoney(num) {
|
|
162
103
|
var dec = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 2;
|
|
163
104
|
if (typeof num !== 'number') {
|
|
164
105
|
num = Number(num);
|
|
@@ -177,8 +118,7 @@ var formatMoney = function formatMoney(num) {
|
|
|
177
118
|
* @param {String} name cookie名
|
|
178
119
|
* @returns
|
|
179
120
|
*/
|
|
180
|
-
|
|
181
|
-
var getCookie = function getCookie(name) {
|
|
121
|
+
export var getCookie = function getCookie(name) {
|
|
182
122
|
var arr;
|
|
183
123
|
var reg = new RegExp("(^| )" + name + "=([^;]*)(;|$)");
|
|
184
124
|
if (arr = document.cookie.match(reg)) return arr[2];else return null;
|
|
@@ -189,8 +129,7 @@ var getCookie = function getCookie(name) {
|
|
|
189
129
|
* @param {*} value Cookie 值
|
|
190
130
|
* @param { Number } day 有效天数 默认1天,
|
|
191
131
|
*/
|
|
192
|
-
|
|
193
|
-
var setCookie = function setCookie(key, value) {
|
|
132
|
+
export var setCookie = function setCookie(key, value) {
|
|
194
133
|
var day = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;
|
|
195
134
|
var sameSite = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
196
135
|
if (day !== 0) {
|
|
@@ -212,12 +151,10 @@ var setCookie = function setCookie(key, value) {
|
|
|
212
151
|
* 判断是否登录
|
|
213
152
|
* @returns
|
|
214
153
|
*/
|
|
215
|
-
|
|
216
|
-
var isLogin = function isLogin() {
|
|
154
|
+
export var isLogin = function isLogin() {
|
|
217
155
|
return !!getCookie('online');
|
|
218
156
|
};
|
|
219
|
-
|
|
220
|
-
var getFullScreenElement = function getFullScreenElement() {
|
|
157
|
+
export var getFullScreenElement = function getFullScreenElement() {
|
|
221
158
|
//@ts-ignore
|
|
222
159
|
return document.fullscreenElement || document.mozFullScreenElement || document.msFullScreenElement || document.webkitFullscreenElement || undefined;
|
|
223
160
|
};
|
|
@@ -227,10 +164,9 @@ var getFullScreenElement = function getFullScreenElement() {
|
|
|
227
164
|
* @param { Object } data 值
|
|
228
165
|
* @param { Boolean } session 保存到 sessionStorage 还是 localStorage,默认 localStorage
|
|
229
166
|
*/
|
|
230
|
-
|
|
231
|
-
var setCache = function setCache(key, data) {
|
|
167
|
+
export var setCache = function setCache(key, data) {
|
|
232
168
|
var session = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
233
|
-
if ((
|
|
169
|
+
if (_typeof(data) === 'object') {
|
|
234
170
|
data = JSON.stringify(data);
|
|
235
171
|
}
|
|
236
172
|
if (session) {
|
|
@@ -245,8 +181,7 @@ var setCache = function setCache(key, data) {
|
|
|
245
181
|
* @param { boolean } session 从 sessionStorage 取数还是从 localStorage 中取数 默认从 localStorage
|
|
246
182
|
* @returns 关键字对应的值
|
|
247
183
|
*/
|
|
248
|
-
|
|
249
|
-
var getCache = function getCache(key) {
|
|
184
|
+
export var getCache = function getCache(key) {
|
|
250
185
|
var session = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
251
186
|
var data = session ? sessionStorage.getItem(key) : localStorage.getItem(key);
|
|
252
187
|
if (data && (data.startsWith('{') || data.startsWith('['))) {
|
|
@@ -259,8 +194,7 @@ var getCache = function getCache(key) {
|
|
|
259
194
|
* @param key
|
|
260
195
|
* @returns
|
|
261
196
|
*/
|
|
262
|
-
|
|
263
|
-
var getCacheSessionFirst = function getCacheSessionFirst(key) {
|
|
197
|
+
export var getCacheSessionFirst = function getCacheSessionFirst(key) {
|
|
264
198
|
return getCache(key, true) || getCache(key);
|
|
265
199
|
};
|
|
266
200
|
/**
|
|
@@ -268,8 +202,7 @@ var getCacheSessionFirst = function getCacheSessionFirst(key) {
|
|
|
268
202
|
* @param key 关键字,不传清除所有
|
|
269
203
|
* @param session 是否session storage , 默认 localStorage
|
|
270
204
|
*/
|
|
271
|
-
|
|
272
|
-
var clearCache = function clearCache(key) {
|
|
205
|
+
export var clearCache = function clearCache(key) {
|
|
273
206
|
var session = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
274
207
|
if (key) {
|
|
275
208
|
if (session) {
|
|
@@ -285,14 +218,13 @@ var clearCache = function clearCache(key) {
|
|
|
285
218
|
}
|
|
286
219
|
}
|
|
287
220
|
};
|
|
288
|
-
|
|
289
|
-
_message2.default.config({
|
|
221
|
+
_message.config({
|
|
290
222
|
maxCount: 1
|
|
291
223
|
});
|
|
292
224
|
/** @name 显示错误 */
|
|
293
|
-
var showError = function showError(text) {
|
|
225
|
+
export var showError = function showError(text) {
|
|
294
226
|
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 4;
|
|
295
|
-
|
|
227
|
+
_message.error({
|
|
296
228
|
content: text,
|
|
297
229
|
duration: duration,
|
|
298
230
|
getPopupContainer: function getPopupContainer(e) {
|
|
@@ -301,10 +233,9 @@ var showError = function showError(text) {
|
|
|
301
233
|
});
|
|
302
234
|
};
|
|
303
235
|
/** @name 显示警示 */
|
|
304
|
-
|
|
305
|
-
var showWarn = function showWarn(text) {
|
|
236
|
+
export var showWarn = function showWarn(text) {
|
|
306
237
|
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
307
|
-
|
|
238
|
+
_message.warn({
|
|
308
239
|
content: text,
|
|
309
240
|
duration: duration,
|
|
310
241
|
getPopupContainer: function getPopupContainer(e) {
|
|
@@ -313,10 +244,9 @@ var showWarn = function showWarn(text) {
|
|
|
313
244
|
});
|
|
314
245
|
};
|
|
315
246
|
/** @name 显示成功 */
|
|
316
|
-
|
|
317
|
-
var showSuccess = function showSuccess(text) {
|
|
247
|
+
export var showSuccess = function showSuccess(text) {
|
|
318
248
|
var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
|
|
319
|
-
|
|
249
|
+
_message.success({
|
|
320
250
|
content: text,
|
|
321
251
|
duration: duration,
|
|
322
252
|
getPopupContainer: function getPopupContainer(e) {
|
|
@@ -332,13 +262,12 @@ var showSuccess = function showSuccess(text) {
|
|
|
332
262
|
* @param opts 附加参数
|
|
333
263
|
* @returns Promise<Boolean>
|
|
334
264
|
*/
|
|
335
|
-
|
|
336
|
-
var showAlert = function showAlert(text) {
|
|
265
|
+
export var showAlert = function showAlert(text) {
|
|
337
266
|
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
338
267
|
var type = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'error';
|
|
339
268
|
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
340
269
|
return new Promise(function (resolve, reject) {
|
|
341
|
-
|
|
270
|
+
_Modal[type](_objectSpread({
|
|
342
271
|
content: text,
|
|
343
272
|
title: title,
|
|
344
273
|
getContainer: getFullScreenElement() || document.body,
|
|
@@ -351,25 +280,22 @@ var showAlert = function showAlert(text) {
|
|
|
351
280
|
}, opts));
|
|
352
281
|
});
|
|
353
282
|
};
|
|
354
|
-
|
|
355
|
-
var httpError = function httpError(retMsg, retCode, faultCode) {
|
|
283
|
+
export var httpError = function httpError(retMsg, retCode, faultCode) {
|
|
356
284
|
var opts = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
357
|
-
var msg = /*#__PURE__*/
|
|
285
|
+
var msg = /*#__PURE__*/React.createElement(React.Fragment, null, "\u9519\u8BEF\u539F\u56E0:", /*#__PURE__*/React.createElement("b", null, retMsg), /*#__PURE__*/React.createElement("br", null), "\u9519\u8BEF\u7801:", /*#__PURE__*/React.createElement("b", null, retCode), /*#__PURE__*/React.createElement("br", null), "\u6545\u969C\u7801:", /*#__PURE__*/React.createElement("b", null, faultCode));
|
|
358
286
|
return showAlert(msg, '请求接口出错', 'error', opts);
|
|
359
287
|
};
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
_modal.default.destroyAll();
|
|
288
|
+
export var exitAlert = function exitAlert() {
|
|
289
|
+
_Modal.destroyAll();
|
|
363
290
|
};
|
|
364
291
|
/** @name 显示确认 */
|
|
365
|
-
|
|
366
|
-
var showConfirm = function showConfirm(text) {
|
|
292
|
+
export var showConfirm = function showConfirm(text) {
|
|
367
293
|
var title = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '系统提示';
|
|
368
294
|
return new Promise(function (resolve, reject) {
|
|
369
|
-
|
|
295
|
+
_Modal.confirm({
|
|
370
296
|
title: title,
|
|
371
297
|
content: text,
|
|
372
|
-
icon: /*#__PURE__*/
|
|
298
|
+
icon: /*#__PURE__*/React.createElement(QuestionCircleOutlined, null),
|
|
373
299
|
okType: 'danger',
|
|
374
300
|
closable: true,
|
|
375
301
|
cancelButtonProps: {
|
|
@@ -385,16 +311,15 @@ var showConfirm = function showConfirm(text) {
|
|
|
385
311
|
});
|
|
386
312
|
});
|
|
387
313
|
};
|
|
388
|
-
exports.showConfirm = showConfirm;
|
|
389
314
|
var timeout = false;
|
|
390
315
|
/**
|
|
391
316
|
* token过期重新登录
|
|
392
317
|
* @returns
|
|
393
318
|
*/
|
|
394
|
-
var reLogin = function reLogin() {
|
|
319
|
+
export var reLogin = function reLogin() {
|
|
395
320
|
if (timeout) return;
|
|
396
321
|
timeout = true;
|
|
397
|
-
|
|
322
|
+
_Modal.warning({
|
|
398
323
|
title: '登录状态已过期,请重新登录',
|
|
399
324
|
okText: '重新登录',
|
|
400
325
|
maskClosable: false,
|
|
@@ -412,8 +337,7 @@ var reLogin = function reLogin() {
|
|
|
412
337
|
* @param endSuffix
|
|
413
338
|
* @returns
|
|
414
339
|
*/
|
|
415
|
-
|
|
416
|
-
var rangeToSearch = function rangeToSearch(values, startField, endField) {
|
|
340
|
+
export var rangeToSearch = function rangeToSearch(values, startField, endField) {
|
|
417
341
|
var endSuffix = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
418
342
|
var startSuffex = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : '';
|
|
419
343
|
var data = {};
|
|
@@ -426,8 +350,7 @@ var rangeToSearch = function rangeToSearch(values, startField, endField) {
|
|
|
426
350
|
return data;
|
|
427
351
|
};
|
|
428
352
|
/** @name 状态列表 */
|
|
429
|
-
|
|
430
|
-
var statusList = [{
|
|
353
|
+
export var statusList = [{
|
|
431
354
|
value: 1,
|
|
432
355
|
text: '启用',
|
|
433
356
|
label: '1→启用'
|
|
@@ -437,8 +360,7 @@ var statusList = [{
|
|
|
437
360
|
label: '0→禁用'
|
|
438
361
|
}];
|
|
439
362
|
/** @name 是否列表 */
|
|
440
|
-
|
|
441
|
-
var yesnoList = [{
|
|
363
|
+
export var yesnoList = [{
|
|
442
364
|
value: 1,
|
|
443
365
|
text: '是',
|
|
444
366
|
label: '1→是'
|
|
@@ -453,8 +375,7 @@ var yesnoList = [{
|
|
|
453
375
|
* @param fn 回调函数
|
|
454
376
|
* @param children 树属性字段
|
|
455
377
|
*/
|
|
456
|
-
|
|
457
|
-
var treeEach = function treeEach(list, fn) {
|
|
378
|
+
export var treeEach = function treeEach(list, fn) {
|
|
458
379
|
var children = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "children";
|
|
459
380
|
list.forEach(function (item, index) {
|
|
460
381
|
fn(item, index, list);
|
|
@@ -473,11 +394,10 @@ var treeEach = function treeEach(list, fn) {
|
|
|
473
394
|
* @param children 树属性字段
|
|
474
395
|
* @returns 返回符合条件的第一条对象
|
|
475
396
|
*/
|
|
476
|
-
|
|
477
|
-
var treeFind = function treeFind(list, key, val) {
|
|
397
|
+
export var treeFind = function treeFind(list, key, val) {
|
|
478
398
|
var children = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "children";
|
|
479
399
|
var item = null;
|
|
480
|
-
var _iterator = (
|
|
400
|
+
var _iterator = _createForOfIteratorHelper(list),
|
|
481
401
|
_step;
|
|
482
402
|
try {
|
|
483
403
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
@@ -506,8 +426,7 @@ var treeFind = function treeFind(list, key, val) {
|
|
|
506
426
|
* @param sizeWidth 尺码宽f1~f100, 默认100
|
|
507
427
|
* @returns 返回已处理好的表头[{dataIndex:sizeTypeNo,title:'国标码',width:120,children[...]},{dataIndex:'f1',...}...]
|
|
508
428
|
*/
|
|
509
|
-
|
|
510
|
-
var handleSizeCols = function handleSizeCols(orgSizeHeader) {
|
|
429
|
+
export var handleSizeCols = function handleSizeCols(orgSizeHeader) {
|
|
511
430
|
var typeWidth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 120;
|
|
512
431
|
var sizeWidth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 100;
|
|
513
432
|
// f1~f100 当所有尺码组都为null时,删除不需要的尺码。
|
|
@@ -586,8 +505,7 @@ var handleSizeCols = function handleSizeCols(orgSizeHeader) {
|
|
|
586
505
|
* @param fn 调用函数
|
|
587
506
|
* @param el 源对象,默认为window
|
|
588
507
|
*/
|
|
589
|
-
|
|
590
|
-
var on = function on(eventName, fn, el) {
|
|
508
|
+
export var on = function on(eventName, fn, el) {
|
|
591
509
|
if (!el) {
|
|
592
510
|
el = window;
|
|
593
511
|
}
|
|
@@ -599,8 +517,7 @@ var on = function on(eventName, fn, el) {
|
|
|
599
517
|
* @param fn 调用函数
|
|
600
518
|
* @param el 源对象,默认为window
|
|
601
519
|
*/
|
|
602
|
-
|
|
603
|
-
var off = function off(eventName, fn, el) {
|
|
520
|
+
export var off = function off(eventName, fn, el) {
|
|
604
521
|
if (!el) {
|
|
605
522
|
el = window;
|
|
606
523
|
}
|
|
@@ -615,13 +532,12 @@ var off = function off(eventName, fn, el) {
|
|
|
615
532
|
* @param method 请求方式,默认post
|
|
616
533
|
* @returns
|
|
617
534
|
*/
|
|
618
|
-
|
|
619
|
-
var printView = function printView(templateNo, reqUrl) {
|
|
535
|
+
export var printView = function printView(templateNo, reqUrl) {
|
|
620
536
|
var bodyParam = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
621
537
|
var param = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
|
|
622
538
|
var method = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'POST';
|
|
623
|
-
var printCenterUrl =
|
|
624
|
-
reqUrl =
|
|
539
|
+
var printCenterUrl = toGatewayUrl('/petrel-print-center-api/report/remote/print/dataStr');
|
|
540
|
+
reqUrl = toGatewayUrl(reqUrl);
|
|
625
541
|
if (!reqUrl.includes(location.origin)) {
|
|
626
542
|
reqUrl = location.origin + reqUrl;
|
|
627
543
|
}
|
|
@@ -649,16 +565,15 @@ var printView = function printView(templateNo, reqUrl) {
|
|
|
649
565
|
* @param method 请求方式,默认post
|
|
650
566
|
* @returns
|
|
651
567
|
*/
|
|
652
|
-
|
|
653
|
-
var printAsync = function printAsync(taskName, templateNo, reqUrl) {
|
|
568
|
+
export var printAsync = function printAsync(taskName, templateNo, reqUrl) {
|
|
654
569
|
var bodyParam = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
|
655
570
|
var param = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
|
|
656
571
|
var method = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 'POST';
|
|
657
|
-
var printCenterUrl =
|
|
572
|
+
var printCenterUrl = toGatewayUrl('/petrel-print-center-api/report/client/print');
|
|
658
573
|
if (!printCenterUrl.includes(location.origin)) {
|
|
659
574
|
printCenterUrl = location.origin + printCenterUrl;
|
|
660
575
|
}
|
|
661
|
-
reqUrl =
|
|
576
|
+
reqUrl = toGatewayUrl(reqUrl);
|
|
662
577
|
if (!reqUrl.includes(location.origin)) {
|
|
663
578
|
reqUrl = location.origin + reqUrl;
|
|
664
579
|
}
|
|
@@ -676,36 +591,30 @@ var printAsync = function printAsync(taskName, templateNo, reqUrl) {
|
|
|
676
591
|
token: getCache('token') || ''
|
|
677
592
|
};
|
|
678
593
|
var url = 'http://localhost:10050/client/async/print';
|
|
679
|
-
return
|
|
594
|
+
return httpPost(url, data, true, false);
|
|
680
595
|
};
|
|
681
|
-
|
|
682
|
-
var isDev = location.href.includes("//localhost");
|
|
596
|
+
export var isDev = location.href.includes("//localhost");
|
|
683
597
|
/** @name 用户信息 */
|
|
684
|
-
|
|
685
|
-
var getUserInfo = function getUserInfo() {
|
|
598
|
+
export var getUserInfo = function getUserInfo() {
|
|
686
599
|
return getCache('user');
|
|
687
600
|
};
|
|
688
601
|
/** @name 用户名 */
|
|
689
|
-
|
|
690
|
-
var getUserName = function getUserName() {
|
|
602
|
+
export var getUserName = function getUserName() {
|
|
691
603
|
var _getUserInfo;
|
|
692
604
|
return (_getUserInfo = getUserInfo()) === null || _getUserInfo === void 0 ? void 0 : _getUserInfo.userName;
|
|
693
605
|
};
|
|
694
606
|
/** @name 登录名 */
|
|
695
|
-
|
|
696
|
-
var getLoginName = function getLoginName() {
|
|
607
|
+
export var getLoginName = function getLoginName() {
|
|
697
608
|
var _getUserInfo2;
|
|
698
609
|
return (_getUserInfo2 = getUserInfo()) === null || _getUserInfo2 === void 0 ? void 0 : _getUserInfo2.loginName;
|
|
699
610
|
};
|
|
700
611
|
/** @name 公司Id */
|
|
701
|
-
|
|
702
|
-
var getCompanyId = function getCompanyId() {
|
|
612
|
+
export var getCompanyId = function getCompanyId() {
|
|
703
613
|
var _getUserInfo3;
|
|
704
614
|
return (_getUserInfo3 = getUserInfo()) === null || _getUserInfo3 === void 0 ? void 0 : _getUserInfo3.companyId;
|
|
705
615
|
};
|
|
706
616
|
/** @name 微前端原生路径 */
|
|
707
|
-
|
|
708
|
-
var appPath = function appPath() {
|
|
617
|
+
export var appPath = function appPath() {
|
|
709
618
|
var path = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
710
619
|
// @ts-ignore
|
|
711
620
|
if (window.__INJECTED_PUBLIC_PATH_BY_QIANKUN__) {
|
|
@@ -722,8 +631,7 @@ var appPath = function appPath() {
|
|
|
722
631
|
* @param obj
|
|
723
632
|
* @returns
|
|
724
633
|
*/
|
|
725
|
-
|
|
726
|
-
var deepClone = function deepClone(obj) {
|
|
634
|
+
export var deepClone = function deepClone(obj) {
|
|
727
635
|
var otype = Object.prototype.toString.call(obj);
|
|
728
636
|
var target = obj;
|
|
729
637
|
if (otype === '[object Array]') {
|
|
@@ -743,40 +651,35 @@ var deepClone = function deepClone(obj) {
|
|
|
743
651
|
* 在主工程中打开模块
|
|
744
652
|
* @param option {path:模块路由,需要加工程编码, resourceId: 资源Id,两者传一个即可,data:参数}
|
|
745
653
|
*/
|
|
746
|
-
|
|
747
|
-
var openPageInMain = function openPageInMain(option) {
|
|
654
|
+
export var openPageInMain = function openPageInMain(option) {
|
|
748
655
|
var win = top || window;
|
|
749
656
|
win.postMessage({
|
|
750
657
|
type: 'openPage',
|
|
751
658
|
param: option
|
|
752
659
|
});
|
|
753
660
|
};
|
|
754
|
-
|
|
755
|
-
var showLoading = function showLoading() {
|
|
661
|
+
export var showLoading = function showLoading() {
|
|
756
662
|
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '处理中...';
|
|
757
663
|
var loading = document.getElementById('myloading');
|
|
758
664
|
if (loading) return;
|
|
759
665
|
var loadWrapper = document.createElement('div');
|
|
760
666
|
loadWrapper.setAttribute("id", "myloading");
|
|
761
|
-
|
|
667
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(_Spin, {
|
|
762
668
|
tip: text
|
|
763
669
|
}), loadWrapper);
|
|
764
670
|
var pNode = getFullScreenElement() || document.body;
|
|
765
671
|
pNode.appendChild(loadWrapper);
|
|
766
672
|
};
|
|
767
|
-
|
|
768
|
-
var exitLoading = function exitLoading() {
|
|
673
|
+
export var exitLoading = function exitLoading() {
|
|
769
674
|
var loading = document.getElementById('myloading');
|
|
770
675
|
if (loading) {
|
|
771
676
|
var _loading$parentNode;
|
|
772
677
|
(_loading$parentNode = loading.parentNode) === null || _loading$parentNode === void 0 ? void 0 : _loading$parentNode.removeChild(loading);
|
|
773
678
|
}
|
|
774
679
|
};
|
|
775
|
-
|
|
776
|
-
var handleTheme = function handleTheme() {
|
|
680
|
+
export var handleTheme = function handleTheme() {
|
|
777
681
|
var theme = getCache('theme');
|
|
778
682
|
if (theme) {
|
|
779
683
|
document.body.classList.add('theme-' + theme);
|
|
780
684
|
}
|
|
781
|
-
};
|
|
782
|
-
exports.handleTheme = handleTheme;
|
|
685
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ls-pro-common",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.31",
|
|
4
4
|
"description": "ls-pro-common",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": [
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
],
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@ant-design/icons": "^4.3.0",
|
|
24
|
-
"ls-pro-table": "^3.0.
|
|
24
|
+
"ls-pro-table": "^3.0.19",
|
|
25
25
|
"ls-pro-form": "^3.0.6",
|
|
26
26
|
"ls-pro-descriptions": "^3.0.1",
|
|
27
27
|
"ls-pro-card": "^3.0.3",
|