st-comp 0.0.261 → 0.0.263

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.
@@ -2,14 +2,15 @@ import { b as le, p as Z, e as ce, u as ue, c as de, n as me, _ as pe, w as fe }
2
2
  import { E as ve } from "./el-dialog-eedcfd3e.js";
3
3
  import "./el-overlay-1ee0338d.js";
4
4
  import { E as ge } from "./el-button-e2c63c08.js";
5
- import { E as he } from "./el-input-d47281da.js";
6
- import { defineComponent as ee, ref as T, computed as I, watch as R, openBlock as v, createElementBlock as y, normalizeClass as te, unref as P, normalizeStyle as W, createBlock as X, withCtx as H, resolveDynamicComponent as _e, renderSlot as ye, inject as be, reactive as Te, onMounted as ke, nextTick as J, Fragment as O, createVNode as M, createElementVNode as o, renderList as Se, toDisplayString as G, createCommentVNode as $, createTextVNode as j, pushScopeId as we, popScopeId as Ce } from "vue";
7
- import { d as B } from "./dayjs.min-8313b006.js";
5
+ import { E as _e } from "./el-input-d47281da.js";
6
+ import { defineComponent as ee, ref as f, computed as $, watch as x, openBlock as c, createElementBlock as m, normalizeClass as te, unref as b, normalizeStyle as G, createBlock as Q, withCtx as S, resolveDynamicComponent as he, renderSlot as ke, inject as be, reactive as ye, onMounted as Te, nextTick as O, Fragment as F, createVNode as _, createElementVNode as o, renderList as we, toDisplayString as W, createCommentVNode as H, createTextVNode as j, pushScopeId as Ce, popScopeId as Se } from "vue";
7
+ import { d as P } from "./dayjs.min-8313b006.js";
8
8
  import { V as Ee } from "./index-7ed0999e.js";
9
- import { E as Ne, u as De, s as Q, p as Me } from "./index-c2b9bbfd.js";
10
- import { _ as Ve } from "./_plugin-vue_export-helper-dad06003.js";
11
- import { E as L } from "./index-f30561d3.js";
12
- import { k as Pe, i as Ye } from "./use-form-common-props-cb0ca65c.js";
9
+ import { s as Ve } from "./aiTools-faa0a14d.js";
10
+ import { E as Me, u as De, s as X, p as Ne } from "./index-c2b9bbfd.js";
11
+ import { _ as Ye } from "./_plugin-vue_export-helper-dad06003.js";
12
+ import { E as B } from "./index-f30561d3.js";
13
+ import { k as Fe, i as He } from "./use-form-common-props-cb0ca65c.js";
13
14
  import "./index-0f79095c.js";
14
15
  import "./index-8391a3df.js";
15
16
  import "./index-de24705f.js";
@@ -22,12 +23,12 @@ import "./index-657047bb.js";
22
23
  import "./typescript-7ae59c4c.js";
23
24
  import "./index-c71e37dc.js";
24
25
  import "./config-provider-7860903c.js";
