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