mgacn-commonsdk 1.1.4 → 1.1.6
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-CMKnyAmb.js → _plugin-vue_export-helper-BB-eAkEJ.js} +143 -126
- package/dist/mgacn-admin.js +1226 -1161
- package/dist/mgacn-commonsdk.js +912 -823
- package/dist/style.css +2 -2
- package/package.json +1 -1
package/dist/{_plugin-vue_export-helper-CMKnyAmb.js → _plugin-vue_export-helper-BB-eAkEJ.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import U from "axios";
|
|
2
|
-
const
|
|
2
|
+
const A = "__MGACN_COMMONSDK_SYSTEM_ID__", M = "__MGACN_COMMONSDK_USER_ID__";
|
|
3
3
|
function G(t) {
|
|
4
|
-
globalThis[
|
|
4
|
+
globalThis[A] = t == null ? "" : String(t);
|
|
5
5
|
}
|
|
6
|
-
function
|
|
7
|
-
return globalThis[
|
|
6
|
+
function N() {
|
|
7
|
+
return globalThis[A] || "";
|
|
8
8
|
}
|
|
9
9
|
function F(t) {
|
|
10
10
|
globalThis[M] = t == null ? "" : String(t);
|
|
@@ -17,11 +17,11 @@ function K(t = {}) {
|
|
|
17
17
|
baseURL: e = "",
|
|
18
18
|
timeout: n = 6e4,
|
|
19
19
|
tokenKey: r,
|
|
20
|
-
systemId:
|
|
21
|
-
userId:
|
|
20
|
+
systemId: i,
|
|
21
|
+
userId: s,
|
|
22
22
|
loginUrl: l = "/login"
|
|
23
23
|
} = t;
|
|
24
|
-
|
|
24
|
+
i != null && i !== "" && G(i), s != null && s !== "" && F(s);
|
|
25
25
|
const c = U.create({ baseURL: e, timeout: n });
|
|
26
26
|
let f = !1;
|
|
27
27
|
function a() {
|
|
@@ -30,40 +30,40 @@ function K(t = {}) {
|
|
|
30
30
|
}, 1500));
|
|
31
31
|
}
|
|
32
32
|
return c.interceptors.request.use(
|
|
33
|
-
(
|
|
34
|
-
if (
|
|
33
|
+
(o) => {
|
|
34
|
+
if (o.headers["Content-Type"] = "application/json;charset=UTF-8", typeof localStorage < "u" && r) {
|
|
35
35
|
const m = localStorage.getItem(r);
|
|
36
|
-
m && (
|
|
36
|
+
m && (o.headers.Authorization = m);
|
|
37
37
|
}
|
|
38
|
-
const u =
|
|
39
|
-
return u && (
|
|
38
|
+
const u = N();
|
|
39
|
+
return u && (o.headers.systemId = u), o;
|
|
40
40
|
},
|
|
41
|
-
(
|
|
41
|
+
(o) => Promise.reject(o)
|
|
42
42
|
), c.interceptors.response.use(
|
|
43
|
-
(
|
|
44
|
-
if (
|
|
45
|
-
return Promise.reject(new Error(`请求发生错误,状态码 ${
|
|
46
|
-
const { data: u, config: m } =
|
|
43
|
+
(o) => {
|
|
44
|
+
if (o.status !== 200)
|
|
45
|
+
return Promise.reject(new Error(`请求发生错误,状态码 ${o.status}`));
|
|
46
|
+
const { data: u, config: m } = o;
|
|
47
47
|
if (m.responseType === "arraybuffer" || m.responseType === "blob")
|
|
48
48
|
return u;
|
|
49
49
|
if (u && u.code === 0) return u.data;
|
|
50
50
|
const p = Number(u == null ? void 0 : u.code);
|
|
51
51
|
if (p === 401 || p === 403)
|
|
52
52
|
return a(), Promise.reject(new Error("登录失效,请重新登录"));
|
|
53
|
-
const b =
|
|
53
|
+
const b = E(u) || "请求失败", d = new Error(b);
|
|
54
54
|
return d.code = p, d.data = u == null ? void 0 : u.data, d.biz = u, Promise.reject(d);
|
|
55
55
|
},
|
|
56
|
-
(
|
|
56
|
+
(o) => {
|
|
57
57
|
var b, d;
|
|
58
|
-
const u = (b =
|
|
58
|
+
const u = (b = o == null ? void 0 : o.response) == null ? void 0 : b.status;
|
|
59
59
|
if (u === 401 || u === 403)
|
|
60
60
|
return a(), Promise.reject(new Error("登录失效,请重新登录"));
|
|
61
|
-
const m = (d =
|
|
61
|
+
const m = (d = o == null ? void 0 : o.response) == null ? void 0 : d.data, p = E(m) || (o == null ? void 0 : o.message) || "请求失败";
|
|
62
62
|
return Promise.reject(new Error(String(p)));
|
|
63
63
|
}
|
|
64
64
|
), c;
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function E(t) {
|
|
67
67
|
if (t == null) return "";
|
|
68
68
|
if (typeof t == "string") {
|
|
69
69
|
const n = t.trim();
|
|
@@ -84,36 +84,36 @@ function mt(t = {}) {
|
|
|
84
84
|
GET(n, r = {}) {
|
|
85
85
|
return e({ method: "get", url: n, ...r });
|
|
86
86
|
},
|
|
87
|
-
POST(n, r,
|
|
88
|
-
return e({ method: "post", url: n, data: r, ...
|
|
87
|
+
POST(n, r, i = {}) {
|
|
88
|
+
return e({ method: "post", url: n, data: r, ...i });
|
|
89
89
|
},
|
|
90
90
|
DELETE(n, r = {}) {
|
|
91
91
|
return e({ method: "delete", url: n, ...r });
|
|
92
92
|
}
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
const
|
|
95
|
+
const D = "__MGACN_COMMONSDK_REQUEST__";
|
|
96
96
|
function dt(t) {
|
|
97
|
-
globalThis[
|
|
97
|
+
globalThis[D] = t;
|
|
98
98
|
}
|
|
99
99
|
function L() {
|
|
100
|
-
const t = globalThis[
|
|
100
|
+
const t = globalThis[D];
|
|
101
101
|
if (!t)
|
|
102
102
|
throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
|
|
103
103
|
return t;
|
|
104
104
|
}
|
|
105
105
|
function $(t, e, n = "application/vnd.ms-excel") {
|
|
106
106
|
if (t == null || typeof window > "u") return;
|
|
107
|
-
const r = t instanceof Blob ? t : new Blob([t], { type: n }),
|
|
108
|
-
|
|
107
|
+
const r = t instanceof Blob ? t : new Blob([t], { type: n }), i = window.URL.createObjectURL(r), s = document.createElement("a");
|
|
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 y(t) {
|
|
111
111
|
return String(t).padStart(2, "0");
|
|
112
112
|
}
|
|
113
113
|
function B(t = /* @__PURE__ */ new Date()) {
|
|
114
|
-
return `${t.getFullYear()}${
|
|
114
|
+
return `${t.getFullYear()}${y(t.getMonth() + 1)}${y(t.getDate())}${y(t.getHours())}${y(t.getMinutes())}${y(t.getSeconds())}`;
|
|
115
115
|
}
|
|
116
|
-
async function
|
|
116
|
+
async function q(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,25 +124,25 @@ async function z(t) {
|
|
|
124
124
|
}
|
|
125
125
|
throw new Error(n);
|
|
126
126
|
}
|
|
127
|
-
async function
|
|
127
|
+
async function z(t = {}) {
|
|
128
128
|
const {
|
|
129
129
|
url: e,
|
|
130
130
|
data: n,
|
|
131
131
|
params: r,
|
|
132
|
-
method:
|
|
133
|
-
filename:
|
|
132
|
+
method: i = "POST",
|
|
133
|
+
filename: s,
|
|
134
134
|
ext: l = "xlsx"
|
|
135
135
|
} = t;
|
|
136
136
|
if (!e) throw new Error("导出地址不能为空");
|
|
137
|
-
if (!
|
|
138
|
-
const c = L(), f = String(
|
|
137
|
+
if (!s) throw new Error("导出文件名不能为空");
|
|
138
|
+
const c = L(), f = String(i).toUpperCase();
|
|
139
139
|
let a;
|
|
140
|
-
f === "GET" ? a = await c.GET(e, { params: r, responseType: "blob" }) : a = await c.POST(e, n, { responseType: "blob" }), await
|
|
141
|
-
const u = /\.[a-z0-9]+$/i.test(
|
|
140
|
+
f === "GET" ? a = await c.GET(e, { params: r, responseType: "blob" }) : a = await c.POST(e, n, { responseType: "blob" }), await q(a);
|
|
141
|
+
const u = /\.[a-z0-9]+$/i.test(s) ? s : `${s}_${B()}.${l}`;
|
|
142
142
|
return $(a, u), u;
|
|
143
143
|
}
|
|
144
144
|
let g = null;
|
|
145
|
-
function
|
|
145
|
+
function k(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();
|
|
@@ -157,22 +157,22 @@ function Q() {
|
|
|
157
157
|
}
|
|
158
158
|
function X(t) {
|
|
159
159
|
if (!Array.isArray(g) || !g.length) return "";
|
|
160
|
-
const e = g.find((n) =>
|
|
160
|
+
const e = g.find((n) => k(n, t));
|
|
161
161
|
return (e == null ? void 0 : e.platformLogo) || "";
|
|
162
162
|
}
|
|
163
163
|
async function J() {
|
|
164
164
|
const t = await at().listPlatformInfoAll();
|
|
165
165
|
return Y(t), g;
|
|
166
166
|
}
|
|
167
|
-
function
|
|
167
|
+
function I(t) {
|
|
168
168
|
const e = String(t || "").trim().toUpperCase();
|
|
169
169
|
if (/^\d{15}$/.test(e)) {
|
|
170
|
-
const a = +`19${e.slice(6, 8)}`,
|
|
171
|
-
return m.getFullYear() === a && m.getMonth() + 1 ===
|
|
170
|
+
const a = +`19${e.slice(6, 8)}`, o = Number(e.slice(8, 10)), u = Number(e.slice(10, 12)), m = new Date(a, o - 1, u);
|
|
171
|
+
return m.getFullYear() === a && m.getMonth() + 1 === o && m.getDate() === u;
|
|
172
172
|
}
|
|
173
173
|
if (!/^\d{17}[\dX]$/.test(e)) return !1;
|
|
174
|
-
const n = Number(e.slice(6, 10)), r = Number(e.slice(10, 12)),
|
|
175
|
-
if (
|
|
174
|
+
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
|
+
if (s.getFullYear() !== n || s.getMonth() + 1 !== r || s.getDate() !== i) return !1;
|
|
176
176
|
const l = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2], c = "10X98765432";
|
|
177
177
|
let f = 0;
|
|
178
178
|
for (let a = 0; a < 17; a++) f += Number(e[a]) * l[a];
|
|
@@ -186,22 +186,22 @@ function P(t) {
|
|
|
186
186
|
const e = String(t || "").trim();
|
|
187
187
|
return e ? /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e) : !1;
|
|
188
188
|
}
|
|
189
|
-
function
|
|
189
|
+
function _(t) {
|
|
190
190
|
return t == null || t === "";
|
|
191
191
|
}
|
|
192
192
|
function Z(t, e, n) {
|
|
193
|
-
if (
|
|
193
|
+
if (_(e)) {
|
|
194
194
|
n();
|
|
195
195
|
return;
|
|
196
196
|
}
|
|
197
|
-
if (!
|
|
197
|
+
if (!I(e)) {
|
|
198
198
|
n(new Error("请输入正确的身份证号(15/18位)"));
|
|
199
199
|
return;
|
|
200
200
|
}
|
|
201
201
|
n();
|
|
202
202
|
}
|
|
203
203
|
function V(t, e, n) {
|
|
204
|
-
if (
|
|
204
|
+
if (_(e)) {
|
|
205
205
|
n();
|
|
206
206
|
return;
|
|
207
207
|
}
|
|
@@ -212,7 +212,7 @@ function V(t, e, n) {
|
|
|
212
212
|
n();
|
|
213
213
|
}
|
|
214
214
|
function W(t, e, n) {
|
|
215
|
-
if (
|
|
215
|
+
if (_(e)) {
|
|
216
216
|
n();
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
@@ -225,166 +225,166 @@ function W(t, e, n) {
|
|
|
225
225
|
function v(t) {
|
|
226
226
|
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
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function S(t) {
|
|
229
229
|
if (t === null || typeof t != "object") return t;
|
|
230
230
|
if (t instanceof Date) return new Date(t.getTime());
|
|
231
|
-
if (Array.isArray(t)) return t.map((n) =>
|
|
231
|
+
if (Array.isArray(t)) return t.map((n) => S(n));
|
|
232
232
|
const e = {};
|
|
233
233
|
return Object.keys(t).forEach((n) => {
|
|
234
|
-
e[n] =
|
|
234
|
+
e[n] = S(t[n]);
|
|
235
235
|
}), e;
|
|
236
236
|
}
|
|
237
237
|
function tt(t, e = 300) {
|
|
238
238
|
let n = null;
|
|
239
|
-
return function(...
|
|
239
|
+
return function(...i) {
|
|
240
240
|
n && clearTimeout(n), n = setTimeout(() => {
|
|
241
|
-
t.apply(this,
|
|
241
|
+
t.apply(this, i);
|
|
242
242
|
}, e);
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
245
|
function et(t, e = 300) {
|
|
246
246
|
let n = 0;
|
|
247
|
-
return function(...
|
|
248
|
-
const
|
|
249
|
-
|
|
247
|
+
return function(...i) {
|
|
248
|
+
const s = Date.now();
|
|
249
|
+
s - n >= e && (n = s, t.apply(this, i));
|
|
250
250
|
};
|
|
251
251
|
}
|
|
252
|
-
function
|
|
252
|
+
function C(t) {
|
|
253
253
|
if (t == null || t === "") return null;
|
|
254
254
|
if (t instanceof Date)
|
|
255
255
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
256
256
|
if (typeof t == "number") {
|
|
257
|
-
const
|
|
258
|
-
return Number.isNaN(
|
|
257
|
+
const i = new Date(t);
|
|
258
|
+
return Number.isNaN(i.getTime()) ? null : i;
|
|
259
259
|
}
|
|
260
260
|
const e = String(t).trim();
|
|
261
261
|
if (!e) return null;
|
|
262
262
|
if (/^\d{10,13}$/.test(e)) {
|
|
263
|
-
const
|
|
264
|
-
return Number.isNaN(
|
|
263
|
+
const i = e.length === 10 ? Number(e) * 1e3 : Number(e), s = new Date(i);
|
|
264
|
+
return Number.isNaN(s.getTime()) ? null : s;
|
|
265
265
|
}
|
|
266
266
|
if (/[Zz]$|[+-]\d{2}:?\d{2}$/.test(e)) {
|
|
267
|
-
const
|
|
268
|
-
return Number.isNaN(
|
|
267
|
+
const i = new Date(e);
|
|
268
|
+
return Number.isNaN(i.getTime()) ? null : i;
|
|
269
269
|
}
|
|
270
270
|
const n = e.match(
|
|
271
271
|
/^(\d{4})[-/.年](\d{1,2})[-/.月](\d{1,2})日?(?:[\sT]+(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?(?:\.(\d{1,3}))?)?/
|
|
272
272
|
);
|
|
273
273
|
if (n) {
|
|
274
|
-
const [,
|
|
275
|
-
Number(
|
|
276
|
-
Number(
|
|
274
|
+
const [, i, s, l, c = "0", f = "0", a = "0", o = "0"] = n, u = new Date(
|
|
275
|
+
Number(i),
|
|
276
|
+
Number(s) - 1,
|
|
277
277
|
Number(l),
|
|
278
278
|
Number(c),
|
|
279
279
|
Number(f),
|
|
280
280
|
Number(a),
|
|
281
|
-
Number(String(
|
|
281
|
+
Number(String(o).padEnd(3, "0"))
|
|
282
282
|
);
|
|
283
283
|
return Number.isNaN(u.getTime()) ? null : u;
|
|
284
284
|
}
|
|
285
285
|
const r = new Date(e);
|
|
286
286
|
return Number.isNaN(r.getTime()) ? null : r;
|
|
287
287
|
}
|
|
288
|
-
function
|
|
289
|
-
const n =
|
|
288
|
+
function T(t, e = "YYYY-MM-DD HH:mm:ss") {
|
|
289
|
+
const n = C(t);
|
|
290
290
|
if (!n) return "";
|
|
291
|
-
const r = n.getFullYear(),
|
|
291
|
+
const r = n.getFullYear(), i = n.getMonth() + 1, s = n.getDate(), l = n.getHours(), c = n.getMinutes(), f = n.getSeconds(), a = {
|
|
292
292
|
YYYY: String(r),
|
|
293
|
-
MM: String(
|
|
294
|
-
DD: String(
|
|
293
|
+
MM: String(i).padStart(2, "0"),
|
|
294
|
+
DD: String(s).padStart(2, "0"),
|
|
295
295
|
HH: String(l).padStart(2, "0"),
|
|
296
296
|
mm: String(c).padStart(2, "0"),
|
|
297
297
|
ss: String(f).padStart(2, "0"),
|
|
298
|
-
M: String(
|
|
299
|
-
D: String(
|
|
298
|
+
M: String(i),
|
|
299
|
+
D: String(s),
|
|
300
300
|
H: String(l),
|
|
301
301
|
m: String(c),
|
|
302
302
|
s: String(f)
|
|
303
303
|
};
|
|
304
|
-
return e.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (
|
|
304
|
+
return e.replace(/YYYY|MM|DD|HH|mm|ss|M|D|H|m|s/g, (o) => a[o]);
|
|
305
305
|
}
|
|
306
306
|
function nt() {
|
|
307
307
|
const t = /* @__PURE__ */ new Date();
|
|
308
308
|
t.setHours(23, 59, 59, 0);
|
|
309
309
|
const e = /* @__PURE__ */ new Date();
|
|
310
310
|
return e.setDate(e.getDate() - 30), e.setHours(0, 0, 0, 0), {
|
|
311
|
-
start:
|
|
312
|
-
end:
|
|
311
|
+
start: T(e, "YYYY-MM-DD HH:mm:ss"),
|
|
312
|
+
end: T(t, "YYYY-MM-DD HH:mm:ss")
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
|
-
function
|
|
315
|
+
function h(t) {
|
|
316
316
|
const e = {};
|
|
317
317
|
return Object.keys(t || {}).forEach((n) => {
|
|
318
318
|
const r = t[n];
|
|
319
319
|
r == null || r === "" || Array.isArray(r) && r.length === 0 || (e[n] = r);
|
|
320
320
|
}), e;
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function w(t, e = 2) {
|
|
323
323
|
if (t == null || t === "") return t;
|
|
324
324
|
const n = Number(t);
|
|
325
325
|
if (Number.isNaN(n)) return t;
|
|
326
|
-
const r = n.toFixed(e), [
|
|
327
|
-
if (
|
|
328
|
-
const c =
|
|
326
|
+
const r = n.toFixed(e), [i, s] = r.split("."), l = i.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
|
|
327
|
+
if (s == null) return l;
|
|
328
|
+
const c = s.replace(/0+$/, "");
|
|
329
329
|
return c ? `${l}.${c}` : l;
|
|
330
330
|
}
|
|
331
331
|
function rt(t) {
|
|
332
332
|
if (t == null || t === "") return "-";
|
|
333
333
|
const e = Number(t);
|
|
334
|
-
return Number.isNaN(e) ? "-" : Math.abs(e) > 1e4 ? `${
|
|
334
|
+
return Number.isNaN(e) ? "-" : Math.abs(e) > 1e4 ? `${w(e / 1e4, 2)}w` : String(w(e, 0));
|
|
335
335
|
}
|
|
336
|
-
function
|
|
336
|
+
function R(t) {
|
|
337
337
|
if (t == null || t === "") return t;
|
|
338
338
|
const e = Number(t);
|
|
339
339
|
return !Number.isFinite(e) || Number.isNaN(e) ? t : e === 0 ? 0 : Number(String((e * 100).toFixed(2)).replace(/(?:\.0*|(\.\d+?)0+)$/, "$1"));
|
|
340
340
|
}
|
|
341
341
|
function it(t) {
|
|
342
342
|
if (t == null || t === "") return "-";
|
|
343
|
-
const e =
|
|
343
|
+
const e = R(t);
|
|
344
344
|
return e == null || e === "" || Number.isNaN(Number(e)) ? "-" : `${e}%`;
|
|
345
345
|
}
|
|
346
|
-
function
|
|
346
|
+
function st(t, e = 4) {
|
|
347
347
|
if (t === "" || t == null) return;
|
|
348
348
|
const n = Number(t);
|
|
349
349
|
if (Number.isFinite(n))
|
|
350
350
|
return Number((n / 100).toFixed(e));
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function ot(t, e = 2, n = 1e9) {
|
|
353
353
|
if (t === 0 || t === "0") return 0;
|
|
354
354
|
if (t == null || t === "") return "";
|
|
355
355
|
let r = Number(t);
|
|
356
356
|
if (!Number.isFinite(r)) return "";
|
|
357
|
-
const
|
|
358
|
-
return Math.abs(r) >=
|
|
357
|
+
const i = Number(n), s = Number.isFinite(i) ? Math.abs(i) : 1e9;
|
|
358
|
+
return Math.abs(r) >= s && (r = r < 0 ? -s : s), Number.isInteger(r) ? r : Number(r.toFixed(e));
|
|
359
359
|
}
|
|
360
360
|
function ut(t = "id") {
|
|
361
361
|
return `${t}_${Date.now()}_${Math.random().toString(36).slice(2, 9)}`;
|
|
362
362
|
}
|
|
363
363
|
const gt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
364
364
|
__proto__: null,
|
|
365
|
-
cleanNumber:
|
|
366
|
-
cleanParams:
|
|
365
|
+
cleanNumber: ot,
|
|
366
|
+
cleanParams: h,
|
|
367
367
|
clearPlatformCache: Q,
|
|
368
368
|
debounce: tt,
|
|
369
|
-
deepClone:
|
|
369
|
+
deepClone: S,
|
|
370
370
|
downloadBlob: $,
|
|
371
|
-
exportFile:
|
|
371
|
+
exportFile: z,
|
|
372
372
|
findPlatformLogo: X,
|
|
373
|
-
formatDate:
|
|
373
|
+
formatDate: T,
|
|
374
374
|
formatFansCount: rt,
|
|
375
|
-
formatNum:
|
|
375
|
+
formatNum: w,
|
|
376
376
|
getRecentMonthRange: nt,
|
|
377
377
|
isEmail: P,
|
|
378
378
|
isEmpty: v,
|
|
379
|
-
isMainlandIdCard:
|
|
379
|
+
isMainlandIdCard: I,
|
|
380
380
|
isMobile: O,
|
|
381
|
-
numberRatio:
|
|
381
|
+
numberRatio: R,
|
|
382
382
|
numberRatioText: it,
|
|
383
|
-
parseDate:
|
|
383
|
+
parseDate: C,
|
|
384
384
|
preloadPlatformList: J,
|
|
385
385
|
setPlatformCache: Y,
|
|
386
386
|
throttle: et,
|
|
387
|
-
toRebateRatio:
|
|
387
|
+
toRebateRatio: st,
|
|
388
388
|
uniqueId: ut,
|
|
389
389
|
validateEmail: W,
|
|
390
390
|
validateIdCardNo: Z,
|
|
@@ -419,9 +419,26 @@ function pt(t) {
|
|
|
419
419
|
* @returns {Promise<Array>} 用户列表(兼容 result / list / 直接数组)
|
|
420
420
|
*/
|
|
421
421
|
async listUserForSelect(e = {}) {
|
|
422
|
-
const n = await t.POST("/yhAdmin/user/listForSelect",
|
|
422
|
+
const n = await t.POST("/yhAdmin/user/listForSelect", h(e));
|
|
423
423
|
return Array.isArray(n) ? n : Array.isArray(n == null ? void 0 : n.result) ? n.result : Array.isArray(n == null ? void 0 : n.list) ? n.list : [];
|
|
424
424
|
},
|
|
425
|
+
/**
|
|
426
|
+
* 按角色名称查询用户列表(下拉)
|
|
427
|
+
* POST /yhAdmin/user/queryUserByRoleName
|
|
428
|
+
* systemId 由组件库自动填充,宿主勿传
|
|
429
|
+
* @param {object} params
|
|
430
|
+
* @param {string} params.roleName 角色名称
|
|
431
|
+
*/
|
|
432
|
+
async queryByRoleName(e = {}) {
|
|
433
|
+
const { systemId: n, ...r } = e && typeof e == "object" ? e : {}, i = await t.POST(
|
|
434
|
+
"/yhAdmin/user/queryUserByRoleName",
|
|
435
|
+
h({
|
|
436
|
+
...r,
|
|
437
|
+
systemId: N()
|
|
438
|
+
})
|
|
439
|
+
);
|
|
440
|
+
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 : [];
|
|
441
|
+
},
|
|
425
442
|
/**
|
|
426
443
|
* 媒介供应商全量列表(下拉)
|
|
427
444
|
* GET /yhAccount/mediaSupplier/listAll
|
|
@@ -444,7 +461,7 @@ function pt(t) {
|
|
|
444
461
|
*/
|
|
445
462
|
queryAllTagConfigs(e = {}) {
|
|
446
463
|
return t.GET("/yhShared/tagConfig/queryAllTagConfigs", {
|
|
447
|
-
params:
|
|
464
|
+
params: h(e)
|
|
448
465
|
});
|
|
449
466
|
},
|
|
450
467
|
/**
|
|
@@ -457,13 +474,13 @@ function pt(t) {
|
|
|
457
474
|
* @param {string} [params.wxUserId] 微信用户 ID
|
|
458
475
|
*/
|
|
459
476
|
addTraceData(e = {}) {
|
|
460
|
-
const { userId: n, projectId: r, clientType:
|
|
477
|
+
const { userId: n, projectId: r, clientType: i, ...s } = e && typeof e == "object" ? e : {};
|
|
461
478
|
return t.POST(
|
|
462
479
|
"/yhAdmin/trace/addTraceData",
|
|
463
|
-
|
|
464
|
-
...
|
|
480
|
+
h({
|
|
481
|
+
...s,
|
|
465
482
|
userId: H(),
|
|
466
|
-
projectId:
|
|
483
|
+
projectId: N(),
|
|
467
484
|
clientType: 1
|
|
468
485
|
})
|
|
469
486
|
);
|
|
@@ -474,37 +491,37 @@ function pt(t) {
|
|
|
474
491
|
}
|
|
475
492
|
};
|
|
476
493
|
}
|
|
477
|
-
const
|
|
478
|
-
function
|
|
479
|
-
globalThis[
|
|
494
|
+
const x = "__MGACN_COMMONSDK_API__";
|
|
495
|
+
function yt(t) {
|
|
496
|
+
globalThis[x] = t;
|
|
480
497
|
}
|
|
481
498
|
function at() {
|
|
482
|
-
const t = globalThis[
|
|
499
|
+
const t = globalThis[x];
|
|
483
500
|
if (!t)
|
|
484
501
|
throw new Error("[mgacn-commonsdk] 请先 app.use(MgacnCommonSdk, { tokenKey, baseURL })");
|
|
485
502
|
return t;
|
|
486
503
|
}
|
|
487
504
|
const j = "__MGACN_COMMONSDK_PERMISSION_GETTER__";
|
|
488
|
-
function
|
|
505
|
+
function ht(t) {
|
|
489
506
|
globalThis[j] = typeof t == "function" ? t : null;
|
|
490
507
|
}
|
|
491
508
|
function ct() {
|
|
492
509
|
return globalThis[j] || null;
|
|
493
510
|
}
|
|
494
511
|
function lt(t, e, n = "and") {
|
|
495
|
-
const r = (Array.isArray(e) ? e : [e]).map((
|
|
512
|
+
const r = (Array.isArray(e) ? e : [e]).map((s) => String(s ?? "").trim()).filter(Boolean);
|
|
496
513
|
if (!r.length) return !0;
|
|
497
|
-
const
|
|
498
|
-
return n === "or" ? r.some((
|
|
514
|
+
const i = new Set((t || []).map(String));
|
|
515
|
+
return n === "or" ? r.some((s) => i.has(s)) : r.every((s) => i.has(s));
|
|
499
516
|
}
|
|
500
|
-
function
|
|
517
|
+
function bt(t, e = "and") {
|
|
501
518
|
const n = ct();
|
|
502
519
|
return typeof n != "function" ? !0 : lt(n(), t, e);
|
|
503
520
|
}
|
|
504
521
|
const Nt = (t, e) => {
|
|
505
522
|
const n = t.__vccOpts || t;
|
|
506
|
-
for (const [r,
|
|
507
|
-
n[r] =
|
|
523
|
+
for (const [r, i] of e)
|
|
524
|
+
n[r] = i;
|
|
508
525
|
return n;
|
|
509
526
|
};
|
|
510
527
|
export {
|
|
@@ -512,20 +529,20 @@ export {
|
|
|
512
529
|
G as a,
|
|
513
530
|
L as b,
|
|
514
531
|
lt as c,
|
|
515
|
-
|
|
516
|
-
|
|
532
|
+
S as d,
|
|
533
|
+
h as e,
|
|
517
534
|
tt as f,
|
|
518
535
|
at as g,
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
536
|
+
w as h,
|
|
537
|
+
bt as i,
|
|
538
|
+
ht as j,
|
|
522
539
|
mt as k,
|
|
523
540
|
pt as l,
|
|
524
541
|
dt as m,
|
|
525
|
-
|
|
542
|
+
yt as n,
|
|
526
543
|
K as o,
|
|
527
544
|
ct as p,
|
|
528
|
-
|
|
545
|
+
N as q,
|
|
529
546
|
H as r,
|
|
530
547
|
F as s,
|
|
531
548
|
gt as t
|