mgacn-commonsdk 1.1.9 → 1.2.1
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/{_plugin-vue_export-helper-BQvqIi3R.js → _plugin-vue_export-helper-C5bbN0Gq.js} +201 -181
- package/dist/mgacn-admin.js +1102 -1048
- package/dist/mgacn-commonsdk.js +837 -788
- package/dist/style.css +2 -2
- package/package.json +1 -1
package/dist/{_plugin-vue_export-helper-BQvqIi3R.js → _plugin-vue_export-helper-C5bbN0Gq.js}
RENAMED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
const
|
|
1
|
+
import F from "axios";
|
|
2
|
+
const D = "__MGACN_COMMONSDK_SYSTEM_ID__", P = "__MGACN_COMMONSDK_USER_ID__";
|
|
3
3
|
function G(t) {
|
|
4
|
-
globalThis[
|
|
4
|
+
globalThis[D] = t == null ? "" : String(t);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return globalThis[
|
|
6
|
+
function S() {
|
|
7
|
+
return globalThis[D] || "";
|
|
8
8
|
}
|
|
9
|
-
function
|
|
10
|
-
globalThis[
|
|
9
|
+
function H(t) {
|
|
10
|
+
globalThis[P] = t == null ? "" : String(t);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
return globalThis[
|
|
12
|
+
function K() {
|
|
13
|
+
return globalThis[P] || "";
|
|
14
14
|
}
|
|
15
|
-
function
|
|
15
|
+
function L(t = {}) {
|
|
16
16
|
const {
|
|
17
17
|
baseURL: e = "",
|
|
18
18
|
timeout: n = 6e4,
|
|
@@ -21,25 +21,25 @@ function K(t = {}) {
|
|
|
21
21
|
userId: s,
|
|
22
22
|
loginUrl: l = "/login"
|
|
23
23
|
} = t;
|
|
24
|
-
i != null && i !== "" && G(i), s != null && s !== "" &&
|
|
25
|
-
const
|
|
24
|
+
i != null && i !== "" && G(i), s != null && s !== "" && H(s);
|
|
25
|
+
const a = F.create({ baseURL: e, timeout: n });
|
|
26
26
|
let f = !1;
|
|
27
|
-
function
|
|
27
|
+
function c() {
|
|
28
28
|
typeof localStorage < "u" && localStorage.clear(), !f && (f = !0, setTimeout(() => {
|
|
29
29
|
typeof window < "u" && window.location.replace(l);
|
|
30
30
|
}, 1500));
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return a.interceptors.request.use(
|
|
33
33
|
(o) => {
|
|
34
34
|
if (o.headers["Content-Type"] = "application/json;charset=UTF-8", typeof localStorage < "u" && r) {
|
|
35
35
|
const m = localStorage.getItem(r);
|
|
36
36
|
m && (o.headers.Authorization = m);
|
|
37
37
|
}
|
|
38
|
-
const u =
|
|
38
|
+
const u = S();
|
|
39
39
|
return u && (o.headers.systemId = u), o;
|
|
40
40
|
},
|
|
41
41
|
(o) => Promise.reject(o)
|
|
42
|
-
),
|
|
42
|
+
), a.interceptors.response.use(
|
|
43
43
|
(o) => {
|
|
44
44
|
if (o.status !== 200)
|
|
45
45
|
return Promise.reject(new Error(`请求发生错误,状态码 ${o.status}`));
|
|
@@ -47,23 +47,23 @@ function K(t = {}) {
|
|
|
47
47
|
if (m.responseType === "arraybuffer" || m.responseType === "blob")
|
|
48
48
|
return u;
|
|
49
49
|
if (u && u.code === 0) return u.data;
|
|
50
|
-
const
|
|
51
|
-
if (
|
|
52
|
-
return
|
|
53
|
-
const
|
|
54
|
-
return
|
|
50
|
+
const y = Number(u == null ? void 0 : u.code);
|
|
51
|
+
if (y === 401 || y === 403)
|
|
52
|
+
return c(), Promise.reject(new Error("登录失效,请重新登录"));
|
|
53
|
+
const N = A(u) || "请求失败", g = new Error(N);
|
|
54
|
+
return g.code = y, g.data = u == null ? void 0 : u.data, g.biz = u, Promise.reject(g);
|
|
55
55
|
},
|
|
56
56
|
(o) => {
|
|
57
|
-
var
|
|
58
|
-
const u = (
|
|
57
|
+
var N, g;
|
|
58
|
+
const u = (N = o == null ? void 0 : o.response) == null ? void 0 : N.status;
|
|
59
59
|
if (u === 401 || u === 403)
|
|
60
|
-
return
|
|
61
|
-
const m = (
|
|
62
|
-
return Promise.reject(new Error(String(
|
|
60
|
+
return c(), Promise.reject(new Error("登录失效,请重新登录"));
|
|
61
|
+
const m = (g = o == null ? void 0 : o.response) == null ? void 0 : g.data, y = A(m) || (o == null ? void 0 : o.message) || "请求失败";
|
|
62
|
+
return Promise.reject(new Error(String(y)));
|
|
63
63
|
}
|
|
64
|
-
),
|
|
64
|
+
), a;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function A(t) {
|
|
67
67
|
if (t == null) return "";
|
|
68
68
|
if (typeof t == "string") {
|
|
69
69
|
const n = t.trim();
|
|
@@ -78,8 +78,8 @@ function E(t) {
|
|
|
78
78
|
}
|
|
79
79
|
return "";
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const e =
|
|
81
|
+
function gt(t = {}) {
|
|
82
|
+
const e = L(t);
|
|
83
83
|
return {
|
|
84
84
|
GET(n, r = {}) {
|
|
85
85
|
return e({ method: "get", url: n, ...r });
|
|
@@ -92,28 +92,28 @@ function mt(t = {}) {
|
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
const
|
|
96
|
-
function
|
|
97
|
-
globalThis[
|
|
95
|
+
const $ = "__MGACN_COMMONSDK_REQUEST__";
|
|
96
|
+
function pt(t) {
|
|
97
|
+
globalThis[$] = t;
|
|
98
98
|
}
|
|
99
|
-
function
|
|
100
|
-
const t = globalThis[
|
|
99
|
+
function B() {
|
|
100
|
+
const t = globalThis[$];
|
|
101
101
|
if (!t)
|
|
102
102
|
throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
|
|
103
103
|
return t;
|
|
104
104
|
}
|
|
105
|
-
function
|
|
105
|
+
function Y(t, e, n = "application/vnd.ms-excel") {
|
|
106
106
|
if (t == null || typeof window > "u") return;
|
|
107
107
|
const r = t instanceof Blob ? t : new Blob([t], { type: n }), i = window.URL.createObjectURL(r), s = document.createElement("a");
|
|
108
108
|
s.href = i, s.download = e || "download", s.style.display = "none", document.body.appendChild(s), s.click(), document.body.removeChild(s), window.URL.revokeObjectURL(i);
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function b(t) {
|
|
111
111
|
return String(t).padStart(2, "0");
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
return `${t.getFullYear()}${
|
|
113
|
+
function q(t = /* @__PURE__ */ new Date()) {
|
|
114
|
+
return `${t.getFullYear()}${b(t.getMonth() + 1)}${b(t.getDate())}${b(t.getHours())}${b(t.getMinutes())}${b(t.getSeconds())}`;
|
|
115
115
|
}
|
|
116
|
-
async function
|
|
116
|
+
async function z(t) {
|
|
117
117
|
if (!(t instanceof Blob) || !t.type || !/json/i.test(t.type)) return;
|
|
118
118
|
const e = await t.text();
|
|
119
119
|
let n = "导出失败";
|
|
@@ -124,7 +124,7 @@ async function q(t) {
|
|
|
124
124
|
}
|
|
125
125
|
throw new Error(n);
|
|
126
126
|
}
|
|
127
|
-
async function
|
|
127
|
+
async function k(t = {}) {
|
|
128
128
|
const {
|
|
129
129
|
url: e,
|
|
130
130
|
data: n,
|
|
@@ -135,106 +135,112 @@ async function z(t = {}) {
|
|
|
135
135
|
} = t;
|
|
136
136
|
if (!e) throw new Error("导出地址不能为空");
|
|
137
137
|
if (!s) throw new Error("导出文件名不能为空");
|
|
138
|
-
const
|
|
139
|
-
let
|
|
140
|
-
f === "GET" ?
|
|
141
|
-
const u = /\.[a-z0-9]+$/i.test(s) ? s : `${s}_${
|
|
142
|
-
return
|
|
143
|
-
}
|
|
144
|
-
let
|
|
145
|
-
function
|
|
138
|
+
const a = B(), f = String(i).toUpperCase();
|
|
139
|
+
let c;
|
|
140
|
+
f === "GET" ? c = await a.GET(e, { params: r, responseType: "blob" }) : c = await a.POST(e, n, { responseType: "blob" }), await z(c);
|
|
141
|
+
const u = /\.[a-z0-9]+$/i.test(s) ? s : `${s}_${q()}.${l}`;
|
|
142
|
+
return Y(c, u), u;
|
|
143
|
+
}
|
|
144
|
+
let d = null, p = null;
|
|
145
|
+
function Q(t, e) {
|
|
146
146
|
if (!t || e == null || e === "") return !1;
|
|
147
147
|
if (typeof e == "object")
|
|
148
148
|
return e.id != null && e.id !== "" && String(t.id) === String(e.id) || e.platformName != null && e.platformName !== "" && String(t.platformName || "") === String(e.platformName).trim();
|
|
149
149
|
const n = String(e).trim();
|
|
150
150
|
return t.id != null && String(t.id) === n || String(t.platformName || "") === n;
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
|
|
152
|
+
function I(t) {
|
|
153
|
+
d = Array.isArray(t) ? t : [];
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
|
|
155
|
+
function X() {
|
|
156
|
+
d = null, p = null;
|
|
157
157
|
}
|
|
158
|
-
function
|
|
159
|
-
if (!Array.isArray(
|
|
160
|
-
const e =
|
|
158
|
+
function J(t) {
|
|
159
|
+
if (!Array.isArray(d) || !d.length) return "";
|
|
160
|
+
const e = d.find((n) => Q(n, t));
|
|
161
161
|
return (e == null ? void 0 : e.platformLogo) || "";
|
|
162
162
|
}
|
|
163
|
-
async function
|
|
164
|
-
|
|
165
|
-
|
|
163
|
+
async function Z() {
|
|
164
|
+
return d ?? (p || (p = (async () => {
|
|
165
|
+
try {
|
|
166
|
+
const t = await lt().listPlatformInfoAll();
|
|
167
|
+
return I(t), d;
|
|
168
|
+
} finally {
|
|
169
|
+
p = null;
|
|
170
|
+
}
|
|
171
|
+
})(), p));
|
|
166
172
|
}
|
|
167
|
-
function
|
|
173
|
+
function O(t) {
|
|
168
174
|
const e = String(t || "").trim().toUpperCase();
|
|
169
175
|
if (/^\d{15}$/.test(e)) {
|
|
170
|
-
const
|
|
171
|
-
return m.getFullYear() ===
|
|
176
|
+
const c = +`19${e.slice(6, 8)}`, o = Number(e.slice(8, 10)), u = Number(e.slice(10, 12)), m = new Date(c, o - 1, u);
|
|
177
|
+
return m.getFullYear() === c && m.getMonth() + 1 === o && m.getDate() === u;
|
|
172
178
|
}
|
|
173
179
|
if (!/^\d{17}[\dX]$/.test(e)) return !1;
|
|
174
180
|
const n = Number(e.slice(6, 10)), r = Number(e.slice(10, 12)), i = Number(e.slice(12, 14)), s = new Date(n, r - 1, i);
|
|
175
181
|
if (s.getFullYear() !== n || s.getMonth() + 1 !== r || s.getDate() !== i) return !1;
|
|
176
|
-
const l = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2],
|
|
182
|
+
const l = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], a = "10X98765432";
|
|
177
183
|
let f = 0;
|
|
178
|
-
for (let
|
|
179
|
-
return
|
|
184
|
+
for (let c = 0; c < 17; c++) f += Number(e[c]) * l[c];
|
|
185
|
+
return a[f % 11] === e[17];
|
|
180
186
|
}
|
|
181
|
-
function
|
|
187
|
+
function C(t) {
|
|
182
188
|
const e = String(t || "").trim().replace(/\s+/g, "");
|
|
183
189
|
return e ? /^1\d{10}$/.test(e) || /^\+[1-9]\d{6,14}$/.test(e) : !1;
|
|
184
190
|
}
|
|
185
|
-
function
|
|
191
|
+
function x(t) {
|
|
186
192
|
const e = String(t || "").trim();
|
|
187
193
|
return e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) : !1;
|
|
188
194
|
}
|
|
189
195
|
function _(t) {
|
|
190
196
|
return t == null || t === "";
|
|
191
197
|
}
|
|
192
|
-
function
|
|
198
|
+
function V(t, e, n) {
|
|
193
199
|
if (_(e)) {
|
|
194
200
|
n();
|
|
195
201
|
return;
|
|
196
202
|
}
|
|
197
|
-
if (!
|
|
203
|
+
if (!O(e)) {
|
|
198
204
|
n(new Error("请输入正确的身份证号(15/18位)"));
|
|
199
205
|
return;
|
|
200
206
|
}
|
|
201
207
|
n();
|
|
202
208
|
}
|
|
203
|
-
function
|
|
209
|
+
function W(t, e, n) {
|
|
204
210
|
if (_(e)) {
|
|
205
211
|
n();
|
|
206
212
|
return;
|
|
207
213
|
}
|
|
208
|
-
if (!
|
|
214
|
+
if (!C(e)) {
|
|
209
215
|
n(new Error("请输入正确的国内或海外手机号"));
|
|
210
216
|
return;
|
|
211
217
|
}
|
|
212
218
|
n();
|
|
213
219
|
}
|
|
214
|
-
function
|
|
220
|
+
function v(t, e, n) {
|
|
215
221
|
if (_(e)) {
|
|
216
222
|
n();
|
|
217
223
|
return;
|
|
218
224
|
}
|
|
219
|
-
if (!
|
|
225
|
+
if (!x(e)) {
|
|
220
226
|
n(new Error("请输入正确的邮箱"));
|
|
221
227
|
return;
|
|
222
228
|
}
|
|
223
229
|
n();
|
|
224
230
|
}
|
|
225
|
-
function
|
|
231
|
+
function tt(t) {
|
|
226
232
|
return !!(t == null || typeof t == "string" && t.trim() === "" || Array.isArray(t) && t.length === 0 || typeof t == "object" && !Array.isArray(t) && Object.keys(t).length === 0);
|
|
227
233
|
}
|
|
228
|
-
function
|
|
234
|
+
function T(t) {
|
|
229
235
|
if (t === null || typeof t != "object") return t;
|
|
230
236
|
if (t instanceof Date) return new Date(t.getTime());
|
|
231
|
-
if (Array.isArray(t)) return t.map((n) =>
|
|
237
|
+
if (Array.isArray(t)) return t.map((n) => T(n));
|
|
232
238
|
const e = {};
|
|
233
239
|
return Object.keys(t).forEach((n) => {
|
|
234
|
-
e[n] =
|
|
240
|
+
e[n] = T(t[n]);
|
|
235
241
|
}), e;
|
|
236
242
|
}
|
|
237
|
-
function
|
|
243
|
+
function et(t, e = 300) {
|
|
238
244
|
let n = null;
|
|
239
245
|
return function(...i) {
|
|
240
246
|
n && clearTimeout(n), n = setTimeout(() => {
|
|
@@ -242,14 +248,14 @@ function tt(t, e = 300) {
|
|
|
242
248
|
}, e);
|
|
243
249
|
};
|
|
244
250
|
}
|
|
245
|
-
function
|
|
251
|
+
function nt(t, e = 300) {
|
|
246
252
|
let n = 0;
|
|
247
253
|
return function(...i) {
|
|
248
254
|
const s = Date.now();
|
|
249
255
|
s - n >= e && (n = s, t.apply(this, i));
|
|
250
256
|
};
|
|
251
257
|
}
|
|
252
|
-
function
|
|
258
|
+
function R(t) {
|
|
253
259
|
if (t == null || t === "") return null;
|
|
254
260
|
if (t instanceof Date)
|
|
255
261
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
@@ -271,13 +277,13 @@ function C(t) {
|
|
|
271
277
|
/^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?(?:[\sT]+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\.(\d{1,3}))?)?/
|
|
272
278
|
);
|
|
273
279
|
if (n) {
|
|
274
|
-
const [, i, s, l,
|
|
280
|
+
const [, i, s, l, a = "0", f = "0", c = "0", o = "0"] = n, u = new Date(
|
|
275
281
|
Number(i),
|
|
276
282
|
Number(s) - 1,
|
|
277
283
|
Number(l),
|
|
278
|
-
Number(c),
|
|
279
|
-
Number(f),
|
|
280
284
|
Number(a),
|
|
285
|
+
Number(f),
|
|
286
|
+
Number(c),
|
|
281
287
|
Number(String(o).padEnd(3, "0"))
|
|
282
288
|
);
|
|
283
289
|
return Number.isNaN(u.getTime()) ? null : u;
|
|
@@ -285,31 +291,31 @@ function C(t) {
|
|
|
285
291
|
const r = new Date(e);
|
|
286
292
|
return Number.isNaN(r.getTime()) ? null : r;
|
|
287
293
|
}
|
|
288
|
-
function
|
|
289
|
-
const n =
|
|
294
|
+
function w(t, e = "YYYY-MM-DD HH:mm:ss") {
|
|
295
|
+
const n = R(t);
|
|
290
296
|
if (!n) return "";
|
|
291
|
-
const r = n.getFullYear(), i = n.getMonth() + 1, s = n.getDate(), l = n.getHours(),
|
|
297
|
+
const r = n.getFullYear(), i = n.getMonth() + 1, s = n.getDate(), l = n.getHours(), a = n.getMinutes(), f = n.getSeconds(), c = {
|
|
292
298
|
YYYY: String(r),
|
|
293
299
|
MM: String(i).padStart(2, "0"),
|
|
294
300
|
DD: String(s).padStart(2, "0"),
|
|
295
301
|
HH: String(l).padStart(2, "0"),
|
|
296
|
-
mm: String(
|
|
302
|
+
mm: String(a).padStart(2, "0"),
|
|
297
303
|
ss: String(f).padStart(2, "0"),
|
|
298
304
|
M: String(i),
|
|
299
305
|
D: String(s),
|
|
300
306
|
H: String(l),
|
|
301
|
-
m: String(
|
|
307
|
+
m: String(a),
|
|
302
308
|
s: String(f)
|
|
303
309
|
};
|
|
304
|
-
return e.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (o) =>
|
|
310
|
+
return e.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (o) => c[o]);
|
|
305
311
|
}
|
|
306
|
-
function
|
|
312
|
+
function rt() {
|
|
307
313
|
const t = /* @__PURE__ */ new Date();
|
|
308
314
|
t.setHours(23, 59, 59, 0);
|
|
309
315
|
const e = /* @__PURE__ */ new Date();
|
|
310
316
|
return e.setDate(e.getDate() - 30), e.setHours(0, 0, 0, 0), {
|
|
311
|
-
start:
|
|
312
|
-
end:
|
|
317
|
+
start: w(e, "YYYY-MM-DD HH:mm:ss"),
|
|
318
|
+
end: w(t, "YYYY-MM-DD HH:mm:ss")
|
|
313
319
|
};
|
|
314
320
|
}
|
|
315
321
|
function h(t) {
|
|
@@ -319,78 +325,90 @@ function h(t) {
|
|
|
319
325
|
r == null || r === "" || Array.isArray(r) && r.length === 0 || (e[n] = r);
|
|
320
326
|
}), e;
|
|
321
327
|
}
|
|
322
|
-
function
|
|
323
|
-
|
|
328
|
+
function it(t) {
|
|
329
|
+
return t == null || t === "" ? "-" : t;
|
|
330
|
+
}
|
|
331
|
+
function M(t, e = 2) {
|
|
332
|
+
if (!Number.isFinite(t)) return t;
|
|
333
|
+
const n = Math.max(0, Math.floor(Number(e) || 0));
|
|
334
|
+
return +(Math.round(+`${t}e${n}`) + `e-${n}`);
|
|
335
|
+
}
|
|
336
|
+
function E(t, e = 2) {
|
|
337
|
+
if (t == null || t === "") return "-";
|
|
324
338
|
const n = Number(t);
|
|
325
339
|
if (Number.isNaN(n)) return t;
|
|
326
|
-
const r = n.toFixed(e), [i, s] = r.split("."), l = i.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
340
|
+
const r = M(n, e).toFixed(e), [i, s] = r.split("."), l = i.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
327
341
|
if (s == null) return l;
|
|
328
|
-
const
|
|
329
|
-
return
|
|
342
|
+
const a = s.replace(/0+$/, "");
|
|
343
|
+
return a ? `${l}.${a}` : l;
|
|
330
344
|
}
|
|
331
|
-
function
|
|
345
|
+
function st(t) {
|
|
332
346
|
if (t == null || t === "") return "-";
|
|
333
347
|
const e = Number(t);
|
|
334
|
-
return Number.isNaN(e) ? "-" : Math.abs(e) > 1e4 ? `${
|
|
348
|
+
return Number.isNaN(e) ? "-" : Math.abs(e) > 1e4 ? `${E(e / 1e4, 2)}w` : String(E(e, 0));
|
|
349
|
+
}
|
|
350
|
+
function ot(t, e = 4, n = "toDecimal") {
|
|
351
|
+
if (n === "toPercent" || n === "toPercentText") {
|
|
352
|
+
if (t == null || t === "") return n === "toPercentText" ? "-" : t;
|
|
353
|
+
const i = Number(t);
|
|
354
|
+
if (!Number.isFinite(i) || Number.isNaN(i)) return n === "toPercentText" ? "-" : t;
|
|
355
|
+
if (i === 0) return n === "toPercentText" ? "0%" : 0;
|
|
356
|
+
const s = Number(String(Number((i * 100).toFixed(2))).replace(/(?:\.0*|(\.\d+?)0+)$/, "$1"));
|
|
357
|
+
return n === "toPercentText" ? `${s}%` : s;
|
|
358
|
+
}
|
|
359
|
+
if (t === "" || t == null) return;
|
|
360
|
+
const r = Number(t);
|
|
361
|
+
if (Number.isFinite(r))
|
|
362
|
+
return Number((r / 100).toFixed(e));
|
|
335
363
|
}
|
|
336
|
-
function
|
|
337
|
-
if (t
|
|
364
|
+
function ut(t) {
|
|
365
|
+
if (t === "" || t == null) return "";
|
|
338
366
|
const e = Number(t);
|
|
339
|
-
return
|
|
367
|
+
return Number.isFinite(e) ? e : "";
|
|
340
368
|
}
|
|
341
|
-
function
|
|
342
|
-
if (t == null || t === "") return "-";
|
|
343
|
-
const e = R(t);
|
|
344
|
-
return e == null || e === "" || Number.isNaN(Number(e)) ? "-" : `${e}%`;
|
|
345
|
-
}
|
|
346
|
-
function st(t, e = 4) {
|
|
347
|
-
if (t === "" || t == null) return;
|
|
348
|
-
const n = Number(t);
|
|
349
|
-
if (Number.isFinite(n))
|
|
350
|
-
return Number((n / 100).toFixed(e));
|
|
351
|
-
}
|
|
352
|
-
function ot(t, e = 2, n = 9999999999999) {
|
|
369
|
+
function ct(t, e = 2, n = 9999999999999) {
|
|
353
370
|
if (t === 0 || t === "0") return 0;
|
|
354
371
|
if (t == null || t === "") return "";
|
|
355
372
|
let r = Number(t);
|
|
356
373
|
if (!Number.isFinite(r)) return "";
|
|
357
374
|
const i = Number(n), s = Number.isFinite(i) ? Math.abs(i) : 9999999999999;
|
|
358
|
-
return Math.abs(r) >= s && (r = r < 0 ? -s : s), Number.isInteger(r) ? r :
|
|
375
|
+
return Math.abs(r) >= s && (r = r < 0 ? -s : s), Number.isInteger(r) ? r : M(r, e);
|
|
359
376
|
}
|
|
360
|
-
function
|
|
377
|
+
function at(t = "id") {
|
|
361
378
|
return `${t}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
362
379
|
}
|
|
363
|
-
const
|
|
380
|
+
const yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
364
381
|
__proto__: null,
|
|
365
|
-
cleanNumber:
|
|
382
|
+
cleanNumber: ct,
|
|
366
383
|
cleanParams: h,
|
|
367
|
-
clearPlatformCache:
|
|
368
|
-
debounce:
|
|
369
|
-
deepClone:
|
|
370
|
-
downloadBlob:
|
|
371
|
-
exportFile:
|
|
372
|
-
findPlatformLogo:
|
|
373
|
-
formatDate:
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
setPlatformCache:
|
|
386
|
-
throttle:
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
384
|
+
clearPlatformCache: X,
|
|
385
|
+
debounce: et,
|
|
386
|
+
deepClone: T,
|
|
387
|
+
downloadBlob: Y,
|
|
388
|
+
exportFile: k,
|
|
389
|
+
findPlatformLogo: J,
|
|
390
|
+
formatDate: w,
|
|
391
|
+
formatEmpty: it,
|
|
392
|
+
formatFansCount: st,
|
|
393
|
+
formatNum: E,
|
|
394
|
+
getRecentMonthRange: rt,
|
|
395
|
+
isEmail: x,
|
|
396
|
+
isEmpty: tt,
|
|
397
|
+
isMainlandIdCard: O,
|
|
398
|
+
isMobile: C,
|
|
399
|
+
parseDate: R,
|
|
400
|
+
preloadPlatformList: Z,
|
|
401
|
+
roundHalfUp: M,
|
|
402
|
+
setPlatformCache: I,
|
|
403
|
+
throttle: nt,
|
|
404
|
+
toNumberOrEmpty: ut,
|
|
405
|
+
toRebateRatio: ot,
|
|
406
|
+
uniqueId: at,
|
|
407
|
+
validateEmail: v,
|
|
408
|
+
validateIdCardNo: V,
|
|
409
|
+
validateMobile: W
|
|
392
410
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
393
|
-
function
|
|
411
|
+
function bt(t) {
|
|
394
412
|
if (!t)
|
|
395
413
|
throw new Error("[mgacn-commonsdk] createApi 需要传入 request 实例");
|
|
396
414
|
return {
|
|
@@ -434,7 +452,7 @@ function pt(t) {
|
|
|
434
452
|
"/yhAdmin/user/queryUserByRoleName",
|
|
435
453
|
h({
|
|
436
454
|
...r,
|
|
437
|
-
systemId:
|
|
455
|
+
systemId: S()
|
|
438
456
|
})
|
|
439
457
|
);
|
|
440
458
|
return Array.isArray(i) ? i : Array.isArray(i == null ? void 0 : i.result) ? i.result : Array.isArray(i == null ? void 0 : i.list) ? i.list : [];
|
|
@@ -479,8 +497,8 @@ function pt(t) {
|
|
|
479
497
|
"/yhAdmin/trace/addTraceData",
|
|
480
498
|
h({
|
|
481
499
|
...s,
|
|
482
|
-
userId:
|
|
483
|
-
projectId:
|
|
500
|
+
userId: K(),
|
|
501
|
+
projectId: S(),
|
|
484
502
|
clientType: 1
|
|
485
503
|
})
|
|
486
504
|
);
|
|
@@ -491,59 +509,61 @@ function pt(t) {
|
|
|
491
509
|
}
|
|
492
510
|
};
|
|
493
511
|
}
|
|
494
|
-
const
|
|
495
|
-
function
|
|
496
|
-
globalThis[
|
|
512
|
+
const j = "__MGACN_COMMONSDK_API__";
|
|
513
|
+
function ht(t) {
|
|
514
|
+
globalThis[j] = t;
|
|
497
515
|
}
|
|
498
|
-
function
|
|
499
|
-
const t = globalThis[
|
|
516
|
+
function lt() {
|
|
517
|
+
const t = globalThis[j];
|
|
500
518
|
if (!t)
|
|
501
519
|
throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
|
|
502
520
|
return t;
|
|
503
521
|
}
|
|
504
|
-
const
|
|
505
|
-
function
|
|
506
|
-
globalThis[
|
|
522
|
+
const U = "__MGACN_COMMONSDK_PERMISSION_GETTER__";
|
|
523
|
+
function Nt(t) {
|
|
524
|
+
globalThis[U] = typeof t == "function" ? t : null;
|
|
507
525
|
}
|
|
508
|
-
function
|
|
509
|
-
return globalThis[
|
|
526
|
+
function ft() {
|
|
527
|
+
return globalThis[U] || null;
|
|
510
528
|
}
|
|
511
|
-
function
|
|
529
|
+
function mt(t, e, n = "and") {
|
|
512
530
|
const r = (Array.isArray(e) ? e : [e]).map((s) => String(s ?? "").trim()).filter(Boolean);
|
|
513
531
|
if (!r.length) return !0;
|
|
514
532
|
const i = new Set((t || []).map(String));
|
|
515
533
|
return n === "or" ? r.some((s) => i.has(s)) : r.every((s) => i.has(s));
|
|
516
534
|
}
|
|
517
|
-
function
|
|
518
|
-
const n =
|
|
519
|
-
return typeof n != "function" ? !0 :
|
|
535
|
+
function St(t, e = "and") {
|
|
536
|
+
const n = ft();
|
|
537
|
+
return typeof n != "function" ? !0 : mt(n(), t, e);
|
|
520
538
|
}
|
|
521
|
-
const
|
|
539
|
+
const Tt = (t, e) => {
|
|
522
540
|
const n = t.__vccOpts || t;
|
|
523
541
|
for (const [r, i] of e)
|
|
524
542
|
n[r] = i;
|
|
525
543
|
return n;
|
|
526
544
|
};
|
|
527
545
|
export {
|
|
528
|
-
|
|
546
|
+
Tt as _,
|
|
529
547
|
G as a,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
548
|
+
B as b,
|
|
549
|
+
mt as c,
|
|
550
|
+
T as d,
|
|
533
551
|
h as e,
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
552
|
+
et as f,
|
|
553
|
+
lt as g,
|
|
554
|
+
E as h,
|
|
555
|
+
it as i,
|
|
556
|
+
St as j,
|
|
557
|
+
Nt as k,
|
|
558
|
+
gt as l,
|
|
559
|
+
bt as m,
|
|
560
|
+
pt as n,
|
|
561
|
+
ht as o,
|
|
562
|
+
L as p,
|
|
563
|
+
ft as q,
|
|
564
|
+
S as r,
|
|
565
|
+
H as s,
|
|
566
|
+
ot as t,
|
|
567
|
+
K as u,
|
|
568
|
+
yt as v
|
|
549
569
|
};
|