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