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.
@@ -1,14 +1,15 @@
1
- import { b as F, p as $, e as W, u as q, c as X, n as G, _ as Q, w as Y } from "./base-29f73b05.js";
2
- import { E as Z } from "./el-dialog-eedcfd3e.js";
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 ee } from "./el-button-e2c63c08.js";
5
- import { E as te } from "./el-input-d47281da.js";
6
- import { defineComponent as L, ref as v, computed as T, watch as K, openBlock as _, createElementBlock as k, normalizeClass as j, unref as S, normalizeStyle as V, createBlock as z, withCtx as B, resolveDynamicComponent as se, renderSlot as ae, onMounted as oe, nextTick as C, createElementVNode as o, Fragment as M, renderList as ne, createVNode as I, toDisplayString as O, createCommentVNode as D, withKeys as re, withModifiers as ie, createTextVNode as le, pushScopeId as ce, popScopeId as ue } from "vue";
7
- import { d as N } from "./dayjs.min-8313b006.js";
8
- import { E as pe, u as de, s as P, p as me } from "./index-c2b9bbfd.js";
9
- import { _ as fe } from "./_plugin-vue_export-helper-dad06003.js";
10
- import { E as R } from "./index-f30561d3.js";
11
- import { k as ve, i as _e } from "./use-form-common-props-cb0ca65c.js";
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 ge = F({
25
+ const we = Z({
25
26
  size: {
26
27
  type: [Number, String],
27
- values: ve,
28
+ values: ye,
28
29
  default: "",
29
- validator: (t) => $(t)
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: _e
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: W(String),
47
+ type: ee(String),
47
48
  default: "cover"
48
49
  }
49
- }), he = {
50
- error: (t) => t instanceof Event
51
- }, ye = L({
50
+ }), Se = {
51
+ error: (r) => r instanceof Event
52
+ }, Ce = J({
52
53
  name: "ElAvatar"
53
- }), Se = /* @__PURE__ */ L({
54
- ...ye,
55
- props: ge,
56
- emits: he,
57
- setup(t, { emit: g }) {
58
- const d = t, s = q("avatar"), c = v(!1), a = T(() => {
59
- const { size: e, icon: f, shape: i } = d, l = [s.b()];
60
- return X(e) && l.push(s.m(e)), f && l.push(s.m("icon")), i && l.push(s.m(i)), l;
61
- }), n = T(() => {
62
- const { size: e } = d;
63
- return $(e) ? s.cssVarBlock({
64
- size: G(e) || ""
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
- }), u = T(() => ({
67
- objectFit: d.fit
67
+ }), h = $(() => ({
68
+ objectFit: _.fit
68
69
  }));
69
- K(() => d.src, () => c.value = !1);
70
- function r(e) {
71
- c.value = !0, g("error", e);
70
+ W(() => _.src, () => m.value = !1);
71
+ function c(o) {
72
+ m.value = !0, E("error", o);
72
73
  }
73
- return (e, f) => (_(), k("span", {
74
- class: j(S(a)),
75
- style: V(S(n))
74
+ return (o, y) => (v(), k("span", {
75
+ class: X(D(l)),
76
+ style: O(D(g))
76
77
  }, [
77
- (e.src || e.srcSet) && !c.value ? (_(), k("img", {
78
+ (o.src || o.srcSet) && !m.value ? (v(), k("img", {
78
79
  key: 0,
79
- src: e.src,
80
- alt: e.alt,
81
- srcset: e.srcSet,
82
- style: V(S(u)),
83
- onError: r
84
- }, null, 44, ["src", "alt", "srcset"])) : e.icon ? (_(), z(S(pe), { key: 1 }, {
85
- default: B(() => [
86
- (_(), z(se(e.icon)))
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
- })) : ae(e.$slots, "default", { key: 2 })
90
+ })) : ue(o.$slots, "default", { key: 2 })
90
91
  ], 6));
91
92
  }
92
93
  });
93
- var we = /* @__PURE__ */ Q(Se, [["__file", "avatar.vue"]]);
94
- const be = Y(we);
95
- const Ee = async ({ appId: t, apiKey: g, value: d, callback: s }) => {
96
- var c;
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 a = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${t}/completion`, {
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: d },
102
+ input: { prompt: _ },
102
103
  parameters: { incremental_output: "true" },
103
104
  debug: {}
104
105
  }),
105
106
  headers: {
106
- Authorization: `Bearer ${g}`,
107
+ Authorization: `Bearer ${E}`,
107
108
  "Content-Type": "application/json",
108
109
  "X-DashScope-SSE": "enable"
109
110
  }
110
111
  });
111
- if (!a.ok)
112
- throw new Error(`HTTP ${a.status}`);
113
- const n = a.body.getReader(), u = new TextDecoder();
114
- let r = "";
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: e, value: f } = await n.read();
117
- if (e) {
118
- r.trim() && ke(r, s), s("finish", "");
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
- r += u.decode(f, { stream: !0 });
122
- let i;
123
- for (; (i = r.indexOf(`
122
+ c += h.decode(y, { stream: !0 });
123
+ let a;
124
+ for (; (a = c.indexOf(`
124
125
  `)) !== -1; ) {
125
- const l = r.substring(0, i).trim();
126
- if (r = r.substring(i + 1), l.startsWith("data:")) {
127
- const b = l.substring(5).trim();
128
- if (b && b !== "[DONE]")
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 p = JSON.parse(b), h = (c = p == null ? void 0 : p.output) == null ? void 0 : c.text;
131
- h && s && s("message", h);
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 (a) {
139
- console.error("流式请求失败:", a), s("error", a.message);
139
+ } catch (l) {
140
+ console.error("流式请求失败:", l), i("error", l.message);
140
141
  }
141
142
  };
142
- function ke(t, g) {
143
- var s;
144
- const d = t.split(`
143
+ function Ae(r, E) {
144
+ var i;
145
+ const _ = r.split(`
145
146
  `);
146
- for (const c of d)
147
- if (c.startsWith("data:")) {
148
- const a = c.substring(5).trim();
149
- if (a && a !== "[DONE]")
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 n = JSON.parse(a), u = (s = n == null ? void 0 : n.output) == null ? void 0 : s.text;
152
- u && g && g("message", u);
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 J = (t) => (ce("data-v-46407344"), t = t(), ue(), t), xe = { class: "chat-container" }, Ae = { class: "avatar" }, Ie = { class: "message-content" }, Ne = { class: "message-text" }, Te = { class: "message-time" }, ze = {
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
- }, Be = { class: "avatar" }, He = /* @__PURE__ */ J(() => /* @__PURE__ */ o("div", { class: "message-content" }, [
161
- /* @__PURE__ */ o("div", { class: "typing-indicator" }, [
162
- /* @__PURE__ */ o("span"),
163
- /* @__PURE__ */ o("span"),
164
- /* @__PURE__ */ o("span")
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)), Ve = { class: "input-area" }, Ce = { class: "input-actions" }, Me = /* @__PURE__ */ J(() => /* @__PURE__ */ o("div", { class: "input-hint" }, [
167
- /* @__PURE__ */ o("span", null, "Ctrl + Enter 发送")
168
- ], -1)), Oe = {
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(t, { expose: g, emit: d }) {
181
- const s = d, c = t, a = v(!1), n = v(!1), u = v(!1), r = v(null), e = v([]), f = v(""), i = v(null), l = v(-1), b = async () => {
182
- const h = f.value.trim();
183
- if (!h)
184
- return R.warning("请输入消息内容");
185
- if (n.value)
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
- e.value.push({
261
+ a.value.push({
188
262
  role: "user",
189
- time: N().format("HH:mm"),
190
- content: h
191
- }), f.value = "", await p();
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
- time: N().format("HH:mm"),
195
- content: ""
196
- };
197
- e.value.push(w), l.value = e.value.length - 1, i.value = w, await p(), n.value = !0, u.value = !0;
198
- let y = "";
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 Ee({
277
+ await Pe({
201
278
  appId: "9e54d112acfe4531bd1fc4fee8827fef",
202
279
  apiKey: "sk-d995eb26a4334bdeb2ccb4cbfaf51de8",
203
- value: h,
204
- callback: (A, E) => {
205
- if (A === "message")
206
- y += E, i.value && (i.value.content = y, p());
207
- else if (A === "finish") {
208
- u.value = !1, n.value = !1, console.log(y);
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 m = JSON.parse(y);
211
- s("callBack", m);
291
+ const A = JSON.parse(e);
292
+ l("callBack", A);
212
293
  } catch {
213
- s("callBack", y);
294
+ l("callBack", e);
214
295
  }
215
- i.value = null, l.value = -1;
216
296
  }
217
297
  }
218
298
  });
219
- } catch (x) {
220
- R.error(`AI响应异常: ${x}`), console.error("AI响应异常:", x), l.value !== -1 && (e.value.splice(l.value, 1), i.value = null, l.value = -1), e.value.push({
299
+ } catch (p) {
300
+ B.error(`AI响应异常: ${p}`), a.value.pop(), a.value.push({
221
301
  role: "assistant",
222
- time: N().format("HH:mm"),
223
- content: "抱歉,AI服务响应异常,请稍后重试。"
224
- }), await p(), n.value = !1, u.value = !1;
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
- }, p = async () => {
227
- await C(), r.value && (r.value.scrollTop = r.value.scrollHeight);
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 oe(() => {
230
- e.value.push({
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
- p();
328
+ P();
239
329
  },
240
330
  { deep: !0 }
241
- ), g({
242
- open: (h) => {
243
- a.value = !0, C(() => {
244
- p();
331
+ ), E({
332
+ open: () => {
333
+ h.value = !0, I(() => {
334
+ P();
245
335
  });
246
336
  }
247
- }), (h, w) => {
248
- const y = be, x = te, H = ee, A = Z;
249
- return _(), z(A, {
250
- class: "ai-dialog",
251
- modelValue: a.value,
252
- "onUpdate:modelValue": w[1] || (w[1] = (E) => a.value = E),
253
- title: " 品种池参数解析AI助手",
254
- width: "500px",
255
- center: "",
256
- draggable: "",
257
- overflow: "",
258
- modal: !1,
259
- "modal-penetrable": !0
260
- }, {
261
- default: B(() => {
262
- var E;
263
- return [
264
- o("div", xe, [
265
- o("div", {
266
- ref_key: "messageListRef",
267
- ref: r,
268
- class: "message-list"
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
- m.content ? (_(), k(M, { key: 0 }, [
275
- o("div", Ae, [
276
- I(y, {
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: m.role === "user" ? S(de) : S(P)
402
+ icon: D(U)
279
403
  }, null, 8, ["icon"])
280
404
  ]),
281
- o("div", Ie, [
282
- o("div", Ne, O(m.content), 1),
283
- o("div", Te, O(m.time), 1)
284
- ])
285
- ], 64)) : D("", !0)
286
- ], 2))), 128)),
287
- u.value && !((E = i.value) != null && E.content) ? (_(), k("div", ze, [
288
- o("div", Be, [
289
- I(y, {
290
- size: 32,
291
- icon: S(P)
292
- }, null, 8, ["icon"])
293
- ]),
294
- He
295
- ])) : D("", !0)
296
- ], 512),
297
- o("div", Ve, [
298
- I(x, {
299
- class: "message-input",
300
- modelValue: f.value,
301
- "onUpdate:modelValue": w[0] || (w[0] = (m) => f.value = m),
302
- type: "textarea",
303
- rows: 4,
304
- autosize: { minRows: 2, maxRows: 4 },
305
- placeholder: "输入您想查询的品种条件...",
306
- onKeydown: re(ie(b, ["ctrl"]), ["enter"])
307
- }, null, 8, ["modelValue", "onKeydown"]),
308
- o("div", Ce, [
309
- Me,
310
- I(H, {
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
- _: 1
329
- }, 8, ["modelValue"]);
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
- }, De = /* @__PURE__ */ fe(Oe, [["__scopeId", "data-v-46407344"]]), it = {
333
- install(t) {
334
- t.component("st-varietyAiHelper", De);
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
- it as default
492
+ Pt as default
339
493
  };