st-comp 0.0.251 → 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 P, e as q, u as X, c as G, n as Q, _ as W, 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 j, ref as u, computed as z, watch as D, openBlock as p, createElementBlock as w, normalizeClass as O, unref as h, normalizeStyle as N, createBlock as T, withCtx as V, resolveDynamicComponent as se, renderSlot as ae, onMounted as oe, nextTick as C, createElementVNode as t, Fragment as M, renderList as ne, createVNode as I, toDisplayString as R, createCommentVNode as L, withKeys as re, withModifiers as ie, createTextVNode as le, pushScopeId as ce, popScopeId as ue } from "vue";
7
- import { d as x } from "./dayjs.min-8313b006.js";
8
- import { E as pe, u as de, s as $, p as me } from "./index-c2b9bbfd.js";
9
- import { _ as ve } from "./_plugin-vue_export-helper-dad06003.js";
10
- import { E as K } from "./index-f30561d3.js";
11
- import { k as fe, 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 he = F({
25
+ const Se = Q({
25
26
  size: {
26
27
  type: [Number, String],
27
- values: fe,
28
+ values: Te,
28
29
  default: "",
29
- validator: (s) => P(s)
30
+ validator: (r) => q(r)
30
31
  },
31
32
  shape: {
32
33
  type: String,
@@ -34,7 +35,7 @@ const he = 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,107 +44,138 @@ const he = F({
43
44
  alt: String,
44
45
  srcSet: String,
45
46
  fit: {
46
- type: q(String),
47
+ type: Z(String),
47
48
  default: "cover"
48
49
  }
49
- }), ye = {
50
- error: (s) => s instanceof Event
51
- }, ge = j({
50
+ }), Ce = {
51
+ error: (r) => r instanceof Event
52
+ }, Ee = J({
52
53
  name: "ElAvatar"
53
- }), Se = /* @__PURE__ */ j({
54
- ...ge,
55
- props: he,
56
- emits: ye,
57
- setup(s, { emit: b }) {
58
- const d = s, a = X("avatar"), m = u(!1), r = z(() => {
59
- const { size: e, icon: i, shape: o } = d, n = [a.b()];
60
- return G(e) && n.push(a.m(e)), i && n.push(a.m("icon")), o && n.push(a.m(o)), n;
61
- }), c = z(() => {
62
- const { size: e } = d;
63
- return P(e) ? a.cssVarBlock({
64
- size: Q(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
- }), v = z(() => ({
67
- objectFit: d.fit
67
+ }), g = $(() => ({
68
+ objectFit: v.fit
68
69
  }));
69
- D(() => d.src, () => m.value = !1);
70
- function f(e) {
71
- m.value = !0, b("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, i) => (p(), w("span", {
74
- class: O(h(r)),
75
- style: N(h(c))
74
+ return (o, k) => (p(), b("span", {
75
+ class: X(V(l)),
76
+ style: j(V(_))
76
77
  }, [
77
- (e.src || e.srcSet) && !m.value ? (p(), w("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: N(h(v)),
83
- onError: f
84
- }, null, 44, ["src", "alt", "srcset"])) : e.icon ? (p(), T(h(pe), { key: 1 }, {
85
- default: V(() => [
86
- (p(), T(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__ */ W(Se, [["__file", "avatar.vue"]]);
94
- const be = Y(we);
95
- const Ee = async ({ appId: s, apiKey: b, value: d, callback: a }) => {
96
- var m;
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 r = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${s}/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
- parameters: {
103
- incremental_output: "true"
104
- // 流式返回
105
- },
102
+ input: { prompt: v },
103
+ parameters: { incremental_output: "true" },
106
104
  debug: {}
107
105
  }),
108
106
  headers: {
109
- Authorization: `Bearer ${b}`,
107
+ Authorization: `Bearer ${C}`,
110
108
  "Content-Type": "application/json",
111
109
  "X-DashScope-SSE": "enable"
112
- // 流式输出
113
110
  }
114
111
  });
115
- if (!r.ok || !r.body)
116
- throw new Error("请求失败");
117
- const c = r.body.getReader(), v = new TextDecoder();
112
+ if (!l.ok)
113
+ throw new Error(`HTTP ${l.status}`);
114
+ const _ = l.body.getReader(), g = new TextDecoder();
115
+ let c = "";
118
116
  for (; ; ) {
119
- const { done: f, value: e } = await c.read();
120
- if (f && a) {
121
- a("finish", "");
117
+ const { done: o, value: k } = await _.read();
118
+ if (o) {
119
+ c.trim() && Me(c, i), i("finish", "");
122
120
  break;
123
121
  }
124
- try {
125
- const i = v.decode(e, { stream: !0 }), o = JSON.parse(i.split(`
126
- `)[3].substr(5)), n = (m = o == null ? void 0 : o.output) == null ? void 0 : m.text;
127
- n && a && a("message", n);
128
- } catch {
122
+ c += g.decode(k, { stream: !0 });
123
+ let t;
124
+ for (; (t = c.indexOf(`
125
+ `)) !== -1; ) {
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]")
130
+ try {
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);
133
+ } catch {
134
+ console.debug("等待完整数据...");
135
+ }
136
+ }
129
137
  }
130
138
  }
131
- } catch (r) {
132
- console.error(r);
139
+ } catch (l) {
140
+ console.error("流式请求失败:", l), i("error", l.message);
133
141
  }
134
142
  };
135
- const J = (s) => (ce("data-v-46407344"), s = s(), ue(), s), ke = { class: "chat-container" }, Ae = { class: "avatar" }, Ie = { class: "message-content" }, xe = { class: "message-text" }, ze = { class: "message-time" }, Te = {
143
+ function Me(r, C) {
144
+ var i;
145
+ const v = r.split(`
146
+ `);
147
+ for (const u of v)
148
+ if (u.startsWith("data:")) {
149
+ const l = u.substring(5).trim();
150
+ if (l && l !== "[DONE]")
151
+ try {
152
+ const _ = JSON.parse(l), g = (i = _ == null ? void 0 : _.output) == null ? void 0 : i.text;
153
+ g && C && C("message", g);
154
+ } catch {
155
+ }
156
+ }
157
+ }
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 = {
136
168
  key: 0,
137
169
  class: "message-item assistant"
138
- }, Ve = { class: "avatar" }, Be = /* @__PURE__ */ J(() => /* @__PURE__ */ t("div", { class: "message-content" }, [
139
- /* @__PURE__ */ t("div", { class: "typing-indicator" }, [
140
- /* @__PURE__ */ t("span"),
141
- /* @__PURE__ */ t("span"),
142
- /* @__PURE__ */ t("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")
143
175
  ])
144
- ], -1)), He = { class: "input-area" }, Ne = { class: "input-actions" }, Ce = /* @__PURE__ */ J(() => /* @__PURE__ */ t("div", { class: "input-hint" }, [
145
- /* @__PURE__ */ t("span", null, "Ctrl + Enter 发送")
146
- ], -1)), Me = {
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 = {
147
179
  __name: "index",
148
180
  props: {
149
181
  defaultMessage: {
@@ -155,163 +187,296 @@ const J = (s) => (ce("data-v-46407344"), s = s(), ue(), s), ke = { class: "chat-
155
187
  }
156
188
  },
157
189
  emits: ["callBack"],
158
- setup(s, { expose: b, emit: d }) {
159
- const a = d, m = s, r = u(!1), c = u(!1), v = u(!1), f = u(null), e = u([]), i = u(""), o = u(null), n = u(-1), B = async () => {
160
- const E = i.value.trim();
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();
161
257
  if (!E)
162
- return K.warning("请输入消息内容");
258
+ return B.warning("请输入消息内容");
163
259
  if (c.value)
164
260
  return;
165
- e.value.push({
261
+ t.value.push({
166
262
  role: "user",
167
- time: x().format("HH:mm"),
168
- content: E
169
- }), i.value = "", await g();
170
- const y = {
263
+ content: E,
264
+ createTime: z().format("YYYY-MM-DD HH:mm:ss")
265
+ }), d.value = "", await P(), t.value.push({
171
266
  role: "assistant",
172
- time: x().format("HH:mm"),
173
- content: ""
174
- };
175
- e.value.push(y), n.value = e.value.length - 1, o.value = y, await g(), c.value = !0, v.value = !0;
176
- let _ = "";
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();
177
276
  try {
178
- await Ee({
277
+ await Ae({
179
278
  appId: "9e54d112acfe4531bd1fc4fee8827fef",
180
279
  apiKey: "sk-d995eb26a4334bdeb2ccb4cbfaf51de8",
181
280
  value: E,
182
- callback: (A, S) => {
183
- if (A === "message")
184
- _ += S, o.value && (o.value.content = _, g());
185
- else if (A === "finish") {
186
- v.value = !1, c.value = !1, console.log(_);
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));
187
290
  try {
188
- const l = JSON.parse(_);
189
- a("callBack", l);
291
+ const A = JSON.parse(s);
292
+ l("callBack", A);
190
293
  } catch {
191
- a("callBack", _);
294
+ l("callBack", s);
192
295
  }
193
- o.value = null, n.value = -1;
194
296
  }
195
297
  }
196
298
  });
197
- } catch (k) {
198
- K.error(`AI响应异常: ${k}`), console.error("AI响应异常:", k), n.value !== -1 && (e.value.splice(n.value, 1), o.value = null, n.value = -1), e.value.push({
299
+ } catch (f) {
300
+ B.error(`AI响应异常: ${f}`), t.value.pop(), t.value.push({
199
301
  role: "assistant",
200
- time: x().format("HH:mm"),
201
- content: "抱歉,AI服务响应异常,请稍后重试。"
202
- }), await g(), c.value = !1, v.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;
203
310
  }
204
- }, g = async () => {
205
- await C(), f.value && (f.value.scrollTop = f.value.scrollHeight);
311
+ }, P = async () => {
312
+ await R(), k.value && (k.value.scrollTop = k.value.scrollHeight);
206
313
  };
207
- return oe(() => {
208
- e.value.push({
209
- role: "assistant",
210
- time: x().format("HH:mm"),
211
- content: m.defaultMessage
212
- });
213
- }), D(
214
- () => e.value,
314
+ return W(
315
+ () => t.value,
215
316
  () => {
216
- g();
317
+ P();
217
318
  },
218
319
  { deep: !0 }
219
- ), b({
220
- open: (E) => {
221
- r.value = !0, C(() => {
222
- g();
320
+ ), C({
321
+ open: () => {
322
+ g.value = !0, R(() => {
323
+ P();
223
324
  });
224
325
  }
225
- }), (E, y) => {
226
- const _ = be, k = te, H = ee, A = Z;
227
- return p(), T(A, {
228
- class: "ai-dialog",
229
- modelValue: r.value,
230
- "onUpdate:modelValue": y[1] || (y[1] = (S) => r.value = S),
231
- title: " 品种池参数解析AI助手",
232
- width: "500px",
233
- center: "",
234
- draggable: "",
235
- overflow: "",
236
- modal: !1,
237
- "modal-penetrable": !0
238
- }, {
239
- default: V(() => {
240
- var S;
241
- return [
242
- t("div", ke, [
243
- t("div", {
244
- ref_key: "messageListRef",
245
- ref: f,
246
- class: "message-list"
247
- }, [
248
- (p(!0), w(M, null, ne(e.value, (l, U) => (p(), w("div", {
249
- key: U,
250
- class: O(["message-item", l.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"
251
349
  }, [
252
- l.content ? (p(), w(M, { key: 0 }, [
253
- t("div", Ae, [
254
- I(_, {
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, {
255
390
  size: 32,
256
- icon: l.role === "user" ? h(de) : h($)
391
+ icon: V(U)
257
392
  }, null, 8, ["icon"])
258
393
  ]),
259
- t("div", Ie, [
260
- t("div", xe, R(l.content), 1),
261
- t("div", ze, R(l.time), 1)
262
- ])
263
- ], 64)) : L("", !0)
264
- ], 2))), 128)),
265
- v.value && !((S = o.value) != null && S.content) ? (p(), w("div", Te, [
266
- t("div", Ve, [
267
- I(_, {
268
- size: 32,
269
- icon: h($)
270
- }, null, 8, ["icon"])
271
- ]),
272
- Be
273
- ])) : L("", !0)
274
- ], 512),
275
- t("div", He, [
276
- I(k, {
277
- class: "message-input",
278
- modelValue: i.value,
279
- "onUpdate:modelValue": y[0] || (y[0] = (l) => i.value = l),
280
- type: "textarea",
281
- rows: 4,
282
- autosize: { minRows: 2, maxRows: 4 },
283
- placeholder: "输入您想查询的品种条件...",
284
- onKeydown: re(ie(B, ["ctrl"]), ["enter"])
285
- }, null, 8, ["modelValue", "onKeydown"]),
286
- t("div", Ne, [
287
- Ce,
288
- I(H, {
289
- class: "send-btn",
290
- type: "primary",
291
- icon: h(me),
292
- loading: c.value,
293
- onClick: B,
294
- round: ""
295
- }, {
296
- default: V(() => [
297
- le(" 发送 ")
298
- ]),
299
- _: 1
300
- }, 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
+ ])
301
424
  ])
302
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
+ })
303
455
  ])
304
- ];
305
- }),
306
- _: 1
307
- }, 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);
308
473
  };
309
474
  }
310
- }, Re = /* @__PURE__ */ ve(Me, [["__scopeId", "data-v-46407344"]]), rt = {
311
- install(s) {
312
- s.component("st-varietyAiHelper", Re);
475
+ }, nt = /* @__PURE__ */ ye(ot, [["__scopeId", "data-v-f1a4bc79"]]), At = {
476
+ install(r) {
477
+ r.component("st-varietyAiHelper", nt);
313
478
  }
314
479
  };
315
480
  export {
316
- rt as default
481
+ At as default
317
482
  };