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.
- package/es/MonacoEditor.cjs +1 -1
- package/es/MonacoEditor.js +1 -1
- package/es/VarietyAiHelper.cjs +5 -4
- package/es/VarietyAiHelper.js +226 -215
- package/es/VarietySearch.cjs +1 -1
- package/es/VarietySearch.js +1 -1
- package/es/{index-5befc414.cjs → index-40f05e2c.cjs} +2 -2
- package/es/{index-8f9d0d17.js → index-8a54ceeb.js} +2 -2
- package/es/{python-27ece6fa.cjs → python-02c3937a.cjs} +1 -1
- package/es/{python-656db04f.js → python-99011a53.js} +1 -1
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +52 -51
- package/lib/{index-0dab5f01.js → index-28225e49.js} +1828 -1817
- package/lib/{python-1a46034d.js → python-b13b7faa.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/VarietyAiHelper/index.vue +27 -4
package/es/VarietyAiHelper.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { b as
|
|
2
|
-
import { E as
|
|
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
|
|
5
|
-
import { E as
|
|
6
|
-
import { defineComponent as J, ref as
|
|
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
|
|
9
|
-
import { E as
|
|
10
|
-
import { _ as
|
|
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
|
|
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
|
|
25
|
+
const we = Z({
|
|
26
26
|
size: {
|
|
27
27
|
type: [Number, String],
|
|
28
|
-
values:
|
|
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:
|
|
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:
|
|
47
|
+
type: ee(String),
|
|
48
48
|
default: "cover"
|
|
49
49
|
}
|
|
50
|
-
}),
|
|
50
|
+
}), Se = {
|
|
51
51
|
error: (r) => r instanceof Event
|
|
52
|
-
},
|
|
52
|
+
}, Ce = J({
|
|
53
53
|
name: "ElAvatar"
|
|
54
|
-
}),
|
|
55
|
-
...
|
|
56
|
-
props:
|
|
57
|
-
emits:
|
|
58
|
-
setup(r, { emit:
|
|
59
|
-
const
|
|
60
|
-
const { size: o, icon:
|
|
61
|
-
return
|
|
62
|
-
}),
|
|
63
|
-
const { size: o } =
|
|
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:
|
|
65
|
+
size: ae(o) || ""
|
|
66
66
|
}) : void 0;
|
|
67
|
-
}),
|
|
68
|
-
objectFit:
|
|
67
|
+
}), h = $(() => ({
|
|
68
|
+
objectFit: _.fit
|
|
69
69
|
}));
|
|
70
|
-
W(() =>
|
|
70
|
+
W(() => _.src, () => m.value = !1);
|
|
71
71
|
function c(o) {
|
|
72
|
-
|
|
72
|
+
m.value = !0, E("error", o);
|
|
73
73
|
}
|
|
74
|
-
return (o,
|
|
75
|
-
class: X(
|
|
76
|
-
style:
|
|
74
|
+
return (o, y) => (v(), k("span", {
|
|
75
|
+
class: X(D(l)),
|
|
76
|
+
style: O(D(g))
|
|
77
77
|
}, [
|
|
78
|
-
(o.src || o.srcSet) && !
|
|
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:
|
|
83
|
+
style: O(D(h)),
|
|
84
84
|
onError: c
|
|
85
|
-
}, null, 44, ["src", "alt", "srcset"])) : o.icon ? (
|
|
86
|
-
default:
|
|
87
|
-
(
|
|
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
|
-
})) :
|
|
90
|
+
})) : ue(o.$slots, "default", { key: 2 })
|
|
91
91
|
], 6));
|
|
92
92
|
}
|
|
93
93
|
});
|
|
94
|
-
var De = /* @__PURE__ */
|
|
95
|
-
const
|
|
96
|
-
const
|
|
97
|
-
var
|
|
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:
|
|
102
|
+
input: { prompt: _ },
|
|
103
103
|
parameters: { incremental_output: "true" },
|
|
104
104
|
debug: {}
|
|
105
105
|
}),
|
|
106
106
|
headers: {
|
|
107
|
-
Authorization: `Bearer ${
|
|
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
|
|
114
|
+
const g = l.body.getReader(), h = new TextDecoder();
|
|
115
115
|
let c = "";
|
|
116
116
|
for (; ; ) {
|
|
117
|
-
const { done: o, value:
|
|
117
|
+
const { done: o, value: y } = await g.read();
|
|
118
118
|
if (o) {
|
|
119
|
-
c.trim() &&
|
|
119
|
+
c.trim() && Ae(c, i), i("finish", "");
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
|
-
c +=
|
|
123
|
-
let
|
|
124
|
-
for (; (
|
|
122
|
+
c += h.decode(y, { stream: !0 });
|
|
123
|
+
let a;
|
|
124
|
+
for (; (a = c.indexOf(`
|
|
125
125
|
`)) !== -1; ) {
|
|
126
|
-
const
|
|
127
|
-
if (c = c.substring(
|
|
128
|
-
const
|
|
129
|
-
if (
|
|
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
|
|
132
|
-
|
|
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
|
|
143
|
+
function Ae(r, E) {
|
|
144
144
|
var i;
|
|
145
|
-
const
|
|
145
|
+
const _ = r.split(`
|
|
146
146
|
`);
|
|
147
|
-
for (const
|
|
148
|
-
if (
|
|
149
|
-
const l =
|
|
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
|
|
153
|
-
|
|
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
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
],
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
],
|
|
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
|
-
},
|
|
167
|
+
}, qe = {
|
|
168
168
|
key: 0,
|
|
169
169
|
class: "message-item assistant"
|
|
170
|
-
},
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
/* @__PURE__ */
|
|
174
|
-
/* @__PURE__ */
|
|
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)),
|
|
177
|
-
/* @__PURE__ */
|
|
178
|
-
], -1)),
|
|
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:
|
|
191
|
-
const i =
|
|
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:
|
|
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
|
-
]),
|
|
209
|
-
switch (
|
|
208
|
+
]), u = b(""), T = b(!1), w = b(""), F = b({}), M = async (d, e) => {
|
|
209
|
+
switch (d) {
|
|
210
210
|
case "satisfied": {
|
|
211
|
-
const
|
|
212
|
-
userName:
|
|
213
|
-
userContent:
|
|
214
|
-
aiContent:
|
|
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:
|
|
217
|
-
resTime:
|
|
218
|
-
firstPackageTime:
|
|
216
|
+
createTime: s.createTime,
|
|
217
|
+
resTime: s.resTime,
|
|
218
|
+
firstPackageTime: s.firstPackageTime
|
|
219
219
|
};
|
|
220
|
-
await i.request.post("/alarm/deliversign/addVarietyAiHelperLog",
|
|
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
|
-
|
|
224
|
+
F.value = e, T.value = !0;
|
|
225
225
|
break;
|
|
226
226
|
}
|
|
227
227
|
case "unsatisfied": {
|
|
228
|
-
const
|
|
229
|
-
userName:
|
|
230
|
-
userContent:
|
|
231
|
-
userSuggestion:
|
|
232
|
-
aiContent:
|
|
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:
|
|
235
|
-
createTime:
|
|
236
|
-
firstPackageTime:
|
|
234
|
+
resTime: s.resTime,
|
|
235
|
+
createTime: s.createTime,
|
|
236
|
+
firstPackageTime: s.firstPackageTime
|
|
237
237
|
};
|
|
238
|
-
await i.request.post("/alarm/deliversign/addVarietyAiHelperLog",
|
|
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
|
|
243
|
-
userName:
|
|
244
|
-
userContent:
|
|
245
|
-
userSuggestion:
|
|
246
|
-
aiContent:
|
|
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:
|
|
249
|
-
createTime:
|
|
250
|
-
firstPackageTime:
|
|
248
|
+
resTime: s.resTime,
|
|
249
|
+
createTime: s.createTime,
|
|
250
|
+
firstPackageTime: s.firstPackageTime
|
|
251
251
|
};
|
|
252
|
-
await i.request.post("/alarm/deliversign/addVarietyAiHelperLog",
|
|
252
|
+
await i.request.post("/alarm/deliversign/addVarietyAiHelperLog", p);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
|
-
},
|
|
256
|
-
const
|
|
257
|
-
if (!
|
|
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
|
-
|
|
261
|
+
a.value.push({
|
|
262
262
|
role: "user",
|
|
263
|
-
content:
|
|
263
|
+
content: d,
|
|
264
264
|
createTime: z().format("YYYY-MM-DD HH:mm:ss")
|
|
265
|
-
}),
|
|
265
|
+
}), u.value = "", await P(), a.value.push({
|
|
266
266
|
role: "assistant",
|
|
267
267
|
content: "",
|
|
268
|
-
userContent:
|
|
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
|
|
275
|
+
let e = "", s = (/* @__PURE__ */ new Date()).getTime();
|
|
276
276
|
try {
|
|
277
|
-
await
|
|
277
|
+
await Pe({
|
|
278
278
|
appId: "9e54d112acfe4531bd1fc4fee8827fef",
|
|
279
279
|
apiKey: "sk-d995eb26a4334bdeb2ccb4cbfaf51de8",
|
|
280
|
-
value:
|
|
281
|
-
callback: (N,
|
|
280
|
+
value: d,
|
|
281
|
+
callback: (N, f) => {
|
|
282
282
|
if (N === "message") {
|
|
283
|
-
|
|
284
|
-
const n =
|
|
285
|
-
n && n.role === "assistant" && (n.content =
|
|
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 =
|
|
289
|
-
n && n.role === "assistant" && (n.showFeedback = !0, n.resTime = (/* @__PURE__ */ new Date()).getTime() -
|
|
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(
|
|
291
|
+
const A = JSON.parse(e);
|
|
292
292
|
l("callBack", A);
|
|
293
293
|
} catch {
|
|
294
|
-
l("callBack",
|
|
294
|
+
l("callBack", e);
|
|
295
295
|
}
|
|
296
296
|
}
|
|
297
297
|
}
|
|
298
298
|
});
|
|
299
|
-
} catch (
|
|
300
|
-
B.error(`AI响应异常: ${
|
|
299
|
+
} catch (p) {
|
|
300
|
+
B.error(`AI响应异常: ${p}`), a.value.pop(), a.value.push({
|
|
301
301
|
role: "assistant",
|
|
302
|
-
userContent:
|
|
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() -
|
|
307
|
+
resTime: (/* @__PURE__ */ new Date()).getTime() - s,
|
|
308
308
|
firstPackageTime: 0
|
|
309
|
-
}),
|
|
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
|
|
323
|
+
await I(), y.value && (y.value.scrollTop = y.value.scrollHeight);
|
|
313
324
|
};
|
|
314
325
|
return W(
|
|
315
|
-
() =>
|
|
326
|
+
() => a.value,
|
|
316
327
|
() => {
|
|
317
328
|
P();
|
|
318
329
|
},
|
|
319
330
|
{ deep: !0 }
|
|
320
|
-
),
|
|
331
|
+
), E({
|
|
321
332
|
open: () => {
|
|
322
|
-
|
|
333
|
+
h.value = !0, I(() => {
|
|
323
334
|
P();
|
|
324
335
|
});
|
|
325
336
|
}
|
|
326
|
-
}), (
|
|
327
|
-
const
|
|
328
|
-
return
|
|
329
|
-
|
|
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:
|
|
332
|
-
"onUpdate:modelValue":
|
|
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:
|
|
342
|
-
var
|
|
352
|
+
default: V(() => {
|
|
353
|
+
var f;
|
|
343
354
|
return [
|
|
344
|
-
|
|
345
|
-
|
|
355
|
+
t("div", Fe, [
|
|
356
|
+
t("div", {
|
|
346
357
|
ref_key: "messageListRef",
|
|
347
|
-
ref:
|
|
358
|
+
ref: y,
|
|
348
359
|
class: "message-list"
|
|
349
360
|
}, [
|
|
350
|
-
(
|
|
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
|
-
|
|
365
|
+
t("div", {
|
|
355
366
|
class: X(["message-item", n.role])
|
|
356
367
|
}, [
|
|
357
|
-
n.content ? (
|
|
358
|
-
|
|
359
|
-
|
|
368
|
+
n.content ? (v(), k(Y, { key: 0 }, [
|
|
369
|
+
t("div", Me, [
|
|
370
|
+
S(s, {
|
|
360
371
|
size: 32,
|
|
361
|
-
icon: n.role === "user" ?
|
|
372
|
+
icon: n.role === "user" ? D(he) : D(U)
|
|
362
373
|
}, null, 8, ["icon"])
|
|
363
374
|
]),
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
n.role === "assistant" ? (
|
|
368
|
-
n.showFeedback && !n.hasFeedback ? (
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
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: (
|
|
374
|
-
},
|
|
375
|
-
|
|
384
|
+
onClick: (Q) => M("satisfied", A)
|
|
385
|
+
}, Le, 8, Be),
|
|
386
|
+
t("button", {
|
|
376
387
|
class: "feedback-btn unsatisfied-btn",
|
|
377
|
-
onClick: (
|
|
378
|
-
},
|
|
388
|
+
onClick: (Q) => M("open", A)
|
|
389
|
+
}, Ke, 8, je)
|
|
379
390
|
])
|
|
380
|
-
], 64)) :
|
|
381
|
-
n.showFeedback && n.hasFeedback ? (
|
|
382
|
-
], 64)) :
|
|
391
|
+
], 64)) : x("", !0),
|
|
392
|
+
n.showFeedback && n.hasFeedback ? (v(), k("div", Ue, "感谢您进行的评价反馈")) : x("", !0)
|
|
393
|
+
], 64)) : x("", !0)
|
|
383
394
|
])
|
|
384
|
-
], 64)) :
|
|
395
|
+
], 64)) : x("", !0)
|
|
385
396
|
], 2)
|
|
386
397
|
]))), 128)),
|
|
387
|
-
o.value && !((
|
|
388
|
-
|
|
389
|
-
|
|
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:
|
|
402
|
+
icon: D(U)
|
|
392
403
|
}, null, 8, ["icon"])
|
|
393
404
|
]),
|
|
394
|
-
|
|
395
|
-
])) :
|
|
405
|
+
We
|
|
406
|
+
])) : x("", !0)
|
|
396
407
|
], 512),
|
|
397
|
-
|
|
398
|
-
|
|
408
|
+
t("div", Xe, [
|
|
409
|
+
S(p, {
|
|
399
410
|
class: "message-input",
|
|
400
|
-
modelValue:
|
|
401
|
-
"onUpdate:modelValue":
|
|
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:
|
|
407
|
-
}, null, 8, ["modelValue"
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
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:
|
|
424
|
+
icon: D(be),
|
|
414
425
|
loading: c.value,
|
|
415
|
-
onClick:
|
|
426
|
+
onClick: j,
|
|
416
427
|
round: ""
|
|
417
428
|
}, {
|
|
418
|
-
default:
|
|
419
|
-
|
|
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
|
-
|
|
431
|
-
modelValue:
|
|
432
|
-
"onUpdate:modelValue":
|
|
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:
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
onClick:
|
|
447
|
+
footer: V(() => [
|
|
448
|
+
t("span", st, [
|
|
449
|
+
S(H, {
|
|
450
|
+
onClick: e[3] || (e[3] = (f) => T.value = !1)
|
|
440
451
|
}, {
|
|
441
|
-
default:
|
|
442
|
-
|
|
452
|
+
default: V(() => [
|
|
453
|
+
L("取消")
|
|
443
454
|
]),
|
|
444
455
|
_: 1
|
|
445
456
|
}),
|
|
446
|
-
|
|
457
|
+
S(H, {
|
|
447
458
|
type: "primary",
|
|
448
|
-
onClick:
|
|
459
|
+
onClick: e[4] || (e[4] = (f) => M("unsatisfied", F.value))
|
|
449
460
|
}, {
|
|
450
|
-
default:
|
|
451
|
-
|
|
461
|
+
default: V(() => [
|
|
462
|
+
L("提交反馈")
|
|
452
463
|
]),
|
|
453
464
|
_: 1
|
|
454
465
|
})
|
|
455
466
|
])
|
|
456
467
|
]),
|
|
457
|
-
default:
|
|
458
|
-
|
|
468
|
+
default: V(() => [
|
|
469
|
+
t("div", Ze, [
|
|
470
|
+
et,
|
|
459
471
|
tt,
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
modelValue:
|
|
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
|
-
},
|
|
486
|
+
}, ot = /* @__PURE__ */ ke(at, [["__scopeId", "data-v-24220a5f"]]), Pt = {
|
|
476
487
|
install(r) {
|
|
477
|
-
r.component("st-varietyAiHelper",
|
|
488
|
+
r.component("st-varietyAiHelper", ot);
|
|
478
489
|
}
|
|
479
490
|
};
|
|
480
491
|
export {
|
|
481
|
-
|
|
492
|
+
Pt as default
|
|
482
493
|
};
|