st-comp 0.0.261 → 0.0.263
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/KlineBasic.cjs +1 -1
- package/es/KlineBasic.js +143 -142
- package/es/VarietyAiHelper.cjs +3 -5
- package/es/VarietyAiHelper.js +226 -312
- package/es/VarietySearch.cjs +18 -19
- package/es/VarietySearch.js +1130 -1165
- package/es/aiTools-2e1f92d2.cjs +3 -0
- package/es/aiTools-faa0a14d.js +90 -0
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +150 -151
- package/lib/{index-ea159fbc.js → index-0969ca9d.js} +8225 -8260
- package/lib/{python-2aa774a5.js → python-506107bf.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/KlineBasic/index.vue +1 -1
- package/packages/VarietySearch/components/FactorScreen/index.vue +20 -7
- package/packages/VarietySearch/components/FactorScreen/tools.js +0 -41
package/es/VarietyAiHelper.js
CHANGED
|
@@ -2,14 +2,15 @@ import { b as le, p as Z, e as ce, u as ue, c as de, n as me, _ as pe, w as fe }
|
|
|
2
2
|
import { E as ve } from "./el-dialog-eedcfd3e.js";
|
|
3
3
|
import "./el-overlay-1ee0338d.js";
|
|
4
4
|
import { E as ge } from "./el-button-e2c63c08.js";
|
|
5
|
-
import { E as
|
|
6
|
-
import { defineComponent as ee, ref as
|
|
7
|
-
import { d as
|
|
5
|
+
import { E as _e } from "./el-input-d47281da.js";
|
|
6
|
+
import { defineComponent as ee, ref as f, computed as $, watch as x, openBlock as c, createElementBlock as m, normalizeClass as te, unref as b, normalizeStyle as G, createBlock as Q, withCtx as S, resolveDynamicComponent as he, renderSlot as ke, inject as be, reactive as ye, onMounted as Te, nextTick as O, Fragment as F, createVNode as _, createElementVNode as o, renderList as we, toDisplayString as W, createCommentVNode as H, createTextVNode as j, pushScopeId as Ce, popScopeId as Se } from "vue";
|
|
7
|
+
import { d as P } from "./dayjs.min-8313b006.js";
|
|
8
8
|
import { V as Ee } from "./index-7ed0999e.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
9
|
+
import { s as Ve } from "./aiTools-faa0a14d.js";
|
|
10
|
+
import { E as Me, u as De, s as X, p as Ne } from "./index-c2b9bbfd.js";
|
|
11
|
+
import { _ as Ye } from "./_plugin-vue_export-helper-dad06003.js";
|
|
12
|
+
import { E as B } from "./index-f30561d3.js";
|
|
13
|
+
import { k as Fe, i as He } from "./use-form-common-props-cb0ca65c.js";
|
|
13
14
|
import "./index-0f79095c.js";
|
|
14
15
|
import "./index-8391a3df.js";
|
|
15
16
|
import "./index-de24705f.js";
|
|
@@ -22,12 +23,12 @@ import "./index-657047bb.js";
|
|
|
22
23
|
import "./typescript-7ae59c4c.js";
|
|
23
24
|
import "./index-c71e37dc.js";
|
|
24
25
|
import "./config-provider-7860903c.js";
|
|
25
|
-
const
|
|
26
|
+
const Pe = le({
|
|
26
27
|
size: {
|
|
27
28
|
type: [Number, String],
|
|
28
|
-
values:
|
|
29
|
+
values: Fe,
|
|
29
30
|
default: "",
|
|
30
|
-
validator: (
|
|
31
|
+
validator: (u) => Z(u)
|
|
31
32
|
},
|
|
32
33
|
shape: {
|
|
33
34
|
type: String,
|
|
@@ -35,7 +36,7 @@ const He = le({
|
|
|
35
36
|
default: "circle"
|
|
36
37
|
},
|
|
37
38
|
icon: {
|
|
38
|
-
type:
|
|
39
|
+
type: He
|
|
39
40
|
},
|
|
40
41
|
src: {
|
|
41
42
|
type: String,
|
|
@@ -47,163 +48,76 @@ const He = le({
|
|
|
47
48
|
type: ce(String),
|
|
48
49
|
default: "cover"
|
|
49
50
|
}
|
|
50
|
-
}),
|
|
51
|
-
error: (
|
|
52
|
-
},
|
|
51
|
+
}), Ae = {
|
|
52
|
+
error: (u) => u instanceof Event
|
|
53
|
+
}, ze = ee({
|
|
53
54
|
name: "ElAvatar"
|
|
54
|
-
}),
|
|
55
|
-
...
|
|
56
|
-
props:
|
|
57
|
-
emits:
|
|
58
|
-
setup(
|
|
59
|
-
const
|
|
60
|
-
const { size:
|
|
61
|
-
return de(
|
|
62
|
-
}),
|
|
63
|
-
const { size:
|
|
64
|
-
return Z(
|
|
65
|
-
size: me(
|
|
55
|
+
}), Be = /* @__PURE__ */ ee({
|
|
56
|
+
...ze,
|
|
57
|
+
props: Pe,
|
|
58
|
+
emits: Ae,
|
|
59
|
+
setup(u, { emit: L }) {
|
|
60
|
+
const E = u, p = ue("avatar"), y = f(!1), N = $(() => {
|
|
61
|
+
const { size: n, icon: k, shape: T } = E, a = [p.b()];
|
|
62
|
+
return de(n) && a.push(p.m(n)), k && a.push(p.m("icon")), T && a.push(p.m(T)), a;
|
|
63
|
+
}), A = $(() => {
|
|
64
|
+
const { size: n } = E;
|
|
65
|
+
return Z(n) ? p.cssVarBlock({
|
|
66
|
+
size: me(n) || ""
|
|
66
67
|
}) : void 0;
|
|
67
|
-
}),
|
|
68
|
-
objectFit:
|
|
68
|
+
}), I = $(() => ({
|
|
69
|
+
objectFit: E.fit
|
|
69
70
|
}));
|
|
70
|
-
|
|
71
|
-
function
|
|
72
|
-
|
|
71
|
+
x(() => E.src, () => y.value = !1);
|
|
72
|
+
function z(n) {
|
|
73
|
+
y.value = !0, L("error", n);
|
|
73
74
|
}
|
|
74
|
-
return (
|
|
75
|
-
class: te(
|
|
76
|
-
style:
|
|
75
|
+
return (n, k) => (c(), m("span", {
|
|
76
|
+
class: te(b(N)),
|
|
77
|
+
style: G(b(A))
|
|
77
78
|
}, [
|
|
78
|
-
(
|
|
79
|
+
(n.src || n.srcSet) && !y.value ? (c(), m("img", {
|
|
79
80
|
key: 0,
|
|
80
|
-
src:
|
|
81
|
-
alt:
|
|
82
|
-
srcset:
|
|
83
|
-
style:
|
|
84
|
-
onError:
|
|
85
|
-
}, null, 44, ["src", "alt", "srcset"])) :
|
|
86
|
-
default:
|
|
87
|
-
(
|
|
81
|
+
src: n.src,
|
|
82
|
+
alt: n.alt,
|
|
83
|
+
srcset: n.srcSet,
|
|
84
|
+
style: G(b(I)),
|
|
85
|
+
onError: z
|
|
86
|
+
}, null, 44, ["src", "alt", "srcset"])) : n.icon ? (c(), Q(b(Me), { key: 1 }, {
|
|
87
|
+
default: S(() => [
|
|
88
|
+
(c(), Q(he(n.icon)))
|
|
88
89
|
]),
|
|
89
90
|
_: 1
|
|
90
|
-
})) :
|
|
91
|
+
})) : ke(n.$slots, "default", { key: 2 })
|
|
91
92
|
], 6));
|
|
92
93
|
}
|
|
93
94
|
});
|
|
94
|
-
var
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
var g;
|
|
98
|
-
try {
|
|
99
|
-
const l = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${c}/completion`, {
|
|
100
|
-
method: "POST",
|
|
101
|
-
body: JSON.stringify({
|
|
102
|
-
input: { prompt: k },
|
|
103
|
-
parameters: { incremental_output: "true" },
|
|
104
|
-
debug: {}
|
|
105
|
-
}),
|
|
106
|
-
headers: {
|
|
107
|
-
Authorization: `Bearer ${E}`,
|
|
108
|
-
"Content-Type": "application/json",
|
|
109
|
-
"X-DashScope-SSE": "enable"
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
if (!l.ok) {
|
|
113
|
-
r("error", `HTTP ${l.status}: ${l.statusText}`);
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
const S = l.body.getReader(), m = new TextDecoder();
|
|
117
|
-
let d = "", a = null;
|
|
118
|
-
for (; ; ) {
|
|
119
|
-
const { done: w, value: N } = await S.read();
|
|
120
|
-
if (w) {
|
|
121
|
-
d.trim() && ze(d, r), r("finish", "");
|
|
122
|
-
break;
|
|
123
|
-
}
|
|
124
|
-
d += m.decode(N, { stream: !0 });
|
|
125
|
-
let s;
|
|
126
|
-
for (; (s = d.indexOf(`
|
|
127
|
-
`)) !== -1; ) {
|
|
128
|
-
const _ = d.substring(0, s).trim();
|
|
129
|
-
if (d = d.substring(s + 1), _.startsWith("event:")) {
|
|
130
|
-
a = _.substring(6).trim();
|
|
131
|
-
continue;
|
|
132
|
-
}
|
|
133
|
-
if (_.startsWith("data:")) {
|
|
134
|
-
const b = _.substring(5).trim();
|
|
135
|
-
if (a === "error" || b && b.startsWith("{"))
|
|
136
|
-
try {
|
|
137
|
-
const p = JSON.parse(b);
|
|
138
|
-
if (p.code || p.message || a === "error") {
|
|
139
|
-
const z = p.message || p.code || "未知错误";
|
|
140
|
-
r("error", `百炼服务端错误: ${z}`);
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
143
|
-
const x = (g = p == null ? void 0 : p.output) == null ? void 0 : g.text;
|
|
144
|
-
x && r && r("message", x);
|
|
145
|
-
} catch {
|
|
146
|
-
console.debug("JSON 解析失败:", b);
|
|
147
|
-
}
|
|
148
|
-
a = null;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
} catch (l) {
|
|
153
|
-
console.error("流式请求失败:", l), r("error", l.message);
|
|
154
|
-
}
|
|
155
|
-
}, ze = (c, E) => {
|
|
156
|
-
var g;
|
|
157
|
-
const k = c.split(`
|
|
158
|
-
`);
|
|
159
|
-
let r = null;
|
|
160
|
-
for (const l of k) {
|
|
161
|
-
if (l.startsWith("event:")) {
|
|
162
|
-
r = l.substring(6).trim();
|
|
163
|
-
continue;
|
|
164
|
-
}
|
|
165
|
-
if (l.startsWith("data:")) {
|
|
166
|
-
const S = l.substring(5).trim();
|
|
167
|
-
if (S && S !== "[DONE]")
|
|
168
|
-
try {
|
|
169
|
-
const m = JSON.parse(S);
|
|
170
|
-
if (r === "error" || m.code || m.message) {
|
|
171
|
-
const a = m.message || m.code || "未知错误";
|
|
172
|
-
E("error", `百炼服务端错误: ${a}`);
|
|
173
|
-
return;
|
|
174
|
-
}
|
|
175
|
-
const d = (g = m == null ? void 0 : m.output) == null ? void 0 : g.text;
|
|
176
|
-
d && E && E("message", d);
|
|
177
|
-
} catch {
|
|
178
|
-
}
|
|
179
|
-
r = null;
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
};
|
|
183
|
-
const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-dialog-body" }, Ie = { class: "avatar" }, Je = { class: "message-content" }, je = ["innerHTML"], Re = {
|
|
95
|
+
var Le = /* @__PURE__ */ pe(Be, [["__file", "avatar.vue"]]);
|
|
96
|
+
const Ie = fe(Le);
|
|
97
|
+
const h = (u) => (Ce("data-v-536916ba"), u = u(), Se(), u), $e = { class: "ai-dialog-body" }, Oe = { class: "avatar" }, je = { class: "message-content" }, xe = ["innerHTML"], qe = {
|
|
184
98
|
key: 1,
|
|
185
99
|
class: "message-text"
|
|
186
|
-
},
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
],
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
],
|
|
100
|
+
}, Je = { class: "message-createTime" }, Ke = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "message-createTime" }, "请问对本轮查询结果是否满意?", -1)), Re = { class: "feedback-buttons" }, Ue = ["onClick"], Ge = /* @__PURE__ */ h(() => /* @__PURE__ */ o("span", { class: "btn-emoji" }, "👍", -1)), Qe = /* @__PURE__ */ h(() => /* @__PURE__ */ o("span", { class: "btn-text" }, "满意", -1)), We = [
|
|
101
|
+
Ge,
|
|
102
|
+
Qe
|
|
103
|
+
], Xe = ["onClick"], Ze = /* @__PURE__ */ h(() => /* @__PURE__ */ o("span", { class: "btn-emoji" }, "👎", -1)), et = /* @__PURE__ */ h(() => /* @__PURE__ */ o("span", { class: "btn-text" }, "不满意", -1)), tt = [
|
|
104
|
+
Ze,
|
|
105
|
+
et
|
|
106
|
+
], st = {
|
|
193
107
|
key: 1,
|
|
194
108
|
class: "message-createTime"
|
|
195
|
-
},
|
|
109
|
+
}, at = {
|
|
196
110
|
key: 0,
|
|
197
111
|
class: "message-item assistant"
|
|
198
|
-
}, ot = { class: "avatar" },
|
|
112
|
+
}, ot = { class: "avatar" }, nt = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "message-content" }, [
|
|
199
113
|
/* @__PURE__ */ o("div", { class: "typing-indicator" }, [
|
|
200
114
|
/* @__PURE__ */ o("span"),
|
|
201
115
|
/* @__PURE__ */ o("span"),
|
|
202
116
|
/* @__PURE__ */ o("span")
|
|
203
117
|
])
|
|
204
|
-
], -1)), it = { class: "input-area" },
|
|
118
|
+
], -1)), it = { class: "input-area" }, rt = { class: "input-actions" }, lt = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "input-hint" }, [
|
|
205
119
|
/* @__PURE__ */ o("span", null, "Enter 发送 | Ctrl + Enter 换行")
|
|
206
|
-
], -1)),
|
|
120
|
+
], -1)), ct = { class: "feedback-dialog-content" }, ut = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "feedback-emoji" }, "😟", -1)), dt = /* @__PURE__ */ h(() => /* @__PURE__ */ o("p", { class: "feedback-tip" }, "很抱歉没能帮到您,请告诉我们哪里需要改进:", -1)), mt = { class: "dialog-footer" }, pt = {
|
|
207
121
|
__name: "index",
|
|
208
122
|
props: {
|
|
209
123
|
defaultMessage: {
|
|
@@ -215,38 +129,38 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
|
|
|
215
129
|
}
|
|
216
130
|
},
|
|
217
131
|
emits: ["callBack"],
|
|
218
|
-
setup(
|
|
219
|
-
const
|
|
132
|
+
setup(u, { expose: L, emit: E }) {
|
|
133
|
+
const p = be("stConfig"), y = ye(Ee()), N = f(!1), A = E, I = u, z = f(), n = f(!1), k = f(!1), T = f(null), a = f([
|
|
220
134
|
{
|
|
221
135
|
role: "assistant",
|
|
222
136
|
// AI-assistant, 用户-user
|
|
223
|
-
content:
|
|
137
|
+
content: I.defaultMessage,
|
|
224
138
|
userContent: null,
|
|
225
139
|
showFeedback: !1,
|
|
226
140
|
// 是否展示反馈按钮(默认信息不用展示)
|
|
227
141
|
hasFeedback: !1,
|
|
228
142
|
// 是否已进行过反馈
|
|
229
|
-
createTime:
|
|
143
|
+
createTime: P().format("YYYY-MM-DD HH:mm:ss"),
|
|
230
144
|
// 消息发起时间
|
|
231
145
|
resTime: 0,
|
|
232
146
|
// 响应总耗时
|
|
233
147
|
firstPackageTime: 0
|
|
234
148
|
// 首包响应耗时
|
|
235
149
|
}
|
|
236
|
-
]),
|
|
237
|
-
if (typeof
|
|
150
|
+
]), w = f(""), V = f(!1), Y = f(""), q = f({}), J = (s) => {
|
|
151
|
+
if (typeof s != "string")
|
|
238
152
|
return !1;
|
|
239
153
|
try {
|
|
240
|
-
const e = JSON.parse(
|
|
154
|
+
const e = JSON.parse(s);
|
|
241
155
|
return e !== null && typeof e == "object";
|
|
242
156
|
} catch {
|
|
243
157
|
return !1;
|
|
244
158
|
}
|
|
245
|
-
}, se = (
|
|
246
|
-
if (!
|
|
159
|
+
}, se = (s) => {
|
|
160
|
+
if (!J(s))
|
|
247
161
|
return null;
|
|
248
162
|
try {
|
|
249
|
-
const e = JSON.parse(
|
|
163
|
+
const e = JSON.parse(s), { parsedConditions: t, ...i } = e;
|
|
250
164
|
return {
|
|
251
165
|
parsedConditions: t,
|
|
252
166
|
webParams: i
|
|
@@ -254,19 +168,19 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
|
|
|
254
168
|
} catch {
|
|
255
169
|
return null;
|
|
256
170
|
}
|
|
257
|
-
}, ae = (
|
|
171
|
+
}, ae = (s) => {
|
|
258
172
|
var t;
|
|
259
|
-
if (!
|
|
173
|
+
if (!s)
|
|
260
174
|
return "";
|
|
261
175
|
let e = "";
|
|
262
|
-
return (t =
|
|
176
|
+
return (t = s.parsedConditions) != null && t.length && (e += '<div class="parsed-conditions">', s.parsedConditions.forEach((i) => {
|
|
263
177
|
e += `<div class="parsed-conditions-item">${i}</div>`;
|
|
264
178
|
}), e += "</div>"), e;
|
|
265
|
-
},
|
|
266
|
-
switch (
|
|
179
|
+
}, M = async (s, e) => {
|
|
180
|
+
switch (s) {
|
|
267
181
|
case "satisfied": {
|
|
268
|
-
const t =
|
|
269
|
-
userName:
|
|
182
|
+
const t = a.value[e], i = {
|
|
183
|
+
userName: y.username,
|
|
270
184
|
userContent: t.userContent,
|
|
271
185
|
aiContent: t.content,
|
|
272
186
|
type: 1,
|
|
@@ -278,18 +192,18 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
|
|
|
278
192
|
logOrigin: 1
|
|
279
193
|
// 日志来源
|
|
280
194
|
};
|
|
281
|
-
await
|
|
195
|
+
await p.request.post("/alarm/deliversign/addVarietyAiHelperLog", i), B.success("感谢您的评价!"), a.value[e].hasFeedback = !0;
|
|
282
196
|
break;
|
|
283
197
|
}
|
|
284
198
|
case "open": {
|
|
285
|
-
|
|
199
|
+
q.value = e, V.value = !0;
|
|
286
200
|
break;
|
|
287
201
|
}
|
|
288
202
|
case "unsatisfied": {
|
|
289
|
-
const t =
|
|
290
|
-
userName:
|
|
203
|
+
const t = a.value[e], i = {
|
|
204
|
+
userName: y.username,
|
|
291
205
|
userContent: t.userContent,
|
|
292
|
-
userSuggestion:
|
|
206
|
+
userSuggestion: Y.value,
|
|
293
207
|
aiContent: t.content,
|
|
294
208
|
type: 2,
|
|
295
209
|
resTime: t.resTime,
|
|
@@ -300,14 +214,14 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
|
|
|
300
214
|
logOrigin: 1
|
|
301
215
|
// 日志来源
|
|
302
216
|
};
|
|
303
|
-
await
|
|
217
|
+
await p.request.post("/alarm/deliversign/addVarietyAiHelperLog", i), B.success("感谢您的反馈!我们将持续跟踪并进行优化"), V.value = !1, a.value[e].hasFeedback = !0;
|
|
304
218
|
break;
|
|
305
219
|
}
|
|
306
220
|
case "default": {
|
|
307
|
-
const t =
|
|
308
|
-
userName:
|
|
221
|
+
const t = a.value[e], i = {
|
|
222
|
+
userName: y.username,
|
|
309
223
|
userContent: t.userContent,
|
|
310
|
-
userSuggestion:
|
|
224
|
+
userSuggestion: Y.value,
|
|
311
225
|
aiContent: t.content,
|
|
312
226
|
type: null,
|
|
313
227
|
resTime: t.resTime,
|
|
@@ -318,137 +232,137 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
|
|
|
318
232
|
logOrigin: 1
|
|
319
233
|
// 日志来源
|
|
320
234
|
};
|
|
321
|
-
await
|
|
235
|
+
await p.request.post("/alarm/deliversign/addVarietyAiHelperLog", i);
|
|
322
236
|
}
|
|
323
237
|
}
|
|
324
|
-
},
|
|
325
|
-
const
|
|
326
|
-
if (!
|
|
327
|
-
return
|
|
328
|
-
if (
|
|
238
|
+
}, K = async () => {
|
|
239
|
+
const s = w.value.trim();
|
|
240
|
+
if (!s)
|
|
241
|
+
return B.warning("请输入消息内容");
|
|
242
|
+
if (n.value)
|
|
329
243
|
return;
|
|
330
|
-
|
|
244
|
+
a.value.push({
|
|
331
245
|
role: "user",
|
|
332
|
-
content:
|
|
333
|
-
createTime:
|
|
334
|
-
}),
|
|
246
|
+
content: s,
|
|
247
|
+
createTime: P().format("YYYY-MM-DD HH:mm:ss")
|
|
248
|
+
}), w.value = "", await C(), a.value.push({
|
|
335
249
|
role: "assistant",
|
|
336
250
|
content: "",
|
|
337
|
-
userContent:
|
|
251
|
+
userContent: s,
|
|
338
252
|
showFeedback: !1,
|
|
339
253
|
hasFeedback: !1,
|
|
340
|
-
createTime:
|
|
254
|
+
createTime: P().format("YYYY-MM-DD HH:mm:ss"),
|
|
341
255
|
resTime: 0,
|
|
342
256
|
firstPackageTime: 0
|
|
343
|
-
}), await
|
|
257
|
+
}), await C(), n.value = !0, k.value = !0;
|
|
344
258
|
let e = "", t = (/* @__PURE__ */ new Date()).getTime();
|
|
345
259
|
try {
|
|
346
|
-
await
|
|
260
|
+
await Ve({
|
|
347
261
|
appId: "9e54d112acfe4531bd1fc4fee8827fef",
|
|
348
262
|
apiKey: "sk-d995eb26a4334bdeb2ccb4cbfaf51de8",
|
|
349
|
-
value:
|
|
350
|
-
callback: (
|
|
351
|
-
var
|
|
352
|
-
if (
|
|
353
|
-
|
|
263
|
+
value: s,
|
|
264
|
+
callback: (g, d) => {
|
|
265
|
+
var r;
|
|
266
|
+
if (g === "error") {
|
|
267
|
+
k.value = !1, n.value = !1, a.value.pop(), a.value.push({
|
|
354
268
|
role: "assistant",
|
|
355
|
-
userContent:
|
|
356
|
-
content: `❌ ${
|
|
269
|
+
userContent: s,
|
|
270
|
+
content: `❌ ${d}`,
|
|
357
271
|
showFeedback: !1,
|
|
358
272
|
hasFeedback: !1,
|
|
359
|
-
createTime:
|
|
273
|
+
createTime: P().format("YYYY-MM-DD HH:mm:ss"),
|
|
360
274
|
resTime: (/* @__PURE__ */ new Date()).getTime() - t,
|
|
361
275
|
firstPackageTime: 0
|
|
362
|
-
}),
|
|
276
|
+
}), M("default", a.value.length - 1), C();
|
|
363
277
|
return;
|
|
364
|
-
} else if (
|
|
365
|
-
e +=
|
|
366
|
-
const
|
|
367
|
-
|
|
368
|
-
} else if (
|
|
369
|
-
|
|
370
|
-
const
|
|
371
|
-
|
|
278
|
+
} else if (g === "message") {
|
|
279
|
+
e += d;
|
|
280
|
+
const l = a.value[a.value.length - 1];
|
|
281
|
+
l && l.role === "assistant" && (l.content = e, C()), l.firstPackageTime === 0 && (l.firstPackageTime = (/* @__PURE__ */ new Date()).getTime() - t);
|
|
282
|
+
} else if (g === "finish") {
|
|
283
|
+
k.value = !1, n.value = !1;
|
|
284
|
+
const l = a.value[a.value.length - 1];
|
|
285
|
+
l && l.role === "assistant" && (l.showFeedback = !0, l.resTime = (/* @__PURE__ */ new Date()).getTime() - t, M("default", a.value.length - 1)), console.log(e);
|
|
372
286
|
try {
|
|
373
|
-
const
|
|
374
|
-
if (
|
|
375
|
-
const
|
|
376
|
-
const U =
|
|
377
|
-
return U &&
|
|
287
|
+
const v = JSON.parse(e);
|
|
288
|
+
if (v.parsedConditions && delete v.parsedConditions, (r = v.customTagNames) != null && r.length) {
|
|
289
|
+
const ie = v.customTagNames.reduce((R, re) => {
|
|
290
|
+
const U = z.value[re];
|
|
291
|
+
return U && R.push(U), R;
|
|
378
292
|
}, []);
|
|
379
|
-
delete
|
|
293
|
+
delete v.customTagNames, v.customTag = ie;
|
|
380
294
|
}
|
|
381
|
-
|
|
295
|
+
A("callBack", v);
|
|
382
296
|
} catch {
|
|
383
|
-
|
|
297
|
+
A("callBack", e);
|
|
384
298
|
}
|
|
385
299
|
}
|
|
386
300
|
}
|
|
387
301
|
});
|
|
388
302
|
} catch (i) {
|
|
389
|
-
|
|
303
|
+
B.error(`AI响应异常: ${i}`), a.value.pop(), a.value.push({
|
|
390
304
|
role: "assistant",
|
|
391
|
-
userContent:
|
|
305
|
+
userContent: s,
|
|
392
306
|
content: "❌ 抱歉,AI服务响应异常,请稍后重试。",
|
|
393
307
|
showFeedback: !0,
|
|
394
308
|
hasFeedback: !1,
|
|
395
|
-
createTime:
|
|
309
|
+
createTime: P().format("YYYY-MM-DD HH:mm:ss"),
|
|
396
310
|
resTime: (/* @__PURE__ */ new Date()).getTime() - t,
|
|
397
311
|
firstPackageTime: 0
|
|
398
|
-
}),
|
|
312
|
+
}), M("default", a.value.length - 1), await C(), n.value = !1, k.value = !1;
|
|
399
313
|
}
|
|
400
|
-
},
|
|
401
|
-
if (
|
|
402
|
-
if (
|
|
403
|
-
|
|
404
|
-
const e =
|
|
405
|
-
|
|
406
|
-
` +
|
|
314
|
+
}, oe = (s) => {
|
|
315
|
+
if (s.key === "Enter")
|
|
316
|
+
if (s.ctrlKey) {
|
|
317
|
+
s.preventDefault();
|
|
318
|
+
const e = s.target, t = e.selectionStart, i = e.selectionEnd;
|
|
319
|
+
w.value = w.value.substring(0, t) + `
|
|
320
|
+
` + w.value.substring(i), O(() => {
|
|
407
321
|
e.selectionStart = e.selectionEnd = t + 1;
|
|
408
322
|
});
|
|
409
323
|
} else
|
|
410
|
-
|
|
411
|
-
},
|
|
412
|
-
await
|
|
413
|
-
},
|
|
414
|
-
const
|
|
415
|
-
|
|
324
|
+
s.preventDefault(), K();
|
|
325
|
+
}, C = async () => {
|
|
326
|
+
await O(), T.value && (T.value.scrollTop = T.value.scrollHeight);
|
|
327
|
+
}, ne = async () => {
|
|
328
|
+
const s = await Promise.all([p.request.post("/alarm/deliversign/findTagsByUserId"), p.request.post("/alarm/deliversign/findSystemTagsByTagName")]);
|
|
329
|
+
z.value = s.reduce((e, t) => {
|
|
416
330
|
var i;
|
|
417
331
|
return {
|
|
418
332
|
...e,
|
|
419
|
-
...(i = t.body) == null ? void 0 : i.reduce((
|
|
420
|
-
...
|
|
421
|
-
[
|
|
333
|
+
...(i = t.body) == null ? void 0 : i.reduce((D, g) => ({
|
|
334
|
+
...D,
|
|
335
|
+
[g.tagName]: g.id
|
|
422
336
|
}), {})
|
|
423
337
|
};
|
|
424
338
|
}, {});
|
|
425
339
|
};
|
|
426
|
-
return
|
|
427
|
-
|
|
428
|
-
}),
|
|
429
|
-
() =>
|
|
340
|
+
return Te(() => {
|
|
341
|
+
ne();
|
|
342
|
+
}), x(
|
|
343
|
+
() => a.value,
|
|
430
344
|
() => {
|
|
431
|
-
|
|
345
|
+
C();
|
|
432
346
|
},
|
|
433
347
|
{ deep: !0 }
|
|
434
|
-
),
|
|
435
|
-
() =>
|
|
436
|
-
(
|
|
437
|
-
|
|
348
|
+
), x(
|
|
349
|
+
() => V.value,
|
|
350
|
+
(s) => {
|
|
351
|
+
s || (Y.value = "");
|
|
438
352
|
}
|
|
439
|
-
),
|
|
353
|
+
), L({
|
|
440
354
|
open: () => {
|
|
441
|
-
|
|
442
|
-
|
|
355
|
+
N.value = !0, O(() => {
|
|
356
|
+
C();
|
|
443
357
|
});
|
|
444
358
|
}
|
|
445
|
-
}), (
|
|
446
|
-
const t =
|
|
447
|
-
return
|
|
448
|
-
|
|
359
|
+
}), (s, e) => {
|
|
360
|
+
const t = Ie, i = _e, D = ge, g = ve;
|
|
361
|
+
return c(), m(F, null, [
|
|
362
|
+
_(g, {
|
|
449
363
|
class: "ai-dialog",
|
|
450
|
-
modelValue:
|
|
451
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
364
|
+
modelValue: N.value,
|
|
365
|
+
"onUpdate:modelValue": e[1] || (e[1] = (d) => N.value = d),
|
|
452
366
|
title: "✨ 品种池参数解析AI助手",
|
|
453
367
|
width: "500px",
|
|
454
368
|
center: "",
|
|
@@ -457,84 +371,84 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
|
|
|
457
371
|
modal: !1,
|
|
458
372
|
"modal-penetrable": !0
|
|
459
373
|
}, {
|
|
460
|
-
default:
|
|
461
|
-
var
|
|
374
|
+
default: S(() => {
|
|
375
|
+
var d;
|
|
462
376
|
return [
|
|
463
|
-
o("div",
|
|
377
|
+
o("div", $e, [
|
|
464
378
|
o("div", {
|
|
465
379
|
ref_key: "messageListRef",
|
|
466
|
-
ref:
|
|
380
|
+
ref: T,
|
|
467
381
|
class: "message-list"
|
|
468
382
|
}, [
|
|
469
|
-
(
|
|
470
|
-
key:
|
|
471
|
-
class: te([
|
|
383
|
+
(c(!0), m(F, null, we(a.value, (r, l) => (c(), m("div", {
|
|
384
|
+
key: l,
|
|
385
|
+
class: te([r.role, "message-item"])
|
|
472
386
|
}, [
|
|
473
|
-
|
|
474
|
-
o("div",
|
|
475
|
-
|
|
387
|
+
r.content ? (c(), m(F, { key: 0 }, [
|
|
388
|
+
o("div", Oe, [
|
|
389
|
+
_(t, {
|
|
476
390
|
size: 32,
|
|
477
|
-
icon:
|
|
391
|
+
icon: r.role === "user" ? b(De) : b(X)
|
|
478
392
|
}, null, 8, ["icon"])
|
|
479
393
|
]),
|
|
480
|
-
o("div",
|
|
481
|
-
|
|
394
|
+
o("div", je, [
|
|
395
|
+
J(r.content) ? (c(), m("div", {
|
|
482
396
|
key: 0,
|
|
483
397
|
class: "message-json",
|
|
484
|
-
innerHTML: ae(se(
|
|
485
|
-
}, null, 8,
|
|
486
|
-
o("div",
|
|
487
|
-
|
|
488
|
-
|
|
398
|
+
innerHTML: ae(se(r.content))
|
|
399
|
+
}, null, 8, xe)) : (c(), m("div", qe, W(r.content), 1)),
|
|
400
|
+
o("div", Je, W(r.createTime), 1),
|
|
401
|
+
r.role === "assistant" ? (c(), m(F, { key: 2 }, [
|
|
402
|
+
r.showFeedback && !r.hasFeedback ? (c(), m(F, { key: 0 }, [
|
|
489
403
|
Ke,
|
|
490
|
-
o("div",
|
|
404
|
+
o("div", Re, [
|
|
491
405
|
o("button", {
|
|
492
406
|
class: "feedback-btn satisfied-btn",
|
|
493
|
-
onClick: (
|
|
494
|
-
},
|
|
407
|
+
onClick: (v) => M("satisfied", l)
|
|
408
|
+
}, We, 8, Ue),
|
|
495
409
|
o("button", {
|
|
496
410
|
class: "feedback-btn unsatisfied-btn",
|
|
497
|
-
onClick: (
|
|
498
|
-
},
|
|
411
|
+
onClick: (v) => M("open", l)
|
|
412
|
+
}, tt, 8, Xe)
|
|
499
413
|
])
|
|
500
|
-
], 64)) :
|
|
501
|
-
|
|
502
|
-
], 64)) :
|
|
414
|
+
], 64)) : H("", !0),
|
|
415
|
+
r.showFeedback && r.hasFeedback ? (c(), m("div", st, "感谢您进行的评价反馈")) : H("", !0)
|
|
416
|
+
], 64)) : H("", !0)
|
|
503
417
|
])
|
|
504
|
-
], 64)) :
|
|
418
|
+
], 64)) : H("", !0)
|
|
505
419
|
], 2))), 128)),
|
|
506
|
-
|
|
420
|
+
k.value && !((d = a.value[a.value.length - 1]) != null && d.content) ? (c(), m("div", at, [
|
|
507
421
|
o("div", ot, [
|
|
508
|
-
|
|
422
|
+
_(t, {
|
|
509
423
|
size: 32,
|
|
510
|
-
icon:
|
|
424
|
+
icon: b(X)
|
|
511
425
|
}, null, 8, ["icon"])
|
|
512
426
|
]),
|
|
513
|
-
|
|
514
|
-
])) :
|
|
427
|
+
nt
|
|
428
|
+
])) : H("", !0)
|
|
515
429
|
], 512),
|
|
516
430
|
o("div", it, [
|
|
517
|
-
|
|
431
|
+
_(i, {
|
|
518
432
|
class: "message-input",
|
|
519
|
-
modelValue:
|
|
520
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
433
|
+
modelValue: w.value,
|
|
434
|
+
"onUpdate:modelValue": e[0] || (e[0] = (r) => w.value = r),
|
|
521
435
|
type: "textarea",
|
|
522
436
|
rows: 4,
|
|
523
437
|
autosize: { minRows: 2, maxRows: 4 },
|
|
524
438
|
placeholder: "输入您想查询的品种条件...",
|
|
525
|
-
onKeydown:
|
|
439
|
+
onKeydown: oe
|
|
526
440
|
}, null, 8, ["modelValue"]),
|
|
527
|
-
o("div",
|
|
528
|
-
|
|
529
|
-
|
|
441
|
+
o("div", rt, [
|
|
442
|
+
lt,
|
|
443
|
+
_(D, {
|
|
530
444
|
class: "send-btn",
|
|
531
445
|
type: "primary",
|
|
532
|
-
icon:
|
|
533
|
-
loading:
|
|
534
|
-
onClick:
|
|
446
|
+
icon: b(Ne),
|
|
447
|
+
loading: n.value,
|
|
448
|
+
onClick: K,
|
|
535
449
|
round: ""
|
|
536
450
|
}, {
|
|
537
|
-
default:
|
|
451
|
+
default: S(() => [
|
|
538
452
|
j(" 发送 ")
|
|
539
453
|
]),
|
|
540
454
|
_: 1
|
|
@@ -546,40 +460,40 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
|
|
|
546
460
|
}),
|
|
547
461
|
_: 1
|
|
548
462
|
}, 8, ["modelValue"]),
|
|
549
|
-
|
|
550
|
-
modelValue:
|
|
551
|
-
"onUpdate:modelValue": e[5] || (e[5] = (
|
|
463
|
+
_(g, {
|
|
464
|
+
modelValue: V.value,
|
|
465
|
+
"onUpdate:modelValue": e[5] || (e[5] = (d) => V.value = d),
|
|
552
466
|
title: "📝 反馈意见",
|
|
553
467
|
width: "400px"
|
|
554
468
|
}, {
|
|
555
|
-
footer:
|
|
556
|
-
o("span",
|
|
557
|
-
|
|
558
|
-
onClick: e[3] || (e[3] = (
|
|
469
|
+
footer: S(() => [
|
|
470
|
+
o("span", mt, [
|
|
471
|
+
_(D, {
|
|
472
|
+
onClick: e[3] || (e[3] = (d) => V.value = !1)
|
|
559
473
|
}, {
|
|
560
|
-
default:
|
|
474
|
+
default: S(() => [
|
|
561
475
|
j("取消")
|
|
562
476
|
]),
|
|
563
477
|
_: 1
|
|
564
478
|
}),
|
|
565
|
-
|
|
479
|
+
_(D, {
|
|
566
480
|
type: "primary",
|
|
567
|
-
onClick: e[4] || (e[4] = (
|
|
481
|
+
onClick: e[4] || (e[4] = (d) => M("unsatisfied", q.value))
|
|
568
482
|
}, {
|
|
569
|
-
default:
|
|
483
|
+
default: S(() => [
|
|
570
484
|
j("提交反馈")
|
|
571
485
|
]),
|
|
572
486
|
_: 1
|
|
573
487
|
})
|
|
574
488
|
])
|
|
575
489
|
]),
|
|
576
|
-
default:
|
|
577
|
-
o("div",
|
|
490
|
+
default: S(() => [
|
|
491
|
+
o("div", ct, [
|
|
492
|
+
ut,
|
|
578
493
|
dt,
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
modelValue:
|
|
582
|
-
"onUpdate:modelValue": e[2] || (e[2] = (h) => p.value = h),
|
|
494
|
+
_(i, {
|
|
495
|
+
modelValue: Y.value,
|
|
496
|
+
"onUpdate:modelValue": e[2] || (e[2] = (d) => Y.value = d),
|
|
583
497
|
type: "textarea",
|
|
584
498
|
rows: 4,
|
|
585
499
|
placeholder: "[非必填]例如:回答不够准确、查询结果有误、界面体验不佳..."
|
|
@@ -591,11 +505,11 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
|
|
|
591
505
|
], 64);
|
|
592
506
|
};
|
|
593
507
|
}
|
|
594
|
-
},
|
|
595
|
-
install(
|
|
596
|
-
|
|
508
|
+
}, ft = /* @__PURE__ */ Ye(pt, [["__scopeId", "data-v-536916ba"]]), $t = {
|
|
509
|
+
install(u) {
|
|
510
|
+
u.component("st-varietyAiHelper", ft);
|
|
597
511
|
}
|
|
598
512
|
};
|
|
599
513
|
export {
|
|
600
|
-
|
|
514
|
+
$t as default
|
|
601
515
|
};
|