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.
@@ -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 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 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 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 ge = F({
25
+ const Se = Q({
25
26
  size: {
26
27
  type: [Number, String],
27
- values: ve,
28
+ values: Te,
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: 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: W(String),
47
+ type: Z(String),
47
48
  default: "cover"
48
49
  }
49
- }), he = {
50
- error: (t) => t instanceof Event
51
- }, ye = L({
50
+ }), Ce = {
51
+ error: (r) => r instanceof Event
52
+ }, Ee = 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
+ }), 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
- }), u = T(() => ({
67
- objectFit: d.fit
67
+ }), g = $(() => ({
68
+ objectFit: v.fit
68
69
  }));
69
- K(() => d.src, () => c.value = !1);
70
- function r(e) {
71
- c.value = !0, g("error", e);
70
+ W(() => v.src, () => u.value = !1);
71
+ function c(o) {
72
+ u.value = !0, C("error", o);
72
73
  }
73
- return (e, f) => (_(), k("span", {
74
- class: j(S(a)),
75
- style: V(S(n))
74
+ return (o, k) => (p(), b("span", {
75
+ class: X(V(l)),
76
+ style: j(V(_))
76
77
  }, [
77
- (e.src || e.srcSet) && !c.value ? (_(), k("img", {
78
+ (o.src || o.srcSet) && !u.value ? (p(), b("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: 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
- })) : ae(e.$slots, "default", { key: 2 })
90
+ })) : ce(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__ */ 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 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: v },
102
103
  parameters: { incremental_output: "true" },
103
104
  debug: {}
104
105
  }),
105
106
  headers: {
106
- Authorization: `Bearer ${g}`,
107
+ Authorization: `Bearer ${C}`,
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 _ = l.body.getReader(), g = 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: k } = await _.read();
118
+ if (o) {
119
+ c.trim() && Me(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 += g.decode(k, { stream: !0 });
123
+ let t;
124
+ for (; (t = 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 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 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 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 (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 Me(r, C) {
144
+ var i;
145
+ const v = 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 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 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 _ = 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 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 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
- }, 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
+ }, 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)), 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)), 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(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: 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
- e.value.push({
261
+ t.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: E,
264
+ createTime: z().format("YYYY-MM-DD HH:mm:ss")
265
+ }), d.value = "", await P(), t.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: 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 Ee({
277
+ await Ae({
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: 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 m = JSON.parse(y);
211
- s("callBack", m);
291
+ const A = JSON.parse(s);
292
+ l("callBack", A);
212
293
  } catch {
213
- s("callBack", y);
294
+ l("callBack", s);
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 (f) {
300
+ B.error(`AI响应异常: ${f}`), t.value.pop(), t.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: 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
- }, p = async () => {
227
- await C(), r.value && (r.value.scrollTop = r.value.scrollHeight);
311
+ }, P = async () => {
312
+ await R(), k.value && (k.value.scrollTop = k.value.scrollHeight);
228
313
  };
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,
314
+ return W(
315
+ () => t.value,
237
316
  () => {
238
- p();
317
+ P();
239
318
  },
240
319
  { deep: !0 }
241
- ), g({
242
- open: (h) => {
243
- a.value = !0, C(() => {
244
- p();
320
+ ), C({
321
+ open: () => {
322
+ g.value = !0, R(() => {
323
+ P();
245
324
  });
246
325
  }
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])
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
- m.content ? (_(), k(M, { key: 0 }, [
275
- o("div", Ae, [
276
- I(y, {
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: m.role === "user" ? S(de) : S(P)
391
+ icon: V(U)
279
392
  }, null, 8, ["icon"])
280
393
  ]),
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"])
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
- _: 1
329
- }, 8, ["modelValue"]);
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
- }, De = /* @__PURE__ */ fe(Oe, [["__scopeId", "data-v-46407344"]]), it = {
333
- install(t) {
334
- t.component("st-varietyAiHelper", De);
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
- it as default
481
+ At as default
339
482
  };