@oeos-components/utils 0.0.19 → 0.0.22
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/base.cjs +682 -0
- package/dist/base.d.cts +342 -0
- package/dist/base.d.mts +342 -0
- package/dist/base.d.ts +342 -0
- package/dist/base.mjs +655 -0
- package/dist/day.cjs +41 -0
- package/dist/day.d.cts +37 -0
- package/dist/day.d.mts +37 -0
- package/dist/day.d.ts +37 -0
- package/dist/day.mjs +31 -0
- package/dist/format.cjs +240 -0
- package/dist/format.d.cts +134 -0
- package/dist/format.d.mts +134 -0
- package/dist/format.d.ts +134 -0
- package/dist/format.mjs +230 -0
- package/dist/index.cjs +76 -858
- package/dist/index.d.cts +10 -404
- package/dist/index.d.mts +10 -404
- package/dist/index.d.ts +10 -404
- package/dist/index.mjs +12 -823
- package/dist/is.cjs +66 -0
- package/dist/is.d.cts +124 -0
- package/dist/is.d.mts +124 -0
- package/dist/is.d.ts +124 -0
- package/dist/is.mjs +43 -0
- package/dist/test.cjs +7 -0
- package/dist/test.d.cts +3 -0
- package/dist/test.d.mts +3 -0
- package/dist/test.d.ts +3 -0
- package/dist/test.mjs +5 -0
- package/dist/ws.cjs +120 -0
- package/dist/ws.d.cts +86 -0
- package/dist/ws.d.mts +86 -0
- package/dist/ws.d.ts +86 -0
- package/dist/ws.mjs +114 -0
- package/package.json +3 -1
package/dist/index.cjs
CHANGED
|
@@ -1,862 +1,80 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
3
|
+
const base = require('./base.cjs');
|
|
4
|
+
const day = require('./day.cjs');
|
|
5
|
+
const is = require('./is.cjs');
|
|
6
|
+
const ws = require('./ws.cjs');
|
|
7
|
+
const format = require('./format.cjs');
|
|
8
|
+
const test = require('./test.cjs');
|
|
9
|
+
require('@vue/reactivity');
|
|
10
|
+
require('consola');
|
|
11
|
+
require('es-toolkit');
|
|
12
|
+
require('element-plus');
|
|
13
|
+
require('dayjs');
|
|
14
|
+
require('qs');
|
|
7
15
|
|
|
8
|
-
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
9
|
-
const isString = (val) => typeof val === "string";
|
|
10
|
-
const isStringNumber = (val) => {
|
|
11
|
-
if (!isString(val)) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
return !Number.isNaN(Number(val));
|
|
15
|
-
};
|
|
16
|
-
const isNumber = (val) => typeof val === "number";
|
|
17
|
-
function $toast(message, type = "success", otherParams = {}) {
|
|
18
|
-
const typeMap = {
|
|
19
|
-
s: "success",
|
|
20
|
-
i: "info",
|
|
21
|
-
e: "error",
|
|
22
|
-
w: "warning"
|
|
23
|
-
};
|
|
24
|
-
function isShortType(t) {
|
|
25
|
-
return ["s", "i", "e", "w"].includes(t);
|
|
26
|
-
}
|
|
27
|
-
function isToastOptions(obj) {
|
|
28
|
-
return typeof obj === "object" && obj !== null;
|
|
29
|
-
}
|
|
30
|
-
if (isToastOptions(message)) {
|
|
31
|
-
if (message.closeAll) {
|
|
32
|
-
elementPlus.ElMessage.closeAll();
|
|
33
|
-
}
|
|
34
|
-
elementPlus.ElMessage(message);
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
if (isToastOptions(type)) {
|
|
38
|
-
if (type.closeAll) {
|
|
39
|
-
elementPlus.ElMessage.closeAll();
|
|
40
|
-
}
|
|
41
|
-
elementPlus.ElMessage({
|
|
42
|
-
message,
|
|
43
|
-
type: "success",
|
|
44
|
-
...type
|
|
45
|
-
});
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
if (otherParams.closeAll) {
|
|
49
|
-
elementPlus.ElMessage.closeAll();
|
|
50
|
-
}
|
|
51
|
-
const resolvedType = isShortType(type) ? typeMap[type] : type;
|
|
52
|
-
elementPlus.ElMessage({
|
|
53
|
-
message,
|
|
54
|
-
type: resolvedType,
|
|
55
|
-
...otherParams
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
$toast.success = (message, otherParams = {}) => $toast(message, "success", otherParams);
|
|
59
|
-
$toast.info = (message, otherParams = {}) => $toast(message, "info", otherParams);
|
|
60
|
-
$toast.error = (message, otherParams = {}) => $toast(message, "error", otherParams);
|
|
61
|
-
$toast.warning = (message, otherParams = {}) => $toast(message, "warning", otherParams);
|
|
62
|
-
function setStorage(storageName, params, isSession = false) {
|
|
63
|
-
let handleParams;
|
|
64
|
-
if (typeof params === "number" || typeof params === "string") {
|
|
65
|
-
handleParams = params;
|
|
66
|
-
} else {
|
|
67
|
-
handleParams = JSON.stringify(params);
|
|
68
|
-
}
|
|
69
|
-
if (isSession) {
|
|
70
|
-
sessionStorage.setItem(storageName, handleParams);
|
|
71
|
-
} else {
|
|
72
|
-
localStorage.setItem(storageName, handleParams);
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
function getStorage(data, isSession = false) {
|
|
76
|
-
let getLocalData = "";
|
|
77
|
-
let getSessionData = "";
|
|
78
|
-
if (isSession) {
|
|
79
|
-
getSessionData = sessionStorage.getItem(data);
|
|
80
|
-
} else {
|
|
81
|
-
getLocalData = localStorage.getItem(data);
|
|
82
|
-
}
|
|
83
|
-
if (getLocalData) {
|
|
84
|
-
try {
|
|
85
|
-
if (typeof JSON.parse(getLocalData) !== "number") {
|
|
86
|
-
getLocalData = JSON.parse(getLocalData);
|
|
87
|
-
}
|
|
88
|
-
} catch (e) {
|
|
89
|
-
}
|
|
90
|
-
return getLocalData;
|
|
91
|
-
} else if (getSessionData) {
|
|
92
|
-
try {
|
|
93
|
-
if (typeof JSON.parse(getSessionData) !== "number") {
|
|
94
|
-
getSessionData = JSON.parse(getSessionData);
|
|
95
|
-
}
|
|
96
|
-
} catch (e) {
|
|
97
|
-
}
|
|
98
|
-
return getSessionData;
|
|
99
|
-
}
|
|
100
|
-
return null;
|
|
101
|
-
}
|
|
102
|
-
function clearStorage(str = "") {
|
|
103
|
-
if (isEmpty(str)) {
|
|
104
|
-
sessionStorage.clear();
|
|
105
|
-
localStorage.clear();
|
|
106
|
-
}
|
|
107
|
-
if (notEmpty(str) && getType(str) !== "object") {
|
|
108
|
-
let strArr = Array.isArray(str) ? str : [str];
|
|
109
|
-
for (let i = 0; i < strArr.length; i++) {
|
|
110
|
-
sessionStorage.removeItem(strArr[i]);
|
|
111
|
-
localStorage.removeItem(strArr[i]);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (_isObjectWithExclude(str)) {
|
|
115
|
-
if (notEmpty(str.exclude) && getType(str) === "object") {
|
|
116
|
-
let sessionStorageObj = {};
|
|
117
|
-
let localStorageObj = {};
|
|
118
|
-
for (const key in str.exclude) {
|
|
119
|
-
if (Object.prototype.hasOwnProperty.call(str.exclude, key)) {
|
|
120
|
-
const name = str.exclude[key];
|
|
121
|
-
if (getStorage(name)) {
|
|
122
|
-
localStorageObj[name] = getStorage(name);
|
|
123
|
-
}
|
|
124
|
-
if (getStorage(name, true)) {
|
|
125
|
-
sessionStorageObj[name] = getStorage(name, true);
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
sessionStorage.clear();
|
|
130
|
-
localStorage.clear();
|
|
131
|
-
for (const key in sessionStorageObj) {
|
|
132
|
-
setStorage(key, sessionStorageObj[key], true);
|
|
133
|
-
}
|
|
134
|
-
for (const key in localStorageObj) {
|
|
135
|
-
setStorage(key, localStorageObj[key]);
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function _isObjectWithExclude(obj) {
|
|
141
|
-
return typeof obj === "object" && obj !== null && "exclude" in obj && typeof obj.exclude === "object";
|
|
142
|
-
}
|
|
143
|
-
function validForm(ref, { message = "\u8868\u5355\u6821\u9A8C\u9519\u8BEF, \u8BF7\u68C0\u67E5", detail = false, showMessage = true } = {}) {
|
|
144
|
-
return new Promise((resolve, reject) => {
|
|
145
|
-
reactivity.unref(ref).validate((valid, status) => {
|
|
146
|
-
if (valid) {
|
|
147
|
-
resolve(status);
|
|
148
|
-
} else {
|
|
149
|
-
if (message && showMessage) {
|
|
150
|
-
let errorText = Object.keys(status);
|
|
151
|
-
let toastMessage = message;
|
|
152
|
-
if (detail) {
|
|
153
|
-
toastMessage = message + errorText.join(",");
|
|
154
|
-
}
|
|
155
|
-
$toast(toastMessage, "e");
|
|
156
|
-
}
|
|
157
|
-
reject(status);
|
|
158
|
-
}
|
|
159
|
-
});
|
|
160
|
-
});
|
|
161
|
-
}
|
|
162
|
-
function isEmpty(data, strict = false) {
|
|
163
|
-
if (reactivity.isRef(data)) {
|
|
164
|
-
data = reactivity.unref(data);
|
|
165
|
-
}
|
|
166
|
-
if (strict) {
|
|
167
|
-
if (data === false || data === 0 || data === BigInt(0)) {
|
|
168
|
-
return false;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
if (data == null) return true;
|
|
172
|
-
if (data instanceof Date) {
|
|
173
|
-
return isNaN(data.getTime());
|
|
174
|
-
}
|
|
175
|
-
switch (typeof data) {
|
|
176
|
-
case "string":
|
|
177
|
-
return data.trim().length === 0;
|
|
178
|
-
case "boolean":
|
|
179
|
-
return !data;
|
|
180
|
-
case "number":
|
|
181
|
-
return 0 === data || isNaN(data);
|
|
182
|
-
// ❗ `NaN`或者0 被认为是空
|
|
183
|
-
case "symbol":
|
|
184
|
-
return false;
|
|
185
|
-
case "bigint":
|
|
186
|
-
return data === BigInt(0);
|
|
187
|
-
}
|
|
188
|
-
if (data instanceof Map || data instanceof Set) return data.size === 0;
|
|
189
|
-
if (Array.isArray(data) || typeof data.length === "number" && Object.prototype.toString.call(data) === "[object Object]") {
|
|
190
|
-
return data.length === 0;
|
|
191
|
-
}
|
|
192
|
-
if (typeof data === "object") {
|
|
193
|
-
return Object.keys(data).length === 0;
|
|
194
|
-
}
|
|
195
|
-
return false;
|
|
196
|
-
}
|
|
197
|
-
function notEmpty(v) {
|
|
198
|
-
return !isEmpty(v);
|
|
199
|
-
}
|
|
200
|
-
function merge(obj1, obj2) {
|
|
201
|
-
let merged = { ...obj1, ...obj2 };
|
|
202
|
-
for (let key in merged) {
|
|
203
|
-
if (!isEmpty(obj1[key]) && !isEmpty(obj2[key])) {
|
|
204
|
-
merged[key] = obj2[key];
|
|
205
|
-
} else if (isEmpty(obj1[key]) && !isEmpty(obj2[key])) {
|
|
206
|
-
merged[key] = obj2[key];
|
|
207
|
-
} else if (!isEmpty(obj1[key]) && isEmpty(obj2[key])) {
|
|
208
|
-
merged[key] = obj1[key];
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
return merged;
|
|
212
|
-
}
|
|
213
|
-
function clone(data, times = 1) {
|
|
214
|
-
if (reactivity.isRef(data)) {
|
|
215
|
-
data = reactivity.unref(data);
|
|
216
|
-
}
|
|
217
|
-
if (getType(data) !== "array") {
|
|
218
|
-
return esToolkit.cloneDeep(data);
|
|
219
|
-
}
|
|
220
|
-
const clonedData = esToolkit.cloneDeep(data);
|
|
221
|
-
const result = [];
|
|
222
|
-
for (let i = 0; i < times; i++) {
|
|
223
|
-
result.push(...clonedData);
|
|
224
|
-
}
|
|
225
|
-
return result;
|
|
226
|
-
}
|
|
227
|
-
function formatTime(time, cFormat = "{y}-{m}-{d} {h}:{i}:{s}") {
|
|
228
|
-
if (!time) {
|
|
229
|
-
return time;
|
|
230
|
-
}
|
|
231
|
-
let date;
|
|
232
|
-
if (typeof time === "object") {
|
|
233
|
-
date = time;
|
|
234
|
-
} else {
|
|
235
|
-
const timeStr = "" + time;
|
|
236
|
-
if (timeStr.includes(".") && !isNaN(parseFloat(timeStr))) {
|
|
237
|
-
time = parseFloat(time) * 1e3;
|
|
238
|
-
} else if (timeStr.length === 10) {
|
|
239
|
-
time = parseInt(time) * 1e3;
|
|
240
|
-
}
|
|
241
|
-
date = new Date(time);
|
|
242
|
-
}
|
|
243
|
-
const formatObj = {
|
|
244
|
-
y: date.getFullYear(),
|
|
245
|
-
m: date.getMonth() + 1,
|
|
246
|
-
d: date.getDate(),
|
|
247
|
-
h: date.getHours(),
|
|
248
|
-
i: date.getMinutes(),
|
|
249
|
-
s: date.getSeconds(),
|
|
250
|
-
a: date.getDay()
|
|
251
|
-
};
|
|
252
|
-
const time_str = cFormat.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
|
253
|
-
let value = formatObj[key];
|
|
254
|
-
if (key === "a") {
|
|
255
|
-
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"][value];
|
|
256
|
-
}
|
|
257
|
-
if (result.length > 0 && value < 10) {
|
|
258
|
-
value = "0" + value;
|
|
259
|
-
}
|
|
260
|
-
return value || 0;
|
|
261
|
-
});
|
|
262
|
-
return time_str;
|
|
263
|
-
}
|
|
264
|
-
function formatDurationTime(timestamp, cFormat = "{d}\u5929{h}\u65F6{i}\u5206{s}\u79D2") {
|
|
265
|
-
const secondsPerMinute = 60;
|
|
266
|
-
const minutesPerHour = 60;
|
|
267
|
-
const hoursPerDay = 24;
|
|
268
|
-
let totalSeconds = Math.floor(timestamp / 1e3);
|
|
269
|
-
let days = 0;
|
|
270
|
-
if (cFormat.indexOf("d") !== -1) {
|
|
271
|
-
days = Math.floor(totalSeconds / (secondsPerMinute * minutesPerHour * hoursPerDay));
|
|
272
|
-
totalSeconds %= secondsPerMinute * minutesPerHour * hoursPerDay;
|
|
273
|
-
}
|
|
274
|
-
let hours = Math.floor(totalSeconds / (secondsPerMinute * minutesPerHour));
|
|
275
|
-
totalSeconds %= secondsPerMinute * minutesPerHour;
|
|
276
|
-
let minutes = Math.floor(totalSeconds / secondsPerMinute);
|
|
277
|
-
let seconds = totalSeconds % secondsPerMinute;
|
|
278
|
-
const formatObj = {
|
|
279
|
-
d: days,
|
|
280
|
-
h: hours,
|
|
281
|
-
i: minutes,
|
|
282
|
-
s: seconds
|
|
283
|
-
};
|
|
284
|
-
let parseFormat = cFormat;
|
|
285
|
-
if (days === 0) {
|
|
286
|
-
parseFormat = cFormat.match(/{h}.*/g)[0];
|
|
287
|
-
if (hours === 0) {
|
|
288
|
-
parseFormat = cFormat.match(/{i}.*/g)[0];
|
|
289
|
-
if (minutes === 0) {
|
|
290
|
-
parseFormat = cFormat.match(/{s}.*/g)[0];
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
}
|
|
294
|
-
const time_str = parseFormat.replace(/{(y|m|d|h|i|s)+}/g, (result, key) => {
|
|
295
|
-
let value = formatObj[key];
|
|
296
|
-
if (result.length > 0 && value < 10 && value != 0) {
|
|
297
|
-
value = "0" + value;
|
|
298
|
-
}
|
|
299
|
-
return value || "00";
|
|
300
|
-
});
|
|
301
|
-
return time_str;
|
|
302
|
-
}
|
|
303
|
-
function uuid(type = "", length = 4, options = {}) {
|
|
304
|
-
const { emailStr = "@qq.com", timeStr = "{y}-{m}-{d} {h}:{i}:{s}", startStr = "", optionsIndex = null } = options;
|
|
305
|
-
function isRef2(obj) {
|
|
306
|
-
return obj && typeof obj === "object" && obj._isRef === true;
|
|
307
|
-
}
|
|
308
|
-
function unref2(ref) {
|
|
309
|
-
return isRef2(ref) ? ref.value : ref;
|
|
310
|
-
}
|
|
311
|
-
function random2(min, max) {
|
|
312
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
313
|
-
}
|
|
314
|
-
type = unref2(type);
|
|
315
|
-
if (Array.isArray(type)) {
|
|
316
|
-
if (type.length === 0) return "";
|
|
317
|
-
const randIndex = optionsIndex ?? random2(0, type.length - 1);
|
|
318
|
-
const selectedItem = type[randIndex];
|
|
319
|
-
if (typeof selectedItem === "object" && selectedItem !== null && "value" in selectedItem) {
|
|
320
|
-
return selectedItem.value;
|
|
321
|
-
}
|
|
322
|
-
return selectedItem;
|
|
323
|
-
}
|
|
324
|
-
let randomChars = "ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678";
|
|
325
|
-
let result = startStr;
|
|
326
|
-
if (type === "phone") {
|
|
327
|
-
const prefixes = ["130", "131", "132", "133", "135", "136", "137", "138", "170", "187", "189"];
|
|
328
|
-
result = prefixes[random2(0, prefixes.length - 1)];
|
|
329
|
-
for (let i = 0; i < 8; i++) {
|
|
330
|
-
result += Math.floor(Math.random() * 10);
|
|
331
|
-
}
|
|
332
|
-
return result;
|
|
333
|
-
}
|
|
334
|
-
if (type === "email") {
|
|
335
|
-
result = uuid(startStr, length) + emailStr;
|
|
336
|
-
return result;
|
|
337
|
-
}
|
|
338
|
-
if (type === "time") {
|
|
339
|
-
return uuid(startStr, length, options) + " " + formatTime(/* @__PURE__ */ new Date(), timeStr);
|
|
340
|
-
}
|
|
341
|
-
if (type === "number") {
|
|
342
|
-
const numChars = "123456789";
|
|
343
|
-
result = "";
|
|
344
|
-
for (let i = 0; i < length; i++) {
|
|
345
|
-
result += numChars[random2(0, numChars.length - 1)];
|
|
346
|
-
}
|
|
347
|
-
return Number(result);
|
|
348
|
-
}
|
|
349
|
-
if (type === "ip") {
|
|
350
|
-
const randomNum = random2(1, 99);
|
|
351
|
-
return `10.0.11.${randomNum}`;
|
|
352
|
-
}
|
|
353
|
-
if (type === "port") {
|
|
354
|
-
return random2(1, 65535);
|
|
355
|
-
}
|
|
356
|
-
for (let i = 0; i < length; i++) {
|
|
357
|
-
result += randomChars[random2(0, randomChars.length - 1)];
|
|
358
|
-
}
|
|
359
|
-
return result;
|
|
360
|
-
}
|
|
361
|
-
function getType(type) {
|
|
362
|
-
if (typeof type === "object") {
|
|
363
|
-
const objType = Object.prototype.toString.call(type).slice(8, -1).toLowerCase();
|
|
364
|
-
return objType;
|
|
365
|
-
} else {
|
|
366
|
-
return typeof type;
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
function sleep(delay = 0, fn) {
|
|
370
|
-
return new Promise(
|
|
371
|
-
(resolve) => setTimeout(() => {
|
|
372
|
-
fn?.();
|
|
373
|
-
resolve();
|
|
374
|
-
}, delay)
|
|
375
|
-
);
|
|
376
|
-
}
|
|
377
|
-
function validateTrigger(type = "required", rules = {}, pureValid = false) {
|
|
378
|
-
let mergeRules = {
|
|
379
|
-
trigger: ["blur", "change"],
|
|
380
|
-
...rules
|
|
381
|
-
};
|
|
382
|
-
return validate(type, mergeRules, pureValid);
|
|
383
|
-
}
|
|
384
|
-
function validate(type = "required", rules = {}, pureValid = false) {
|
|
385
|
-
if (getType(type) === "object") {
|
|
386
|
-
pureValid = rules || false;
|
|
387
|
-
rules = type;
|
|
388
|
-
type = "required";
|
|
389
|
-
}
|
|
390
|
-
let trigger = rules.trigger || [];
|
|
391
|
-
const typeMaps = ["required", "pwd", "number", "mobile", "email", "between", "length", "same", "ip", "port", "custom"];
|
|
392
|
-
let parseRequired = rules.required ?? true;
|
|
393
|
-
if (!typeMaps.includes(type)) {
|
|
394
|
-
return {
|
|
395
|
-
required: parseRequired,
|
|
396
|
-
message: type,
|
|
397
|
-
trigger
|
|
398
|
-
};
|
|
399
|
-
}
|
|
400
|
-
if (type === "required") {
|
|
401
|
-
return {
|
|
402
|
-
required: parseRequired,
|
|
403
|
-
message: rules.message ?? "\u8BF7\u8F93\u5165",
|
|
404
|
-
trigger
|
|
405
|
-
};
|
|
406
|
-
}
|
|
407
|
-
if (type === "password") {
|
|
408
|
-
const validateName = (rule, value, callback) => {
|
|
409
|
-
let validFlag = /^[a-zA-Z0-9_-]+$/.test(value);
|
|
410
|
-
if (!validFlag) {
|
|
411
|
-
callback(new Error(rules.message || "\u5BC6\u7801\u53EA\u80FD\u7531\u82F1\u6587\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u3001\u4E2D\u5212\u7EBF\u7EC4\u6210"));
|
|
412
|
-
} else {
|
|
413
|
-
callback();
|
|
414
|
-
}
|
|
415
|
-
};
|
|
416
|
-
return {
|
|
417
|
-
validator: validateName,
|
|
418
|
-
trigger
|
|
419
|
-
};
|
|
420
|
-
}
|
|
421
|
-
if (type === "positive" || type === "number") {
|
|
422
|
-
return _validValue(rules, "\u8BF7\u8F93\u5165\u6B63\u6574\u6570", pureValid, /^[1-9]+\d*$/);
|
|
423
|
-
}
|
|
424
|
-
if (type === "zeroPositive") {
|
|
425
|
-
return _validValue(rules, "\u8BF7\u8F93\u5165\u975E\u8D1F\u6574\u6570", pureValid, /^(0|[1-9]+\d*)$/);
|
|
426
|
-
}
|
|
427
|
-
if (type === "integer") {
|
|
428
|
-
return _validValue(rules, "\u8BF7\u8F93\u5165\u6574\u6570", pureValid, /^(0|[-]?[1-9]\d*)$/);
|
|
429
|
-
}
|
|
430
|
-
if (type === "decimal") {
|
|
431
|
-
return _validValue(rules, "\u8BF7\u8F93\u5165\u975E\u8D1F\u6570\u5B57, \u5305\u542B\u5C0F\u6570\u4E14\u6700\u591A2\u4F4D", pureValid, /(0|[1-9]\d*)(\.\d{1, 2})?|0\.\d{1,2}/);
|
|
432
|
-
}
|
|
433
|
-
if (type === "mobile") {
|
|
434
|
-
return _validValue(rules, "\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7", pureValid, /^[1][0-9]{10}$/);
|
|
435
|
-
}
|
|
436
|
-
if (type === "email") {
|
|
437
|
-
return _validValue(rules, "\u8BF7\u8F93\u5165\u6B63\u786E\u7684email", pureValid, /^[^\s@]+@[^\s@]+\.[^\s@]+$/);
|
|
438
|
-
}
|
|
439
|
-
if (type === "ip") {
|
|
440
|
-
return _validValue(
|
|
441
|
-
rules,
|
|
442
|
-
"\u8BF7\u8F93\u5165\u6B63\u786E\u7684ip\u5730\u5740",
|
|
443
|
-
pureValid,
|
|
444
|
-
/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/
|
|
445
|
-
);
|
|
446
|
-
}
|
|
447
|
-
if (type === "between") {
|
|
448
|
-
let min = rules.min;
|
|
449
|
-
let max = rules.max;
|
|
450
|
-
const validateBetween = (rule, value, callback) => {
|
|
451
|
-
let validFlag = /^-?[0-9]+$/.test(value);
|
|
452
|
-
if (!validFlag) {
|
|
453
|
-
callback(new Error("\u8BF7\u8F93\u5165\u6570\u5B57"));
|
|
454
|
-
}
|
|
455
|
-
if (value < min && min !== void 0) {
|
|
456
|
-
callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5C0F\u4E8E${min}`));
|
|
457
|
-
}
|
|
458
|
-
if (value > max && max !== void 0) {
|
|
459
|
-
callback(new Error(`\u6570\u5B57\u4E0D\u80FD\u5927\u4E8E${max}`));
|
|
460
|
-
}
|
|
461
|
-
callback();
|
|
462
|
-
};
|
|
463
|
-
return {
|
|
464
|
-
validator: validateBetween,
|
|
465
|
-
trigger,
|
|
466
|
-
required: parseRequired
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
if (type === "length") {
|
|
470
|
-
return {
|
|
471
|
-
min: rules.min,
|
|
472
|
-
max: rules.max,
|
|
473
|
-
message: rules.message ?? `\u8BF7\u8F93\u5165${rules.min}\u5230${rules.max}\u4E2A\u5B57\u7B26`,
|
|
474
|
-
trigger,
|
|
475
|
-
required: parseRequired
|
|
476
|
-
};
|
|
477
|
-
}
|
|
478
|
-
if (type === "port") {
|
|
479
|
-
return _validValue(
|
|
480
|
-
rules,
|
|
481
|
-
"\u8BF7\u8F93\u51651-65535\u7684\u7AEF\u53E3\u53F7",
|
|
482
|
-
pureValid,
|
|
483
|
-
/^([1-9]|[1-9][0-9]{1,3}|[1-5][0-9]{4}|6[0-5][0-5][0-3][0-5])$/
|
|
484
|
-
);
|
|
485
|
-
}
|
|
486
|
-
if (type === "same") {
|
|
487
|
-
const validateSame = (rule, value, callback) => {
|
|
488
|
-
let isSame = value === rules.value;
|
|
489
|
-
if (!isSame) {
|
|
490
|
-
const errMessage = rules.message || "\u5BC6\u7801\u548C\u786E\u8BA4\u5BC6\u7801\u8981\u4E00\u81F4";
|
|
491
|
-
callback(new Error(errMessage));
|
|
492
|
-
}
|
|
493
|
-
if (parseRequired && !value) {
|
|
494
|
-
callback(new Error(rules.message || "\u8BF7\u8F93\u5165"));
|
|
495
|
-
}
|
|
496
|
-
callback();
|
|
497
|
-
};
|
|
498
|
-
let res = {
|
|
499
|
-
validator: validateSame,
|
|
500
|
-
trigger,
|
|
501
|
-
required: parseRequired
|
|
502
|
-
};
|
|
503
|
-
return res;
|
|
504
|
-
}
|
|
505
|
-
if (type === "custom") {
|
|
506
|
-
if (pureValid) {
|
|
507
|
-
return _validValue(rules.value, rules.message, pureValid, rules.reg);
|
|
508
|
-
} else {
|
|
509
|
-
return _validValue(rules, rules.message, pureValid, rules.reg);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
function _validValue(rules2, msg, pureValid2, reg) {
|
|
513
|
-
if (pureValid2 === true) {
|
|
514
|
-
return reg.test(rules2);
|
|
515
|
-
}
|
|
516
|
-
const validatePhone = (rule, value, callback) => {
|
|
517
|
-
let validFlag = reg.test(value);
|
|
518
|
-
if (!validFlag) {
|
|
519
|
-
callback(new Error(rules2.message ?? msg));
|
|
520
|
-
} else {
|
|
521
|
-
callback();
|
|
522
|
-
}
|
|
523
|
-
};
|
|
524
|
-
return {
|
|
525
|
-
validator: validatePhone,
|
|
526
|
-
required: rules2.required ?? true,
|
|
527
|
-
trigger
|
|
528
|
-
};
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
async function asyncWrapper(func, ...args) {
|
|
532
|
-
try {
|
|
533
|
-
const res = await func(...args);
|
|
534
|
-
return { res };
|
|
535
|
-
} catch (err) {
|
|
536
|
-
return { err };
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
function formatImg(photoName, addPath = "", { basePath = "assets/images" } = {}) {
|
|
540
|
-
if (photoName.startsWith("http") || photoName.startsWith("https")) {
|
|
541
|
-
return photoName;
|
|
542
|
-
}
|
|
543
|
-
if (photoName.indexOf(".") === -1) {
|
|
544
|
-
photoName = photoName + ".png";
|
|
545
|
-
}
|
|
546
|
-
const addLastSlash = addPath.endsWith("/") || !addPath ? addPath : `${addPath}/`;
|
|
547
|
-
const addLastBasePathSlash = basePath.endsWith("/") || !basePath ? basePath : `${basePath}/`;
|
|
548
|
-
let mergeSrc = `${addLastSlash}${photoName}`;
|
|
549
|
-
let res = new URL(`../${addLastBasePathSlash}${mergeSrc}`, (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.cjs', document.baseURI).href))).href;
|
|
550
|
-
return res;
|
|
551
|
-
}
|
|
552
|
-
const copy = (text, toastParams = {}) => {
|
|
553
|
-
const textarea = document.createElement("textarea");
|
|
554
|
-
textarea.value = text;
|
|
555
|
-
textarea.style.position = "fixed";
|
|
556
|
-
document.body.appendChild(textarea);
|
|
557
|
-
textarea.select();
|
|
558
|
-
document.execCommand("copy");
|
|
559
|
-
document.body.removeChild(textarea);
|
|
560
|
-
if (!toastParams.hideToast) {
|
|
561
|
-
$toast(text + "\u590D\u5236\u6210\u529F", toastParams);
|
|
562
|
-
}
|
|
563
|
-
};
|
|
564
|
-
function formatThousands(number) {
|
|
565
|
-
let matches = ("" + number).match(/^([\d,]+)(\.?)(\d+)?(\D+)?$/);
|
|
566
|
-
if (!matches) {
|
|
567
|
-
return number;
|
|
568
|
-
}
|
|
569
|
-
let numericString = matches[1].replace(/\D/g, "");
|
|
570
|
-
let decimalString = matches[3] ? `.${matches[3]}` : "";
|
|
571
|
-
let unit = matches[4] || "";
|
|
572
|
-
let numberWithSeparator = numericString.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
573
|
-
return `${numberWithSeparator}${decimalString}${unit}`;
|
|
574
|
-
}
|
|
575
|
-
function log(variableStr, variable, otherInfo = "") {
|
|
576
|
-
const stack = new Error().stack.split("\n")[2].trim();
|
|
577
|
-
const matchResult = stack.match(/\((.*):(\d+):(\d+)\)/);
|
|
578
|
-
let fileInfo = "";
|
|
579
|
-
try {
|
|
580
|
-
if (matchResult && otherInfo) {
|
|
581
|
-
const lineNumber = matchResult[2];
|
|
582
|
-
fileInfo = `vscode://file${JSON.parse(otherInfo)}:${lineNumber}`;
|
|
583
|
-
}
|
|
584
|
-
} catch (error) {
|
|
585
|
-
fileInfo = otherInfo;
|
|
586
|
-
}
|
|
587
|
-
if (reactivity.isRef(variable)) {
|
|
588
|
-
let unrefVariable = reactivity.unref(variable);
|
|
589
|
-
_log(reactivity.toRaw(unrefVariable));
|
|
590
|
-
} else {
|
|
591
|
-
_log(variable);
|
|
592
|
-
}
|
|
593
|
-
function _log(consoleData) {
|
|
594
|
-
if (getType2(consoleData) === "object" || getType2(consoleData) === "array") {
|
|
595
|
-
consola.consola.log(
|
|
596
|
-
`%c${variableStr} `,
|
|
597
|
-
"background:#fff; color: blue;font-size: 0.8em",
|
|
598
|
-
JSON.stringify(consoleData, null, " "),
|
|
599
|
-
`${fileInfo}`
|
|
600
|
-
);
|
|
601
|
-
} else {
|
|
602
|
-
consola.consola.log(`%c${variableStr} `, "background:#fff; color: blue;font-size: 0.8em", consoleData, `${fileInfo}`);
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
function getType2(type) {
|
|
606
|
-
if (typeof type === "object") {
|
|
607
|
-
const objType = Object.prototype.toString.call(type).slice(8, -1).toLowerCase();
|
|
608
|
-
return objType;
|
|
609
|
-
} else {
|
|
610
|
-
return typeof type;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
613
|
-
}
|
|
614
|
-
function random(min = 0, max = 10) {
|
|
615
|
-
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
616
|
-
}
|
|
617
|
-
function toLine(text, connect = "-") {
|
|
618
|
-
let translateText = text.replace(/([A-Z])/g, (match, p1, offset, origin) => {
|
|
619
|
-
if (offset === 0) {
|
|
620
|
-
return `${match.toLocaleLowerCase()}`;
|
|
621
|
-
} else {
|
|
622
|
-
return `${connect}${match.toLocaleLowerCase()}`;
|
|
623
|
-
}
|
|
624
|
-
}).toLocaleLowerCase();
|
|
625
|
-
return translateText;
|
|
626
|
-
}
|
|
627
|
-
function processWidth(initValue, isBase = false) {
|
|
628
|
-
let value = reactivity.unref(initValue);
|
|
629
|
-
let res = "";
|
|
630
|
-
if (!value) {
|
|
631
|
-
return isBase ? value : {};
|
|
632
|
-
} else if (typeof value === "number") {
|
|
633
|
-
value = String(value);
|
|
634
|
-
}
|
|
635
|
-
if (value === "") {
|
|
636
|
-
return isBase ? value : {};
|
|
637
|
-
} else if (typeof value === "string" && !isNaN(value)) {
|
|
638
|
-
res = value + "px";
|
|
639
|
-
} else if (typeof value === "string" && /^[0-9]+(\.[0-9]+)?(px|%|em|rem|vw|vh|ch)*$/.test(value)) {
|
|
640
|
-
res = value;
|
|
641
|
-
} else {
|
|
642
|
-
console.warn(`${value} is Invalid unit provided`);
|
|
643
|
-
return value;
|
|
644
|
-
}
|
|
645
|
-
if (isBase) {
|
|
646
|
-
return res;
|
|
647
|
-
}
|
|
648
|
-
return { width: res };
|
|
649
|
-
}
|
|
650
|
-
function toFixed(value, options = {}) {
|
|
651
|
-
if (typeof options === "number") {
|
|
652
|
-
options = { digit: options };
|
|
653
|
-
}
|
|
654
|
-
let { digit = 2, prefix = "", suffix = "", unit = true } = options;
|
|
655
|
-
let matches = ("" + value).match(/^([\d,]+)(\.?)(\d+)?(\D+)?$/);
|
|
656
|
-
if (!matches) {
|
|
657
|
-
return value;
|
|
658
|
-
}
|
|
659
|
-
let numericString = matches[1].replace(/\D/g, "");
|
|
660
|
-
let decimalString = matches[3] ? `.${matches[3]}` : "";
|
|
661
|
-
let finalUnit = matches[4] || "";
|
|
662
|
-
let res = numericString;
|
|
663
|
-
if (isStringNumber(numericString) || isNumber(numericString)) {
|
|
664
|
-
res = Number(numericString + decimalString).toFixed(digit);
|
|
665
|
-
}
|
|
666
|
-
if (!unit) {
|
|
667
|
-
finalUnit = "";
|
|
668
|
-
}
|
|
669
|
-
return `${prefix}${res}${finalUnit}${suffix}`;
|
|
670
|
-
}
|
|
671
|
-
function formatBytes(bytes, options = {}) {
|
|
672
|
-
let { digit = 2, thousands = true, prefix = "", suffix = "", roundType = "floor" } = options;
|
|
673
|
-
if (isStringNumber(bytes) || isNumber(bytes)) {
|
|
674
|
-
bytes = Number(bytes);
|
|
675
|
-
} else {
|
|
676
|
-
return bytes;
|
|
677
|
-
}
|
|
678
|
-
if (bytes <= 1) {
|
|
679
|
-
return Math[roundType](bytes * Math.pow(10, digit)) / Math.pow(10, digit) + " B";
|
|
680
|
-
}
|
|
681
|
-
const k = 1024;
|
|
682
|
-
const sizes = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
|
|
683
|
-
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
684
|
-
const power = Math.pow(k, i);
|
|
685
|
-
let num = bytes / power;
|
|
686
|
-
num = Math[roundType](num * Math.pow(10, digit)) / Math.pow(10, digit);
|
|
687
|
-
let res = num.toFixed(digit) + " " + sizes[i];
|
|
688
|
-
if (thousands) {
|
|
689
|
-
res = formatThousands(res);
|
|
690
|
-
}
|
|
691
|
-
return `${prefix}${res}${suffix}`;
|
|
692
|
-
}
|
|
693
|
-
function formatBytesConvert(oBytes, { thounsands = false, digit = 0 } = {}) {
|
|
694
|
-
let bytes = oBytes;
|
|
695
|
-
if (isStringNumber(oBytes) || isNumber(oBytes) || getType(oBytes) !== "string") {
|
|
696
|
-
return parseDigitThounsands(oBytes);
|
|
697
|
-
}
|
|
698
|
-
if (!oBytes) {
|
|
699
|
-
return parseDigitThounsands(oBytes);
|
|
700
|
-
}
|
|
701
|
-
const regex = /^\d{1,3}(,\d{3})*(\.\d+)?[a-zA-Z ]*$/;
|
|
702
|
-
if (regex.test(oBytes)) {
|
|
703
|
-
bytes = oBytes.replace(/,/g, "");
|
|
704
|
-
if (isStringNumber(bytes) || isNumber(bytes) || getType(bytes) !== "string") {
|
|
705
|
-
return parseDigitThounsands(bytes);
|
|
706
|
-
}
|
|
707
|
-
}
|
|
708
|
-
const bytesRegex = /^(\d+(?:\.\d+)?)\s*([BKMGTPEZY]?B|Byte)$/i;
|
|
709
|
-
const units = {
|
|
710
|
-
B: 1,
|
|
711
|
-
BYTE: 1,
|
|
712
|
-
KB: 1024,
|
|
713
|
-
MB: 1024 ** 2,
|
|
714
|
-
GB: 1024 ** 3,
|
|
715
|
-
TB: 1024 ** 4,
|
|
716
|
-
PB: 1024 ** 5,
|
|
717
|
-
EB: 1024 ** 6,
|
|
718
|
-
ZB: 1024 ** 7,
|
|
719
|
-
YB: 1024 ** 8
|
|
720
|
-
};
|
|
721
|
-
const match = bytes.match(bytesRegex);
|
|
722
|
-
if (!match) {
|
|
723
|
-
console.warn("Invalid bytes format. Please provide a valid bytes string, like '100GB'.");
|
|
724
|
-
return;
|
|
725
|
-
}
|
|
726
|
-
const size = parseFloat(match[1]);
|
|
727
|
-
const unit = match[2].toUpperCase();
|
|
728
|
-
if (!units.hasOwnProperty(unit)) {
|
|
729
|
-
console.warn(
|
|
730
|
-
"Invalid bytes unit. Please provide a valid unit, like 'B', 'BYTE', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', or 'YB'."
|
|
731
|
-
);
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
function parseDigitThounsands(val) {
|
|
735
|
-
let finalRes = val;
|
|
736
|
-
if (digit) {
|
|
737
|
-
finalRes = Number(finalRes).toFixed(digit);
|
|
738
|
-
}
|
|
739
|
-
if (thounsands) {
|
|
740
|
-
finalRes = formatThousands(finalRes);
|
|
741
|
-
}
|
|
742
|
-
return finalRes;
|
|
743
|
-
}
|
|
744
|
-
return parseDigitThounsands(size * units[unit]);
|
|
745
|
-
}
|
|
746
|
-
function throttle(fn, delay = 1e3) {
|
|
747
|
-
let last = 0;
|
|
748
|
-
let timer = null;
|
|
749
|
-
return function() {
|
|
750
|
-
let context = this;
|
|
751
|
-
let args = arguments;
|
|
752
|
-
let now = +/* @__PURE__ */ new Date();
|
|
753
|
-
if (now - last < delay) {
|
|
754
|
-
clearTimeout(timer);
|
|
755
|
-
timer = setTimeout(function() {
|
|
756
|
-
last = now;
|
|
757
|
-
fn.apply(context, args);
|
|
758
|
-
}, delay);
|
|
759
|
-
} else {
|
|
760
|
-
last = now;
|
|
761
|
-
fn.apply(context, args);
|
|
762
|
-
}
|
|
763
|
-
};
|
|
764
|
-
}
|
|
765
|
-
function tryCatch(promise, sendLoading) {
|
|
766
|
-
const updateLoading = (value) => {
|
|
767
|
-
if (reactivity.isRef(sendLoading)) {
|
|
768
|
-
sendLoading.value = value;
|
|
769
|
-
} else if (sendLoading !== null) {
|
|
770
|
-
console.warn("Cannot modify non-ref sendLoading directly!");
|
|
771
|
-
}
|
|
772
|
-
};
|
|
773
|
-
updateLoading(true);
|
|
774
|
-
return promise.then((data) => {
|
|
775
|
-
updateLoading(false);
|
|
776
|
-
return { data, error: null };
|
|
777
|
-
}).catch((error) => {
|
|
778
|
-
updateLoading(false);
|
|
779
|
-
return { data: null, error };
|
|
780
|
-
});
|
|
781
|
-
}
|
|
782
|
-
function debounce(fn, delay = 1e3) {
|
|
783
|
-
let timer = null;
|
|
784
|
-
return function() {
|
|
785
|
-
if (timer) {
|
|
786
|
-
clearTimeout(timer);
|
|
787
|
-
}
|
|
788
|
-
timer = setTimeout(() => {
|
|
789
|
-
fn.apply(this, arguments);
|
|
790
|
-
timer = null;
|
|
791
|
-
}, delay);
|
|
792
|
-
};
|
|
793
|
-
}
|
|
794
|
-
function confirm(message, options) {
|
|
795
|
-
const resolvedMessage = typeof message === "function" ? message() : message;
|
|
796
|
-
const elContext = elementPlus.ElMessageBox.install?.context || elementPlus.ElMessageBox._context || document.querySelector("#app")?._vue_app?._context;
|
|
797
|
-
const mergeOptions = {
|
|
798
|
-
title: "\u63D0\u793A",
|
|
799
|
-
draggable: true,
|
|
800
|
-
showCancelButton: false,
|
|
801
|
-
confirmButtonText: "\u786E\u5B9A",
|
|
802
|
-
dangerouslyUseHTMLString: true,
|
|
803
|
-
// 允许 HTML
|
|
804
|
-
appContext: elContext,
|
|
805
|
-
// 强制注入 Element Plus 的上下文
|
|
806
|
-
...options
|
|
807
|
-
};
|
|
808
|
-
return elementPlus.ElMessageBox.confirm(resolvedMessage, mergeOptions);
|
|
809
|
-
}
|
|
810
|
-
function formatNewLines(str) {
|
|
811
|
-
if (!str || typeof str !== "string") {
|
|
812
|
-
return str;
|
|
813
|
-
}
|
|
814
|
-
str = str.replace(/\n/g, "<br>");
|
|
815
|
-
str = str.replace(/\t/g, " ");
|
|
816
|
-
return str;
|
|
817
|
-
}
|
|
818
|
-
function getVariable(propertyName) {
|
|
819
|
-
let res = getComputedStyle(document.documentElement).getPropertyValue(propertyName).trim();
|
|
820
|
-
return res;
|
|
821
|
-
}
|
|
822
|
-
function test() {
|
|
823
|
-
return "\u54C8\u54C8\u54C8" + /* @__PURE__ */ new Date();
|
|
824
|
-
}
|
|
825
16
|
|
|
826
|
-
|
|
827
|
-
exports
|
|
828
|
-
exports.
|
|
829
|
-
exports.
|
|
830
|
-
exports.
|
|
831
|
-
exports.
|
|
832
|
-
exports.
|
|
833
|
-
exports.
|
|
834
|
-
exports.
|
|
835
|
-
exports.
|
|
836
|
-
exports.
|
|
837
|
-
exports.
|
|
838
|
-
exports.
|
|
839
|
-
exports.
|
|
840
|
-
exports.
|
|
841
|
-
exports.
|
|
842
|
-
exports.
|
|
843
|
-
exports.
|
|
844
|
-
exports.
|
|
845
|
-
exports.
|
|
846
|
-
exports.
|
|
847
|
-
exports.
|
|
848
|
-
exports.
|
|
849
|
-
exports.
|
|
850
|
-
exports.
|
|
851
|
-
exports.
|
|
852
|
-
exports.
|
|
853
|
-
exports.
|
|
854
|
-
exports.
|
|
855
|
-
exports.
|
|
856
|
-
exports.
|
|
857
|
-
exports.
|
|
858
|
-
exports.
|
|
859
|
-
exports.
|
|
860
|
-
exports.
|
|
861
|
-
exports.
|
|
862
|
-
exports.
|
|
17
|
+
|
|
18
|
+
exports.$toast = base.$toast;
|
|
19
|
+
exports.asyncWrapper = base.asyncWrapper;
|
|
20
|
+
exports.clearStorage = base.clearStorage;
|
|
21
|
+
exports.clone = base.clone;
|
|
22
|
+
exports.confirm = base.confirm;
|
|
23
|
+
exports.copy = base.copy;
|
|
24
|
+
exports.debounce = base.debounce;
|
|
25
|
+
exports.getStorage = base.getStorage;
|
|
26
|
+
exports.getType = base.getType;
|
|
27
|
+
exports.getVariable = base.getVariable;
|
|
28
|
+
exports.isEmpty = base.isEmpty;
|
|
29
|
+
exports.log = base.log;
|
|
30
|
+
exports.merge = base.merge;
|
|
31
|
+
exports.notEmpty = base.notEmpty;
|
|
32
|
+
exports.processWidth = base.processWidth;
|
|
33
|
+
exports.random = base.random;
|
|
34
|
+
exports.setStorage = base.setStorage;
|
|
35
|
+
exports.sleep = base.sleep;
|
|
36
|
+
exports.test = base.test;
|
|
37
|
+
exports.throttle = base.throttle;
|
|
38
|
+
exports.toLine = base.toLine;
|
|
39
|
+
exports.tryCatch = base.tryCatch;
|
|
40
|
+
exports.uuid = base.uuid;
|
|
41
|
+
exports.validForm = base.validForm;
|
|
42
|
+
exports.validate = base.validate;
|
|
43
|
+
exports.validateTrigger = base.validateTrigger;
|
|
44
|
+
exports.diffDate = day.diffDate;
|
|
45
|
+
exports.diffDateFromCurrent = day.diffDateFromCurrent;
|
|
46
|
+
exports.formatDate = day.formatDate;
|
|
47
|
+
exports.formatDateToDay = day.formatDateToDay;
|
|
48
|
+
exports.formatDateToMinute = day.formatDateToMinute;
|
|
49
|
+
exports.isArray = is.isArray;
|
|
50
|
+
exports.isBoolean = is.isBoolean;
|
|
51
|
+
exports.isComponent = is.isComponent;
|
|
52
|
+
exports.isDate = is.isDate;
|
|
53
|
+
exports.isEmptyObject = is.isEmptyObject;
|
|
54
|
+
exports.isFunction = is.isFunction;
|
|
55
|
+
exports.isIOS = is.isIOS;
|
|
56
|
+
exports.isMap = is.isMap;
|
|
57
|
+
exports.isNumber = is.isNumber;
|
|
58
|
+
exports.isObject = is.isObject;
|
|
59
|
+
exports.isPlainObject = is.isPlainObject;
|
|
60
|
+
exports.isPromise = is.isPromise;
|
|
61
|
+
exports.isRegExp = is.isRegExp;
|
|
62
|
+
exports.isSVGElement = is.isSVGElement;
|
|
63
|
+
exports.isSet = is.isSet;
|
|
64
|
+
exports.isString = is.isString;
|
|
65
|
+
exports.isStringNumber = is.isStringNumber;
|
|
66
|
+
exports.isSymbol = is.isSymbol;
|
|
67
|
+
exports.isUrl = is.isUrl;
|
|
68
|
+
exports.objectToString = is.objectToString;
|
|
69
|
+
exports.toRawType = is.toRawType;
|
|
70
|
+
exports.toTypeString = is.toTypeString;
|
|
71
|
+
exports.WS = ws.WS;
|
|
72
|
+
exports.formatBytes = format.formatBytes;
|
|
73
|
+
exports.formatBytesConvert = format.formatBytesConvert;
|
|
74
|
+
exports.formatDurationTime = format.formatDurationTime;
|
|
75
|
+
exports.formatImg = format.formatImg;
|
|
76
|
+
exports.formatTextToHtml = format.formatTextToHtml;
|
|
77
|
+
exports.formatThousands = format.formatThousands;
|
|
78
|
+
exports.formatTime = format.formatTime;
|
|
79
|
+
exports.formatToFixed = format.formatToFixed;
|
|
80
|
+
exports.onlyTest = test.onlyTest;
|