wi-chat 0.5.0 → 0.6.0
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/dist/core/index.cjs +1 -1
- package/dist/core/index.js +34 -34
- package/dist/core/useChat.d.ts +6 -6
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +99 -94
- package/dist/mobile-ui/index.cjs +1 -1
- package/dist/mobile-ui/index.d.ts +1 -1
- package/dist/mobile-ui/index.js +88 -81
- package/dist/mobile-ui/style.css +1 -1
- package/dist/parser/answerCom/actionExecute/actionProtocol.d.ts +27 -0
- package/dist/parser/answerCom/actionExecute/parseAgentAction.d.ts +25 -0
- package/dist/parser/answerCom/actionExecute/parseCollectClarifications.d.ts +26 -0
- package/dist/parser/answerCom/actionExecute/reply.d.ts +17 -0
- package/dist/parser/answerCom/actionExecute/types.d.ts +26 -5
- package/dist/parser/index.cjs +2 -2
- package/dist/parser/index.d.ts +7 -5
- package/dist/parser/index.js +360 -294
- package/dist/parser/registry.d.ts +5 -5
- package/dist/renderers/agentAction/AgentActionStatus.vue.d.ts +19 -0
- package/dist/renderers/index.cjs +1 -1
- package/dist/renderers/index.d.ts +1 -0
- package/dist/renderers/index.js +523 -477
- package/dist/renderers/style.css +1 -1
- package/dist/tools/index.cjs +4 -4
- package/dist/tools/index.js +176 -161
- package/dist/tools/useAutoScroll.d.ts +11 -3
- package/dist/web-ui/index.cjs +1 -1
- package/dist/web-ui/index.d.ts +1 -1
- package/dist/web-ui/index.js +309 -303
- package/dist/web-ui/style.css +1 -1
- package/package.json +1 -1
- package/dist/parser/answerCom/actionExecute/parseActionExecute.d.ts +0 -28
package/dist/web-ui/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createAnswerContentMap as re, provideOutputFileConfig as de, DeepThinkingSteps as ce, AiAnswerBubble as ue } from "wi-chat/renderers";
|
|
2
|
-
import { AiAnswerBubble as
|
|
3
|
-
import { defineComponent as D, computed as
|
|
2
|
+
import { AgentActionStatus as Es, AiAnswerBubble as xs, ClarificationCard as Os, DeepThinkingSteps as Ds, IframePage as Qs, KnowledgeStreamResult as Ns, OutputFile as js, createAnswerContentMap as Hs, injectIframeResizerChild as Ws, provideIframePageConfig as qs, provideOutputFileConfig as Ks, resolveIframePlaceholders as Ys, useIframePage as Xs } from "wi-chat/renderers";
|
|
3
|
+
import { defineComponent as D, computed as k, openBlock as s, createElementBlock as n, normalizeClass as z, createElementVNode as t, renderSlot as S, createBlock as V, unref as I, withModifiers as te, withCtx as $, createTextVNode as O, toDisplayString as A, createCommentVNode as g, createStaticVNode as le, pushScopeId as q, popScopeId as K, Fragment as P, renderList as j, normalizeProps as Z, guardReactiveProps as G, ref as x, onBeforeUnmount as pe, createVNode as L, withKeys as he, defineAsyncComponent as _e, watch as se, Transition as ve, resolveComponent as J, normalizeStyle as we } from "vue";
|
|
4
4
|
import { ElImage as me, ElPopover as be, ElCheckbox as fe, ElInput as ge, ElTooltip as ee } from "element-plus";
|
|
5
5
|
import { isImageAttachment as ye, resolveAttachPreviewUrl as ke, normalizeAttachment as $e, resolveRemoteFileUrl as Ce, parseRealtimeAttachment as Ue } from "wi-chat/parser";
|
|
6
6
|
import { downloadAttachment as Ae, useAutoScroll as Be } from "wi-chat/tools";
|
|
7
|
-
const H = (
|
|
7
|
+
const H = (p) => (q("data-v-dc2d5f2b"), p = p(), K(), p), Ie = { class: "wi-web-attach-card__icon" }, Fe = /* @__PURE__ */ H(() => /* @__PURE__ */ t("div", { class: "wi-web-attach-card__image-fallback" }, [
|
|
8
8
|
/* @__PURE__ */ t("svg", {
|
|
9
9
|
viewBox: "0 0 24 24",
|
|
10
10
|
width: "16",
|
|
@@ -60,7 +60,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
60
60
|
fill: "none",
|
|
61
61
|
stroke: "currentColor",
|
|
62
62
|
"stroke-width": "2"
|
|
63
|
-
}, Ve = /* @__PURE__ */
|
|
63
|
+
}, Ve = /* @__PURE__ */ le('<rect x="3" y="3" width="18" height="18" rx="2" data-v-dc2d5f2b></rect><path d="M3 9h18" data-v-dc2d5f2b></path><path d="M3 15h18" data-v-dc2d5f2b></path><path d="M9 3v18" data-v-dc2d5f2b></path><path d="M15 3v18" data-v-dc2d5f2b></path>', 5), Le = [
|
|
64
64
|
Ve
|
|
65
65
|
], Te = {
|
|
66
66
|
key: 2,
|
|
@@ -82,7 +82,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
82
82
|
fill: "none",
|
|
83
83
|
stroke: "currentColor",
|
|
84
84
|
"stroke-width": "2"
|
|
85
|
-
}, Oe = /* @__PURE__ */
|
|
85
|
+
}, Oe = /* @__PURE__ */ le('<path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" data-v-dc2d5f2b></path><polyline points="14 2 14 8 20 8" data-v-dc2d5f2b></polyline><line x1="16" y1="13" x2="8" y2="13" data-v-dc2d5f2b></line><line x1="16" y1="17" x2="8" y2="17" data-v-dc2d5f2b></line><polyline points="10 9 9 9 8 9" data-v-dc2d5f2b></polyline>', 5), De = [
|
|
86
86
|
Oe
|
|
87
87
|
], Qe = { class: "wi-web-attach-card__info" }, Ne = ["title"], je = {
|
|
88
88
|
key: 0,
|
|
@@ -116,54 +116,54 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
116
116
|
getFileUrl: { type: Function, default: void 0 }
|
|
117
117
|
},
|
|
118
118
|
emits: ["click", "remove", "download"],
|
|
119
|
-
setup(
|
|
120
|
-
const
|
|
119
|
+
setup(p, { emit: C }) {
|
|
120
|
+
const i = p, r = C, _ = k(() => {
|
|
121
121
|
var o;
|
|
122
|
-
return ((o =
|
|
123
|
-
}),
|
|
124
|
-
if (
|
|
122
|
+
return ((o = i.item) == null ? void 0 : o.attachContent) || {};
|
|
123
|
+
}), m = k(() => ye(i.item)), b = k(() => ke(i.item, i.baseURL, i.getFileUrl)), a = k(() => {
|
|
124
|
+
if (i.removable)
|
|
125
125
|
return !1;
|
|
126
|
-
if (
|
|
127
|
-
return
|
|
128
|
-
if (
|
|
126
|
+
if (i.downloadable !== void 0)
|
|
127
|
+
return i.downloadable;
|
|
128
|
+
if (i.item.type && i.item.type !== "file")
|
|
129
129
|
return !1;
|
|
130
|
-
const o =
|
|
130
|
+
const o = _.value;
|
|
131
131
|
return !!(o.fileId || o.raw);
|
|
132
|
-
}),
|
|
133
|
-
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
baseURL:
|
|
139
|
-
getFileUrl:
|
|
132
|
+
}), u = () => {
|
|
133
|
+
r("click", i.item);
|
|
134
|
+
}, d = () => {
|
|
135
|
+
r("remove", i.item);
|
|
136
|
+
}, h = async () => {
|
|
137
|
+
r("download", i.item), await Ae(i.item, {
|
|
138
|
+
baseURL: i.baseURL,
|
|
139
|
+
getFileUrl: i.getFileUrl
|
|
140
140
|
});
|
|
141
141
|
};
|
|
142
|
-
return (o,
|
|
142
|
+
return (o, l) => (s(), n("div", {
|
|
143
143
|
class: z(["wi-web-attach-card", { "is-clickable": o.clickable || !!o.$attrs.onClick }]),
|
|
144
|
-
onClick:
|
|
144
|
+
onClick: u
|
|
145
145
|
}, [
|
|
146
146
|
t("div", Ie, [
|
|
147
147
|
S(o.$slots, "icon", { item: o.item }, () => [
|
|
148
|
-
|
|
148
|
+
m.value && b.value ? (s(), V(I(me), {
|
|
149
149
|
key: 0,
|
|
150
|
-
src:
|
|
151
|
-
"preview-src-list": [
|
|
150
|
+
src: b.value,
|
|
151
|
+
"preview-src-list": [b.value],
|
|
152
152
|
"zoom-rate": 1.2,
|
|
153
153
|
"preview-teleported": "",
|
|
154
154
|
fit: "cover",
|
|
155
155
|
class: "wi-web-attach-card__image",
|
|
156
|
-
onClick:
|
|
156
|
+
onClick: l[0] || (l[0] = te(() => {
|
|
157
157
|
}, ["stop"]))
|
|
158
158
|
}, {
|
|
159
|
-
placeholder:
|
|
159
|
+
placeholder: $(() => [
|
|
160
160
|
Fe
|
|
161
161
|
]),
|
|
162
|
-
error:
|
|
162
|
+
error: $(() => [
|
|
163
163
|
Re
|
|
164
164
|
]),
|
|
165
165
|
_: 1
|
|
166
|
-
}, 8, ["src", "preview-src-list"])) : o.item.type === "table" ? (s(),
|
|
166
|
+
}, 8, ["src", "preview-src-list"])) : o.item.type === "table" ? (s(), n("svg", Se, Le)) : o.item.type === "metric" ? (s(), n("svg", Te, Ee)) : (s(), n("svg", xe, De))
|
|
167
167
|
], !0)
|
|
168
168
|
]),
|
|
169
169
|
t("div", Qe, [
|
|
@@ -175,7 +175,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
175
175
|
O(A(o.item.name), 1)
|
|
176
176
|
], !0)
|
|
177
177
|
], 8, Ne),
|
|
178
|
-
o.item.description || o.$slots.description ? (s(),
|
|
178
|
+
o.item.description || o.$slots.description ? (s(), n("div", je, [
|
|
179
179
|
S(o.$slots, "description", { item: o.item }, () => [
|
|
180
180
|
O(A(o.item.description), 1)
|
|
181
181
|
], !0)
|
|
@@ -183,29 +183,29 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
183
183
|
]),
|
|
184
184
|
t("div", He, [
|
|
185
185
|
S(o.$slots, "actions", { item: o.item }, () => [
|
|
186
|
-
a.value ? (s(),
|
|
186
|
+
a.value ? (s(), n("button", {
|
|
187
187
|
key: 0,
|
|
188
188
|
type: "button",
|
|
189
189
|
class: "wi-web-attach-card__action-btn wi-web-attach-card__download",
|
|
190
190
|
title: "下载附件",
|
|
191
|
-
onClick: te(
|
|
191
|
+
onClick: te(h, ["stop"])
|
|
192
192
|
}, qe)) : g("", !0),
|
|
193
|
-
o.removable ? (s(),
|
|
193
|
+
o.removable ? (s(), n("button", {
|
|
194
194
|
key: 1,
|
|
195
195
|
type: "button",
|
|
196
196
|
class: "wi-web-attach-card__action-btn wi-web-attach-card__delete",
|
|
197
197
|
title: "删除附件",
|
|
198
|
-
onClick: te(
|
|
198
|
+
onClick: te(d, ["stop"])
|
|
199
199
|
}, " × ")) : g("", !0)
|
|
200
200
|
], !0)
|
|
201
201
|
])
|
|
202
202
|
], 2));
|
|
203
203
|
}
|
|
204
|
-
}), Q = (
|
|
205
|
-
const
|
|
206
|
-
for (const [
|
|
207
|
-
|
|
208
|
-
return
|
|
204
|
+
}), Q = (p, C) => {
|
|
205
|
+
const i = p.__vccOpts || p;
|
|
206
|
+
for (const [r, _] of C)
|
|
207
|
+
i[r] = _;
|
|
208
|
+
return i;
|
|
209
209
|
}, Ye = /* @__PURE__ */ Q(Ke, [["__scopeId", "data-v-dc2d5f2b"]]), Xe = {
|
|
210
210
|
key: 0,
|
|
211
211
|
class: "wi-web-attachment-list"
|
|
@@ -220,57 +220,57 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
220
220
|
getFileUrl: { type: Function, default: void 0 }
|
|
221
221
|
},
|
|
222
222
|
emits: ["remove", "click", "download"],
|
|
223
|
-
setup(
|
|
224
|
-
const
|
|
225
|
-
var
|
|
226
|
-
const o = $e(
|
|
223
|
+
setup(p, { emit: C }) {
|
|
224
|
+
const i = p, r = C, _ = k(() => (i.items || []).map((d, h) => {
|
|
225
|
+
var c, f;
|
|
226
|
+
const o = $e(d), l = (c = o.attachContent) == null ? void 0 : c.raw, U = ((f = o.attachContent) == null ? void 0 : f.fileId) || (l ? `${l.name}_${l.size}_${h}` : `${o.name}_${h}`);
|
|
227
227
|
return {
|
|
228
228
|
...o,
|
|
229
|
-
key:
|
|
229
|
+
key: U
|
|
230
230
|
};
|
|
231
|
-
})),
|
|
232
|
-
|
|
233
|
-
},
|
|
234
|
-
|
|
235
|
-
}, a = (
|
|
236
|
-
|
|
231
|
+
})), m = (u, d) => {
|
|
232
|
+
r("remove", u, d);
|
|
233
|
+
}, b = (u, d) => {
|
|
234
|
+
r("click", u, d);
|
|
235
|
+
}, a = (u, d) => {
|
|
236
|
+
r("download", u, d);
|
|
237
237
|
};
|
|
238
|
-
return (
|
|
239
|
-
(s(!0),
|
|
240
|
-
key:
|
|
241
|
-
item:
|
|
242
|
-
removable:
|
|
243
|
-
downloadable:
|
|
244
|
-
clickable:
|
|
245
|
-
"base-u-r-l":
|
|
246
|
-
"get-file-url":
|
|
247
|
-
onClick: (
|
|
248
|
-
onRemove: (
|
|
249
|
-
onDownload: (
|
|
238
|
+
return (u, d) => _.value.length > 0 ? (s(), n("div", Xe, [
|
|
239
|
+
(s(!0), n(P, null, j(_.value, (h, o) => (s(), V(Ye, {
|
|
240
|
+
key: h.key || o,
|
|
241
|
+
item: h,
|
|
242
|
+
removable: u.removable,
|
|
243
|
+
downloadable: u.downloadable,
|
|
244
|
+
clickable: u.clickable || !!u.$attrs.onClick,
|
|
245
|
+
"base-u-r-l": u.baseURL,
|
|
246
|
+
"get-file-url": u.getFileUrl,
|
|
247
|
+
onClick: (l) => b(h, o),
|
|
248
|
+
onRemove: (l) => m(o, h),
|
|
249
|
+
onDownload: (l) => a(h, o)
|
|
250
250
|
}, {
|
|
251
|
-
icon:
|
|
252
|
-
S(
|
|
251
|
+
icon: $((l) => [
|
|
252
|
+
S(u.$slots, "icon", Z(G(l)), void 0, !0)
|
|
253
253
|
]),
|
|
254
|
-
title:
|
|
255
|
-
S(
|
|
254
|
+
title: $((l) => [
|
|
255
|
+
S(u.$slots, "title", Z(G(l)), void 0, !0)
|
|
256
256
|
]),
|
|
257
|
-
description:
|
|
258
|
-
S(
|
|
257
|
+
description: $((l) => [
|
|
258
|
+
S(u.$slots, "description", Z(G(l)), void 0, !0)
|
|
259
259
|
]),
|
|
260
|
-
actions:
|
|
261
|
-
S(
|
|
260
|
+
actions: $((l) => [
|
|
261
|
+
S(u.$slots, "actions", Z(G(l)), void 0, !0)
|
|
262
262
|
]),
|
|
263
263
|
_: 2
|
|
264
264
|
}, 1032, ["item", "removable", "downloadable", "clickable", "base-u-r-l", "get-file-url", "onClick", "onRemove", "onDownload"]))), 128))
|
|
265
265
|
])) : g("", !0);
|
|
266
266
|
}
|
|
267
|
-
}), ne = /* @__PURE__ */ Q(Ze, [["__scopeId", "data-v-ff76d134"]]), T = (
|
|
267
|
+
}), ne = /* @__PURE__ */ Q(Ze, [["__scopeId", "data-v-ff76d134"]]), T = (p) => (q("data-v-c6f1253a"), p = p(), K(), p), Ge = { class: "wi-web-inputbox" }, Je = {
|
|
268
268
|
key: 0,
|
|
269
269
|
class: "wi-web-inputbox__top-bar"
|
|
270
270
|
}, et = {
|
|
271
271
|
key: 0,
|
|
272
272
|
class: "wi-web-inputbox__agent-bar"
|
|
273
|
-
}, tt = { class: "wi-web-inputbox__agent-icon-wrapper" },
|
|
273
|
+
}, tt = { class: "wi-web-inputbox__agent-icon-wrapper" }, st = ["src"], ot = {
|
|
274
274
|
key: 1,
|
|
275
275
|
class: "wi-web-inputbox__agent-svg",
|
|
276
276
|
viewBox: "0 0 24 24",
|
|
@@ -387,77 +387,77 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
387
387
|
showIncPrevQuestion: { type: Boolean, default: !0 }
|
|
388
388
|
},
|
|
389
389
|
emits: ["update:modelValue", "submit", "stop", "selectAgent", "update:files", "update:attachments", "update:incPrevQuestion"],
|
|
390
|
-
setup(
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
},
|
|
394
|
-
|
|
395
|
-
},
|
|
396
|
-
|
|
397
|
-
},
|
|
398
|
-
|
|
390
|
+
setup(p, { expose: C, emit: i }) {
|
|
391
|
+
const r = p, _ = i, m = x(null), b = x(null), a = x(!1), u = (e) => Ue(e), d = x([]), h = k(() => !!!(r.modelValue && r.modelValue.trim())), o = (e) => e ? r.getFileUrl ? r.getFileUrl(e) : Ce(e, r.baseURL, "/algorithm/get_file_data") : "", l = (e) => {
|
|
392
|
+
_("selectAgent", e), a.value = !1;
|
|
393
|
+
}, U = (e) => {
|
|
394
|
+
_("update:incPrevQuestion", e ? "N" : "Y");
|
|
395
|
+
}, c = () => {
|
|
396
|
+
_("update:modelValue", "");
|
|
397
|
+
}, f = () => {
|
|
398
|
+
b.value && (b.value.value = "", b.value.click());
|
|
399
399
|
}, B = (e) => {
|
|
400
400
|
const w = e.target;
|
|
401
401
|
if (w.files && w.files.length > 0) {
|
|
402
402
|
const v = Array.from(w.files);
|
|
403
|
-
for (const
|
|
404
|
-
|
|
405
|
-
var
|
|
406
|
-
const X = ((
|
|
407
|
-
return X && X.name ===
|
|
408
|
-
}) ||
|
|
409
|
-
const R =
|
|
403
|
+
for (const y of v)
|
|
404
|
+
d.value.some((W) => {
|
|
405
|
+
var ae;
|
|
406
|
+
const X = ((ae = W.attachContent) == null ? void 0 : ae.raw) || W.raw;
|
|
407
|
+
return X && X.name === y.name && X.size === y.size && X.lastModified === y.lastModified;
|
|
408
|
+
}) || d.value.push(u(y));
|
|
409
|
+
const R = d.value.map((y) => {
|
|
410
410
|
var E;
|
|
411
|
-
return ((E =
|
|
411
|
+
return ((E = y.attachContent) == null ? void 0 : E.raw) || y.raw;
|
|
412
412
|
}).filter(Boolean);
|
|
413
|
-
|
|
413
|
+
_("update:files", R), _("update:attachments", [...d.value]);
|
|
414
414
|
}
|
|
415
415
|
}, M = (e) => {
|
|
416
|
-
var
|
|
417
|
-
const w =
|
|
416
|
+
var y;
|
|
417
|
+
const w = d.value.splice(e, 1)[0], v = ((y = w == null ? void 0 : w.attachContent) == null ? void 0 : y.url) || (w == null ? void 0 : w.url);
|
|
418
418
|
v && v.startsWith("blob:") && URL.revokeObjectURL(v);
|
|
419
|
-
const R =
|
|
419
|
+
const R = d.value.map((E) => {
|
|
420
420
|
var W;
|
|
421
421
|
return ((W = E.attachContent) == null ? void 0 : W.raw) || E.raw;
|
|
422
422
|
}).filter(Boolean);
|
|
423
|
-
|
|
423
|
+
_("update:files", R), _("update:attachments", [...d.value]);
|
|
424
424
|
}, N = () => {
|
|
425
|
-
|
|
425
|
+
d.value.forEach((e) => {
|
|
426
426
|
var v;
|
|
427
427
|
const w = ((v = e == null ? void 0 : e.attachContent) == null ? void 0 : v.url) || (e == null ? void 0 : e.url);
|
|
428
428
|
w && w.startsWith("blob:") && URL.revokeObjectURL(w);
|
|
429
|
-
}),
|
|
429
|
+
}), d.value = [], _("update:files", []), _("update:attachments", []);
|
|
430
430
|
}, Y = () => {
|
|
431
|
-
if (
|
|
431
|
+
if (r.disabled || h.value)
|
|
432
432
|
return;
|
|
433
|
-
const e =
|
|
434
|
-
var
|
|
435
|
-
return ((
|
|
436
|
-
}).filter(Boolean), v = [...
|
|
437
|
-
|
|
433
|
+
const e = r.modelValue || "", w = d.value.map((R) => {
|
|
434
|
+
var y;
|
|
435
|
+
return ((y = R.attachContent) == null ? void 0 : y.raw) || R.raw;
|
|
436
|
+
}).filter(Boolean), v = [...d.value];
|
|
437
|
+
_("submit", { text: e, files: w, attachments: v, agent: r.currentAgent }), d.value = [], _("update:files", []), _("update:attachments", []);
|
|
438
438
|
}, F = (e) => {
|
|
439
439
|
e.isComposing || e.keyCode === 229 || (e.preventDefault(), Y());
|
|
440
440
|
};
|
|
441
441
|
return pe(() => {
|
|
442
442
|
N();
|
|
443
|
-
}),
|
|
443
|
+
}), C({
|
|
444
444
|
/** 手动清空所有附件 */
|
|
445
445
|
clearFiles: N,
|
|
446
446
|
/** 获取当前附件原生 File 列表 */
|
|
447
|
-
getFiles: () =>
|
|
447
|
+
getFiles: () => d.value.map((e) => {
|
|
448
448
|
var w;
|
|
449
449
|
return ((w = e.attachContent) == null ? void 0 : w.raw) || e.raw;
|
|
450
450
|
}).filter(Boolean),
|
|
451
451
|
/** 获取当前附件标准化对象列表 */
|
|
452
|
-
getAttachments: () =>
|
|
452
|
+
getAttachments: () => d.value,
|
|
453
453
|
/** 聚焦输入框 */
|
|
454
454
|
focus: () => {
|
|
455
455
|
var e;
|
|
456
|
-
(e =
|
|
456
|
+
(e = m.value) == null || e.focus();
|
|
457
457
|
}
|
|
458
|
-
}), (e, w) => (s(),
|
|
459
|
-
e.showAgentBar || e.showIncPrevQuestion ? (s(),
|
|
460
|
-
e.showAgentBar ? (s(),
|
|
458
|
+
}), (e, w) => (s(), n("div", Ge, [
|
|
459
|
+
e.showAgentBar || e.showIncPrevQuestion ? (s(), n("div", Je, [
|
|
460
|
+
e.showAgentBar ? (s(), n("div", et, [
|
|
461
461
|
L(I(be), {
|
|
462
462
|
visible: a.value,
|
|
463
463
|
"onUpdate:visible": w[0] || (w[0] = (v) => a.value = v),
|
|
@@ -466,21 +466,21 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
466
466
|
trigger: "click",
|
|
467
467
|
"popper-class": "wi-web-agent-popover"
|
|
468
468
|
}, {
|
|
469
|
-
reference:
|
|
470
|
-
var v, R,
|
|
469
|
+
reference: $(() => {
|
|
470
|
+
var v, R, y;
|
|
471
471
|
return [
|
|
472
472
|
t("div", {
|
|
473
473
|
class: z(["wi-web-inputbox__agent-btn", { "is-disabled": e.disabled || e.talking }])
|
|
474
474
|
}, [
|
|
475
475
|
t("div", tt, [
|
|
476
|
-
(v = e.currentAgent) != null && v.image_id && o(e.currentAgent.image_id) ? (s(),
|
|
476
|
+
(v = e.currentAgent) != null && v.image_id && o(e.currentAgent.image_id) ? (s(), n("img", {
|
|
477
477
|
key: 0,
|
|
478
478
|
src: o(e.currentAgent.image_id),
|
|
479
479
|
class: "wi-web-inputbox__agent-avatar"
|
|
480
|
-
}, null, 8,
|
|
480
|
+
}, null, 8, st)) : (s(), n("svg", ot, nt))
|
|
481
481
|
]),
|
|
482
|
-
t("span", it, " @" + A(((R = e.currentAgent) == null ? void 0 : R.entry_title) || ((
|
|
483
|
-
(s(),
|
|
482
|
+
t("span", it, " @" + A(((R = e.currentAgent) == null ? void 0 : R.entry_title) || ((y = e.currentAgent) == null ? void 0 : y.entry_id) || e.defaultAgentTitle), 1),
|
|
483
|
+
(s(), n("svg", {
|
|
484
484
|
class: z(["wi-web-inputbox__agent-arrow", { "is-active": a.value }]),
|
|
485
485
|
viewBox: "0 0 1024 1024",
|
|
486
486
|
width: "12",
|
|
@@ -489,26 +489,26 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
489
489
|
], 2)
|
|
490
490
|
];
|
|
491
491
|
}),
|
|
492
|
-
default:
|
|
492
|
+
default: $(() => [
|
|
493
493
|
t("div", ct, [
|
|
494
494
|
ut,
|
|
495
|
-
!e.agentList || e.agentList.length === 0 ? (s(),
|
|
496
|
-
(s(!0),
|
|
497
|
-
var R,
|
|
498
|
-
return s(),
|
|
495
|
+
!e.agentList || e.agentList.length === 0 ? (s(), n("div", pt, " 暂无可选智能体 ")) : g("", !0),
|
|
496
|
+
(s(!0), n(P, null, j(e.agentList, (v) => {
|
|
497
|
+
var R, y;
|
|
498
|
+
return s(), n("div", {
|
|
499
499
|
key: v.entry_id,
|
|
500
500
|
class: z(["wi-web-agent-item", { "is-active": v.entry_id === ((R = e.currentAgent) == null ? void 0 : R.entry_id) }]),
|
|
501
|
-
onClick: (E) =>
|
|
501
|
+
onClick: (E) => l(v)
|
|
502
502
|
}, [
|
|
503
503
|
t("div", _t, [
|
|
504
|
-
v.image_id && o(v.image_id) ? (s(),
|
|
504
|
+
v.image_id && o(v.image_id) ? (s(), n("img", {
|
|
505
505
|
key: 0,
|
|
506
506
|
src: o(v.image_id),
|
|
507
507
|
class: "wi-web-agent-item__avatar"
|
|
508
|
-
}, null, 8, vt)) : (s(),
|
|
508
|
+
}, null, 8, vt)) : (s(), n("div", wt, bt)),
|
|
509
509
|
t("span", ft, A(v.entry_title || v.entry_id), 1)
|
|
510
510
|
]),
|
|
511
|
-
v.entry_id === ((
|
|
511
|
+
v.entry_id === ((y = e.currentAgent) == null ? void 0 : y.entry_id) ? (s(), n("span", gt, "✓")) : g("", !0)
|
|
512
512
|
], 10, ht);
|
|
513
513
|
}), 128))
|
|
514
514
|
])
|
|
@@ -516,13 +516,13 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
516
516
|
_: 1
|
|
517
517
|
}, 8, ["visible"])
|
|
518
518
|
])) : g("", !0),
|
|
519
|
-
e.showIncPrevQuestion ? (s(),
|
|
519
|
+
e.showIncPrevQuestion ? (s(), n("div", yt, [
|
|
520
520
|
L(I(fe), {
|
|
521
521
|
class: "wi-web-inputbox__ignore-prev",
|
|
522
522
|
"model-value": e.incPrevQuestion === "N",
|
|
523
|
-
"onUpdate:modelValue":
|
|
523
|
+
"onUpdate:modelValue": U
|
|
524
524
|
}, {
|
|
525
|
-
default:
|
|
525
|
+
default: $(() => [
|
|
526
526
|
O(" 忽略之前对话 ")
|
|
527
527
|
]),
|
|
528
528
|
_: 1
|
|
@@ -530,9 +530,9 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
530
530
|
])) : g("", !0)
|
|
531
531
|
])) : g("", !0),
|
|
532
532
|
t("div", kt, [
|
|
533
|
-
|
|
533
|
+
d.value.length > 0 ? (s(), n("div", $t, [
|
|
534
534
|
L(ne, {
|
|
535
|
-
items:
|
|
535
|
+
items: d.value,
|
|
536
536
|
"base-u-r-l": e.baseURL,
|
|
537
537
|
"get-file-url": e.getFileUrl,
|
|
538
538
|
removable: "",
|
|
@@ -541,7 +541,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
541
541
|
])) : g("", !0),
|
|
542
542
|
L(I(ge), {
|
|
543
543
|
ref_key: "textareaRef",
|
|
544
|
-
ref:
|
|
544
|
+
ref: m,
|
|
545
545
|
"model-value": e.modelValue,
|
|
546
546
|
type: "textarea",
|
|
547
547
|
resize: "none",
|
|
@@ -550,7 +550,7 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
550
550
|
placeholder: e.placeholder,
|
|
551
551
|
disabled: e.disabled || e.talking,
|
|
552
552
|
class: "wi-web-inputbox__textarea",
|
|
553
|
-
"onUpdate:modelValue": w[1] || (w[1] = (v) =>
|
|
553
|
+
"onUpdate:modelValue": w[1] || (w[1] = (v) => _("update:modelValue", v)),
|
|
554
554
|
onKeydown: he(te(F, ["exact"]), ["enter"])
|
|
555
555
|
}, null, 8, ["model-value", "maxlength", "autosize", "placeholder", "disabled", "onKeydown"]),
|
|
556
556
|
t("div", Ct, [
|
|
@@ -558,9 +558,9 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
558
558
|
S(e.$slots, "footer-left", {}, void 0, !0)
|
|
559
559
|
]),
|
|
560
560
|
t("div", At, [
|
|
561
|
-
e.showWordLimit ? (s(),
|
|
561
|
+
e.showWordLimit ? (s(), n("div", Bt, [
|
|
562
562
|
O(A((e.modelValue || "").length), 1),
|
|
563
|
-
e.maxlength ? (s(),
|
|
563
|
+
e.maxlength ? (s(), n(P, { key: 0 }, [
|
|
564
564
|
O("/" + A(e.maxlength), 1)
|
|
565
565
|
], 64)) : g("", !0)
|
|
566
566
|
])) : g("", !0),
|
|
@@ -569,11 +569,11 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
569
569
|
content: "清除",
|
|
570
570
|
placement: "top"
|
|
571
571
|
}, {
|
|
572
|
-
default:
|
|
572
|
+
default: $(() => [
|
|
573
573
|
t("button", {
|
|
574
574
|
type: "button",
|
|
575
575
|
class: "wi-web-inputbox__icon-btn",
|
|
576
|
-
onClick:
|
|
576
|
+
onClick: c
|
|
577
577
|
}, Ft)
|
|
578
578
|
]),
|
|
579
579
|
_: 1
|
|
@@ -583,19 +583,19 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
583
583
|
content: "上传附件",
|
|
584
584
|
placement: "top"
|
|
585
585
|
}, {
|
|
586
|
-
default:
|
|
586
|
+
default: $(() => [
|
|
587
587
|
t("button", {
|
|
588
588
|
type: "button",
|
|
589
589
|
class: "wi-web-inputbox__icon-btn",
|
|
590
590
|
disabled: e.disabled || e.talking,
|
|
591
|
-
onClick:
|
|
591
|
+
onClick: f
|
|
592
592
|
}, Vt, 8, Rt)
|
|
593
593
|
]),
|
|
594
594
|
_: 1
|
|
595
595
|
})) : g("", !0),
|
|
596
596
|
t("input", {
|
|
597
597
|
ref_key: "fileInputRef",
|
|
598
|
-
ref:
|
|
598
|
+
ref: b,
|
|
599
599
|
type: "file",
|
|
600
600
|
multiple: "",
|
|
601
601
|
accept: e.accept,
|
|
@@ -608,10 +608,10 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
608
608
|
content: "停止生成",
|
|
609
609
|
placement: "top"
|
|
610
610
|
}, {
|
|
611
|
-
default:
|
|
611
|
+
default: $(() => [
|
|
612
612
|
t("div", {
|
|
613
613
|
class: "wi-web-inputbox__action-btn wi-web-inputbox__action-btn--stop",
|
|
614
|
-
onClick: w[2] || (w[2] = (v) =>
|
|
614
|
+
onClick: w[2] || (w[2] = (v) => _("stop"))
|
|
615
615
|
}, zt)
|
|
616
616
|
]),
|
|
617
617
|
_: 1
|
|
@@ -620,9 +620,9 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
620
620
|
content: "发送",
|
|
621
621
|
placement: "top"
|
|
622
622
|
}, {
|
|
623
|
-
default:
|
|
623
|
+
default: $(() => [
|
|
624
624
|
t("div", {
|
|
625
|
-
class: z(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send", { "is-disabled": e.disabled || !e.talking &&
|
|
625
|
+
class: z(["wi-web-inputbox__action-btn wi-web-inputbox__action-btn--send", { "is-disabled": e.disabled || !e.talking && h.value }]),
|
|
626
626
|
onClick: Y
|
|
627
627
|
}, Et, 2)
|
|
628
628
|
]),
|
|
@@ -634,8 +634,8 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
634
634
|
]));
|
|
635
635
|
}
|
|
636
636
|
}), Ot = /* @__PURE__ */ Q(xt, [["__scopeId", "data-v-c6f1253a"]]), Dt = [
|
|
637
|
-
{ id: "recordset", answerType: "recordset", component: _e(() => Promise.resolve().then(() =>
|
|
638
|
-
], Qt = (
|
|
637
|
+
{ id: "recordset", answerType: "recordset", component: _e(() => Promise.resolve().then(() => ps)) }
|
|
638
|
+
], Qt = (p) => re([...Dt, ...p ?? []]), Nt = (p) => (q("data-v-c18f2f94"), p = p(), K(), p), jt = {
|
|
639
639
|
key: 0,
|
|
640
640
|
class: "wi-web-chat-messages__loading"
|
|
641
641
|
}, Ht = {
|
|
@@ -660,81 +660,86 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
660
660
|
emptyDescription: { default: "回答内容由共享渲染层统一分发" }
|
|
661
661
|
},
|
|
662
662
|
emits: ["loadOlder", "updateThinkingExpanded"],
|
|
663
|
-
setup(
|
|
664
|
-
const
|
|
663
|
+
setup(p, { expose: C, emit: i }) {
|
|
664
|
+
const r = p, _ = i;
|
|
665
665
|
de(
|
|
666
|
-
|
|
667
|
-
getFileUrl: (
|
|
668
|
-
var
|
|
669
|
-
return ((
|
|
666
|
+
r.outputFileConfig ?? {
|
|
667
|
+
getFileUrl: (l) => {
|
|
668
|
+
var U;
|
|
669
|
+
return ((U = r.getFileUrl) == null ? void 0 : U.call(r, l)) ?? (r.baseURL ? `${r.baseURL.replace(/\/$/, "")}/algorithm/get_file_data?file_id=${encodeURIComponent(l)}` : "");
|
|
670
670
|
}
|
|
671
671
|
}
|
|
672
672
|
);
|
|
673
|
-
const
|
|
674
|
-
return
|
|
675
|
-
() =>
|
|
673
|
+
const m = x(), { showScrollToBottom: b, forceScrollToBottom: a, requestScrollToBottom: u, resetScrollState: d, onReachTop: h } = Be(m), o = k(() => Qt(r.parsers));
|
|
674
|
+
return se(
|
|
675
|
+
() => r.messages.length === 0,
|
|
676
|
+
(l) => {
|
|
677
|
+
l && d();
|
|
678
|
+
}
|
|
679
|
+
), se(
|
|
680
|
+
() => r.messages[r.messages.length - 1],
|
|
676
681
|
() => {
|
|
677
|
-
|
|
682
|
+
u();
|
|
678
683
|
},
|
|
679
684
|
{ deep: !0 }
|
|
680
|
-
),
|
|
685
|
+
), h(() => _("loadOlder")), C({
|
|
681
686
|
/** 强制滚动到底部 */
|
|
682
687
|
forceScrollToBottom: a,
|
|
683
688
|
/** 自动滚动开启时请求滚动到底部 */
|
|
684
|
-
requestScrollToBottom:
|
|
685
|
-
}), (
|
|
689
|
+
requestScrollToBottom: u
|
|
690
|
+
}), (l, U) => (s(), n("div", {
|
|
686
691
|
ref_key: "scrollEl",
|
|
687
|
-
ref:
|
|
692
|
+
ref: m,
|
|
688
693
|
class: "wi-web-chat-messages"
|
|
689
694
|
}, [
|
|
690
|
-
|
|
695
|
+
l.loading ? (s(), n("div", jt, "历史加载中...")) : l.messages.length === 0 ? (s(), n("div", Ht, [
|
|
691
696
|
Wt,
|
|
692
|
-
t("div", qt, A(
|
|
693
|
-
t("div", Kt, A(
|
|
697
|
+
t("div", qt, A(l.emptyTitle), 1),
|
|
698
|
+
t("div", Kt, A(l.emptyDescription), 1)
|
|
694
699
|
])) : g("", !0),
|
|
695
|
-
(s(!0),
|
|
696
|
-
key:
|
|
700
|
+
(s(!0), n(P, null, j(l.messages, (c) => (s(), n(P, {
|
|
701
|
+
key: c.id
|
|
697
702
|
}, [
|
|
698
|
-
|
|
703
|
+
c.role === "user" ? (s(), n("div", Yt, [
|
|
699
704
|
t("div", Xt, [
|
|
700
|
-
|
|
705
|
+
c.attachments && c.attachments.length > 0 ? (s(), V(ne, {
|
|
701
706
|
key: 0,
|
|
702
707
|
class: "wi-web-chat-messages__attachments",
|
|
703
|
-
items:
|
|
704
|
-
"base-u-r-l":
|
|
705
|
-
"get-file-url":
|
|
708
|
+
items: c.attachments,
|
|
709
|
+
"base-u-r-l": l.baseURL,
|
|
710
|
+
"get-file-url": l.getFileUrl
|
|
706
711
|
}, null, 8, ["items", "base-u-r-l", "get-file-url"])) : g("", !0),
|
|
707
|
-
t("div", Zt, A(
|
|
712
|
+
t("div", Zt, A(c.content), 1)
|
|
708
713
|
])
|
|
709
|
-
])) : (s(),
|
|
714
|
+
])) : (s(), n("div", Gt, [
|
|
710
715
|
L(I(ce), {
|
|
711
|
-
steps:
|
|
712
|
-
expanded:
|
|
713
|
-
"onUpdate:expanded": (
|
|
716
|
+
steps: c.thinking.steps,
|
|
717
|
+
expanded: c.thinking.expanded,
|
|
718
|
+
"onUpdate:expanded": (f) => _("updateThinkingExpanded", c, f)
|
|
714
719
|
}, null, 8, ["steps", "expanded", "onUpdate:expanded"]),
|
|
715
720
|
L(I(ue), {
|
|
716
|
-
answer:
|
|
717
|
-
error:
|
|
718
|
-
stopped:
|
|
719
|
-
"content-map":
|
|
721
|
+
answer: c.answer,
|
|
722
|
+
error: c.error,
|
|
723
|
+
stopped: c.stopped,
|
|
724
|
+
"content-map": o.value
|
|
720
725
|
}, null, 8, ["answer", "error", "stopped", "content-map"])
|
|
721
726
|
]))
|
|
722
727
|
], 64))), 128)),
|
|
723
728
|
L(ve, { name: "wi-web-chat-messages-fade" }, {
|
|
724
|
-
default:
|
|
725
|
-
I(
|
|
729
|
+
default: $(() => [
|
|
730
|
+
I(b) ? (s(), n("button", {
|
|
726
731
|
key: 0,
|
|
727
732
|
type: "button",
|
|
728
733
|
class: "wi-web-chat-messages__bottom",
|
|
729
|
-
onClick:
|
|
730
|
-
(...
|
|
734
|
+
onClick: U[0] || (U[0] = //@ts-ignore
|
|
735
|
+
(...c) => I(a) && I(a)(...c))
|
|
731
736
|
}, " 回到底部 ")) : g("", !0)
|
|
732
737
|
]),
|
|
733
738
|
_: 1
|
|
734
739
|
})
|
|
735
740
|
], 512));
|
|
736
741
|
}
|
|
737
|
-
}),
|
|
742
|
+
}), es = /* @__PURE__ */ Q(Jt, [["__scopeId", "data-v-c18f2f94"]]), ts = { class: "wi-web-chat-container" }, ss = { class: "wi-web-chat-container__footer" }, os = /* @__PURE__ */ D({
|
|
738
743
|
__name: "ChatContainer",
|
|
739
744
|
props: {
|
|
740
745
|
messages: {},
|
|
@@ -756,17 +761,17 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
756
761
|
disabled: { type: Boolean, default: !1 }
|
|
757
762
|
},
|
|
758
763
|
emits: ["update:question", "update:incPrevQuestion", "submit", "stop", "selectAgent", "loadOlder", "updateThinkingExpanded"],
|
|
759
|
-
setup(
|
|
760
|
-
const
|
|
761
|
-
|
|
762
|
-
},
|
|
763
|
-
|
|
764
|
-
},
|
|
765
|
-
|
|
764
|
+
setup(p, { emit: C }) {
|
|
765
|
+
const i = p, r = C, _ = (a) => {
|
|
766
|
+
r("submit", a);
|
|
767
|
+
}, m = () => {
|
|
768
|
+
i.hasMore && r("loadOlder");
|
|
769
|
+
}, b = (a) => {
|
|
770
|
+
r("selectAgent", a);
|
|
766
771
|
};
|
|
767
|
-
return (a,
|
|
772
|
+
return (a, u) => (s(), n("section", ts, [
|
|
768
773
|
S(a.$slots, "messages", {}, () => [
|
|
769
|
-
L(
|
|
774
|
+
L(es, {
|
|
770
775
|
messages: a.messages,
|
|
771
776
|
parsers: a.parsers,
|
|
772
777
|
"base-u-r-l": a.baseURL,
|
|
@@ -775,17 +780,17 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
775
780
|
loading: a.loading,
|
|
776
781
|
"empty-title": a.emptyTitle,
|
|
777
782
|
"empty-description": a.emptyDescription,
|
|
778
|
-
onLoadOlder:
|
|
779
|
-
onUpdateThinkingExpanded:
|
|
783
|
+
onLoadOlder: m,
|
|
784
|
+
onUpdateThinkingExpanded: u[0] || (u[0] = (d, h) => r("updateThinkingExpanded", d, h))
|
|
780
785
|
}, null, 8, ["messages", "parsers", "base-u-r-l", "get-file-url", "output-file-config", "loading", "empty-title", "empty-description"])
|
|
781
786
|
], !0),
|
|
782
787
|
S(a.$slots, "above-input", {}, void 0, !0),
|
|
783
|
-
t("footer",
|
|
788
|
+
t("footer", ss, [
|
|
784
789
|
L(Ot, {
|
|
785
790
|
"model-value": a.question,
|
|
786
|
-
"onUpdate:modelValue":
|
|
791
|
+
"onUpdate:modelValue": u[1] || (u[1] = (d) => r("update:question", d)),
|
|
787
792
|
"inc-prev-question": a.incPrevQuestion,
|
|
788
|
-
"onUpdate:incPrevQuestion":
|
|
793
|
+
"onUpdate:incPrevQuestion": u[2] || (u[2] = (d) => r("update:incPrevQuestion", d)),
|
|
789
794
|
"base-u-r-l": a.baseURL,
|
|
790
795
|
disabled: a.disabled || !a.session,
|
|
791
796
|
talking: a.talking,
|
|
@@ -793,17 +798,17 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
793
798
|
"current-agent": a.currentAgent,
|
|
794
799
|
placeholder: a.placeholder,
|
|
795
800
|
"get-file-url": a.getFileUrl,
|
|
796
|
-
onSelectAgent:
|
|
797
|
-
onSubmit:
|
|
798
|
-
onStop:
|
|
801
|
+
onSelectAgent: b,
|
|
802
|
+
onSubmit: _,
|
|
803
|
+
onStop: u[3] || (u[3] = (d) => r("stop"))
|
|
799
804
|
}, null, 8, ["model-value", "inc-prev-question", "base-u-r-l", "disabled", "talking", "agent-list", "current-agent", "placeholder", "get-file-url"])
|
|
800
805
|
])
|
|
801
806
|
]));
|
|
802
807
|
}
|
|
803
|
-
}),
|
|
808
|
+
}), Ts = /* @__PURE__ */ Q(os, [["__scopeId", "data-v-8663b501"]]), ie = (p) => (q("data-v-96941d57"), p = p(), K(), p), as = {
|
|
804
809
|
key: 0,
|
|
805
810
|
class: "wi-web-recordset"
|
|
806
|
-
},
|
|
811
|
+
}, ls = { class: "wi-web-recordset__header" }, ns = { class: "wi-web-recordset__title" }, is = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("button", {
|
|
807
812
|
type: "button",
|
|
808
813
|
class: "wi-web-recordset__columns-btn",
|
|
809
814
|
title: "选择展示列"
|
|
@@ -825,66 +830,66 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
825
830
|
/* @__PURE__ */ t("path", { d: "M9 4v16M15 4v16" })
|
|
826
831
|
]),
|
|
827
832
|
/* @__PURE__ */ t("span", null, "列")
|
|
828
|
-
], -1)),
|
|
833
|
+
], -1)), rs = { class: "wi-web-recordset__columns-panel" }, ds = /* @__PURE__ */ ie(() => /* @__PURE__ */ t("div", { class: "wi-web-recordset__columns-panel-title" }, "选择展示列", -1)), cs = /* @__PURE__ */ D({
|
|
829
834
|
__name: "RecordsetTable",
|
|
830
835
|
props: {
|
|
831
836
|
report: {},
|
|
832
837
|
maxHeight: { default: 420 }
|
|
833
838
|
},
|
|
834
|
-
setup(
|
|
835
|
-
const
|
|
836
|
-
var
|
|
837
|
-
return ((
|
|
838
|
-
}),
|
|
839
|
+
setup(p) {
|
|
840
|
+
const C = p, i = k(() => {
|
|
841
|
+
var c;
|
|
842
|
+
return ((c = C.report) == null ? void 0 : c.values) ?? {};
|
|
843
|
+
}), r = k(() => i.value.chart === "table"), _ = k(() => i.value.title ?? ""), m = k(() => (Array.isArray(i.value.cols) ? i.value.cols : []).map((f, B) => ({
|
|
839
844
|
key: `c${B}`,
|
|
840
|
-
title: (
|
|
841
|
-
}))),
|
|
842
|
-
const
|
|
843
|
-
return Number.isFinite(
|
|
844
|
-
}), a =
|
|
845
|
-
|
|
846
|
-
() =>
|
|
845
|
+
title: (f == null ? void 0 : f.title) || (f == null ? void 0 : f.name) || `列${B + 1}`
|
|
846
|
+
}))), b = k(() => {
|
|
847
|
+
const c = Number(i.value.max_cols);
|
|
848
|
+
return Number.isFinite(c) && c > 0 ? c : 1 / 0;
|
|
849
|
+
}), a = k(() => m.value.length > b.value), u = x([]), d = k(() => new Set(u.value)), h = k(() => m.value.filter((c) => d.value.has(c.key)));
|
|
850
|
+
se(
|
|
851
|
+
() => m.value.map((c) => c.key).join("|"),
|
|
847
852
|
() => {
|
|
848
|
-
|
|
853
|
+
u.value = m.value.slice(0, b.value).map((c) => c.key);
|
|
849
854
|
},
|
|
850
855
|
{ immediate: !0 }
|
|
851
856
|
);
|
|
852
|
-
const o =
|
|
857
|
+
const o = k(() => (Array.isArray(i.value.values) ? i.value.values : []).map((f) => {
|
|
853
858
|
const B = {};
|
|
854
|
-
return
|
|
855
|
-
B[M.key] = Array.isArray(
|
|
859
|
+
return m.value.forEach((M, N) => {
|
|
860
|
+
B[M.key] = Array.isArray(f) ? f[N] : void 0;
|
|
856
861
|
}), B;
|
|
857
|
-
})),
|
|
858
|
-
const B = new Set(
|
|
859
|
-
|
|
862
|
+
})), l = x(!1), U = (c, f) => {
|
|
863
|
+
const B = new Set(u.value);
|
|
864
|
+
f ? B.add(c) : B.delete(c), u.value = m.value.filter((M) => B.has(M.key)).map((M) => M.key);
|
|
860
865
|
};
|
|
861
|
-
return (
|
|
866
|
+
return (c, f) => {
|
|
862
867
|
const B = J("el-checkbox"), M = J("el-popover"), N = J("el-table-column"), Y = J("el-table");
|
|
863
|
-
return
|
|
864
|
-
t("div",
|
|
865
|
-
t("div",
|
|
868
|
+
return r.value ? (s(), n("div", as, [
|
|
869
|
+
t("div", ls, [
|
|
870
|
+
t("div", ns, A(_.value), 1),
|
|
866
871
|
a.value ? (s(), V(M, {
|
|
867
872
|
key: 0,
|
|
868
|
-
visible:
|
|
869
|
-
"onUpdate:visible":
|
|
873
|
+
visible: l.value,
|
|
874
|
+
"onUpdate:visible": f[0] || (f[0] = (F) => l.value = F),
|
|
870
875
|
placement: "bottom-end",
|
|
871
876
|
width: 220,
|
|
872
877
|
trigger: "click",
|
|
873
878
|
"popper-class": "wi-web-recordset-columns-popper"
|
|
874
879
|
}, {
|
|
875
|
-
reference:
|
|
876
|
-
|
|
880
|
+
reference: $(() => [
|
|
881
|
+
is
|
|
877
882
|
]),
|
|
878
|
-
default:
|
|
879
|
-
t("div",
|
|
880
|
-
|
|
881
|
-
(s(!0),
|
|
883
|
+
default: $(() => [
|
|
884
|
+
t("div", rs, [
|
|
885
|
+
ds,
|
|
886
|
+
(s(!0), n(P, null, j(m.value, (F) => (s(), V(B, {
|
|
882
887
|
key: F.key,
|
|
883
888
|
class: "wi-web-recordset__column-item",
|
|
884
|
-
"model-value":
|
|
885
|
-
"onUpdate:modelValue": (e) =>
|
|
889
|
+
"model-value": d.value.has(F.key),
|
|
890
|
+
"onUpdate:modelValue": (e) => U(F.key, !!e)
|
|
886
891
|
}, {
|
|
887
|
-
default:
|
|
892
|
+
default: $(() => [
|
|
888
893
|
O(A(F.title), 1)
|
|
889
894
|
]),
|
|
890
895
|
_: 2
|
|
@@ -899,10 +904,10 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
899
904
|
border: "",
|
|
900
905
|
size: "small",
|
|
901
906
|
class: "wi-web-recordset__table",
|
|
902
|
-
"max-height":
|
|
907
|
+
"max-height": c.maxHeight
|
|
903
908
|
}, {
|
|
904
|
-
default:
|
|
905
|
-
(s(!0),
|
|
909
|
+
default: $(() => [
|
|
910
|
+
(s(!0), n(P, null, j(h.value, (F) => (s(), V(N, {
|
|
906
911
|
key: F.key,
|
|
907
912
|
prop: F.key,
|
|
908
913
|
label: F.title,
|
|
@@ -915,10 +920,10 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
915
920
|
])) : g("", !0);
|
|
916
921
|
};
|
|
917
922
|
}
|
|
918
|
-
}),
|
|
923
|
+
}), us = /* @__PURE__ */ Q(cs, [["__scopeId", "data-v-96941d57"]]), ps = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
919
924
|
__proto__: null,
|
|
920
|
-
default:
|
|
921
|
-
}, Symbol.toStringTag, { value: "Module" })), oe = (
|
|
925
|
+
default: us
|
|
926
|
+
}, Symbol.toStringTag, { value: "Module" })), oe = (p) => (q("data-v-94659445"), p = p(), K(), p), hs = { class: "wi-web-env-switch__track" }, _s = { class: "wi-web-env-switch__items" }, vs = ["disabled", "onClick"], ws = { class: "wi-web-env-switch__icon" }, ms = {
|
|
922
927
|
key: 0,
|
|
923
928
|
viewBox: "0 0 24 24",
|
|
924
929
|
fill: "none",
|
|
@@ -926,32 +931,32 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
926
931
|
"stroke-width": "1.8",
|
|
927
932
|
"stroke-linecap": "round",
|
|
928
933
|
"stroke-linejoin": "round"
|
|
929
|
-
},
|
|
930
|
-
|
|
931
|
-
],
|
|
934
|
+
}, bs = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("path", { d: "M17.5 19a4.5 4.5 0 0 0 .6-8.96 6 6 0 0 0-11.63 1.4A3.8 3.8 0 0 0 7 19z" }, null, -1)), fs = [
|
|
935
|
+
bs
|
|
936
|
+
], gs = {
|
|
932
937
|
key: 1,
|
|
933
938
|
viewBox: "0 0 24 24",
|
|
934
939
|
fill: "none",
|
|
935
940
|
stroke: "currentColor",
|
|
936
941
|
"stroke-width": "1.8",
|
|
937
942
|
"stroke-linecap": "round"
|
|
938
|
-
},
|
|
943
|
+
}, ys = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("rect", {
|
|
939
944
|
x: "2.5",
|
|
940
945
|
y: "4",
|
|
941
946
|
width: "19",
|
|
942
947
|
height: "12",
|
|
943
948
|
rx: "2",
|
|
944
949
|
"stroke-linejoin": "round"
|
|
945
|
-
}, null, -1)),
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
],
|
|
950
|
+
}, null, -1)), ks = /* @__PURE__ */ oe(() => /* @__PURE__ */ t("path", { d: "M8.5 20h7M12 16v4" }, null, -1)), $s = [
|
|
951
|
+
ys,
|
|
952
|
+
ks
|
|
953
|
+
], Cs = { class: "wi-web-env-switch__label" }, Us = {
|
|
949
954
|
key: 0,
|
|
950
955
|
class: "wi-web-env-switch__hint"
|
|
951
|
-
},
|
|
956
|
+
}, As = { class: "wi-web-env-switch__hint-text" }, Bs = {
|
|
952
957
|
key: 0,
|
|
953
958
|
class: "wi-web-env-switch__hint-status"
|
|
954
|
-
},
|
|
959
|
+
}, Is = /* @__PURE__ */ D({
|
|
955
960
|
__name: "EnvSwitch",
|
|
956
961
|
props: {
|
|
957
962
|
modelValue: { default: "local" },
|
|
@@ -961,8 +966,8 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
961
966
|
showHint: { type: Boolean, default: !0 }
|
|
962
967
|
},
|
|
963
968
|
emits: ["update:modelValue", "change"],
|
|
964
|
-
setup(
|
|
965
|
-
const
|
|
969
|
+
setup(p, { emit: C }) {
|
|
970
|
+
const i = p, r = C, _ = [
|
|
966
971
|
{
|
|
967
972
|
value: "local",
|
|
968
973
|
label: "本地电脑",
|
|
@@ -977,49 +982,49 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
977
982
|
status: "未连接",
|
|
978
983
|
online: !1
|
|
979
984
|
}
|
|
980
|
-
],
|
|
981
|
-
const
|
|
982
|
-
return
|
|
983
|
-
}), a =
|
|
984
|
-
if (!
|
|
985
|
+
], m = { default: 3, small: 2 }, b = k(() => {
|
|
986
|
+
const h = i.options ?? [];
|
|
987
|
+
return h.length > 0 ? h : _;
|
|
988
|
+
}), a = k(() => {
|
|
989
|
+
if (!i.showHint)
|
|
985
990
|
return null;
|
|
986
|
-
const
|
|
987
|
-
return
|
|
988
|
-
}),
|
|
989
|
-
const
|
|
991
|
+
const h = b.value;
|
|
992
|
+
return h.find((o) => o.value === i.modelValue) ?? h[0] ?? null;
|
|
993
|
+
}), u = k(() => {
|
|
994
|
+
const h = b.value, o = h.length || 1, l = Math.max(h.findIndex((c) => c.value === i.modelValue), 0), U = m[i.size] ?? m.default;
|
|
990
995
|
return {
|
|
991
|
-
width: `calc(${100 / o}% - ${2 *
|
|
992
|
-
transform: `translateX(${
|
|
996
|
+
width: `calc(${100 / o}% - ${2 * U / o}px)`,
|
|
997
|
+
transform: `translateX(${l * 100}%)`
|
|
993
998
|
};
|
|
994
|
-
}),
|
|
995
|
-
|
|
999
|
+
}), d = (h) => {
|
|
1000
|
+
i.disabled || h.disabled || h.value !== i.modelValue && (r("update:modelValue", h.value), r("change", h));
|
|
996
1001
|
};
|
|
997
|
-
return (
|
|
998
|
-
class: z(["wi-web-env-switch", [`is-${
|
|
1002
|
+
return (h, o) => (s(), n("div", {
|
|
1003
|
+
class: z(["wi-web-env-switch", [`is-${h.size}`, { "is-disabled": h.disabled }]])
|
|
999
1004
|
}, [
|
|
1000
|
-
t("div",
|
|
1005
|
+
t("div", hs, [
|
|
1001
1006
|
t("span", {
|
|
1002
1007
|
class: "wi-web-env-switch__thumb",
|
|
1003
|
-
style: we(
|
|
1008
|
+
style: we(u.value)
|
|
1004
1009
|
}, null, 4),
|
|
1005
|
-
t("div",
|
|
1006
|
-
(s(!0),
|
|
1007
|
-
key:
|
|
1010
|
+
t("div", _s, [
|
|
1011
|
+
(s(!0), n(P, null, j(b.value, (l) => (s(), n("button", {
|
|
1012
|
+
key: l.value,
|
|
1008
1013
|
type: "button",
|
|
1009
|
-
class: z(["wi-web-env-switch__item", { "is-active":
|
|
1010
|
-
disabled:
|
|
1011
|
-
onClick: (
|
|
1014
|
+
class: z(["wi-web-env-switch__item", { "is-active": l.value === h.modelValue, "is-disabled": l.disabled }]),
|
|
1015
|
+
disabled: h.disabled || l.disabled,
|
|
1016
|
+
onClick: (U) => d(l)
|
|
1012
1017
|
}, [
|
|
1013
|
-
t("span",
|
|
1014
|
-
|
|
1018
|
+
t("span", ws, [
|
|
1019
|
+
l.value === "cloud" ? (s(), n("svg", ms, fs)) : (s(), n("svg", gs, $s))
|
|
1015
1020
|
]),
|
|
1016
|
-
t("span",
|
|
1017
|
-
], 10,
|
|
1021
|
+
t("span", Cs, A(l.label), 1)
|
|
1022
|
+
], 10, vs))), 128))
|
|
1018
1023
|
])
|
|
1019
1024
|
]),
|
|
1020
|
-
a.value ? (s(),
|
|
1021
|
-
t("span",
|
|
1022
|
-
a.value.status ? (s(),
|
|
1025
|
+
a.value ? (s(), n("div", Us, [
|
|
1026
|
+
t("span", As, A(a.value.description), 1),
|
|
1027
|
+
a.value.status ? (s(), n("span", Bs, [
|
|
1023
1028
|
t("i", {
|
|
1024
1029
|
class: z(["wi-web-env-switch__dot", { "is-online": a.value.online }])
|
|
1025
1030
|
}, null, 2),
|
|
@@ -1028,27 +1033,28 @@ const H = (c) => (q("data-v-dc2d5f2b"), c = c(), K(), c), Ie = { class: "wi-web-
|
|
|
1028
1033
|
])) : g("", !0)
|
|
1029
1034
|
], 2));
|
|
1030
1035
|
}
|
|
1031
|
-
}),
|
|
1036
|
+
}), Ms = /* @__PURE__ */ Q(Is, [["__scopeId", "data-v-94659445"]]);
|
|
1032
1037
|
export {
|
|
1033
|
-
|
|
1038
|
+
Es as AgentActionStatus,
|
|
1039
|
+
xs as AiAnswerBubble,
|
|
1034
1040
|
Ye as AttachmentCard,
|
|
1035
1041
|
ne as AttachmentList,
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
+
Ts as ChatContainer,
|
|
1043
|
+
es as ChatMessagesView,
|
|
1044
|
+
Os as ClarificationCard,
|
|
1045
|
+
Ds as DeepThinkingSteps,
|
|
1046
|
+
Ms as EnvSwitch,
|
|
1047
|
+
Qs as IframePage,
|
|
1042
1048
|
Ot as Inputbox,
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1049
|
+
Ns as KnowledgeStreamResult,
|
|
1050
|
+
js as OutputFile,
|
|
1051
|
+
us as RecordsetTable,
|
|
1052
|
+
Hs as createAnswerContentMap,
|
|
1047
1053
|
Qt as createWebAnswerContentMap,
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1054
|
+
Ws as injectIframeResizerChild,
|
|
1055
|
+
qs as provideIframePageConfig,
|
|
1056
|
+
Ks as provideOutputFileConfig,
|
|
1057
|
+
Ys as resolveIframePlaceholders,
|
|
1058
|
+
Xs as useIframePage
|
|
1053
1059
|
};
|
|
1054
1060
|
//# sourceMappingURL=index.js.map
|