st-comp 0.0.269 → 0.0.270
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 +4 -4
- package/es/VarietyAiHelper.js +221 -221
- package/es/style.css +1 -1
- package/lib/bundle.js +1 -1
- package/lib/bundle.umd.cjs +46 -46
- package/lib/{index-8ba1607b.js → index-2dd72fda.js} +421 -421
- package/lib/{python-16c6e601.js → python-126b61c5.js} +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/packages/VarietyAiHelper/index.vue +7 -50
package/es/VarietyAiHelper.js
CHANGED
|
@@ -3,12 +3,12 @@ import { E as be } from "./el-dialog-59a23c2b.js";
|
|
|
3
3
|
import "./el-overlay-465cd11e.js";
|
|
4
4
|
import { E as we } from "./el-button-cd144ee1.js";
|
|
5
5
|
import { E as Te } from "./el-input-1f14a6e2.js";
|
|
6
|
-
import { defineComponent as se, ref as
|
|
6
|
+
import { defineComponent as se, ref as w, computed as f, watch as re, openBlock as i, createElementBlock as d, normalizeClass as y, unref as s, normalizeStyle as x, createBlock as K, withCtx as P, resolveDynamicComponent as ge, renderSlot as le, createElementVNode as r, toDisplayString as O, createCommentVNode as A, inject as Se, reactive as Ce, nextTick as ae, Fragment as q, createVNode as C, renderList as ue, createTextVNode as ne, pushScopeId as $e, popScopeId as Ee } from "vue";
|
|
7
7
|
import { d as X } from "./dayjs.min-8313b006.js";
|
|
8
8
|
import { V as Pe, U as De } from "./index-7ed0999e.js";
|
|
9
9
|
import { s as Fe } from "./aiTools-9c59a74a.js";
|
|
10
|
-
import { E as ie, w as Ne, o as Ve, p as Me, s as Ae, c as Ye, u as He, t as Le, v as Be, x as Ie, y as
|
|
11
|
-
import { _ as
|
|
10
|
+
import { E as ie, w as Ne, o as Ve, p as Me, s as Ae, c as Ye, u as He, t as Le, v as Be, x as Ie, y as ze } from "./index-1b97095f.js";
|
|
11
|
+
import { _ as xe } from "./_plugin-vue_export-helper-dad06003.js";
|
|
12
12
|
import { E as ee } from "./index-499cf989.js";
|
|
13
13
|
import { k as Oe, i as Re } from "./use-form-common-props-dd9617de.js";
|
|
14
14
|
import "./index-8e88a0bd.js";
|
|
@@ -57,35 +57,35 @@ const Ue = de({
|
|
|
57
57
|
props: Ue,
|
|
58
58
|
emits: je,
|
|
59
59
|
setup(p, { emit: c }) {
|
|
60
|
-
const
|
|
61
|
-
const { size: u, icon: v, shape:
|
|
62
|
-
return oe(u) &&
|
|
60
|
+
const D = p, l = fe("avatar"), F = w(!1), N = f(() => {
|
|
61
|
+
const { size: u, icon: v, shape: $ } = D, T = [l.b()];
|
|
62
|
+
return oe(u) && T.push(l.m(u)), v && T.push(l.m("icon")), $ && T.push(l.m($)), T;
|
|
63
63
|
}), U = f(() => {
|
|
64
|
-
const { size: u } =
|
|
65
|
-
return pe(u) ?
|
|
64
|
+
const { size: u } = D;
|
|
65
|
+
return pe(u) ? l.cssVarBlock({
|
|
66
66
|
size: _e(u) || ""
|
|
67
67
|
}) : void 0;
|
|
68
|
-
}),
|
|
69
|
-
objectFit:
|
|
68
|
+
}), J = f(() => ({
|
|
69
|
+
objectFit: D.fit
|
|
70
70
|
}));
|
|
71
|
-
re(() =>
|
|
71
|
+
re(() => D.src, () => F.value = !1);
|
|
72
72
|
function k(u) {
|
|
73
|
-
|
|
73
|
+
F.value = !0, c("error", u);
|
|
74
74
|
}
|
|
75
75
|
return (u, v) => (i(), d("span", {
|
|
76
|
-
class:
|
|
77
|
-
style:
|
|
76
|
+
class: y(s(N)),
|
|
77
|
+
style: x(s(U))
|
|
78
78
|
}, [
|
|
79
|
-
(u.src || u.srcSet) && !
|
|
79
|
+
(u.src || u.srcSet) && !F.value ? (i(), d("img", {
|
|
80
80
|
key: 0,
|
|
81
81
|
src: u.src,
|
|
82
82
|
alt: u.alt,
|
|
83
83
|
srcset: u.srcSet,
|
|
84
|
-
style:
|
|
84
|
+
style: x(s(J)),
|
|
85
85
|
onError: k
|
|
86
|
-
}, null, 44, ["src", "alt", "srcset"])) : u.icon ? (i(),
|
|
87
|
-
default:
|
|
88
|
-
(i(),
|
|
86
|
+
}, null, 44, ["src", "alt", "srcset"])) : u.icon ? (i(), K(s(ie), { key: 1 }, {
|
|
87
|
+
default: P(() => [
|
|
88
|
+
(i(), K(ge(u.icon)))
|
|
89
89
|
]),
|
|
90
90
|
_: 1
|
|
91
91
|
})) : le(u.$slots, "default", { key: 2 })
|
|
@@ -151,18 +151,18 @@ const Ke = ve(qe), Ge = de({
|
|
|
151
151
|
...Qe,
|
|
152
152
|
props: Ge,
|
|
153
153
|
setup(p) {
|
|
154
|
-
const c = p,
|
|
154
|
+
const c = p, D = {
|
|
155
155
|
success: "#13ce66",
|
|
156
156
|
exception: "#ff4949",
|
|
157
157
|
warning: "#e6a23c",
|
|
158
158
|
default: "#20a0ff"
|
|
159
|
-
},
|
|
159
|
+
}, l = fe("progress"), F = f(() => {
|
|
160
160
|
const e = {
|
|
161
161
|
width: `${c.percentage}%`,
|
|
162
162
|
animationDuration: `${c.duration}s`
|
|
163
|
-
}, g =
|
|
163
|
+
}, g = G(c.percentage);
|
|
164
164
|
return g.includes("gradient") ? e.background = g : e.backgroundColor = g, e;
|
|
165
|
-
}),
|
|
165
|
+
}), N = f(() => (c.strokeWidth / c.width * 100).toFixed(1)), U = f(() => ["circle", "dashboard"].includes(c.type) ? Number.parseInt(`${50 - Number.parseFloat(N.value) / 2}`, 10) : 0), J = f(() => {
|
|
166
166
|
const e = U.value, g = c.type === "dashboard";
|
|
167
167
|
return `
|
|
168
168
|
M 50 50
|
|
@@ -170,25 +170,25 @@ const Ke = ve(qe), Ge = de({
|
|
|
170
170
|
a ${e} ${e} 0 1 1 0 ${g ? "-" : ""}${e * 2}
|
|
171
171
|
a ${e} ${e} 0 1 1 0 ${g ? "" : "-"}${e * 2}
|
|
172
172
|
`;
|
|
173
|
-
}), k = f(() => 2 * Math.PI * U.value), u = f(() => c.type === "dashboard" ? 0.75 : 1), v = f(() => `${-1 * k.value * (1 - u.value) / 2}px`),
|
|
173
|
+
}), k = f(() => 2 * Math.PI * U.value), u = f(() => c.type === "dashboard" ? 0.75 : 1), v = f(() => `${-1 * k.value * (1 - u.value) / 2}px`), $ = f(() => ({
|
|
174
174
|
strokeDasharray: `${k.value * u.value}px, ${k.value}px`,
|
|
175
175
|
strokeDashoffset: v.value
|
|
176
|
-
})),
|
|
176
|
+
})), T = f(() => ({
|
|
177
177
|
strokeDasharray: `${k.value * u.value * (c.percentage / 100)}px, ${k.value}px`,
|
|
178
178
|
strokeDashoffset: v.value,
|
|
179
179
|
transition: "stroke-dasharray 0.6s ease 0s, stroke 0.6s ease, opacity ease 0.6s"
|
|
180
|
-
})),
|
|
180
|
+
})), o = f(() => {
|
|
181
181
|
let e;
|
|
182
|
-
return c.color ? e =
|
|
183
|
-
}),
|
|
182
|
+
return c.color ? e = G(c.percentage) : e = D[c.status] || D.default, e;
|
|
183
|
+
}), V = f(() => c.status === "warning" ? Ne : c.type === "line" ? c.status === "success" ? Ve : Me : c.status === "success" ? Ae : Ye), Y = f(() => c.type === "line" ? 12 + c.strokeWidth * 0.4 : c.width * 0.111111 + 2), H = f(() => c.format(c.percentage));
|
|
184
184
|
function Z(e) {
|
|
185
185
|
const g = 100 / e.length;
|
|
186
|
-
return e.map((
|
|
187
|
-
color:
|
|
186
|
+
return e.map((b, B) => oe(b) ? {
|
|
187
|
+
color: b,
|
|
188
188
|
percentage: (B + 1) * g
|
|
189
|
-
} :
|
|
189
|
+
} : b).sort((b, B) => b.percentage - B.percentage);
|
|
190
190
|
}
|
|
191
|
-
const
|
|
191
|
+
const G = (e) => {
|
|
192
192
|
var g;
|
|
193
193
|
const { color: L } = c;
|
|
194
194
|
if (ye(L))
|
|
@@ -196,21 +196,21 @@ const Ke = ve(qe), Ge = de({
|
|
|
196
196
|
if (oe(L))
|
|
197
197
|
return L;
|
|
198
198
|
{
|
|
199
|
-
const
|
|
200
|
-
for (const B of
|
|
199
|
+
const b = Z(L);
|
|
200
|
+
for (const B of b)
|
|
201
201
|
if (B.percentage > e)
|
|
202
202
|
return B.color;
|
|
203
|
-
return (g =
|
|
203
|
+
return (g = b[b.length - 1]) == null ? void 0 : g.color;
|
|
204
204
|
}
|
|
205
205
|
};
|
|
206
206
|
return (e, g) => (i(), d("div", {
|
|
207
|
-
class:
|
|
208
|
-
s(
|
|
209
|
-
s(
|
|
210
|
-
s(
|
|
207
|
+
class: y([
|
|
208
|
+
s(l).b(),
|
|
209
|
+
s(l).m(e.type),
|
|
210
|
+
s(l).is(e.status),
|
|
211
211
|
{
|
|
212
|
-
[s(
|
|
213
|
-
[s(
|
|
212
|
+
[s(l).m("without-text")]: !e.showText,
|
|
213
|
+
[s(l).m("text-inside")]: e.textInside
|
|
214
214
|
}
|
|
215
215
|
]),
|
|
216
216
|
role: "progressbar",
|
|
@@ -220,98 +220,95 @@ const Ke = ve(qe), Ge = de({
|
|
|
220
220
|
}, [
|
|
221
221
|
e.type === "line" ? (i(), d("div", {
|
|
222
222
|
key: 0,
|
|
223
|
-
class:
|
|
223
|
+
class: y(s(l).b("bar"))
|
|
224
224
|
}, [
|
|
225
|
-
|
|
226
|
-
class:
|
|
227
|
-
style:
|
|
225
|
+
r("div", {
|
|
226
|
+
class: y(s(l).be("bar", "outer")),
|
|
227
|
+
style: x({ height: `${e.strokeWidth}px` })
|
|
228
228
|
}, [
|
|
229
|
-
|
|
230
|
-
class:
|
|
231
|
-
s(
|
|
232
|
-
{ [s(
|
|
233
|
-
{ [s(
|
|
234
|
-
{ [s(
|
|
229
|
+
r("div", {
|
|
230
|
+
class: y([
|
|
231
|
+
s(l).be("bar", "inner"),
|
|
232
|
+
{ [s(l).bem("bar", "inner", "indeterminate")]: e.indeterminate },
|
|
233
|
+
{ [s(l).bem("bar", "inner", "striped")]: e.striped },
|
|
234
|
+
{ [s(l).bem("bar", "inner", "striped-flow")]: e.stripedFlow }
|
|
235
235
|
]),
|
|
236
|
-
style:
|
|
236
|
+
style: x(s(F))
|
|
237
237
|
}, [
|
|
238
238
|
(e.showText || e.$slots.default) && e.textInside ? (i(), d("div", {
|
|
239
239
|
key: 0,
|
|
240
|
-
class:
|
|
240
|
+
class: y(s(l).be("bar", "innerText"))
|
|
241
241
|
}, [
|
|
242
242
|
le(e.$slots, "default", { percentage: e.percentage }, () => [
|
|
243
|
-
|
|
243
|
+
r("span", null, O(s(H)), 1)
|
|
244
244
|
])
|
|
245
|
-
], 2)) :
|
|
245
|
+
], 2)) : A("v-if", !0)
|
|
246
246
|
], 6)
|
|
247
247
|
], 6)
|
|
248
248
|
], 2)) : (i(), d("div", {
|
|
249
249
|
key: 1,
|
|
250
|
-
class:
|
|
251
|
-
style:
|
|
250
|
+
class: y(s(l).b("circle")),
|
|
251
|
+
style: x({ height: `${e.width}px`, width: `${e.width}px` })
|
|
252
252
|
}, [
|
|
253
253
|
(i(), d("svg", { viewBox: "0 0 100 100" }, [
|
|
254
|
-
|
|
255
|
-
class:
|
|
256
|
-
d: s(
|
|
257
|
-
stroke: `var(${s(
|
|
254
|
+
r("path", {
|
|
255
|
+
class: y(s(l).be("circle", "track")),
|
|
256
|
+
d: s(J),
|
|
257
|
+
stroke: `var(${s(l).cssVarName("fill-color-light")}, #e5e9f2)`,
|
|
258
258
|
"stroke-linecap": e.strokeLinecap,
|
|
259
|
-
"stroke-width": s(
|
|
259
|
+
"stroke-width": s(N),
|
|
260
260
|
fill: "none",
|
|
261
|
-
style:
|
|
261
|
+
style: x(s($))
|
|
262
262
|
}, null, 14, ["d", "stroke", "stroke-linecap", "stroke-width"]),
|
|
263
|
-
|
|
264
|
-
class:
|
|
265
|
-
d: s(
|
|
266
|
-
stroke: s(
|
|
263
|
+
r("path", {
|
|
264
|
+
class: y(s(l).be("circle", "path")),
|
|
265
|
+
d: s(J),
|
|
266
|
+
stroke: s(o),
|
|
267
267
|
fill: "none",
|
|
268
268
|
opacity: e.percentage ? 1 : 0,
|
|
269
269
|
"stroke-linecap": e.strokeLinecap,
|
|
270
|
-
"stroke-width": s(
|
|
271
|
-
style:
|
|
270
|
+
"stroke-width": s(N),
|
|
271
|
+
style: x(s(T))
|
|
272
272
|
}, null, 14, ["d", "stroke", "opacity", "stroke-linecap", "stroke-width"])
|
|
273
273
|
]))
|
|
274
274
|
], 6)),
|
|
275
275
|
(e.showText || e.$slots.default) && !e.textInside ? (i(), d("div", {
|
|
276
276
|
key: 2,
|
|
277
|
-
class:
|
|
278
|
-
style:
|
|
277
|
+
class: y(s(l).e("text")),
|
|
278
|
+
style: x({ fontSize: `${s(Y)}px` })
|
|
279
279
|
}, [
|
|
280
280
|
le(e.$slots, "default", { percentage: e.percentage }, () => [
|
|
281
|
-
e.status ? (i(),
|
|
282
|
-
default:
|
|
283
|
-
(i(),
|
|
281
|
+
e.status ? (i(), K(s(ie), { key: 1 }, {
|
|
282
|
+
default: P(() => [
|
|
283
|
+
(i(), K(ge(s(V))))
|
|
284
284
|
]),
|
|
285
285
|
_: 1
|
|
286
286
|
})) : (i(), d("span", { key: 0 }, O(s(H)), 1))
|
|
287
287
|
])
|
|
288
|
-
], 6)) :
|
|
288
|
+
], 6)) : A("v-if", !0)
|
|
289
289
|
], 10, ["aria-valuenow"]));
|
|
290
290
|
}
|
|
291
291
|
});
|
|
292
292
|
var Ze = /* @__PURE__ */ me(Xe, [["__file", "progress.vue"]]);
|
|
293
293
|
const et = ve(Ze);
|
|
294
|
-
const R = (p) => ($e("data-v-
|
|
294
|
+
const R = (p) => ($e("data-v-8e2737b7"), p = p(), Ee(), p), tt = { class: "ai-dialog-body" }, st = { class: "avatar" }, at = { class: "message-content" }, nt = {
|
|
295
295
|
key: 0,
|
|
296
296
|
class: "node-progress"
|
|
297
|
-
}, ot = { class: "node-status-icon" }, rt = { class: "node-name" }, lt = { class: "progress-footer" }, it = { class: "progress-text" }, ct = ["innerHTML"], ut = {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
],
|
|
304
|
-
_t,
|
|
305
|
-
yt
|
|
306
|
-
], wt = {
|
|
297
|
+
}, ot = { class: "node-status-icon" }, rt = { class: "node-name" }, lt = { class: "progress-footer" }, it = { class: "progress-text" }, ct = ["innerHTML"], ut = { class: "message-createTime" }, dt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("div", { class: "message-createTime" }, "请问对本轮查询结果是否满意?", -1)), pt = { class: "feedback-buttons" }, ft = ["onClick"], mt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("span", { class: "btn-emoji" }, "👍", -1)), vt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("span", { class: "btn-text" }, "满意", -1)), gt = [
|
|
298
|
+
mt,
|
|
299
|
+
vt
|
|
300
|
+
], ht = ["onClick"], kt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("span", { class: "btn-emoji" }, "👎", -1)), _t = /* @__PURE__ */ R(() => /* @__PURE__ */ r("span", { class: "btn-text" }, "不满意", -1)), yt = [
|
|
301
|
+
kt,
|
|
302
|
+
_t
|
|
303
|
+
], bt = {
|
|
307
304
|
key: 1,
|
|
308
305
|
class: "message-createTime"
|
|
309
|
-
},
|
|
306
|
+
}, wt = {
|
|
310
307
|
key: 0,
|
|
311
308
|
class: "thinking-placeholder"
|
|
312
|
-
},
|
|
313
|
-
/* @__PURE__ */
|
|
314
|
-
], -1)),
|
|
309
|
+
}, Tt = { class: "input-area" }, St = { class: "input-actions" }, Ct = /* @__PURE__ */ R(() => /* @__PURE__ */ r("div", { class: "input-hint" }, [
|
|
310
|
+
/* @__PURE__ */ r("span", null, "Enter 发送 | Ctrl + Enter 换行")
|
|
311
|
+
], -1)), $t = { class: "feedback-dialog-content" }, Et = /* @__PURE__ */ R(() => /* @__PURE__ */ r("div", { class: "feedback-emoji" }, "😟", -1)), Pt = /* @__PURE__ */ R(() => /* @__PURE__ */ r("p", { class: "feedback-tip" }, "很抱歉没能帮到您,请告诉我们哪里需要改进:", -1)), Dt = { class: "dialog-footer" }, Ft = {
|
|
315
312
|
__name: "index",
|
|
316
313
|
props: {
|
|
317
314
|
defaultMessage: {
|
|
@@ -323,11 +320,11 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
323
320
|
}
|
|
324
321
|
},
|
|
325
322
|
emits: ["callBack"],
|
|
326
|
-
setup(p, { expose: c, emit:
|
|
327
|
-
const
|
|
323
|
+
setup(p, { expose: c, emit: D }) {
|
|
324
|
+
const l = Se("stConfig"), F = Ce(Pe()), N = w(!1), U = D, J = p, k = w(!1), u = w(!1), v = w([]), $ = w(!1), T = w(null), o = w([
|
|
328
325
|
{
|
|
329
326
|
role: "assistant",
|
|
330
|
-
content:
|
|
327
|
+
content: J.defaultMessage,
|
|
331
328
|
userContent: null,
|
|
332
329
|
showFeedback: !1,
|
|
333
330
|
hasFeedback: !1,
|
|
@@ -335,10 +332,10 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
335
332
|
resTime: 0,
|
|
336
333
|
firstPackageTime: 0
|
|
337
334
|
}
|
|
338
|
-
]),
|
|
335
|
+
]), V = w(""), Y = w(!1), H = w(""), Z = w({}), G = f(() => v.value.filter((a) => a.status === "success").length), e = f(() => v.value.length), g = f(() => e.value ? G.value / e.value * 100 : 0), L = f(() => {
|
|
339
336
|
const a = v.value.find((t) => t.status === "executing");
|
|
340
337
|
return a ? a.name : "处理中";
|
|
341
|
-
}),
|
|
338
|
+
}), b = (a) => {
|
|
342
339
|
if (typeof a != "string")
|
|
343
340
|
return !1;
|
|
344
341
|
try {
|
|
@@ -348,11 +345,11 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
348
345
|
return !1;
|
|
349
346
|
}
|
|
350
347
|
}, B = (a) => {
|
|
351
|
-
if (!
|
|
348
|
+
if (!b(a))
|
|
352
349
|
return null;
|
|
353
350
|
try {
|
|
354
|
-
const t = JSON.parse(a), { parsedConditions: n, ...
|
|
355
|
-
return { parsedConditions: n, webParams:
|
|
351
|
+
const t = JSON.parse(a), { parsedConditions: n, ...S } = t;
|
|
352
|
+
return { parsedConditions: n, webParams: S };
|
|
356
353
|
} catch {
|
|
357
354
|
return null;
|
|
358
355
|
}
|
|
@@ -361,15 +358,15 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
361
358
|
if (!a)
|
|
362
359
|
return "";
|
|
363
360
|
let t = "";
|
|
364
|
-
return (n = a.parsedConditions) != null && n.length && (t += '<div class="parsed-conditions">', a.parsedConditions.forEach((
|
|
365
|
-
t += `<div class="parsed-conditions-item">${
|
|
361
|
+
return (n = a.parsedConditions) != null && n.length && (t += '<div class="parsed-conditions">', a.parsedConditions.forEach((S) => {
|
|
362
|
+
t += `<div class="parsed-conditions-item">${S}</div>`;
|
|
366
363
|
}), t += "</div>"), t;
|
|
367
|
-
},
|
|
364
|
+
}, W = async (a, t) => {
|
|
368
365
|
switch (a) {
|
|
369
366
|
case "satisfied": {
|
|
370
|
-
const n =
|
|
371
|
-
await
|
|
372
|
-
userName:
|
|
367
|
+
const n = o.value[t];
|
|
368
|
+
await l.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
|
|
369
|
+
userName: F.username,
|
|
373
370
|
userContent: n.userContent,
|
|
374
371
|
aiContent: n.content,
|
|
375
372
|
type: 1,
|
|
@@ -378,7 +375,7 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
378
375
|
firstPackageTime: n.firstPackageTime,
|
|
379
376
|
isSolved: 1,
|
|
380
377
|
logOrigin: 1
|
|
381
|
-
}), ee.success("感谢您的评价!"),
|
|
378
|
+
}), ee.success("感谢您的评价!"), o.value[t].hasFeedback = !0;
|
|
382
379
|
break;
|
|
383
380
|
}
|
|
384
381
|
case "open": {
|
|
@@ -386,9 +383,9 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
386
383
|
break;
|
|
387
384
|
}
|
|
388
385
|
case "unsatisfied": {
|
|
389
|
-
const n =
|
|
390
|
-
await
|
|
391
|
-
userName:
|
|
386
|
+
const n = o.value[t];
|
|
387
|
+
await l.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
|
|
388
|
+
userName: F.username,
|
|
392
389
|
userContent: n.userContent,
|
|
393
390
|
userSuggestion: H.value,
|
|
394
391
|
aiContent: n.content,
|
|
@@ -398,13 +395,13 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
398
395
|
firstPackageTime: n.firstPackageTime,
|
|
399
396
|
isSolved: 0,
|
|
400
397
|
logOrigin: 1
|
|
401
|
-
}), ee.success("感谢您的反馈!我们将持续跟踪并进行优化"), Y.value = !1,
|
|
398
|
+
}), ee.success("感谢您的反馈!我们将持续跟踪并进行优化"), Y.value = !1, o.value[t].hasFeedback = !0;
|
|
402
399
|
break;
|
|
403
400
|
}
|
|
404
401
|
case "default": {
|
|
405
|
-
const n =
|
|
406
|
-
await
|
|
407
|
-
userName:
|
|
402
|
+
const n = o.value[t];
|
|
403
|
+
await l.request.post("/alarm/deliversign/addVarietyAiHelperLog", {
|
|
404
|
+
userName: F.username,
|
|
408
405
|
userContent: n.userContent,
|
|
409
406
|
userSuggestion: H.value,
|
|
410
407
|
aiContent: n.content,
|
|
@@ -418,16 +415,16 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
418
415
|
}
|
|
419
416
|
}
|
|
420
417
|
}, ce = async () => {
|
|
421
|
-
const a =
|
|
418
|
+
const a = V.value.trim();
|
|
422
419
|
if (!a)
|
|
423
420
|
return ee.warning("请输入消息内容");
|
|
424
421
|
if (k.value)
|
|
425
422
|
return;
|
|
426
|
-
v.value = [],
|
|
423
|
+
v.value = [], $.value = !1, o.value.push({
|
|
427
424
|
role: "user",
|
|
428
425
|
content: a,
|
|
429
426
|
createTime: X().format("YYYY-MM-DD HH:mm:ss")
|
|
430
|
-
}),
|
|
427
|
+
}), V.value = "", await I(), o.value.push({
|
|
431
428
|
role: "assistant",
|
|
432
429
|
content: "",
|
|
433
430
|
userContent: a,
|
|
@@ -437,45 +434,45 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
437
434
|
resTime: 0,
|
|
438
435
|
firstPackageTime: 0
|
|
439
436
|
}), await I(), k.value = !0, u.value = !0;
|
|
440
|
-
let t = "", n = (/* @__PURE__ */ new Date()).getTime(),
|
|
437
|
+
let t = "", n = (/* @__PURE__ */ new Date()).getTime(), S = !1;
|
|
441
438
|
try {
|
|
442
439
|
await Fe({
|
|
443
|
-
baseUrl:
|
|
440
|
+
baseUrl: l.env.VITE_BASE_URL,
|
|
444
441
|
token: De(),
|
|
445
442
|
value: a,
|
|
446
|
-
callback: (
|
|
447
|
-
if (
|
|
448
|
-
u.value = !1, k.value = !1,
|
|
443
|
+
callback: (z, M) => {
|
|
444
|
+
if (z === "error") {
|
|
445
|
+
u.value = !1, k.value = !1, o.value.pop(), o.value.push({
|
|
449
446
|
role: "assistant",
|
|
450
447
|
userContent: a,
|
|
451
|
-
content: `❌ ${
|
|
448
|
+
content: `❌ ${M}`,
|
|
452
449
|
showFeedback: !1,
|
|
453
450
|
hasFeedback: !1,
|
|
454
451
|
createTime: X().format("YYYY-MM-DD HH:mm:ss"),
|
|
455
452
|
resTime: (/* @__PURE__ */ new Date()).getTime() - n,
|
|
456
453
|
firstPackageTime: 0
|
|
457
|
-
}),
|
|
454
|
+
}), W("default", o.value.length - 1), I();
|
|
458
455
|
return;
|
|
459
456
|
}
|
|
460
|
-
if (
|
|
461
|
-
if (!
|
|
462
|
-
|
|
463
|
-
const _ =
|
|
457
|
+
if (z === "node") {
|
|
458
|
+
if (!S) {
|
|
459
|
+
S = !0, u.value = !1;
|
|
460
|
+
const _ = o.value[o.value.length - 1];
|
|
464
461
|
_ && _.role === "assistant" && _.firstPackageTime === 0 && (_.firstPackageTime = (/* @__PURE__ */ new Date()).getTime() - n);
|
|
465
462
|
}
|
|
466
|
-
const h = v.value.find((_) => _.name ===
|
|
467
|
-
h ? h.status =
|
|
463
|
+
const h = v.value.find((_) => _.name === M.name);
|
|
464
|
+
h ? h.status = M.status : v.value.push({ name: M.name, status: M.status }), I();
|
|
468
465
|
return;
|
|
469
466
|
}
|
|
470
|
-
if (
|
|
471
|
-
t =
|
|
472
|
-
const h =
|
|
467
|
+
if (z === "message") {
|
|
468
|
+
t = M;
|
|
469
|
+
const h = o.value[o.value.length - 1];
|
|
473
470
|
h && h.role === "assistant" && (h.content = t, I());
|
|
474
471
|
}
|
|
475
|
-
if (
|
|
476
|
-
k.value = !1,
|
|
477
|
-
const h =
|
|
478
|
-
h && h.role === "assistant" && (h.showFeedback = !0, h.resTime = (/* @__PURE__ */ new Date()).getTime() - n,
|
|
472
|
+
if (z === "finish") {
|
|
473
|
+
k.value = !1, $.value = !0;
|
|
474
|
+
const h = o.value[o.value.length - 1];
|
|
475
|
+
h && h.role === "assistant" && (h.showFeedback = !0, h.resTime = (/* @__PURE__ */ new Date()).getTime() - n, W("default", o.value.length - 1));
|
|
479
476
|
try {
|
|
480
477
|
const _ = JSON.parse(t);
|
|
481
478
|
_.parsedConditions && delete _.parsedConditions, U("callBack", _);
|
|
@@ -485,8 +482,8 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
485
482
|
}
|
|
486
483
|
}
|
|
487
484
|
});
|
|
488
|
-
} catch (
|
|
489
|
-
ee.error(`AI响应异常: ${
|
|
485
|
+
} catch (z) {
|
|
486
|
+
ee.error(`AI响应异常: ${z}`), o.value.pop(), o.value.push({
|
|
490
487
|
role: "assistant",
|
|
491
488
|
userContent: a,
|
|
492
489
|
content: "❌ 抱歉,AI服务响应异常,请稍后重试。",
|
|
@@ -495,24 +492,24 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
495
492
|
createTime: X().format("YYYY-MM-DD HH:mm:ss"),
|
|
496
493
|
resTime: (/* @__PURE__ */ new Date()).getTime() - n,
|
|
497
494
|
firstPackageTime: 0
|
|
498
|
-
}),
|
|
495
|
+
}), W("default", o.value.length - 1), await I(), k.value = !1, u.value = !1;
|
|
499
496
|
}
|
|
500
497
|
}, ke = (a) => {
|
|
501
498
|
if (a.key === "Enter")
|
|
502
499
|
if (a.ctrlKey) {
|
|
503
500
|
a.preventDefault();
|
|
504
|
-
const t = a.target, n = t.selectionStart,
|
|
505
|
-
|
|
506
|
-
` +
|
|
501
|
+
const t = a.target, n = t.selectionStart, S = t.selectionEnd;
|
|
502
|
+
V.value = V.value.substring(0, n) + `
|
|
503
|
+
` + V.value.substring(S), ae(() => {
|
|
507
504
|
t.selectionStart = t.selectionEnd = n + 1;
|
|
508
505
|
});
|
|
509
506
|
} else
|
|
510
507
|
a.preventDefault(), ce();
|
|
511
508
|
}, I = async () => {
|
|
512
|
-
await ae(),
|
|
509
|
+
await ae(), T.value && (T.value.scrollTop = T.value.scrollHeight);
|
|
513
510
|
};
|
|
514
511
|
return re(
|
|
515
|
-
() =>
|
|
512
|
+
() => o.value,
|
|
516
513
|
() => {
|
|
517
514
|
I();
|
|
518
515
|
},
|
|
@@ -524,17 +521,17 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
524
521
|
}
|
|
525
522
|
), c({
|
|
526
523
|
open: () => {
|
|
527
|
-
|
|
524
|
+
N.value = !0, ae(() => {
|
|
528
525
|
I();
|
|
529
526
|
});
|
|
530
527
|
}
|
|
531
528
|
}), (a, t) => {
|
|
532
|
-
const n = Ke,
|
|
533
|
-
return i(), d(
|
|
534
|
-
|
|
529
|
+
const n = Ke, S = ie, z = et, M = Te, h = we, _ = be;
|
|
530
|
+
return i(), d(q, null, [
|
|
531
|
+
C(_, {
|
|
535
532
|
class: "ai-dialog",
|
|
536
|
-
modelValue:
|
|
537
|
-
"onUpdate:modelValue": t[1] || (t[1] = (
|
|
533
|
+
modelValue: N.value,
|
|
534
|
+
"onUpdate:modelValue": t[1] || (t[1] = (E) => N.value = E),
|
|
538
535
|
title: "✨ 品种池参数解析AI助手",
|
|
539
536
|
width: "500px",
|
|
540
537
|
center: "",
|
|
@@ -543,112 +540,115 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
543
540
|
modal: !1,
|
|
544
541
|
"modal-penetrable": !0
|
|
545
542
|
}, {
|
|
546
|
-
default:
|
|
547
|
-
var
|
|
543
|
+
default: P(() => {
|
|
544
|
+
var E;
|
|
548
545
|
return [
|
|
549
|
-
|
|
550
|
-
|
|
546
|
+
r("div", tt, [
|
|
547
|
+
r("div", {
|
|
551
548
|
ref_key: "messageListRef",
|
|
552
|
-
ref:
|
|
549
|
+
ref: T,
|
|
553
550
|
class: "message-list"
|
|
554
551
|
}, [
|
|
555
|
-
(i(!0), d(
|
|
556
|
-
key:
|
|
557
|
-
class:
|
|
552
|
+
(i(!0), d(q, null, ue(o.value, (m, j) => (i(), d("div", {
|
|
553
|
+
key: j,
|
|
554
|
+
class: y([m.role, "message-item"])
|
|
558
555
|
}, [
|
|
559
|
-
m.content ||
|
|
560
|
-
|
|
561
|
-
|
|
556
|
+
m.content || j === o.value.length - 1 && m.role === "assistant" && v.value.length > 0 ? (i(), d(q, { key: 0 }, [
|
|
557
|
+
r("div", st, [
|
|
558
|
+
C(n, {
|
|
562
559
|
size: 32,
|
|
563
560
|
icon: m.role === "user" ? s(He) : s(Le)
|
|
564
561
|
}, null, 8, ["icon"])
|
|
565
562
|
]),
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
(i(!0), d(
|
|
563
|
+
r("div", at, [
|
|
564
|
+
j === o.value.length - 1 && m.role === "assistant" && v.value.length > 0 && !$.value ? (i(), d("div", nt, [
|
|
565
|
+
(i(!0), d(q, null, ue(v.value, (Q) => (i(), d("div", {
|
|
569
566
|
key: Q.name,
|
|
570
567
|
class: "node-progress-item"
|
|
571
568
|
}, [
|
|
572
|
-
|
|
573
|
-
Q.status === "success" ? (i(),
|
|
569
|
+
r("span", ot, [
|
|
570
|
+
Q.status === "success" ? (i(), K(S, {
|
|
574
571
|
key: 0,
|
|
575
572
|
class: "node-icon done"
|
|
576
573
|
}, {
|
|
577
|
-
default:
|
|
578
|
-
|
|
574
|
+
default: P(() => [
|
|
575
|
+
C(s(Be))
|
|
579
576
|
]),
|
|
580
577
|
_: 1
|
|
581
|
-
})) : (i(),
|
|
578
|
+
})) : (i(), K(S, {
|
|
582
579
|
key: 1,
|
|
583
580
|
class: "node-icon running"
|
|
584
581
|
}, {
|
|
585
|
-
default:
|
|
586
|
-
|
|
582
|
+
default: P(() => [
|
|
583
|
+
C(s(Ie))
|
|
587
584
|
]),
|
|
588
585
|
_: 1
|
|
589
586
|
}))
|
|
590
587
|
]),
|
|
591
|
-
|
|
588
|
+
r("span", rt, O(Q.name), 1)
|
|
592
589
|
]))), 128)),
|
|
593
|
-
|
|
594
|
-
|
|
590
|
+
r("div", lt, [
|
|
591
|
+
C(z, {
|
|
595
592
|
percentage: g.value,
|
|
596
593
|
"show-text": !1,
|
|
597
594
|
"stroke-width": 4,
|
|
598
595
|
color: "#667eea"
|
|
599
596
|
}, null, 8, ["percentage"]),
|
|
600
|
-
|
|
597
|
+
r("span", it, "第 " + O(G.value) + "/" + O(e.value) + " 步 · " + O(L.value), 1)
|
|
601
598
|
])
|
|
602
|
-
])) :
|
|
603
|
-
|
|
599
|
+
])) : A("", !0),
|
|
600
|
+
b(m.content) ? (i(), d("div", {
|
|
604
601
|
key: 1,
|
|
605
|
-
class: "message-json",
|
|
602
|
+
class: y(["message-json", { "result-animation": j === o.value.length - 1 && $.value }]),
|
|
606
603
|
innerHTML: he(B(m.content))
|
|
607
|
-
}, null,
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
604
|
+
}, null, 10, ct)) : m.content ? (i(), d("div", {
|
|
605
|
+
key: 2,
|
|
606
|
+
class: y(["message-text", { "result-animation": j === o.value.length - 1 && $.value }])
|
|
607
|
+
}, O(m.content), 3)) : A("", !0),
|
|
608
|
+
r("div", ut, O(m.createTime), 1),
|
|
609
|
+
m.role === "assistant" ? (i(), d(q, { key: 3 }, [
|
|
610
|
+
m.showFeedback && !m.hasFeedback ? (i(), d(q, { key: 0 }, [
|
|
611
|
+
dt,
|
|
612
|
+
r("div", pt, [
|
|
613
|
+
r("button", {
|
|
614
614
|
class: "feedback-btn satisfied-btn",
|
|
615
|
-
onClick: (Q) =>
|
|
616
|
-
},
|
|
617
|
-
|
|
615
|
+
onClick: (Q) => W("satisfied", j)
|
|
616
|
+
}, gt, 8, ft),
|
|
617
|
+
r("button", {
|
|
618
618
|
class: "feedback-btn unsatisfied-btn",
|
|
619
|
-
onClick: (Q) =>
|
|
620
|
-
},
|
|
619
|
+
onClick: (Q) => W("open", j)
|
|
620
|
+
}, yt, 8, ht)
|
|
621
621
|
])
|
|
622
|
-
], 64)) :
|
|
623
|
-
m.showFeedback && m.hasFeedback ? (i(), d("div",
|
|
624
|
-
], 64)) :
|
|
622
|
+
], 64)) : A("", !0),
|
|
623
|
+
m.showFeedback && m.hasFeedback ? (i(), d("div", bt, "感谢您进行的评价反馈")) : A("", !0)
|
|
624
|
+
], 64)) : A("", !0)
|
|
625
625
|
])
|
|
626
|
-
], 64)) :
|
|
626
|
+
], 64)) : A("", !0)
|
|
627
627
|
], 2))), 128)),
|
|
628
|
-
u.value && v.value.length === 0 && !((
|
|
628
|
+
u.value && v.value.length === 0 && !((E = o.value[o.value.length - 1]) != null && E.content) ? (i(), d("div", wt, " 🤔 正在分析您的需求... ")) : A("", !0)
|
|
629
629
|
], 512),
|
|
630
|
-
|
|
631
|
-
|
|
630
|
+
r("div", Tt, [
|
|
631
|
+
C(M, {
|
|
632
632
|
class: "message-input",
|
|
633
|
-
modelValue:
|
|
634
|
-
"onUpdate:modelValue": t[0] || (t[0] = (m) =>
|
|
633
|
+
modelValue: V.value,
|
|
634
|
+
"onUpdate:modelValue": t[0] || (t[0] = (m) => V.value = m),
|
|
635
635
|
type: "textarea",
|
|
636
636
|
rows: 4,
|
|
637
637
|
autosize: { minRows: 2, maxRows: 4 },
|
|
638
638
|
placeholder: "输入您想查询的品种条件...",
|
|
639
639
|
onKeydown: ke
|
|
640
640
|
}, null, 8, ["modelValue"]),
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
641
|
+
r("div", St, [
|
|
642
|
+
Ct,
|
|
643
|
+
C(h, {
|
|
644
644
|
class: "send-btn",
|
|
645
645
|
type: "primary",
|
|
646
|
-
icon: s(
|
|
646
|
+
icon: s(ze),
|
|
647
647
|
loading: k.value,
|
|
648
648
|
onClick: ce,
|
|
649
649
|
round: ""
|
|
650
650
|
}, {
|
|
651
|
-
default:
|
|
651
|
+
default: P(() => [
|
|
652
652
|
ne(" 发送 ")
|
|
653
653
|
]),
|
|
654
654
|
_: 1
|
|
@@ -660,40 +660,40 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
660
660
|
}),
|
|
661
661
|
_: 1
|
|
662
662
|
}, 8, ["modelValue"]),
|
|
663
|
-
|
|
663
|
+
C(_, {
|
|
664
664
|
modelValue: Y.value,
|
|
665
|
-
"onUpdate:modelValue": t[5] || (t[5] = (
|
|
665
|
+
"onUpdate:modelValue": t[5] || (t[5] = (E) => Y.value = E),
|
|
666
666
|
title: "📝 反馈意见",
|
|
667
667
|
width: "400px"
|
|
668
668
|
}, {
|
|
669
|
-
footer:
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
onClick: t[3] || (t[3] = (
|
|
669
|
+
footer: P(() => [
|
|
670
|
+
r("span", Dt, [
|
|
671
|
+
C(h, {
|
|
672
|
+
onClick: t[3] || (t[3] = (E) => Y.value = !1)
|
|
673
673
|
}, {
|
|
674
|
-
default:
|
|
674
|
+
default: P(() => [
|
|
675
675
|
ne("取消")
|
|
676
676
|
]),
|
|
677
677
|
_: 1
|
|
678
678
|
}),
|
|
679
|
-
|
|
679
|
+
C(h, {
|
|
680
680
|
type: "primary",
|
|
681
|
-
onClick: t[4] || (t[4] = (
|
|
681
|
+
onClick: t[4] || (t[4] = (E) => W("unsatisfied", Z.value))
|
|
682
682
|
}, {
|
|
683
|
-
default:
|
|
683
|
+
default: P(() => [
|
|
684
684
|
ne("提交反馈")
|
|
685
685
|
]),
|
|
686
686
|
_: 1
|
|
687
687
|
})
|
|
688
688
|
])
|
|
689
689
|
]),
|
|
690
|
-
default:
|
|
691
|
-
|
|
690
|
+
default: P(() => [
|
|
691
|
+
r("div", $t, [
|
|
692
|
+
Et,
|
|
692
693
|
Pt,
|
|
693
|
-
|
|
694
|
-
S(V, {
|
|
694
|
+
C(M, {
|
|
695
695
|
modelValue: H.value,
|
|
696
|
-
"onUpdate:modelValue": t[2] || (t[2] = (
|
|
696
|
+
"onUpdate:modelValue": t[2] || (t[2] = (E) => H.value = E),
|
|
697
697
|
type: "textarea",
|
|
698
698
|
rows: 4,
|
|
699
699
|
placeholder: "[非必填]例如:回答不够准确、查询结果有误、界面体验不佳..."
|
|
@@ -705,11 +705,11 @@ const R = (p) => ($e("data-v-6c033243"), p = p(), Ee(), p), tt = { class: "ai-di
|
|
|
705
705
|
], 64);
|
|
706
706
|
};
|
|
707
707
|
}
|
|
708
|
-
},
|
|
708
|
+
}, Nt = /* @__PURE__ */ xe(Ft, [["__scopeId", "data-v-8e2737b7"]]), as = {
|
|
709
709
|
install(p) {
|
|
710
|
-
p.component("st-varietyAiHelper",
|
|
710
|
+
p.component("st-varietyAiHelper", Nt);
|
|
711
711
|
}
|
|
712
712
|
};
|
|
713
713
|
export {
|
|
714
|
-
|
|
714
|
+
as as default
|
|
715
715
|
};
|