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