st-comp 0.0.266 → 0.0.267
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/VarietyAiHelper.cjs +3 -3
- package/es/VarietyAiHelper.js +242 -262
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +1 -1
- package/es/aiTools-822859d6.cjs +4 -0
- package/es/aiTools-9a9c997f.js +149 -0
- package/es/aiTools.js +2 -2
- package/es/style.css +1 -1
- package/lib/aiTools.js +2 -2
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +192 -192
- package/lib/{index-53b3465c.js → index-7279dacd.js} +12861 -12881
- package/lib/{python-4a270481.js → python-60bc2922.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
|
|
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 U, openBlock as l, createElementBlock as u, normalizeClass as ae, unref as _, normalizeStyle as Q, createBlock as $, withCtx as g, resolveDynamicComponent as he, renderSlot as ke, inject as be, reactive as ye, nextTick as R, Fragment as H, createVNode as m, createElementVNode as s, renderList as X, toDisplayString as J, createCommentVNode as w, createTextVNode as K, pushScopeId as Te, popScopeId as we } from "vue";
|
|
7
7
|
import { d as L } from "./dayjs.min-8313b006.js";
|
|
8
|
-
import { V as
|
|
9
|
-
import { s as
|
|
10
|
-
import { E as
|
|
11
|
-
import { _ as
|
|
12
|
-
import { E as
|
|
13
|
-
import { k as
|
|
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 I } 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
|
-
}), z =
|
|
64
|
-
const { size:
|
|
65
|
-
return
|
|
66
|
-
size:
|
|
55
|
+
}), Le = /* @__PURE__ */ se({
|
|
56
|
+
...Ae,
|
|
57
|
+
props: Pe,
|
|
58
|
+
emits: Ne,
|
|
59
|
+
setup(d, { emit: O }) {
|
|
60
|
+
const M = d, k = ue("avatar"), C = v(!1), P = x(() => {
|
|
61
|
+
const { size: i, icon: p, shape: S } = M, b = [k.b()];
|
|
62
|
+
return de(i) && b.push(k.m(i)), p && b.push(k.m("icon")), S && b.push(k.m(S)), b;
|
|
63
|
+
}), z = x(() => {
|
|
64
|
+
const { size: i } = M;
|
|
65
|
+
return te(i) ? k.cssVarBlock({
|
|
66
|
+
size: me(i) || ""
|
|
67
67
|
}) : void 0;
|
|
68
|
-
}),
|
|
69
|
-
objectFit:
|
|
68
|
+
}), j = x(() => ({
|
|
69
|
+
objectFit: M.fit
|
|
70
70
|
}));
|
|
71
|
-
U(() =>
|
|
72
|
-
function
|
|
73
|
-
C.value = !0,
|
|
71
|
+
U(() => M.src, () => C.value = !1);
|
|
72
|
+
function y(i) {
|
|
73
|
+
C.value = !0, O("error", i);
|
|
74
74
|
}
|
|
75
|
-
return (
|
|
76
|
-
class:
|
|
77
|
-
style:
|
|
75
|
+
return (i, p) => (l(), u("span", {
|
|
76
|
+
class: ae(_(P)),
|
|
77
|
+
style: Q(_(z))
|
|
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: g(() => [
|
|
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 h = (d) => (Te("data-v-c6a98338"), d = d(), we(), d), Ie = { class: "ai-dialog-body" }, $e = { class: "avatar" }, Oe = { 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
|
+
}, Ke = { class: "node-status-icon" }, Ue = /* @__PURE__ */ h(() => /* @__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__ */ h(() => /* @__PURE__ */ s("div", { class: "message-createTime" }, "请问对本轮查询结果是否满意?", -1)), Xe = { class: "feedback-buttons" }, Ze = ["onClick"], et = /* @__PURE__ */ h(() => /* @__PURE__ */ s("span", { class: "btn-emoji" }, "👍", -1)), tt = /* @__PURE__ */ h(() => /* @__PURE__ */ s("span", { class: "btn-text" }, "满意", -1)), st = [
|
|
107
|
+
et,
|
|
108
|
+
tt
|
|
109
|
+
], at = ["onClick"], nt = /* @__PURE__ */ h(() => /* @__PURE__ */ s("span", { class: "btn-emoji" }, "👎", -1)), ot = /* @__PURE__ */ h(() => /* @__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__ */ h(() => /* @__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__ */ h(() => /* @__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__ */ h(() => /* @__PURE__ */ s("div", { class: "feedback-emoji" }, "😟", -1)), _t = /* @__PURE__ */ h(() => /* @__PURE__ */ s("p", { class: "feedback-tip" }, "很抱歉没能帮到您,请告诉我们哪里需要改进:", -1)), gt = { class: "dialog-footer" }, ht = {
|
|
127
127
|
__name: "index",
|
|
128
128
|
props: {
|
|
129
129
|
defaultMessage: {
|
|
@@ -135,11 +135,11 @@ 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
|
|
138
|
+
setup(d, { expose: O, emit: M }) {
|
|
139
|
+
const k = be("stConfig"), C = ye(Ce()), P = v(!1), z = 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,
|
|
@@ -147,37 +147,37 @@ const y = (p) => (Ne("data-v-3015ca89"), p = p(), De(), p), qe = { class: "ai-di
|
|
|
147
147
|
resTime: 0,
|
|
148
148
|
firstPackageTime: 0
|
|
149
149
|
}
|
|
150
|
-
]), E = v(""), Y = v(!1),
|
|
151
|
-
if (typeof
|
|
150
|
+
]), E = v(""), Y = v(!1), N = 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 =
|
|
180
|
-
await
|
|
179
|
+
const t = o.value[e];
|
|
180
|
+
await k.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
|
|
181
181
|
userName: C.username,
|
|
182
182
|
userContent: t.userContent,
|
|
183
183
|
aiContent: t.content,
|
|
@@ -187,19 +187,19 @@ 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
|
+
}), I.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 =
|
|
199
|
-
await
|
|
198
|
+
const t = o.value[e];
|
|
199
|
+
await k.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
|
|
200
200
|
userName: C.username,
|
|
201
201
|
userContent: t.userContent,
|
|
202
|
-
userSuggestion:
|
|
202
|
+
userSuggestion: N.value,
|
|
203
203
|
aiContent: t.content,
|
|
204
204
|
type: 2,
|
|
205
205
|
resTime: t.resTime,
|
|
@@ -207,15 +207,15 @@ 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
|
+
}), I.success("感谢您的反馈!我们将持续跟踪并进行优化"), Y.value = !1, o.value[e].hasFeedback = !0;
|
|
211
211
|
break;
|
|
212
212
|
}
|
|
213
213
|
case "default": {
|
|
214
|
-
const t =
|
|
215
|
-
await
|
|
214
|
+
const t = o.value[e];
|
|
215
|
+
await k.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
|
|
216
216
|
userName: C.username,
|
|
217
217
|
userContent: t.userContent,
|
|
218
|
-
userSuggestion:
|
|
218
|
+
userSuggestion: N.value,
|
|
219
219
|
aiContent: t.content,
|
|
220
220
|
type: null,
|
|
221
221
|
resTime: t.resTime,
|
|
@@ -226,146 +226,126 @@ 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 I.warning("请输入消息内容");
|
|
233
|
+
if (y.value)
|
|
234
234
|
return;
|
|
235
|
-
|
|
235
|
+
p.value = [], S.value = !1, o.value.push({
|
|
236
236
|
role: "user",
|
|
237
|
-
content:
|
|
237
|
+
content: n,
|
|
238
238
|
createTime: L().format("YYYY-MM-DD HH:mm:ss")
|
|
239
|
-
}), E.value = "", await
|
|
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
245
|
createTime: L().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
|
-
await
|
|
251
|
+
await Ee({
|
|
252
|
+
mode: "build:split",
|
|
252
253
|
appId: "1977602b357e4dab9d0b74899d5323b3",
|
|
253
254
|
apiKey: "sk-d995eb26a4334bdeb2ccb4cbfaf51de8",
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
if (
|
|
258
|
-
|
|
255
|
+
token: Se(),
|
|
256
|
+
value: n,
|
|
257
|
+
callback: (V, r) => {
|
|
258
|
+
if (V === "error") {
|
|
259
|
+
i.value = !1, y.value = !1, o.value.pop(), o.value.push({
|
|
259
260
|
role: "assistant",
|
|
260
|
-
userContent:
|
|
261
|
-
content: `❌ ${
|
|
261
|
+
userContent: n,
|
|
262
|
+
content: `❌ ${r}`,
|
|
262
263
|
showFeedback: !1,
|
|
263
264
|
hasFeedback: !1,
|
|
264
265
|
createTime: L().format("YYYY-MM-DD HH:mm:ss"),
|
|
265
266
|
resTime: (/* @__PURE__ */ new Date()).getTime() - t,
|
|
266
267
|
firstPackageTime: 0
|
|
267
|
-
}), F("default",
|
|
268
|
+
}), F("default", o.value.length - 1), T();
|
|
268
269
|
return;
|
|
269
270
|
}
|
|
270
|
-
if (
|
|
271
|
-
if (!
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
|
|
271
|
+
if (V === "node") {
|
|
272
|
+
if (!f) {
|
|
273
|
+
f = !0;
|
|
274
|
+
const c = o.value[o.value.length - 1];
|
|
275
|
+
c && c.role === "assistant" && c.firstPackageTime === 0 && (c.firstPackageTime = (/* @__PURE__ */ new Date()).getTime() - t);
|
|
275
276
|
}
|
|
276
|
-
const
|
|
277
|
-
|
|
277
|
+
const a = p.value.find((c) => c.name === r.name);
|
|
278
|
+
a ? a.status = r.status : p.value.push({ name: r.name, status: r.status }), T();
|
|
278
279
|
return;
|
|
279
280
|
}
|
|
280
|
-
if (
|
|
281
|
-
e =
|
|
282
|
-
const
|
|
283
|
-
|
|
281
|
+
if (V === "message") {
|
|
282
|
+
e = r;
|
|
283
|
+
const a = o.value[o.value.length - 1];
|
|
284
|
+
a && a.role === "assistant" && (a.content = e, T());
|
|
284
285
|
}
|
|
285
|
-
if (
|
|
286
|
-
|
|
287
|
-
const
|
|
288
|
-
|
|
286
|
+
if (V === "finish") {
|
|
287
|
+
i.value = !1, y.value = !1, S.value = !0;
|
|
288
|
+
const a = o.value[o.value.length - 1];
|
|
289
|
+
a && a.role === "assistant" && (a.showFeedback = !0, a.resTime = (/* @__PURE__ */ new Date()).getTime() - t, F("default", o.value.length - 1));
|
|
289
290
|
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);
|
|
291
|
+
const c = JSON.parse(e);
|
|
292
|
+
c.parsedConditions && delete c.parsedConditions, z("callBack", c);
|
|
299
293
|
} catch {
|
|
300
294
|
z("callBack", e);
|
|
301
295
|
}
|
|
302
296
|
}
|
|
303
297
|
}
|
|
304
298
|
});
|
|
305
|
-
} catch (
|
|
306
|
-
|
|
299
|
+
} catch (A) {
|
|
300
|
+
I.error(`AI响应异常: ${A}`), o.value.pop(), o.value.push({
|
|
307
301
|
role: "assistant",
|
|
308
|
-
userContent:
|
|
302
|
+
userContent: n,
|
|
309
303
|
content: "❌ 抱歉,AI服务响应异常,请稍后重试。",
|
|
310
304
|
showFeedback: !0,
|
|
311
305
|
hasFeedback: !1,
|
|
312
306
|
createTime: L().format("YYYY-MM-DD HH:mm:ss"),
|
|
313
307
|
resTime: (/* @__PURE__ */ new Date()).getTime() - t,
|
|
314
308
|
firstPackageTime: 0
|
|
315
|
-
}), F("default",
|
|
309
|
+
}), F("default", o.value.length - 1), await T(), y.value = !1, i.value = !1;
|
|
316
310
|
}
|
|
317
|
-
},
|
|
318
|
-
if (
|
|
319
|
-
if (
|
|
320
|
-
|
|
321
|
-
const e =
|
|
311
|
+
}, le = (n) => {
|
|
312
|
+
if (n.key === "Enter")
|
|
313
|
+
if (n.ctrlKey) {
|
|
314
|
+
n.preventDefault();
|
|
315
|
+
const e = n.target, t = e.selectionStart, f = e.selectionEnd;
|
|
322
316
|
E.value = E.value.substring(0, t) + `
|
|
323
|
-
` + E.value.substring(
|
|
317
|
+
` + E.value.substring(f), R(() => {
|
|
324
318
|
e.selectionStart = e.selectionEnd = t + 1;
|
|
325
319
|
});
|
|
326
320
|
} 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
|
-
}, {});
|
|
321
|
+
n.preventDefault(), G();
|
|
322
|
+
}, T = async () => {
|
|
323
|
+
await R(), b.value && (b.value.scrollTop = b.value.scrollHeight);
|
|
342
324
|
};
|
|
343
|
-
return
|
|
344
|
-
|
|
345
|
-
}), U(
|
|
346
|
-
() => n.value,
|
|
325
|
+
return U(
|
|
326
|
+
() => o.value,
|
|
347
327
|
() => {
|
|
348
|
-
|
|
328
|
+
T();
|
|
349
329
|
},
|
|
350
330
|
{ deep: !0 }
|
|
351
331
|
), U(
|
|
352
332
|
() => Y.value,
|
|
353
|
-
(
|
|
354
|
-
|
|
333
|
+
(n) => {
|
|
334
|
+
n || (N.value = "");
|
|
355
335
|
}
|
|
356
|
-
),
|
|
336
|
+
), O({
|
|
357
337
|
open: () => {
|
|
358
|
-
|
|
359
|
-
|
|
338
|
+
P.value = !0, R(() => {
|
|
339
|
+
T();
|
|
360
340
|
});
|
|
361
341
|
}
|
|
362
|
-
}), (
|
|
363
|
-
const t =
|
|
364
|
-
return
|
|
365
|
-
|
|
342
|
+
}), (n, e) => {
|
|
343
|
+
const t = Be, f = ne, A = ge, B = _e, V = ve;
|
|
344
|
+
return l(), u(H, null, [
|
|
345
|
+
m(V, {
|
|
366
346
|
class: "ai-dialog",
|
|
367
|
-
modelValue:
|
|
368
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
347
|
+
modelValue: P.value,
|
|
348
|
+
"onUpdate:modelValue": e[1] || (e[1] = (r) => P.value = r),
|
|
369
349
|
title: "✨ 品种池参数解析AI助手",
|
|
370
350
|
width: "500px",
|
|
371
351
|
center: "",
|
|
@@ -374,122 +354,122 @@ const y = (p) => (Ne("data-v-3015ca89"), p = p(), De(), p), qe = { class: "ai-di
|
|
|
374
354
|
modal: !1,
|
|
375
355
|
"modal-penetrable": !0
|
|
376
356
|
}, {
|
|
377
|
-
default:
|
|
378
|
-
var
|
|
357
|
+
default: g(() => {
|
|
358
|
+
var r;
|
|
379
359
|
return [
|
|
380
|
-
s("div",
|
|
360
|
+
s("div", Ie, [
|
|
381
361
|
s("div", {
|
|
382
362
|
ref_key: "messageListRef",
|
|
383
|
-
ref:
|
|
363
|
+
ref: b,
|
|
384
364
|
class: "message-list"
|
|
385
365
|
}, [
|
|
386
|
-
(
|
|
387
|
-
key:
|
|
388
|
-
class:
|
|
366
|
+
(l(!0), u(H, null, X(o.value, (a, c) => (l(), u("div", {
|
|
367
|
+
key: c,
|
|
368
|
+
class: ae([a.role, "message-item"])
|
|
389
369
|
}, [
|
|
390
|
-
|
|
391
|
-
s("div",
|
|
392
|
-
|
|
370
|
+
a.content || c === o.value.length - 1 && a.role === "assistant" && p.value.length > 0 ? (l(), u(H, { key: 0 }, [
|
|
371
|
+
s("div", $e, [
|
|
372
|
+
m(t, {
|
|
393
373
|
size: 32,
|
|
394
|
-
icon:
|
|
374
|
+
icon: a.role === "user" ? _(Ve) : _(Z)
|
|
395
375
|
}, null, 8, ["icon"])
|
|
396
376
|
]),
|
|
397
|
-
s("div",
|
|
398
|
-
|
|
399
|
-
(
|
|
400
|
-
key:
|
|
377
|
+
s("div", Oe, [
|
|
378
|
+
c === o.value.length - 1 && a.role === "assistant" && p.value.length > 0 && !S.value ? (l(), u("div", je, [
|
|
379
|
+
(l(!0), u(H, null, X(p.value, (D) => (l(), u("div", {
|
|
380
|
+
key: D.name,
|
|
401
381
|
class: "node-progress-item"
|
|
402
382
|
}, [
|
|
403
|
-
s("span",
|
|
404
|
-
|
|
383
|
+
s("span", xe, [
|
|
384
|
+
D.status === "success" ? (l(), $(f, {
|
|
405
385
|
key: 0,
|
|
406
386
|
class: "node-icon done"
|
|
407
387
|
}, {
|
|
408
|
-
default:
|
|
409
|
-
|
|
388
|
+
default: g(() => [
|
|
389
|
+
m(_(De))
|
|
410
390
|
]),
|
|
411
391
|
_: 1
|
|
412
|
-
})) : (
|
|
392
|
+
})) : (l(), $(f, {
|
|
413
393
|
key: 1,
|
|
414
394
|
class: "node-icon running"
|
|
415
395
|
}, {
|
|
416
|
-
default:
|
|
417
|
-
|
|
396
|
+
default: g(() => [
|
|
397
|
+
m(_(ee))
|
|
418
398
|
]),
|
|
419
399
|
_: 1
|
|
420
400
|
}))
|
|
421
401
|
]),
|
|
422
|
-
s("span",
|
|
402
|
+
s("span", Re, J(D.name), 1)
|
|
423
403
|
]))), 128)),
|
|
424
|
-
|
|
425
|
-
s("span",
|
|
426
|
-
f
|
|
427
|
-
default:
|
|
428
|
-
|
|
404
|
+
p.value.length > 0 && p.value.every((D) => D.status === "success") && !S.value ? (l(), u("div", Je, [
|
|
405
|
+
s("span", Ke, [
|
|
406
|
+
m(f, { class: "node-icon waiting" }, {
|
|
407
|
+
default: g(() => [
|
|
408
|
+
m(_(ee))
|
|
429
409
|
]),
|
|
430
410
|
_: 1
|
|
431
411
|
})
|
|
432
412
|
]),
|
|
433
|
-
|
|
434
|
-
])) :
|
|
435
|
-
])) :
|
|
436
|
-
|
|
413
|
+
Ue
|
|
414
|
+
])) : w("", !0)
|
|
415
|
+
])) : w("", !0),
|
|
416
|
+
W(a.content) ? (l(), u("div", {
|
|
437
417
|
key: 1,
|
|
438
418
|
class: "message-json",
|
|
439
|
-
innerHTML:
|
|
440
|
-
}, null, 8,
|
|
441
|
-
s("div",
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
s("div",
|
|
419
|
+
innerHTML: ie(oe(a.content))
|
|
420
|
+
}, null, 8, qe)) : a.content ? (l(), u("div", We, J(a.content), 1)) : w("", !0),
|
|
421
|
+
s("div", Ge, J(a.createTime), 1),
|
|
422
|
+
a.role === "assistant" ? (l(), u(H, { key: 3 }, [
|
|
423
|
+
a.showFeedback && !a.hasFeedback ? (l(), u(H, { key: 0 }, [
|
|
424
|
+
Qe,
|
|
425
|
+
s("div", Xe, [
|
|
446
426
|
s("button", {
|
|
447
427
|
class: "feedback-btn satisfied-btn",
|
|
448
|
-
onClick: (
|
|
449
|
-
},
|
|
428
|
+
onClick: (D) => F("satisfied", c)
|
|
429
|
+
}, st, 8, Ze),
|
|
450
430
|
s("button", {
|
|
451
431
|
class: "feedback-btn unsatisfied-btn",
|
|
452
|
-
onClick: (
|
|
453
|
-
},
|
|
432
|
+
onClick: (D) => F("open", c)
|
|
433
|
+
}, it, 8, at)
|
|
454
434
|
])
|
|
455
|
-
], 64)) :
|
|
456
|
-
|
|
457
|
-
], 64)) :
|
|
435
|
+
], 64)) : w("", !0),
|
|
436
|
+
a.showFeedback && a.hasFeedback ? (l(), u("div", lt, "感谢您进行的评价反馈")) : w("", !0)
|
|
437
|
+
], 64)) : w("", !0)
|
|
458
438
|
])
|
|
459
|
-
], 64)) :
|
|
439
|
+
], 64)) : w("", !0)
|
|
460
440
|
], 2))), 128)),
|
|
461
|
-
|
|
462
|
-
s("div",
|
|
463
|
-
|
|
441
|
+
i.value && p.value.length === 0 && !((r = o.value[o.value.length - 1]) != null && r.content) ? (l(), u("div", rt, [
|
|
442
|
+
s("div", ct, [
|
|
443
|
+
m(t, {
|
|
464
444
|
size: 32,
|
|
465
|
-
icon:
|
|
445
|
+
icon: _(Z)
|
|
466
446
|
}, null, 8, ["icon"])
|
|
467
447
|
]),
|
|
468
|
-
|
|
469
|
-
])) :
|
|
448
|
+
ut
|
|
449
|
+
])) : w("", !0)
|
|
470
450
|
], 512),
|
|
471
|
-
s("div",
|
|
472
|
-
|
|
451
|
+
s("div", dt, [
|
|
452
|
+
m(A, {
|
|
473
453
|
class: "message-input",
|
|
474
454
|
modelValue: E.value,
|
|
475
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
455
|
+
"onUpdate:modelValue": e[0] || (e[0] = (a) => E.value = a),
|
|
476
456
|
type: "textarea",
|
|
477
457
|
rows: 4,
|
|
478
458
|
autosize: { minRows: 2, maxRows: 4 },
|
|
479
459
|
placeholder: "输入您想查询的品种条件...",
|
|
480
|
-
onKeydown:
|
|
460
|
+
onKeydown: le
|
|
481
461
|
}, null, 8, ["modelValue"]),
|
|
482
|
-
s("div",
|
|
483
|
-
|
|
484
|
-
|
|
462
|
+
s("div", mt, [
|
|
463
|
+
pt,
|
|
464
|
+
m(B, {
|
|
485
465
|
class: "send-btn",
|
|
486
466
|
type: "primary",
|
|
487
|
-
icon:
|
|
488
|
-
loading:
|
|
489
|
-
onClick:
|
|
467
|
+
icon: _(Me),
|
|
468
|
+
loading: y.value,
|
|
469
|
+
onClick: G,
|
|
490
470
|
round: ""
|
|
491
471
|
}, {
|
|
492
|
-
default:
|
|
472
|
+
default: g(() => [
|
|
493
473
|
K(" 发送 ")
|
|
494
474
|
]),
|
|
495
475
|
_: 1
|
|
@@ -501,40 +481,40 @@ const y = (p) => (Ne("data-v-3015ca89"), p = p(), De(), p), qe = { class: "ai-di
|
|
|
501
481
|
}),
|
|
502
482
|
_: 1
|
|
503
483
|
}, 8, ["modelValue"]),
|
|
504
|
-
|
|
484
|
+
m(V, {
|
|
505
485
|
modelValue: Y.value,
|
|
506
|
-
"onUpdate:modelValue": e[5] || (e[5] = (
|
|
486
|
+
"onUpdate:modelValue": e[5] || (e[5] = (r) => Y.value = r),
|
|
507
487
|
title: "📝 反馈意见",
|
|
508
488
|
width: "400px"
|
|
509
489
|
}, {
|
|
510
|
-
footer:
|
|
511
|
-
s("span",
|
|
512
|
-
|
|
513
|
-
onClick: e[3] || (e[3] = (
|
|
490
|
+
footer: g(() => [
|
|
491
|
+
s("span", gt, [
|
|
492
|
+
m(B, {
|
|
493
|
+
onClick: e[3] || (e[3] = (r) => Y.value = !1)
|
|
514
494
|
}, {
|
|
515
|
-
default:
|
|
495
|
+
default: g(() => [
|
|
516
496
|
K("取消")
|
|
517
497
|
]),
|
|
518
498
|
_: 1
|
|
519
499
|
}),
|
|
520
|
-
|
|
500
|
+
m(B, {
|
|
521
501
|
type: "primary",
|
|
522
|
-
onClick: e[4] || (e[4] = (
|
|
502
|
+
onClick: e[4] || (e[4] = (r) => F("unsatisfied", q.value))
|
|
523
503
|
}, {
|
|
524
|
-
default:
|
|
504
|
+
default: g(() => [
|
|
525
505
|
K("提交反馈")
|
|
526
506
|
]),
|
|
527
507
|
_: 1
|
|
528
508
|
})
|
|
529
509
|
])
|
|
530
510
|
]),
|
|
531
|
-
default:
|
|
532
|
-
s("div",
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
modelValue:
|
|
537
|
-
"onUpdate:modelValue": e[2] || (e[2] = (
|
|
511
|
+
default: g(() => [
|
|
512
|
+
s("div", ft, [
|
|
513
|
+
vt,
|
|
514
|
+
_t,
|
|
515
|
+
m(A, {
|
|
516
|
+
modelValue: N.value,
|
|
517
|
+
"onUpdate:modelValue": e[2] || (e[2] = (r) => N.value = r),
|
|
538
518
|
type: "textarea",
|
|
539
519
|
rows: 4,
|
|
540
520
|
placeholder: "[非必填]例如:回答不够准确、查询结果有误、界面体验不佳..."
|
|
@@ -546,11 +526,11 @@ const y = (p) => (Ne("data-v-3015ca89"), p = p(), De(), p), qe = { class: "ai-di
|
|
|
546
526
|
], 64);
|
|
547
527
|
};
|
|
548
528
|
}
|
|
549
|
-
},
|
|
550
|
-
install(
|
|
551
|
-
|
|
529
|
+
}, kt = /* @__PURE__ */ Ye(ht, [["__scopeId", "data-v-c6a98338"]]), Jt = {
|
|
530
|
+
install(d) {
|
|
531
|
+
d.component("st-varietyAiHelper", kt);
|
|
552
532
|
}
|
|
553
533
|
};
|
|
554
534
|
export {
|
|
555
|
-
|
|
535
|
+
Jt as default
|
|
556
536
|
};
|