ztxkutils 2.9.0 → 2.9.3
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/fileOperation.d.ts +1 -0
- package/dist/fileOperation.js +14 -2
- package/dist/index.js +1 -1
- package/dist/{reqUrl-88fcc5c5.js → reqUrl-41d0836e.js} +1 -1
- package/dist/reqUrl.js +1 -1
- package/package.json +1 -1
- package/dist/tools-243bb17e.js +0 -297
- package/dist/tools-6422df68.js +0 -329
- package/dist/tools-aa1fafe4.js +0 -294
package/dist/fileOperation.d.ts
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
interface IOtherOption {
|
9
9
|
authToken?: string;
|
10
10
|
callbackAfter?: () => void;
|
11
|
+
callbackError?: () => void;
|
11
12
|
}
|
12
13
|
export declare function downloadFile(apiUrl: string, fileId: string, fileName: string, authToken?: string): void;
|
13
14
|
export declare function downloadFileCallBack(apiUrl: string, fileId: string, fileName: string, otherOption?: IOtherOption): void;
|
package/dist/fileOperation.js
CHANGED
@@ -33,7 +33,7 @@ function downloadFile(apiUrl, fileId, fileName, authToken) {
|
|
33
33
|
xhr.send();
|
34
34
|
}
|
35
35
|
function downloadFileCallBack(apiUrl, fileId, fileName, otherOption) {
|
36
|
-
var _a = otherOption || {}, authToken = _a.authToken, callbackAfter = _a.callbackAfter;
|
36
|
+
var _a = otherOption || {}, authToken = _a.authToken, callbackAfter = _a.callbackAfter, callbackError = _a.callbackError;
|
37
37
|
var xhr = new XMLHttpRequest();
|
38
38
|
var token = getToken() || authToken;
|
39
39
|
var _apiUrl = apiUrl.endsWith('/')
|
@@ -55,6 +55,12 @@ function downloadFileCallBack(apiUrl, fileId, fileName, otherOption) {
|
|
55
55
|
window.URL.revokeObjectURL(link.href);
|
56
56
|
callbackAfter && callbackAfter();
|
57
57
|
}
|
58
|
+
else {
|
59
|
+
callbackError && callbackError();
|
60
|
+
}
|
61
|
+
};
|
62
|
+
xhr.onerror = function (err) {
|
63
|
+
callbackError && callbackError();
|
58
64
|
};
|
59
65
|
xhr.send();
|
60
66
|
}
|
@@ -65,7 +71,7 @@ function downloadFileCallBack(apiUrl, fileId, fileName, otherOption) {
|
|
65
71
|
* @param {string} fileName 文件名
|
66
72
|
*/
|
67
73
|
function downloadPublicFile(apiUrl, fileId, fileName, otherOption) {
|
68
|
-
var
|
74
|
+
var _a = otherOption || {}, callbackAfter = _a.callbackAfter, callbackError = _a.callbackError;
|
69
75
|
var xhr = new XMLHttpRequest();
|
70
76
|
var _apiUrl = apiUrl.endsWith('/')
|
71
77
|
? apiUrl.slice(0, apiUrl.length - 1)
|
@@ -86,6 +92,12 @@ function downloadPublicFile(apiUrl, fileId, fileName, otherOption) {
|
|
86
92
|
window.URL.revokeObjectURL(link.href);
|
87
93
|
callbackAfter && callbackAfter();
|
88
94
|
}
|
95
|
+
else {
|
96
|
+
callbackError && callbackError();
|
97
|
+
}
|
98
|
+
};
|
99
|
+
xhr.onerror = function (err) {
|
100
|
+
callbackError && callbackError();
|
89
101
|
};
|
90
102
|
xhr.send();
|
91
103
|
}
|
package/dist/index.js
CHANGED
@@ -3,7 +3,7 @@ export { d as dataModel } from './dataModel-1fbaff40.js';
|
|
3
3
|
export { t as tools } from './tools-1e6fe951.js';
|
4
4
|
export { v as validate } from './validate-3e15dd74.js';
|
5
5
|
export { r as request } from './request-09b081d4.js';
|
6
|
-
export { r as reqUrl } from './reqUrl-
|
6
|
+
export { r as reqUrl } from './reqUrl-41d0836e.js';
|
7
7
|
import './tslib.es6-f9459658.js';
|
8
8
|
import 'dayjs';
|
9
9
|
import 'number-precision';
|
@@ -14,7 +14,7 @@ function getReqUrl(processObj) {
|
|
14
14
|
var ZT_FILE_PREVIEW_DEV = processObj.REACT_APP_ZT_FILE_PREVIEW_DEV || 'http://192.168.0.83:88'; // 开发环境
|
15
15
|
var ZT_FILE_PREVIEW_TEST = processObj.REACT_APP_ZT_FILE_PREVIEW_TEST || 'http://172.55.5.101:33013'; // 测试环境 https://192.168.0.135:18012
|
16
16
|
var ZT_FILE_PREVIEW_STAGE = processObj.REACT_APP_ZT_FILE_PREVIEW_STAGE ||
|
17
|
-
'
|
17
|
+
'https://dzfile-prod.zmd.com.cn/'; // 阶段性环境 http://192.168.0.134:8012
|
18
18
|
var ZT_FILE_PREVIEW_PRODUCT = processObj.REACT_APP_ZT_FILE_PREVIEW_PRODUCT ||
|
19
19
|
'https://dzfile.zmd.com.cn:8012'; // 生产环境
|
20
20
|
// 字体文件附件id
|
package/dist/reqUrl.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export { g as getReqUrl } from './reqUrl-
|
1
|
+
export { g as getReqUrl } from './reqUrl-41d0836e.js';
|
package/package.json
CHANGED
package/dist/tools-243bb17e.js
DELETED
@@ -1,297 +0,0 @@
|
|
1
|
-
import { _ as __assign, a as __spreadArray } from './tslib.es6-f9459658.js';
|
2
|
-
import dayjs from 'dayjs';
|
3
|
-
import { divide as divide$1, round, plus, minus, times } from 'number-precision';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @description 时间格式转换
|
7
|
-
*/
|
8
|
-
function timeTransfrom(timeParams) {
|
9
|
-
var _a, _b, _c, _d, _e;
|
10
|
-
var params = timeParams.params, fromKey = timeParams.fromKey, toKey = timeParams.toKey, _f = timeParams.type, type = _f === void 0 ? 'string' : _f, format = timeParams.format;
|
11
|
-
var copyParams = __assign({}, params);
|
12
|
-
for (var i = 0; i < fromKey.length; i++) {
|
13
|
-
var fromKeyItem = fromKey[i];
|
14
|
-
var toKeyItem = toKey[i];
|
15
|
-
var formatItem = Array.isArray(format)
|
16
|
-
? format[i]
|
17
|
-
? format[i]
|
18
|
-
: 'YYYY-MM-DD'
|
19
|
-
: format
|
20
|
-
? format
|
21
|
-
: 'YYYY-MM-DD';
|
22
|
-
// 从一个键转换成两个键
|
23
|
-
if (typeof fromKeyItem === 'string' && typeof toKeyItem === 'object') {
|
24
|
-
if (type === 'string' && copyParams[fromKeyItem]) {
|
25
|
-
var _g = copyParams[fromKeyItem], startMoment = _g[0], endMoment = _g[1];
|
26
|
-
var start = void 0, end = void 0;
|
27
|
-
if (dayjs.isDayjs(startMoment)) {
|
28
|
-
start = startMoment.format(formatItem);
|
29
|
-
}
|
30
|
-
if (dayjs.isDayjs(endMoment)) {
|
31
|
-
end = endMoment.format(formatItem);
|
32
|
-
}
|
33
|
-
if (formatItem === 'YYYY-MM-DD HH:mm:ss') {
|
34
|
-
start = start.substr(0, 10) + ' 00:00:00';
|
35
|
-
end = end.substr(0, 10) + ' 23:59:59';
|
36
|
-
}
|
37
|
-
delete copyParams[fromKeyItem];
|
38
|
-
copyParams = __assign(__assign({}, copyParams), (_a = {}, _a[toKeyItem[0]] = start, _a[toKeyItem[1]] = end, _a));
|
39
|
-
}
|
40
|
-
else {
|
41
|
-
copyParams = __assign(__assign({}, copyParams), (_b = {}, _b[toKeyItem[0]] = undefined, _b[toKeyItem[1]] = undefined, _b));
|
42
|
-
}
|
43
|
-
}
|
44
|
-
// 从一个键转换成一个键
|
45
|
-
if (typeof fromKeyItem === 'string' && typeof toKeyItem === 'string') {
|
46
|
-
if (type === 'string') {
|
47
|
-
var _dayjsObj = copyParams[fromKeyItem];
|
48
|
-
var start = void 0;
|
49
|
-
if (dayjs.isDayjs(_dayjsObj)) {
|
50
|
-
start = _dayjsObj.format(formatItem);
|
51
|
-
}
|
52
|
-
if (formatItem === 'startTime') {
|
53
|
-
start = start.substr(0, 10) + ' 00:00:00';
|
54
|
-
}
|
55
|
-
if (formatItem === 'endTime') {
|
56
|
-
start = start.substr(0, 10) + ' 23:59:59';
|
57
|
-
}
|
58
|
-
delete copyParams[fromKeyItem];
|
59
|
-
copyParams = __assign(__assign({}, copyParams), (_c = {}, _c[toKeyItem] = start, _c));
|
60
|
-
}
|
61
|
-
if (type === 'object') {
|
62
|
-
var start = copyParams[fromKeyItem]
|
63
|
-
? dayjs(copyParams[fromKeyItem])
|
64
|
-
: undefined;
|
65
|
-
delete copyParams[fromKeyItem];
|
66
|
-
copyParams = __assign(__assign({}, copyParams), (_d = {}, _d[toKeyItem] = start, _d));
|
67
|
-
}
|
68
|
-
}
|
69
|
-
// 从两个键转换成一个键
|
70
|
-
if (typeof fromKeyItem === 'object' && typeof toKeyItem === 'string') {
|
71
|
-
if (type === 'object') {
|
72
|
-
var startMoment = fromKeyItem[0], endMoment = fromKeyItem[1];
|
73
|
-
var intime = copyParams[toKeyItem] || [null, null];
|
74
|
-
if (copyParams[startMoment]) {
|
75
|
-
intime[0] = dayjs(copyParams[startMoment]);
|
76
|
-
delete copyParams[startMoment];
|
77
|
-
}
|
78
|
-
if (copyParams[endMoment]) {
|
79
|
-
intime[1] = dayjs(copyParams[endMoment]);
|
80
|
-
delete copyParams[endMoment];
|
81
|
-
}
|
82
|
-
if (intime[0] == null || intime[1] == null) {
|
83
|
-
intime = null;
|
84
|
-
}
|
85
|
-
copyParams = __assign(__assign({}, copyParams), (_e = {}, _e[toKeyItem] = intime, _e));
|
86
|
-
}
|
87
|
-
}
|
88
|
-
}
|
89
|
-
return copyParams;
|
90
|
-
}
|
91
|
-
function divide(num1, num2) {
|
92
|
-
var others = [];
|
93
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
94
|
-
others[_i - 2] = arguments[_i];
|
95
|
-
}
|
96
|
-
try {
|
97
|
-
return divide$1.apply(void 0, __spreadArray([num1, num2], others));
|
98
|
-
}
|
99
|
-
catch (err) {
|
100
|
-
console.log(err);
|
101
|
-
return 0;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
/**
|
105
|
-
* @description 精确四舍五入后保留几位小数
|
106
|
-
*/
|
107
|
-
function exactRound(num, ratio) {
|
108
|
-
var typeNum = typeof num;
|
109
|
-
if (typeNum !== 'number' && typeNum !== 'string') {
|
110
|
-
return num;
|
111
|
-
}
|
112
|
-
try {
|
113
|
-
return round(num, ratio).toFixed(ratio);
|
114
|
-
}
|
115
|
-
catch (err) {
|
116
|
-
console.error(err);
|
117
|
-
return num;
|
118
|
-
}
|
119
|
-
}
|
120
|
-
/**
|
121
|
-
* @description 添加千分符符号
|
122
|
-
*/
|
123
|
-
function toThousand(num) {
|
124
|
-
var typeNum = typeof num;
|
125
|
-
if (typeNum !== 'number' && typeNum !== 'string') {
|
126
|
-
return num;
|
127
|
-
}
|
128
|
-
var str = (num + '').replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, '$1,');
|
129
|
-
return str;
|
130
|
-
}
|
131
|
-
/**
|
132
|
-
* @description 去除指定字符串
|
133
|
-
*/
|
134
|
-
function clearAssignStr(str, originalStr) {
|
135
|
-
if (!originalStr) {
|
136
|
-
return originalStr;
|
137
|
-
}
|
138
|
-
if (originalStr.startsWith(str)) {
|
139
|
-
return originalStr.replace(str, '');
|
140
|
-
}
|
141
|
-
return originalStr;
|
142
|
-
}
|
143
|
-
/**
|
144
|
-
* @description 下载重命名
|
145
|
-
*/
|
146
|
-
function loadFileRename(fileUrl, fileName) {
|
147
|
-
var xhr = new XMLHttpRequest();
|
148
|
-
xhr.open('GET', fileUrl, true);
|
149
|
-
xhr.responseType = 'blob';
|
150
|
-
xhr.onload = function () {
|
151
|
-
if (xhr.status === 200) {
|
152
|
-
var link = document.createElement('a');
|
153
|
-
var body = document.querySelector('body');
|
154
|
-
link.href = window.URL.createObjectURL(xhr.response);
|
155
|
-
link.download = fileName;
|
156
|
-
// fix Firefox
|
157
|
-
link.style.display = 'none';
|
158
|
-
body.appendChild(link);
|
159
|
-
link.click();
|
160
|
-
body.removeChild(link);
|
161
|
-
window.URL.revokeObjectURL(link.href);
|
162
|
-
}
|
163
|
-
};
|
164
|
-
xhr.send();
|
165
|
-
}
|
166
|
-
/**
|
167
|
-
* @description 文件大小提示转换
|
168
|
-
*/
|
169
|
-
function transformFileSize(value) {
|
170
|
-
if (value < 1024) {
|
171
|
-
return round(value, 2).toFixed(2) + 'B';
|
172
|
-
}
|
173
|
-
else if (value < 1024 * 1024) {
|
174
|
-
return round(divide(value, 1024), 2).toFixed(2) + 'KB';
|
175
|
-
}
|
176
|
-
return round(divide(value, 1024, 1024), 2).toFixed(2) + 'MB';
|
177
|
-
}
|
178
|
-
/**
|
179
|
-
* @description 更具key判断前后值是否一致
|
180
|
-
*/
|
181
|
-
function isEqualByKey(keys, record, preRecord) {
|
182
|
-
var isEqual = false; // 是否相等
|
183
|
-
if (!record || !preRecord) {
|
184
|
-
isEqual = true;
|
185
|
-
return isEqual;
|
186
|
-
}
|
187
|
-
// 如果数据源相同的话,那么判断是初次更改,应该更新
|
188
|
-
if (record === preRecord) {
|
189
|
-
isEqual = true;
|
190
|
-
return isEqual;
|
191
|
-
}
|
192
|
-
for (var i = 0; i < keys.length; i++) {
|
193
|
-
var key = keys[i];
|
194
|
-
if (record[key] !== preRecord[key]) {
|
195
|
-
isEqual = true;
|
196
|
-
break;
|
197
|
-
}
|
198
|
-
}
|
199
|
-
return isEqual;
|
200
|
-
}
|
201
|
-
/**
|
202
|
-
* @description 判断是否显示框架
|
203
|
-
*/
|
204
|
-
var SHOWFRAME_KEY = 'showFrame';
|
205
|
-
function showFrame() {
|
206
|
-
var _a;
|
207
|
-
var search = (_a = window.location) === null || _a === void 0 ? void 0 : _a.search;
|
208
|
-
try {
|
209
|
-
if (search) {
|
210
|
-
var searchList = search.slice(1).split('&');
|
211
|
-
for (var i = 0; i < searchList.length; i++) {
|
212
|
-
var _b = searchList[i].split('='), key = _b[0], value = _b[1];
|
213
|
-
if (key === SHOWFRAME_KEY)
|
214
|
-
return false;
|
215
|
-
}
|
216
|
-
}
|
217
|
-
}
|
218
|
-
catch (err) {
|
219
|
-
return true;
|
220
|
-
}
|
221
|
-
return true;
|
222
|
-
}
|
223
|
-
/**
|
224
|
-
*
|
225
|
-
* @description 取地址栏参数
|
226
|
-
*/
|
227
|
-
function getUrlSearch() {
|
228
|
-
var _a;
|
229
|
-
var search = (_a = window.location) === null || _a === void 0 ? void 0 : _a.search;
|
230
|
-
var result = {};
|
231
|
-
try {
|
232
|
-
if (search) {
|
233
|
-
var searchList = search.slice(1).split('&');
|
234
|
-
for (var i = 0; i < searchList.length; i++) {
|
235
|
-
var _b = searchList[i].split('='), key = _b[0], value = _b[1];
|
236
|
-
result[key] = value;
|
237
|
-
}
|
238
|
-
}
|
239
|
-
}
|
240
|
-
catch (err) {
|
241
|
-
console.log(err);
|
242
|
-
}
|
243
|
-
return result;
|
244
|
-
}
|
245
|
-
/**
|
246
|
-
* @description 复制
|
247
|
-
*/
|
248
|
-
function copyContent(text) {
|
249
|
-
var textarea = document.createElement('textarea');
|
250
|
-
textarea.setAttribute('readonly', 'readonly');
|
251
|
-
textarea.value = text;
|
252
|
-
document.body.appendChild(textarea);
|
253
|
-
textarea.select();
|
254
|
-
document === null || document === void 0 ? void 0 : document.execCommand('copy');
|
255
|
-
document.body.removeChild(textarea);
|
256
|
-
}
|
257
|
-
/**
|
258
|
-
* @author 陈亚雄
|
259
|
-
* @description 处理转义字符
|
260
|
-
*/
|
261
|
-
function dangerouslySetXss(str) {
|
262
|
-
var _a;
|
263
|
-
if (!str) {
|
264
|
-
return str;
|
265
|
-
}
|
266
|
-
try {
|
267
|
-
var arrEntities_1 = { lt: '', gt: '', nbsp: ' ', amp: '&', quot: '"' };
|
268
|
-
return (_a = str === null || str === void 0 ? void 0 : str.replace) === null || _a === void 0 ? void 0 : _a.call(str, /&(lt|gt|nbsp|amp|quot);/gi, function (all, t) {
|
269
|
-
return arrEntities_1[t];
|
270
|
-
});
|
271
|
-
}
|
272
|
-
catch (err) {
|
273
|
-
return str;
|
274
|
-
}
|
275
|
-
}
|
276
|
-
|
277
|
-
var tools = /*#__PURE__*/Object.freeze({
|
278
|
-
__proto__: null,
|
279
|
-
timeTransfrom: timeTransfrom,
|
280
|
-
plus: plus,
|
281
|
-
minus: minus,
|
282
|
-
times: times,
|
283
|
-
divide: divide,
|
284
|
-
exactRound: exactRound,
|
285
|
-
toThousand: toThousand,
|
286
|
-
clearAssignStr: clearAssignStr,
|
287
|
-
loadFileRename: loadFileRename,
|
288
|
-
transformFileSize: transformFileSize,
|
289
|
-
isEqualByKey: isEqualByKey,
|
290
|
-
SHOWFRAME_KEY: SHOWFRAME_KEY,
|
291
|
-
showFrame: showFrame,
|
292
|
-
getUrlSearch: getUrlSearch,
|
293
|
-
copyContent: copyContent,
|
294
|
-
dangerouslySetXss: dangerouslySetXss
|
295
|
-
});
|
296
|
-
|
297
|
-
export { SHOWFRAME_KEY as S, timeTransfrom as a, divide as b, toThousand as c, dangerouslySetXss as d, exactRound as e, clearAssignStr as f, getUrlSearch as g, transformFileSize as h, isEqualByKey as i, copyContent as j, loadFileRename as l, showFrame as s, tools as t };
|
package/dist/tools-6422df68.js
DELETED
@@ -1,329 +0,0 @@
|
|
1
|
-
import { _ as __assign, a as __spreadArray } from './tslib.es6-f9459658.js';
|
2
|
-
import dayjs from 'dayjs';
|
3
|
-
import { divide as divide$1, round, plus, minus, times } from 'number-precision';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @description 时间格式转换
|
7
|
-
*/
|
8
|
-
function timeTransfrom(timeParams) {
|
9
|
-
var _a, _b, _c, _d, _e;
|
10
|
-
var params = timeParams.params, fromKey = timeParams.fromKey, toKey = timeParams.toKey, _f = timeParams.type, type = _f === void 0 ? 'string' : _f, format = timeParams.format;
|
11
|
-
var copyParams = __assign({}, params);
|
12
|
-
for (var i = 0; i < fromKey.length; i++) {
|
13
|
-
var fromKeyItem = fromKey[i];
|
14
|
-
var toKeyItem = toKey[i];
|
15
|
-
var formatItem = Array.isArray(format)
|
16
|
-
? format[i]
|
17
|
-
? format[i]
|
18
|
-
: 'YYYY-MM-DD'
|
19
|
-
: format
|
20
|
-
? format
|
21
|
-
: 'YYYY-MM-DD';
|
22
|
-
// 从一个键转换成两个键
|
23
|
-
if (typeof fromKeyItem === 'string' && typeof toKeyItem === 'object') {
|
24
|
-
if (type === 'string' && copyParams[fromKeyItem]) {
|
25
|
-
var _g = copyParams[fromKeyItem], startMoment = _g[0], endMoment = _g[1];
|
26
|
-
var start = void 0, end = void 0;
|
27
|
-
if (dayjs.isDayjs(startMoment)) {
|
28
|
-
start = startMoment.format(formatItem);
|
29
|
-
}
|
30
|
-
if (dayjs.isDayjs(endMoment)) {
|
31
|
-
end = endMoment.format(formatItem);
|
32
|
-
}
|
33
|
-
if (formatItem === 'YYYY-MM-DD HH:mm:ss') {
|
34
|
-
start = start.substr(0, 10) + ' 00:00:00';
|
35
|
-
end = end.substr(0, 10) + ' 23:59:59';
|
36
|
-
}
|
37
|
-
delete copyParams[fromKeyItem];
|
38
|
-
copyParams = __assign(__assign({}, copyParams), (_a = {}, _a[toKeyItem[0]] = start, _a[toKeyItem[1]] = end, _a));
|
39
|
-
}
|
40
|
-
else {
|
41
|
-
copyParams = __assign(__assign({}, copyParams), (_b = {}, _b[toKeyItem[0]] = undefined, _b[toKeyItem[1]] = undefined, _b));
|
42
|
-
}
|
43
|
-
}
|
44
|
-
// 从一个键转换成一个键
|
45
|
-
if (typeof fromKeyItem === 'string' && typeof toKeyItem === 'string') {
|
46
|
-
if (type === 'string') {
|
47
|
-
var _dayjsObj = copyParams[fromKeyItem];
|
48
|
-
var start = void 0;
|
49
|
-
if (dayjs.isDayjs(_dayjsObj)) {
|
50
|
-
start = _dayjsObj.format(formatItem);
|
51
|
-
}
|
52
|
-
if (formatItem === 'startTime') {
|
53
|
-
start = start.substr(0, 10) + ' 00:00:00';
|
54
|
-
}
|
55
|
-
if (formatItem === 'endTime') {
|
56
|
-
start = start.substr(0, 10) + ' 23:59:59';
|
57
|
-
}
|
58
|
-
delete copyParams[fromKeyItem];
|
59
|
-
copyParams = __assign(__assign({}, copyParams), (_c = {}, _c[toKeyItem] = start, _c));
|
60
|
-
}
|
61
|
-
if (type === 'object') {
|
62
|
-
var start = copyParams[fromKeyItem]
|
63
|
-
? dayjs(copyParams[fromKeyItem])
|
64
|
-
: undefined;
|
65
|
-
delete copyParams[fromKeyItem];
|
66
|
-
copyParams = __assign(__assign({}, copyParams), (_d = {}, _d[toKeyItem] = start, _d));
|
67
|
-
}
|
68
|
-
}
|
69
|
-
// 从两个键转换成一个键
|
70
|
-
if (typeof fromKeyItem === 'object' && typeof toKeyItem === 'string') {
|
71
|
-
if (type === 'object') {
|
72
|
-
var startMoment = fromKeyItem[0], endMoment = fromKeyItem[1];
|
73
|
-
var intime = copyParams[toKeyItem] || [null, null];
|
74
|
-
if (copyParams[startMoment]) {
|
75
|
-
intime[0] = dayjs(copyParams[startMoment]);
|
76
|
-
delete copyParams[startMoment];
|
77
|
-
}
|
78
|
-
if (copyParams[endMoment]) {
|
79
|
-
intime[1] = dayjs(copyParams[endMoment]);
|
80
|
-
delete copyParams[endMoment];
|
81
|
-
}
|
82
|
-
if (intime[0] == null || intime[1] == null) {
|
83
|
-
intime = null;
|
84
|
-
}
|
85
|
-
copyParams = __assign(__assign({}, copyParams), (_e = {}, _e[toKeyItem] = intime, _e));
|
86
|
-
}
|
87
|
-
}
|
88
|
-
}
|
89
|
-
return copyParams;
|
90
|
-
}
|
91
|
-
function divide(num1, num2) {
|
92
|
-
var others = [];
|
93
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
94
|
-
others[_i - 2] = arguments[_i];
|
95
|
-
}
|
96
|
-
try {
|
97
|
-
return divide$1.apply(void 0, __spreadArray([num1, num2], others));
|
98
|
-
}
|
99
|
-
catch (err) {
|
100
|
-
console.log(err);
|
101
|
-
return 0;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
/**
|
105
|
-
* @description 精确四舍五入后保留几位小数
|
106
|
-
*/
|
107
|
-
function exactRound(num, ratio) {
|
108
|
-
var typeNum = typeof num;
|
109
|
-
if (typeNum !== 'number' && typeNum !== 'string') {
|
110
|
-
return num;
|
111
|
-
}
|
112
|
-
try {
|
113
|
-
return round(num, ratio).toFixed(ratio);
|
114
|
-
}
|
115
|
-
catch (err) {
|
116
|
-
console.error(err);
|
117
|
-
return num;
|
118
|
-
}
|
119
|
-
}
|
120
|
-
/**
|
121
|
-
* @description 添加千分符符号
|
122
|
-
*/
|
123
|
-
// export function toThousand(num: number | string) {
|
124
|
-
// const typeNum = typeof num;
|
125
|
-
// if (typeNum !== 'number' && typeNum !== 'string') {
|
126
|
-
// return num;
|
127
|
-
// }
|
128
|
-
// let str = (num + '').replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, '$1,');
|
129
|
-
// return str;
|
130
|
-
// }
|
131
|
-
function toThousand(n) {
|
132
|
-
if (n != null) {
|
133
|
-
var _n = n.toString();
|
134
|
-
var pointIndex = _n.indexOf('.');
|
135
|
-
var pointAfterNum = '';
|
136
|
-
if (pointIndex !== -1) {
|
137
|
-
n = _n.slice(0, pointIndex);
|
138
|
-
pointAfterNum = _n.slice(pointIndex);
|
139
|
-
}
|
140
|
-
var res = '';
|
141
|
-
var s = n.toString();
|
142
|
-
var length_1 = s.length;
|
143
|
-
for (var i = length_1 - 1; i >= 0; i--) {
|
144
|
-
var j = length_1 - i;
|
145
|
-
if (j % 3 === 0) {
|
146
|
-
if (i === 0) {
|
147
|
-
res = s[i] + res;
|
148
|
-
}
|
149
|
-
else {
|
150
|
-
res = ',' + s[i] + res;
|
151
|
-
}
|
152
|
-
}
|
153
|
-
else {
|
154
|
-
res = s[i] + res;
|
155
|
-
}
|
156
|
-
}
|
157
|
-
return res + pointAfterNum;
|
158
|
-
}
|
159
|
-
else {
|
160
|
-
return n;
|
161
|
-
}
|
162
|
-
}
|
163
|
-
/**
|
164
|
-
* @description 去除指定字符串
|
165
|
-
*/
|
166
|
-
function clearAssignStr(str, originalStr) {
|
167
|
-
if (!originalStr) {
|
168
|
-
return originalStr;
|
169
|
-
}
|
170
|
-
if (originalStr.startsWith(str)) {
|
171
|
-
return originalStr.replace(str, '');
|
172
|
-
}
|
173
|
-
return originalStr;
|
174
|
-
}
|
175
|
-
/**
|
176
|
-
* @description 下载重命名
|
177
|
-
*/
|
178
|
-
function loadFileRename(fileUrl, fileName) {
|
179
|
-
var xhr = new XMLHttpRequest();
|
180
|
-
xhr.open('GET', fileUrl, true);
|
181
|
-
xhr.responseType = 'blob';
|
182
|
-
xhr.onload = function () {
|
183
|
-
if (xhr.status === 200) {
|
184
|
-
var link = document.createElement('a');
|
185
|
-
var body = document.querySelector('body');
|
186
|
-
link.href = window.URL.createObjectURL(xhr.response);
|
187
|
-
link.download = fileName;
|
188
|
-
// fix Firefox
|
189
|
-
link.style.display = 'none';
|
190
|
-
body.appendChild(link);
|
191
|
-
link.click();
|
192
|
-
body.removeChild(link);
|
193
|
-
window.URL.revokeObjectURL(link.href);
|
194
|
-
}
|
195
|
-
};
|
196
|
-
xhr.send();
|
197
|
-
}
|
198
|
-
/**
|
199
|
-
* @description 文件大小提示转换
|
200
|
-
*/
|
201
|
-
function transformFileSize(value) {
|
202
|
-
if (value < 1024) {
|
203
|
-
return round(value, 2).toFixed(2) + 'B';
|
204
|
-
}
|
205
|
-
else if (value < 1024 * 1024) {
|
206
|
-
return round(divide(value, 1024), 2).toFixed(2) + 'KB';
|
207
|
-
}
|
208
|
-
return round(divide(value, 1024, 1024), 2).toFixed(2) + 'MB';
|
209
|
-
}
|
210
|
-
/**
|
211
|
-
* @description 更具key判断前后值是否一致
|
212
|
-
*/
|
213
|
-
function isEqualByKey(keys, record, preRecord) {
|
214
|
-
var isEqual = false; // 是否相等
|
215
|
-
if (!record || !preRecord) {
|
216
|
-
isEqual = true;
|
217
|
-
return isEqual;
|
218
|
-
}
|
219
|
-
// 如果数据源相同的话,那么判断是初次更改,应该更新
|
220
|
-
if (record === preRecord) {
|
221
|
-
isEqual = true;
|
222
|
-
return isEqual;
|
223
|
-
}
|
224
|
-
for (var i = 0; i < keys.length; i++) {
|
225
|
-
var key = keys[i];
|
226
|
-
if (record[key] !== preRecord[key]) {
|
227
|
-
isEqual = true;
|
228
|
-
break;
|
229
|
-
}
|
230
|
-
}
|
231
|
-
return isEqual;
|
232
|
-
}
|
233
|
-
/**
|
234
|
-
* @description 判断是否显示框架
|
235
|
-
*/
|
236
|
-
var SHOWFRAME_KEY = 'showFrame';
|
237
|
-
function showFrame() {
|
238
|
-
var _a;
|
239
|
-
var search = (_a = window.location) === null || _a === void 0 ? void 0 : _a.search;
|
240
|
-
try {
|
241
|
-
if (search) {
|
242
|
-
var searchList = search.slice(1).split('&');
|
243
|
-
for (var i = 0; i < searchList.length; i++) {
|
244
|
-
var _b = searchList[i].split('='), key = _b[0], value = _b[1];
|
245
|
-
if (key === SHOWFRAME_KEY)
|
246
|
-
return false;
|
247
|
-
}
|
248
|
-
}
|
249
|
-
}
|
250
|
-
catch (err) {
|
251
|
-
return true;
|
252
|
-
}
|
253
|
-
return true;
|
254
|
-
}
|
255
|
-
/**
|
256
|
-
*
|
257
|
-
* @description 取地址栏参数
|
258
|
-
*/
|
259
|
-
function getUrlSearch() {
|
260
|
-
var _a;
|
261
|
-
var search = (_a = window.location) === null || _a === void 0 ? void 0 : _a.search;
|
262
|
-
var result = {};
|
263
|
-
try {
|
264
|
-
if (search) {
|
265
|
-
var searchList = search.slice(1).split('&');
|
266
|
-
for (var i = 0; i < searchList.length; i++) {
|
267
|
-
var _b = searchList[i].split('='), key = _b[0], value = _b[1];
|
268
|
-
result[key] = value;
|
269
|
-
}
|
270
|
-
}
|
271
|
-
}
|
272
|
-
catch (err) {
|
273
|
-
console.log(err);
|
274
|
-
}
|
275
|
-
return result;
|
276
|
-
}
|
277
|
-
/**
|
278
|
-
* @description 复制
|
279
|
-
*/
|
280
|
-
function copyContent(text) {
|
281
|
-
var textarea = document.createElement('textarea');
|
282
|
-
textarea.setAttribute('readonly', 'readonly');
|
283
|
-
textarea.value = text;
|
284
|
-
document.body.appendChild(textarea);
|
285
|
-
textarea.select();
|
286
|
-
document === null || document === void 0 ? void 0 : document.execCommand('copy');
|
287
|
-
document.body.removeChild(textarea);
|
288
|
-
}
|
289
|
-
/**
|
290
|
-
* @author 陈亚雄
|
291
|
-
* @description 处理转义字符
|
292
|
-
*/
|
293
|
-
function dangerouslySetXss(str) {
|
294
|
-
var _a;
|
295
|
-
if (!str) {
|
296
|
-
return str;
|
297
|
-
}
|
298
|
-
try {
|
299
|
-
var arrEntities_1 = { lt: '', gt: '', nbsp: ' ', amp: '&', quot: '"' };
|
300
|
-
return (_a = str === null || str === void 0 ? void 0 : str.replace) === null || _a === void 0 ? void 0 : _a.call(str, /&(lt|gt|nbsp|amp|quot);/gi, function (all, t) {
|
301
|
-
return arrEntities_1[t];
|
302
|
-
});
|
303
|
-
}
|
304
|
-
catch (err) {
|
305
|
-
return str;
|
306
|
-
}
|
307
|
-
}
|
308
|
-
|
309
|
-
var tools = /*#__PURE__*/Object.freeze({
|
310
|
-
__proto__: null,
|
311
|
-
timeTransfrom: timeTransfrom,
|
312
|
-
plus: plus,
|
313
|
-
minus: minus,
|
314
|
-
times: times,
|
315
|
-
divide: divide,
|
316
|
-
exactRound: exactRound,
|
317
|
-
toThousand: toThousand,
|
318
|
-
clearAssignStr: clearAssignStr,
|
319
|
-
loadFileRename: loadFileRename,
|
320
|
-
transformFileSize: transformFileSize,
|
321
|
-
isEqualByKey: isEqualByKey,
|
322
|
-
SHOWFRAME_KEY: SHOWFRAME_KEY,
|
323
|
-
showFrame: showFrame,
|
324
|
-
getUrlSearch: getUrlSearch,
|
325
|
-
copyContent: copyContent,
|
326
|
-
dangerouslySetXss: dangerouslySetXss
|
327
|
-
});
|
328
|
-
|
329
|
-
export { SHOWFRAME_KEY as S, timeTransfrom as a, divide as b, toThousand as c, dangerouslySetXss as d, exactRound as e, clearAssignStr as f, getUrlSearch as g, transformFileSize as h, isEqualByKey as i, copyContent as j, loadFileRename as l, showFrame as s, tools as t };
|
package/dist/tools-aa1fafe4.js
DELETED
@@ -1,294 +0,0 @@
|
|
1
|
-
import { _ as __assign, a as __spreadArray } from './tslib.es6-f9459658.js';
|
2
|
-
import dayjs from 'dayjs';
|
3
|
-
import { divide as divide$1, round, plus, minus, times } from 'number-precision';
|
4
|
-
|
5
|
-
/**
|
6
|
-
* @description 时间格式转换
|
7
|
-
*/
|
8
|
-
function timeTransfrom(timeParams) {
|
9
|
-
var _a, _b, _c, _d, _e;
|
10
|
-
var params = timeParams.params, fromKey = timeParams.fromKey, toKey = timeParams.toKey, _f = timeParams.type, type = _f === void 0 ? 'string' : _f, format = timeParams.format;
|
11
|
-
var copyParams = __assign({}, params);
|
12
|
-
for (var i = 0; i < fromKey.length; i++) {
|
13
|
-
var fromKeyItem = fromKey[i];
|
14
|
-
var toKeyItem = toKey[i];
|
15
|
-
var formatItem = Array.isArray(format)
|
16
|
-
? format[i]
|
17
|
-
? format[i]
|
18
|
-
: 'YYYY-MM-DD'
|
19
|
-
: format
|
20
|
-
? format
|
21
|
-
: 'YYYY-MM-DD';
|
22
|
-
// 从一个键转换成两个键
|
23
|
-
if (typeof fromKeyItem === 'string' && typeof toKeyItem === 'object') {
|
24
|
-
if (type === 'string' && copyParams[fromKeyItem]) {
|
25
|
-
var _g = copyParams[fromKeyItem], startMoment = _g[0], endMoment = _g[1];
|
26
|
-
var start = void 0, end = void 0;
|
27
|
-
if (dayjs.isDayjs(startMoment)) {
|
28
|
-
start = startMoment.format(formatItem);
|
29
|
-
}
|
30
|
-
if (dayjs.isDayjs(endMoment)) {
|
31
|
-
end = endMoment.format(formatItem);
|
32
|
-
}
|
33
|
-
if (formatItem === 'YYYY-MM-DD HH:mm:ss') {
|
34
|
-
start = start.substr(0, 10) + ' 00:00:00';
|
35
|
-
end = end.substr(0, 10) + ' 23:59:59';
|
36
|
-
}
|
37
|
-
delete copyParams[fromKeyItem];
|
38
|
-
copyParams = __assign(__assign({}, copyParams), (_a = {}, _a[toKeyItem[0]] = start, _a[toKeyItem[1]] = end, _a));
|
39
|
-
}
|
40
|
-
else {
|
41
|
-
copyParams = __assign(__assign({}, copyParams), (_b = {}, _b[toKeyItem[0]] = undefined, _b[toKeyItem[1]] = undefined, _b));
|
42
|
-
}
|
43
|
-
}
|
44
|
-
// 从一个键转换成一个键
|
45
|
-
if (typeof fromKeyItem === 'string' && typeof toKeyItem === 'string') {
|
46
|
-
if (type === 'string') {
|
47
|
-
var _dayjsObj = copyParams[fromKeyItem];
|
48
|
-
var start = void 0;
|
49
|
-
if (dayjs.isDayjs(_dayjsObj)) {
|
50
|
-
start = _dayjsObj.format(formatItem);
|
51
|
-
}
|
52
|
-
if (formatItem === 'startTime') {
|
53
|
-
start = start.substr(0, 10) + ' 00:00:00';
|
54
|
-
}
|
55
|
-
if (formatItem === 'endTime') {
|
56
|
-
start = start.substr(0, 10) + ' 23:59:59';
|
57
|
-
}
|
58
|
-
delete copyParams[fromKeyItem];
|
59
|
-
copyParams = __assign(__assign({}, copyParams), (_c = {}, _c[toKeyItem] = start, _c));
|
60
|
-
}
|
61
|
-
if (type === 'object') {
|
62
|
-
var start = copyParams[fromKeyItem]
|
63
|
-
? dayjs(copyParams[fromKeyItem])
|
64
|
-
: undefined;
|
65
|
-
delete copyParams[fromKeyItem];
|
66
|
-
copyParams = __assign(__assign({}, copyParams), (_d = {}, _d[toKeyItem] = start, _d));
|
67
|
-
}
|
68
|
-
}
|
69
|
-
// 从两个键转换成一个键
|
70
|
-
if (typeof fromKeyItem === 'object' && typeof toKeyItem === 'string') {
|
71
|
-
if (type === 'object') {
|
72
|
-
var startMoment = fromKeyItem[0], endMoment = fromKeyItem[1];
|
73
|
-
var intime = copyParams[toKeyItem] || [null, null];
|
74
|
-
if (copyParams[startMoment]) {
|
75
|
-
intime[0] = dayjs(copyParams[startMoment]);
|
76
|
-
delete copyParams[startMoment];
|
77
|
-
}
|
78
|
-
if (copyParams[endMoment]) {
|
79
|
-
intime[1] = dayjs(copyParams[endMoment]);
|
80
|
-
delete copyParams[endMoment];
|
81
|
-
}
|
82
|
-
if (intime[0] == null || intime[1] == null) {
|
83
|
-
intime = null;
|
84
|
-
}
|
85
|
-
copyParams = __assign(__assign({}, copyParams), (_e = {}, _e[toKeyItem] = intime, _e));
|
86
|
-
}
|
87
|
-
}
|
88
|
-
}
|
89
|
-
return copyParams;
|
90
|
-
}
|
91
|
-
function divide(num1, num2) {
|
92
|
-
var others = [];
|
93
|
-
for (var _i = 2; _i < arguments.length; _i++) {
|
94
|
-
others[_i - 2] = arguments[_i];
|
95
|
-
}
|
96
|
-
try {
|
97
|
-
return divide$1.apply(void 0, __spreadArray([num1, num2], others));
|
98
|
-
}
|
99
|
-
catch (err) {
|
100
|
-
console.log(err);
|
101
|
-
return 0;
|
102
|
-
}
|
103
|
-
}
|
104
|
-
/**
|
105
|
-
* @description 精确四舍五入后保留几位小数
|
106
|
-
*/
|
107
|
-
function exactRound(num, ratio) {
|
108
|
-
var typeNum = typeof num;
|
109
|
-
if (typeNum !== 'number' && typeNum !== 'string') {
|
110
|
-
return num;
|
111
|
-
}
|
112
|
-
try {
|
113
|
-
return round(num, ratio).toFixed(ratio);
|
114
|
-
}
|
115
|
-
catch (err) {
|
116
|
-
console.error(err);
|
117
|
-
return num;
|
118
|
-
}
|
119
|
-
}
|
120
|
-
/**
|
121
|
-
* @description 添加千分符符号
|
122
|
-
*/
|
123
|
-
function toThousand(num) {
|
124
|
-
var typeNum = typeof num;
|
125
|
-
if (typeNum !== 'number' && typeNum !== 'string') {
|
126
|
-
return num;
|
127
|
-
}
|
128
|
-
var str = (num + '').replace(/(\d{1,3})(?=(\d{3})+(?:$|\.))/g, '$1,');
|
129
|
-
return str;
|
130
|
-
}
|
131
|
-
/**
|
132
|
-
* @description 去除指定字符串
|
133
|
-
*/
|
134
|
-
function clearAssignStr(str, originalStr) {
|
135
|
-
if (!originalStr) {
|
136
|
-
return originalStr;
|
137
|
-
}
|
138
|
-
if (originalStr.startsWith(str)) {
|
139
|
-
return originalStr.replace(str, '');
|
140
|
-
}
|
141
|
-
return originalStr;
|
142
|
-
}
|
143
|
-
/**
|
144
|
-
* @description 下载重命名
|
145
|
-
*/
|
146
|
-
function loadFileRename(fileUrl, fileName) {
|
147
|
-
var xhr = new XMLHttpRequest();
|
148
|
-
xhr.open('GET', fileUrl, true);
|
149
|
-
xhr.responseType = 'blob';
|
150
|
-
xhr.onload = function () {
|
151
|
-
if (xhr.status === 200) {
|
152
|
-
var link = document.createElement('a');
|
153
|
-
var body = document.querySelector('body');
|
154
|
-
link.href = window.URL.createObjectURL(xhr.response);
|
155
|
-
link.download = fileName;
|
156
|
-
// fix Firefox
|
157
|
-
link.style.display = 'none';
|
158
|
-
body.appendChild(link);
|
159
|
-
link.click();
|
160
|
-
body.removeChild(link);
|
161
|
-
window.URL.revokeObjectURL(link.href);
|
162
|
-
}
|
163
|
-
};
|
164
|
-
xhr.send();
|
165
|
-
}
|
166
|
-
/**
|
167
|
-
* @description 文件大小提示转换
|
168
|
-
*/
|
169
|
-
function transformFileSize(value) {
|
170
|
-
if (value < 1024) {
|
171
|
-
return round(value, 2).toFixed(2) + 'B';
|
172
|
-
}
|
173
|
-
else if (value < 1024 * 1024) {
|
174
|
-
return round(divide(value, 1024), 2).toFixed(2) + 'KB';
|
175
|
-
}
|
176
|
-
return round(divide(value, 1024, 1024), 2).toFixed(2) + 'MB';
|
177
|
-
}
|
178
|
-
/**
|
179
|
-
* @description 更具key判断前后值是否一致
|
180
|
-
*/
|
181
|
-
function isEqualByKey(keys, record, preRecord) {
|
182
|
-
var isEqual = false; // 是否相等
|
183
|
-
if (!record || !preRecord) {
|
184
|
-
isEqual = true;
|
185
|
-
return isEqual;
|
186
|
-
}
|
187
|
-
// 如果数据源相同的话,那么判断是初次更改,应该更新
|
188
|
-
if (record === preRecord) {
|
189
|
-
isEqual = true;
|
190
|
-
return isEqual;
|
191
|
-
}
|
192
|
-
for (var i = 0; i < keys.length; i++) {
|
193
|
-
var key = keys[i];
|
194
|
-
if (record[key] !== preRecord[key]) {
|
195
|
-
isEqual = true;
|
196
|
-
break;
|
197
|
-
}
|
198
|
-
}
|
199
|
-
return isEqual;
|
200
|
-
}
|
201
|
-
/**
|
202
|
-
* @description 判断是否显示框架
|
203
|
-
*/
|
204
|
-
var SHOWFRAME_KEY = 'showFrame';
|
205
|
-
function showFrame() {
|
206
|
-
var _a;
|
207
|
-
var search = (_a = window.location) === null || _a === void 0 ? void 0 : _a.search;
|
208
|
-
try {
|
209
|
-
if (search) {
|
210
|
-
var searchList = search.slice(1).split('&');
|
211
|
-
for (var i = 0; i < searchList.length; i++) {
|
212
|
-
var _b = searchList[i].split('='), key = _b[0], value = _b[1];
|
213
|
-
if (key === SHOWFRAME_KEY)
|
214
|
-
return false;
|
215
|
-
}
|
216
|
-
}
|
217
|
-
}
|
218
|
-
catch (err) {
|
219
|
-
return true;
|
220
|
-
}
|
221
|
-
return true;
|
222
|
-
}
|
223
|
-
/**
|
224
|
-
*
|
225
|
-
* @description 取地址栏参数
|
226
|
-
*/
|
227
|
-
function getUrlSearch() {
|
228
|
-
var _a;
|
229
|
-
var search = (_a = window.location) === null || _a === void 0 ? void 0 : _a.search;
|
230
|
-
var result = {};
|
231
|
-
try {
|
232
|
-
if (search) {
|
233
|
-
var searchList = search.slice(1).split('&');
|
234
|
-
for (var i = 0; i < searchList.length; i++) {
|
235
|
-
var _b = searchList[i].split('='), key = _b[0], value = _b[1];
|
236
|
-
result[key] = value;
|
237
|
-
}
|
238
|
-
}
|
239
|
-
}
|
240
|
-
catch (err) {
|
241
|
-
console.log(err);
|
242
|
-
}
|
243
|
-
return result;
|
244
|
-
}
|
245
|
-
/**
|
246
|
-
* @description 复制
|
247
|
-
*/
|
248
|
-
function copyContent(text) {
|
249
|
-
var textarea = document.createElement('textarea');
|
250
|
-
textarea.setAttribute('readonly', 'readonly');
|
251
|
-
textarea.value = text;
|
252
|
-
document.body.appendChild(textarea);
|
253
|
-
textarea.select();
|
254
|
-
document === null || document === void 0 ? void 0 : document.execCommand('copy');
|
255
|
-
document.body.removeChild(textarea);
|
256
|
-
}
|
257
|
-
/**
|
258
|
-
* @author 陈亚雄
|
259
|
-
* @description 处理转义字符
|
260
|
-
*/
|
261
|
-
function dangerouslySetXss(str) {
|
262
|
-
var _a;
|
263
|
-
try {
|
264
|
-
var arrEntities_1 = { lt: '', gt: '', nbsp: ' ', amp: '&', quot: '"' };
|
265
|
-
return (_a = str === null || str === void 0 ? void 0 : str.replace) === null || _a === void 0 ? void 0 : _a.call(str, /&(lt|gt|nbsp|amp|quot);/gi, function (all, t) {
|
266
|
-
return arrEntities_1[t];
|
267
|
-
});
|
268
|
-
}
|
269
|
-
catch (err) {
|
270
|
-
return str;
|
271
|
-
}
|
272
|
-
}
|
273
|
-
|
274
|
-
var tools = /*#__PURE__*/Object.freeze({
|
275
|
-
__proto__: null,
|
276
|
-
timeTransfrom: timeTransfrom,
|
277
|
-
plus: plus,
|
278
|
-
minus: minus,
|
279
|
-
times: times,
|
280
|
-
divide: divide,
|
281
|
-
exactRound: exactRound,
|
282
|
-
toThousand: toThousand,
|
283
|
-
clearAssignStr: clearAssignStr,
|
284
|
-
loadFileRename: loadFileRename,
|
285
|
-
transformFileSize: transformFileSize,
|
286
|
-
isEqualByKey: isEqualByKey,
|
287
|
-
SHOWFRAME_KEY: SHOWFRAME_KEY,
|
288
|
-
showFrame: showFrame,
|
289
|
-
getUrlSearch: getUrlSearch,
|
290
|
-
copyContent: copyContent,
|
291
|
-
dangerouslySetXss: dangerouslySetXss
|
292
|
-
});
|
293
|
-
|
294
|
-
export { SHOWFRAME_KEY as S, timeTransfrom as a, toThousand as b, clearAssignStr as c, divide as d, exactRound as e, transformFileSize as f, getUrlSearch as g, copyContent as h, isEqualByKey as i, dangerouslySetXss as j, loadFileRename as l, showFrame as s, tools as t };
|