25
- const He = le({
26
+ const Pe = le({
26
27
  size: {
27
28
  type: [Number, String],
28
- values: Pe,
29
+ values: Fe,
29
30
  default: "",
30
- validator: (c) => Z(c)
31
+ validator: (u) => Z(u)
31
32
  },
32
33
  shape: {
33
34
  type: String,
@@ -35,7 +36,7 @@ const He = le({
35
36
  default: "circle"
36
37
  },
37
38
  icon: {
38
- type: Ye
39
+ type: He
39
40
  },
40
41
  src: {
41
42
  type: String,
@@ -47,163 +48,76 @@ const He = le({
47
48
  type: ce(String),
48
49
  default: "cover"
49
50
  }
50
- }), Fe = {
51
- error: (c) => c instanceof Event
52
- }, Ae = ee({
51
+ }), Ae = {
52
+ error: (u) => u instanceof Event
53
+ }, ze = ee({
53
54
  name: "ElAvatar"
54
- }), xe = /* @__PURE__ */ ee({
55
- ...Ae,
56
- props: He,
57
- emits: Fe,
58
- setup(c, { emit: E }) {
59
- const k = c, r = ue("avatar"), g = T(!1), l = I(() => {
60
- const { size: a, icon: w, shape: N } = k, s = [r.b()];
61
- return de(a) && s.push(r.m(a)), w && s.push(r.m("icon")), N && s.push(r.m(N)), s;
62
- }), S = I(() => {
63
- const { size: a } = k;
64
- return Z(a) ? r.cssVarBlock({
65
- size: me(a) || ""
55
+ }), Be = /* @__PURE__ */ ee({
56
+ ...ze,
57
+ props: Pe,
58
+ emits: Ae,
59
+ setup(u, { emit: L }) {
60
+ const E = u, p = ue("avatar"), y = f(!1), N = $(() => {
61
+ const { size: n, icon: k, shape: T } = E, a = [p.b()];
62
+ return de(n) && a.push(p.m(n)), k && a.push(p.m("icon")), T && a.push(p.m(T)), a;
63
+ }), A = $(() => {
64
+ const { size: n } = E;
65
+ return Z(n) ? p.cssVarBlock({
66
+ size: me(n) || ""
66
67
  }) : void 0;
67
- }), m = I(() => ({
68
- objectFit: k.fit
68
+ }), I = $(() => ({
69
+ objectFit: E.fit
69
70
  }));
70
- R(() => k.src, () => g.value = !1);
71
- function d(a) {
72
- g.value = !0, E("error", a);
71
+ x(() => E.src, () => y.value = !1);
72
+ function z(n) {
73
+ y.value = !0, L("error", n);
73
74
  }
74
- return (a, w) => (v(), y("span", {
75
- class: te(P(l)),
76
- style: W(P(S))
75
+ return (n, k) => (c(), m("span", {
76
+ class: te(b(N)),
77
+ style: G(b(A))
77
78
  }, [
78
- (a.src || a.srcSet) && !g.value ? (v(), y("img", {
79
+ (n.src || n.srcSet) && !y.value ? (c(), m("img", {
79
80
  key: 0,
80
- src: a.src,
81
- alt: a.alt,
82
- srcset: a.srcSet,
83
- style: W(P(m)),
84
- onError: d
85
- }, null, 44, ["src", "alt", "srcset"])) : a.icon ? (v(), X(P(Ne), { key: 1 }, {
86
- default: H(() => [
87
- (v(), X(_e(a.icon)))
81
+ src: n.src,
82
+ alt: n.alt,
83
+ srcset: n.srcSet,
84
+ style: G(b(I)),
85
+ onError: z
86
+ }, null, 44, ["src", "alt", "srcset"])) : n.icon ? (c(), Q(b(Me), { key: 1 }, {
87
+ default: S(() => [
88
+ (c(), Q(he(n.icon)))
88
89
  ]),
89
90
  _: 1
90
- })) : ye(a.$slots, "default", { key: 2 })
91
+ })) : ke(n.$slots, "default", { key: 2 })
91
92
  ], 6));
92
93
  }
93
94
  });
94
- var Oe = /* @__PURE__ */ pe(xe, [["__file", "avatar.vue"]]);
95
- const $e = fe(Oe);
96
- const Be = async ({ appId: c, apiKey: E, value: k, callback: r }) => {
97
- var g;
98
- try {
99
- const l = await fetch(`https://dashscope.aliyuncs.com/api/v1/apps/${c}/completion`, {
100
- method: "POST",
101
- body: JSON.stringify({
102
- input: { prompt: k },
103
- parameters: { incremental_output: "true" },
104
- debug: {}
105
- }),
106
- headers: {
107
- Authorization: `Bearer ${E}`,
108
- "Content-Type": "application/json",
109
- "X-DashScope-SSE": "enable"
110
- }
111
- });
112
- if (!l.ok) {
113
- r("error", `HTTP ${l.status}: ${l.statusText}`);
114
- return;
115
- }
116
- const S = l.body.getReader(), m = new TextDecoder();
117
- let d = "", a = null;
118
- for (; ; ) {
119
- const { done: w, value: N } = await S.read();
120
- if (w) {
121
- d.trim() && ze(d, r), r("finish", "");
122
- break;
123
- }
124
- d += m.decode(N, { stream: !0 });
125
- let s;
126
- for (; (s = d.indexOf(`
127
- `)) !== -1; ) {
128
- const _ = d.substring(0, s).trim();
129
- if (d = d.substring(s + 1), _.startsWith("event:")) {
130
- a = _.substring(6).trim();
131
- continue;
132
- }
133
- if (_.startsWith("data:")) {
134
- const b = _.substring(5).trim();
135
- if (a === "error" || b && b.startsWith("{"))
136
- try {
137
- const p = JSON.parse(b);
138
- if (p.code || p.message || a === "error") {
139
- const z = p.message || p.code || "未知错误";
140
- r("error", `百炼服务端错误: ${z}`);
141
- return;
142
- }
143
- const x = (g = p == null ? void 0 : p.output) == null ? void 0 : g.text;
144
- x && r && r("message", x);
145
- } catch {
146
- console.debug("JSON 解析失败:", b);
147
- }
148
- a = null;
149
- }
150
- }
151
- }
152
- } catch (l) {
153
- console.error("流式请求失败:", l), r("error", l.message);
154
- }
155
- }, ze = (c, E) => {
156
- var g;
157
- const k = c.split(`
158
- `);
159
- let r = null;
160
- for (const l of k) {
161
- if (l.startsWith("event:")) {
162
- r = l.substring(6).trim();
163
- continue;
164
- }
165
- if (l.startsWith("data:")) {
166
- const S = l.substring(5).trim();
167
- if (S && S !== "[DONE]")
168
- try {
169
- const m = JSON.parse(S);
170
- if (r === "error" || m.code || m.message) {
171
- const a = m.message || m.code || "未知错误";
172
- E("error", `百炼服务端错误: ${a}`);
173
- return;
174
- }
175
- const d = (g = m == null ? void 0 : m.output) == null ? void 0 : g.text;
176
- d && E && E("message", d);
177
- } catch {
178
- }
179
- r = null;
180
- }
181
- }
182
- };
183
- const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-dialog-body" }, Ie = { class: "avatar" }, Je = { class: "message-content" }, je = ["innerHTML"], Re = {
95
+ var Le = /* @__PURE__ */ pe(Be, [["__file", "avatar.vue"]]);
96
+ const Ie = fe(Le);
97
+ const h = (u) => (Ce("data-v-536916ba"), u = u(), Se(), u), $e = { class: "ai-dialog-body" }, Oe = { class: "avatar" }, je = { class: "message-content" }, xe = ["innerHTML"], qe = {
184
98
  key: 1,
185
99
  class: "message-text"
186
- }, qe = { class: "message-createTime" }, Ke = /* @__PURE__ */ V(() => /* @__PURE__ */ o("div", { class: "message-createTime" }, "请问对本轮查询结果是否满意?", -1)), Ue = { class: "feedback-buttons" }, We = ["onClick"], Xe = /* @__PURE__ */ V(() => /* @__PURE__ */ o("span", { class: "btn-emoji" }, "👍", -1)), Ge = /* @__PURE__ */ V(() => /* @__PURE__ */ o("span", { class: "btn-text" }, "满意", -1)), Qe = [
187
- Xe,
188
- Ge
189
- ], Ze = ["onClick"], et = /* @__PURE__ */ V(() => /* @__PURE__ */ o("span", { class: "btn-emoji" }, "👎", -1)), tt = /* @__PURE__ */ V(() => /* @__PURE__ */ o("span", { class: "btn-text" }, "不满意", -1)), st = [
190
- et,
191
- tt
192
- ], at = {
100
+ }, Je = { class: "message-createTime" }, Ke = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "message-createTime" }, "请问对本轮查询结果是否满意?", -1)), Re = { class: "feedback-buttons" }, Ue = ["onClick"], Ge = /* @__PURE__ */ h(() => /* @__PURE__ */ o("span", { class: "btn-emoji" }, "👍", -1)), Qe = /* @__PURE__ */ h(() => /* @__PURE__ */ o("span", { class: "btn-text" }, "满意", -1)), We = [
101
+ Ge,
102
+ Qe
103
+ ], Xe = ["onClick"], Ze = /* @__PURE__ */ h(() => /* @__PURE__ */ o("span", { class: "btn-emoji" }, "👎", -1)), et = /* @__PURE__ */ h(() => /* @__PURE__ */ o("span", { class: "btn-text" }, "不满意", -1)), tt = [
104
+ Ze,
105
+ et
106
+ ], st = {
193
107
  key: 1,
194
108
  class: "message-createTime"
195
- }, nt = {
109
+ }, at = {
196
110
  key: 0,
197
111
  class: "message-item assistant"
198
- }, ot = { class: "avatar" }, rt = /* @__PURE__ */ V(() => /* @__PURE__ */ o("div", { class: "message-content" }, [
112
+ }, ot = { class: "avatar" }, nt = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "message-content" }, [
199
113
  /* @__PURE__ */ o("div", { class: "typing-indicator" }, [
200
114
  /* @__PURE__ */ o("span"),
201
115
  /* @__PURE__ */ o("span"),
202
116
  /* @__PURE__ */ o("span")
203
117
  ])
204
- ], -1)), it = { class: "input-area" }, lt = { class: "input-actions" }, ct = /* @__PURE__ */ V(() => /* @__PURE__ */ o("div", { class: "input-hint" }, [
118
+ ], -1)), it = { class: "input-area" }, rt = { class: "input-actions" }, lt = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "input-hint" }, [
205
119
  /* @__PURE__ */ o("span", null, "Enter 发送 | Ctrl + Enter 换行")
206
- ], -1)), ut = { class: "feedback-dialog-content" }, dt = /* @__PURE__ */ V(() => /* @__PURE__ */ o("div", { class: "feedback-emoji" }, "😟", -1)), mt = /* @__PURE__ */ V(() => /* @__PURE__ */ o("p", { class: "feedback-tip" }, "很抱歉没能帮到您,请告诉我们哪里需要改进:", -1)), pt = { class: "dialog-footer" }, ft = {
120
+ ], -1)), ct = { class: "feedback-dialog-content" }, ut = /* @__PURE__ */ h(() => /* @__PURE__ */ o("div", { class: "feedback-emoji" }, "😟", -1)), dt = /* @__PURE__ */ h(() => /* @__PURE__ */ o("p", { class: "feedback-tip" }, "很抱歉没能帮到您,请告诉我们哪里需要改进:", -1)), mt = { class: "dialog-footer" }, pt = {
207
121
  __name: "index",
208
122
  props: {
209
123
  defaultMessage: {
@@ -215,38 +129,38 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
215
129
  }
216
130
  },
217
131
  emits: ["callBack"],
218
- setup(c, { expose: E, emit: k }) {
219
- const r = be("stConfig"), g = Te(Ee()), l = T(!1), S = k, m = c, d = T(), a = T(!1), w = T(!1), N = T(null), s = T([
132
+ setup(u, { expose: L, emit: E }) {
133
+ const p = be("stConfig"), y = ye(Ee()), N = f(!1), A = E, I = u, z = f(), n = f(!1), k = f(!1), T = f(null), a = f([
220
134
  {
221
135
  role: "assistant",
222
136
  // AI-assistant, 用户-user
223
- content: m.defaultMessage,
137
+ content: I.defaultMessage,
224
138
  userContent: null,
225
139
  showFeedback: !1,
226
140
  // 是否展示反馈按钮(默认信息不用展示)
227
141
  hasFeedback: !1,
228
142
  // 是否已进行过反馈
229
- createTime: B().format("YYYY-MM-DD HH:mm:ss"),
143
+ createTime: P().format("YYYY-MM-DD HH:mm:ss"),
230
144
  // 消息发起时间
231
145
  resTime: 0,
232
146
  // 响应总耗时
233
147
  firstPackageTime: 0
234
148
  // 首包响应耗时
235
149
  }
236
- ]), _ = T(""), b = T(!1), p = T(""), x = T({}), z = (n) => {
237
- if (typeof n != "string")
150
+ ]), w = f(""), V = f(!1), Y = f(""), q = f({}), J = (s) => {
151
+ if (typeof s != "string")
238
152
  return !1;
239
153
  try {
240
- const e = JSON.parse(n);
154
+ const e = JSON.parse(s);
241
155
  return e !== null && typeof e == "object";
242
156
  } catch {
243
157
  return !1;
244
158
  }
245
- }, se = (n) => {
246
- if (!z(n))
159
+ }, se = (s) => {
160
+ if (!J(s))
247
161
  return null;
248
162
  try {
249
- const e = JSON.parse(n), { parsedConditions: t, ...i } = e;
163
+ const e = JSON.parse(s), { parsedConditions: t, ...i } = e;
250
164
  return {
251
165
  parsedConditions: t,
252
166
  webParams: i
@@ -254,19 +168,19 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
254
168
  } catch {
255
169
  return null;
256
170
  }
257
- }, ae = (n) => {
171
+ }, ae = (s) => {
258
172
  var t;
259
- if (!n)
173
+ if (!s)
260
174
  return "";
261
175
  let e = "";
262
- return (t = n.parsedConditions) != null && t.length && (e += '<div class="parsed-conditions">', n.parsedConditions.forEach((i) => {
176
+ return (t = s.parsedConditions) != null && t.length && (e += '<div class="parsed-conditions">', s.parsedConditions.forEach((i) => {
263
177
  e += `<div class="parsed-conditions-item">${i}</div>`;
264
178
  }), e += "</div>"), e;
265
- }, F = async (n, e) => {
266
- switch (n) {
179
+ }, M = async (s, e) => {
180
+ switch (s) {
267
181
  case "satisfied": {
268
- const t = s.value[e], i = {
269
- userName: g.username,
182
+ const t = a.value[e], i = {
183
+ userName: y.username,
270
184
  userContent: t.userContent,
271
185
  aiContent: t.content,
272
186
  type: 1,
@@ -278,18 +192,18 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
278
192
  logOrigin: 1
279
193
  // 日志来源
280
194
  };
281
- await r.request.post("/alarm/deliversign/addVarietyAiHelperLog", i), L.success("感谢您的评价!"), s.value[e].hasFeedback = !0;
195
+ await p.request.post("/alarm/deliversign/addVarietyAiHelperLog", i), B.success("感谢您的评价!"), a.value[e].hasFeedback = !0;
282
196
  break;
283
197
  }
284
198
  case "open": {
285
- x.value = e, b.value = !0;
199
+ q.value = e, V.value = !0;
286
200
  break;
287
201
  }
288
202
  case "unsatisfied": {
289
- const t = s.value[e], i = {
290
- userName: g.username,
203
+ const t = a.value[e], i = {
204
+ userName: y.username,
291
205
  userContent: t.userContent,
292
- userSuggestion: p.value,
206
+ userSuggestion: Y.value,
293
207
  aiContent: t.content,
294
208
  type: 2,
295
209
  resTime: t.resTime,
@@ -300,14 +214,14 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
300
214
  logOrigin: 1
301
215
  // 日志来源
302
216
  };
303
- await r.request.post("/alarm/deliversign/addVarietyAiHelperLog", i), L.success("感谢您的反馈!我们将持续跟踪并进行优化"), b.value = !1, s.value[e].hasFeedback = !0;
217
+ await p.request.post("/alarm/deliversign/addVarietyAiHelperLog", i), B.success("感谢您的反馈!我们将持续跟踪并进行优化"), V.value = !1, a.value[e].hasFeedback = !0;
304
218
  break;
305
219
  }
306
220
  case "default": {
307
- const t = s.value[e], i = {
308
- userName: g.username,
221
+ const t = a.value[e], i = {
222
+ userName: y.username,
309
223
  userContent: t.userContent,
310
- userSuggestion: p.value,
224
+ userSuggestion: Y.value,
311
225
  aiContent: t.content,
312
226
  type: null,
313
227
  resTime: t.resTime,
@@ -318,137 +232,137 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
318
232
  logOrigin: 1
319
233
  // 日志来源
320
234
  };
321
- await r.request.post("/alarm/deliversign/addVarietyAiHelperLog", i);
235
+ await p.request.post("/alarm/deliversign/addVarietyAiHelperLog", i);
322
236
  }
323
237
  }
324
- }, q = async () => {
325
- const n = _.value.trim();
326
- if (!n)
327
- return L.warning("请输入消息内容");
328
- if (a.value)
238
+ }, K = async () => {
239
+ const s = w.value.trim();
240
+ if (!s)
241
+ return B.warning("请输入消息内容");
242
+ if (n.value)
329
243
  return;
330
- s.value.push({
244
+ a.value.push({
331
245
  role: "user",
332
- content: n,
333
- createTime: B().format("YYYY-MM-DD HH:mm:ss")
334
- }), _.value = "", await Y(), s.value.push({
246
+ content: s,
247
+ createTime: P().format("YYYY-MM-DD HH:mm:ss")
248
+ }), w.value = "", await C(), a.value.push({
335
249
  role: "assistant",
336
250
  content: "",
337
- userContent: n,
251
+ userContent: s,
338
252
  showFeedback: !1,
339
253
  hasFeedback: !1,
340
- createTime: B().format("YYYY-MM-DD HH:mm:ss"),
254
+ createTime: P().format("YYYY-MM-DD HH:mm:ss"),
341
255
  resTime: 0,
342
256
  firstPackageTime: 0
343
- }), await Y(), a.value = !0, w.value = !0;
257
+ }), await C(), n.value = !0, k.value = !0;
344
258
  let e = "", t = (/* @__PURE__ */ new Date()).getTime();
345
259
  try {
346
- await Be({
260
+ await Ve({
347
261
  appId: "9e54d112acfe4531bd1fc4fee8827fef",
348
262
  apiKey: "sk-d995eb26a4334bdeb2ccb4cbfaf51de8",
349
- value: n,
350
- callback: (D, h) => {
351
- var u;
352
- if (D === "error") {
353
- w.value = !1, a.value = !1, s.value.pop(), s.value.push({
263
+ value: s,
264
+ callback: (g, d) => {
265
+ var r;
266
+ if (g === "error") {
267
+ k.value = !1, n.value = !1, a.value.pop(), a.value.push({
354
268
  role: "assistant",
355
- userContent: n,
356
- content: `❌ ${h}`,
269
+ userContent: s,
270
+ content: `❌ ${d}`,
357
271
  showFeedback: !1,
358
272
  hasFeedback: !1,
359
- createTime: B().format("YYYY-MM-DD HH:mm:ss"),
273
+ createTime: P().format("YYYY-MM-DD HH:mm:ss"),
360
274
  resTime: (/* @__PURE__ */ new Date()).getTime() - t,
361
275
  firstPackageTime: 0
362
- }), F("default", s.value.length - 1), Y();
276
+ }), M("default", a.value.length - 1), C();
363
277
  return;
364
- } else if (D === "message") {
365
- e += h;
366
- const f = s.value[s.value.length - 1];
367
- f && f.role === "assistant" && (f.content = e, Y()), f.firstPackageTime === 0 && (f.firstPackageTime = (/* @__PURE__ */ new Date()).getTime() - t);
368
- } else if (D === "finish") {
369
- w.value = !1, a.value = !1;
370
- const f = s.value[s.value.length - 1];
371
- f && f.role === "assistant" && (f.showFeedback = !0, f.resTime = (/* @__PURE__ */ new Date()).getTime() - t, F("default", s.value.length - 1)), console.log(e);
278
+ } else if (g === "message") {
279
+ e += d;
280
+ const l = a.value[a.value.length - 1];
281
+ l && l.role === "assistant" && (l.content = e, C()), l.firstPackageTime === 0 && (l.firstPackageTime = (/* @__PURE__ */ new Date()).getTime() - t);
282
+ } else if (g === "finish") {
283
+ k.value = !1, n.value = !1;
284
+ const l = a.value[a.value.length - 1];
285
+ l && l.role === "assistant" && (l.showFeedback = !0, l.resTime = (/* @__PURE__ */ new Date()).getTime() - t, M("default", a.value.length - 1)), console.log(e);
372
286
  try {
373
- const C = JSON.parse(e);
374
- if (C.parsedConditions && delete C.parsedConditions, (u = C.customTagNames) != null && u.length) {
375
- const re = C.customTagNames.reduce((K, ie) => {
376
- const U = d.value[ie];
377
- return U && K.push(U), K;
287
+ const v = JSON.parse(e);
288
+ if (v.parsedConditions && delete v.parsedConditions, (r = v.customTagNames) != null && r.length) {
289
+ const ie = v.customTagNames.reduce((R, re) => {
290
+ const U = z.value[re];
291
+ return U && R.push(U), R;
378
292
  }, []);
379
- delete C.customTagNames, C.customTag = re;
293
+ delete v.customTagNames, v.customTag = ie;
380
294
  }
381
- S("callBack", C);
295
+ A("callBack", v);
382
296
  } catch {
383
- S("callBack", e);
297
+ A("callBack", e);
384
298
  }
385
299
  }
386
300
  }
387
301
  });
388
302
  } catch (i) {
389
- L.error(`AI响应异常: ${i}`), s.value.pop(), s.value.push({
303
+ B.error(`AI响应异常: ${i}`), a.value.pop(), a.value.push({
390
304
  role: "assistant",
391
- userContent: n,
305
+ userContent: s,
392
306
  content: "❌ 抱歉,AI服务响应异常,请稍后重试。",
393
307
  showFeedback: !0,
394
308
  hasFeedback: !1,
395
- createTime: B().format("YYYY-MM-DD HH:mm:ss"),
309
+ createTime: P().format("YYYY-MM-DD HH:mm:ss"),
396
310
  resTime: (/* @__PURE__ */ new Date()).getTime() - t,
397
311
  firstPackageTime: 0
398
- }), F("default", s.value.length - 1), await Y(), a.value = !1, w.value = !1;
312
+ }), M("default", a.value.length - 1), await C(), n.value = !1, k.value = !1;
399
313
  }
400
- }, ne = (n) => {
401
- if (n.key === "Enter")
402
- if (n.ctrlKey) {
403
- n.preventDefault();
404
- const e = n.target, t = e.selectionStart, i = e.selectionEnd;
405
- _.value = _.value.substring(0, t) + `
406
- ` + _.value.substring(i), J(() => {
314
+ }, oe = (s) => {
315
+ if (s.key === "Enter")
316
+ if (s.ctrlKey) {
317
+ s.preventDefault();
318
+ const e = s.target, t = e.selectionStart, i = e.selectionEnd;
319
+ w.value = w.value.substring(0, t) + `
320
+ ` + w.value.substring(i), O(() => {
407
321
  e.selectionStart = e.selectionEnd = t + 1;
408
322
  });
409
323
  } else
410
- n.preventDefault(), q();
411
- }, Y = async () => {
412
- await J(), N.value && (N.value.scrollTop = N.value.scrollHeight);
413
- }, oe = async () => {
414
- const n = await Promise.all([r.request.post("/alarm/deliversign/findTagsByUserId"), r.request.post("/alarm/deliversign/findSystemTagsByTagName")]);
415
- d.value = n.reduce((e, t) => {
324
+ s.preventDefault(), K();
325
+ }, C = async () => {
326
+ await O(), T.value && (T.value.scrollTop = T.value.scrollHeight);
327
+ }, ne = async () => {
328
+ const s = await Promise.all([p.request.post("/alarm/deliversign/findTagsByUserId"), p.request.post("/alarm/deliversign/findSystemTagsByTagName")]);
329
+ z.value = s.reduce((e, t) => {
416
330
  var i;
417
331
  return {
418
332
  ...e,
419
- ...(i = t.body) == null ? void 0 : i.reduce((A, D) => ({
420
- ...A,
421
- [D.tagName]: D.id
333
+ ...(i = t.body) == null ? void 0 : i.reduce((D, g) => ({
334
+ ...D,
335
+ [g.tagName]: g.id
422
336
  }), {})
423
337
  };
424
338
  }, {});
425
339
  };
426
- return ke(() => {
427
- oe();
428
- }), R(
429
- () => s.value,
340
+ return Te(() => {
341
+ ne();
342
+ }), x(
343
+ () => a.value,
430
344
  () => {
431
- Y();
345
+ C();
432
346
  },
433
347
  { deep: !0 }
434
- ), R(
435
- () => b.value,
436
- (n) => {
437
- n || (p.value = "");
348
+ ), x(
349
+ () => V.value,
350
+ (s) => {
351
+ s || (Y.value = "");
438
352
  }
439
- ), E({
353
+ ), L({
440
354
  open: () => {
441
- l.value = !0, J(() => {
442
- Y();
355
+ N.value = !0, O(() => {
356
+ C();
443
357
  });
444
358
  }
445
- }), (n, e) => {
446
- const t = $e, i = he, A = ge, D = ve;
447
- return v(), y(O, null, [
448
- M(D, {
359
+ }), (s, e) => {
360
+ const t = Ie, i = _e, D = ge, g = ve;
361
+ return c(), m(F, null, [
362
+ _(g, {
449
363
  class: "ai-dialog",
450
- modelValue: l.value,
451
- "onUpdate:modelValue": e[1] || (e[1] = (h) => l.value = h),
364
+ modelValue: N.value,
365
+ "onUpdate:modelValue": e[1] || (e[1] = (d) => N.value = d),
452
366
  title: "✨ 品种池参数解析AI助手",
453
367
  width: "500px",
454
368
  center: "",
@@ -457,84 +371,84 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
457
371
  modal: !1,
458
372
  "modal-penetrable": !0
459
373
  }, {
460
- default: H(() => {
461
- var h;
374
+ default: S(() => {
375
+ var d;
462
376
  return [
463
- o("div", Le, [
377
+ o("div", $e, [
464
378
  o("div", {
465
379
  ref_key: "messageListRef",
466
- ref: N,
380
+ ref: T,
467
381
  class: "message-list"
468
382
  }, [
469
- (v(!0), y(O, null, Se(s.value, (u, f) => (v(), y("div", {
470
- key: f,
471
- class: te([u.role, "message-item"])
383
+ (c(!0), m(F, null, we(a.value, (r, l) => (c(), m("div", {
384
+ key: l,
385
+ class: te([r.role, "message-item"])
472
386
  }, [
473
- u.content ? (v(), y(O, { key: 0 }, [
474
- o("div", Ie, [
475
- M(t, {
387
+ r.content ? (c(), m(F, { key: 0 }, [
388
+ o("div", Oe, [
389
+ _(t, {
476
390
  size: 32,
477
- icon: u.role === "user" ? P(De) : P(Q)
391
+ icon: r.role === "user" ? b(De) : b(X)
478
392
  }, null, 8, ["icon"])
479
393
  ]),
480
- o("div", Je, [
481
- z(u.content) ? (v(), y("div", {
394
+ o("div", je, [
395
+ J(r.content) ? (c(), m("div", {
482
396
  key: 0,
483
397
  class: "message-json",
484
- innerHTML: ae(se(u.content))
485
- }, null, 8, je)) : (v(), y("div", Re, G(u.content), 1)),
486
- o("div", qe, G(u.createTime), 1),
487
- u.role === "assistant" ? (v(), y(O, { key: 2 }, [
488
- u.showFeedback && !u.hasFeedback ? (v(), y(O, { key: 0 }, [
398
+ innerHTML: ae(se(r.content))
399
+ }, null, 8, xe)) : (c(), m("div", qe, W(r.content), 1)),
400
+ o("div", Je, W(r.createTime), 1),
401
+ r.role === "assistant" ? (c(), m(F, { key: 2 }, [
402
+ r.showFeedback && !r.hasFeedback ? (c(), m(F, { key: 0 }, [
489
403
  Ke,
490
- o("div", Ue, [
404
+ o("div", Re, [
491
405
  o("button", {
492
406
  class: "feedback-btn satisfied-btn",
493
- onClick: (C) => F("satisfied", f)
494
- }, Qe, 8, We),
407
+ onClick: (v) => M("satisfied", l)
408
+ }, We, 8, Ue),
495
409
  o("button", {
496
410
  class: "feedback-btn unsatisfied-btn",
497
- onClick: (C) => F("open", f)
498
- }, st, 8, Ze)
411
+ onClick: (v) => M("open", l)
412
+ }, tt, 8, Xe)
499
413
  ])
500
- ], 64)) : $("", !0),
501
- u.showFeedback && u.hasFeedback ? (v(), y("div", at, "感谢您进行的评价反馈")) : $("", !0)
502
- ], 64)) : $("", !0)
414
+ ], 64)) : H("", !0),
415
+ r.showFeedback && r.hasFeedback ? (c(), m("div", st, "感谢您进行的评价反馈")) : H("", !0)
416
+ ], 64)) : H("", !0)
503
417
  ])
504
- ], 64)) : $("", !0)
418
+ ], 64)) : H("", !0)
505
419
  ], 2))), 128)),
506
- w.value && !((h = s.value[s.value.length - 1]) != null && h.content) ? (v(), y("div", nt, [
420
+ k.value && !((d = a.value[a.value.length - 1]) != null && d.content) ? (c(), m("div", at, [
507
421
  o("div", ot, [
508
- M(t, {
422
+ _(t, {
509
423
  size: 32,
510
- icon: P(Q)
424
+ icon: b(X)
511
425
  }, null, 8, ["icon"])
512
426
  ]),
513
- rt
514
- ])) : $("", !0)
427
+ nt
428
+ ])) : H("", !0)
515
429
  ], 512),
516
430
  o("div", it, [
517
- M(i, {
431
+ _(i, {
518
432
  class: "message-input",
519
- modelValue: _.value,
520
- "onUpdate:modelValue": e[0] || (e[0] = (u) => _.value = u),
433
+ modelValue: w.value,
434
+ "onUpdate:modelValue": e[0] || (e[0] = (r) => w.value = r),
521
435
  type: "textarea",
522
436
  rows: 4,
523
437
  autosize: { minRows: 2, maxRows: 4 },
524
438
  placeholder: "输入您想查询的品种条件...",
525
- onKeydown: ne
439
+ onKeydown: oe
526
440
  }, null, 8, ["modelValue"]),
527
- o("div", lt, [
528
- ct,
529
- M(A, {
441
+ o("div", rt, [
442
+ lt,
443
+ _(D, {
530
444
  class: "send-btn",
531
445
  type: "primary",
532
- icon: P(Me),
533
- loading: a.value,
534
- onClick: q,
446
+ icon: b(Ne),
447
+ loading: n.value,
448
+ onClick: K,
535
449
  round: ""
536
450
  }, {
537
- default: H(() => [
451
+ default: S(() => [
538
452
  j(" 发送 ")
539
453
  ]),
540
454
  _: 1
@@ -546,40 +460,40 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
546
460
  }),
547
461
  _: 1
548
462
  }, 8, ["modelValue"]),
549
- M(D, {
550
- modelValue: b.value,
551
- "onUpdate:modelValue": e[5] || (e[5] = (h) => b.value = h),
463
+ _(g, {
464
+ modelValue: V.value,
465
+ "onUpdate:modelValue": e[5] || (e[5] = (d) => V.value = d),
552
466
  title: "📝 反馈意见",
553
467
  width: "400px"
554
468
  }, {
555
- footer: H(() => [
556
- o("span", pt, [
557
- M(A, {
558
- onClick: e[3] || (e[3] = (h) => b.value = !1)
469
+ footer: S(() => [
470
+ o("span", mt, [
471
+ _(D, {
472
+ onClick: e[3] || (e[3] = (d) => V.value = !1)
559
473
  }, {
560
- default: H(() => [
474
+ default: S(() => [
561
475
  j("取消")
562
476
  ]),
563
477
  _: 1
564
478
  }),
565
- M(A, {
479
+ _(D, {
566
480
  type: "primary",
567
- onClick: e[4] || (e[4] = (h) => F("unsatisfied", x.value))
481
+ onClick: e[4] || (e[4] = (d) => M("unsatisfied", q.value))
568
482
  }, {
569
- default: H(() => [
483
+ default: S(() => [
570
484
  j("提交反馈")
571
485
  ]),
572
486
  _: 1
573
487
  })
574
488
  ])
575
489
  ]),
576
- default: H(() => [
577
- o("div", ut, [
490
+ default: S(() => [
491
+ o("div", ct, [
492
+ ut,
578
493
  dt,
579
- mt,
580
- M(i, {
581
- modelValue: p.value,
582
- "onUpdate:modelValue": e[2] || (e[2] = (h) => p.value = h),
494
+ _(i, {
495
+ modelValue: Y.value,
496
+ "onUpdate:modelValue": e[2] || (e[2] = (d) => Y.value = d),
583
497
  type: "textarea",
584
498
  rows: 4,
585
499
  placeholder: "[非必填]例如:回答不够准确、查询结果有误、界面体验不佳..."
@@ -591,11 +505,11 @@ const V = (c) => (we("data-v-536916ba"), c = c(), Ce(), c), Le = { class: "ai-di
591
505
  ], 64);
592
506
  };
593
507
  }
594
- }, vt = /* @__PURE__ */ Ve(ft, [["__scopeId", "data-v-536916ba"]]), zt = {
595
- install(c) {
596
- c.component("st-varietyAiHelper", vt);
508
+ }, ft = /* @__PURE__ */ Ye(pt, [["__scopeId", "data-v-536916ba"]]), $t = {
509
+ install(u) {
510
+ u.component("st-varietyAiHelper", ft);
597
511
  }
598
512
  };
599
513
  export {
600
- zt as default
514
+ $t as default
601
515
  };