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