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/renderers/index.js
CHANGED
|
@@ -1,71 +1,73 @@
|
|
|
1
1
|
import "wi-chat/style.css";
|
|
2
|
-
import { defineAsyncComponent as
|
|
3
|
-
import { knowledgeStreamParser as Ue, iframePageParser as
|
|
4
|
-
import { createStyleScope as pe, renderMarkdown as fe, downloadTableAsExcel as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
{ ...Ue, component:
|
|
8
|
-
{ ...
|
|
9
|
-
{ ...
|
|
10
|
-
// 确认卡片(action_execute
|
|
11
|
-
//
|
|
12
|
-
{ ...
|
|
13
|
-
|
|
2
|
+
import { defineAsyncComponent as K, defineComponent as j, computed as I, openBlock as l, createElementBlock as u, createElementVNode as e, Fragment as M, renderList as B, createBlock as ee, resolveDynamicComponent as ke, createCommentVNode as V, createTextVNode as Se, pushScopeId as H, popScopeId as X, unref as i, toDisplayString as v, withDirectives as $e, vShow as xe, getCurrentInstance as ue, inject as ce, toValue as z, ref as U, watch as de, onBeforeUnmount as Ie, provide as _e, withKeys as re, withModifiers as te, normalizeClass as D, Teleport as Ce, createVNode as Ee, Transition as Oe, withCtx as Te, reactive as Ve, normalizeStyle as Pe } from "vue";
|
|
3
|
+
import { knowledgeStreamParser as Ue, iframePageParser as Me, outputFileParser as Le, collectClarificationsParser as je, agentActionParser as Ae, formatFileSize as Ne, IFRAME_RESIZER_CHILD_SCRIPT as Re, submitClarification as Fe, cancelClarification as De } from "wi-chat/parser";
|
|
4
|
+
import { createStyleScope as pe, renderMarkdown as fe, downloadTableAsExcel as Be } from "wi-chat/tools";
|
|
5
|
+
import ie from "@iframe-resizer/vue/iframe-resizer.vue";
|
|
6
|
+
const ze = [
|
|
7
|
+
{ ...Ue, component: K(() => Promise.resolve().then(() => ft)) },
|
|
8
|
+
{ ...Me, component: K(() => Promise.resolve().then(() => fs)) },
|
|
9
|
+
{ ...Le, component: K(() => Promise.resolve().then(() => os)) },
|
|
10
|
+
// 确认卡片(front_reply + action_execute + executor=host + collect_clarifications):
|
|
11
|
+
// 解析由内置 collectClarificationsParser 完成,提交/取消经 wi-chat/parser 回传 wait_reply
|
|
12
|
+
{ ...je, component: K(() => Promise.resolve().then(() => tn)) },
|
|
13
|
+
// agent 指令执行过程(front_reply + action_execute + executor=agent):宿主执行、进度卡片
|
|
14
|
+
{ ...Ae, component: K(() => Promise.resolve().then(() => fn)) }
|
|
15
|
+
], qe = (n) => {
|
|
14
16
|
const a = (c) => {
|
|
15
|
-
const
|
|
16
|
-
for (const
|
|
17
|
-
!
|
|
18
|
-
return
|
|
17
|
+
const t = {};
|
|
18
|
+
for (const o of c)
|
|
19
|
+
!o.answerType || !o.component || (t[o.answerType] = o.component);
|
|
20
|
+
return t;
|
|
19
21
|
};
|
|
20
|
-
return { ...a(
|
|
21
|
-
},
|
|
22
|
+
return { ...a(ze), ...a(n ?? []) };
|
|
23
|
+
}, Ke = (n) => (H("data-v-efad55c8"), n = n(), X(), n), He = { class: "flex justify-start" }, Xe = { class: "ai-answer-bubble" }, Ge = {
|
|
22
24
|
key: 0,
|
|
23
25
|
class: "ai-answer-bubble__error"
|
|
24
|
-
},
|
|
26
|
+
}, We = { class: "ai-answer-bubble__body" }, Ye = {
|
|
25
27
|
key: 0,
|
|
26
28
|
class: "ai-answer-bubble__status"
|
|
27
|
-
},
|
|
29
|
+
}, Je = {
|
|
28
30
|
key: 2,
|
|
29
31
|
class: "ai-answer-bubble__status"
|
|
30
|
-
},
|
|
32
|
+
}, Ze = {
|
|
31
33
|
key: 3,
|
|
32
34
|
class: "ai-answer-bubble__loading"
|
|
33
|
-
},
|
|
35
|
+
}, Qe = /* @__PURE__ */ Ke(() => /* @__PURE__ */ e("span", { class: "ai-answer-bubble__pulse" }, null, -1)), et = /* @__PURE__ */ j({
|
|
34
36
|
__name: "AiAnswerBubble",
|
|
35
37
|
props: {
|
|
36
38
|
answer: {},
|
|
37
39
|
error: { type: Boolean, default: !1 },
|
|
38
40
|
stopped: { type: Boolean, default: !1 },
|
|
39
|
-
contentMap: { default: () =>
|
|
41
|
+
contentMap: { default: () => qe() }
|
|
40
42
|
},
|
|
41
43
|
setup(n) {
|
|
42
|
-
const a = n, c =
|
|
43
|
-
var
|
|
44
|
-
return ((
|
|
45
|
-
}),
|
|
46
|
-
return (
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
(
|
|
51
|
-
key:
|
|
44
|
+
const a = n, c = I(() => {
|
|
45
|
+
var o, d;
|
|
46
|
+
return ((d = (o = a.answer) == null ? void 0 : o.answer) == null ? void 0 : d.reports) ?? [];
|
|
47
|
+
}), t = I(() => c.value.filter((o) => a.contentMap[o.answer_type]));
|
|
48
|
+
return (o, d) => (l(), u("div", He, [
|
|
49
|
+
e("div", Xe, [
|
|
50
|
+
o.error ? (l(), u("div", Ge, "回答加载失败")) : t.value.length ? (l(), u(M, { key: 1 }, [
|
|
51
|
+
e("div", We, [
|
|
52
|
+
(l(!0), u(M, null, B(t.value, (w, $) => (l(), ee(ke(o.contentMap[w.answer_type]), {
|
|
53
|
+
key: $,
|
|
52
54
|
report: w
|
|
53
55
|
}, null, 8, ["report"]))), 128))
|
|
54
56
|
]),
|
|
55
|
-
|
|
56
|
-
], 64)) :
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
o.stopped ? (l(), u("div", Ye, "回答已停止")) : V("", !0)
|
|
58
|
+
], 64)) : o.stopped ? (l(), u("div", Je, "回答已停止")) : c.value.length ? V("", !0) : (l(), u("div", Ze, [
|
|
59
|
+
Qe,
|
|
60
|
+
Se("正在思考...")
|
|
59
61
|
]))
|
|
60
62
|
])
|
|
61
63
|
]));
|
|
62
64
|
}
|
|
63
|
-
}),
|
|
65
|
+
}), A = (n, a) => {
|
|
64
66
|
const c = n.__vccOpts || n;
|
|
65
|
-
for (const [
|
|
66
|
-
c[
|
|
67
|
+
for (const [t, o] of a)
|
|
68
|
+
c[t] = o;
|
|
67
69
|
return c;
|
|
68
|
-
},
|
|
70
|
+
}, bn = /* @__PURE__ */ A(et, [["__scopeId", "data-v-efad55c8"]]), tt = (n) => (H("data-v-de333356"), n = n(), X(), n), st = ["data-wi-md-scope"], nt = ["aria-expanded"], ot = /* @__PURE__ */ tt(() => /* @__PURE__ */ e("span", { class: "deep-thinking__title" }, "深度思考", -1)), at = { class: "deep-thinking__count" }, rt = { class: "deep-thinking__list" }, it = { class: "deep-thinking__index" }, lt = ["innerHTML"], ut = /* @__PURE__ */ j({
|
|
69
71
|
__name: "DeepThinkingSteps",
|
|
70
72
|
props: {
|
|
71
73
|
steps: {},
|
|
@@ -73,77 +75,77 @@ const De = [
|
|
|
73
75
|
},
|
|
74
76
|
emits: ["update:expanded"],
|
|
75
77
|
setup(n, { emit: a }) {
|
|
76
|
-
const c = n,
|
|
77
|
-
let
|
|
78
|
-
return
|
|
79
|
-
}, g =
|
|
80
|
-
return (p,
|
|
78
|
+
const c = n, t = a, o = { imageDownload: !1, tableDownload: !1 }, d = pe(), w = { ...o, styleScope: d.selector }, $ = /* @__PURE__ */ new Map(), b = (p) => {
|
|
79
|
+
let h = $.get(p);
|
|
80
|
+
return h === void 0 && ($.size > 500 && $.clear(), h = fe(p, w), $.set(p, h)), h;
|
|
81
|
+
}, g = I(() => c.steps.map(b));
|
|
82
|
+
return (p, h) => g.value.length ? (l(), u("div", {
|
|
81
83
|
key: 0,
|
|
82
84
|
class: "deep-thinking",
|
|
83
|
-
"data-wi-md-scope":
|
|
85
|
+
"data-wi-md-scope": i(d).id
|
|
84
86
|
}, [
|
|
85
|
-
|
|
87
|
+
e("button", {
|
|
86
88
|
type: "button",
|
|
87
89
|
class: "deep-thinking__header",
|
|
88
90
|
"aria-expanded": p.expanded,
|
|
89
|
-
onClick:
|
|
91
|
+
onClick: h[0] || (h[0] = (k) => t("update:expanded", !p.expanded))
|
|
90
92
|
}, [
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
], 8,
|
|
95
|
-
|
|
96
|
-
(
|
|
97
|
-
key:
|
|
93
|
+
ot,
|
|
94
|
+
e("span", at, v(g.value.length), 1),
|
|
95
|
+
e("span", null, v(p.expanded ? "收起" : "展开"), 1)
|
|
96
|
+
], 8, nt),
|
|
97
|
+
$e(e("div", rt, [
|
|
98
|
+
(l(!0), u(M, null, B(g.value, (k, O) => (l(), u("div", {
|
|
99
|
+
key: O,
|
|
98
100
|
class: "deep-thinking__item"
|
|
99
101
|
}, [
|
|
100
|
-
|
|
101
|
-
|
|
102
|
+
e("span", it, v(O + 1), 1),
|
|
103
|
+
e("div", {
|
|
102
104
|
class: "markdown-it",
|
|
103
105
|
innerHTML: k
|
|
104
|
-
}, null, 8,
|
|
106
|
+
}, null, 8, lt)
|
|
105
107
|
]))), 128))
|
|
106
108
|
], 512), [
|
|
107
|
-
[
|
|
109
|
+
[xe, p.expanded]
|
|
108
110
|
])
|
|
109
|
-
], 8,
|
|
111
|
+
], 8, st)) : V("", !0);
|
|
110
112
|
}
|
|
111
|
-
}),
|
|
113
|
+
}), gn = /* @__PURE__ */ A(ut, [["__scopeId", "data-v-de333356"]]), ct = ["data-wi-md-scope"], dt = ["innerHTML"], _t = /* @__PURE__ */ j({
|
|
112
114
|
__name: "KnowledgeStreamResult",
|
|
113
115
|
props: {
|
|
114
116
|
report: {}
|
|
115
117
|
},
|
|
116
118
|
setup(n) {
|
|
117
|
-
const a = n, c = { imageDownload: !1, tableDownload: !0 },
|
|
118
|
-
var
|
|
119
|
-
const
|
|
120
|
-
if (!
|
|
119
|
+
const a = n, c = { imageDownload: !1, tableDownload: !0 }, t = pe(), o = { ...c, styleScope: t.selector }, d = (g) => {
|
|
120
|
+
var O;
|
|
121
|
+
const h = g.target.closest(".wi-md-table-download");
|
|
122
|
+
if (!h)
|
|
121
123
|
return;
|
|
122
124
|
g.preventDefault(), g.stopPropagation();
|
|
123
|
-
const k = (
|
|
124
|
-
k &&
|
|
125
|
-
}, w = /* @__PURE__ */ new Map(),
|
|
125
|
+
const k = (O = h.closest(".wi-md-table-wrap")) == null ? void 0 : O.querySelector("table");
|
|
126
|
+
k && Be(k);
|
|
127
|
+
}, w = /* @__PURE__ */ new Map(), $ = (g) => {
|
|
126
128
|
let p = w.get(g);
|
|
127
|
-
return p === void 0 && (w.size > 300 && w.clear(), p = fe(g,
|
|
128
|
-
}, b =
|
|
129
|
-
return (g, p) => (
|
|
129
|
+
return p === void 0 && (w.size > 300 && w.clear(), p = fe(g, o), w.set(g, p)), p;
|
|
130
|
+
}, b = I(() => (a.report.values || []).map((g) => $(g.answer || "")));
|
|
131
|
+
return (g, p) => (l(), u("div", {
|
|
130
132
|
class: "knowledge-result",
|
|
131
|
-
"data-wi-md-scope":
|
|
132
|
-
onClick:
|
|
133
|
+
"data-wi-md-scope": i(t).id,
|
|
134
|
+
onClick: d
|
|
133
135
|
}, [
|
|
134
|
-
(
|
|
136
|
+
(l(!0), u(M, null, B(b.value, (h, k) => (l(), u("div", {
|
|
135
137
|
key: k,
|
|
136
138
|
class: "markdown-it",
|
|
137
|
-
innerHTML:
|
|
138
|
-
}, null, 8,
|
|
139
|
-
], 8,
|
|
139
|
+
innerHTML: h
|
|
140
|
+
}, null, 8, dt))), 128))
|
|
141
|
+
], 8, ct));
|
|
140
142
|
}
|
|
141
|
-
}),
|
|
143
|
+
}), pt = /* @__PURE__ */ A(_t, [["__scopeId", "data-v-857bc0d2"]]), ft = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
142
144
|
__proto__: null,
|
|
143
|
-
default:
|
|
144
|
-
}, Symbol.toStringTag, { value: "Module" })), ve = Symbol("wi-chat-output-file-config"),
|
|
145
|
+
default: pt
|
|
146
|
+
}, Symbol.toStringTag, { value: "Module" })), ve = Symbol("wi-chat-output-file-config"), kn = (n) => {
|
|
145
147
|
_e(ve, n);
|
|
146
|
-
},
|
|
148
|
+
}, vt = /* @__PURE__ */ new Set(["png", "jpg", "jpeg", "gif", "webp", "bmp", "svg", "ico"]), wt = /* @__PURE__ */ new Set(["mp3", "wav", "ogg", "m4a", "aac", "flac"]), yt = /* @__PURE__ */ new Set(["mp4", "webm", "mov", "avi", "mkv"]), ht = /* @__PURE__ */ new Set(["doc", "docx", "xls", "xlsx", "ppt", "pptx"]), mt = /* @__PURE__ */ new Set(["html", "htm"]), bt = /* @__PURE__ */ new Set([
|
|
147
149
|
"js",
|
|
148
150
|
"mjs",
|
|
149
151
|
"cjs",
|
|
@@ -169,7 +171,7 @@ const De = [
|
|
|
169
171
|
"css",
|
|
170
172
|
"scss",
|
|
171
173
|
"less"
|
|
172
|
-
]),
|
|
174
|
+
]), gt = /* @__PURE__ */ new Set([
|
|
173
175
|
"txt",
|
|
174
176
|
"text",
|
|
175
177
|
"md",
|
|
@@ -185,122 +187,122 @@ const De = [
|
|
|
185
187
|
"env",
|
|
186
188
|
"toml",
|
|
187
189
|
"sql"
|
|
188
|
-
]),
|
|
189
|
-
if (!
|
|
190
|
-
const c =
|
|
191
|
-
c !== void 0 &&
|
|
190
|
+
]), kt = 20, F = /* @__PURE__ */ new Map(), se = /* @__PURE__ */ new Map(), St = (n, a) => {
|
|
191
|
+
if (!F.has(n) && F.size >= kt) {
|
|
192
|
+
const c = F.keys().next().value;
|
|
193
|
+
c !== void 0 && F.delete(c);
|
|
192
194
|
}
|
|
193
|
-
|
|
194
|
-
},
|
|
195
|
+
F.set(n, a);
|
|
196
|
+
}, $t = (n) => {
|
|
195
197
|
const a = n.lastIndexOf(".");
|
|
196
198
|
return a >= 0 ? n.slice(a + 1).toLowerCase() : "";
|
|
197
|
-
},
|
|
198
|
-
const a = ue() ? ce(ve, {}) : {}, c =
|
|
199
|
-
var
|
|
200
|
-
const
|
|
201
|
-
return ((
|
|
202
|
-
}),
|
|
203
|
-
var
|
|
204
|
-
const
|
|
205
|
-
return ((
|
|
206
|
-
}),
|
|
207
|
-
|
|
208
|
-
},
|
|
209
|
-
const
|
|
210
|
-
if (!
|
|
199
|
+
}, xt = (n) => vt.has(n) ? "image" : n === "pdf" ? "pdf" : mt.has(n) ? "html" : wt.has(n) ? "audio" : yt.has(n) ? "video" : ht.has(n) ? "office" : bt.has(n) ? "code" : gt.has(n) ? "text" : "unknown", It = (n) => {
|
|
200
|
+
const a = ue() ? ce(ve, {}) : {}, c = I(() => {
|
|
201
|
+
var C;
|
|
202
|
+
const _ = z(n);
|
|
203
|
+
return ((C = _ == null ? void 0 : _.values) == null ? void 0 : C.file_id) ?? (_ == null ? void 0 : _.file_id) ?? "";
|
|
204
|
+
}), t = I(() => {
|
|
205
|
+
var C;
|
|
206
|
+
const _ = z(n);
|
|
207
|
+
return ((C = _ == null ? void 0 : _.values) == null ? void 0 : C.file_name) ?? (_ == null ? void 0 : _.file_name) ?? "未命名文件";
|
|
208
|
+
}), o = I(() => $t(t.value)), d = I(() => xt(o.value)), w = U(!1), $ = U(!1), b = U(""), g = U(!1), p = U(""), h = U(""), k = U(null), O = I(() => k.value ? Ne(k.value.size) : ""), T = () => {
|
|
209
|
+
h.value && typeof URL < "u" && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(h.value), h.value = "";
|
|
210
|
+
}, N = async () => {
|
|
211
|
+
const _ = c.value, C = t.value;
|
|
212
|
+
if (!_)
|
|
211
213
|
throw new Error("缺少文件 id,无法加载文件");
|
|
212
|
-
const
|
|
213
|
-
if (
|
|
214
|
-
return
|
|
215
|
-
let R = se.get(
|
|
214
|
+
const E = _ || C, Y = F.get(E);
|
|
215
|
+
if (Y)
|
|
216
|
+
return Y;
|
|
217
|
+
let R = se.get(E);
|
|
216
218
|
return R || (R = (async () => {
|
|
217
|
-
var
|
|
219
|
+
var J, Z;
|
|
218
220
|
if (a.loadFile)
|
|
219
|
-
return a.loadFile(
|
|
220
|
-
const
|
|
221
|
-
if (!
|
|
221
|
+
return a.loadFile(_);
|
|
222
|
+
const L = (J = a.getFileUrl) == null ? void 0 : J.call(a, _);
|
|
223
|
+
if (!L)
|
|
222
224
|
throw new Error("未配置文件加载方式(请提供 loadFile 或 getFileUrl)");
|
|
223
|
-
const
|
|
224
|
-
if (!
|
|
225
|
-
throw new Error(`文件加载失败(HTTP ${
|
|
226
|
-
return
|
|
227
|
-
})().then((
|
|
225
|
+
const y = await fetch(L, { headers: (Z = a.getHeaders) == null ? void 0 : Z.call(a) });
|
|
226
|
+
if (!y.ok)
|
|
227
|
+
throw new Error(`文件加载失败(HTTP ${y.status})`);
|
|
228
|
+
return y.blob();
|
|
229
|
+
})().then((L) => (St(E, L), L)).finally(() => se.delete(E)), se.set(E, R)), R;
|
|
228
230
|
}, S = async () => {
|
|
229
|
-
|
|
231
|
+
$.value = !0, b.value = "", g.value = !1, p.value = "", T();
|
|
230
232
|
try {
|
|
231
|
-
const
|
|
232
|
-
k.value =
|
|
233
|
-
const
|
|
234
|
-
if (
|
|
233
|
+
const _ = await N();
|
|
234
|
+
k.value = _;
|
|
235
|
+
const C = d.value;
|
|
236
|
+
if (C === "office") {
|
|
235
237
|
g.value = !0;
|
|
236
238
|
return;
|
|
237
239
|
}
|
|
238
|
-
if (
|
|
239
|
-
typeof URL < "u" && typeof URL.createObjectURL == "function" && (
|
|
240
|
+
if (C === "image" || C === "pdf" || C === "audio" || C === "video") {
|
|
241
|
+
typeof URL < "u" && typeof URL.createObjectURL == "function" && (h.value = URL.createObjectURL(_));
|
|
240
242
|
return;
|
|
241
243
|
}
|
|
242
|
-
const
|
|
243
|
-
if (
|
|
244
|
+
const E = await _.text();
|
|
245
|
+
if (E.includes("\0")) {
|
|
244
246
|
g.value = !0;
|
|
245
247
|
return;
|
|
246
248
|
}
|
|
247
|
-
p.value =
|
|
248
|
-
} catch (
|
|
249
|
-
b.value =
|
|
249
|
+
p.value = E;
|
|
250
|
+
} catch (_) {
|
|
251
|
+
b.value = _ instanceof Error ? _.message : String(_);
|
|
250
252
|
} finally {
|
|
251
|
-
|
|
253
|
+
$.value = !1;
|
|
252
254
|
}
|
|
253
|
-
},
|
|
255
|
+
}, x = async () => {
|
|
254
256
|
if (a.openPreview) {
|
|
255
257
|
a.openPreview({
|
|
256
258
|
fileId: c.value,
|
|
257
|
-
fileName:
|
|
258
|
-
loadFile:
|
|
259
|
-
download:
|
|
259
|
+
fileName: t.value,
|
|
260
|
+
loadFile: N,
|
|
261
|
+
download: W
|
|
260
262
|
});
|
|
261
263
|
return;
|
|
262
264
|
}
|
|
263
265
|
w.value = !0, await S();
|
|
264
|
-
},
|
|
265
|
-
w.value = !1,
|
|
266
|
-
},
|
|
266
|
+
}, G = () => {
|
|
267
|
+
w.value = !1, $.value = !1, b.value = "", g.value = !1, p.value = "", T();
|
|
268
|
+
}, W = async () => {
|
|
267
269
|
try {
|
|
268
|
-
const
|
|
269
|
-
if (k.value =
|
|
270
|
-
a.downloadFile({ fileId: c.value, fileName:
|
|
270
|
+
const _ = k.value ?? await N();
|
|
271
|
+
if (k.value = _, a.downloadFile) {
|
|
272
|
+
a.downloadFile({ fileId: c.value, fileName: t.value, blob: _ });
|
|
271
273
|
return;
|
|
272
274
|
}
|
|
273
275
|
if (typeof document > "u" || typeof URL > "u")
|
|
274
276
|
return;
|
|
275
|
-
const
|
|
276
|
-
|
|
277
|
-
} catch (
|
|
278
|
-
b.value =
|
|
277
|
+
const C = URL.createObjectURL(_), E = document.createElement("a");
|
|
278
|
+
E.href = C, E.download = t.value, document.body.appendChild(E), E.click(), E.remove(), URL.revokeObjectURL(C);
|
|
279
|
+
} catch (_) {
|
|
280
|
+
b.value = _ instanceof Error ? _.message : String(_), !w.value && !a.openPreview && (w.value = !0);
|
|
279
281
|
}
|
|
280
|
-
},
|
|
281
|
-
|
|
282
|
+
}, q = (_) => {
|
|
283
|
+
_.key === "Escape" && w.value && G();
|
|
282
284
|
};
|
|
283
|
-
return de(w, (
|
|
284
|
-
typeof window > "u" || (
|
|
285
|
-
}),
|
|
286
|
-
typeof window < "u" && window.removeEventListener("keydown",
|
|
285
|
+
return de(w, (_) => {
|
|
286
|
+
typeof window > "u" || (_ ? window.addEventListener("keydown", q) : window.removeEventListener("keydown", q));
|
|
287
|
+
}), Ie(() => {
|
|
288
|
+
typeof window < "u" && window.removeEventListener("keydown", q), T();
|
|
287
289
|
}), {
|
|
288
290
|
fileId: c,
|
|
289
|
-
fileName:
|
|
290
|
-
extension:
|
|
291
|
-
previewKind:
|
|
292
|
-
fileSize:
|
|
291
|
+
fileName: t,
|
|
292
|
+
extension: o,
|
|
293
|
+
previewKind: d,
|
|
294
|
+
fileSize: O,
|
|
293
295
|
visible: w,
|
|
294
|
-
loading:
|
|
296
|
+
loading: $,
|
|
295
297
|
error: b,
|
|
296
298
|
unsupported: g,
|
|
297
299
|
textContent: p,
|
|
298
|
-
objectUrl:
|
|
299
|
-
open:
|
|
300
|
-
close:
|
|
301
|
-
download:
|
|
300
|
+
objectUrl: h,
|
|
301
|
+
open: x,
|
|
302
|
+
close: G,
|
|
303
|
+
download: W
|
|
302
304
|
};
|
|
303
|
-
}, oe = (n) => (
|
|
305
|
+
}, oe = (n) => (H("data-v-f61a91b5"), n = n(), X(), n), Ct = { class: "wi-output-file" }, Et = ["aria-label"], Ot = /* @__PURE__ */ oe(() => /* @__PURE__ */ e("svg", {
|
|
304
306
|
viewBox: "0 0 24 24",
|
|
305
307
|
fill: "none",
|
|
306
308
|
stroke: "currentColor",
|
|
@@ -308,14 +310,14 @@ const De = [
|
|
|
308
310
|
"stroke-linecap": "round",
|
|
309
311
|
"stroke-linejoin": "round"
|
|
310
312
|
}, [
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */
|
|
313
|
-
], -1)),
|
|
314
|
-
|
|
315
|
-
],
|
|
313
|
+
/* @__PURE__ */ e("path", { d: "M7 2.5h7l4 4V21.5H7z" }),
|
|
314
|
+
/* @__PURE__ */ e("path", { d: "M14 2.5v4h4" })
|
|
315
|
+
], -1)), Tt = [
|
|
316
|
+
Ot
|
|
317
|
+
], Vt = { class: "wi-output-file__info" }, Pt = ["title"], Ut = { class: "wi-output-file__meta" }, Mt = { class: "wi-output-file__ext" }, Lt = {
|
|
316
318
|
key: 0,
|
|
317
319
|
class: "wi-output-file__size"
|
|
318
|
-
},
|
|
320
|
+
}, jt = /* @__PURE__ */ oe(() => /* @__PURE__ */ e("svg", {
|
|
319
321
|
viewBox: "0 0 24 24",
|
|
320
322
|
fill: "none",
|
|
321
323
|
stroke: "currentColor",
|
|
@@ -323,27 +325,27 @@ const De = [
|
|
|
323
325
|
"stroke-linecap": "round",
|
|
324
326
|
"stroke-linejoin": "round"
|
|
325
327
|
}, [
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
/* @__PURE__ */
|
|
329
|
-
], -1)),
|
|
330
|
-
|
|
331
|
-
],
|
|
328
|
+
/* @__PURE__ */ e("path", { d: "M12 3v12" }),
|
|
329
|
+
/* @__PURE__ */ e("path", { d: "m7 10 5 5 5-5" }),
|
|
330
|
+
/* @__PURE__ */ e("path", { d: "M5 21h14" })
|
|
331
|
+
], -1)), At = [
|
|
332
|
+
jt
|
|
333
|
+
], Nt = ["aria-label"], Rt = { class: "wi-output-file-drawer__head" }, Ft = { class: "wi-output-file-drawer__title" }, Dt = { class: "wi-output-file-drawer__ext" }, Bt = ["title"], zt = {
|
|
332
334
|
key: 0,
|
|
333
335
|
class: "wi-output-file-drawer__size"
|
|
334
|
-
},
|
|
336
|
+
}, qt = { class: "wi-output-file-drawer__actions" }, Kt = { class: "wi-output-file-drawer__body" }, Ht = {
|
|
335
337
|
key: 0,
|
|
336
338
|
class: "wi-output-file-drawer__state"
|
|
337
|
-
},
|
|
339
|
+
}, Xt = {
|
|
338
340
|
key: 1,
|
|
339
341
|
class: "wi-output-file-drawer__state is-error"
|
|
340
|
-
},
|
|
342
|
+
}, Gt = {
|
|
341
343
|
key: 2,
|
|
342
344
|
class: "wi-output-file-drawer__state"
|
|
343
|
-
},
|
|
345
|
+
}, Wt = /* @__PURE__ */ oe(() => /* @__PURE__ */ e("p", null, "该文件类型暂不支持在线预览,请下载后查看。", -1)), Yt = ["src", "alt"], Jt = ["src", "title"], Zt = ["srcdoc", "title"], Qt = ["src"], es = ["src"], ts = {
|
|
344
346
|
key: 8,
|
|
345
347
|
class: "wi-output-file-drawer__text"
|
|
346
|
-
},
|
|
348
|
+
}, ss = /* @__PURE__ */ j({
|
|
347
349
|
__name: "OutputFile",
|
|
348
350
|
props: {
|
|
349
351
|
report: {}
|
|
@@ -351,155 +353,155 @@ const De = [
|
|
|
351
353
|
setup(n) {
|
|
352
354
|
const a = n, {
|
|
353
355
|
fileName: c,
|
|
354
|
-
extension:
|
|
355
|
-
previewKind:
|
|
356
|
-
fileSize:
|
|
356
|
+
extension: t,
|
|
357
|
+
previewKind: o,
|
|
358
|
+
fileSize: d,
|
|
357
359
|
visible: w,
|
|
358
|
-
loading:
|
|
360
|
+
loading: $,
|
|
359
361
|
error: b,
|
|
360
362
|
unsupported: g,
|
|
361
363
|
textContent: p,
|
|
362
|
-
objectUrl:
|
|
364
|
+
objectUrl: h,
|
|
363
365
|
open: k,
|
|
364
|
-
close:
|
|
365
|
-
download:
|
|
366
|
-
} =
|
|
367
|
-
return (
|
|
368
|
-
|
|
366
|
+
close: O,
|
|
367
|
+
download: T
|
|
368
|
+
} = It(() => a.report);
|
|
369
|
+
return (N, S) => (l(), u("div", Ct, [
|
|
370
|
+
e("div", {
|
|
369
371
|
class: "wi-output-file__card",
|
|
370
372
|
role: "button",
|
|
371
373
|
tabindex: "0",
|
|
372
|
-
"aria-label": `预览文件 ${
|
|
374
|
+
"aria-label": `预览文件 ${i(c)}`,
|
|
373
375
|
onClick: S[1] || (S[1] = //@ts-ignore
|
|
374
|
-
(
|
|
376
|
+
(...x) => i(k) && i(k)(...x)),
|
|
375
377
|
onKeydown: [
|
|
376
378
|
S[2] || (S[2] = re(
|
|
377
379
|
//@ts-ignore
|
|
378
|
-
(
|
|
380
|
+
(...x) => i(k) && i(k)(...x),
|
|
379
381
|
["enter"]
|
|
380
382
|
)),
|
|
381
383
|
S[3] || (S[3] = re(te(
|
|
382
384
|
//@ts-ignore
|
|
383
|
-
(
|
|
385
|
+
(...x) => i(k) && i(k)(...x),
|
|
384
386
|
["prevent"]
|
|
385
387
|
), ["space"]))
|
|
386
388
|
]
|
|
387
389
|
}, [
|
|
388
|
-
|
|
389
|
-
class:
|
|
390
|
-
},
|
|
391
|
-
|
|
392
|
-
|
|
390
|
+
e("span", {
|
|
391
|
+
class: D(["wi-output-file__icon", `is-${i(o)}`])
|
|
392
|
+
}, Tt, 2),
|
|
393
|
+
e("div", Vt, [
|
|
394
|
+
e("div", {
|
|
393
395
|
class: "wi-output-file__name",
|
|
394
|
-
title:
|
|
395
|
-
},
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
396
|
+
title: i(c)
|
|
397
|
+
}, v(i(c)), 9, Pt),
|
|
398
|
+
e("div", Ut, [
|
|
399
|
+
e("span", Mt, v(i(t).toUpperCase() || "FILE"), 1),
|
|
400
|
+
i(d) ? (l(), u("span", Lt, v(i(d)), 1)) : V("", !0)
|
|
399
401
|
])
|
|
400
402
|
]),
|
|
401
|
-
|
|
403
|
+
e("button", {
|
|
402
404
|
type: "button",
|
|
403
405
|
class: "wi-output-file__download",
|
|
404
406
|
title: "下载文件",
|
|
405
407
|
"aria-label": "下载文件",
|
|
406
408
|
onClick: S[0] || (S[0] = te(
|
|
407
409
|
//@ts-ignore
|
|
408
|
-
(
|
|
410
|
+
(...x) => i(T) && i(T)(...x),
|
|
409
411
|
["stop"]
|
|
410
412
|
))
|
|
411
|
-
},
|
|
412
|
-
], 40,
|
|
413
|
-
(
|
|
414
|
-
|
|
415
|
-
default:
|
|
416
|
-
|
|
413
|
+
}, At)
|
|
414
|
+
], 40, Et),
|
|
415
|
+
(l(), ee(Ce, { to: "body" }, [
|
|
416
|
+
Ee(Oe, { name: "wi-output-file-fade" }, {
|
|
417
|
+
default: Te(() => [
|
|
418
|
+
i(w) ? (l(), u("div", {
|
|
417
419
|
key: 0,
|
|
418
420
|
class: "wi-output-file-mask",
|
|
419
421
|
onClick: S[8] || (S[8] = te(
|
|
420
422
|
//@ts-ignore
|
|
421
|
-
(
|
|
423
|
+
(...x) => i(O) && i(O)(...x),
|
|
422
424
|
["self"]
|
|
423
425
|
))
|
|
424
426
|
}, [
|
|
425
|
-
|
|
427
|
+
e("aside", {
|
|
426
428
|
class: "wi-output-file-drawer",
|
|
427
429
|
role: "dialog",
|
|
428
430
|
"aria-modal": "true",
|
|
429
|
-
"aria-label": `预览文件 ${
|
|
431
|
+
"aria-label": `预览文件 ${i(c)}`
|
|
430
432
|
}, [
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
433
|
+
e("header", Rt, [
|
|
434
|
+
e("div", Ft, [
|
|
435
|
+
e("span", Dt, v(i(t).toUpperCase() || "FILE"), 1),
|
|
436
|
+
e("div", {
|
|
435
437
|
class: "wi-output-file-drawer__name",
|
|
436
|
-
title:
|
|
437
|
-
},
|
|
438
|
-
|
|
438
|
+
title: i(c)
|
|
439
|
+
}, v(i(c)), 9, Bt),
|
|
440
|
+
i(d) ? (l(), u("div", zt, v(i(d)), 1)) : V("", !0)
|
|
439
441
|
]),
|
|
440
|
-
|
|
441
|
-
|
|
442
|
+
e("div", qt, [
|
|
443
|
+
e("button", {
|
|
442
444
|
type: "button",
|
|
443
445
|
class: "wi-output-file-drawer__btn",
|
|
444
446
|
onClick: S[4] || (S[4] = //@ts-ignore
|
|
445
|
-
(
|
|
447
|
+
(...x) => i(T) && i(T)(...x))
|
|
446
448
|
}, "下载"),
|
|
447
|
-
|
|
449
|
+
e("button", {
|
|
448
450
|
type: "button",
|
|
449
451
|
class: "wi-output-file-drawer__btn wi-output-file-drawer__btn--close",
|
|
450
452
|
title: "关闭",
|
|
451
453
|
"aria-label": "关闭预览",
|
|
452
454
|
onClick: S[5] || (S[5] = //@ts-ignore
|
|
453
|
-
(
|
|
455
|
+
(...x) => i(O) && i(O)(...x))
|
|
454
456
|
}, " × ")
|
|
455
457
|
])
|
|
456
458
|
]),
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
459
|
+
e("div", Kt, [
|
|
460
|
+
i($) ? (l(), u("div", Ht, "文件加载中…")) : i(b) ? (l(), u("div", Xt, [
|
|
461
|
+
e("p", null, v(i(b)), 1),
|
|
462
|
+
e("button", {
|
|
461
463
|
type: "button",
|
|
462
464
|
class: "wi-output-file-drawer__btn",
|
|
463
465
|
onClick: S[6] || (S[6] = //@ts-ignore
|
|
464
|
-
(
|
|
466
|
+
(...x) => i(T) && i(T)(...x))
|
|
465
467
|
}, "下载文件")
|
|
466
|
-
])) :
|
|
467
|
-
|
|
468
|
-
|
|
468
|
+
])) : i(g) ? (l(), u("div", Gt, [
|
|
469
|
+
Wt,
|
|
470
|
+
e("button", {
|
|
469
471
|
type: "button",
|
|
470
472
|
class: "wi-output-file-drawer__btn",
|
|
471
473
|
onClick: S[7] || (S[7] = //@ts-ignore
|
|
472
|
-
(
|
|
474
|
+
(...x) => i(T) && i(T)(...x))
|
|
473
475
|
}, "下载文件")
|
|
474
|
-
])) :
|
|
476
|
+
])) : i(o) === "image" && i(h) ? (l(), u("img", {
|
|
475
477
|
key: 3,
|
|
476
478
|
class: "wi-output-file-drawer__image",
|
|
477
|
-
src:
|
|
478
|
-
alt:
|
|
479
|
-
}, null, 8,
|
|
479
|
+
src: i(h),
|
|
480
|
+
alt: i(c)
|
|
481
|
+
}, null, 8, Yt)) : i(o) === "pdf" && i(h) ? (l(), u("iframe", {
|
|
480
482
|
key: 4,
|
|
481
483
|
class: "wi-output-file-drawer__frame",
|
|
482
|
-
src:
|
|
483
|
-
title:
|
|
484
|
-
}, null, 8,
|
|
484
|
+
src: i(h),
|
|
485
|
+
title: i(c)
|
|
486
|
+
}, null, 8, Jt)) : i(o) === "html" ? (l(), u("iframe", {
|
|
485
487
|
key: 5,
|
|
486
488
|
class: "wi-output-file-drawer__frame",
|
|
487
|
-
srcdoc:
|
|
489
|
+
srcdoc: i(p),
|
|
488
490
|
sandbox: "allow-scripts allow-forms allow-modals",
|
|
489
|
-
title:
|
|
490
|
-
}, null, 8,
|
|
491
|
+
title: i(c)
|
|
492
|
+
}, null, 8, Zt)) : i(o) === "audio" && i(h) ? (l(), u("audio", {
|
|
491
493
|
key: 6,
|
|
492
494
|
class: "wi-output-file-drawer__media",
|
|
493
|
-
src:
|
|
495
|
+
src: i(h),
|
|
494
496
|
controls: ""
|
|
495
|
-
}, null, 8,
|
|
497
|
+
}, null, 8, Qt)) : i(o) === "video" && i(h) ? (l(), u("video", {
|
|
496
498
|
key: 7,
|
|
497
499
|
class: "wi-output-file-drawer__media",
|
|
498
|
-
src:
|
|
500
|
+
src: i(h),
|
|
499
501
|
controls: ""
|
|
500
|
-
}, null, 8,
|
|
502
|
+
}, null, 8, es)) : (l(), u("pre", ts, v(i(p)), 1))
|
|
501
503
|
])
|
|
502
|
-
], 8,
|
|
504
|
+
], 8, Nt)
|
|
503
505
|
])) : V("", !0)
|
|
504
506
|
]),
|
|
505
507
|
_: 1
|
|
@@ -507,51 +509,51 @@ const De = [
|
|
|
507
509
|
]))
|
|
508
510
|
]));
|
|
509
511
|
}
|
|
510
|
-
}),
|
|
512
|
+
}), ns = /* @__PURE__ */ A(ss, [["__scopeId", "data-v-f61a91b5"]]), os = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
511
513
|
__proto__: null,
|
|
512
|
-
default:
|
|
513
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
514
|
+
default: ns
|
|
515
|
+
}, Symbol.toStringTag, { value: "Module" })), as = () => {
|
|
514
516
|
var a, c;
|
|
515
517
|
const n = (c = (a = window == null ? void 0 : window.globalConfig) == null ? void 0 : a.WebApiUrl) == null ? void 0 : c.MainUrl;
|
|
516
518
|
return typeof n == "string" ? n : "";
|
|
517
|
-
},
|
|
519
|
+
}, rs = () => window.location.origin + window.location.pathname, ne = "access-session", is = () => {
|
|
518
520
|
const n = window.location.pathname.split("/").filter((a) => !!a).join("-");
|
|
519
521
|
return n ? `${n}-` : "";
|
|
520
|
-
},
|
|
521
|
-
const n = `${
|
|
522
|
-
for (let
|
|
523
|
-
const
|
|
524
|
-
!
|
|
522
|
+
}, ls = () => {
|
|
523
|
+
const n = `${is()}${ne}`, a = [];
|
|
524
|
+
for (let t = 0; t < localStorage.length; t++) {
|
|
525
|
+
const o = localStorage.key(t);
|
|
526
|
+
!o || !o.endsWith(ne) || o.slice(0, o.lastIndexOf(":")) !== "wi admin" && (o.endsWith(`x-${ne}`) || a.push(o));
|
|
525
527
|
}
|
|
526
|
-
const c = a.find((
|
|
528
|
+
const c = a.find((t) => t.endsWith(n)) ?? a[0];
|
|
527
529
|
if (!c)
|
|
528
530
|
return "";
|
|
529
531
|
try {
|
|
530
|
-
const
|
|
531
|
-
if (!
|
|
532
|
+
const t = localStorage.getItem(c);
|
|
533
|
+
if (!t || t === "undefined")
|
|
532
534
|
return "";
|
|
533
|
-
const
|
|
534
|
-
return
|
|
535
|
+
const o = JSON.parse(t);
|
|
536
|
+
return o == null ? "" : String(o);
|
|
535
537
|
} catch {
|
|
536
538
|
return "";
|
|
537
539
|
}
|
|
538
|
-
}, we = Symbol("wi-chat-iframe-page-config"),
|
|
540
|
+
}, we = Symbol("wi-chat-iframe-page-config"), Sn = (n) => {
|
|
539
541
|
_e(we, n);
|
|
540
|
-
},
|
|
541
|
-
const c = (a == null ? void 0 : a.mainUrl) !== void 0 ? String(
|
|
542
|
-
return n.replace(/\{\{\s*MAIN_URL\s*\}\}/g, c).replace(/\{\{\s*SERVE_URL\s*\}\}/g,
|
|
543
|
-
},
|
|
544
|
-
const a = ue() ? ce(we, {}) : {}, c =
|
|
542
|
+
}, us = (n, a) => {
|
|
543
|
+
const c = (a == null ? void 0 : a.mainUrl) !== void 0 ? String(z(a.mainUrl)) : as(), t = (a == null ? void 0 : a.token) !== void 0 ? String(z(a.token)) : ls();
|
|
544
|
+
return n.replace(/\{\{\s*MAIN_URL\s*\}\}/g, c).replace(/\{\{\s*SERVE_URL\s*\}\}/g, rs()).replace(/\{\{\s*token\s*\}\}/g, t);
|
|
545
|
+
}, cs = (n) => {
|
|
546
|
+
const a = ue() ? ce(we, {}) : {}, c = I(() => {
|
|
545
547
|
var w;
|
|
546
|
-
const
|
|
547
|
-
return
|
|
548
|
-
}),
|
|
549
|
-
var
|
|
550
|
-
const
|
|
551
|
-
return ((
|
|
548
|
+
const o = z(n), d = ((w = o == null ? void 0 : o.values) == null ? void 0 : w.url) ?? (o == null ? void 0 : o.url) ?? "";
|
|
549
|
+
return d ? a.resolveUrl ? a.resolveUrl(d) : us(d, a) : "";
|
|
550
|
+
}), t = I(() => {
|
|
551
|
+
var d;
|
|
552
|
+
const o = z(n);
|
|
553
|
+
return ((d = o == null ? void 0 : o.values) == null ? void 0 : d.srcdoc) ?? (o == null ? void 0 : o.srcdoc) ?? "";
|
|
552
554
|
});
|
|
553
|
-
return { url: c, srcdoc:
|
|
554
|
-
},
|
|
555
|
+
return { url: c, srcdoc: t };
|
|
556
|
+
}, le = "data-wi-iframe-resizer-child", ds = (n) => {
|
|
555
557
|
if (!n)
|
|
556
558
|
return !1;
|
|
557
559
|
let a = null;
|
|
@@ -565,33 +567,33 @@ const De = [
|
|
|
565
567
|
const c = a.head || a.documentElement;
|
|
566
568
|
if (!c)
|
|
567
569
|
return !1;
|
|
568
|
-
const
|
|
569
|
-
if (
|
|
570
|
+
const t = a.defaultView;
|
|
571
|
+
if (t != null && t.parentIframe || t != null && t.parentIFrame || a.querySelector(`script[${le}]`))
|
|
570
572
|
return !1;
|
|
571
|
-
const
|
|
572
|
-
return
|
|
573
|
-
},
|
|
573
|
+
const o = a.createElement("script");
|
|
574
|
+
return o.textContent = Re, o.setAttribute(le, ""), c.appendChild(o), !0;
|
|
575
|
+
}, _s = /* @__PURE__ */ j({
|
|
574
576
|
__name: "IframePage",
|
|
575
577
|
props: {
|
|
576
578
|
report: {}
|
|
577
579
|
},
|
|
578
580
|
setup(n) {
|
|
579
|
-
const a = n, { url: c, srcdoc:
|
|
580
|
-
|
|
581
|
+
const a = n, { url: c, srcdoc: t } = cs(() => a.report), o = (d) => {
|
|
582
|
+
ds(d.target);
|
|
581
583
|
};
|
|
582
|
-
return (
|
|
584
|
+
return (d, w) => i(c) ? (l(), ee(ie, {
|
|
583
585
|
key: 0,
|
|
584
586
|
class: "iframe-page__frame iframe-page__frame--url",
|
|
585
587
|
license: "GPLv3",
|
|
586
|
-
src:
|
|
588
|
+
src: i(c),
|
|
587
589
|
width: "100%",
|
|
588
590
|
"warning-timeout": 0,
|
|
589
|
-
onLoad:
|
|
590
|
-
}, null, 8, ["src"])) :
|
|
591
|
+
onLoad: o
|
|
592
|
+
}, null, 8, ["src"])) : i(t) ? (l(), ee(ie, {
|
|
591
593
|
key: 1,
|
|
592
594
|
class: "iframe-page iframe-page--srcdoc",
|
|
593
595
|
license: "GPLv3",
|
|
594
|
-
srcdoc:
|
|
596
|
+
srcdoc: i(t),
|
|
595
597
|
width: "100%",
|
|
596
598
|
frameborder: "no",
|
|
597
599
|
border: "0",
|
|
@@ -600,45 +602,45 @@ const De = [
|
|
|
600
602
|
scrolling: "no"
|
|
601
603
|
}, null, 8, ["srcdoc"])) : V("", !0);
|
|
602
604
|
}
|
|
603
|
-
}),
|
|
605
|
+
}), ps = /* @__PURE__ */ A(_s, [["__scopeId", "data-v-f4c94a4e"]]), fs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
604
606
|
__proto__: null,
|
|
605
|
-
default:
|
|
606
|
-
}, Symbol.toStringTag, { value: "Module" })), ae = (n) => (
|
|
607
|
+
default: ps
|
|
608
|
+
}, Symbol.toStringTag, { value: "Module" })), ae = (n) => (H("data-v-74053305"), n = n(), X(), n), vs = { class: "wi-clarify__header" }, ws = { class: "wi-clarify__heading" }, ys = /* @__PURE__ */ ae(() => /* @__PURE__ */ e("div", { class: "wi-clarify__eyebrow" }, "需要补充信息", -1)), hs = { class: "wi-clarify__title" }, ms = {
|
|
607
609
|
key: 0,
|
|
608
610
|
class: "wi-clarify__desc"
|
|
609
|
-
},
|
|
611
|
+
}, bs = { class: "wi-clarify__status" }, gs = { class: "wi-clarify__progress" }, ks = { class: "wi-clarify__progress-track" }, Ss = {
|
|
610
612
|
key: 0,
|
|
611
613
|
class: "wi-clarify__panel"
|
|
612
|
-
},
|
|
614
|
+
}, $s = { class: "wi-clarify__question" }, xs = {
|
|
613
615
|
key: 0,
|
|
614
616
|
class: "wi-clarify__question-desc"
|
|
615
|
-
},
|
|
617
|
+
}, Is = {
|
|
616
618
|
key: 1,
|
|
617
619
|
class: "wi-clarify__binding"
|
|
618
|
-
},
|
|
620
|
+
}, Cs = {
|
|
619
621
|
key: 2,
|
|
620
622
|
class: "wi-clarify__options"
|
|
621
|
-
},
|
|
623
|
+
}, Es = ["onClick"], Os = { class: "wi-clarify__option-indicator" }, Ts = {
|
|
622
624
|
key: 3,
|
|
623
625
|
class: "wi-clarify__date"
|
|
624
|
-
},
|
|
626
|
+
}, Vs = ["for"], Ps = ["id", "value"], Us = { class: "wi-clarify__text" }, Ms = {
|
|
625
627
|
key: 0,
|
|
626
628
|
class: "wi-clarify__or"
|
|
627
|
-
}, Ls = /* @__PURE__ */ ae(() => /* @__PURE__ */
|
|
629
|
+
}, Ls = /* @__PURE__ */ ae(() => /* @__PURE__ */ e("span", null, "或者,用自己的话说明", -1)), js = [
|
|
628
630
|
Ls
|
|
629
|
-
],
|
|
631
|
+
], As = ["for"], Ns = ["id", "value", "placeholder"], Rs = {
|
|
630
632
|
class: "wi-clarify__dots",
|
|
631
633
|
"aria-label": "确认问题导航"
|
|
632
|
-
},
|
|
634
|
+
}, Fs = ["aria-label", "onClick"], Ds = { class: "wi-clarify__footer" }, Bs = /* @__PURE__ */ ae(() => /* @__PURE__ */ e("span", { class: "wi-clarify__confirm-text" }, "取消后本次操作将停止等待这些回答", -1)), zs = { class: "wi-clarify__actions" }, qs = { class: "wi-clarify__actions" }, Ks = ["disabled"], Hs = {
|
|
633
635
|
key: 1,
|
|
634
636
|
class: "wi-clarify__result"
|
|
635
|
-
},
|
|
637
|
+
}, Xs = { class: "wi-clarify__result-icon" }, Gs = { class: "wi-clarify__result-body" }, Ws = {
|
|
636
638
|
key: 0,
|
|
637
639
|
class: "wi-clarify__summary"
|
|
638
|
-
},
|
|
640
|
+
}, Ys = { key: 1 }, Js = { key: 2 }, Zs = {
|
|
639
641
|
key: 2,
|
|
640
642
|
class: "wi-clarify__feedback"
|
|
641
|
-
},
|
|
643
|
+
}, Qs = /* @__PURE__ */ j({
|
|
642
644
|
__name: "ClarificationCard",
|
|
643
645
|
props: {
|
|
644
646
|
report: {}
|
|
@@ -651,246 +653,290 @@ const De = [
|
|
|
651
653
|
items: [],
|
|
652
654
|
status: "expired",
|
|
653
655
|
resultMessage: "本次补充信息已失效(回答已结束)"
|
|
654
|
-
},
|
|
656
|
+
}, t = I(() => a.report.values ?? c), o = I(() => t.value.items ?? []), d = U(0), w = Ve({}), $ = U(!1), b = U("");
|
|
655
657
|
de(() => {
|
|
656
|
-
var
|
|
657
|
-
return (
|
|
658
|
+
var s;
|
|
659
|
+
return (s = t.value) == null ? void 0 : s.requestId;
|
|
658
660
|
}, () => {
|
|
659
|
-
Object.keys(w).forEach((
|
|
660
|
-
const
|
|
661
|
-
|
|
662
|
-
}),
|
|
661
|
+
Object.keys(w).forEach((s) => delete w[s]), o.value.forEach((s) => {
|
|
662
|
+
const r = { structuredValue: void 0, structuredValues: [], textValue: "" };
|
|
663
|
+
s.default !== void 0 && (s.input.type === "multi_select" ? r.structuredValues = Array.isArray(s.default) ? [...s.default] : [] : s.input.type === "text" ? r.textValue = String(s.default) : r.structuredValue = s.default), w[s.id] = r;
|
|
664
|
+
}), d.value = 0;
|
|
663
665
|
}, { immediate: !0 });
|
|
664
|
-
const p = (
|
|
665
|
-
var
|
|
666
|
-
return ((
|
|
667
|
-
}), k = (
|
|
666
|
+
const p = (s) => (w[s] || (w[s] = { structuredValue: void 0, structuredValues: [], textValue: "" }), w[s]), h = I(() => {
|
|
667
|
+
var s, r, f;
|
|
668
|
+
return ((s = t.value) == null ? void 0 : s.status) === "submitted" ? "已提交" : ((r = t.value) == null ? void 0 : r.status) === "cancelled" ? "已取消" : ((f = t.value) == null ? void 0 : f.status) === "expired" ? "已失效" : "等待回答";
|
|
669
|
+
}), k = (s) => {
|
|
668
670
|
try {
|
|
669
|
-
const
|
|
670
|
-
return
|
|
671
|
+
const r = JSON.stringify(s);
|
|
672
|
+
return r === void 0 ? String(s) : r;
|
|
671
673
|
} catch {
|
|
672
|
-
return String(
|
|
674
|
+
return String(s);
|
|
673
675
|
}
|
|
674
|
-
},
|
|
675
|
-
const f = p(
|
|
676
|
-
return
|
|
677
|
-
},
|
|
678
|
-
const f = p(
|
|
679
|
-
if (f.textValue = "",
|
|
680
|
-
const
|
|
681
|
-
|
|
676
|
+
}, O = (s, r) => k(s) === k(r), T = (s, r) => {
|
|
677
|
+
const f = p(s.id);
|
|
678
|
+
return s.input.type === "multi_select" ? f.structuredValues.some((m) => O(m, r)) : O(f.structuredValue, r);
|
|
679
|
+
}, N = (s, r) => {
|
|
680
|
+
const f = p(s.id);
|
|
681
|
+
if (f.textValue = "", s.input.type === "multi_select") {
|
|
682
|
+
const m = f.structuredValues.findIndex((P) => O(P, r));
|
|
683
|
+
m >= 0 ? f.structuredValues.splice(m, 1) : f.structuredValues.push(r);
|
|
682
684
|
return;
|
|
683
685
|
}
|
|
684
|
-
f.structuredValue =
|
|
685
|
-
}, S = (
|
|
686
|
-
var
|
|
687
|
-
return ((
|
|
688
|
-
},
|
|
689
|
-
const f = p(
|
|
690
|
-
f.textValue = S(
|
|
691
|
-
},
|
|
692
|
-
const f = p(
|
|
693
|
-
f.structuredValue = S(
|
|
694
|
-
},
|
|
695
|
-
const
|
|
696
|
-
return
|
|
697
|
-
},
|
|
698
|
-
var
|
|
699
|
-
return ((
|
|
700
|
-
},
|
|
701
|
-
const
|
|
702
|
-
if (!
|
|
686
|
+
f.structuredValue = r;
|
|
687
|
+
}, S = (s) => {
|
|
688
|
+
var r;
|
|
689
|
+
return ((r = s.target) == null ? void 0 : r.value) ?? "";
|
|
690
|
+
}, x = (s, r) => {
|
|
691
|
+
const f = p(s.id);
|
|
692
|
+
f.textValue = S(r), s.input.type !== "text" && (f.structuredValue = void 0, f.structuredValues.splice(0));
|
|
693
|
+
}, G = (s, r) => {
|
|
694
|
+
const f = p(s.id);
|
|
695
|
+
f.structuredValue = S(r), f.textValue = "";
|
|
696
|
+
}, W = (s) => {
|
|
697
|
+
const r = p(s.id).structuredValue;
|
|
698
|
+
return r == null ? "" : String(r);
|
|
699
|
+
}, q = (s) => {
|
|
700
|
+
var r;
|
|
701
|
+
return ((r = s.input.textInput) == null ? void 0 : r.placeholder) ?? s.input.placeholder ?? (s.input.type === "text" ? "请输入需要补充的信息" : "例如:使用阀门,或者说明你的具体要求");
|
|
702
|
+
}, _ = (s) => {
|
|
703
|
+
const r = s.binding;
|
|
704
|
+
if (!r)
|
|
703
705
|
return "";
|
|
704
|
-
const f =
|
|
705
|
-
return [f,
|
|
706
|
-
},
|
|
707
|
-
const
|
|
708
|
-
return
|
|
709
|
-
},
|
|
710
|
-
b.value = "",
|
|
711
|
-
},
|
|
712
|
-
!
|
|
713
|
-
},
|
|
714
|
-
var
|
|
715
|
-
const
|
|
716
|
-
return (
|
|
717
|
-
}).filter(Boolean).join("、"),
|
|
718
|
-
const
|
|
719
|
-
if (
|
|
720
|
-
return { id:
|
|
721
|
-
const
|
|
706
|
+
const f = r.actionName ? `动作:${r.actionName}` : "", m = r.parameterPath ? `参数:${r.parameterPath}` : "";
|
|
707
|
+
return [f, m].filter(Boolean).join(" · ");
|
|
708
|
+
}, C = (s) => {
|
|
709
|
+
const r = p(s.id);
|
|
710
|
+
return s.input.type === "multi_select" ? r.structuredValues.length > 0 : s.input.type === "single_select" ? r.structuredValue !== void 0 : s.input.type === "date" ? !!r.structuredValue : !1;
|
|
711
|
+
}, E = (s) => !!p(s.id).textValue.trim() || C(s), Y = (s) => !s.required || E(s) ? !0 : (b.value = `请回答“${s.question}”`, !1), R = () => {
|
|
712
|
+
b.value = "", d.value = Math.max(0, d.value - 1);
|
|
713
|
+
}, L = () => {
|
|
714
|
+
!y.value || !Y(y.value) || (b.value = "", d.value = Math.min(o.value.length - 1, d.value + 1));
|
|
715
|
+
}, y = I(() => o.value[d.value]), J = (s, r) => s.input.type === "date" ? String(r ?? "") : (Array.isArray(r) ? r : [r]).map((m) => {
|
|
716
|
+
var Q;
|
|
717
|
+
const P = (Q = s.input.options) == null ? void 0 : Q.find((ge) => O(ge.value, m));
|
|
718
|
+
return (P == null ? void 0 : P.label) ?? String(m ?? "");
|
|
719
|
+
}).filter(Boolean).join("、"), Z = (s) => {
|
|
720
|
+
const r = p(s.id), f = r.textValue.trim();
|
|
721
|
+
if (s.input.type === "text" || f || !C(s))
|
|
722
|
+
return { id: s.id, mode: "text", value: f, displayText: f };
|
|
723
|
+
const m = s.input.type === "multi_select" ? [...r.structuredValues] : r.structuredValue;
|
|
722
724
|
return {
|
|
723
|
-
id:
|
|
725
|
+
id: s.id,
|
|
724
726
|
mode: "structured",
|
|
725
|
-
value:
|
|
726
|
-
displayText:
|
|
727
|
+
value: m,
|
|
728
|
+
displayText: J(s, m)
|
|
727
729
|
};
|
|
728
|
-
},
|
|
729
|
-
const
|
|
730
|
-
if (
|
|
731
|
-
|
|
730
|
+
}, he = () => {
|
|
731
|
+
const s = o.value.findIndex((f) => f.required && !E(f));
|
|
732
|
+
if (s >= 0) {
|
|
733
|
+
d.value = s, b.value = `请回答“${o.value[s].question}”`;
|
|
732
734
|
return;
|
|
733
735
|
}
|
|
734
736
|
b.value = "";
|
|
735
|
-
const
|
|
736
|
-
|
|
737
|
-
},
|
|
738
|
-
|
|
739
|
-
},
|
|
740
|
-
var
|
|
741
|
-
return ((
|
|
737
|
+
const r = o.value.map(Z);
|
|
738
|
+
Fe(t.value.requestId, r) || (b.value = "本次补充信息已经处理");
|
|
739
|
+
}, me = () => {
|
|
740
|
+
$.value = !1, b.value = "", De(t.value.requestId) || (b.value = "本次补充信息已经处理");
|
|
741
|
+
}, be = (s) => {
|
|
742
|
+
var r;
|
|
743
|
+
return ((r = o.value.find((f) => f.id === s)) == null ? void 0 : r.question) ?? s;
|
|
742
744
|
};
|
|
743
|
-
return (
|
|
745
|
+
return (s, r) => {
|
|
744
746
|
var f;
|
|
745
|
-
return
|
|
746
|
-
class:
|
|
747
|
+
return l(), u("section", {
|
|
748
|
+
class: D(["wi-clarify", `is-${t.value.status}`])
|
|
747
749
|
}, [
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
750
|
+
e("header", vs, [
|
|
751
|
+
e("div", ws, [
|
|
752
|
+
ys,
|
|
753
|
+
e("h3", hs, v(t.value.title), 1),
|
|
754
|
+
t.value.description ? (l(), u("p", ms, v(t.value.description), 1)) : V("", !0)
|
|
753
755
|
]),
|
|
754
|
-
|
|
756
|
+
e("span", bs, v(h.value), 1)
|
|
755
757
|
]),
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
style:
|
|
758
|
+
t.value.status === "pending" ? (l(), u(M, { key: 0 }, [
|
|
759
|
+
e("div", gs, [
|
|
760
|
+
e("span", null, "问题 " + v(d.value + 1) + " / " + v(o.value.length), 1),
|
|
761
|
+
e("div", ks, [
|
|
762
|
+
e("span", {
|
|
763
|
+
style: Pe({ width: `${(d.value + 1) / o.value.length * 100}%` })
|
|
762
764
|
}, null, 4)
|
|
763
765
|
])
|
|
764
766
|
]),
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
class:
|
|
769
|
-
},
|
|
770
|
-
|
|
767
|
+
y.value ? (l(), u("div", Ss, [
|
|
768
|
+
e("div", $s, [
|
|
769
|
+
e("span", {
|
|
770
|
+
class: D(y.value.required ? "wi-clarify__required" : "wi-clarify__optional")
|
|
771
|
+
}, v(y.value.required ? "必填" : "选填"), 3),
|
|
772
|
+
e("h4", null, v(y.value.question), 1)
|
|
771
773
|
]),
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
(
|
|
776
|
-
key:
|
|
774
|
+
y.value.description ? (l(), u("p", xs, v(y.value.description), 1)) : V("", !0),
|
|
775
|
+
_(y.value) ? (l(), u("div", Is, v(_(y.value)), 1)) : V("", !0),
|
|
776
|
+
y.value.input.type === "single_select" || y.value.input.type === "multi_select" ? (l(), u("div", Cs, [
|
|
777
|
+
(l(!0), u(M, null, B(y.value.input.options, (m, P) => (l(), u("button", {
|
|
778
|
+
key: P,
|
|
777
779
|
type: "button",
|
|
778
|
-
class:
|
|
779
|
-
onClick: (
|
|
780
|
+
class: D(["wi-clarify__option", { "is-selected": T(y.value, m.value) }]),
|
|
781
|
+
onClick: (Q) => N(y.value, m.value)
|
|
780
782
|
}, [
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
], 10,
|
|
784
|
-
])) :
|
|
785
|
-
|
|
786
|
-
for: `wi-clarify-date-${
|
|
787
|
-
}, "选择日期", 8,
|
|
788
|
-
|
|
789
|
-
id: `wi-clarify-date-${
|
|
783
|
+
e("span", Os, v(T(y.value, m.value) ? "✓" : ""), 1),
|
|
784
|
+
e("span", null, v(m.label), 1)
|
|
785
|
+
], 10, Es))), 128))
|
|
786
|
+
])) : y.value.input.type === "date" ? (l(), u("div", Ts, [
|
|
787
|
+
e("label", {
|
|
788
|
+
for: `wi-clarify-date-${y.value.id}`
|
|
789
|
+
}, "选择日期", 8, Vs),
|
|
790
|
+
e("input", {
|
|
791
|
+
id: `wi-clarify-date-${y.value.id}`,
|
|
790
792
|
type: "date",
|
|
791
|
-
value:
|
|
792
|
-
onInput:
|
|
793
|
-
}, null, 40,
|
|
793
|
+
value: W(y.value),
|
|
794
|
+
onInput: r[0] || (r[0] = (m) => G(y.value, m))
|
|
795
|
+
}, null, 40, Ps)
|
|
794
796
|
])) : V("", !0),
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
for: `wi-clarify-text-${
|
|
799
|
-
},
|
|
800
|
-
|
|
801
|
-
id: `wi-clarify-text-${
|
|
802
|
-
value: p(
|
|
803
|
-
placeholder:
|
|
797
|
+
e("div", Us, [
|
|
798
|
+
y.value.input.type !== "text" ? (l(), u("div", Ms, js)) : V("", !0),
|
|
799
|
+
e("label", {
|
|
800
|
+
for: `wi-clarify-text-${y.value.id}`
|
|
801
|
+
}, v(y.value.input.type === "text" ? "你的回答" : "自然语言回答"), 9, As),
|
|
802
|
+
e("textarea", {
|
|
803
|
+
id: `wi-clarify-text-${y.value.id}`,
|
|
804
|
+
value: p(y.value.id).textValue,
|
|
805
|
+
placeholder: q(y.value),
|
|
804
806
|
rows: "3",
|
|
805
|
-
onInput:
|
|
806
|
-
}, null, 40,
|
|
807
|
+
onInput: r[1] || (r[1] = (m) => x(y.value, m))
|
|
808
|
+
}, null, 40, Ns)
|
|
807
809
|
])
|
|
808
810
|
])) : V("", !0),
|
|
809
|
-
|
|
810
|
-
(
|
|
811
|
-
key:
|
|
811
|
+
e("div", Rs, [
|
|
812
|
+
(l(!0), u(M, null, B(o.value, (m, P) => (l(), u("button", {
|
|
813
|
+
key: m.id,
|
|
812
814
|
type: "button",
|
|
813
|
-
"aria-label": `查看第 ${
|
|
814
|
-
class:
|
|
815
|
-
onClick: (
|
|
816
|
-
}, null, 10,
|
|
815
|
+
"aria-label": `查看第 ${P + 1} 个问题`,
|
|
816
|
+
class: D({ "is-active": P === d.value, "is-answered": E(m) }),
|
|
817
|
+
onClick: (Q) => d.value = P
|
|
818
|
+
}, null, 10, Fs))), 128))
|
|
817
819
|
]),
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
820
|
+
e("footer", Ds, [
|
|
821
|
+
$.value ? (l(), u(M, { key: 0 }, [
|
|
822
|
+
Bs,
|
|
823
|
+
e("div", zs, [
|
|
824
|
+
e("button", {
|
|
823
825
|
type: "button",
|
|
824
826
|
class: "wi-clarify__btn wi-clarify__btn--secondary",
|
|
825
|
-
onClick:
|
|
827
|
+
onClick: r[2] || (r[2] = (m) => $.value = !1)
|
|
826
828
|
}, " 继续填写 "),
|
|
827
|
-
|
|
829
|
+
e("button", {
|
|
828
830
|
type: "button",
|
|
829
831
|
class: "wi-clarify__btn wi-clarify__btn--danger",
|
|
830
|
-
onClick:
|
|
832
|
+
onClick: me
|
|
831
833
|
}, "确认取消")
|
|
832
834
|
])
|
|
833
|
-
], 64)) : (
|
|
834
|
-
|
|
835
|
+
], 64)) : (l(), u(M, { key: 1 }, [
|
|
836
|
+
e("button", {
|
|
835
837
|
type: "button",
|
|
836
838
|
class: "wi-clarify__cancel",
|
|
837
|
-
onClick:
|
|
839
|
+
onClick: r[3] || (r[3] = (m) => $.value = !0)
|
|
838
840
|
}, "取消"),
|
|
839
|
-
|
|
840
|
-
|
|
841
|
+
e("div", qs, [
|
|
842
|
+
e("button", {
|
|
841
843
|
type: "button",
|
|
842
844
|
class: "wi-clarify__btn wi-clarify__btn--secondary",
|
|
843
|
-
disabled:
|
|
845
|
+
disabled: d.value === 0,
|
|
844
846
|
onClick: R
|
|
845
|
-
}, " 上一项 ", 8,
|
|
846
|
-
|
|
847
|
+
}, " 上一项 ", 8, Ks),
|
|
848
|
+
d.value < o.value.length - 1 ? (l(), u("button", {
|
|
847
849
|
key: 0,
|
|
848
850
|
type: "button",
|
|
849
851
|
class: "wi-clarify__btn wi-clarify__btn--primary",
|
|
850
|
-
onClick:
|
|
851
|
-
}, " 下一项 ")) : (
|
|
852
|
+
onClick: L
|
|
853
|
+
}, " 下一项 ")) : (l(), u("button", {
|
|
852
854
|
key: 1,
|
|
853
855
|
type: "button",
|
|
854
856
|
class: "wi-clarify__btn wi-clarify__btn--primary",
|
|
855
|
-
onClick:
|
|
857
|
+
onClick: he
|
|
856
858
|
}, "提交全部"))
|
|
857
859
|
])
|
|
858
860
|
], 64))
|
|
859
861
|
])
|
|
860
|
-
], 64)) : (
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
(
|
|
866
|
-
key:
|
|
862
|
+
], 64)) : (l(), u("div", Hs, [
|
|
863
|
+
e("div", Xs, v(t.value.status === "submitted" ? "✓" : t.value.status === "cancelled" ? "—" : "!"), 1),
|
|
864
|
+
e("div", Gs, [
|
|
865
|
+
e("h4", null, v(t.value.resultMessage || h.value), 1),
|
|
866
|
+
t.value.status === "submitted" && ((f = t.value.answers) != null && f.length) ? (l(), u("div", Ws, [
|
|
867
|
+
(l(!0), u(M, null, B(t.value.answers, (m) => (l(), u("div", {
|
|
868
|
+
key: m.id
|
|
867
869
|
}, [
|
|
868
|
-
|
|
869
|
-
|
|
870
|
+
e("span", null, v(be(m.id)), 1),
|
|
871
|
+
e("strong", null, v(m.displayText || "未填写"), 1)
|
|
870
872
|
]))), 128))
|
|
871
|
-
])) :
|
|
873
|
+
])) : t.value.status === "cancelled" ? (l(), u("p", Ys, "本次确认未提交,工作流将收到取消结果。")) : (l(), u("p", Js, "该确认项已失效,无法再提交。"))
|
|
872
874
|
])
|
|
873
875
|
])),
|
|
874
|
-
b.value ? (
|
|
876
|
+
b.value ? (l(), u("div", Zs, v(b.value), 1)) : V("", !0)
|
|
875
877
|
], 2);
|
|
876
878
|
};
|
|
877
879
|
}
|
|
878
|
-
}),
|
|
880
|
+
}), en = /* @__PURE__ */ A(Qs, [["__scopeId", "data-v-74053305"]]), tn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
881
|
+
__proto__: null,
|
|
882
|
+
default: en
|
|
883
|
+
}, Symbol.toStringTag, { value: "Module" })), ye = (n) => (H("data-v-14805363"), n = n(), X(), n), sn = { class: "wi-agent-action__head" }, nn = {
|
|
884
|
+
class: "wi-agent-action__icon",
|
|
885
|
+
"aria-hidden": "true"
|
|
886
|
+
}, on = { class: "wi-agent-action__title" }, an = /* @__PURE__ */ ye(() => /* @__PURE__ */ e("span", { class: "wi-agent-action__label" }, "执行操作", -1)), rn = { class: "wi-agent-action__name" }, ln = { class: "wi-agent-action__chip" }, un = { class: "wi-agent-action__message" }, cn = {
|
|
887
|
+
key: 0,
|
|
888
|
+
class: "wi-agent-action__args"
|
|
889
|
+
}, dn = /* @__PURE__ */ ye(() => /* @__PURE__ */ e("summary", null, "查看参数", -1)), _n = /* @__PURE__ */ j({
|
|
890
|
+
__name: "AgentActionStatus",
|
|
891
|
+
props: {
|
|
892
|
+
report: {}
|
|
893
|
+
},
|
|
894
|
+
setup(n) {
|
|
895
|
+
const a = n, c = {
|
|
896
|
+
id: "",
|
|
897
|
+
name: "",
|
|
898
|
+
arguments: {},
|
|
899
|
+
status: "unknown",
|
|
900
|
+
message: "执行状态未知(回答已结束)"
|
|
901
|
+
}, t = I(() => a.report.values ?? c), o = I(() => t.value.status === "running" ? "●" : t.value.status === "success" ? "✓" : t.value.status === "error" ? "!" : "?"), d = I(() => t.value.status === "running" ? "执行中" : t.value.status === "success" ? "已完成" : t.value.status === "error" ? "执行失败" : "状态未知"), w = I(() => {
|
|
902
|
+
const b = t.value.arguments;
|
|
903
|
+
return !!b && typeof b == "object" && Object.keys(b).length > 0;
|
|
904
|
+
}), $ = I(() => JSON.stringify(t.value.arguments ?? {}, null, 2));
|
|
905
|
+
return (b, g) => (l(), u("section", {
|
|
906
|
+
class: D(["wi-agent-action", `is-${t.value.status}`])
|
|
907
|
+
}, [
|
|
908
|
+
e("header", sn, [
|
|
909
|
+
e("span", nn, v(o.value), 1),
|
|
910
|
+
e("div", on, [
|
|
911
|
+
an,
|
|
912
|
+
e("code", rn, v(t.value.name || "未知操作"), 1)
|
|
913
|
+
]),
|
|
914
|
+
e("span", ln, v(d.value), 1)
|
|
915
|
+
]),
|
|
916
|
+
e("p", un, v(t.value.message || d.value), 1),
|
|
917
|
+
w.value ? (l(), u("details", cn, [
|
|
918
|
+
dn,
|
|
919
|
+
e("pre", null, v($.value), 1)
|
|
920
|
+
])) : V("", !0)
|
|
921
|
+
], 2));
|
|
922
|
+
}
|
|
923
|
+
}), pn = /* @__PURE__ */ A(_n, [["__scopeId", "data-v-14805363"]]), fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
879
924
|
__proto__: null,
|
|
880
|
-
default:
|
|
925
|
+
default: pn
|
|
881
926
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
882
927
|
export {
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
928
|
+
pn as AgentActionStatus,
|
|
929
|
+
bn as AiAnswerBubble,
|
|
930
|
+
en as ClarificationCard,
|
|
931
|
+
gn as DeepThinkingSteps,
|
|
932
|
+
ps as IframePage,
|
|
933
|
+
pt as KnowledgeStreamResult,
|
|
934
|
+
ns as OutputFile,
|
|
935
|
+
qe as createAnswerContentMap,
|
|
936
|
+
ds as injectIframeResizerChild,
|
|
937
|
+
Sn as provideIframePageConfig,
|
|
938
|
+
kn as provideOutputFileConfig,
|
|
939
|
+
us as resolveIframePlaceholders,
|
|
940
|
+
cs as useIframePage
|
|
895
941
|
};
|
|
896
942
|
//# sourceMappingURL=index.js.map
|