color-star-custom-methods 0.0.29 → 0.0.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/index.mjs +557 -711
- package/lib/index.js +2 -2
- package/package.json +2 -2
package/es/index.mjs
CHANGED
|
@@ -1,717 +1,563 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { ElMessage as
|
|
6
|
-
import { fetchEventSource as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
openCallback: t
|
|
133
|
-
}) => {
|
|
134
|
-
const i = {
|
|
135
|
-
method: n,
|
|
136
|
-
signal: a,
|
|
137
|
-
headers: {
|
|
138
|
-
"Content-Type": "application/json"
|
|
139
|
-
},
|
|
140
|
-
async onopen(d) {
|
|
141
|
-
const p = d.headers.get("content-type");
|
|
142
|
-
if (d.status === 200 && (!p || !p.includes("text/event-stream"))) {
|
|
143
|
-
const g = await d.json();
|
|
144
|
-
F(g, e);
|
|
145
|
-
}
|
|
146
|
-
t?.(d);
|
|
147
|
-
},
|
|
148
|
-
onmessage(d) {
|
|
149
|
-
l?.(d);
|
|
150
|
-
},
|
|
151
|
-
onerror(d) {
|
|
152
|
-
throw r?.(d), new Error("请求出错");
|
|
153
|
-
},
|
|
154
|
-
openWhenHidden: !0
|
|
155
|
-
};
|
|
156
|
-
if (n == "post") {
|
|
157
|
-
const d = T(s);
|
|
158
|
-
i.body = JSON.stringify(d);
|
|
159
|
-
}
|
|
160
|
-
H(o, i);
|
|
1
|
+
import { computed as e, markRaw as t, onMounted as n, onUnmounted as r, ref as i } from "vue";
|
|
2
|
+
import a from "axios";
|
|
3
|
+
import o from "qs";
|
|
4
|
+
import s from "js-yaml";
|
|
5
|
+
import { ElMessage as c, ElMessageBox as l } from "element-plus";
|
|
6
|
+
import { fetchEventSource as u } from "@microsoft/fetch-event-source";
|
|
7
|
+
import { IconBasicError as d, IconBasicSuccess as f, IconBasicWarn as p, IconClose as m } from "color-message-lingyun-vue";
|
|
8
|
+
//#region methods/pageZoomController.js
|
|
9
|
+
var h = 1, g = (e = .9) => {
|
|
10
|
+
let t = 1920, n = window.innerWidth, r = window.innerHeight, i = n === t, a = i ? h : n / t, o = i ? h : r / 1080, s = Math.min(a, o);
|
|
11
|
+
return Math.max(e, s);
|
|
12
|
+
}, _ = (t = {}) => {
|
|
13
|
+
let { minScale: a = .9, enableZoomPrevention: o = !1 } = t, s = i(h), c = () => {
|
|
14
|
+
s.value = g(a), document.documentElement.style.setProperty("--app-scale", s.value.toString());
|
|
15
|
+
}, l = (e) => {
|
|
16
|
+
if ((e.ctrlKey || e.metaKey) && (e.key === "+" || e.key === "-" || e.key === "=" || e.key === "0")) {
|
|
17
|
+
e.preventDefault();
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (e.ctrlKey && e.type === "wheel") {
|
|
21
|
+
e.preventDefault();
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
}, u = (e) => {
|
|
25
|
+
e.touches && e.touches.length > 1 && e.preventDefault();
|
|
26
|
+
}, d = (e) => {
|
|
27
|
+
e.preventDefault();
|
|
28
|
+
}, f = e(() => {
|
|
29
|
+
let e = s.value !== h;
|
|
30
|
+
return {
|
|
31
|
+
transform: `scale(${s.value})`,
|
|
32
|
+
transformOrigin: "top left",
|
|
33
|
+
position: e ? "fixed" : "relative",
|
|
34
|
+
width: `calc(100% / ${s.value})`,
|
|
35
|
+
height: `calc(100% / ${s.value})`,
|
|
36
|
+
...e && {
|
|
37
|
+
top: "0",
|
|
38
|
+
left: "0"
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}), p = e(() => {
|
|
42
|
+
let e = s.value !== h;
|
|
43
|
+
return { "app-container": e };
|
|
44
|
+
}), m = () => {
|
|
45
|
+
if (typeof document > "u") return;
|
|
46
|
+
let e = "page-zoom-controller-styles", t = document.getElementById(e);
|
|
47
|
+
t || (t = document.createElement("style"), t.id = e, t.textContent = "\n .app-container * {\n /* 优化字体渲染,防止缩放时字体模糊 */\n -webkit-font-smoothing: antialiased !important;\n -moz-osx-font-smoothing: grayscale !important;\n text-rendering: optimizeLegibility !important;\n }\n ", document.head.appendChild(t));
|
|
48
|
+
}, _ = () => {
|
|
49
|
+
if (typeof document > "u") return;
|
|
50
|
+
let e = document.getElementById("page-zoom-controller-styles");
|
|
51
|
+
e && e.remove();
|
|
52
|
+
};
|
|
53
|
+
return n(() => {
|
|
54
|
+
c(), m(), window.addEventListener("resize", c), o && (window.addEventListener("wheel", l, { passive: !1 }), window.addEventListener("keydown", l), window.addEventListener("touchstart", u, { passive: !1 }), window.addEventListener("touchmove", u, { passive: !1 }), window.addEventListener("gesturestart", d, { passive: !1 }), window.addEventListener("gesturechange", d, { passive: !1 }), window.addEventListener("gestureend", d, { passive: !1 }), document.body.style.touchAction = "none");
|
|
55
|
+
}), r(() => {
|
|
56
|
+
window.removeEventListener("resize", c), _(), o && (window.removeEventListener("wheel", l), window.removeEventListener("keydown", l), window.removeEventListener("touchstart", u), window.removeEventListener("touchmove", u), window.removeEventListener("gesturestart", d), window.removeEventListener("gesturechange", d), window.removeEventListener("gestureend", d), document.body.style.touchAction === "none" && (document.body.style.touchAction = ""));
|
|
57
|
+
}), {
|
|
58
|
+
containerStyles: f,
|
|
59
|
+
containerClasses: p,
|
|
60
|
+
scaleValue: s
|
|
61
|
+
};
|
|
62
|
+
}, v = (e) => e.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(), y = (e) => e.replace(/-([a-z])/g, (e, t) => t.toUpperCase()), b = (e) => typeof e != "object" || !e ? e : Array.isArray(e) ? e.map(b) : Object.keys(e).reduce((t, n) => {
|
|
63
|
+
let r = v(n);
|
|
64
|
+
return n === "dataValue" && (e.dataType === "object" || e.dataType === "arrayObject") ? t[r] = e[n] : t[r] = b(e[n]), t;
|
|
65
|
+
}, {}), x = (e) => typeof e != "object" || !e ? e : Array.isArray(e) ? e.map(x) : Object.keys(e).reduce((t, n) => {
|
|
66
|
+
let r = y(n);
|
|
67
|
+
return t[r] = x(e[n]), t;
|
|
68
|
+
}, {}), S = ({ logout: e, axiosConfig: t = {}, t: n } = {}) => {
|
|
69
|
+
let { language: r } = t, i = n || t?.t, l = (e, t, n) => {
|
|
70
|
+
if (typeof i == "function") {
|
|
71
|
+
let r = i(e, n);
|
|
72
|
+
return r === e ? t : r;
|
|
73
|
+
}
|
|
74
|
+
return t;
|
|
75
|
+
}, u = a.create({
|
|
76
|
+
baseURL: "",
|
|
77
|
+
headers: {
|
|
78
|
+
"Content-Type": "application/json;",
|
|
79
|
+
"Accept-Language": r
|
|
80
|
+
},
|
|
81
|
+
withCredentials: !1,
|
|
82
|
+
paramsSerializer: (e) => o.stringify(e, { indices: !1 }),
|
|
83
|
+
...t
|
|
84
|
+
});
|
|
85
|
+
return u.interceptors.request.use((e) => (e.dataType === "formData" && (e.headers["Content-Type"] = "multipart/form-data"), e.dataType === "yaml" && (e.headers["Content-Type"] = "application/yaml", e.headers.Accept = "yaml", e.data = s.dump(e.data)), e.cozeToken && (e.headers.Authorization = `Bearer ${e.cozeToken}`), e.skipCamelToKebab || (e.data = b(e.data), e.params = b(e.params)), e), (e) => {
|
|
86
|
+
Promise.reject(e);
|
|
87
|
+
}), u.interceptors.response.use((t) => {
|
|
88
|
+
if (t.request.responseType !== "arraybuffer" && (t.config.headers.Accept === "json" || t.config.headers.Accept === "application/json, text/plain, */*")) {
|
|
89
|
+
let n = t.config.skipKebabToCamel ? t.data : x(t.data);
|
|
90
|
+
if ([
|
|
91
|
+
21401,
|
|
92
|
+
20401,
|
|
93
|
+
21409
|
|
94
|
+
].includes(n.code)) {
|
|
95
|
+
e?.();
|
|
96
|
+
return;
|
|
97
|
+
} else n.code && n.mesg && c.error(n.mesg);
|
|
98
|
+
return n;
|
|
99
|
+
}
|
|
100
|
+
return t;
|
|
101
|
+
}, (e) => (e?.response && e?.response?.status ? e?.response?.data?.mesg && c.error(e.response.data.mesg) : navigator.onLine || c.error(l("REQUEST.NETWORK_ERROR", "网络异常请检查")), e?.code === "ECONNABORTED" && e?.message?.includes("timeout") && c({
|
|
102
|
+
message: l("REQUEST.TIMEOUT", "网络请求超时"),
|
|
103
|
+
type: "error",
|
|
104
|
+
duration: 3 * 1e3
|
|
105
|
+
}), Promise.reject(e))), u;
|
|
106
|
+
}, C = (e, t) => e && [
|
|
107
|
+
21401,
|
|
108
|
+
20401,
|
|
109
|
+
21409
|
|
110
|
+
].includes(e.code) ? (t?.(), !0) : !1, ee = ({ logout: e } = {}) => (t, { method: n = "post", signal: r, body: i, successCallback: a, errCallback: o, openCallback: s }) => {
|
|
111
|
+
let c = {
|
|
112
|
+
method: n,
|
|
113
|
+
signal: r,
|
|
114
|
+
headers: { "Content-Type": "application/json" },
|
|
115
|
+
async onopen(t) {
|
|
116
|
+
let n = t.headers.get("content-type");
|
|
117
|
+
t.status === 200 && (!n || !n.includes("text/event-stream")) && C(await t.json(), e), s?.(t);
|
|
118
|
+
},
|
|
119
|
+
onmessage(e) {
|
|
120
|
+
a?.(e);
|
|
121
|
+
},
|
|
122
|
+
onerror(e) {
|
|
123
|
+
throw o?.(e), Error("请求出错");
|
|
124
|
+
},
|
|
125
|
+
openWhenHidden: !0
|
|
126
|
+
};
|
|
127
|
+
if (n == "post") {
|
|
128
|
+
let e = b(i);
|
|
129
|
+
c.body = JSON.stringify(e);
|
|
130
|
+
}
|
|
131
|
+
u(t, c);
|
|
161
132
|
}, w = {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
},
|
|
181
|
-
|
|
182
|
-
},
|
|
183
|
-
|
|
184
|
-
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
},
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
},
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
},
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
133
|
+
success: "success",
|
|
134
|
+
error: "error",
|
|
135
|
+
warning: "warning"
|
|
136
|
+
}, T = {
|
|
137
|
+
[w.success]: t(f),
|
|
138
|
+
[w.error]: t(d),
|
|
139
|
+
[w.warning]: t(p)
|
|
140
|
+
}, E = (e, t) => {
|
|
141
|
+
c({
|
|
142
|
+
grouping: !0,
|
|
143
|
+
duration: 5e3,
|
|
144
|
+
type: t,
|
|
145
|
+
message: e,
|
|
146
|
+
offset: 66,
|
|
147
|
+
icon: T[t]
|
|
148
|
+
});
|
|
149
|
+
}, D = (e) => {
|
|
150
|
+
E(e, w.success);
|
|
151
|
+
}, te = (e) => {
|
|
152
|
+
E(e, w.error);
|
|
153
|
+
}, ne = (e) => {
|
|
154
|
+
E(e, w.warning);
|
|
155
|
+
}, re = (e = {}) => {
|
|
156
|
+
let n = [];
|
|
157
|
+
e?.text && n.push(`<div class="text-202434 fz-14 weight-500">${e?.text}</div>`), e?.subText && n.push(`<div class="text-74798c fz-12">${e?.subText}</div>`);
|
|
158
|
+
let r = {
|
|
159
|
+
prompt: "提示",
|
|
160
|
+
confirmButtonText: "删除",
|
|
161
|
+
cancelButtonText: "取消",
|
|
162
|
+
type: "warning",
|
|
163
|
+
icon: t(p),
|
|
164
|
+
closeIcon: t(m),
|
|
165
|
+
confirmButtonClass: "el-button--danger"
|
|
166
|
+
};
|
|
167
|
+
return l.confirm(n.join(""), e?.prompt || r.prompt, {
|
|
168
|
+
confirmButtonText: e?.confirmButtonText || r.confirmButtonText,
|
|
169
|
+
cancelButtonText: e?.cancelButtonText || r.cancelButtonText,
|
|
170
|
+
type: e?.type || r.type,
|
|
171
|
+
icon: e?.icon || r.icon,
|
|
172
|
+
closeIcon: e?.closeIcon || r.closeIcon,
|
|
173
|
+
dangerouslyUseHTMLString: !0,
|
|
174
|
+
confirmButtonClass: e?.confirmButtonClass || r.confirmButtonClass
|
|
175
|
+
}).then(() => {
|
|
176
|
+
e?.success?.();
|
|
177
|
+
}).catch(() => {
|
|
178
|
+
e?.error?.();
|
|
179
|
+
});
|
|
180
|
+
}, ie = {
|
|
181
|
+
sendMessage: "sendMessage",
|
|
182
|
+
stopChat: "stopChat",
|
|
183
|
+
generationStart: "generationStart",
|
|
184
|
+
generationComplete: "generationComplete",
|
|
185
|
+
delete: "delete",
|
|
186
|
+
change: "change",
|
|
187
|
+
updateModelValue: "update:modelValue",
|
|
188
|
+
paginationChange: "pagination-change",
|
|
189
|
+
operation: "operation",
|
|
190
|
+
menuSelect: "menuSelect",
|
|
191
|
+
updateData: "update-data",
|
|
192
|
+
cancel: "cancel",
|
|
193
|
+
confirm: "confirm",
|
|
194
|
+
open: "open",
|
|
195
|
+
opened: "opened",
|
|
196
|
+
close: "close",
|
|
197
|
+
closed: "closed",
|
|
198
|
+
openAutoFocus: "open-auto-focus",
|
|
199
|
+
closeAutoFocus: "close-auto-focus",
|
|
200
|
+
updatePageSize: "update-page-size",
|
|
201
|
+
updateCurrentPage: "update-current-page",
|
|
202
|
+
currentChange: "current-change",
|
|
203
|
+
enter: "enter",
|
|
204
|
+
visibleChange: "visible-change",
|
|
205
|
+
click: "click",
|
|
206
|
+
command: "command",
|
|
207
|
+
tabChange: "tab-change",
|
|
208
|
+
uploadSuccess: "upload-success",
|
|
209
|
+
search: "search",
|
|
210
|
+
reset: "reset",
|
|
211
|
+
actionClick: "action-click",
|
|
212
|
+
sizeChange: "size-change",
|
|
213
|
+
dataLoaded: "data-loaded",
|
|
214
|
+
dataError: "data-error",
|
|
215
|
+
save: "save",
|
|
216
|
+
updateType: "update:type",
|
|
217
|
+
updateVisible: "update:visible",
|
|
218
|
+
updateAllVisible: "update:allVisible",
|
|
219
|
+
edit: "edit",
|
|
220
|
+
blur: "blur",
|
|
221
|
+
focus: "focus"
|
|
222
|
+
}, ae = {
|
|
223
|
+
success: "0000",
|
|
224
|
+
notLogin: 401,
|
|
225
|
+
canceled: "ERR_CANCELED"
|
|
226
|
+
}, O = {
|
|
227
|
+
pageNum: 1,
|
|
228
|
+
pageSize: 20
|
|
229
|
+
}, oe = {
|
|
230
|
+
text: "text",
|
|
231
|
+
select: "select",
|
|
232
|
+
date: "date",
|
|
233
|
+
inputNumber: "inputNumber",
|
|
234
|
+
switch: "switch",
|
|
235
|
+
radio: "radio",
|
|
236
|
+
checkbox: "checkbox",
|
|
237
|
+
textarea: "textarea",
|
|
238
|
+
upload: "upload"
|
|
239
|
+
}, se = {
|
|
240
|
+
date: "YYYY-MM-DD",
|
|
241
|
+
dateTime: "YYYY-MM-DD HH:mm:ss"
|
|
242
|
+
}, ce = {
|
|
243
|
+
search: "search",
|
|
244
|
+
reset: "reset",
|
|
245
|
+
export: "export",
|
|
246
|
+
import: "import",
|
|
247
|
+
add: "add",
|
|
248
|
+
edit: "edit",
|
|
249
|
+
delete: "delete",
|
|
250
|
+
cancel: "cancel",
|
|
251
|
+
submit: "submit"
|
|
252
|
+
}, k = {
|
|
253
|
+
year: "year",
|
|
254
|
+
month: "month",
|
|
255
|
+
date: "date",
|
|
256
|
+
datetime: "datetime",
|
|
257
|
+
week: "week",
|
|
258
|
+
datetimerange: "datetimerange",
|
|
259
|
+
daterange: "daterange",
|
|
260
|
+
monthrange: "monthrange",
|
|
261
|
+
dates: "dates",
|
|
262
|
+
years: "years",
|
|
263
|
+
months: "months",
|
|
264
|
+
yearrange: "yearrange"
|
|
265
|
+
}, A = {
|
|
266
|
+
[k.datetimerange]: {
|
|
267
|
+
rangeSeparator: "至",
|
|
268
|
+
startPlaceholder: "开始时间",
|
|
269
|
+
endPlaceholder: "结束时间"
|
|
270
|
+
},
|
|
271
|
+
[k.daterange]: {
|
|
272
|
+
rangeSeparator: "至",
|
|
273
|
+
startPlaceholder: "开始日期",
|
|
274
|
+
endPlaceholder: "结束日期"
|
|
275
|
+
},
|
|
276
|
+
[k.monthrange]: {
|
|
277
|
+
rangeSeparator: "至",
|
|
278
|
+
startPlaceholder: "开始月份",
|
|
279
|
+
endPlaceholder: "结束月份"
|
|
280
|
+
},
|
|
281
|
+
[k.yearrange]: {
|
|
282
|
+
rangeSeparator: "至",
|
|
283
|
+
startPlaceholder: "开始年份",
|
|
284
|
+
endPlaceholder: "结束年份"
|
|
285
|
+
}
|
|
286
|
+
}, j = {
|
|
287
|
+
label: "name",
|
|
288
|
+
value: "id"
|
|
289
|
+
}, M = { satoken: "satoken" }, N = {
|
|
290
|
+
pageSizes: [
|
|
291
|
+
O.pageSize,
|
|
292
|
+
50,
|
|
293
|
+
100,
|
|
294
|
+
200
|
|
295
|
+
],
|
|
296
|
+
layout: "total, sizes, prev, pager, next, jumper"
|
|
297
|
+
}, P = {
|
|
298
|
+
png: "png",
|
|
299
|
+
jpeg: "jpeg",
|
|
300
|
+
jpg: "jpg",
|
|
301
|
+
gif: "gif",
|
|
302
|
+
bmp: "bmp",
|
|
303
|
+
webp: "webp",
|
|
304
|
+
pdf: "pdf",
|
|
305
|
+
doc: "doc",
|
|
306
|
+
docx: "docx",
|
|
307
|
+
xls: "xls",
|
|
308
|
+
xlsx: "xlsx",
|
|
309
|
+
ppt: "ppt",
|
|
310
|
+
pptx: "pptx",
|
|
311
|
+
txt: "txt",
|
|
312
|
+
md: "md",
|
|
313
|
+
csv: "csv",
|
|
314
|
+
json: "json"
|
|
315
|
+
}, F = "image/jpeg", I = {
|
|
316
|
+
[P.png]: "image/png",
|
|
317
|
+
[P.jpeg]: F,
|
|
318
|
+
[P.jpg]: F,
|
|
319
|
+
[P.gif]: "image/gif",
|
|
320
|
+
[P.bmp]: "image/bmp",
|
|
321
|
+
[P.webp]: "image/webp",
|
|
322
|
+
[P.pdf]: "application/pdf",
|
|
323
|
+
[P.doc]: "application/msword",
|
|
324
|
+
[P.docx]: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
325
|
+
[P.xls]: "application/vnd.ms-excel",
|
|
326
|
+
[P.xlsx]: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
327
|
+
[P.ppt]: "application/vnd.ms-powerpoint",
|
|
328
|
+
[P.pptx]: "application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
329
|
+
[P.txt]: "text/plain",
|
|
330
|
+
[P.md]: "text/markdown",
|
|
331
|
+
[P.csv]: "text/csv",
|
|
332
|
+
[P.json]: "application/json"
|
|
333
|
+
}, L = { blob: "blob" }, R = { max: 3 }, z = {
|
|
334
|
+
keepAliveExclude: "keep-alive-exclude",
|
|
335
|
+
keepAliveInclude: "keep-alive-include"
|
|
336
|
+
}, B = { complete: "complete" }, V = { eventStream: "text/event-stream" }, H = {
|
|
337
|
+
horizontal: "horizontal",
|
|
338
|
+
vertical: "vertical"
|
|
339
|
+
}, U = {
|
|
340
|
+
left: "left",
|
|
341
|
+
right: "right",
|
|
342
|
+
top: "top"
|
|
343
|
+
}, W = {
|
|
344
|
+
serviceUp: "serviceUp",
|
|
345
|
+
marketing: "marketing",
|
|
346
|
+
demandPre: "demandPre",
|
|
347
|
+
summary: "summary",
|
|
348
|
+
verify: "verify",
|
|
349
|
+
efficiency: "efficiency",
|
|
350
|
+
aiAudit: "aiAudit"
|
|
351
|
+
}, le = [
|
|
352
|
+
{
|
|
353
|
+
label: "服务提升",
|
|
354
|
+
value: W.serviceUp
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
label: "营销转化",
|
|
358
|
+
value: W.marketing
|
|
359
|
+
},
|
|
360
|
+
{
|
|
361
|
+
label: "诉求预判",
|
|
362
|
+
value: W.demandPre
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
label: "AI稽核",
|
|
366
|
+
value: W.aiAudit
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
label: "归纳总结",
|
|
370
|
+
value: W.summary
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
label: "信息查证",
|
|
374
|
+
value: W.verify
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
label: "效能提升",
|
|
378
|
+
value: W.efficiency
|
|
379
|
+
}
|
|
380
|
+
], G = {
|
|
381
|
+
textCreation: "1",
|
|
382
|
+
efficiencyTool: "2",
|
|
383
|
+
mediaEntertainment: "3",
|
|
384
|
+
officePersonnel: "4",
|
|
385
|
+
webSearch: "5",
|
|
386
|
+
newsReading: "6",
|
|
387
|
+
marketingEcommerce: "7",
|
|
388
|
+
other: "8"
|
|
389
|
+
}, ue = [
|
|
390
|
+
{
|
|
391
|
+
label: "文本创作",
|
|
392
|
+
value: G.textCreation
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
label: "效率工具",
|
|
396
|
+
value: G.efficiencyTool
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
label: "媒体文娱",
|
|
400
|
+
value: G.mediaEntertainment
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
label: "办公人事",
|
|
404
|
+
value: G.officePersonnel
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
label: "网页搜索",
|
|
408
|
+
value: G.webSearch
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
label: "新闻阅读",
|
|
412
|
+
value: G.newsReading
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
label: "营销电商",
|
|
416
|
+
value: G.marketingEcommerce
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
label: "其他",
|
|
420
|
+
value: G.other
|
|
421
|
+
}
|
|
422
|
+
], de = () => window.$wujie, K = {
|
|
423
|
+
ACCOUNT: "aibox_account",
|
|
424
|
+
logoutTag: "logout"
|
|
448
425
|
};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region ../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs
|
|
428
|
+
function q(e) {
|
|
429
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
430
|
+
var n = arguments[t];
|
|
431
|
+
for (var r in n) e[r] = n[r];
|
|
432
|
+
}
|
|
433
|
+
return e;
|
|
456
434
|
}
|
|
457
|
-
var
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
decodeURIComponent
|
|
465
|
-
);
|
|
466
|
-
}
|
|
435
|
+
var J = {
|
|
436
|
+
read: function(e) {
|
|
437
|
+
return e[0] === "\"" && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
438
|
+
},
|
|
439
|
+
write: function(e) {
|
|
440
|
+
return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
|
|
441
|
+
}
|
|
467
442
|
};
|
|
468
|
-
function
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
withAttributes: function(s) {
|
|
506
|
-
return I(this.converter, E({}, this.attributes, s));
|
|
507
|
-
},
|
|
508
|
-
withConverter: function(s) {
|
|
509
|
-
return I(E({}, this.converter, s), this.attributes);
|
|
510
|
-
}
|
|
511
|
-
},
|
|
512
|
-
{
|
|
513
|
-
attributes: { value: Object.freeze(o) },
|
|
514
|
-
converter: { value: Object.freeze(e) }
|
|
515
|
-
}
|
|
516
|
-
);
|
|
443
|
+
function Y(e, t) {
|
|
444
|
+
function n(n, r, i) {
|
|
445
|
+
if (!(typeof document > "u")) {
|
|
446
|
+
i = q({}, t, i), typeof i.expires == "number" && (i.expires = new Date(Date.now() + i.expires * 864e5)), i.expires &&= i.expires.toUTCString(), n = encodeURIComponent(n).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
447
|
+
var a = "";
|
|
448
|
+
for (var o in i) i[o] && (a += "; " + o, i[o] !== !0 && (a += "=" + i[o].split(";")[0]));
|
|
449
|
+
return document.cookie = n + "=" + e.write(r, n) + a;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
function r(t) {
|
|
453
|
+
if (!(typeof document > "u" || arguments.length && !t)) {
|
|
454
|
+
for (var n = document.cookie ? document.cookie.split("; ") : [], r = {}, i = 0; i < n.length; i++) {
|
|
455
|
+
var a = n[i].split("="), o = a.slice(1).join("=");
|
|
456
|
+
try {
|
|
457
|
+
var s = decodeURIComponent(a[0]);
|
|
458
|
+
if (r[s] = e.read(o, s), t === s) break;
|
|
459
|
+
} catch {}
|
|
460
|
+
}
|
|
461
|
+
return t ? r[t] : r;
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
return Object.create({
|
|
465
|
+
set: n,
|
|
466
|
+
get: r,
|
|
467
|
+
remove: function(e, t) {
|
|
468
|
+
n(e, "", q({}, t, { expires: -1 }));
|
|
469
|
+
},
|
|
470
|
+
withAttributes: function(e) {
|
|
471
|
+
return Y(this.converter, q({}, this.attributes, e));
|
|
472
|
+
},
|
|
473
|
+
withConverter: function(e) {
|
|
474
|
+
return Y(q({}, this.converter, e), this.attributes);
|
|
475
|
+
}
|
|
476
|
+
}, {
|
|
477
|
+
attributes: { value: Object.freeze(t) },
|
|
478
|
+
converter: { value: Object.freeze(e) }
|
|
479
|
+
});
|
|
517
480
|
}
|
|
518
|
-
var
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
} catch {
|
|
599
|
-
return n;
|
|
600
|
-
}
|
|
601
|
-
},
|
|
602
|
-
/**
|
|
603
|
-
* 移除指定的 LocalStorage
|
|
604
|
-
* @param {string} key - 键名
|
|
605
|
-
*/
|
|
606
|
-
removeLocalStorageById(o) {
|
|
607
|
-
return window.localStorage.removeItem(o);
|
|
608
|
-
},
|
|
609
|
-
/**
|
|
610
|
-
* 清除所有 LocalStorage
|
|
611
|
-
*/
|
|
612
|
-
removeLocalStorage() {
|
|
613
|
-
return window.localStorage.clear();
|
|
614
|
-
},
|
|
615
|
-
//清除token、和sessionStorage、localStorage、除了记住密码
|
|
616
|
-
clearAllStoreStates(o = L.logoutTag, n = L.ACCOUNT) {
|
|
617
|
-
const a = this.getLocalStorage(n);
|
|
618
|
-
console.log("清除所有 LocalStorage 保留记住密码", a), this.removeToken(), this.removeSessionStorage(), this.removeLocalStorage(), a && this.setLocalStorage(n, a);
|
|
619
|
-
}
|
|
620
|
-
}), Re = ({
|
|
621
|
-
getUserInfo: e,
|
|
622
|
-
baseUrl: o,
|
|
623
|
-
tokenKey: n = "ai-token",
|
|
624
|
-
logoutTag: a,
|
|
625
|
-
accountKey: s
|
|
626
|
-
} = {}) => {
|
|
627
|
-
let l = !1;
|
|
628
|
-
const r = G({ tokenKey: n });
|
|
629
|
-
return (t) => {
|
|
630
|
-
if (l || (window.location.pathname || "").includes("login")) return;
|
|
631
|
-
l = !0, r.clearAllStoreStates(a, s);
|
|
632
|
-
const d = e ? e() : null, p = window.location.pathname + window.location.search, g = d?.name || "";
|
|
633
|
-
let c = "";
|
|
634
|
-
const m = o || "/";
|
|
635
|
-
m === "/" ? t ? c = "/login" : c = g ? `/login?fromPath=${p}&userName=${g}` : `/login?fromPath=${p}` : t ? c = `${m}/login` : c = g ? `${m}/login?fromPath=${p}&userName=${encodeURIComponent(g)}` : `${m}/login?fromPath=${p}`, window.location.href = c;
|
|
636
|
-
};
|
|
637
|
-
};
|
|
638
|
-
let v = null;
|
|
639
|
-
const Q = (e = {}) => {
|
|
640
|
-
const {
|
|
641
|
-
message: o = "您已退出当前账号,将为您刷新数据!",
|
|
642
|
-
title: n = "提醒",
|
|
643
|
-
confirmButtonText: a = "确定",
|
|
644
|
-
onConfirm: s = () => window.location.reload(),
|
|
645
|
-
showClose: l = !1,
|
|
646
|
-
closeOnClickModal: r = !1,
|
|
647
|
-
messageBoxOptions: t = {}
|
|
648
|
-
} = e;
|
|
649
|
-
return v && (k.close(), v = null), v = k.alert(o, n, {
|
|
650
|
-
confirmButtonText: a,
|
|
651
|
-
showClose: l,
|
|
652
|
-
closeOnClickModal: r,
|
|
653
|
-
...t
|
|
654
|
-
}), v.then(() => {
|
|
655
|
-
v = null, s();
|
|
656
|
-
}).catch((i) => {
|
|
657
|
-
if (v = null, !(i === "close" || i === "cancel"))
|
|
658
|
-
return Promise.reject(i);
|
|
659
|
-
});
|
|
660
|
-
}, Oe = (e = {}) => {
|
|
661
|
-
const {
|
|
662
|
-
excludePaths: o = ["/login"],
|
|
663
|
-
logoutKey: n = "logout",
|
|
664
|
-
notificationOptions: a = {}
|
|
665
|
-
} = e, s = (l) => {
|
|
666
|
-
const r = window.location.pathname;
|
|
667
|
-
o.some((i) => r.includes(i)) || l.key === n && l.newValue !== null && Q(a);
|
|
668
|
-
};
|
|
669
|
-
return window.addEventListener("storage", s), () => {
|
|
670
|
-
window.removeEventListener("storage", s);
|
|
671
|
-
};
|
|
672
|
-
};
|
|
673
|
-
export {
|
|
674
|
-
L as STORAGE_KEYS,
|
|
675
|
-
Pe as applicationTags,
|
|
676
|
-
h as applicationTagsMap,
|
|
677
|
-
ze as broadcastLogout,
|
|
678
|
-
Y as calculateScale,
|
|
679
|
-
_ as camelToKebab,
|
|
680
|
-
ge as codeMap,
|
|
681
|
-
fe as componentType,
|
|
682
|
-
Se as cookieKeyMap,
|
|
683
|
-
ie as createConfiguredAxios,
|
|
684
|
-
Re as createLogout,
|
|
685
|
-
ce as createSSERequest,
|
|
686
|
-
G as createStorageUtils,
|
|
687
|
-
he as dateFormat,
|
|
688
|
-
we as dateParamsMap,
|
|
689
|
-
b as dateTypeMap,
|
|
690
|
-
me as emitsMap,
|
|
691
|
-
Ae as headersAccept,
|
|
692
|
-
Me as isMicroApp,
|
|
693
|
-
V as kebabToCamel,
|
|
694
|
-
Ee as keepAliveMap,
|
|
695
|
-
Ie as labelPositionMap,
|
|
696
|
-
pe as messageConfirm,
|
|
697
|
-
de as messageError,
|
|
698
|
-
le as messageSuccess,
|
|
699
|
-
ue as messageWarning,
|
|
700
|
-
Q as notifyAccountSwitchAndReload,
|
|
701
|
-
ve as operationConfigMap,
|
|
702
|
-
Z as pageParams,
|
|
703
|
-
xe as paginationConfig,
|
|
704
|
-
Be as pluginTags,
|
|
705
|
-
f as pluginTagsMap,
|
|
706
|
-
Ce as postMessageMap,
|
|
707
|
-
ye as provinceMapping,
|
|
708
|
-
ke as readyState,
|
|
709
|
-
T as recursiveCamelToKebab,
|
|
710
|
-
A as recursiveKebabToCamel,
|
|
711
|
-
be as responseType,
|
|
712
|
-
Oe as setupCrossTabLogoutListener,
|
|
713
|
-
Le as textDirection,
|
|
714
|
-
u as uploadFileType,
|
|
715
|
-
Te as uploadFileTypeMap,
|
|
716
|
-
se as usePageZoomController
|
|
481
|
+
var X = Y(J, { path: "/" }), fe = (e = K.logoutTag) => {
|
|
482
|
+
e && window.localStorage.setItem(e, (/* @__PURE__ */ new Date()).getTime());
|
|
483
|
+
}, Z = ({ tokenKey: e = "ai-token" } = {}) => ({
|
|
484
|
+
getToken() {
|
|
485
|
+
return X.get(e);
|
|
486
|
+
},
|
|
487
|
+
setToken(t) {
|
|
488
|
+
X.set(e, t);
|
|
489
|
+
},
|
|
490
|
+
removeToken() {
|
|
491
|
+
return X.remove(e);
|
|
492
|
+
},
|
|
493
|
+
setSessionStorage(e, t) {
|
|
494
|
+
return window.sessionStorage.setItem(e, JSON.stringify(t));
|
|
495
|
+
},
|
|
496
|
+
getSessionStorage(e) {
|
|
497
|
+
let t = window.sessionStorage.getItem(e);
|
|
498
|
+
if (!t) return null;
|
|
499
|
+
try {
|
|
500
|
+
return JSON.parse(t);
|
|
501
|
+
} catch {
|
|
502
|
+
return t;
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
removeSessionStorageById(e) {
|
|
506
|
+
return window.sessionStorage.removeItem(e);
|
|
507
|
+
},
|
|
508
|
+
removeSessionStorage() {
|
|
509
|
+
return window.sessionStorage.clear();
|
|
510
|
+
},
|
|
511
|
+
setLocalStorage(e, t) {
|
|
512
|
+
return window.localStorage.setItem(e, JSON.stringify(t));
|
|
513
|
+
},
|
|
514
|
+
getLocalStorage(e) {
|
|
515
|
+
let t = window.localStorage.getItem(e);
|
|
516
|
+
if (!t) return null;
|
|
517
|
+
try {
|
|
518
|
+
return JSON.parse(t);
|
|
519
|
+
} catch {
|
|
520
|
+
return t;
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
removeLocalStorageById(e) {
|
|
524
|
+
return window.localStorage.removeItem(e);
|
|
525
|
+
},
|
|
526
|
+
removeLocalStorage() {
|
|
527
|
+
return window.localStorage.clear();
|
|
528
|
+
},
|
|
529
|
+
clearAllStoreStates(e = K.logoutTag, t = K.ACCOUNT) {
|
|
530
|
+
let n = this.getLocalStorage(t);
|
|
531
|
+
console.log("清除所有 LocalStorage 保留记住密码", n), this.removeToken(), this.removeSessionStorage(), this.removeLocalStorage(), n && this.setLocalStorage(t, n);
|
|
532
|
+
}
|
|
533
|
+
}), pe = ({ getUserInfo: e, baseUrl: t, tokenKey: n = "ai-token", logoutTag: r, accountKey: i } = {}) => {
|
|
534
|
+
let a = !1, o = Z({ tokenKey: n });
|
|
535
|
+
return (n) => {
|
|
536
|
+
if (a || (window.location.pathname || "").includes("login")) return;
|
|
537
|
+
a = !0, o.clearAllStoreStates(r, i);
|
|
538
|
+
let s = e ? e() : null, c = window.location.pathname + window.location.search, l = s?.name || "", u = "", d = t || "/";
|
|
539
|
+
u = d === "/" ? n ? "/login" : l ? `/login?fromPath=${c}&userName=${l}` : `/login?fromPath=${c}` : n ? `${d}/login` : l ? `${d}/login?fromPath=${c}&userName=${encodeURIComponent(l)}` : `${d}/login?fromPath=${c}`, window.location.href = u;
|
|
540
|
+
};
|
|
541
|
+
}, Q = null, $ = (e = {}) => {
|
|
542
|
+
let { message: t = "您已退出当前账号,将为您刷新数据!", title: n = "提醒", confirmButtonText: r = "确定", onConfirm: i = () => window.location.reload(), showClose: a = !1, closeOnClickModal: o = !1, messageBoxOptions: s = {} } = e;
|
|
543
|
+
return Q || (Q = l.alert(t, n, {
|
|
544
|
+
confirmButtonText: r,
|
|
545
|
+
showClose: a,
|
|
546
|
+
closeOnClickModal: o,
|
|
547
|
+
...s
|
|
548
|
+
}), Q.then(() => {
|
|
549
|
+
Q = null, i();
|
|
550
|
+
}).catch((e) => {
|
|
551
|
+
if (Q = null, !(e === "close" || e === "cancel")) return Promise.reject(e);
|
|
552
|
+
}));
|
|
553
|
+
}, me = (e = {}) => {
|
|
554
|
+
let { excludePaths: t = ["/login"], logoutKey: n = "logout", notificationOptions: r = {} } = e, i = (e) => {
|
|
555
|
+
let i = window.location.pathname;
|
|
556
|
+
t.some((e) => i.includes(e)) || e.key === n && e.newValue !== null && $(r);
|
|
557
|
+
};
|
|
558
|
+
return window.addEventListener("storage", i), () => {
|
|
559
|
+
window.removeEventListener("storage", i);
|
|
560
|
+
};
|
|
717
561
|
};
|
|
562
|
+
//#endregion
|
|
563
|
+
export { K as STORAGE_KEYS, le as applicationTags, W as applicationTagsMap, fe as broadcastLogout, g as calculateScale, v as camelToKebab, ae as codeMap, oe as componentType, M as cookieKeyMap, S as createConfiguredAxios, pe as createLogout, ee as createSSERequest, Z as createStorageUtils, se as dateFormat, A as dateParamsMap, k as dateTypeMap, ie as emitsMap, V as headersAccept, de as isMicroApp, y as kebabToCamel, R as keepAliveMap, U as labelPositionMap, re as messageConfirm, te as messageError, D as messageSuccess, ne as messageWarning, $ as notifyAccountSwitchAndReload, ce as operationConfigMap, O as pageParams, N as paginationConfig, ue as pluginTags, G as pluginTagsMap, z as postMessageMap, j as provinceMapping, B as readyState, b as recursiveCamelToKebab, x as recursiveKebabToCamel, L as responseType, me as setupCrossTabLogoutListener, H as textDirection, P as uploadFileType, I as uploadFileTypeMap, _ as usePageZoomController };
|