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