@skopon-cool/form-sdk 0.3.2 → 0.4.1
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/catalog/skoponCaseSelect.d.ts.map +1 -1
- package/dist/catalog/skoponResumeSelect.d.ts.map +1 -1
- package/dist/components/AskUserFormCard.d.ts.map +1 -1
- package/dist/index.js +1386 -1173
- package/dist/runtime/buildFormRuntimeSnapshot.d.ts +16 -0
- package/dist/runtime/buildFormRuntimeSnapshot.d.ts.map +1 -0
- package/dist/runtime/formLiveOptionsContext.d.ts +20 -0
- package/dist/runtime/formLiveOptionsContext.d.ts.map +1 -0
- package/dist/runtime/formRuntimeConnection.d.ts +35 -0
- package/dist/runtime/formRuntimeConnection.d.ts.map +1 -0
- package/dist/runtime/formRuntimeContext.d.ts +2 -2
- package/dist/runtime/formRuntimeContext.d.ts.map +1 -1
- package/dist/runtime/formRuntimeWs.d.ts +8 -15
- package/dist/runtime/formRuntimeWs.d.ts.map +1 -1
- package/dist/runtime/types.d.ts +11 -0
- package/dist/runtime/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/catalog/skoponCaseSelect.tsx +12 -1
- package/src/catalog/skoponResumeSelect.tsx +12 -1
- package/src/components/AskUserFormCard.tsx +112 -13
- package/src/runtime/buildFormRuntimeSnapshot.test.ts +97 -0
- package/src/runtime/buildFormRuntimeSnapshot.ts +61 -0
- package/src/runtime/formLiveOptionsContext.tsx +118 -0
- package/src/runtime/formRuntimeConnection.test.ts +155 -0
- package/src/runtime/formRuntimeConnection.ts +251 -0
- package/src/runtime/formRuntimeContext.tsx +13 -11
- package/src/runtime/formRuntimeWs.ts +24 -134
- package/src/runtime/types.ts +12 -0
package/dist/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import './form-sdk.css';
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
import { jsx as
|
|
6
|
-
import {
|
|
7
|
-
import { Spin as
|
|
8
|
-
import { ReloadOutlined as
|
|
9
|
-
import { createBinderlessComponentImplementation as
|
|
10
|
-
import { z as
|
|
11
|
-
import { Catalog as
|
|
12
|
-
import { injectBasicCatalogStyles as
|
|
13
|
-
import { injectStyles as
|
|
14
|
-
import
|
|
15
|
-
const
|
|
2
|
+
var Fn = Object.defineProperty;
|
|
3
|
+
var En = (e, t, n) => t in e ? Fn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
|
|
4
|
+
var G = (e, t, n) => En(e, typeof t != "symbol" ? t + "" : t, n);
|
|
5
|
+
import { jsx as u, jsxs as I } from "react/jsx-runtime";
|
|
6
|
+
import { useRef as A, useState as R, useCallback as $, useMemo as j, createContext as ye, useContext as ve, useEffect as z, useSyncExternalStore as Un, forwardRef as Rn, useImperativeHandle as wn } from "react";
|
|
7
|
+
import { Spin as mt, Button as ze, Typography as te, Avatar as Pn, Tag as fe, Select as ot, Checkbox as zn, Radio as On, Switch as qn, TimePicker as Bn, DatePicker as Ln, Upload as Je, Input as We, InputNumber as Vn, ConfigProvider as jn, Tooltip as pe } from "antd";
|
|
8
|
+
import { ReloadOutlined as Gt, FileTextOutlined as Jt, UserOutlined as $n, FileImageOutlined as Dn, FileExcelOutlined as Hn, FileOutlined as Wt, PictureOutlined as Kn, SoundOutlined as Gn, VideoCameraOutlined as Jn } from "@ant-design/icons";
|
|
9
|
+
import { createBinderlessComponentImplementation as Q, basicCatalog as Ee, A2uiSurface as Yt } from "@a2ui/react/v0_9";
|
|
10
|
+
import { z as h } from "zod";
|
|
11
|
+
import { Catalog as Wn, MessageProcessor as Qt } from "@a2ui/web_core/v0_9";
|
|
12
|
+
import { injectBasicCatalogStyles as Xt } from "@a2ui/web_core/v0_9/basic_catalog";
|
|
13
|
+
import { injectStyles as Zt } from "@a2ui/react/styles";
|
|
14
|
+
import Lt from "dayjs";
|
|
15
|
+
const ns = "v0.9", Yn = [
|
|
16
16
|
"huge",
|
|
17
17
|
"large",
|
|
18
18
|
"medium",
|
|
19
19
|
"small",
|
|
20
20
|
"icon"
|
|
21
21
|
];
|
|
22
|
-
function
|
|
22
|
+
function Ue(e) {
|
|
23
23
|
return e === "image" || e === "video" || e === "audio";
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function Oe(e) {
|
|
26
26
|
return e === "heading" || e === "paragraph";
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
return !
|
|
28
|
+
function ae(e) {
|
|
29
|
+
return !Oe(e) && !Ue(e);
|
|
30
30
|
}
|
|
31
|
-
function
|
|
31
|
+
function Qn() {
|
|
32
32
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
33
33
|
return crypto.randomUUID();
|
|
34
34
|
if (typeof crypto < "u" && typeof crypto.getRandomValues == "function") {
|
|
@@ -42,11 +42,11 @@ function Bn() {
|
|
|
42
42
|
return (e === "x" ? t : t & 3 | 8).toString(16);
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
function
|
|
46
|
-
const t =
|
|
45
|
+
function Se(e) {
|
|
46
|
+
const t = Qn().replace(/-/g, "").slice(0, 8);
|
|
47
47
|
return `${e}${t}`;
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const en = [
|
|
50
50
|
{ value: "image/*", label: "图片" },
|
|
51
51
|
{ value: "video/*", label: "视频" },
|
|
52
52
|
{ value: "audio/*", label: "音频" },
|
|
@@ -57,7 +57,7 @@ const Vt = [
|
|
|
57
57
|
{ value: "text/plain", label: "纯文本" },
|
|
58
58
|
{ value: "application/zip", label: "ZIP 压缩包" },
|
|
59
59
|
{ value: "application/x-rar-compressed", label: "RAR 压缩包" }
|
|
60
|
-
],
|
|
60
|
+
], Xn = {
|
|
61
61
|
"image/*": ["image/*"],
|
|
62
62
|
"video/*": ["video/*"],
|
|
63
63
|
"audio/*": ["audio/*"],
|
|
@@ -77,7 +77,7 @@ const Vt = [
|
|
|
77
77
|
"text/plain": ["text/plain"],
|
|
78
78
|
"application/zip": ["application/zip"],
|
|
79
79
|
"application/x-rar-compressed": ["application/x-rar-compressed"]
|
|
80
|
-
},
|
|
80
|
+
}, Zn = {
|
|
81
81
|
"image/*": [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg"],
|
|
82
82
|
"video/*": [".mp4", ".mov", ".avi", ".webm"],
|
|
83
83
|
"audio/*": [".mp3", ".wav", ".ogg", ".m4a"],
|
|
@@ -88,14 +88,14 @@ const Vt = [
|
|
|
88
88
|
"text/plain": [".txt"],
|
|
89
89
|
"application/zip": [".zip", ".7z"],
|
|
90
90
|
"application/x-rar-compressed": [".rar"]
|
|
91
|
-
},
|
|
91
|
+
}, er = {
|
|
92
92
|
"application/msword": "office/word",
|
|
93
93
|
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "office/word",
|
|
94
94
|
"application/vnd.ms-excel": "office/excel",
|
|
95
95
|
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": "office/excel",
|
|
96
96
|
"application/vnd.ms-powerpoint": "office/ppt",
|
|
97
97
|
"application/vnd.openxmlformats-officedocument.presentationml.presentation": "office/ppt"
|
|
98
|
-
},
|
|
98
|
+
}, dt = [
|
|
99
99
|
{ value: ".jpg", label: ".jpg" },
|
|
100
100
|
{ value: ".jpeg", label: ".jpeg" },
|
|
101
101
|
{ value: ".png", label: ".png" },
|
|
@@ -121,124 +121,124 @@ const Vt = [
|
|
|
121
121
|
{ value: ".zip", label: ".zip" },
|
|
122
122
|
{ value: ".rar", label: ".rar" },
|
|
123
123
|
{ value: ".7z", label: ".7z" }
|
|
124
|
-
],
|
|
125
|
-
|
|
126
|
-
),
|
|
127
|
-
|
|
128
|
-
),
|
|
129
|
-
|
|
124
|
+
], tr = Object.fromEntries(
|
|
125
|
+
en.map((e) => [e.value, e.label])
|
|
126
|
+
), nr = Object.fromEntries(
|
|
127
|
+
dt.map((e) => [e.value, e.label])
|
|
128
|
+
), rr = new Set(en.map((e) => e.value)), or = new Set(
|
|
129
|
+
dt.map((e) => e.value)
|
|
130
130
|
);
|
|
131
|
-
function
|
|
131
|
+
function ir(e) {
|
|
132
132
|
const t = e.trim();
|
|
133
|
-
return t ?
|
|
133
|
+
return t ? rr.has(t) ? t : er[t] ?? null : null;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function sr(e) {
|
|
136
136
|
return Array.isArray(e) ? e.map((t) => {
|
|
137
137
|
const n = t.trim().toLowerCase();
|
|
138
138
|
return n ? n.startsWith(".") ? n : `.${n}` : "";
|
|
139
139
|
}).filter(Boolean) : [];
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function be(e) {
|
|
142
142
|
if (!Array.isArray(e)) return [];
|
|
143
143
|
const t = [], n = /* @__PURE__ */ new Set();
|
|
144
144
|
for (const r of e) {
|
|
145
|
-
const o =
|
|
145
|
+
const o = ir(r);
|
|
146
146
|
o && !n.has(o) && (n.add(o), t.push(o));
|
|
147
147
|
}
|
|
148
148
|
return t;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
const t =
|
|
150
|
+
function ar(e) {
|
|
151
|
+
const t = be(e), n = [];
|
|
152
152
|
for (const r of t)
|
|
153
|
-
n.push(...
|
|
153
|
+
n.push(...Xn[r] ?? [r]);
|
|
154
154
|
return n;
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
const t =
|
|
156
|
+
function lr(e) {
|
|
157
|
+
const t = be(e);
|
|
158
158
|
if (t.length === 0) return [];
|
|
159
159
|
const n = /* @__PURE__ */ new Set();
|
|
160
160
|
for (const r of t)
|
|
161
|
-
for (const o of
|
|
161
|
+
for (const o of Zn[r] ?? [])
|
|
162
162
|
n.add(o);
|
|
163
|
-
return
|
|
163
|
+
return dt.filter((r) => n.has(r.value));
|
|
164
164
|
}
|
|
165
|
-
function
|
|
166
|
-
const n =
|
|
165
|
+
function pt(e, t) {
|
|
166
|
+
const n = sr(t), r = be(e);
|
|
167
167
|
if (r.length === 0)
|
|
168
|
-
return n.filter((i) =>
|
|
168
|
+
return n.filter((i) => or.has(i));
|
|
169
169
|
const o = new Set(
|
|
170
|
-
|
|
170
|
+
lr(r).map((i) => i.value)
|
|
171
171
|
);
|
|
172
172
|
return n.filter((i) => o.has(i));
|
|
173
173
|
}
|
|
174
|
-
function
|
|
175
|
-
const n =
|
|
174
|
+
function cr(e, t) {
|
|
175
|
+
const n = ar(e), r = pt(e, t), o = [...n, ...r];
|
|
176
176
|
return o.length > 0 ? o.join(",") : void 0;
|
|
177
177
|
}
|
|
178
|
-
function
|
|
179
|
-
const n =
|
|
178
|
+
function ur(e, t) {
|
|
179
|
+
const n = be(e), r = pt(
|
|
180
180
|
n,
|
|
181
181
|
t
|
|
182
182
|
), o = [
|
|
183
|
-
...n.map((i) =>
|
|
184
|
-
...r.map((i) =>
|
|
183
|
+
...n.map((i) => tr[i] ?? i),
|
|
184
|
+
...r.map((i) => nr[i] ?? i)
|
|
185
185
|
];
|
|
186
186
|
return o.length === 0 ? null : o.join("、");
|
|
187
187
|
}
|
|
188
|
-
const
|
|
188
|
+
const mr = [
|
|
189
189
|
"video",
|
|
190
190
|
"audio",
|
|
191
191
|
"image",
|
|
192
192
|
"file",
|
|
193
193
|
"spreadsheet",
|
|
194
194
|
"document"
|
|
195
|
-
],
|
|
196
|
-
function
|
|
197
|
-
return e &&
|
|
195
|
+
], dr = new Set(mr);
|
|
196
|
+
function pr(e) {
|
|
197
|
+
return e && dr.has(e) ? e : "file";
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
return typeof e == "string" &&
|
|
199
|
+
function ke(e) {
|
|
200
|
+
return typeof e == "string" && Yn.includes(e) ? e : "medium";
|
|
201
201
|
}
|
|
202
|
-
function
|
|
202
|
+
function fr(e, t) {
|
|
203
203
|
var o;
|
|
204
204
|
const n = Math.max(1, t);
|
|
205
205
|
let r = [];
|
|
206
206
|
return Array.isArray(e.mediaUrls) ? r = e.mediaUrls.map((i) => String(i).trim()) : (o = e.mediaUrl) != null && o.trim() && (r = [e.mediaUrl.trim()]), r.length === 0 ? [""] : r.slice(0, n);
|
|
207
207
|
}
|
|
208
|
-
function
|
|
208
|
+
function hr(e) {
|
|
209
209
|
var t;
|
|
210
210
|
return Array.isArray(e.mediaUrls) ? e.mediaUrls.map((n) => n.trim()).filter(Boolean) : (t = e.mediaUrl) != null && t.trim() ? [e.mediaUrl.trim()] : [];
|
|
211
211
|
}
|
|
212
|
-
function
|
|
213
|
-
return `form-media-size-${
|
|
212
|
+
function gr(e) {
|
|
213
|
+
return `form-media-size-${ke(e)}`;
|
|
214
214
|
}
|
|
215
|
-
function
|
|
216
|
-
return `form-media-preview form-media-list ${
|
|
215
|
+
function yr(e) {
|
|
216
|
+
return `form-media-preview form-media-list ${gr(e)}`;
|
|
217
217
|
}
|
|
218
|
-
const
|
|
219
|
-
function
|
|
218
|
+
const vr = 10;
|
|
219
|
+
function ft(e) {
|
|
220
220
|
return e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function Ce(e) {
|
|
223
223
|
return e === !0 || e === "true" || e === 1 || e === "1";
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function Vt(e, t = 1) {
|
|
226
226
|
const n = typeof e == "number" ? e : Number(e);
|
|
227
227
|
return Number.isFinite(n) ? Math.max(0, Math.floor(n)) : t;
|
|
228
228
|
}
|
|
229
|
-
function
|
|
229
|
+
function Me(e, t = 1) {
|
|
230
230
|
const n = typeof e == "number" ? e : Number(e);
|
|
231
231
|
return Number.isFinite(n) ? Math.max(1, Math.floor(n)) : t;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Sr(e, t) {
|
|
234
234
|
if (t !== void 0)
|
|
235
|
-
return e === "toggle" ?
|
|
235
|
+
return e === "toggle" ? Ce(t) : e === "multiselect" || e === "checkbox" || e === "resume_multiselect" || e === "case_multiselect" ? Array.isArray(t) ? t.map(String) : typeof t == "string" && t ? [t] : [] : typeof t == "boolean" ? t ? "true" : "false" : Array.isArray(t) ? t.map(String) : String(t);
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function br(e) {
|
|
238
238
|
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20, r = typeof (e == null ? void 0 : e.agentKind) == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, o = typeof (e == null ? void 0 : e.agentUniqueId) == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, i = typeof (e == null ? void 0 : e.flowType) == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, s = typeof (e == null ? void 0 : e.category) == "string" && e.category.trim() ? e.category.trim() : void 0, a = Array.isArray(e == null ? void 0 : e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
239
239
|
return { agentKind: r, agentUniqueId: o, flowType: i, category: s, flowUniqueIds: a, pageSize: n };
|
|
240
240
|
}
|
|
241
|
-
function
|
|
241
|
+
function kr(e) {
|
|
242
242
|
const t = typeof (e == null ? void 0 : e.pageSize) == "number" ? e.pageSize : Number(e == null ? void 0 : e.pageSize), n = Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20;
|
|
243
243
|
return {
|
|
244
244
|
names: Array.isArray(e == null ? void 0 : e.names) ? e.names.map(String).filter(Boolean) : [],
|
|
@@ -247,51 +247,51 @@ function ar(e) {
|
|
|
247
247
|
pageSize: n
|
|
248
248
|
};
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Cr(e) {
|
|
251
251
|
if (e.type !== "case_singleselect") return e;
|
|
252
252
|
const t = typeof e.defaultValue == "string" && e.defaultValue.trim() ? [e.defaultValue.trim()] : Array.isArray(e.defaultValue) ? e.defaultValue.map(String).filter(Boolean) : [];
|
|
253
253
|
return { ...e, type: "case_multiselect", defaultValue: t };
|
|
254
254
|
}
|
|
255
|
-
function
|
|
255
|
+
function Ar(e) {
|
|
256
256
|
var o, i;
|
|
257
|
-
const t =
|
|
257
|
+
const t = Cr(e), n = be(t.fileAcceptTypes), r = t.type;
|
|
258
258
|
return {
|
|
259
|
-
id: ((o = t.id) == null ? void 0 : o.trim()) ||
|
|
259
|
+
id: ((o = t.id) == null ? void 0 : o.trim()) || Se("block-"),
|
|
260
260
|
type: r,
|
|
261
261
|
name: ((i = t.name) == null ? void 0 : i.trim()) || void 0,
|
|
262
262
|
label: t.label ?? "",
|
|
263
263
|
placeholder: t.placeholder ?? "",
|
|
264
264
|
help: t.help ?? "",
|
|
265
265
|
required: t.required === !0,
|
|
266
|
-
mediaUrls:
|
|
267
|
-
mediaSize:
|
|
266
|
+
mediaUrls: Ue(r) ? fr(t, vr) : void 0,
|
|
267
|
+
mediaSize: Ue(r) ? ke(t.mediaSize) : void 0,
|
|
268
268
|
fileAcceptTypes: n,
|
|
269
|
-
fileAcceptExtensions:
|
|
269
|
+
fileAcceptExtensions: pt(
|
|
270
270
|
n,
|
|
271
271
|
t.fileAcceptExtensions
|
|
272
272
|
),
|
|
273
|
-
filePlaceholderIcon:
|
|
274
|
-
fileMinCount: r === "file" ?
|
|
275
|
-
fileMaxCount: r === "file" ?
|
|
276
|
-
defaultValue:
|
|
273
|
+
filePlaceholderIcon: pr(t.filePlaceholderIcon),
|
|
274
|
+
fileMinCount: r === "file" ? Vt(t.fileMinCount, 1) : void 0,
|
|
275
|
+
fileMaxCount: r === "file" ? Vt(t.fileMaxCount, 1) : void 0,
|
|
276
|
+
defaultValue: Sr(r, t.defaultValue),
|
|
277
277
|
options: Array.isArray(t.options) ? t.options.map((s, a) => {
|
|
278
|
-
var l,
|
|
278
|
+
var l, c;
|
|
279
279
|
return {
|
|
280
280
|
value: ((l = s.value) == null ? void 0 : l.trim()) || `option_${a + 1}`,
|
|
281
|
-
label: ((
|
|
281
|
+
label: ((c = s.label) == null ? void 0 : c.trim()) || `选项 ${a + 1}`
|
|
282
282
|
};
|
|
283
283
|
}) : void 0,
|
|
284
284
|
resumeEnableRefresh: r === "resume_multiselect" ? t.resumeEnableRefresh !== !1 : void 0,
|
|
285
|
-
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ?
|
|
286
|
-
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ?
|
|
287
|
-
resumeFilter: r === "resume_multiselect" ?
|
|
285
|
+
resumeMinCount: r === "resume_multiselect" && t.resumeMinCount != null ? Me(t.resumeMinCount, 1) : void 0,
|
|
286
|
+
resumeMaxCount: r === "resume_multiselect" && t.resumeMaxCount != null ? Me(t.resumeMaxCount, 1) : void 0,
|
|
287
|
+
resumeFilter: r === "resume_multiselect" ? kr(t.resumeFilter) : void 0,
|
|
288
288
|
caseEnableRefresh: r === "case_multiselect" ? t.caseEnableRefresh !== !1 : void 0,
|
|
289
|
-
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ?
|
|
290
|
-
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ?
|
|
291
|
-
caseFilter: r === "case_multiselect" ?
|
|
289
|
+
caseMinCount: r === "case_multiselect" && t.caseMinCount != null ? Me(t.caseMinCount, 1) : void 0,
|
|
290
|
+
caseMaxCount: r === "case_multiselect" && t.caseMaxCount != null ? Me(t.caseMaxCount, 1) : void 0,
|
|
291
|
+
caseFilter: r === "case_multiselect" ? br(t.caseFilter) : void 0
|
|
292
292
|
};
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Re(e) {
|
|
295
295
|
return {
|
|
296
296
|
title: e.title ?? "",
|
|
297
297
|
description: e.description ?? "",
|
|
@@ -299,18 +299,18 @@ function xe(e) {
|
|
|
299
299
|
jsonSchema: e.jsonSchema ?? {}
|
|
300
300
|
};
|
|
301
301
|
}
|
|
302
|
-
function
|
|
302
|
+
function ue(e) {
|
|
303
303
|
if (!e || !Array.isArray(e.blocks))
|
|
304
|
-
return
|
|
305
|
-
const t = e.blocks.map(
|
|
306
|
-
return
|
|
304
|
+
return Re({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
305
|
+
const t = e.blocks.map(Ar);
|
|
306
|
+
return Re({
|
|
307
307
|
title: typeof e.title == "string" ? e.title : "",
|
|
308
308
|
description: typeof e.description == "string" ? e.description : "",
|
|
309
309
|
blocks: t,
|
|
310
|
-
jsonSchema:
|
|
310
|
+
jsonSchema: ft(e.jsonSchema)
|
|
311
311
|
});
|
|
312
312
|
}
|
|
313
|
-
function
|
|
313
|
+
function _r(e) {
|
|
314
314
|
const t = typeof e.pageSize == "number" ? e.pageSize : Number(e.pageSize), n = typeof e.agentKind == "string" && e.agentKind.trim() ? e.agentKind.trim() : void 0, r = typeof e.agentUniqueId == "string" && e.agentUniqueId.trim() ? e.agentUniqueId.trim() : void 0, o = typeof e.flowType == "string" && e.flowType.trim() ? e.flowType.trim() : void 0, i = typeof e.category == "string" && e.category.trim() ? e.category.trim() : void 0, s = Array.isArray(e.flowUniqueIds) ? e.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
315
315
|
return {
|
|
316
316
|
agentKind: n,
|
|
@@ -321,14 +321,14 @@ function ur(e) {
|
|
|
321
321
|
pageSize: Number.isFinite(t) && t >= 1 && t <= 100 ? Math.floor(t) : 20
|
|
322
322
|
};
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function jt(e) {
|
|
325
325
|
if (e == null) return;
|
|
326
326
|
const t = typeof e == "number" ? e : Number(e);
|
|
327
327
|
if (!(!Number.isFinite(t) || t < 1))
|
|
328
328
|
return Math.floor(t);
|
|
329
329
|
}
|
|
330
|
-
function
|
|
331
|
-
var s, a, l,
|
|
330
|
+
function Tr(e, t) {
|
|
331
|
+
var s, a, l, c, m, d;
|
|
332
332
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
333
333
|
return i({
|
|
334
334
|
id: n,
|
|
@@ -341,7 +341,7 @@ function mr(e, t) {
|
|
|
341
341
|
agentKind: (s = e.caseFilter) == null ? void 0 : s.agentKind,
|
|
342
342
|
agentUniqueId: (a = e.caseFilter) == null ? void 0 : a.agentUniqueId,
|
|
343
343
|
flowType: (l = e.caseFilter) == null ? void 0 : l.flowType,
|
|
344
|
-
category: (
|
|
344
|
+
category: (c = e.caseFilter) == null ? void 0 : c.category,
|
|
345
345
|
flowUniqueIds: ((m = e.caseFilter) == null ? void 0 : m.flowUniqueIds) ?? [],
|
|
346
346
|
pageSize: ((d = e.caseFilter) == null ? void 0 : d.pageSize) ?? 20
|
|
347
347
|
},
|
|
@@ -350,7 +350,7 @@ function mr(e, t) {
|
|
|
350
350
|
value: { path: o }
|
|
351
351
|
});
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function xr(e, t, n) {
|
|
354
354
|
const r = n.nameFromValue(e.value), o = {
|
|
355
355
|
...t("case_multiselect"),
|
|
356
356
|
name: r,
|
|
@@ -358,27 +358,83 @@ function dr(e, t, n) {
|
|
|
358
358
|
}, i = n.asLiteral(e.placeholder);
|
|
359
359
|
i && (o.placeholder = i);
|
|
360
360
|
const s = n.asLiteral(e.help);
|
|
361
|
-
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter =
|
|
362
|
-
const a =
|
|
361
|
+
s && (o.help = s), e.caseFilter && typeof e.caseFilter == "object" && (o.caseFilter = _r(e.caseFilter));
|
|
362
|
+
const a = jt(e.minCount);
|
|
363
363
|
a !== void 0 && (o.caseMinCount = a);
|
|
364
|
-
const l =
|
|
364
|
+
const l = jt(e.maxCount);
|
|
365
365
|
return l !== void 0 && (o.caseMaxCount = l), o;
|
|
366
366
|
}
|
|
367
|
-
const
|
|
368
|
-
|
|
367
|
+
const tn = ye(
|
|
368
|
+
null
|
|
369
|
+
);
|
|
370
|
+
function Ir(e) {
|
|
371
|
+
try {
|
|
372
|
+
return JSON.stringify(e);
|
|
373
|
+
} catch {
|
|
374
|
+
return String(e.length);
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
const Mr = {
|
|
378
|
+
publishLiveOptions: () => {
|
|
379
|
+
},
|
|
380
|
+
liveOptions: /* @__PURE__ */ new Map(),
|
|
381
|
+
pendingChangeFields: [],
|
|
382
|
+
version: 0,
|
|
383
|
+
clearPendingChangeFields: () => {
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
function Nr({ children: e }) {
|
|
387
|
+
const t = A(/* @__PURE__ */ new Map()), n = A(/* @__PURE__ */ new Map()), r = A([]), [o, i] = R(0), [s, a] = R(() => /* @__PURE__ */ new Map()), [l, c] = R(
|
|
388
|
+
[]
|
|
389
|
+
), m = $(
|
|
390
|
+
(g, b) => {
|
|
391
|
+
const y = g.trim();
|
|
392
|
+
if (!y) return;
|
|
393
|
+
const k = b.map((p) => ({
|
|
394
|
+
value: String(p.value ?? ""),
|
|
395
|
+
label: String(p.label ?? p.value ?? "")
|
|
396
|
+
})), f = Ir(k);
|
|
397
|
+
n.current.get(y) !== f && (n.current.set(y, f), t.current.set(y, k), r.current.includes(y) || (r.current = [...r.current, y]), a(new Map(t.current)), c(r.current), i((p) => p + 1));
|
|
398
|
+
},
|
|
399
|
+
[]
|
|
400
|
+
), d = $(() => {
|
|
401
|
+
r.current = [], c([]);
|
|
402
|
+
}, []), S = j(
|
|
403
|
+
() => ({
|
|
404
|
+
publishLiveOptions: m,
|
|
405
|
+
liveOptions: s,
|
|
406
|
+
pendingChangeFields: l,
|
|
407
|
+
version: o,
|
|
408
|
+
clearPendingChangeFields: d
|
|
409
|
+
}),
|
|
410
|
+
[
|
|
411
|
+
m,
|
|
412
|
+
s,
|
|
413
|
+
l,
|
|
414
|
+
o,
|
|
415
|
+
d
|
|
416
|
+
]
|
|
417
|
+
);
|
|
418
|
+
return /* @__PURE__ */ u(tn.Provider, { value: S, children: e });
|
|
419
|
+
}
|
|
420
|
+
function ht() {
|
|
421
|
+
return ve(tn) ?? Mr;
|
|
422
|
+
}
|
|
423
|
+
const nn = ye({ interactive: !0 });
|
|
424
|
+
function it({
|
|
369
425
|
interactive: e,
|
|
370
426
|
children: t
|
|
371
427
|
}) {
|
|
372
|
-
return /* @__PURE__ */
|
|
428
|
+
return /* @__PURE__ */ u(nn.Provider, { value: { interactive: e }, children: t });
|
|
373
429
|
}
|
|
374
|
-
function
|
|
375
|
-
return
|
|
430
|
+
function ie() {
|
|
431
|
+
return ve(nn);
|
|
376
432
|
}
|
|
377
|
-
const
|
|
378
|
-
function
|
|
433
|
+
const rn = ye(null);
|
|
434
|
+
function Fr(e) {
|
|
379
435
|
return e != null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
380
436
|
}
|
|
381
|
-
const
|
|
437
|
+
const Er = {
|
|
382
438
|
reportEvent: () => {
|
|
383
439
|
},
|
|
384
440
|
reportData: () => {
|
|
@@ -386,46 +442,50 @@ const fr = {
|
|
|
386
442
|
runAutoControl: (e) => e(),
|
|
387
443
|
isAutoControl: () => !1
|
|
388
444
|
};
|
|
389
|
-
function
|
|
445
|
+
function Ur(e) {
|
|
390
446
|
const t = {};
|
|
391
|
-
for (const [n, r] of Object.entries(e))
|
|
447
|
+
for (const [n, r] of Object.entries(e.form_values ?? {}))
|
|
392
448
|
r !== void 0 && (t[n] = r);
|
|
393
|
-
return
|
|
449
|
+
return {
|
|
450
|
+
form_schema: e.form_schema,
|
|
451
|
+
form_values: t,
|
|
452
|
+
form_change: Array.isArray(e.form_change) ? [...e.form_change] : []
|
|
453
|
+
};
|
|
394
454
|
}
|
|
395
|
-
function
|
|
455
|
+
function Rr({
|
|
396
456
|
client: e,
|
|
397
457
|
children: t
|
|
398
458
|
}) {
|
|
399
|
-
const n =
|
|
459
|
+
const n = A(0), r = A(e);
|
|
400
460
|
r.current = e;
|
|
401
|
-
const o = $((
|
|
461
|
+
const o = $((c) => {
|
|
402
462
|
const m = r.current;
|
|
403
463
|
if (!m) return;
|
|
404
464
|
const d = {
|
|
405
|
-
action:
|
|
406
|
-
component:
|
|
465
|
+
action: c.action,
|
|
466
|
+
component: c.component
|
|
407
467
|
};
|
|
408
|
-
|
|
468
|
+
c.field !== void 0 && (d.field = c.field), c.value !== void 0 && (d.value = c.value);
|
|
409
469
|
const S = n.current > 0 ? "form_auto_control_bac_event" : "form_runtime_event";
|
|
410
470
|
m.send(S, d);
|
|
411
|
-
}, []), i = $((
|
|
471
|
+
}, []), i = $((c) => {
|
|
412
472
|
const m = r.current;
|
|
413
|
-
m && m.send("form_runtime_data",
|
|
414
|
-
}, []), s = $((
|
|
473
|
+
m && m.send("form_runtime_data", Ur(c));
|
|
474
|
+
}, []), s = $((c) => {
|
|
415
475
|
n.current += 1;
|
|
416
476
|
let m;
|
|
417
477
|
try {
|
|
418
|
-
m =
|
|
478
|
+
m = c();
|
|
419
479
|
} catch (d) {
|
|
420
480
|
throw n.current = Math.max(0, n.current - 1), d;
|
|
421
481
|
}
|
|
422
|
-
return
|
|
482
|
+
return Fr(m) ? Promise.resolve(m).finally(() => {
|
|
423
483
|
n.current = Math.max(0, n.current - 1);
|
|
424
484
|
}) : (n.current = Math.max(0, n.current - 1), m);
|
|
425
485
|
}, []), a = $(
|
|
426
486
|
() => n.current > 0,
|
|
427
487
|
[]
|
|
428
|
-
), l =
|
|
488
|
+
), l = j(
|
|
429
489
|
() => ({
|
|
430
490
|
reportEvent: o,
|
|
431
491
|
reportData: i,
|
|
@@ -434,89 +494,89 @@ function gr({
|
|
|
434
494
|
}),
|
|
435
495
|
[o, i, s, a]
|
|
436
496
|
);
|
|
437
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ u(rn.Provider, { value: l, children: t });
|
|
438
498
|
}
|
|
439
|
-
function
|
|
440
|
-
return
|
|
499
|
+
function on() {
|
|
500
|
+
return ve(rn) ?? Er;
|
|
441
501
|
}
|
|
442
|
-
const
|
|
443
|
-
function
|
|
502
|
+
const wr = 300;
|
|
503
|
+
function sn(e) {
|
|
444
504
|
return e && typeof e == "object" && "path" in e && String(e.path ?? "").trim() || null;
|
|
445
505
|
}
|
|
446
|
-
function
|
|
506
|
+
function Pr(e) {
|
|
447
507
|
if (!e) return;
|
|
448
508
|
const t = e.trim();
|
|
449
509
|
if (t)
|
|
450
510
|
return t.startsWith("/") ? t.slice(1) : t;
|
|
451
511
|
}
|
|
452
|
-
function
|
|
512
|
+
function $t(e, t = "value") {
|
|
453
513
|
const r = e.componentModel.properties[t];
|
|
454
|
-
if (!(!
|
|
514
|
+
if (!(!sn(r) || r === void 0))
|
|
455
515
|
return e.dataContext.resolveDynamicValue(r);
|
|
456
516
|
}
|
|
457
|
-
function
|
|
458
|
-
const o = e.componentModel.properties[t], i =
|
|
517
|
+
function se(e, t = "value", n = {}) {
|
|
518
|
+
const o = e.componentModel.properties[t], i = sn(o), s = Pr(i), a = on(), {
|
|
459
519
|
component: l = "Unknown",
|
|
460
|
-
changeAction:
|
|
520
|
+
changeAction: c = "change",
|
|
461
521
|
debounceChange: m = !1
|
|
462
|
-
} = n, d =
|
|
463
|
-
|
|
464
|
-
const y =
|
|
465
|
-
y.current =
|
|
466
|
-
const
|
|
467
|
-
|
|
468
|
-
const
|
|
469
|
-
|
|
470
|
-
d.current != null && (clearTimeout(d.current), d.current = null), g.current &&
|
|
522
|
+
} = n, d = A(null), S = A(void 0), g = A(!1), b = A(a);
|
|
523
|
+
b.current = a;
|
|
524
|
+
const y = A(c);
|
|
525
|
+
y.current = c;
|
|
526
|
+
const k = A(l);
|
|
527
|
+
k.current = l;
|
|
528
|
+
const f = A(s);
|
|
529
|
+
f.current = s, z(() => () => {
|
|
530
|
+
d.current != null && (clearTimeout(d.current), d.current = null), g.current && f.current && (g.current = !1, b.current.reportEvent({
|
|
471
531
|
action: y.current,
|
|
472
|
-
component:
|
|
473
|
-
field:
|
|
532
|
+
component: k.current,
|
|
533
|
+
field: f.current,
|
|
474
534
|
value: S.current
|
|
475
535
|
}));
|
|
476
536
|
}, []);
|
|
477
537
|
const p = $(
|
|
478
|
-
(
|
|
538
|
+
(O) => {
|
|
479
539
|
if (!i || o === void 0) return () => {
|
|
480
540
|
};
|
|
481
|
-
const
|
|
482
|
-
return () =>
|
|
541
|
+
const B = e.dataContext.subscribeDynamicValue(o, () => O());
|
|
542
|
+
return () => B.unsubscribe();
|
|
483
543
|
},
|
|
484
544
|
[e, o, i]
|
|
485
545
|
), v = $(() => {
|
|
486
546
|
if (!(!i || o === void 0))
|
|
487
547
|
return e.dataContext.resolveDynamicValue(o);
|
|
488
|
-
}, [e, o, i]), x =
|
|
489
|
-
(
|
|
548
|
+
}, [e, o, i]), x = Un(p, v, v), M = $(
|
|
549
|
+
(O) => {
|
|
490
550
|
if (!s) return;
|
|
491
|
-
const
|
|
492
|
-
g.current = !1,
|
|
493
|
-
action:
|
|
551
|
+
const B = () => {
|
|
552
|
+
g.current = !1, b.current.reportEvent({
|
|
553
|
+
action: c,
|
|
494
554
|
component: l,
|
|
495
555
|
field: s,
|
|
496
|
-
value:
|
|
556
|
+
value: O
|
|
497
557
|
});
|
|
498
558
|
};
|
|
499
559
|
if (!m) {
|
|
500
|
-
|
|
560
|
+
B();
|
|
501
561
|
return;
|
|
502
562
|
}
|
|
503
|
-
S.current =
|
|
504
|
-
d.current = null,
|
|
505
|
-
},
|
|
563
|
+
S.current = O, g.current = !0, d.current != null && clearTimeout(d.current), d.current = setTimeout(() => {
|
|
564
|
+
d.current = null, B();
|
|
565
|
+
}, wr);
|
|
506
566
|
},
|
|
507
|
-
[s,
|
|
508
|
-
),
|
|
509
|
-
(
|
|
510
|
-
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path),
|
|
567
|
+
[s, c, l, m]
|
|
568
|
+
), _ = $(
|
|
569
|
+
(O) => {
|
|
570
|
+
!i || !o || typeof o != "object" || !("path" in o) || e.dataContext.set(String(o.path), O);
|
|
511
571
|
},
|
|
512
572
|
[e, o, i]
|
|
513
|
-
),
|
|
514
|
-
(
|
|
515
|
-
|
|
573
|
+
), w = $(
|
|
574
|
+
(O) => {
|
|
575
|
+
_(O), M(O);
|
|
516
576
|
},
|
|
517
|
-
[
|
|
518
|
-
),
|
|
519
|
-
s &&
|
|
577
|
+
[_, M]
|
|
578
|
+
), C = $(() => {
|
|
579
|
+
s && b.current.reportEvent({
|
|
520
580
|
action: "focus",
|
|
521
581
|
component: l,
|
|
522
582
|
field: s
|
|
@@ -524,86 +584,86 @@ function te(e, t = "value", n = {}) {
|
|
|
524
584
|
}, [s, l]);
|
|
525
585
|
return {
|
|
526
586
|
value: x,
|
|
527
|
-
setValue:
|
|
587
|
+
setValue: w,
|
|
528
588
|
/** 写入 dataModel 但不上报(用于模式切换规范化等内部同步) */
|
|
529
|
-
setValueSilent:
|
|
589
|
+
setValueSilent: _,
|
|
530
590
|
hasBinding: !!i,
|
|
531
591
|
fieldName: s,
|
|
532
|
-
reportFocus:
|
|
592
|
+
reportFocus: C
|
|
533
593
|
};
|
|
534
594
|
}
|
|
535
|
-
function
|
|
595
|
+
function he(e) {
|
|
536
596
|
if (typeof e == "string") return e || void 0;
|
|
537
597
|
if (typeof e == "number") return String(e);
|
|
538
598
|
}
|
|
539
|
-
function
|
|
599
|
+
function Y(e) {
|
|
540
600
|
return Array.isArray(e) ? e.map(String) : typeof e == "string" && e ? [e] : [];
|
|
541
601
|
}
|
|
542
|
-
function
|
|
543
|
-
return t ? Array.isArray(e) ? null :
|
|
602
|
+
function an(e, t) {
|
|
603
|
+
return t ? Array.isArray(e) ? null : Y(e) : Array.isArray(e) ? e.length > 0 ? String(e[0]) : "" : e == null || typeof e == "string" || typeof e == "number" ? null : "";
|
|
544
604
|
}
|
|
545
|
-
function
|
|
605
|
+
function we(e) {
|
|
546
606
|
if (e == null) return;
|
|
547
607
|
const t = typeof e == "number" ? e : Number(e);
|
|
548
608
|
if (!(!Number.isFinite(t) || t < 1))
|
|
549
609
|
return Math.floor(t);
|
|
550
610
|
}
|
|
551
|
-
function
|
|
611
|
+
function ln(e, t, n, r) {
|
|
552
612
|
if (e.includes(t)) {
|
|
553
613
|
const i = e.filter((s) => s !== t);
|
|
554
614
|
return n !== void 0 && i.length < n ? null : i;
|
|
555
615
|
}
|
|
556
616
|
return r !== void 0 && e.length >= r ? null : [...e, t];
|
|
557
617
|
}
|
|
558
|
-
function
|
|
618
|
+
function cn(e, t, n, r, o) {
|
|
559
619
|
if (!n) return !0;
|
|
560
620
|
const i = e.includes(t);
|
|
561
621
|
return !!(!i && o !== void 0 && e.length >= o || i && r !== void 0 && e.length <= r);
|
|
562
622
|
}
|
|
563
|
-
function
|
|
623
|
+
function un(e, t) {
|
|
564
624
|
return t === void 0 || e.length <= t ? null : e.slice(0, t);
|
|
565
625
|
}
|
|
566
|
-
const
|
|
567
|
-
function
|
|
626
|
+
const mn = ye(null);
|
|
627
|
+
function st({
|
|
568
628
|
caseSearch: e,
|
|
569
629
|
children: t
|
|
570
630
|
}) {
|
|
571
|
-
return /* @__PURE__ */
|
|
631
|
+
return /* @__PURE__ */ u(mn.Provider, { value: e ?? null, children: t });
|
|
572
632
|
}
|
|
573
|
-
function
|
|
574
|
-
return
|
|
633
|
+
function zr() {
|
|
634
|
+
return ve(mn);
|
|
575
635
|
}
|
|
576
|
-
function
|
|
636
|
+
function Ye(e) {
|
|
577
637
|
return typeof e == "string" ? e : "";
|
|
578
638
|
}
|
|
579
|
-
function
|
|
639
|
+
function Qe(e) {
|
|
580
640
|
if (!e || typeof e != "object")
|
|
581
641
|
return { flowUniqueIds: [], pageSize: 20 };
|
|
582
642
|
const t = e, n = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), r = Number.isFinite(n) && n >= 1 && n <= 100 ? Math.floor(n) : 20, o = typeof t.agentKind == "string" && t.agentKind.trim() ? t.agentKind.trim() : void 0, i = typeof t.agentUniqueId == "string" && t.agentUniqueId.trim() ? t.agentUniqueId.trim() : void 0, s = typeof t.flowType == "string" && t.flowType.trim() ? t.flowType.trim() : void 0, a = typeof t.category == "string" && t.category.trim() ? t.category.trim() : void 0, l = Array.isArray(t.flowUniqueIds) ? t.flowUniqueIds.map(String).filter(Boolean) : [];
|
|
583
643
|
return { agentKind: o, agentUniqueId: i, flowType: s, category: a, flowUniqueIds: l, pageSize: r };
|
|
584
644
|
}
|
|
585
|
-
function
|
|
645
|
+
function Xe(e) {
|
|
586
646
|
var r;
|
|
587
647
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!(e.agentUniqueId && e.flowType && e.category);
|
|
588
648
|
return t || n;
|
|
589
649
|
}
|
|
590
|
-
function
|
|
650
|
+
function Or(e) {
|
|
591
651
|
return JSON.stringify(e);
|
|
592
652
|
}
|
|
593
|
-
const
|
|
653
|
+
const qr = {
|
|
594
654
|
name: "SkoponCaseSelect",
|
|
595
|
-
schema:
|
|
596
|
-
label:
|
|
597
|
-
placeholder:
|
|
598
|
-
help:
|
|
599
|
-
enableRefresh:
|
|
600
|
-
caseFilter:
|
|
601
|
-
minCount:
|
|
602
|
-
maxCount:
|
|
603
|
-
value:
|
|
655
|
+
schema: h.object({
|
|
656
|
+
label: h.any().optional(),
|
|
657
|
+
placeholder: h.any().optional(),
|
|
658
|
+
help: h.any().optional(),
|
|
659
|
+
enableRefresh: h.any().optional(),
|
|
660
|
+
caseFilter: h.any().optional(),
|
|
661
|
+
minCount: h.any().optional(),
|
|
662
|
+
maxCount: h.any().optional(),
|
|
663
|
+
value: h.any().optional()
|
|
604
664
|
}).passthrough()
|
|
605
665
|
};
|
|
606
|
-
function
|
|
666
|
+
function Br({
|
|
607
667
|
item: e,
|
|
608
668
|
selected: t,
|
|
609
669
|
disabled: n,
|
|
@@ -617,10 +677,10 @@ function Ar({
|
|
|
617
677
|
disabled: n,
|
|
618
678
|
onClick: r,
|
|
619
679
|
children: [
|
|
620
|
-
/* @__PURE__ */
|
|
680
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-avatar", children: /* @__PURE__ */ u(Jt, { style: { fontSize: 24, color: "var(--color-primary, #208368)" } }) }),
|
|
621
681
|
/* @__PURE__ */ I("div", { className: "skopon-resume-select-card-body", children: [
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
e.description ? /* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name }),
|
|
683
|
+
e.description ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-desc", children: e.description }) : null,
|
|
624
684
|
/* @__PURE__ */ I("div", { className: "skopon-resume-select-card-meta", children: [
|
|
625
685
|
e.caseUniqueId,
|
|
626
686
|
e.platform ? ` · ${e.platform}` : "",
|
|
@@ -631,115 +691,121 @@ function Ar({
|
|
|
631
691
|
}
|
|
632
692
|
);
|
|
633
693
|
}
|
|
634
|
-
function
|
|
635
|
-
const { interactive: t } =
|
|
694
|
+
function Lr({ context: e }) {
|
|
695
|
+
const { interactive: t } = ie(), n = zr(), { publishLiveOptions: r } = ht(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = se(e, "value", {
|
|
636
696
|
component: "SkoponCaseSelect",
|
|
637
697
|
changeAction: "click"
|
|
638
|
-
}),
|
|
639
|
-
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
}, [
|
|
643
|
-
const
|
|
644
|
-
async (
|
|
645
|
-
const
|
|
646
|
-
if (!n || !
|
|
647
|
-
|
|
698
|
+
}), l = e.componentModel.properties, c = Ye(l.label), m = Ye(l.placeholder), d = Ye(l.help), S = l.enableRefresh !== !1, g = we(l.minCount), b = we(l.maxCount), y = j(() => Qe(l.caseFilter), [l.caseFilter]), k = Or(y), [f, p] = R(1), [v, x] = R(!1), [M, _] = R(""), [w, C] = R([]), [O, B] = R(0), [ne, K] = R(y.pageSize ?? 20), D = A(0), J = Y(o);
|
|
699
|
+
z(() => {
|
|
700
|
+
const T = un(J, b);
|
|
701
|
+
T !== null && s(T);
|
|
702
|
+
}, [b, J, s]);
|
|
703
|
+
const Z = j(() => n ? Xe(y) ? M || m || "暂无匹配的案例" : "未配置案例列表筛选条件" : "未配置案例搜索服务", [n, y, M, m]), ee = $(
|
|
704
|
+
async (T) => {
|
|
705
|
+
const V = Qe(JSON.parse(k)), P = ++D.current;
|
|
706
|
+
if (!n || !Xe(V)) {
|
|
707
|
+
C([]), B(0), _(""), x(!1);
|
|
648
708
|
return;
|
|
649
709
|
}
|
|
650
|
-
|
|
710
|
+
x(!0), _("");
|
|
651
711
|
try {
|
|
652
|
-
const
|
|
653
|
-
if (
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
712
|
+
const N = await n({ filter: V, page: T });
|
|
713
|
+
if (P !== D.current) return;
|
|
714
|
+
C(N.list), B(N.total), p(N.page), K(N.pageSize), a && r(
|
|
715
|
+
a,
|
|
716
|
+
N.list.map((W) => ({
|
|
717
|
+
value: W.caseUniqueId,
|
|
718
|
+
label: W.name || W.caseUniqueId
|
|
719
|
+
}))
|
|
720
|
+
);
|
|
721
|
+
} catch (N) {
|
|
722
|
+
if (P !== D.current) return;
|
|
723
|
+
C([]), B(0), _(N instanceof Error ? N.message : "加载案例列表失败");
|
|
658
724
|
} finally {
|
|
659
|
-
|
|
725
|
+
P === D.current && x(!1);
|
|
660
726
|
}
|
|
661
727
|
},
|
|
662
|
-
[n,
|
|
728
|
+
[n, k, a, r]
|
|
663
729
|
);
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
}, [
|
|
667
|
-
const
|
|
730
|
+
z(() => {
|
|
731
|
+
p(1), ee(1);
|
|
732
|
+
}, [k, ee]);
|
|
733
|
+
const F = (T) => {
|
|
668
734
|
if (!t) return;
|
|
669
|
-
const
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
735
|
+
const V = ln(
|
|
736
|
+
J,
|
|
737
|
+
T,
|
|
738
|
+
g,
|
|
739
|
+
b
|
|
674
740
|
);
|
|
675
|
-
|
|
676
|
-
},
|
|
677
|
-
const
|
|
678
|
-
|
|
741
|
+
V !== null && i(V);
|
|
742
|
+
}, L = () => {
|
|
743
|
+
const T = Qe(JSON.parse(k)), V = ne || T.pageSize || 20, P = Math.max(1, Math.ceil(O / V)), N = f >= P ? 1 : f + 1;
|
|
744
|
+
ee(N);
|
|
679
745
|
};
|
|
680
746
|
return /* @__PURE__ */ I(
|
|
681
747
|
"div",
|
|
682
748
|
{
|
|
683
749
|
className: "form-block-preview skopon-resume-select",
|
|
684
|
-
"data-skopon-field":
|
|
750
|
+
"data-skopon-field": a || void 0,
|
|
685
751
|
children: [
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
/* @__PURE__ */
|
|
752
|
+
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
753
|
+
v && w.length === 0 ? /* @__PURE__ */ I("div", { className: "skopon-resume-select-status", children: [
|
|
754
|
+
/* @__PURE__ */ u(mt, { size: "small" }),
|
|
689
755
|
" 加载案例…"
|
|
690
756
|
] }) : null,
|
|
691
|
-
!
|
|
692
|
-
|
|
693
|
-
|
|
757
|
+
!v && w.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: Z }) : null,
|
|
758
|
+
w.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: w.map((T) => /* @__PURE__ */ u(
|
|
759
|
+
Br,
|
|
694
760
|
{
|
|
695
|
-
item:
|
|
696
|
-
selected:
|
|
697
|
-
disabled:
|
|
698
|
-
|
|
699
|
-
|
|
761
|
+
item: T,
|
|
762
|
+
selected: J.includes(T.caseUniqueId),
|
|
763
|
+
disabled: cn(
|
|
764
|
+
J,
|
|
765
|
+
T.caseUniqueId,
|
|
700
766
|
t,
|
|
701
|
-
|
|
702
|
-
|
|
767
|
+
g,
|
|
768
|
+
b
|
|
703
769
|
),
|
|
704
|
-
onToggle: () =>
|
|
770
|
+
onToggle: () => F(T.caseUniqueId)
|
|
705
771
|
},
|
|
706
|
-
|
|
772
|
+
T.caseUniqueId
|
|
707
773
|
)) }) : null,
|
|
708
|
-
|
|
709
|
-
|
|
774
|
+
S && n && Xe(y) ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
775
|
+
ze,
|
|
710
776
|
{
|
|
711
777
|
type: "default",
|
|
712
778
|
size: "small",
|
|
713
|
-
icon: /* @__PURE__ */
|
|
714
|
-
loading:
|
|
779
|
+
icon: /* @__PURE__ */ u(Gt, {}),
|
|
780
|
+
loading: v,
|
|
715
781
|
disabled: !t,
|
|
716
|
-
onClick:
|
|
782
|
+
onClick: L,
|
|
717
783
|
children: "换一批"
|
|
718
784
|
}
|
|
719
785
|
) }) : null,
|
|
720
|
-
|
|
786
|
+
d ? /* @__PURE__ */ u(te.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
|
|
721
787
|
]
|
|
722
788
|
}
|
|
723
789
|
);
|
|
724
790
|
}
|
|
725
|
-
const
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
),
|
|
791
|
+
const Vr = Q(
|
|
792
|
+
qr,
|
|
793
|
+
Lr
|
|
794
|
+
), jr = {
|
|
729
795
|
type: "case_multiselect",
|
|
730
796
|
componentName: "SkoponCaseSelect",
|
|
731
|
-
toComponent:
|
|
732
|
-
fromComponent:
|
|
733
|
-
catalogComponents: [
|
|
797
|
+
toComponent: Tr,
|
|
798
|
+
fromComponent: xr,
|
|
799
|
+
catalogComponents: [Vr]
|
|
734
800
|
};
|
|
735
|
-
function
|
|
801
|
+
function Dt(e) {
|
|
736
802
|
if (e == null) return;
|
|
737
803
|
const t = typeof e == "number" ? e : Number(e);
|
|
738
804
|
if (!(!Number.isFinite(t) || t < 1))
|
|
739
805
|
return Math.floor(t);
|
|
740
806
|
}
|
|
741
|
-
function
|
|
742
|
-
var s, a, l,
|
|
807
|
+
function $r(e, t) {
|
|
808
|
+
var s, a, l, c;
|
|
743
809
|
const { id: n, label: r, path: o, withData: i } = t;
|
|
744
810
|
return i({
|
|
745
811
|
id: n,
|
|
@@ -752,14 +818,14 @@ function Tr(e, t) {
|
|
|
752
818
|
names: ((s = e.resumeFilter) == null ? void 0 : s.names) ?? [],
|
|
753
819
|
agentUniqueIds: ((a = e.resumeFilter) == null ? void 0 : a.agentUniqueIds) ?? [],
|
|
754
820
|
resumeUniqueIds: ((l = e.resumeFilter) == null ? void 0 : l.resumeUniqueIds) ?? [],
|
|
755
|
-
pageSize: ((
|
|
821
|
+
pageSize: ((c = e.resumeFilter) == null ? void 0 : c.pageSize) ?? 20
|
|
756
822
|
},
|
|
757
823
|
...e.resumeMinCount !== void 0 ? { minCount: e.resumeMinCount } : {},
|
|
758
824
|
...e.resumeMaxCount !== void 0 ? { maxCount: e.resumeMaxCount } : {},
|
|
759
825
|
value: { path: o }
|
|
760
826
|
});
|
|
761
827
|
}
|
|
762
|
-
function
|
|
828
|
+
function Dr(e, t, n) {
|
|
763
829
|
const r = n.nameFromValue(e.value), o = {
|
|
764
830
|
...t("resume_multiselect"),
|
|
765
831
|
name: r,
|
|
@@ -768,86 +834,86 @@ function Ir(e, t, n) {
|
|
|
768
834
|
i && (o.placeholder = i);
|
|
769
835
|
const s = n.asLiteral(e.help);
|
|
770
836
|
if (s && (o.help = s), e.resumeFilter && typeof e.resumeFilter == "object") {
|
|
771
|
-
const
|
|
837
|
+
const c = e.resumeFilter;
|
|
772
838
|
o.resumeFilter = {
|
|
773
|
-
names: Array.isArray(
|
|
774
|
-
agentUniqueIds: Array.isArray(
|
|
775
|
-
resumeUniqueIds: Array.isArray(
|
|
776
|
-
pageSize: typeof
|
|
839
|
+
names: Array.isArray(c.names) ? c.names.map(String) : [],
|
|
840
|
+
agentUniqueIds: Array.isArray(c.agentUniqueIds) ? c.agentUniqueIds.map(String) : [],
|
|
841
|
+
resumeUniqueIds: Array.isArray(c.resumeUniqueIds) ? c.resumeUniqueIds.map(String) : [],
|
|
842
|
+
pageSize: typeof c.pageSize == "number" ? c.pageSize : 20
|
|
777
843
|
};
|
|
778
844
|
}
|
|
779
|
-
const a =
|
|
845
|
+
const a = Dt(e.minCount);
|
|
780
846
|
a !== void 0 && (o.resumeMinCount = a);
|
|
781
|
-
const l =
|
|
847
|
+
const l = Dt(e.maxCount);
|
|
782
848
|
return l !== void 0 && (o.resumeMaxCount = l), o;
|
|
783
849
|
}
|
|
784
|
-
const
|
|
785
|
-
function
|
|
850
|
+
const dn = ye(null);
|
|
851
|
+
function at({
|
|
786
852
|
resumeSearch: e,
|
|
787
853
|
children: t
|
|
788
854
|
}) {
|
|
789
|
-
return /* @__PURE__ */
|
|
855
|
+
return /* @__PURE__ */ u(dn.Provider, { value: e ?? null, children: t });
|
|
790
856
|
}
|
|
791
|
-
function
|
|
792
|
-
return
|
|
857
|
+
function Hr() {
|
|
858
|
+
return ve(dn);
|
|
793
859
|
}
|
|
794
|
-
function
|
|
860
|
+
function Ze(e) {
|
|
795
861
|
return typeof e == "string" ? e : "";
|
|
796
862
|
}
|
|
797
|
-
function
|
|
863
|
+
function et(e) {
|
|
798
864
|
if (!e || typeof e != "object")
|
|
799
865
|
return { names: [], agentUniqueIds: [], resumeUniqueIds: [], pageSize: 20 };
|
|
800
866
|
const t = e, n = Array.isArray(t.names) ? t.names.map(String).filter(Boolean) : [], r = Array.isArray(t.agentUniqueIds) ? t.agentUniqueIds.map(String).filter(Boolean) : [], o = Array.isArray(t.resumeUniqueIds) ? t.resumeUniqueIds.map(String).filter(Boolean) : [], i = typeof t.pageSize == "number" ? t.pageSize : Number(t.pageSize), s = Number.isFinite(i) && i >= 1 && i <= 100 ? Math.floor(i) : 20;
|
|
801
867
|
return { names: n, agentUniqueIds: r, resumeUniqueIds: o, pageSize: s };
|
|
802
868
|
}
|
|
803
|
-
function
|
|
869
|
+
function Kr(e) {
|
|
804
870
|
return JSON.stringify(e);
|
|
805
871
|
}
|
|
806
|
-
const
|
|
872
|
+
const Gr = {
|
|
807
873
|
name: "SkoponResumeSelect",
|
|
808
|
-
schema:
|
|
809
|
-
label:
|
|
810
|
-
placeholder:
|
|
811
|
-
help:
|
|
812
|
-
enableRefresh:
|
|
813
|
-
resumeFilter:
|
|
814
|
-
minCount:
|
|
815
|
-
maxCount:
|
|
816
|
-
value:
|
|
874
|
+
schema: h.object({
|
|
875
|
+
label: h.any().optional(),
|
|
876
|
+
placeholder: h.any().optional(),
|
|
877
|
+
help: h.any().optional(),
|
|
878
|
+
enableRefresh: h.any().optional(),
|
|
879
|
+
resumeFilter: h.any().optional(),
|
|
880
|
+
minCount: h.any().optional(),
|
|
881
|
+
maxCount: h.any().optional(),
|
|
882
|
+
value: h.any().optional()
|
|
817
883
|
}).passthrough()
|
|
818
|
-
},
|
|
819
|
-
function
|
|
820
|
-
const n = (t ?? []).filter(Boolean), r = n.slice(0,
|
|
884
|
+
}, Jr = 3, Wr = 2;
|
|
885
|
+
function tt(e, t) {
|
|
886
|
+
const n = (t ?? []).filter(Boolean), r = n.slice(0, Jr), o = n.length - r.length;
|
|
821
887
|
return /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-tags", children: [
|
|
822
|
-
/* @__PURE__ */
|
|
888
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: e }),
|
|
823
889
|
n.length > 0 ? /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-tags-list", children: [
|
|
824
|
-
r.map((i) => /* @__PURE__ */
|
|
825
|
-
o > 0 ? /* @__PURE__ */ I(
|
|
890
|
+
r.map((i) => /* @__PURE__ */ u(fe, { className: "skopon-resume-select-card-tag", children: i }, i)),
|
|
891
|
+
o > 0 ? /* @__PURE__ */ I(fe, { className: "skopon-resume-select-card-tag", children: [
|
|
826
892
|
"+",
|
|
827
893
|
o
|
|
828
894
|
] }) : null
|
|
829
|
-
] }) : /* @__PURE__ */
|
|
895
|
+
] }) : /* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-empty", children: "暂无" })
|
|
830
896
|
] });
|
|
831
897
|
}
|
|
832
|
-
function
|
|
898
|
+
function Yr(e) {
|
|
833
899
|
return /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-field", children: [
|
|
834
|
-
/* @__PURE__ */
|
|
835
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-tags-label", children: "满意度" }),
|
|
901
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-field-value", children: typeof e == "number" ? `${e}%` : "暂无" })
|
|
836
902
|
] });
|
|
837
903
|
}
|
|
838
|
-
function
|
|
904
|
+
function Qr({ work: e }) {
|
|
839
905
|
return /* @__PURE__ */ I("div", { className: "skopon-resume-select-card-work", children: [
|
|
840
|
-
/* @__PURE__ */
|
|
841
|
-
/* @__PURE__ */
|
|
906
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-cover", children: e.coverUrl ? /* @__PURE__ */ u("img", { src: e.coverUrl, alt: "", className: "skopon-resume-select-card-work-img" }) : /* @__PURE__ */ u(Dn, { className: "skopon-resume-select-card-work-placeholder" }) }),
|
|
907
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-work-title", children: e.title || "未命名作品" })
|
|
842
908
|
] });
|
|
843
909
|
}
|
|
844
|
-
function
|
|
910
|
+
function Xr({
|
|
845
911
|
item: e,
|
|
846
912
|
selected: t,
|
|
847
913
|
disabled: n,
|
|
848
914
|
onToggle: r
|
|
849
915
|
}) {
|
|
850
|
-
const o = (e.works ?? []).slice(0,
|
|
916
|
+
const o = (e.works ?? []).slice(0, Wr);
|
|
851
917
|
return /* @__PURE__ */ I(
|
|
852
918
|
"button",
|
|
853
919
|
{
|
|
@@ -856,179 +922,185 @@ function wr({
|
|
|
856
922
|
disabled: n,
|
|
857
923
|
onClick: r,
|
|
858
924
|
children: [
|
|
859
|
-
/* @__PURE__ */
|
|
860
|
-
|
|
925
|
+
/* @__PURE__ */ u(
|
|
926
|
+
Pn,
|
|
861
927
|
{
|
|
862
928
|
size: 48,
|
|
863
929
|
src: e.avatarUrl || void 0,
|
|
864
|
-
icon: e.avatarUrl ? void 0 : /* @__PURE__ */
|
|
930
|
+
icon: e.avatarUrl ? void 0 : /* @__PURE__ */ u($n, {}),
|
|
865
931
|
className: "skopon-resume-select-card-avatar"
|
|
866
932
|
}
|
|
867
933
|
),
|
|
868
|
-
/* @__PURE__ */
|
|
934
|
+
/* @__PURE__ */ u("div", { className: "skopon-resume-select-card-name", children: e.name || "未命名简历" }),
|
|
869
935
|
/* @__PURE__ */ I("div", { className: "skopon-resume-select-card-body", children: [
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
936
|
+
Yr(e.satisfaction),
|
|
937
|
+
tt("性格", e.personality),
|
|
938
|
+
tt("专长", e.specialties),
|
|
939
|
+
tt("擅长领域", e.traits),
|
|
874
940
|
/* @__PURE__ */ I("div", { className: "skopon-resume-select-card-works", children: [
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
o.length > 0 ? /* @__PURE__ */
|
|
941
|
+
/* @__PURE__ */ u("span", { className: "skopon-resume-select-card-works-label", children: "过往作品" }),
|
|
942
|
+
o.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-list", children: o.map((i, s) => /* @__PURE__ */ u(Qr, { work: i }, `${i.title}-${s}`)) }) : /* @__PURE__ */ u("div", { className: "skopon-resume-select-card-works-empty", children: "暂无作品" })
|
|
877
943
|
] })
|
|
878
944
|
] })
|
|
879
945
|
]
|
|
880
946
|
}
|
|
881
947
|
);
|
|
882
948
|
}
|
|
883
|
-
function
|
|
884
|
-
const { interactive: t } =
|
|
949
|
+
function Zr({ context: e }) {
|
|
950
|
+
const { interactive: t } = ie(), n = Hr(), { publishLiveOptions: r } = ht(), { value: o, setValue: i, setValueSilent: s, fieldName: a } = se(e, "value", {
|
|
885
951
|
component: "SkoponResumeSelect",
|
|
886
952
|
changeAction: "click"
|
|
887
|
-
}),
|
|
888
|
-
|
|
889
|
-
const
|
|
890
|
-
|
|
891
|
-
}, [
|
|
892
|
-
const
|
|
893
|
-
async (
|
|
894
|
-
const
|
|
953
|
+
}), l = e.componentModel.properties, c = Ze(l.label), m = Ze(l.placeholder), d = Ze(l.help), S = l.enableRefresh !== !1, g = we(l.minCount), b = we(l.maxCount), y = j(() => et(l.resumeFilter), [l.resumeFilter]), k = Kr(y), [f, p] = R(1), [v, x] = R(!1), [M, _] = R(""), [w, C] = R([]), [O, B] = R(0), [ne, K] = R(y.pageSize ?? 20), D = A(0), J = Y(o);
|
|
954
|
+
z(() => {
|
|
955
|
+
const T = un(J, b);
|
|
956
|
+
T !== null && s(T);
|
|
957
|
+
}, [b, J, s]);
|
|
958
|
+
const Z = $(
|
|
959
|
+
async (T) => {
|
|
960
|
+
const V = et(JSON.parse(k)), P = ++D.current;
|
|
895
961
|
if (!n) {
|
|
896
|
-
|
|
962
|
+
C([]), B(0), _("未配置简历搜索服务"), x(!1);
|
|
897
963
|
return;
|
|
898
964
|
}
|
|
899
|
-
|
|
965
|
+
x(!0), _("");
|
|
900
966
|
try {
|
|
901
|
-
const
|
|
902
|
-
if (
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
967
|
+
const N = await n({ filter: V, page: T });
|
|
968
|
+
if (P !== D.current) return;
|
|
969
|
+
C(N.list), B(N.total), p(N.page), K(N.pageSize), a && r(
|
|
970
|
+
a,
|
|
971
|
+
N.list.map((W) => ({
|
|
972
|
+
value: W.resumeUniqueId,
|
|
973
|
+
label: W.name || W.resumeUniqueId
|
|
974
|
+
}))
|
|
975
|
+
);
|
|
976
|
+
} catch (N) {
|
|
977
|
+
if (P !== D.current) return;
|
|
978
|
+
C([]), B(0), _(N instanceof Error ? N.message : "加载简历列表失败");
|
|
907
979
|
} finally {
|
|
908
|
-
|
|
980
|
+
P === D.current && x(!1);
|
|
909
981
|
}
|
|
910
982
|
},
|
|
911
|
-
[n,
|
|
983
|
+
[n, k, a, r]
|
|
912
984
|
);
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
}, [
|
|
916
|
-
const
|
|
985
|
+
z(() => {
|
|
986
|
+
p(1), Z(1);
|
|
987
|
+
}, [k, Z]);
|
|
988
|
+
const ee = (T) => {
|
|
917
989
|
if (!t) return;
|
|
918
|
-
const
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
990
|
+
const V = ln(
|
|
991
|
+
J,
|
|
992
|
+
T,
|
|
993
|
+
g,
|
|
994
|
+
b
|
|
923
995
|
);
|
|
924
|
-
|
|
925
|
-
},
|
|
926
|
-
const
|
|
927
|
-
|
|
928
|
-
},
|
|
996
|
+
V !== null && i(V);
|
|
997
|
+
}, F = () => {
|
|
998
|
+
const T = et(JSON.parse(k)), V = ne || T.pageSize || 20, P = Math.max(1, Math.ceil(O / V)), N = f >= P ? 1 : f + 1;
|
|
999
|
+
Z(N);
|
|
1000
|
+
}, L = m || "暂无匹配的简历";
|
|
929
1001
|
return /* @__PURE__ */ I(
|
|
930
1002
|
"div",
|
|
931
1003
|
{
|
|
932
1004
|
className: "form-block-preview skopon-resume-select",
|
|
933
|
-
"data-skopon-field":
|
|
1005
|
+
"data-skopon-field": a || void 0,
|
|
934
1006
|
children: [
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
/* @__PURE__ */
|
|
1007
|
+
c ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: c }) : null,
|
|
1008
|
+
v && w.length === 0 ? /* @__PURE__ */ I("div", { className: "skopon-resume-select-status", children: [
|
|
1009
|
+
/* @__PURE__ */ u(mt, { size: "small" }),
|
|
938
1010
|
" 加载简历…"
|
|
939
1011
|
] }) : null,
|
|
940
|
-
!
|
|
941
|
-
!
|
|
942
|
-
|
|
943
|
-
|
|
1012
|
+
!v && M ? /* @__PURE__ */ u(te.Text, { type: "danger", className: "skopon-resume-select-status", children: M }) : null,
|
|
1013
|
+
!v && !M && w.length === 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-empty", children: L }) : null,
|
|
1014
|
+
w.length > 0 ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-list", children: w.map((T) => /* @__PURE__ */ u(
|
|
1015
|
+
Xr,
|
|
944
1016
|
{
|
|
945
|
-
item:
|
|
946
|
-
selected:
|
|
947
|
-
disabled:
|
|
948
|
-
|
|
949
|
-
|
|
1017
|
+
item: T,
|
|
1018
|
+
selected: J.includes(T.resumeUniqueId),
|
|
1019
|
+
disabled: cn(
|
|
1020
|
+
J,
|
|
1021
|
+
T.resumeUniqueId,
|
|
950
1022
|
t,
|
|
951
|
-
|
|
952
|
-
|
|
1023
|
+
g,
|
|
1024
|
+
b
|
|
953
1025
|
),
|
|
954
|
-
onToggle: () =>
|
|
1026
|
+
onToggle: () => ee(T.resumeUniqueId)
|
|
955
1027
|
},
|
|
956
|
-
|
|
1028
|
+
T.resumeUniqueId
|
|
957
1029
|
)) }) : null,
|
|
958
|
-
|
|
959
|
-
|
|
1030
|
+
S && n ? /* @__PURE__ */ u("div", { className: "skopon-resume-select-actions", children: /* @__PURE__ */ u(
|
|
1031
|
+
ze,
|
|
960
1032
|
{
|
|
961
1033
|
type: "default",
|
|
962
1034
|
size: "small",
|
|
963
|
-
icon: /* @__PURE__ */
|
|
964
|
-
loading:
|
|
1035
|
+
icon: /* @__PURE__ */ u(Gt, {}),
|
|
1036
|
+
loading: v,
|
|
965
1037
|
disabled: !t,
|
|
966
|
-
onClick:
|
|
1038
|
+
onClick: F,
|
|
967
1039
|
children: "换一批"
|
|
968
1040
|
}
|
|
969
1041
|
) }) : null,
|
|
970
|
-
|
|
1042
|
+
d ? /* @__PURE__ */ u(te.Text, { type: "secondary", className: "form-block-preview-help", children: d }) : null
|
|
971
1043
|
]
|
|
972
1044
|
}
|
|
973
1045
|
);
|
|
974
1046
|
}
|
|
975
|
-
const
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
),
|
|
1047
|
+
const eo = Q(
|
|
1048
|
+
Gr,
|
|
1049
|
+
Zr
|
|
1050
|
+
), to = {
|
|
979
1051
|
type: "resume_multiselect",
|
|
980
1052
|
componentName: "SkoponResumeSelect",
|
|
981
|
-
toComponent:
|
|
982
|
-
fromComponent:
|
|
983
|
-
catalogComponents: [
|
|
984
|
-
},
|
|
985
|
-
|
|
986
|
-
),
|
|
987
|
-
|
|
1053
|
+
toComponent: $r,
|
|
1054
|
+
fromComponent: Dr,
|
|
1055
|
+
catalogComponents: [eo]
|
|
1056
|
+
}, qe = [to, jr], no = new Map(
|
|
1057
|
+
qe.map((e) => [e.type, e])
|
|
1058
|
+
), ro = new Map(
|
|
1059
|
+
qe.map((e) => [e.componentName, e])
|
|
988
1060
|
);
|
|
989
|
-
function
|
|
990
|
-
return
|
|
1061
|
+
function oo(e) {
|
|
1062
|
+
return no.get(e);
|
|
991
1063
|
}
|
|
992
|
-
function
|
|
993
|
-
return
|
|
1064
|
+
function io(e) {
|
|
1065
|
+
return ro.get(e);
|
|
994
1066
|
}
|
|
995
|
-
function
|
|
996
|
-
return
|
|
1067
|
+
function so() {
|
|
1068
|
+
return qe.flatMap((e) => e.catalogComponents);
|
|
997
1069
|
}
|
|
998
|
-
function
|
|
999
|
-
return
|
|
1070
|
+
function ao() {
|
|
1071
|
+
return qe.map((e) => e.componentName);
|
|
1000
1072
|
}
|
|
1001
|
-
const
|
|
1002
|
-
function
|
|
1073
|
+
const Pe = "root", lt = "__title__", ct = "__desc__", gt = "^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$";
|
|
1074
|
+
function lo(e) {
|
|
1003
1075
|
return `/${e}`;
|
|
1004
1076
|
}
|
|
1005
|
-
function
|
|
1077
|
+
function Ht(e) {
|
|
1006
1078
|
return e && typeof e == "object" && "path" in e ? String(e.path ?? "").replace(/^\//, "") : "";
|
|
1007
1079
|
}
|
|
1008
|
-
function
|
|
1080
|
+
function H(e) {
|
|
1009
1081
|
if (typeof e == "string") return e;
|
|
1010
1082
|
}
|
|
1011
|
-
function
|
|
1012
|
-
const t = e.id ||
|
|
1083
|
+
function co(e) {
|
|
1084
|
+
const t = e.id || Se("a2-"), n = e.type === "video" ? "video" : e.type === "audio" ? "audio" : "image";
|
|
1013
1085
|
return {
|
|
1014
1086
|
id: t,
|
|
1015
1087
|
component: "SkoponMedia",
|
|
1016
1088
|
mediaType: n,
|
|
1017
|
-
urls:
|
|
1018
|
-
mediaSize:
|
|
1089
|
+
urls: hr(e),
|
|
1090
|
+
mediaSize: ke(e.mediaSize),
|
|
1019
1091
|
label: e.label ?? "",
|
|
1020
1092
|
help: e.help ?? "",
|
|
1021
1093
|
placeholder: e.placeholder ?? ""
|
|
1022
1094
|
};
|
|
1023
1095
|
}
|
|
1024
|
-
function
|
|
1096
|
+
function uo(e) {
|
|
1025
1097
|
if (Array.isArray(e.urls))
|
|
1026
1098
|
return e.urls.map((n) => String(n).trim()).filter(Boolean);
|
|
1027
|
-
const t =
|
|
1099
|
+
const t = H(e.url);
|
|
1028
1100
|
return t != null && t.trim() ? [t.trim()] : [];
|
|
1029
1101
|
}
|
|
1030
|
-
function
|
|
1031
|
-
const r = typeof e.id == "string" ? e.id :
|
|
1102
|
+
function Ne(e, t, n) {
|
|
1103
|
+
const r = typeof e.id == "string" ? e.id : Se("block-"), o = uo(e), i = H(e.label) ?? H(e.description) ?? n, s = H(e.help), a = H(e.placeholder), l = ke(e.mediaSize);
|
|
1032
1104
|
return {
|
|
1033
1105
|
id: r,
|
|
1034
1106
|
type: t,
|
|
@@ -1039,10 +1111,10 @@ function ke(e, t, n) {
|
|
|
1039
1111
|
mediaUrls: o.length > 0 ? o : [""]
|
|
1040
1112
|
};
|
|
1041
1113
|
}
|
|
1042
|
-
function
|
|
1114
|
+
function mo(e) {
|
|
1043
1115
|
switch (e.type) {
|
|
1044
1116
|
case "toggle":
|
|
1045
|
-
return
|
|
1117
|
+
return Ce(e.defaultValue);
|
|
1046
1118
|
case "multiselect":
|
|
1047
1119
|
case "checkbox":
|
|
1048
1120
|
case "resume_multiselect":
|
|
@@ -1056,9 +1128,9 @@ function Jr(e) {
|
|
|
1056
1128
|
return typeof e.defaultValue == "string" ? e.defaultValue : "";
|
|
1057
1129
|
}
|
|
1058
1130
|
}
|
|
1059
|
-
function
|
|
1060
|
-
var
|
|
1061
|
-
const t = e.id ||
|
|
1131
|
+
function po(e) {
|
|
1132
|
+
var c;
|
|
1133
|
+
const t = e.id || Se("a2-"), n = e.label ?? "", r = ((c = e.name) == null ? void 0 : c.trim()) || "", o = r ? lo(r) : void 0, i = (e.options ?? []).map((m) => ({ label: m.label, value: m.value })), s = (m) => r ? { node: m, dataKey: r, dataValue: mo(e) } : { node: m }, a = { id: t, label: n, name: r, path: o, withData: s }, l = oo(e.type);
|
|
1062
1134
|
if (l)
|
|
1063
1135
|
return l.toComponent(e, a);
|
|
1064
1136
|
switch (e.type) {
|
|
@@ -1083,7 +1155,7 @@ function Wr(e) {
|
|
|
1083
1155
|
component: "TextField",
|
|
1084
1156
|
label: n,
|
|
1085
1157
|
variant: "shortText",
|
|
1086
|
-
validationRegexp:
|
|
1158
|
+
validationRegexp: gt,
|
|
1087
1159
|
...e.placeholder ? { placeholder: e.placeholder } : {},
|
|
1088
1160
|
value: { path: o }
|
|
1089
1161
|
});
|
|
@@ -1169,7 +1241,7 @@ function Wr(e) {
|
|
|
1169
1241
|
case "image":
|
|
1170
1242
|
case "video":
|
|
1171
1243
|
case "audio":
|
|
1172
|
-
return { node:
|
|
1244
|
+
return { node: co(e) };
|
|
1173
1245
|
case "file":
|
|
1174
1246
|
return s({
|
|
1175
1247
|
id: t,
|
|
@@ -1186,31 +1258,31 @@ function Wr(e) {
|
|
|
1186
1258
|
return { node: null };
|
|
1187
1259
|
}
|
|
1188
1260
|
}
|
|
1189
|
-
function
|
|
1261
|
+
function ut(e) {
|
|
1190
1262
|
if (!e || !Array.isArray(e.components) || e.components.length === 0) return !0;
|
|
1191
|
-
const t = e.components.find((r) => r.id ===
|
|
1263
|
+
const t = e.components.find((r) => r.id === Pe);
|
|
1192
1264
|
if (!t) return e.components.length === 0;
|
|
1193
1265
|
const n = t.children;
|
|
1194
1266
|
return !Array.isArray(n) || n.length === 0;
|
|
1195
1267
|
}
|
|
1196
|
-
function
|
|
1268
|
+
function pn(e, t) {
|
|
1197
1269
|
const n = [], r = [], o = {}, i = (t == null ? void 0 : t.includeHeader) !== !1, s = (e.title ?? "").trim(), a = (e.description ?? "").trim();
|
|
1198
|
-
i && s && (n.push({ id:
|
|
1270
|
+
i && s && (n.push({ id: lt, component: "Text", text: s, variant: "h2" }), r.push(lt)), i && a && (n.push({ id: ct, component: "Text", text: a, variant: "body" }), r.push(ct));
|
|
1199
1271
|
for (const m of e.blocks ?? []) {
|
|
1200
|
-
const { node: d, dataKey: S, dataValue: g } =
|
|
1272
|
+
const { node: d, dataKey: S, dataValue: g } = po(m);
|
|
1201
1273
|
d && (n.push(d), r.push(d.id), S && (o[S] = g));
|
|
1202
1274
|
}
|
|
1203
|
-
n.unshift({ id:
|
|
1204
|
-
const l = { root:
|
|
1205
|
-
return
|
|
1275
|
+
n.unshift({ id: Pe, component: "Column", children: r });
|
|
1276
|
+
const l = { root: Pe, components: n, dataModel: o }, c = t == null ? void 0 : t.styleId;
|
|
1277
|
+
return c !== void 0 && (l.surfaceProperties = { styleId: c ?? null }), l;
|
|
1206
1278
|
}
|
|
1207
|
-
function
|
|
1279
|
+
function fo(e) {
|
|
1208
1280
|
const t = /* @__PURE__ */ new Map();
|
|
1209
1281
|
for (const n of e.components ?? [])
|
|
1210
1282
|
n && typeof n.id == "string" && t.set(n.id, n);
|
|
1211
1283
|
return t;
|
|
1212
1284
|
}
|
|
1213
|
-
function
|
|
1285
|
+
function nt(e) {
|
|
1214
1286
|
const t = e.options;
|
|
1215
1287
|
return Array.isArray(t) ? t.map((n) => {
|
|
1216
1288
|
if (!n || typeof n != "object") return null;
|
|
@@ -1221,10 +1293,10 @@ function Ke(e) {
|
|
|
1221
1293
|
};
|
|
1222
1294
|
}).filter((n) => !!n) : [];
|
|
1223
1295
|
}
|
|
1224
|
-
function
|
|
1225
|
-
const t = typeof e.id == "string" ? e.id :
|
|
1296
|
+
function ho(e) {
|
|
1297
|
+
const t = typeof e.id == "string" ? e.id : Se("block-"), n = String(e.component ?? ""), r = H(e.label) ?? H(e.text) ?? "", o = Ht(e.value), i = (a) => ({ id: t, type: a, label: r }), s = io(n);
|
|
1226
1298
|
if (s)
|
|
1227
|
-
return s.fromComponent(e, i, { asLiteral:
|
|
1299
|
+
return s.fromComponent(e, i, { asLiteral: H, nameFromValue: Ht });
|
|
1228
1300
|
switch (n) {
|
|
1229
1301
|
case "Text": {
|
|
1230
1302
|
const a = String(e.variant ?? "body"), l = /^h[1-6]$/i.test(a) || a === "title" || a === "subtitle";
|
|
@@ -1233,56 +1305,56 @@ function Qr(e) {
|
|
|
1233
1305
|
case "TextField": {
|
|
1234
1306
|
const a = String(e.variant ?? "shortText");
|
|
1235
1307
|
let l = "text";
|
|
1236
|
-
a === "longText" ? l = "textarea" : a === "number" ? l = "number" :
|
|
1237
|
-
const
|
|
1238
|
-
return m && (
|
|
1308
|
+
a === "longText" ? l = "textarea" : a === "number" ? l = "number" : H(e.validationRegexp) === gt && (l = "email");
|
|
1309
|
+
const c = { ...i(l), name: o }, m = H(e.placeholder);
|
|
1310
|
+
return m && (c.placeholder = m), c;
|
|
1239
1311
|
}
|
|
1240
1312
|
case "CheckBox":
|
|
1241
1313
|
return { ...i("toggle"), name: o };
|
|
1242
1314
|
case "SkoponSelect": {
|
|
1243
|
-
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select",
|
|
1315
|
+
const l = String(e.mode ?? "single") === "multiple" ? "multiselect" : "select", c = {
|
|
1244
1316
|
...i(l),
|
|
1245
1317
|
name: o,
|
|
1246
|
-
options:
|
|
1247
|
-
}, m =
|
|
1248
|
-
return m && (
|
|
1318
|
+
options: nt(e)
|
|
1319
|
+
}, m = H(e.placeholder);
|
|
1320
|
+
return m && (c.placeholder = m), c;
|
|
1249
1321
|
}
|
|
1250
1322
|
case "ChoicePicker": {
|
|
1251
|
-
const a =
|
|
1323
|
+
const a = H(e.skoponPickerType);
|
|
1252
1324
|
if (a === "select" || a === "multiselect" || a === "radio" || a === "checkbox") {
|
|
1253
1325
|
const m = {
|
|
1254
1326
|
...i(a),
|
|
1255
1327
|
name: o,
|
|
1256
|
-
options:
|
|
1257
|
-
}, d =
|
|
1328
|
+
options: nt(e)
|
|
1329
|
+
}, d = H(e.placeholder);
|
|
1258
1330
|
return d && (m.placeholder = d), m;
|
|
1259
1331
|
}
|
|
1260
|
-
const
|
|
1261
|
-
return { ...i(
|
|
1332
|
+
const c = String(e.variant ?? "mutuallyExclusive") === "multipleSelection" ? "checkbox" : "radio";
|
|
1333
|
+
return { ...i(c), name: o, options: nt(e) };
|
|
1262
1334
|
}
|
|
1263
1335
|
case "DateTimeInput": {
|
|
1264
|
-
const a = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!a && l ? "time" : "datetime"), name: o }, d =
|
|
1336
|
+
const a = e.enableDate === !0, l = e.enableTime === !0, m = { ...i(!a && l ? "time" : "datetime"), name: o }, d = H(e.placeholder);
|
|
1265
1337
|
return d && (m.placeholder = d), m;
|
|
1266
1338
|
}
|
|
1267
1339
|
case "SkoponMedia": {
|
|
1268
1340
|
const a = String(e.mediaType ?? "image");
|
|
1269
|
-
return
|
|
1341
|
+
return Ne(e, a === "video" ? "video" : a === "audio" ? "audio" : "image", r);
|
|
1270
1342
|
}
|
|
1271
1343
|
case "Image":
|
|
1272
|
-
return
|
|
1344
|
+
return Ne(e, "image", r);
|
|
1273
1345
|
case "Video":
|
|
1274
|
-
return
|
|
1346
|
+
return Ne(e, "video", r);
|
|
1275
1347
|
case "AudioPlayer":
|
|
1276
|
-
return
|
|
1348
|
+
return Ne(e, "audio", r);
|
|
1277
1349
|
case "FileUpload": {
|
|
1278
|
-
const a =
|
|
1279
|
-
return a && (l.fileAcceptExtensions = a.split(",").map((
|
|
1350
|
+
const a = H(e.accept) ?? "", l = { ...i("file"), name: o };
|
|
1351
|
+
return a && (l.fileAcceptExtensions = a.split(",").map((c) => c.trim()).filter(Boolean)), Array.isArray(e.fileAcceptTypes) && (l.fileAcceptTypes = e.fileAcceptTypes.map(String)), typeof e.filePlaceholderIcon == "string" && (l.filePlaceholderIcon = e.filePlaceholderIcon), typeof e.minCount == "number" && (l.fileMinCount = e.minCount), typeof e.maxCount == "number" && (l.fileMaxCount = e.maxCount), l;
|
|
1280
1352
|
}
|
|
1281
1353
|
default:
|
|
1282
1354
|
return null;
|
|
1283
1355
|
}
|
|
1284
1356
|
}
|
|
1285
|
-
function
|
|
1357
|
+
function fn(e, t, n, r) {
|
|
1286
1358
|
if (n.has(e)) return;
|
|
1287
1359
|
n.add(e);
|
|
1288
1360
|
const o = t.get(e);
|
|
@@ -1290,47 +1362,47 @@ function Xt(e, t, n, r) {
|
|
|
1290
1362
|
const i = String(o.component ?? "");
|
|
1291
1363
|
if ((i === "Column" || i === "Row") && Array.isArray(o.children)) {
|
|
1292
1364
|
for (const s of o.children)
|
|
1293
|
-
typeof s == "string" &&
|
|
1365
|
+
typeof s == "string" && fn(s, t, n, r);
|
|
1294
1366
|
return;
|
|
1295
1367
|
}
|
|
1296
1368
|
r.push(o);
|
|
1297
1369
|
}
|
|
1298
|
-
function
|
|
1370
|
+
function go(e, t) {
|
|
1299
1371
|
return t ? e.map((n) => {
|
|
1300
1372
|
var i;
|
|
1301
1373
|
const r = (i = n.name) == null ? void 0 : i.trim();
|
|
1302
1374
|
if (!r || !(r in t)) return n;
|
|
1303
1375
|
const o = t[r];
|
|
1304
|
-
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue:
|
|
1376
|
+
return o === void 0 ? n : n.type === "toggle" ? { ...n, defaultValue: Ce(o) } : { ...n, defaultValue: o };
|
|
1305
1377
|
}) : e;
|
|
1306
1378
|
}
|
|
1307
|
-
function
|
|
1379
|
+
function yo(e) {
|
|
1308
1380
|
if (!e || !Array.isArray(e.components))
|
|
1309
|
-
return
|
|
1310
|
-
const t =
|
|
1311
|
-
|
|
1381
|
+
return Re({ title: "", description: "", blocks: [], jsonSchema: {} });
|
|
1382
|
+
const t = fo(e), n = [];
|
|
1383
|
+
fn(e.root ?? Pe, t, /* @__PURE__ */ new Set(), n);
|
|
1312
1384
|
let r = "", o = "";
|
|
1313
1385
|
const i = [];
|
|
1314
1386
|
for (const s of n) {
|
|
1315
|
-
if (s.id ===
|
|
1316
|
-
r =
|
|
1387
|
+
if (s.id === lt) {
|
|
1388
|
+
r = H(s.text) ?? r;
|
|
1317
1389
|
continue;
|
|
1318
1390
|
}
|
|
1319
|
-
if (s.id ===
|
|
1320
|
-
o =
|
|
1391
|
+
if (s.id === ct) {
|
|
1392
|
+
o = H(s.text) ?? o;
|
|
1321
1393
|
continue;
|
|
1322
1394
|
}
|
|
1323
|
-
const a =
|
|
1395
|
+
const a = ho(s);
|
|
1324
1396
|
a && i.push(a);
|
|
1325
1397
|
}
|
|
1326
|
-
return
|
|
1398
|
+
return Re({
|
|
1327
1399
|
title: r,
|
|
1328
1400
|
description: o,
|
|
1329
|
-
blocks:
|
|
1401
|
+
blocks: go(i, e.dataModel),
|
|
1330
1402
|
jsonSchema: {}
|
|
1331
1403
|
});
|
|
1332
1404
|
}
|
|
1333
|
-
function
|
|
1405
|
+
function vo(e, t) {
|
|
1334
1406
|
const { surfaceId: n, catalogId: r } = t, o = [
|
|
1335
1407
|
{ version: "v0.9", createSurface: { surfaceId: n, catalogId: r } },
|
|
1336
1408
|
{
|
|
@@ -1343,25 +1415,25 @@ function eo(e, t) {
|
|
|
1343
1415
|
updateDataModel: { surfaceId: n, path: "/", value: e.dataModel }
|
|
1344
1416
|
}), o;
|
|
1345
1417
|
}
|
|
1346
|
-
function
|
|
1418
|
+
function hn(e) {
|
|
1347
1419
|
return !!e && typeof e == "object" && !Array.isArray(e) && Array.isArray(e.components);
|
|
1348
1420
|
}
|
|
1349
|
-
function
|
|
1421
|
+
function So(e, t) {
|
|
1350
1422
|
if (!e || typeof e != "object") return null;
|
|
1351
|
-
const n = e, r =
|
|
1352
|
-
if (r && !
|
|
1423
|
+
const n = e, r = hn(n.a2ui) ? n.a2ui : void 0;
|
|
1424
|
+
if (r && !ut(r)) return r;
|
|
1353
1425
|
const o = Array.isArray(n.blocks) ? n.blocks : [];
|
|
1354
1426
|
if (o.length === 0) return null;
|
|
1355
|
-
const i =
|
|
1427
|
+
const i = ue({
|
|
1356
1428
|
title: typeof n.title == "string" ? n.title : "",
|
|
1357
1429
|
description: typeof n.description == "string" ? n.description : "",
|
|
1358
1430
|
blocks: o,
|
|
1359
|
-
jsonSchema:
|
|
1360
|
-
}), s =
|
|
1361
|
-
return
|
|
1431
|
+
jsonSchema: ft(n.jsonSchema ?? n.json_schema)
|
|
1432
|
+
}), s = pn(i, t);
|
|
1433
|
+
return ut(s) ? null : s;
|
|
1362
1434
|
}
|
|
1363
|
-
function
|
|
1364
|
-
return
|
|
1435
|
+
function bo(e, t, n) {
|
|
1436
|
+
return pn(
|
|
1365
1437
|
{
|
|
1366
1438
|
title: e.title,
|
|
1367
1439
|
description: e.description,
|
|
@@ -1370,18 +1442,18 @@ function no(e, t, n) {
|
|
|
1370
1442
|
n
|
|
1371
1443
|
);
|
|
1372
1444
|
}
|
|
1373
|
-
function
|
|
1445
|
+
function ko(e) {
|
|
1374
1446
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1375
1447
|
return;
|
|
1376
1448
|
const t = e;
|
|
1377
|
-
return !(Array.isArray(t.blocks) && t.blocks.length > 0) &&
|
|
1449
|
+
return !(Array.isArray(t.blocks) && t.blocks.length > 0) && hn(t.a2ui) ? yo(t.a2ui) : ue({
|
|
1378
1450
|
title: typeof t.title == "string" ? t.title : "",
|
|
1379
1451
|
description: typeof t.description == "string" ? t.description : "",
|
|
1380
1452
|
blocks: Array.isArray(t.blocks) ? t.blocks : [],
|
|
1381
|
-
jsonSchema:
|
|
1453
|
+
jsonSchema: ft(t.jsonSchema ?? t.json_schema)
|
|
1382
1454
|
});
|
|
1383
1455
|
}
|
|
1384
|
-
function
|
|
1456
|
+
function Co(e, t, n) {
|
|
1385
1457
|
const r = e.model.surfacesMap.get(t);
|
|
1386
1458
|
if (!r) return {};
|
|
1387
1459
|
const o = {};
|
|
@@ -1391,15 +1463,15 @@ function oo(e, t, n) {
|
|
|
1391
1463
|
}
|
|
1392
1464
|
return o;
|
|
1393
1465
|
}
|
|
1394
|
-
function
|
|
1395
|
-
return
|
|
1466
|
+
function Ao(e) {
|
|
1467
|
+
return ue({
|
|
1396
1468
|
title: "",
|
|
1397
1469
|
description: "",
|
|
1398
1470
|
blocks: [e],
|
|
1399
1471
|
jsonSchema: {}
|
|
1400
1472
|
}).blocks[0];
|
|
1401
1473
|
}
|
|
1402
|
-
function
|
|
1474
|
+
function _o(e, t) {
|
|
1403
1475
|
var o, i;
|
|
1404
1476
|
const n = /* @__PURE__ */ new Map();
|
|
1405
1477
|
for (const s of t) {
|
|
@@ -1408,11 +1480,11 @@ function so(e, t) {
|
|
|
1408
1480
|
}
|
|
1409
1481
|
const r = [];
|
|
1410
1482
|
for (const s of e.blocks) {
|
|
1411
|
-
if (
|
|
1412
|
-
r.push(
|
|
1483
|
+
if (Oe(s.type)) {
|
|
1484
|
+
r.push(Ao(s));
|
|
1413
1485
|
continue;
|
|
1414
1486
|
}
|
|
1415
|
-
if (!
|
|
1487
|
+
if (!ae(s.type)) continue;
|
|
1416
1488
|
const a = (i = s.name) == null ? void 0 : i.trim();
|
|
1417
1489
|
if (!a) continue;
|
|
1418
1490
|
const l = n.get(a);
|
|
@@ -1420,42 +1492,42 @@ function so(e, t) {
|
|
|
1420
1492
|
}
|
|
1421
1493
|
return r;
|
|
1422
1494
|
}
|
|
1423
|
-
function
|
|
1495
|
+
function To(e, t) {
|
|
1424
1496
|
var r;
|
|
1425
1497
|
const n = {
|
|
1426
1498
|
...e,
|
|
1427
1499
|
name: ((r = e.name) == null ? void 0 : r.trim()) || t.name
|
|
1428
1500
|
};
|
|
1429
|
-
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue),
|
|
1501
|
+
return t.defaultValue !== void 0 && (n.defaultValue = t.defaultValue), ue({
|
|
1430
1502
|
title: "",
|
|
1431
1503
|
description: "",
|
|
1432
1504
|
blocks: [n],
|
|
1433
1505
|
jsonSchema: {}
|
|
1434
1506
|
}).blocks[0];
|
|
1435
1507
|
}
|
|
1436
|
-
function
|
|
1508
|
+
function Be(e) {
|
|
1437
1509
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1438
1510
|
const t = e;
|
|
1439
|
-
return Array.isArray(t.blocks) ?
|
|
1511
|
+
return Array.isArray(t.blocks) ? ue({
|
|
1440
1512
|
title: typeof t.title == "string" ? t.title : "",
|
|
1441
1513
|
description: typeof t.description == "string" ? t.description : "",
|
|
1442
1514
|
blocks: t.blocks,
|
|
1443
1515
|
jsonSchema: {}
|
|
1444
1516
|
}) : null;
|
|
1445
1517
|
}
|
|
1446
|
-
function
|
|
1447
|
-
var i, s, a, l,
|
|
1518
|
+
function xo(e, t) {
|
|
1519
|
+
var i, s, a, l, c, m;
|
|
1448
1520
|
const n = /* @__PURE__ */ new Map();
|
|
1449
1521
|
for (const d of (t == null ? void 0 : t.blocks) ?? [])
|
|
1450
|
-
|
|
1522
|
+
ae(d.type) && ((i = d.name) != null && i.trim()) && n.set(d.name.trim(), d);
|
|
1451
1523
|
const r = [], o = [];
|
|
1452
1524
|
for (const d of e.blocks) {
|
|
1453
|
-
if (!
|
|
1525
|
+
if (!ae(d.type)) continue;
|
|
1454
1526
|
const S = (s = d.name) == null ? void 0 : s.trim();
|
|
1455
1527
|
if (!S) continue;
|
|
1456
1528
|
const g = n.get(S);
|
|
1457
|
-
g ? r.push(
|
|
1458
|
-
|
|
1529
|
+
g ? r.push(To(g, d)) : o.push(
|
|
1530
|
+
ue({
|
|
1459
1531
|
title: "",
|
|
1460
1532
|
description: "",
|
|
1461
1533
|
blocks: [d],
|
|
@@ -1466,88 +1538,88 @@ function lo(e, t) {
|
|
|
1466
1538
|
return {
|
|
1467
1539
|
matchedBlocks: r,
|
|
1468
1540
|
extraBlocks: o,
|
|
1469
|
-
renderBlocks:
|
|
1541
|
+
renderBlocks: _o(e, r),
|
|
1470
1542
|
title: ((a = e.title) == null ? void 0 : a.trim()) || ((l = t == null ? void 0 : t.title) == null ? void 0 : l.trim()) || "",
|
|
1471
|
-
description: ((
|
|
1543
|
+
description: ((c = e.description) == null ? void 0 : c.trim()) || ((m = t == null ? void 0 : t.description) == null ? void 0 : m.trim()) || ""
|
|
1472
1544
|
};
|
|
1473
1545
|
}
|
|
1474
|
-
function
|
|
1546
|
+
function Io(e) {
|
|
1475
1547
|
const { type: t, defaultValue: n } = e;
|
|
1476
1548
|
return n !== void 0 ? t === "toggle" ? n === !0 || n === "true" : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? Array.isArray(n) ? n.map(String) : typeof n == "string" && n ? [n] : [] : n : t === "toggle" ? !1 : t === "multiselect" || t === "checkbox" || t === "resume_multiselect" || t === "case_multiselect" ? [] : t === "number" ? null : "";
|
|
1477
1549
|
}
|
|
1478
|
-
function
|
|
1550
|
+
function yt(e) {
|
|
1479
1551
|
var n;
|
|
1480
1552
|
const t = {};
|
|
1481
1553
|
for (const r of e) {
|
|
1482
|
-
if (!
|
|
1554
|
+
if (!ae(r.type)) continue;
|
|
1483
1555
|
const o = (n = r.name) == null ? void 0 : n.trim();
|
|
1484
|
-
o && (t[o] =
|
|
1556
|
+
o && (t[o] = Io(r));
|
|
1485
1557
|
}
|
|
1486
1558
|
return t;
|
|
1487
1559
|
}
|
|
1488
|
-
function
|
|
1560
|
+
function Mo(e) {
|
|
1489
1561
|
return e.blocks.some(
|
|
1490
1562
|
(t) => {
|
|
1491
1563
|
var n;
|
|
1492
|
-
return
|
|
1564
|
+
return ae(t.type) && !!((n = t.name) != null && n.trim());
|
|
1493
1565
|
}
|
|
1494
1566
|
);
|
|
1495
1567
|
}
|
|
1496
|
-
function
|
|
1568
|
+
function No(e) {
|
|
1497
1569
|
return e.blocks.filter((t) => {
|
|
1498
1570
|
var n;
|
|
1499
|
-
return
|
|
1571
|
+
return Oe(t.type) ? !0 : ae(t.type) && !!((n = t.name) != null && n.trim());
|
|
1500
1572
|
});
|
|
1501
1573
|
}
|
|
1502
|
-
function
|
|
1574
|
+
function Fo(e) {
|
|
1503
1575
|
return e.blocks.filter((t) => {
|
|
1504
1576
|
var n;
|
|
1505
|
-
return
|
|
1577
|
+
return ae(t.type) && ((n = t.name) == null ? void 0 : n.trim());
|
|
1506
1578
|
}).map((t) => t.name.trim());
|
|
1507
1579
|
}
|
|
1508
|
-
function
|
|
1580
|
+
function vt(e) {
|
|
1509
1581
|
return e.replace(/'/g, "'\\''");
|
|
1510
1582
|
}
|
|
1511
|
-
function
|
|
1583
|
+
function gn(e) {
|
|
1512
1584
|
var n;
|
|
1513
1585
|
const t = (n = e == null ? void 0 : e.Authorization) == null ? void 0 : n.trim();
|
|
1514
|
-
return t ? ` -H 'Authorization: ${
|
|
1586
|
+
return t ? ` -H 'Authorization: ${vt(t)}' \\` : " -H 'Authorization: Bearer <token>' \\";
|
|
1515
1587
|
}
|
|
1516
|
-
function
|
|
1588
|
+
function yn(e, t, n) {
|
|
1517
1589
|
const r = (t ?? "").trim() || "<callback_url>", o = JSON.stringify(e ?? {}, null, 2);
|
|
1518
1590
|
return [
|
|
1519
1591
|
`curl -X POST '${r}' \\`,
|
|
1520
1592
|
" -H 'Content-Type: application/json' \\",
|
|
1521
|
-
|
|
1522
|
-
` -d '${
|
|
1593
|
+
gn(n),
|
|
1594
|
+
` -d '${vt(o)}'`
|
|
1523
1595
|
].join(`
|
|
1524
1596
|
`);
|
|
1525
1597
|
}
|
|
1526
|
-
function
|
|
1598
|
+
function Eo(e, t) {
|
|
1527
1599
|
return JSON.stringify({ ...e, ...t }, null, 2);
|
|
1528
1600
|
}
|
|
1529
|
-
function
|
|
1601
|
+
function Uo({
|
|
1530
1602
|
cardValues: e,
|
|
1531
1603
|
extraValues: t = {},
|
|
1532
1604
|
callbackUrl: n,
|
|
1533
1605
|
headers: r
|
|
1534
1606
|
}) {
|
|
1535
|
-
const o = (n ?? "").trim() || "<callback_url>", i =
|
|
1607
|
+
const o = (n ?? "").trim() || "<callback_url>", i = Eo(e, t);
|
|
1536
1608
|
return [
|
|
1537
1609
|
`curl -X POST '${o}' \\`,
|
|
1538
1610
|
" -H 'Content-Type: application/json' \\",
|
|
1539
|
-
|
|
1540
|
-
` -d '${
|
|
1611
|
+
gn(r),
|
|
1612
|
+
` -d '${vt(i)}'`
|
|
1541
1613
|
].join(`
|
|
1542
1614
|
`);
|
|
1543
1615
|
}
|
|
1544
|
-
function
|
|
1545
|
-
const r =
|
|
1546
|
-
if (!r) return
|
|
1547
|
-
const o =
|
|
1548
|
-
return
|
|
1616
|
+
function rs(e, t, n) {
|
|
1617
|
+
const r = Be(e);
|
|
1618
|
+
if (!r) return yn(e, t, n);
|
|
1619
|
+
const o = yt(r.blocks);
|
|
1620
|
+
return Uo({ cardValues: o, callbackUrl: t, headers: n });
|
|
1549
1621
|
}
|
|
1550
|
-
async function
|
|
1622
|
+
async function vn(e, t, n) {
|
|
1551
1623
|
const r = e.trim();
|
|
1552
1624
|
if (!r)
|
|
1553
1625
|
throw new Error("callback_url 为空");
|
|
@@ -1574,7 +1646,7 @@ async function nn(e, t, n) {
|
|
|
1574
1646
|
}
|
|
1575
1647
|
return { ok: i.ok, status: i.status, body: s };
|
|
1576
1648
|
}
|
|
1577
|
-
async function
|
|
1649
|
+
async function os(e) {
|
|
1578
1650
|
var n;
|
|
1579
1651
|
if (typeof navigator < "u" && ((n = navigator.clipboard) != null && n.writeText)) {
|
|
1580
1652
|
await navigator.clipboard.writeText(e);
|
|
@@ -1590,7 +1662,7 @@ async function Ri(e) {
|
|
|
1590
1662
|
document.body.removeChild(t);
|
|
1591
1663
|
}
|
|
1592
1664
|
}
|
|
1593
|
-
async function
|
|
1665
|
+
async function St(e) {
|
|
1594
1666
|
let t;
|
|
1595
1667
|
try {
|
|
1596
1668
|
t = await e.json();
|
|
@@ -1603,8 +1675,8 @@ async function lt(e) {
|
|
|
1603
1675
|
throw new Error(t.message || `响应缺少 data (${e.status})`);
|
|
1604
1676
|
return t.data;
|
|
1605
1677
|
}
|
|
1606
|
-
const
|
|
1607
|
-
function
|
|
1678
|
+
const bt = "auth_user", Ro = "token", wo = "answer_agent_callback_url", Po = "realtime_ws_url", zo = "/api/v1/mock/ask_user_answer_mock";
|
|
1679
|
+
function kt(e) {
|
|
1608
1680
|
if (typeof window > "u") return null;
|
|
1609
1681
|
try {
|
|
1610
1682
|
return e === "localStorage" ? window.localStorage : window.sessionStorage;
|
|
@@ -1612,7 +1684,7 @@ function ut(e) {
|
|
|
1612
1684
|
return null;
|
|
1613
1685
|
}
|
|
1614
1686
|
}
|
|
1615
|
-
function
|
|
1687
|
+
function Ct(e) {
|
|
1616
1688
|
try {
|
|
1617
1689
|
const t = JSON.parse(e);
|
|
1618
1690
|
return !t || typeof t != "object" || Array.isArray(t) ? null : t;
|
|
@@ -1620,50 +1692,50 @@ function mt(e) {
|
|
|
1620
1692
|
return null;
|
|
1621
1693
|
}
|
|
1622
1694
|
}
|
|
1623
|
-
function
|
|
1624
|
-
const n =
|
|
1695
|
+
function Oo(e, t) {
|
|
1696
|
+
const n = Ct(e);
|
|
1625
1697
|
if (!n) return "";
|
|
1626
1698
|
const r = n[t];
|
|
1627
1699
|
return typeof r == "string" ? r.trim().replace(/^bearer\s+/i, "").trim() : "";
|
|
1628
1700
|
}
|
|
1629
|
-
function
|
|
1630
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1701
|
+
function qo(e = {}) {
|
|
1702
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? bt, r = e.answerAgentCallbackUrlField ?? wo, o = kt(t);
|
|
1631
1703
|
if (!o) return "";
|
|
1632
1704
|
const i = o.getItem(n);
|
|
1633
1705
|
if (!i) return "";
|
|
1634
|
-
const s =
|
|
1706
|
+
const s = Ct(i);
|
|
1635
1707
|
if (!s) return "";
|
|
1636
1708
|
const a = s[r];
|
|
1637
|
-
return (typeof a == "string" ? a.trim() : "") ||
|
|
1709
|
+
return (typeof a == "string" ? a.trim() : "") || zo;
|
|
1638
1710
|
}
|
|
1639
|
-
function
|
|
1640
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1711
|
+
function Bo(e = {}) {
|
|
1712
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? bt, r = e.realtimeWsUrlField ?? Po, o = kt(t);
|
|
1641
1713
|
if (!o) return "";
|
|
1642
1714
|
const i = o.getItem(n);
|
|
1643
1715
|
if (!i) return "";
|
|
1644
|
-
const s =
|
|
1716
|
+
const s = Ct(i);
|
|
1645
1717
|
if (!s) return "";
|
|
1646
1718
|
const a = s[r];
|
|
1647
1719
|
return typeof a == "string" ? a.trim() : "";
|
|
1648
1720
|
}
|
|
1649
|
-
function
|
|
1721
|
+
function At(e, t) {
|
|
1650
1722
|
return {
|
|
1651
|
-
...
|
|
1723
|
+
...Sn(t),
|
|
1652
1724
|
...e ?? {}
|
|
1653
1725
|
};
|
|
1654
1726
|
}
|
|
1655
|
-
function
|
|
1656
|
-
const t = e.storage ?? "sessionStorage", n = e.storageKey ??
|
|
1727
|
+
function Sn(e = {}) {
|
|
1728
|
+
const t = e.storage ?? "sessionStorage", n = e.storageKey ?? bt, r = e.tokenField ?? Ro, o = kt(t);
|
|
1657
1729
|
if (!o) return {};
|
|
1658
1730
|
const i = o.getItem(n);
|
|
1659
1731
|
if (!i) return {};
|
|
1660
|
-
const s =
|
|
1732
|
+
const s = Oo(i, r);
|
|
1661
1733
|
return s ? { Authorization: `Bearer ${s}` } : {};
|
|
1662
1734
|
}
|
|
1663
|
-
async function
|
|
1664
|
-
return e.getHeaders ? await e.getHeaders() ?? {} :
|
|
1735
|
+
async function _t(e = {}) {
|
|
1736
|
+
return e.getHeaders ? await e.getHeaders() ?? {} : Sn(e.authStorage);
|
|
1665
1737
|
}
|
|
1666
|
-
function
|
|
1738
|
+
function Lo(e = {}) {
|
|
1667
1739
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.detailPath ?? "/dev/form/detail", r = e.fetch ?? fetch;
|
|
1668
1740
|
async function o(i) {
|
|
1669
1741
|
const s = new URLSearchParams();
|
|
@@ -1673,21 +1745,21 @@ function Co(e = {}) {
|
|
|
1673
1745
|
s.set("form_unique_id", i.formUniqueId);
|
|
1674
1746
|
else
|
|
1675
1747
|
throw new Error("form_id 或 form_unique_id 至少传一个");
|
|
1676
|
-
const a = await
|
|
1748
|
+
const a = await _t(e), l = await r(`${t}${n}?${s.toString()}`, {
|
|
1677
1749
|
method: "GET",
|
|
1678
1750
|
headers: a
|
|
1679
|
-
}),
|
|
1751
|
+
}), c = await St(l), m = ko(c.form_definition);
|
|
1680
1752
|
return {
|
|
1681
|
-
formUniqueId:
|
|
1682
|
-
formId:
|
|
1683
|
-
disabled:
|
|
1753
|
+
formUniqueId: c.form_unique_id,
|
|
1754
|
+
formId: c.form_id,
|
|
1755
|
+
disabled: c.disabled === 1,
|
|
1684
1756
|
formDefinition: m,
|
|
1685
|
-
a2ui:
|
|
1757
|
+
a2ui: So(c.form_definition) ?? void 0
|
|
1686
1758
|
};
|
|
1687
1759
|
}
|
|
1688
1760
|
return { fetchDetail: o };
|
|
1689
1761
|
}
|
|
1690
|
-
function
|
|
1762
|
+
function Vo(e) {
|
|
1691
1763
|
if (!e || typeof e != "object" || Array.isArray(e))
|
|
1692
1764
|
return e ?? null;
|
|
1693
1765
|
const t = e;
|
|
@@ -1697,13 +1769,13 @@ function _o(e) {
|
|
|
1697
1769
|
blocks: t.blocks
|
|
1698
1770
|
} : e;
|
|
1699
1771
|
}
|
|
1700
|
-
function
|
|
1772
|
+
function Tt({
|
|
1701
1773
|
context: e,
|
|
1702
1774
|
payload: t,
|
|
1703
1775
|
form: n,
|
|
1704
1776
|
answer: r
|
|
1705
1777
|
}) {
|
|
1706
|
-
const o =
|
|
1778
|
+
const o = Be(t) ?? t, i = n ? Vo(n) : o;
|
|
1707
1779
|
return {
|
|
1708
1780
|
mission_id: e.missionId ?? null,
|
|
1709
1781
|
tenant_id: e.tenantId ?? null,
|
|
@@ -1716,7 +1788,7 @@ function ft({
|
|
|
1716
1788
|
answer: r
|
|
1717
1789
|
};
|
|
1718
1790
|
}
|
|
1719
|
-
function
|
|
1791
|
+
function xt(e) {
|
|
1720
1792
|
const t = e.callback_url;
|
|
1721
1793
|
if (typeof t != "string" || !t.trim())
|
|
1722
1794
|
return "callback_url 为空,无法提交";
|
|
@@ -1731,34 +1803,34 @@ function ht(e) {
|
|
|
1731
1803
|
const o = e.mission_id;
|
|
1732
1804
|
return o == null || o === "" ? "mission_id 缺失,无法提交" : null;
|
|
1733
1805
|
}
|
|
1734
|
-
function
|
|
1735
|
-
return
|
|
1736
|
-
|
|
1806
|
+
function is(e) {
|
|
1807
|
+
return xt(
|
|
1808
|
+
Tt({
|
|
1737
1809
|
context: e,
|
|
1738
1810
|
payload: {},
|
|
1739
1811
|
answer: {}
|
|
1740
1812
|
})
|
|
1741
1813
|
);
|
|
1742
1814
|
}
|
|
1743
|
-
const
|
|
1744
|
-
function
|
|
1815
|
+
const Kt = "answer_agent_callback_url 未配置,无法提交";
|
|
1816
|
+
function jo(e) {
|
|
1745
1817
|
if ((e == null ? void 0 : e.answerAgentCallbackUrl) != null) {
|
|
1746
1818
|
const n = e.answerAgentCallbackUrl.trim();
|
|
1747
1819
|
if (!n)
|
|
1748
|
-
throw new Error(
|
|
1820
|
+
throw new Error(Kt);
|
|
1749
1821
|
return n;
|
|
1750
1822
|
}
|
|
1751
|
-
const t =
|
|
1823
|
+
const t = qo(e == null ? void 0 : e.authStorage).trim();
|
|
1752
1824
|
if (!t)
|
|
1753
|
-
throw new Error(
|
|
1825
|
+
throw new Error(Kt);
|
|
1754
1826
|
return t;
|
|
1755
1827
|
}
|
|
1756
|
-
function
|
|
1828
|
+
function bn(e) {
|
|
1757
1829
|
if (!e || typeof e != "object" || Array.isArray(e)) return null;
|
|
1758
1830
|
const n = e.data;
|
|
1759
1831
|
return !n || typeof n != "object" || Array.isArray(n) ? null : n;
|
|
1760
1832
|
}
|
|
1761
|
-
function
|
|
1833
|
+
function $o(e, t) {
|
|
1762
1834
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
1763
1835
|
const n = t.message;
|
|
1764
1836
|
if (typeof n == "string" && n.trim())
|
|
@@ -1766,27 +1838,27 @@ function To(e, t) {
|
|
|
1766
1838
|
}
|
|
1767
1839
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
1768
1840
|
}
|
|
1769
|
-
function
|
|
1841
|
+
function Do(e) {
|
|
1770
1842
|
return `提交失败:${typeof e.error == "string" && e.error.trim() ? e.error.trim() : `回调 HTTP ${e.callback_status ?? "失败"}`}`;
|
|
1771
1843
|
}
|
|
1772
|
-
function
|
|
1773
|
-
const t =
|
|
1774
|
-
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message:
|
|
1844
|
+
function kn(e) {
|
|
1845
|
+
const t = bn(e.body);
|
|
1846
|
+
return (t == null ? void 0 : t.callback_ok) === !1 ? { type: "error", message: Do(t) } : e.ok ? { type: "success", message: "提交成功" } : {
|
|
1775
1847
|
type: "error",
|
|
1776
|
-
message:
|
|
1848
|
+
message: $o(e.status, e.body)
|
|
1777
1849
|
};
|
|
1778
1850
|
}
|
|
1779
|
-
async function
|
|
1780
|
-
const n =
|
|
1851
|
+
async function Cn(e, t) {
|
|
1852
|
+
const n = xt(e);
|
|
1781
1853
|
if (n)
|
|
1782
1854
|
throw new Error(n);
|
|
1783
|
-
const r =
|
|
1855
|
+
const r = jo(t), o = await vn(r, e, {
|
|
1784
1856
|
...t,
|
|
1785
|
-
headers:
|
|
1786
|
-
}), i =
|
|
1857
|
+
headers: At(t == null ? void 0 : t.headers, t == null ? void 0 : t.authStorage)
|
|
1858
|
+
}), i = bn(o.body);
|
|
1787
1859
|
return o.ok && (i == null ? void 0 : i.callback_ok) === !1 ? { ok: !1, status: o.status, body: o.body } : o;
|
|
1788
1860
|
}
|
|
1789
|
-
function
|
|
1861
|
+
function Ho(e) {
|
|
1790
1862
|
return {
|
|
1791
1863
|
resumeUniqueId: e.resume_unique_id,
|
|
1792
1864
|
resumeId: e.resume_id,
|
|
@@ -1807,7 +1879,7 @@ function No(e) {
|
|
|
1807
1879
|
}))
|
|
1808
1880
|
};
|
|
1809
1881
|
}
|
|
1810
|
-
function
|
|
1882
|
+
function Ko(e, t) {
|
|
1811
1883
|
const n = new URLSearchParams();
|
|
1812
1884
|
n.set("page", String(t)), n.set("page_size", String(e.pageSize ?? 20));
|
|
1813
1885
|
for (const r of e.names ?? [])
|
|
@@ -1818,27 +1890,27 @@ function Mo(e, t) {
|
|
|
1818
1890
|
r && n.append("resume_unique_id", r);
|
|
1819
1891
|
return n;
|
|
1820
1892
|
}
|
|
1821
|
-
function
|
|
1893
|
+
function Go(e = {}) {
|
|
1822
1894
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.searchPath ?? "/univ/resume/search", r = e.fetch ?? fetch;
|
|
1823
1895
|
return async ({ filter: o, page: i }) => {
|
|
1824
|
-
const s = await
|
|
1896
|
+
const s = await _t(e), a = Ko(o, i), l = await r(`${t}${n}?${a.toString()}`, {
|
|
1825
1897
|
method: "GET",
|
|
1826
1898
|
headers: s
|
|
1827
|
-
}),
|
|
1899
|
+
}), c = await St(l);
|
|
1828
1900
|
return {
|
|
1829
|
-
list: (
|
|
1830
|
-
total:
|
|
1831
|
-
page:
|
|
1832
|
-
pageSize:
|
|
1901
|
+
list: (c.list ?? []).map(Ho),
|
|
1902
|
+
total: c.total ?? 0,
|
|
1903
|
+
page: c.page ?? i,
|
|
1904
|
+
pageSize: c.page_size ?? o.pageSize ?? 20
|
|
1833
1905
|
};
|
|
1834
1906
|
};
|
|
1835
1907
|
}
|
|
1836
|
-
function
|
|
1908
|
+
function Jo(e) {
|
|
1837
1909
|
var r, o, i, s;
|
|
1838
1910
|
const t = !!((r = e.flowUniqueIds) != null && r.length), n = !!((o = e.agentUniqueId) != null && o.trim() && ((i = e.flowType) != null && i.trim()) && ((s = e.category) != null && s.trim()));
|
|
1839
1911
|
return t || n;
|
|
1840
1912
|
}
|
|
1841
|
-
function
|
|
1913
|
+
function Wo(e) {
|
|
1842
1914
|
return {
|
|
1843
1915
|
caseUniqueId: e.case_unique_id,
|
|
1844
1916
|
caseId: e.case_id,
|
|
@@ -1849,7 +1921,7 @@ function Uo(e) {
|
|
|
1849
1921
|
description: e.description ?? void 0
|
|
1850
1922
|
};
|
|
1851
1923
|
}
|
|
1852
|
-
function
|
|
1924
|
+
function Yo(e, t, n) {
|
|
1853
1925
|
var o, i, s;
|
|
1854
1926
|
const r = new URLSearchParams();
|
|
1855
1927
|
r.set("page", String(t)), r.set("page_size", String(e.pageSize ?? 20)), r.set("published", String(n)), (o = e.agentUniqueId) != null && o.trim() && r.set("agent_unique_id", e.agentUniqueId.trim()), (i = e.flowType) != null && i.trim() && r.set("flow_type", e.flowType.trim()), (s = e.category) != null && s.trim() && r.set("category_unique_id", e.category.trim());
|
|
@@ -1857,24 +1929,24 @@ function Po(e, t, n) {
|
|
|
1857
1929
|
a && r.append("flow_unique_ids", a);
|
|
1858
1930
|
return r;
|
|
1859
1931
|
}
|
|
1860
|
-
function
|
|
1932
|
+
function Qo(e = {}) {
|
|
1861
1933
|
const t = (e.baseUrl ?? "/api/v1").replace(/\/$/, ""), n = e.listPath ?? "/univ/case/list", r = e.fetch ?? fetch, o = e.published ?? 1;
|
|
1862
1934
|
return async ({ filter: i, page: s }) => {
|
|
1863
|
-
if (!
|
|
1935
|
+
if (!Jo(i))
|
|
1864
1936
|
return { list: [], total: 0, page: 1, pageSize: i.pageSize ?? 20 };
|
|
1865
|
-
const a = await
|
|
1937
|
+
const a = await _t(e), l = Yo(i, s, o), c = await r(`${t}${n}?${l.toString()}`, {
|
|
1866
1938
|
method: "GET",
|
|
1867
1939
|
headers: a
|
|
1868
|
-
}), m = await
|
|
1940
|
+
}), m = await St(c);
|
|
1869
1941
|
return {
|
|
1870
|
-
list: (m.list ?? []).map(
|
|
1942
|
+
list: (m.list ?? []).map(Wo),
|
|
1871
1943
|
total: m.total ?? 0,
|
|
1872
1944
|
page: m.page ?? s,
|
|
1873
1945
|
pageSize: m.page_size ?? i.pageSize ?? 20
|
|
1874
1946
|
};
|
|
1875
1947
|
};
|
|
1876
1948
|
}
|
|
1877
|
-
function
|
|
1949
|
+
function ss(e = {}) {
|
|
1878
1950
|
var r, o, i, s;
|
|
1879
1951
|
const t = {
|
|
1880
1952
|
baseUrl: e.baseUrl,
|
|
@@ -1883,22 +1955,22 @@ function zi(e = {}) {
|
|
|
1883
1955
|
authStorage: e.authStorage
|
|
1884
1956
|
};
|
|
1885
1957
|
return {
|
|
1886
|
-
fetchDetail:
|
|
1958
|
+
fetchDetail: Lo({
|
|
1887
1959
|
...t,
|
|
1888
1960
|
detailPath: (r = e.form) == null ? void 0 : r.detailPath
|
|
1889
1961
|
}).fetchDetail,
|
|
1890
|
-
resumeSearch:
|
|
1962
|
+
resumeSearch: Go({
|
|
1891
1963
|
...t,
|
|
1892
1964
|
searchPath: (o = e.resume) == null ? void 0 : o.searchPath
|
|
1893
1965
|
}),
|
|
1894
|
-
caseSearch:
|
|
1966
|
+
caseSearch: Qo({
|
|
1895
1967
|
...t,
|
|
1896
1968
|
listPath: (i = e.case) == null ? void 0 : i.listPath,
|
|
1897
1969
|
published: (s = e.case) == null ? void 0 : s.published
|
|
1898
1970
|
})
|
|
1899
1971
|
};
|
|
1900
1972
|
}
|
|
1901
|
-
function
|
|
1973
|
+
function An(e, t) {
|
|
1902
1974
|
if (!t.trim()) return !0;
|
|
1903
1975
|
try {
|
|
1904
1976
|
return new RegExp(t).test(e);
|
|
@@ -1906,44 +1978,44 @@ function ln(e, t) {
|
|
|
1906
1978
|
return !0;
|
|
1907
1979
|
}
|
|
1908
1980
|
}
|
|
1909
|
-
function
|
|
1981
|
+
function _n(e) {
|
|
1910
1982
|
return e == null ? !0 : typeof e == "string" ? !e.trim() : !1;
|
|
1911
1983
|
}
|
|
1912
|
-
function
|
|
1984
|
+
function Xo(e, t) {
|
|
1913
1985
|
switch (e.type) {
|
|
1914
1986
|
case "multiselect":
|
|
1915
1987
|
case "checkbox":
|
|
1916
1988
|
case "file":
|
|
1917
1989
|
case "resume_multiselect":
|
|
1918
1990
|
case "case_multiselect":
|
|
1919
|
-
return
|
|
1991
|
+
return Y(t).length === 0;
|
|
1920
1992
|
case "toggle":
|
|
1921
|
-
return !
|
|
1993
|
+
return !Ce(t);
|
|
1922
1994
|
case "number":
|
|
1923
1995
|
return t == null || t === "";
|
|
1924
1996
|
default:
|
|
1925
|
-
return
|
|
1997
|
+
return _n(t);
|
|
1926
1998
|
}
|
|
1927
1999
|
}
|
|
1928
|
-
function
|
|
2000
|
+
function rt(e, t) {
|
|
1929
2001
|
return e.required === !0 || t > 0;
|
|
1930
2002
|
}
|
|
1931
|
-
function
|
|
2003
|
+
function Zo(e, t) {
|
|
1932
2004
|
var n, r;
|
|
1933
2005
|
for (const o of e) {
|
|
1934
2006
|
const i = (n = o.name) == null ? void 0 : n.trim();
|
|
1935
|
-
if (!i ||
|
|
2007
|
+
if (!i || Oe(o.type) || Ue(o.type)) continue;
|
|
1936
2008
|
const s = t[i], a = ((r = o.label) == null ? void 0 : r.trim()) || i;
|
|
1937
|
-
if (o.required &&
|
|
2009
|
+
if (o.required && Xo(o, s))
|
|
1938
2010
|
return { fieldName: i, label: a, message: `请填写「${a}」` };
|
|
1939
|
-
if (o.type === "email" && !
|
|
2011
|
+
if (o.type === "email" && !_n(s)) {
|
|
1940
2012
|
const l = String(s).trim();
|
|
1941
|
-
if (!
|
|
2013
|
+
if (!An(l, gt))
|
|
1942
2014
|
return { fieldName: i, label: a, message: `「${a}」格式不正确` };
|
|
1943
2015
|
}
|
|
1944
2016
|
if (o.type === "file") {
|
|
1945
|
-
const l = o.fileMinCount ?? 0,
|
|
1946
|
-
if (l > 0 &&
|
|
2017
|
+
const l = o.fileMinCount ?? 0, c = Y(s).length;
|
|
2018
|
+
if (l > 0 && c < l && rt(o, c))
|
|
1947
2019
|
return {
|
|
1948
2020
|
fieldName: i,
|
|
1949
2021
|
label: a,
|
|
@@ -1951,8 +2023,8 @@ function zo(e, t) {
|
|
|
1951
2023
|
};
|
|
1952
2024
|
}
|
|
1953
2025
|
if (o.type === "resume_multiselect") {
|
|
1954
|
-
const l = o.resumeMinCount,
|
|
1955
|
-
if (l !== void 0 &&
|
|
2026
|
+
const l = o.resumeMinCount, c = Y(s).length;
|
|
2027
|
+
if (l !== void 0 && c < l && rt(o, c))
|
|
1956
2028
|
return {
|
|
1957
2029
|
fieldName: i,
|
|
1958
2030
|
label: a,
|
|
@@ -1960,8 +2032,8 @@ function zo(e, t) {
|
|
|
1960
2032
|
};
|
|
1961
2033
|
}
|
|
1962
2034
|
if (o.type === "case_multiselect") {
|
|
1963
|
-
const l = o.caseMinCount,
|
|
1964
|
-
if (l !== void 0 &&
|
|
2035
|
+
const l = o.caseMinCount, c = Y(s).length;
|
|
2036
|
+
if (l !== void 0 && c < l && rt(o, c))
|
|
1965
2037
|
return {
|
|
1966
2038
|
fieldName: i,
|
|
1967
2039
|
label: a,
|
|
@@ -1971,21 +2043,21 @@ function zo(e, t) {
|
|
|
1971
2043
|
}
|
|
1972
2044
|
return null;
|
|
1973
2045
|
}
|
|
1974
|
-
const
|
|
1975
|
-
video:
|
|
1976
|
-
audio:
|
|
1977
|
-
image:
|
|
1978
|
-
file:
|
|
1979
|
-
spreadsheet:
|
|
1980
|
-
document:
|
|
2046
|
+
const ei = {
|
|
2047
|
+
video: Jn,
|
|
2048
|
+
audio: Gn,
|
|
2049
|
+
image: Kn,
|
|
2050
|
+
file: Wt,
|
|
2051
|
+
spreadsheet: Hn,
|
|
2052
|
+
document: Jt
|
|
1981
2053
|
};
|
|
1982
|
-
function
|
|
2054
|
+
function ti({
|
|
1983
2055
|
type: e,
|
|
1984
2056
|
size: t = 40,
|
|
1985
2057
|
className: n
|
|
1986
2058
|
}) {
|
|
1987
|
-
const r =
|
|
1988
|
-
return /* @__PURE__ */
|
|
2059
|
+
const r = ei[e] ?? Wt;
|
|
2060
|
+
return /* @__PURE__ */ u(
|
|
1989
2061
|
r,
|
|
1990
2062
|
{
|
|
1991
2063
|
className: n ?? "skopon-form-file-placeholder-icon",
|
|
@@ -1994,7 +2066,7 @@ function qo({
|
|
|
1994
2066
|
}
|
|
1995
2067
|
);
|
|
1996
2068
|
}
|
|
1997
|
-
const
|
|
2069
|
+
const Tn = "skopon-form-v0_9", ni = /* @__PURE__ */ new Set([
|
|
1998
2070
|
"SkoponMedia",
|
|
1999
2071
|
"SkoponSelect",
|
|
2000
2072
|
"Image",
|
|
@@ -2006,24 +2078,24 @@ const un = "skopon-form-v0_9", Oo = /* @__PURE__ */ new Set([
|
|
|
2006
2078
|
"FileUpload",
|
|
2007
2079
|
"TextField",
|
|
2008
2080
|
"Text",
|
|
2009
|
-
...
|
|
2010
|
-
]),
|
|
2011
|
-
function
|
|
2012
|
-
const t = [...
|
|
2081
|
+
...ao()
|
|
2082
|
+
]), ri = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "caption"]);
|
|
2083
|
+
function Ae(e) {
|
|
2084
|
+
const t = [...Ee.components.values()].find((n) => n.name === e);
|
|
2013
2085
|
if (!t) throw new Error(`Missing basic catalog component: ${e}`);
|
|
2014
2086
|
return t.schema;
|
|
2015
2087
|
}
|
|
2016
2088
|
function E(e) {
|
|
2017
2089
|
return typeof e == "string" ? e : "";
|
|
2018
2090
|
}
|
|
2019
|
-
function
|
|
2091
|
+
function xn(e) {
|
|
2020
2092
|
return Array.isArray(e) ? e.map((t) => {
|
|
2021
2093
|
if (!t || typeof t != "object") return null;
|
|
2022
2094
|
const n = t, r = String(n.value ?? n.label ?? ""), o = String(n.label ?? n.value ?? "");
|
|
2023
2095
|
return { value: r, label: o };
|
|
2024
2096
|
}).filter((t) => !!t) : [];
|
|
2025
2097
|
}
|
|
2026
|
-
function
|
|
2098
|
+
function Le({
|
|
2027
2099
|
mediaType: e,
|
|
2028
2100
|
urls: t,
|
|
2029
2101
|
mediaSize: n,
|
|
@@ -2031,10 +2103,10 @@ function Re({
|
|
|
2031
2103
|
help: o,
|
|
2032
2104
|
placeholder: i
|
|
2033
2105
|
}) {
|
|
2034
|
-
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l =
|
|
2106
|
+
const s = r == null ? void 0 : r.trim(), a = o == null ? void 0 : o.trim(), l = yr(n), c = (i == null ? void 0 : i.trim()) || (e === "image" ? "未设置图片 URL" : e === "video" ? "未设置视频 URL" : "未设置音频 URL");
|
|
2035
2107
|
return /* @__PURE__ */ I("div", { className: "form-block-preview", children: [
|
|
2036
|
-
s ? /* @__PURE__ */
|
|
2037
|
-
t.length === 0 ? /* @__PURE__ */
|
|
2108
|
+
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2109
|
+
t.length === 0 ? /* @__PURE__ */ u("div", { className: "form-media-preview form-media-preview--empty", children: c }) : /* @__PURE__ */ u("div", { className: l, children: t.map((m, d) => e === "image" ? /* @__PURE__ */ u(
|
|
2038
2110
|
"img",
|
|
2039
2111
|
{
|
|
2040
2112
|
src: m,
|
|
@@ -2042,7 +2114,7 @@ function Re({
|
|
|
2042
2114
|
className: "form-media-item"
|
|
2043
2115
|
},
|
|
2044
2116
|
`media-${d}`
|
|
2045
|
-
) : e === "video" ? /* @__PURE__ */
|
|
2117
|
+
) : e === "video" ? /* @__PURE__ */ u(
|
|
2046
2118
|
"video",
|
|
2047
2119
|
{
|
|
2048
2120
|
src: m,
|
|
@@ -2050,7 +2122,7 @@ function Re({
|
|
|
2050
2122
|
className: "form-media-item"
|
|
2051
2123
|
},
|
|
2052
2124
|
`media-${d}`
|
|
2053
|
-
) : /* @__PURE__ */
|
|
2125
|
+
) : /* @__PURE__ */ u(
|
|
2054
2126
|
"audio",
|
|
2055
2127
|
{
|
|
2056
2128
|
src: m,
|
|
@@ -2059,64 +2131,64 @@ function Re({
|
|
|
2059
2131
|
},
|
|
2060
2132
|
`media-${d}`
|
|
2061
2133
|
)) }),
|
|
2062
|
-
a ? /* @__PURE__ */
|
|
2134
|
+
a ? /* @__PURE__ */ u(te.Text, { type: "secondary", className: "form-block-preview-help", children: a }) : null
|
|
2063
2135
|
] });
|
|
2064
2136
|
}
|
|
2065
|
-
function
|
|
2137
|
+
function Ve(e, t) {
|
|
2066
2138
|
const n = Array.isArray(e.urls) ? e.urls.map((r) => String(r).trim()).filter(Boolean) : E(e.url).trim() ? [E(e.url).trim()] : [];
|
|
2067
2139
|
return {
|
|
2068
2140
|
mediaType: t,
|
|
2069
2141
|
urls: n,
|
|
2070
|
-
mediaSize:
|
|
2142
|
+
mediaSize: ke(e.mediaSize),
|
|
2071
2143
|
label: E(e.label) || E(e.description),
|
|
2072
2144
|
help: E(e.help),
|
|
2073
2145
|
placeholder: E(e.placeholder)
|
|
2074
2146
|
};
|
|
2075
2147
|
}
|
|
2076
|
-
const
|
|
2148
|
+
const oi = {
|
|
2077
2149
|
name: "SkoponMedia",
|
|
2078
|
-
schema:
|
|
2079
|
-
mediaType:
|
|
2080
|
-
urls:
|
|
2081
|
-
mediaSize:
|
|
2082
|
-
label:
|
|
2083
|
-
help:
|
|
2084
|
-
placeholder:
|
|
2150
|
+
schema: h.object({
|
|
2151
|
+
mediaType: h.any().optional(),
|
|
2152
|
+
urls: h.any().optional(),
|
|
2153
|
+
mediaSize: h.any().optional(),
|
|
2154
|
+
label: h.any().optional(),
|
|
2155
|
+
help: h.any().optional(),
|
|
2156
|
+
placeholder: h.any().optional()
|
|
2085
2157
|
}).passthrough()
|
|
2086
|
-
},
|
|
2158
|
+
}, ii = Q(oi, ({ context: e }) => {
|
|
2087
2159
|
const t = e.componentModel.properties, n = E(t.mediaType);
|
|
2088
|
-
return /* @__PURE__ */
|
|
2089
|
-
}),
|
|
2090
|
-
{ name: "Image", schema:
|
|
2091
|
-
({ context: e }) => /* @__PURE__ */
|
|
2092
|
-
),
|
|
2093
|
-
{ name: "Video", schema:
|
|
2094
|
-
({ context: e }) => /* @__PURE__ */
|
|
2095
|
-
),
|
|
2096
|
-
{ name: "AudioPlayer", schema:
|
|
2097
|
-
({ context: e }) => /* @__PURE__ */
|
|
2098
|
-
),
|
|
2160
|
+
return /* @__PURE__ */ u(Le, { ...Ve(t, n === "video" ? "video" : n === "audio" ? "audio" : "image") });
|
|
2161
|
+
}), si = Q(
|
|
2162
|
+
{ name: "Image", schema: Ae("Image") },
|
|
2163
|
+
({ context: e }) => /* @__PURE__ */ u(Le, { ...Ve(e.componentModel.properties, "image") })
|
|
2164
|
+
), ai = Q(
|
|
2165
|
+
{ name: "Video", schema: Ae("Video") },
|
|
2166
|
+
({ context: e }) => /* @__PURE__ */ u(Le, { ...Ve(e.componentModel.properties, "video") })
|
|
2167
|
+
), li = Q(
|
|
2168
|
+
{ name: "AudioPlayer", schema: Ae("AudioPlayer") },
|
|
2169
|
+
({ context: e }) => /* @__PURE__ */ u(Le, { ...Ve(e.componentModel.properties, "audio") })
|
|
2170
|
+
), ci = {
|
|
2099
2171
|
name: "SkoponSelect",
|
|
2100
|
-
schema:
|
|
2101
|
-
label:
|
|
2102
|
-
mode:
|
|
2103
|
-
placeholder:
|
|
2104
|
-
options:
|
|
2105
|
-
value:
|
|
2172
|
+
schema: h.object({
|
|
2173
|
+
label: h.any().optional(),
|
|
2174
|
+
mode: h.any().optional(),
|
|
2175
|
+
placeholder: h.any().optional(),
|
|
2176
|
+
options: h.any().optional(),
|
|
2177
|
+
value: h.any().optional()
|
|
2106
2178
|
}).passthrough()
|
|
2107
2179
|
};
|
|
2108
|
-
function
|
|
2109
|
-
const { interactive: t } =
|
|
2180
|
+
function ui({ context: e }) {
|
|
2181
|
+
const { interactive: t } = ie(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = se(e, "value", {
|
|
2110
2182
|
component: "SkoponSelect",
|
|
2111
2183
|
changeAction: "select"
|
|
2112
|
-
}), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder),
|
|
2113
|
-
return
|
|
2114
|
-
const d =
|
|
2184
|
+
}), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder), c = xn(s.options), m = E(s.mode) === "multiple";
|
|
2185
|
+
return z(() => {
|
|
2186
|
+
const d = an(n, m);
|
|
2115
2187
|
d !== null && o(d);
|
|
2116
2188
|
}, [m, n, o]), /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2117
|
-
a ? /* @__PURE__ */
|
|
2118
|
-
/* @__PURE__ */
|
|
2119
|
-
|
|
2189
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2190
|
+
/* @__PURE__ */ u(
|
|
2191
|
+
ot,
|
|
2120
2192
|
{
|
|
2121
2193
|
mode: m ? "multiple" : void 0,
|
|
2122
2194
|
disabled: !t,
|
|
@@ -2124,29 +2196,29 @@ function Go({ context: e }) {
|
|
|
2124
2196
|
className: "form-block-preview-control",
|
|
2125
2197
|
style: { width: "100%" },
|
|
2126
2198
|
placeholder: l || (m ? "请选择多项" : "请选择"),
|
|
2127
|
-
options:
|
|
2128
|
-
value: m ?
|
|
2199
|
+
options: c,
|
|
2200
|
+
value: m ? Y(n) : he(n),
|
|
2129
2201
|
onChange: (d) => r(m ? d ?? [] : d ?? "")
|
|
2130
2202
|
}
|
|
2131
2203
|
)
|
|
2132
2204
|
] });
|
|
2133
2205
|
}
|
|
2134
|
-
const
|
|
2135
|
-
|
|
2136
|
-
|
|
2206
|
+
const mi = Q(
|
|
2207
|
+
ci,
|
|
2208
|
+
ui
|
|
2137
2209
|
);
|
|
2138
|
-
function
|
|
2139
|
-
const { interactive: t } =
|
|
2210
|
+
function di({ context: e }) {
|
|
2211
|
+
const { interactive: t } = ie(), { value: n, setValue: r, setValueSilent: o, fieldName: i } = se(e, "value", {
|
|
2140
2212
|
component: "ChoicePicker",
|
|
2141
2213
|
changeAction: "select"
|
|
2142
|
-
}), s = e.componentModel.properties, a = E(s.label), l = E(s.variant) || "mutuallyExclusive",
|
|
2143
|
-
return
|
|
2144
|
-
const y =
|
|
2214
|
+
}), s = e.componentModel.properties, a = E(s.label), l = E(s.variant) || "mutuallyExclusive", c = E(s.skoponPickerType), m = E(s.placeholder), d = xn(s.options), g = c === "select" || c === "multiselect" || c === "radio" || c === "checkbox" ? c : l === "multipleSelection" ? "checkbox" : "radio", b = g === "multiselect" || g === "checkbox";
|
|
2215
|
+
return z(() => {
|
|
2216
|
+
const y = an(n, b);
|
|
2145
2217
|
y !== null && o(y);
|
|
2146
|
-
}, [
|
|
2147
|
-
a ? /* @__PURE__ */
|
|
2148
|
-
g === "select" ? /* @__PURE__ */
|
|
2149
|
-
|
|
2218
|
+
}, [b, n, o]), /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": i || void 0, children: [
|
|
2219
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2220
|
+
g === "select" ? /* @__PURE__ */ u(
|
|
2221
|
+
ot,
|
|
2150
2222
|
{
|
|
2151
2223
|
disabled: !t,
|
|
2152
2224
|
allowClear: !0,
|
|
@@ -2154,11 +2226,11 @@ function Wo({ context: e }) {
|
|
|
2154
2226
|
style: { width: "100%" },
|
|
2155
2227
|
placeholder: m || "请选择",
|
|
2156
2228
|
options: d,
|
|
2157
|
-
value:
|
|
2229
|
+
value: he(n),
|
|
2158
2230
|
onChange: (y) => r(y ?? "")
|
|
2159
2231
|
}
|
|
2160
|
-
) : g === "multiselect" ? /* @__PURE__ */
|
|
2161
|
-
|
|
2232
|
+
) : g === "multiselect" ? /* @__PURE__ */ u(
|
|
2233
|
+
ot,
|
|
2162
2234
|
{
|
|
2163
2235
|
mode: "multiple",
|
|
2164
2236
|
disabled: !t,
|
|
@@ -2167,99 +2239,99 @@ function Wo({ context: e }) {
|
|
|
2167
2239
|
style: { width: "100%" },
|
|
2168
2240
|
placeholder: m || "请选择多项",
|
|
2169
2241
|
options: d,
|
|
2170
|
-
value:
|
|
2242
|
+
value: Y(n),
|
|
2171
2243
|
onChange: (y) => r(y ?? [])
|
|
2172
2244
|
}
|
|
2173
|
-
) : g === "checkbox" ? /* @__PURE__ */
|
|
2174
|
-
|
|
2245
|
+
) : g === "checkbox" ? /* @__PURE__ */ u(
|
|
2246
|
+
zn.Group,
|
|
2175
2247
|
{
|
|
2176
2248
|
disabled: !t,
|
|
2177
2249
|
className: "form-block-preview-control",
|
|
2178
2250
|
options: d,
|
|
2179
|
-
value:
|
|
2251
|
+
value: Y(n),
|
|
2180
2252
|
onChange: (y) => r(y)
|
|
2181
2253
|
}
|
|
2182
|
-
) : /* @__PURE__ */
|
|
2183
|
-
|
|
2254
|
+
) : /* @__PURE__ */ u(
|
|
2255
|
+
On.Group,
|
|
2184
2256
|
{
|
|
2185
2257
|
disabled: !t,
|
|
2186
2258
|
className: "form-block-preview-control",
|
|
2187
2259
|
options: d,
|
|
2188
|
-
value:
|
|
2260
|
+
value: he(n),
|
|
2189
2261
|
onChange: (y) => r(y.target.value)
|
|
2190
2262
|
}
|
|
2191
2263
|
)
|
|
2192
2264
|
] });
|
|
2193
2265
|
}
|
|
2194
|
-
const
|
|
2266
|
+
const pi = Q(
|
|
2195
2267
|
{
|
|
2196
2268
|
name: "ChoicePicker",
|
|
2197
|
-
schema:
|
|
2198
|
-
label:
|
|
2199
|
-
variant:
|
|
2200
|
-
options:
|
|
2201
|
-
value:
|
|
2202
|
-
skoponPickerType:
|
|
2203
|
-
placeholder:
|
|
2269
|
+
schema: h.object({
|
|
2270
|
+
label: h.any().optional(),
|
|
2271
|
+
variant: h.any().optional(),
|
|
2272
|
+
options: h.any().optional(),
|
|
2273
|
+
value: h.any().optional(),
|
|
2274
|
+
skoponPickerType: h.any().optional(),
|
|
2275
|
+
placeholder: h.any().optional()
|
|
2204
2276
|
}).passthrough()
|
|
2205
2277
|
},
|
|
2206
|
-
|
|
2278
|
+
di
|
|
2207
2279
|
);
|
|
2208
|
-
function
|
|
2209
|
-
const { interactive: t } =
|
|
2280
|
+
function fi({ context: e }) {
|
|
2281
|
+
const { interactive: t } = ie(), { value: n, setValue: r, fieldName: o } = se(e, "value", {
|
|
2210
2282
|
component: "CheckBox",
|
|
2211
2283
|
changeAction: "change"
|
|
2212
2284
|
}), i = e.componentModel.properties, s = E(i.label);
|
|
2213
2285
|
return /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2214
|
-
s ? /* @__PURE__ */
|
|
2215
|
-
/* @__PURE__ */
|
|
2216
|
-
|
|
2286
|
+
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2287
|
+
/* @__PURE__ */ u(
|
|
2288
|
+
qn,
|
|
2217
2289
|
{
|
|
2218
2290
|
disabled: !t,
|
|
2219
2291
|
className: "form-block-preview-control",
|
|
2220
|
-
checked:
|
|
2292
|
+
checked: Ce(n),
|
|
2221
2293
|
onChange: (a) => r(a)
|
|
2222
2294
|
}
|
|
2223
2295
|
)
|
|
2224
2296
|
] });
|
|
2225
2297
|
}
|
|
2226
|
-
const
|
|
2227
|
-
{ name: "CheckBox", schema:
|
|
2228
|
-
|
|
2298
|
+
const hi = Q(
|
|
2299
|
+
{ name: "CheckBox", schema: Ae("CheckBox") },
|
|
2300
|
+
fi
|
|
2229
2301
|
);
|
|
2230
|
-
function
|
|
2231
|
-
const r =
|
|
2302
|
+
function gi(e, t, n) {
|
|
2303
|
+
const r = he(e);
|
|
2232
2304
|
if (!r) return;
|
|
2233
2305
|
if (!t && n) {
|
|
2234
|
-
const i =
|
|
2306
|
+
const i = Lt(r, "HH:mm", !0);
|
|
2235
2307
|
return i.isValid() ? i : void 0;
|
|
2236
2308
|
}
|
|
2237
|
-
const o =
|
|
2309
|
+
const o = Lt(r);
|
|
2238
2310
|
return o.isValid() ? o : void 0;
|
|
2239
2311
|
}
|
|
2240
|
-
function
|
|
2241
|
-
const { interactive: t } =
|
|
2312
|
+
function yi({ context: e }) {
|
|
2313
|
+
const { interactive: t } = ie(), { value: n, setValue: r, fieldName: o, reportFocus: i } = se(e, "value", {
|
|
2242
2314
|
component: "DateTimeInput",
|
|
2243
2315
|
changeAction: "change"
|
|
2244
|
-
}), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder),
|
|
2316
|
+
}), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder), c = s.enableDate === !0, m = s.enableTime === !0, d = gi(n, c, m), S = (g) => {
|
|
2245
2317
|
if (!g) {
|
|
2246
2318
|
r("");
|
|
2247
2319
|
return;
|
|
2248
2320
|
}
|
|
2249
|
-
if (!
|
|
2321
|
+
if (!c && m) {
|
|
2250
2322
|
r(g.format("HH:mm"));
|
|
2251
2323
|
return;
|
|
2252
2324
|
}
|
|
2253
|
-
if (
|
|
2325
|
+
if (c && m) {
|
|
2254
2326
|
r(g.format("YYYY-MM-DDTHH:mm"));
|
|
2255
2327
|
return;
|
|
2256
2328
|
}
|
|
2257
2329
|
r(g.format("YYYY-MM-DD"));
|
|
2258
2330
|
};
|
|
2259
2331
|
return /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2260
|
-
a ? /* @__PURE__ */
|
|
2261
|
-
!
|
|
2262
|
-
|
|
2332
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2333
|
+
!c && m ? /* @__PURE__ */ u(
|
|
2334
|
+
Bn,
|
|
2263
2335
|
{
|
|
2264
2336
|
disabled: !t,
|
|
2265
2337
|
className: "form-block-preview-control",
|
|
@@ -2269,14 +2341,14 @@ function ei({ context: e }) {
|
|
|
2269
2341
|
onChange: S,
|
|
2270
2342
|
onFocus: i
|
|
2271
2343
|
}
|
|
2272
|
-
) : /* @__PURE__ */
|
|
2273
|
-
|
|
2344
|
+
) : /* @__PURE__ */ u(
|
|
2345
|
+
Ln,
|
|
2274
2346
|
{
|
|
2275
|
-
showTime:
|
|
2347
|
+
showTime: c && m,
|
|
2276
2348
|
disabled: !t,
|
|
2277
2349
|
className: "form-block-preview-control",
|
|
2278
2350
|
style: { width: "100%" },
|
|
2279
|
-
placeholder: l || (
|
|
2351
|
+
placeholder: l || (c && m ? "选择日期时间" : "选择日期"),
|
|
2280
2352
|
value: d,
|
|
2281
2353
|
onChange: S,
|
|
2282
2354
|
onFocus: i
|
|
@@ -2284,46 +2356,46 @@ function ei({ context: e }) {
|
|
|
2284
2356
|
)
|
|
2285
2357
|
] });
|
|
2286
2358
|
}
|
|
2287
|
-
const
|
|
2359
|
+
const vi = Q(
|
|
2288
2360
|
{
|
|
2289
2361
|
name: "DateTimeInput",
|
|
2290
|
-
schema:
|
|
2291
|
-
label:
|
|
2292
|
-
enableDate:
|
|
2293
|
-
enableTime:
|
|
2294
|
-
placeholder:
|
|
2295
|
-
value:
|
|
2296
|
-
min:
|
|
2297
|
-
max:
|
|
2362
|
+
schema: h.object({
|
|
2363
|
+
label: h.any().optional(),
|
|
2364
|
+
enableDate: h.any().optional(),
|
|
2365
|
+
enableTime: h.any().optional(),
|
|
2366
|
+
placeholder: h.any().optional(),
|
|
2367
|
+
value: h.any().optional(),
|
|
2368
|
+
min: h.any().optional(),
|
|
2369
|
+
max: h.any().optional()
|
|
2298
2370
|
}).passthrough()
|
|
2299
2371
|
},
|
|
2300
|
-
|
|
2301
|
-
),
|
|
2372
|
+
yi
|
|
2373
|
+
), Si = {
|
|
2302
2374
|
name: "FileUpload",
|
|
2303
|
-
schema:
|
|
2304
|
-
label:
|
|
2305
|
-
accept:
|
|
2306
|
-
fileAcceptTypes:
|
|
2307
|
-
filePlaceholderIcon:
|
|
2308
|
-
minCount:
|
|
2309
|
-
maxCount:
|
|
2310
|
-
value:
|
|
2375
|
+
schema: h.object({
|
|
2376
|
+
label: h.any().optional(),
|
|
2377
|
+
accept: h.any().optional(),
|
|
2378
|
+
fileAcceptTypes: h.any().optional(),
|
|
2379
|
+
filePlaceholderIcon: h.any().optional(),
|
|
2380
|
+
minCount: h.any().optional(),
|
|
2381
|
+
maxCount: h.any().optional(),
|
|
2382
|
+
value: h.any().optional()
|
|
2311
2383
|
}).passthrough()
|
|
2312
2384
|
};
|
|
2313
|
-
function
|
|
2314
|
-
const { interactive: t } =
|
|
2385
|
+
function bi({ context: e }) {
|
|
2386
|
+
const { interactive: t } = ie(), { value: n, setValue: r, fieldName: o } = se(e, "value", {
|
|
2315
2387
|
component: "FileUpload",
|
|
2316
2388
|
changeAction: "change"
|
|
2317
|
-
}), i = e.componentModel.properties, s = E(i.label), a = E(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0,
|
|
2389
|
+
}), i = e.componentModel.properties, s = E(i.label), a = E(i.accept), l = Array.isArray(i.fileAcceptTypes) ? i.fileAcceptTypes.map(String) : void 0, c = a ? a.split(",").map((p) => p.trim()).filter(Boolean) : void 0, m = ur(l, c), d = typeof i.filePlaceholderIcon == "string" && ["video", "audio", "image", "file", "spreadsheet", "document"].includes(
|
|
2318
2390
|
i.filePlaceholderIcon
|
|
2319
|
-
) ? i.filePlaceholderIcon : "document", S = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, g = typeof i.maxCount == "number" ? i.maxCount : 1,
|
|
2391
|
+
) ? i.filePlaceholderIcon : "document", S = typeof i.minCount == "number" ? Math.max(0, i.minCount) : 0, g = typeof i.maxCount == "number" ? i.maxCount : 1, b = g > 0, y = Y(n), k = b && y.length >= g, f = y.length < S;
|
|
2320
2392
|
return /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2321
|
-
s ? /* @__PURE__ */
|
|
2393
|
+
s ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: s }) : null,
|
|
2322
2394
|
/* @__PURE__ */ I(
|
|
2323
|
-
|
|
2395
|
+
Je.Dragger,
|
|
2324
2396
|
{
|
|
2325
|
-
disabled: !t ||
|
|
2326
|
-
accept:
|
|
2397
|
+
disabled: !t || k,
|
|
2398
|
+
accept: cr(l, c),
|
|
2327
2399
|
className: "form-file-upload-preview",
|
|
2328
2400
|
showUploadList: t && y.length > 0,
|
|
2329
2401
|
fileList: t ? y.map((p, v) => ({
|
|
@@ -2332,60 +2404,60 @@ function ri({ context: e }) {
|
|
|
2332
2404
|
status: "done"
|
|
2333
2405
|
})) : [],
|
|
2334
2406
|
beforeUpload: (p) => {
|
|
2335
|
-
if (!t) return
|
|
2336
|
-
const v =
|
|
2337
|
-
if (
|
|
2338
|
-
const x =
|
|
2407
|
+
if (!t) return Je.LIST_IGNORE;
|
|
2408
|
+
const v = Y($t(e));
|
|
2409
|
+
if (b && v.length >= g) return Je.LIST_IGNORE;
|
|
2410
|
+
const x = b ? [...v, p.name].slice(0, g) : [...v, p.name];
|
|
2339
2411
|
return r(x), !1;
|
|
2340
2412
|
},
|
|
2341
2413
|
onRemove: (p) => {
|
|
2342
|
-
const v =
|
|
2343
|
-
if (
|
|
2344
|
-
r(
|
|
2414
|
+
const v = Y($t(e)), x = /^(\d+)-/.exec(p.uid ?? ""), M = x ? Number(x[1]) : -1, _ = M >= 0 && M < v.length ? v.filter((w, C) => C !== M) : v.filter((w) => w !== p.name);
|
|
2415
|
+
if (_.length < S) return !1;
|
|
2416
|
+
r(_);
|
|
2345
2417
|
},
|
|
2346
2418
|
children: [
|
|
2347
|
-
/* @__PURE__ */
|
|
2348
|
-
/* @__PURE__ */
|
|
2419
|
+
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-icon", children: /* @__PURE__ */ u(ti, { type: d, size: 40 }) }),
|
|
2420
|
+
/* @__PURE__ */ u("p", { className: "form-file-upload-preview-text", children: "点击或拖拽文件到此处上传" })
|
|
2349
2421
|
]
|
|
2350
2422
|
}
|
|
2351
2423
|
),
|
|
2352
|
-
/* @__PURE__ */ I(
|
|
2424
|
+
/* @__PURE__ */ I(te.Text, { type: "secondary", className: "form-block-preview-help", children: [
|
|
2353
2425
|
"允许:",
|
|
2354
2426
|
m ?? "全部类型",
|
|
2355
2427
|
S > 0 ? `;至少 ${S} 个文件` : "",
|
|
2356
|
-
|
|
2428
|
+
b ? `;最多 ${g} 个文件` : "",
|
|
2357
2429
|
";当前仅收集文件名(不含文件内容,需宿主另行上传)",
|
|
2358
|
-
|
|
2430
|
+
f && t ? `(当前 ${y.length} 个,未达下限)` : ""
|
|
2359
2431
|
] })
|
|
2360
2432
|
] });
|
|
2361
2433
|
}
|
|
2362
|
-
const
|
|
2363
|
-
|
|
2364
|
-
|
|
2434
|
+
const ki = Q(
|
|
2435
|
+
Si,
|
|
2436
|
+
bi
|
|
2365
2437
|
);
|
|
2366
|
-
function
|
|
2367
|
-
const { interactive: t } =
|
|
2438
|
+
function Ci({ context: e }) {
|
|
2439
|
+
const { interactive: t } = ie(), { value: n, setValue: r, fieldName: o, reportFocus: i } = se(e, "value", {
|
|
2368
2440
|
component: "TextField",
|
|
2369
2441
|
changeAction: "change",
|
|
2370
2442
|
debounceChange: !0
|
|
2371
|
-
}), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder),
|
|
2443
|
+
}), s = e.componentModel.properties, a = E(s.label), l = E(s.placeholder), c = E(s.variant) || "shortText", m = E(s.validationRegexp), d = he(n) ?? "", S = !t, [g, b] = R(""), y = (p) => {
|
|
2372
2444
|
if (!m || !p.trim()) {
|
|
2373
|
-
|
|
2445
|
+
b("");
|
|
2374
2446
|
return;
|
|
2375
2447
|
}
|
|
2376
|
-
|
|
2448
|
+
b(An(p, m) ? "" : "格式不正确");
|
|
2377
2449
|
};
|
|
2378
|
-
|
|
2450
|
+
z(() => {
|
|
2379
2451
|
y(d);
|
|
2380
2452
|
}, [m, d]);
|
|
2381
|
-
const
|
|
2382
|
-
let
|
|
2383
|
-
if (
|
|
2384
|
-
|
|
2385
|
-
|
|
2453
|
+
const k = "form-block-preview-control";
|
|
2454
|
+
let f;
|
|
2455
|
+
if (c === "longText")
|
|
2456
|
+
f = /* @__PURE__ */ u(
|
|
2457
|
+
We.TextArea,
|
|
2386
2458
|
{
|
|
2387
2459
|
disabled: S,
|
|
2388
|
-
className:
|
|
2460
|
+
className: k,
|
|
2389
2461
|
placeholder: l || "长文本回答...",
|
|
2390
2462
|
autoSize: { minRows: 2, maxRows: 6 },
|
|
2391
2463
|
value: d,
|
|
@@ -2398,13 +2470,13 @@ function ii({ context: e }) {
|
|
|
2398
2470
|
onBlur: (p) => y(p.target.value)
|
|
2399
2471
|
}
|
|
2400
2472
|
);
|
|
2401
|
-
else if (
|
|
2473
|
+
else if (c === "number") {
|
|
2402
2474
|
const p = d && Number.isFinite(Number(d)) ? Number(d) : void 0;
|
|
2403
|
-
|
|
2404
|
-
|
|
2475
|
+
f = /* @__PURE__ */ u(
|
|
2476
|
+
Vn,
|
|
2405
2477
|
{
|
|
2406
2478
|
disabled: S,
|
|
2407
|
-
className:
|
|
2479
|
+
className: k,
|
|
2408
2480
|
style: { width: "100%" },
|
|
2409
2481
|
placeholder: l || "数字",
|
|
2410
2482
|
value: p,
|
|
@@ -2412,21 +2484,21 @@ function ii({ context: e }) {
|
|
|
2412
2484
|
onFocus: i
|
|
2413
2485
|
}
|
|
2414
2486
|
);
|
|
2415
|
-
} else
|
|
2416
|
-
|
|
2487
|
+
} else c === "obscured" ? f = /* @__PURE__ */ u(
|
|
2488
|
+
We.Password,
|
|
2417
2489
|
{
|
|
2418
2490
|
disabled: S,
|
|
2419
|
-
className:
|
|
2491
|
+
className: k,
|
|
2420
2492
|
placeholder: l,
|
|
2421
2493
|
value: d,
|
|
2422
2494
|
onChange: (p) => r(p.target.value),
|
|
2423
2495
|
onFocus: i
|
|
2424
2496
|
}
|
|
2425
|
-
) :
|
|
2426
|
-
|
|
2497
|
+
) : f = /* @__PURE__ */ u(
|
|
2498
|
+
We,
|
|
2427
2499
|
{
|
|
2428
2500
|
disabled: S,
|
|
2429
|
-
className:
|
|
2501
|
+
className: k,
|
|
2430
2502
|
placeholder: l,
|
|
2431
2503
|
value: d,
|
|
2432
2504
|
status: g ? "error" : void 0,
|
|
@@ -2439,53 +2511,53 @@ function ii({ context: e }) {
|
|
|
2439
2511
|
}
|
|
2440
2512
|
);
|
|
2441
2513
|
return /* @__PURE__ */ I("div", { className: "form-block-preview", "data-skopon-field": o || void 0, children: [
|
|
2442
|
-
a ? /* @__PURE__ */
|
|
2443
|
-
|
|
2444
|
-
g ? /* @__PURE__ */
|
|
2514
|
+
a ? /* @__PURE__ */ u("div", { className: "form-block-preview-label", children: a }) : null,
|
|
2515
|
+
f,
|
|
2516
|
+
g ? /* @__PURE__ */ u(te.Text, { type: "danger", className: "form-block-preview-help", children: g }) : null
|
|
2445
2517
|
] });
|
|
2446
2518
|
}
|
|
2447
|
-
const
|
|
2519
|
+
const Ai = Q(
|
|
2448
2520
|
{
|
|
2449
2521
|
name: "TextField",
|
|
2450
|
-
schema:
|
|
2451
|
-
label:
|
|
2452
|
-
variant:
|
|
2453
|
-
placeholder:
|
|
2454
|
-
validationRegexp:
|
|
2455
|
-
value:
|
|
2522
|
+
schema: h.object({
|
|
2523
|
+
label: h.any().optional(),
|
|
2524
|
+
variant: h.any().optional(),
|
|
2525
|
+
placeholder: h.any().optional(),
|
|
2526
|
+
validationRegexp: h.any().optional(),
|
|
2527
|
+
value: h.any().optional()
|
|
2456
2528
|
}).passthrough()
|
|
2457
2529
|
},
|
|
2458
|
-
|
|
2530
|
+
Ci
|
|
2459
2531
|
);
|
|
2460
|
-
function
|
|
2532
|
+
function _i({ context: e }) {
|
|
2461
2533
|
const t = e.componentModel.properties, n = E(t.text), r = E(t.variant) || "body";
|
|
2462
|
-
return
|
|
2534
|
+
return ri.has(r) ? r === "caption" ? /* @__PURE__ */ u(te.Text, { type: "secondary", className: "form-block-preview-paragraph", children: /* @__PURE__ */ u("em", { children: n }) }) : /* @__PURE__ */ u(r, { className: "form-block-preview-heading", children: n }) : /* @__PURE__ */ u(te.Paragraph, { className: "form-block-preview-paragraph", children: n });
|
|
2463
2535
|
}
|
|
2464
|
-
const
|
|
2465
|
-
{ name: "Text", schema:
|
|
2466
|
-
|
|
2536
|
+
const Ti = Q(
|
|
2537
|
+
{ name: "Text", schema: Ae("Text") },
|
|
2538
|
+
_i
|
|
2467
2539
|
);
|
|
2468
|
-
function
|
|
2540
|
+
function In() {
|
|
2469
2541
|
const t = [
|
|
2470
|
-
...[...
|
|
2471
|
-
(r) => !
|
|
2542
|
+
...[...Ee.components.values()].filter(
|
|
2543
|
+
(r) => !ni.has(r.name)
|
|
2472
2544
|
),
|
|
2473
|
-
|
|
2474
|
-
|
|
2475
|
-
$o,
|
|
2476
|
-
Do,
|
|
2477
|
-
Ho,
|
|
2478
|
-
Yo,
|
|
2479
|
-
Xo,
|
|
2480
|
-
ti,
|
|
2481
|
-
oi,
|
|
2545
|
+
ii,
|
|
2546
|
+
mi,
|
|
2482
2547
|
si,
|
|
2548
|
+
ai,
|
|
2483
2549
|
li,
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2550
|
+
pi,
|
|
2551
|
+
hi,
|
|
2552
|
+
vi,
|
|
2553
|
+
ki,
|
|
2554
|
+
Ai,
|
|
2555
|
+
Ti,
|
|
2556
|
+
...so()
|
|
2557
|
+
], n = [...Ee.functions.values()];
|
|
2558
|
+
return new Wn(Tn, t, n, Ee.themeSchema);
|
|
2559
|
+
}
|
|
2560
|
+
const oe = {
|
|
2489
2561
|
jade9: "#29a383",
|
|
2490
2562
|
jade10: "#26997b",
|
|
2491
2563
|
jade11: "#208368",
|
|
@@ -2497,20 +2569,20 @@ const Z = {
|
|
|
2497
2569
|
primaryHover: "#26997b",
|
|
2498
2570
|
primaryActive: "#1d3b31",
|
|
2499
2571
|
onPrimary: "#ffffff"
|
|
2500
|
-
},
|
|
2572
|
+
}, xi = {
|
|
2501
2573
|
cssVar: { key: "vidtempl" },
|
|
2502
2574
|
token: {
|
|
2503
|
-
colorPrimary:
|
|
2504
|
-
colorPrimaryHover:
|
|
2505
|
-
colorPrimaryActive:
|
|
2506
|
-
colorLink:
|
|
2507
|
-
colorLinkHover:
|
|
2508
|
-
colorSuccess:
|
|
2575
|
+
colorPrimary: oe.primarySolid,
|
|
2576
|
+
colorPrimaryHover: oe.primaryHover,
|
|
2577
|
+
colorPrimaryActive: oe.primaryActive,
|
|
2578
|
+
colorLink: oe.primary,
|
|
2579
|
+
colorLinkHover: oe.primaryHover,
|
|
2580
|
+
colorSuccess: oe.jade9,
|
|
2509
2581
|
colorWarning: "#f5a623",
|
|
2510
2582
|
gold6: "#f5a623",
|
|
2511
2583
|
gold7: "#e6951a",
|
|
2512
2584
|
colorError: "#e5484d",
|
|
2513
|
-
colorInfo:
|
|
2585
|
+
colorInfo: oe.primary,
|
|
2514
2586
|
colorBgLayout: "#f9f9f9",
|
|
2515
2587
|
colorBgContainer: "#ffffff",
|
|
2516
2588
|
colorBgElevated: "#ffffff",
|
|
@@ -2570,7 +2642,7 @@ const Z = {
|
|
|
2570
2642
|
},
|
|
2571
2643
|
Tag: {
|
|
2572
2644
|
defaultBg: "#e6f7ed",
|
|
2573
|
-
defaultColor:
|
|
2645
|
+
defaultColor: oe.primary,
|
|
2574
2646
|
fontSizeSM: 13
|
|
2575
2647
|
},
|
|
2576
2648
|
Form: {
|
|
@@ -2582,14 +2654,14 @@ const Z = {
|
|
|
2582
2654
|
}
|
|
2583
2655
|
}
|
|
2584
2656
|
};
|
|
2585
|
-
function
|
|
2657
|
+
function ge({
|
|
2586
2658
|
children: e,
|
|
2587
2659
|
locale: t,
|
|
2588
2660
|
theme: n
|
|
2589
2661
|
}) {
|
|
2590
|
-
return /* @__PURE__ */
|
|
2662
|
+
return /* @__PURE__ */ u(jn, { theme: n ?? xi, locale: t, children: e });
|
|
2591
2663
|
}
|
|
2592
|
-
const
|
|
2664
|
+
const Ii = Rn(
|
|
2593
2665
|
function({
|
|
2594
2666
|
doc: t,
|
|
2595
2667
|
surfaceId: n = "skopon-form",
|
|
@@ -2599,68 +2671,68 @@ const ui = Sn(
|
|
|
2599
2671
|
resumeSearch: s = null,
|
|
2600
2672
|
caseSearch: a = null,
|
|
2601
2673
|
wrapProvider: l = !0
|
|
2602
|
-
},
|
|
2603
|
-
|
|
2604
|
-
|
|
2674
|
+
}, c) {
|
|
2675
|
+
z(() => {
|
|
2676
|
+
Zt(), Xt();
|
|
2605
2677
|
}, []);
|
|
2606
|
-
const m =
|
|
2678
|
+
const m = A(null), d = A(i);
|
|
2607
2679
|
d.current = i;
|
|
2608
|
-
const S =
|
|
2609
|
-
if (
|
|
2680
|
+
const S = j(() => {
|
|
2681
|
+
if (ut(t)) return "";
|
|
2610
2682
|
try {
|
|
2611
2683
|
return JSON.stringify(t);
|
|
2612
2684
|
} catch {
|
|
2613
2685
|
return String(t);
|
|
2614
2686
|
}
|
|
2615
|
-
}, [t]), g =
|
|
2687
|
+
}, [t]), g = j(() => {
|
|
2616
2688
|
if (!S)
|
|
2617
2689
|
return { surfaces: [], processor: null };
|
|
2618
2690
|
try {
|
|
2619
|
-
const
|
|
2691
|
+
const f = JSON.parse(S), p = new Qt([In()]), v = vo(f, {
|
|
2620
2692
|
surfaceId: n,
|
|
2621
|
-
catalogId:
|
|
2693
|
+
catalogId: Tn
|
|
2622
2694
|
});
|
|
2623
2695
|
return p.processMessages(v), {
|
|
2624
2696
|
surfaces: Array.from(p.model.surfacesMap.values()),
|
|
2625
2697
|
processor: p
|
|
2626
2698
|
};
|
|
2627
|
-
} catch (
|
|
2628
|
-
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败",
|
|
2699
|
+
} catch (f) {
|
|
2700
|
+
return console.error("[SkoponFormRenderer] 渲染 A2UI surface 失败", f), { surfaces: [], processor: null };
|
|
2629
2701
|
}
|
|
2630
|
-
}, [S, n]), { surfaces:
|
|
2631
|
-
if (m.current = y,
|
|
2632
|
-
|
|
2702
|
+
}, [S, n]), { surfaces: b, processor: y } = g;
|
|
2703
|
+
if (m.current = y, wn(
|
|
2704
|
+
c,
|
|
2633
2705
|
() => ({
|
|
2634
|
-
getValues(
|
|
2706
|
+
getValues(f) {
|
|
2635
2707
|
const p = m.current;
|
|
2636
2708
|
if (!p) return {};
|
|
2637
|
-
const v = (
|
|
2638
|
-
return
|
|
2709
|
+
const v = (f ?? d.current).map((x) => x.trim()).filter(Boolean);
|
|
2710
|
+
return Co(p, n, v);
|
|
2639
2711
|
},
|
|
2640
|
-
setValues(
|
|
2712
|
+
setValues(f) {
|
|
2641
2713
|
const p = m.current;
|
|
2642
2714
|
if (!p) return;
|
|
2643
2715
|
const v = p.model.surfacesMap.get(n);
|
|
2644
2716
|
if (v)
|
|
2645
|
-
for (const [x,
|
|
2646
|
-
const
|
|
2647
|
-
|
|
2717
|
+
for (const [x, M] of Object.entries(f)) {
|
|
2718
|
+
const _ = x.trim();
|
|
2719
|
+
_ && v.dataModel.set(`/${_}`, M);
|
|
2648
2720
|
}
|
|
2649
2721
|
}
|
|
2650
2722
|
}),
|
|
2651
2723
|
[n]
|
|
2652
|
-
),
|
|
2653
|
-
const
|
|
2654
|
-
return l ? /* @__PURE__ */
|
|
2724
|
+
), b.length === 0) {
|
|
2725
|
+
const f = /* @__PURE__ */ u(at, { resumeSearch: s, children: /* @__PURE__ */ u(st, { caseSearch: a, children: /* @__PURE__ */ u(it, { interactive: o, children: r }) }) });
|
|
2726
|
+
return l ? /* @__PURE__ */ u(ge, { children: f }) : f;
|
|
2655
2727
|
}
|
|
2656
|
-
const
|
|
2657
|
-
return l ? /* @__PURE__ */
|
|
2728
|
+
const k = /* @__PURE__ */ u(at, { resumeSearch: s, children: /* @__PURE__ */ u(st, { caseSearch: a, children: /* @__PURE__ */ u(it, { interactive: o, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: b.map((f) => /* @__PURE__ */ u(Yt, { surface: f }, f.id)) }) }) }) });
|
|
2729
|
+
return l ? /* @__PURE__ */ u(ge, { children: k }) : k;
|
|
2658
2730
|
}
|
|
2659
2731
|
);
|
|
2660
|
-
function
|
|
2661
|
-
return new
|
|
2732
|
+
function Fe() {
|
|
2733
|
+
return new Qt([In()]);
|
|
2662
2734
|
}
|
|
2663
|
-
function
|
|
2735
|
+
function as({
|
|
2664
2736
|
messages: e,
|
|
2665
2737
|
surfaceId: t = "skopon-form-stream",
|
|
2666
2738
|
emptyHint: n = null,
|
|
@@ -2668,92 +2740,145 @@ function Bi({
|
|
|
2668
2740
|
resumeSearch: o = null,
|
|
2669
2741
|
caseSearch: i = null
|
|
2670
2742
|
}) {
|
|
2671
|
-
|
|
2672
|
-
|
|
2743
|
+
z(() => {
|
|
2744
|
+
Zt(), Xt();
|
|
2673
2745
|
}, []);
|
|
2674
|
-
const s =
|
|
2675
|
-
s.current === null && (s.current =
|
|
2676
|
-
const a =
|
|
2677
|
-
function d(
|
|
2678
|
-
s.current =
|
|
2746
|
+
const s = A(null);
|
|
2747
|
+
s.current === null && (s.current = Fe());
|
|
2748
|
+
const a = A(0), l = A(""), c = A(!0), m = A(t);
|
|
2749
|
+
function d(f, p) {
|
|
2750
|
+
s.current = f, a.current = p.length, l.current = JSON.stringify(p), c.current && (b(f), k(Array.from(f.model.surfacesMap.values())));
|
|
2679
2751
|
}
|
|
2680
|
-
function S(
|
|
2752
|
+
function S(f, p) {
|
|
2681
2753
|
if (p <= 0) return !1;
|
|
2682
|
-
const v = JSON.stringify(
|
|
2754
|
+
const v = JSON.stringify(f.slice(0, p)), x = l.current;
|
|
2683
2755
|
if (!x) return !0;
|
|
2684
2756
|
try {
|
|
2685
|
-
const
|
|
2686
|
-
return JSON.stringify(
|
|
2757
|
+
const M = JSON.parse(x);
|
|
2758
|
+
return JSON.stringify(M.slice(0, p)) !== v;
|
|
2687
2759
|
} catch {
|
|
2688
2760
|
return !0;
|
|
2689
2761
|
}
|
|
2690
2762
|
}
|
|
2691
|
-
const [g,
|
|
2763
|
+
const [g, b] = R(
|
|
2692
2764
|
() => s.current
|
|
2693
|
-
), [y,
|
|
2765
|
+
), [y, k] = R(
|
|
2694
2766
|
() => Array.from(
|
|
2695
2767
|
s.current.model.surfacesMap.values()
|
|
2696
2768
|
)
|
|
2697
2769
|
);
|
|
2698
|
-
return
|
|
2699
|
-
|
|
2700
|
-
}), []),
|
|
2770
|
+
return z(() => (c.current = !0, () => {
|
|
2771
|
+
c.current = !1;
|
|
2772
|
+
}), []), z(() => {
|
|
2701
2773
|
s.current = g;
|
|
2702
|
-
}, [g]),
|
|
2703
|
-
const
|
|
2704
|
-
|
|
2705
|
-
}, p = g.onSurfaceCreated(
|
|
2774
|
+
}, [g]), z(() => {
|
|
2775
|
+
const f = () => {
|
|
2776
|
+
c.current && k(Array.from(g.model.surfacesMap.values()));
|
|
2777
|
+
}, p = g.onSurfaceCreated(f), v = g.onSurfaceDeleted(f);
|
|
2706
2778
|
return () => {
|
|
2707
2779
|
p.unsubscribe(), v.unsubscribe();
|
|
2708
2780
|
};
|
|
2709
|
-
}, [g]),
|
|
2710
|
-
let
|
|
2781
|
+
}, [g]), z(() => {
|
|
2782
|
+
let f = !1;
|
|
2711
2783
|
const p = m.current !== t;
|
|
2712
2784
|
if (m.current = t, p) {
|
|
2713
|
-
const
|
|
2714
|
-
return Array.isArray(e) && e.length > 0 ? (
|
|
2715
|
-
|
|
2785
|
+
const _ = Fe();
|
|
2786
|
+
return Array.isArray(e) && e.length > 0 ? (_.processMessages(e), f || d(_, e)) : (s.current = _, a.current = 0, l.current = "", f || (b(_), k([]))), () => {
|
|
2787
|
+
f = !0;
|
|
2716
2788
|
};
|
|
2717
2789
|
}
|
|
2718
2790
|
if (!Array.isArray(e) || e.length === 0) {
|
|
2719
2791
|
if (a.current > 0) {
|
|
2720
|
-
const
|
|
2721
|
-
s.current =
|
|
2792
|
+
const _ = Fe();
|
|
2793
|
+
s.current = _, a.current = 0, l.current = "", f || (b(_), k([]));
|
|
2722
2794
|
}
|
|
2723
2795
|
return () => {
|
|
2724
|
-
|
|
2796
|
+
f = !0;
|
|
2725
2797
|
};
|
|
2726
2798
|
}
|
|
2727
2799
|
const v = s.current, x = a.current;
|
|
2728
2800
|
if (e.length < x || S(e, x)) {
|
|
2729
|
-
const
|
|
2730
|
-
return
|
|
2731
|
-
|
|
2801
|
+
const _ = Fe();
|
|
2802
|
+
return _.processMessages(e), f || d(_, e), () => {
|
|
2803
|
+
f = !0;
|
|
2732
2804
|
};
|
|
2733
2805
|
}
|
|
2734
|
-
const
|
|
2735
|
-
return
|
|
2736
|
-
|
|
2737
|
-
} : (v.processMessages(
|
|
2738
|
-
|
|
2806
|
+
const M = e.slice(x);
|
|
2807
|
+
return M.length === 0 ? () => {
|
|
2808
|
+
f = !0;
|
|
2809
|
+
} : (v.processMessages(M), a.current = e.length, l.current = JSON.stringify(e), f || k(Array.from(v.model.surfacesMap.values())), () => {
|
|
2810
|
+
f = !0;
|
|
2739
2811
|
});
|
|
2740
|
-
}, [e, t]), y.length === 0 ? /* @__PURE__ */
|
|
2812
|
+
}, [e, t]), y.length === 0 ? /* @__PURE__ */ u(ge, { children: n }) : /* @__PURE__ */ u(ge, { children: /* @__PURE__ */ u(at, { resumeSearch: o, children: /* @__PURE__ */ u(st, { caseSearch: i, children: /* @__PURE__ */ u(it, { interactive: r, children: /* @__PURE__ */ u("div", { className: "a2ui-surface a2ui-container", children: y.map((f) => /* @__PURE__ */ u(Yt, { surface: f }, f.id)) }) }) }) }) });
|
|
2813
|
+
}
|
|
2814
|
+
const Mi = 100, Ni = 3e4, Fi = 1500, ce = /* @__PURE__ */ new Map();
|
|
2815
|
+
function Ei(e) {
|
|
2816
|
+
const t = e.trim();
|
|
2817
|
+
let n = ce.get(t);
|
|
2818
|
+
return n || (n = new Ui(t), ce.set(t, n)), n.acquire(), n;
|
|
2741
2819
|
}
|
|
2742
|
-
|
|
2743
|
-
class pi {
|
|
2820
|
+
class Ui {
|
|
2744
2821
|
constructor(t) {
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
this
|
|
2822
|
+
G(this, "url");
|
|
2823
|
+
G(this, "ws", null);
|
|
2824
|
+
G(this, "refCount", 0);
|
|
2825
|
+
G(this, "connectRequested", !1);
|
|
2826
|
+
G(this, "reconnectAttempt", 0);
|
|
2827
|
+
G(this, "reconnectTimer", null);
|
|
2828
|
+
G(this, "releaseTimer", null);
|
|
2829
|
+
G(this, "sendQueue", []);
|
|
2830
|
+
G(this, "handlers", /* @__PURE__ */ new Map());
|
|
2831
|
+
this.url = t;
|
|
2832
|
+
}
|
|
2833
|
+
acquire() {
|
|
2834
|
+
this.refCount += 1, this.clearReleaseTimer();
|
|
2754
2835
|
}
|
|
2836
|
+
release() {
|
|
2837
|
+
this.refCount = Math.max(0, this.refCount - 1), !(this.refCount > 0) && (this.clearReleaseTimer(), this.releaseTimer = setTimeout(() => {
|
|
2838
|
+
this.releaseTimer = null, !(this.refCount > 0) && (this.teardown(), ce.get(this.url) === this && ce.delete(this.url));
|
|
2839
|
+
}, Fi));
|
|
2840
|
+
}
|
|
2841
|
+
/** 强制关闭(测试用),跳过宽限期。 */
|
|
2842
|
+
forceClose() {
|
|
2843
|
+
this.refCount = 0, this.teardown(), ce.get(this.url) === this && ce.delete(this.url);
|
|
2844
|
+
}
|
|
2845
|
+
subscribe(t, n) {
|
|
2846
|
+
const r = t.trim();
|
|
2847
|
+
if (!r) return () => {
|
|
2848
|
+
};
|
|
2849
|
+
let o = this.handlers.get(r);
|
|
2850
|
+
return o || (o = /* @__PURE__ */ new Set(), this.handlers.set(r, o)), o.add(n), () => {
|
|
2851
|
+
const i = this.handlers.get(r);
|
|
2852
|
+
i && (i.delete(n), i.size === 0 && this.handlers.delete(r));
|
|
2853
|
+
};
|
|
2854
|
+
}
|
|
2855
|
+
/** 懒建连:首个会话 connect() 时才真正打开 socket。 */
|
|
2755
2856
|
connect() {
|
|
2756
|
-
|
|
2857
|
+
typeof WebSocket > "u" || (this.connectRequested = !0, !(this.ws && (this.ws.readyState === WebSocket.OPEN || this.ws.readyState === WebSocket.CONNECTING)) && this.openSocket());
|
|
2858
|
+
}
|
|
2859
|
+
send(t, n, r) {
|
|
2860
|
+
var s;
|
|
2861
|
+
if (this.refCount <= 0 && !this.connectRequested) return;
|
|
2862
|
+
const o = {
|
|
2863
|
+
type: n,
|
|
2864
|
+
ask_user_message_id: t,
|
|
2865
|
+
data: r
|
|
2866
|
+
};
|
|
2867
|
+
let i;
|
|
2868
|
+
try {
|
|
2869
|
+
i = JSON.stringify(o);
|
|
2870
|
+
} catch (a) {
|
|
2871
|
+
console.warn("[FormRuntimeConnection] serialize failed", a);
|
|
2872
|
+
return;
|
|
2873
|
+
}
|
|
2874
|
+
if (((s = this.ws) == null ? void 0 : s.readyState) === WebSocket.OPEN) {
|
|
2875
|
+
this.ws.send(i);
|
|
2876
|
+
return;
|
|
2877
|
+
}
|
|
2878
|
+
this.enqueue(i);
|
|
2879
|
+
}
|
|
2880
|
+
openSocket() {
|
|
2881
|
+
if (!(!this.connectRequested || this.refCount <= 0)) {
|
|
2757
2882
|
this.clearReconnectTimer(), this.disposeSocket();
|
|
2758
2883
|
try {
|
|
2759
2884
|
const t = new WebSocket(this.url);
|
|
@@ -2766,35 +2891,13 @@ class pi {
|
|
|
2766
2891
|
}, t.onerror = () => {
|
|
2767
2892
|
};
|
|
2768
2893
|
} catch (t) {
|
|
2769
|
-
console.warn("[
|
|
2894
|
+
console.warn("[FormRuntimeConnection] connect failed", t), this.scheduleReconnect();
|
|
2770
2895
|
}
|
|
2771
2896
|
}
|
|
2772
2897
|
}
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
if (this.closed) return;
|
|
2776
|
-
const r = {
|
|
2777
|
-
type: t,
|
|
2778
|
-
ask_user_message_id: this.askUserMessageId,
|
|
2779
|
-
data: n
|
|
2780
|
-
};
|
|
2781
|
-
let o;
|
|
2782
|
-
try {
|
|
2783
|
-
o = JSON.stringify(r);
|
|
2784
|
-
} catch (s) {
|
|
2785
|
-
console.warn("[FormRuntimeWs] serialize failed", s);
|
|
2786
|
-
return;
|
|
2787
|
-
}
|
|
2788
|
-
if (((i = this.ws) == null ? void 0 : i.readyState) === WebSocket.OPEN) {
|
|
2789
|
-
this.ws.send(o);
|
|
2790
|
-
return;
|
|
2791
|
-
}
|
|
2792
|
-
this.enqueue(o);
|
|
2793
|
-
}
|
|
2794
|
-
close() {
|
|
2795
|
-
this.closed = !0, this.clearReconnectTimer(), this.sendQueue = [], this.disposeSocket();
|
|
2898
|
+
teardown() {
|
|
2899
|
+
this.connectRequested = !1, this.clearReconnectTimer(), this.clearReleaseTimer(), this.sendQueue = [], this.handlers.clear(), this.disposeSocket();
|
|
2796
2900
|
}
|
|
2797
|
-
/** 关闭当前 socket 且不触发重连(清掉 onclose),建新连或主动 close 时用。 */
|
|
2798
2901
|
disposeSocket() {
|
|
2799
2902
|
if (this.ws) {
|
|
2800
2903
|
this.ws.onopen = null, this.ws.onmessage = null, this.ws.onclose = null, this.ws.onerror = null;
|
|
@@ -2806,7 +2909,7 @@ class pi {
|
|
|
2806
2909
|
}
|
|
2807
2910
|
}
|
|
2808
2911
|
enqueue(t) {
|
|
2809
|
-
for (this.sendQueue.push(t); this.sendQueue.length >
|
|
2912
|
+
for (this.sendQueue.push(t); this.sendQueue.length > Mi; )
|
|
2810
2913
|
this.sendQueue.shift();
|
|
2811
2914
|
}
|
|
2812
2915
|
flushQueue() {
|
|
@@ -2817,21 +2920,23 @@ class pi {
|
|
|
2817
2920
|
this.ws.send(n);
|
|
2818
2921
|
}
|
|
2819
2922
|
scheduleReconnect() {
|
|
2820
|
-
if (this.
|
|
2923
|
+
if (!this.connectRequested || this.refCount <= 0) return;
|
|
2821
2924
|
this.clearReconnectTimer();
|
|
2822
2925
|
const t = Math.min(
|
|
2823
|
-
|
|
2926
|
+
Ni,
|
|
2824
2927
|
1e3 * 2 ** Math.min(this.reconnectAttempt, 5)
|
|
2825
2928
|
);
|
|
2826
2929
|
this.reconnectAttempt += 1, this.reconnectTimer = setTimeout(() => {
|
|
2827
|
-
this.reconnectTimer = null, this.
|
|
2930
|
+
this.reconnectTimer = null, this.openSocket();
|
|
2828
2931
|
}, t);
|
|
2829
2932
|
}
|
|
2830
2933
|
clearReconnectTimer() {
|
|
2831
2934
|
this.reconnectTimer != null && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null);
|
|
2832
2935
|
}
|
|
2936
|
+
clearReleaseTimer() {
|
|
2937
|
+
this.releaseTimer != null && (clearTimeout(this.releaseTimer), this.releaseTimer = null);
|
|
2938
|
+
}
|
|
2833
2939
|
handleMessage(t) {
|
|
2834
|
-
var i;
|
|
2835
2940
|
if (typeof t != "string") return;
|
|
2836
2941
|
let n;
|
|
2837
2942
|
try {
|
|
@@ -2841,29 +2946,60 @@ class pi {
|
|
|
2841
2946
|
}
|
|
2842
2947
|
if (!n || typeof n != "object" || Array.isArray(n)) return;
|
|
2843
2948
|
const r = n;
|
|
2844
|
-
if (r.type !== "form_auto_control_event"
|
|
2845
|
-
const o = r.
|
|
2846
|
-
|
|
2949
|
+
if (r.type !== "form_auto_control_event") return;
|
|
2950
|
+
const o = String(r.ask_user_message_id ?? "").trim();
|
|
2951
|
+
if (!o) return;
|
|
2952
|
+
const i = r.data;
|
|
2953
|
+
if (!i || typeof i != "object" || Array.isArray(i)) return;
|
|
2954
|
+
const s = this.handlers.get(o);
|
|
2955
|
+
if (!(!s || s.size === 0))
|
|
2956
|
+
for (const a of [...s])
|
|
2957
|
+
try {
|
|
2958
|
+
a(i, r);
|
|
2959
|
+
} catch (l) {
|
|
2960
|
+
console.warn("[FormRuntimeConnection] handler error", l);
|
|
2961
|
+
}
|
|
2847
2962
|
}
|
|
2848
2963
|
}
|
|
2849
|
-
|
|
2964
|
+
class Ri {
|
|
2965
|
+
constructor(t) {
|
|
2966
|
+
G(this, "askUserMessageId");
|
|
2967
|
+
G(this, "connection");
|
|
2968
|
+
G(this, "unsubscribe");
|
|
2969
|
+
G(this, "closed", !1);
|
|
2970
|
+
this.askUserMessageId = t.askUserMessageId.trim(), this.connection = Ei(t.url);
|
|
2971
|
+
const n = t.onAutoControl;
|
|
2972
|
+
this.unsubscribe = n ? this.connection.subscribe(this.askUserMessageId, n) : () => {
|
|
2973
|
+
};
|
|
2974
|
+
}
|
|
2975
|
+
connect() {
|
|
2976
|
+
this.closed || this.connection.connect();
|
|
2977
|
+
}
|
|
2978
|
+
send(t, n) {
|
|
2979
|
+
this.closed || this.connection.send(this.askUserMessageId, t, n);
|
|
2980
|
+
}
|
|
2981
|
+
close() {
|
|
2982
|
+
this.closed || (this.closed = !0, this.unsubscribe(), this.connection.release());
|
|
2983
|
+
}
|
|
2984
|
+
}
|
|
2985
|
+
function Mn(e) {
|
|
2850
2986
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/\\/g, "\\\\").replace(/"/g, '\\"');
|
|
2851
2987
|
}
|
|
2852
|
-
function
|
|
2988
|
+
function wi(e, t) {
|
|
2853
2989
|
if (!e) return !1;
|
|
2854
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
2990
|
+
const n = e.querySelector(`[data-skopon-field="${Mn(t)}"]`);
|
|
2855
2991
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
2856
2992
|
'input, textarea, select, button, [tabindex]:not([tabindex="-1"])'
|
|
2857
2993
|
) ?? n).focus(), !0) : !1;
|
|
2858
2994
|
}
|
|
2859
|
-
function
|
|
2995
|
+
function Pi(e, t) {
|
|
2860
2996
|
if (!e) return !1;
|
|
2861
|
-
const n = e.querySelector(`[data-skopon-field="${
|
|
2997
|
+
const n = e.querySelector(`[data-skopon-field="${Mn(t)}"]`);
|
|
2862
2998
|
return n instanceof HTMLElement ? ((n.querySelector(
|
|
2863
2999
|
'button, [role="button"], .skopon-resume-select-card, input, label'
|
|
2864
3000
|
) ?? n).click(), !0) : !1;
|
|
2865
3001
|
}
|
|
2866
|
-
function
|
|
3002
|
+
function zi(e, t, n) {
|
|
2867
3003
|
const r = e.action;
|
|
2868
3004
|
if (r !== "change" && r !== "select" && r !== "focus" && r !== "click" && r !== "submit") {
|
|
2869
3005
|
console.warn("[FormAutoControl] unknown action", r);
|
|
@@ -2893,21 +3029,47 @@ function gi(e, t, n) {
|
|
|
2893
3029
|
return;
|
|
2894
3030
|
}
|
|
2895
3031
|
if (r === "focus") {
|
|
2896
|
-
|
|
3032
|
+
wi(t.rootElement, o), n.reportEvent({
|
|
2897
3033
|
action: "focus",
|
|
2898
3034
|
component: i,
|
|
2899
3035
|
field: o
|
|
2900
3036
|
});
|
|
2901
3037
|
return;
|
|
2902
3038
|
}
|
|
2903
|
-
|
|
3039
|
+
Pi(t.rootElement, o) || console.warn("[FormAutoControl] click target not found", o);
|
|
2904
3040
|
});
|
|
2905
3041
|
}
|
|
2906
|
-
function
|
|
2907
|
-
const t =
|
|
2908
|
-
|
|
3042
|
+
function Oi(e) {
|
|
3043
|
+
const t = {};
|
|
3044
|
+
for (const [n, r] of Object.entries(e))
|
|
3045
|
+
r !== void 0 && (t[n] = r);
|
|
3046
|
+
return t;
|
|
2909
3047
|
}
|
|
2910
|
-
function
|
|
3048
|
+
function qi(e, t) {
|
|
3049
|
+
var o;
|
|
3050
|
+
const n = (o = e.name) == null ? void 0 : o.trim();
|
|
3051
|
+
if (!n || !t) return { ...e };
|
|
3052
|
+
const r = t.get(n);
|
|
3053
|
+
return r ? e.type !== "resume_multiselect" && e.type !== "case_multiselect" ? { ...e } : { ...e, options: r.map((i) => ({ ...i })) } : { ...e };
|
|
3054
|
+
}
|
|
3055
|
+
function Bi(e) {
|
|
3056
|
+
var i, s;
|
|
3057
|
+
const n = {
|
|
3058
|
+
blocks: (e.blocks ?? []).map(
|
|
3059
|
+
(a) => qi(a, e.liveOptions)
|
|
3060
|
+
)
|
|
3061
|
+
}, r = (i = e.title) == null ? void 0 : i.trim(), o = (s = e.description) == null ? void 0 : s.trim();
|
|
3062
|
+
return r && (n.title = r), o && (n.description = o), {
|
|
3063
|
+
form_schema: n,
|
|
3064
|
+
form_values: Oi(e.values ?? {}),
|
|
3065
|
+
form_change: [...e.formChange ?? []]
|
|
3066
|
+
};
|
|
3067
|
+
}
|
|
3068
|
+
function Li(e) {
|
|
3069
|
+
const t = Be(e);
|
|
3070
|
+
return t ? yt(t.blocks) : e && typeof e == "object" && !Array.isArray(e) ? e : {};
|
|
3071
|
+
}
|
|
3072
|
+
function Vi({
|
|
2911
3073
|
payload: e,
|
|
2912
3074
|
callbackUrl: t,
|
|
2913
3075
|
title: n,
|
|
@@ -2917,69 +3079,70 @@ function vi({
|
|
|
2917
3079
|
submitHeaders: s,
|
|
2918
3080
|
onNotify: a
|
|
2919
3081
|
}) {
|
|
2920
|
-
const [l,
|
|
2921
|
-
|
|
3082
|
+
const [l, c] = R(!1), m = A(!0);
|
|
3083
|
+
z(() => (m.current = !0, () => {
|
|
2922
3084
|
m.current = !1;
|
|
2923
3085
|
}), []);
|
|
2924
|
-
const d =
|
|
2925
|
-
() =>
|
|
3086
|
+
const d = j(
|
|
3087
|
+
() => At(s),
|
|
2926
3088
|
[s]
|
|
2927
|
-
), S =
|
|
2928
|
-
() =>
|
|
3089
|
+
), S = j(
|
|
3090
|
+
() => yn(e, t, d),
|
|
2929
3091
|
[e, t, d]
|
|
2930
|
-
), g =
|
|
3092
|
+
), g = j(
|
|
2931
3093
|
() => ({
|
|
2932
3094
|
...i,
|
|
2933
3095
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? t ?? null
|
|
2934
3096
|
}),
|
|
2935
3097
|
[i, t]
|
|
2936
3098
|
);
|
|
2937
|
-
async function
|
|
3099
|
+
async function b() {
|
|
2938
3100
|
if (!l) {
|
|
2939
|
-
|
|
3101
|
+
c(!0);
|
|
2940
3102
|
try {
|
|
2941
|
-
const y =
|
|
3103
|
+
const y = Li(e), k = Tt({
|
|
2942
3104
|
context: g,
|
|
2943
3105
|
payload: e,
|
|
2944
3106
|
answer: y
|
|
2945
|
-
}),
|
|
3107
|
+
}), f = await Cn(k, {
|
|
2946
3108
|
headers: d
|
|
2947
3109
|
});
|
|
2948
3110
|
if (!m.current) return;
|
|
2949
|
-
const p =
|
|
3111
|
+
const p = kn(f);
|
|
2950
3112
|
a == null || a(p.type, p.message);
|
|
2951
3113
|
} catch (y) {
|
|
2952
3114
|
if (!m.current) return;
|
|
2953
|
-
const
|
|
2954
|
-
a == null || a("error",
|
|
3115
|
+
const k = y instanceof Error ? y.message : "提交失败";
|
|
3116
|
+
a == null || a("error", k);
|
|
2955
3117
|
} finally {
|
|
2956
|
-
m.current &&
|
|
3118
|
+
m.current && c(!1);
|
|
2957
3119
|
}
|
|
2958
3120
|
}
|
|
2959
3121
|
}
|
|
2960
3122
|
return /* @__PURE__ */ I("div", { className: "ask-user-curl-card", children: [
|
|
2961
3123
|
/* @__PURE__ */ I("div", { className: "ask-user-curl-card-header", children: [
|
|
2962
3124
|
/* @__PURE__ */ I("div", { className: "ask-user-curl-card-header-title", children: [
|
|
2963
|
-
/* @__PURE__ */
|
|
2964
|
-
r ? /* @__PURE__ */
|
|
2965
|
-
o ? /* @__PURE__ */
|
|
3125
|
+
/* @__PURE__ */ u(te.Text, { type: "secondary", children: n ?? "curl 命令" }),
|
|
3126
|
+
r ? /* @__PURE__ */ u(pe, { title: r, children: /* @__PURE__ */ u(fe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) : null,
|
|
3127
|
+
o ? /* @__PURE__ */ u(pe, { title: o, children: /* @__PURE__ */ u(fe, { className: "ask-user-curl-incomplete-tag", children: "卡片 ID 待补足" }) }) : null
|
|
2966
3128
|
] }),
|
|
2967
|
-
/* @__PURE__ */
|
|
2968
|
-
|
|
3129
|
+
/* @__PURE__ */ u(pe, { title: "提交到 answer_agent_callback_url", children: /* @__PURE__ */ u(
|
|
3130
|
+
ze,
|
|
2969
3131
|
{
|
|
2970
3132
|
size: "small",
|
|
2971
3133
|
type: "text",
|
|
2972
3134
|
loading: l,
|
|
2973
3135
|
disabled: l,
|
|
2974
|
-
onClick: () => void
|
|
3136
|
+
onClick: () => void b(),
|
|
2975
3137
|
children: "提交"
|
|
2976
3138
|
}
|
|
2977
3139
|
) })
|
|
2978
3140
|
] }),
|
|
2979
|
-
/* @__PURE__ */
|
|
3141
|
+
/* @__PURE__ */ u("pre", { className: "skopon-form-curl-json", children: S })
|
|
2980
3142
|
] });
|
|
2981
3143
|
}
|
|
2982
|
-
|
|
3144
|
+
const ji = 80;
|
|
3145
|
+
function $i(e, t) {
|
|
2983
3146
|
if (t && typeof t == "object" && t !== null && "message" in t) {
|
|
2984
3147
|
const n = t.message;
|
|
2985
3148
|
if (typeof n == "string" && n.trim())
|
|
@@ -2987,7 +3150,7 @@ function Si(e, t) {
|
|
|
2987
3150
|
}
|
|
2988
3151
|
return typeof t == "string" && t.trim() ? `提交失败 (${e}): ${t.trim()}` : `提交失败 (${e})`;
|
|
2989
3152
|
}
|
|
2990
|
-
function
|
|
3153
|
+
function Di({
|
|
2991
3154
|
payload: e,
|
|
2992
3155
|
formUniqueId: t,
|
|
2993
3156
|
askUserMessageId: n,
|
|
@@ -2997,200 +3160,250 @@ function bi({
|
|
|
2997
3160
|
submitHeaders: s,
|
|
2998
3161
|
fetchFormDetail: a,
|
|
2999
3162
|
onNotify: l,
|
|
3000
|
-
resumeSearch:
|
|
3163
|
+
resumeSearch: c = null,
|
|
3001
3164
|
caseSearch: m = null,
|
|
3002
3165
|
onSurfaceReadyChange: d,
|
|
3003
3166
|
onAutoControlReady: S
|
|
3004
3167
|
}) {
|
|
3005
|
-
const [g,
|
|
3006
|
-
|
|
3007
|
-
const
|
|
3008
|
-
() =>
|
|
3168
|
+
const [g, b] = R(null), [y, k] = R(!1), [f, p] = R(!0), [v, x] = R(!1), M = A(null), _ = A(null), w = A(!0), C = A(l);
|
|
3169
|
+
C.current = l;
|
|
3170
|
+
const O = on(), B = ht(), ne = A(""), K = A(null), D = (t == null ? void 0 : t.trim()) ?? "", J = (n == null ? void 0 : n.trim()) ?? "", Z = j(
|
|
3171
|
+
() => At(s),
|
|
3009
3172
|
[s]
|
|
3010
|
-
),
|
|
3173
|
+
), ee = j(
|
|
3011
3174
|
() => ({
|
|
3012
3175
|
...i,
|
|
3013
3176
|
callbackUrl: (i == null ? void 0 : i.callbackUrl) ?? r ?? null
|
|
3014
3177
|
}),
|
|
3015
3178
|
[i, r]
|
|
3016
3179
|
);
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
}), []),
|
|
3020
|
-
let
|
|
3021
|
-
return
|
|
3022
|
-
|
|
3023
|
-
}).catch((
|
|
3024
|
-
var
|
|
3025
|
-
if (!
|
|
3026
|
-
|
|
3027
|
-
const
|
|
3028
|
-
(
|
|
3180
|
+
z(() => (w.current = !0, () => {
|
|
3181
|
+
w.current = !1, K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3182
|
+
}), []), z(() => {
|
|
3183
|
+
let U = !1;
|
|
3184
|
+
return D ? (p(!0), k(!1), a({ formUniqueId: D }).then((q) => {
|
|
3185
|
+
U || (k(!!q.disabled), b(q.formDefinition ?? null));
|
|
3186
|
+
}).catch((q) => {
|
|
3187
|
+
var X;
|
|
3188
|
+
if (!U) {
|
|
3189
|
+
k(!1), b(null);
|
|
3190
|
+
const xe = q instanceof Error ? q.message : "获取表单定义失败";
|
|
3191
|
+
(X = C.current) == null || X.call(C, "error", xe);
|
|
3029
3192
|
}
|
|
3030
3193
|
}).finally(() => {
|
|
3031
|
-
|
|
3194
|
+
U || p(!1);
|
|
3032
3195
|
}), () => {
|
|
3033
|
-
|
|
3034
|
-
}) : (p(!1),
|
|
3035
|
-
|
|
3196
|
+
U = !0;
|
|
3197
|
+
}) : (p(!1), k(!1), b(null), () => {
|
|
3198
|
+
U = !0;
|
|
3036
3199
|
});
|
|
3037
|
-
}, [
|
|
3038
|
-
const
|
|
3039
|
-
() =>
|
|
3040
|
-
[
|
|
3041
|
-
),
|
|
3042
|
-
var
|
|
3043
|
-
return (
|
|
3044
|
-
}).map((
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3200
|
+
}, [D, a]);
|
|
3201
|
+
const F = j(() => Be(e), [e]), L = j(() => F ? xo(F, g ?? void 0) : null, [F, g]), T = (L == null ? void 0 : L.matchedBlocks) ?? [], V = !!(F && Mo(F) && T.length === 0), P = j(() => V && F ? No(F) : L && L.renderBlocks.length > 0 ? L.renderBlocks : [], [L, V, F]), N = j(
|
|
3202
|
+
() => V ? {} : yt((L == null ? void 0 : L.extraBlocks) ?? []),
|
|
3203
|
+
[V, L]
|
|
3204
|
+
), W = j(() => V && F ? Fo(F) : P.filter((U) => {
|
|
3205
|
+
var q;
|
|
3206
|
+
return (q = U.name) == null ? void 0 : q.trim();
|
|
3207
|
+
}).map((U) => U.name.trim()), [V, F, P]), _e = (L == null ? void 0 : L.title) ?? (F == null ? void 0 : F.title) ?? "", Te = (L == null ? void 0 : L.description) ?? (F == null ? void 0 : F.description) ?? "", le = j(() => P.length === 0 ? null : bo(
|
|
3208
|
+
{ title: _e, description: Te },
|
|
3209
|
+
P
|
|
3210
|
+
), [_e, Te, P]), je = j(() => {
|
|
3211
|
+
if (!le) return "";
|
|
3212
|
+
try {
|
|
3213
|
+
return JSON.stringify(le);
|
|
3214
|
+
} catch {
|
|
3215
|
+
return String(le);
|
|
3216
|
+
}
|
|
3217
|
+
}, [le]), $e = D ? `ask-user-${D}` : "ask-user-payload", re = !!(!f && F && P.length > 0 && le);
|
|
3218
|
+
z(() => (d(re), () => d(!1)), [re, d]);
|
|
3219
|
+
const It = $(() => {
|
|
3220
|
+
var q;
|
|
3221
|
+
return { ...((q = M.current) == null ? void 0 : q.getValues(W)) ?? {}, ...N };
|
|
3222
|
+
}, [W, N]), Mt = A(B.liveOptions);
|
|
3223
|
+
Mt.current = B.liveOptions;
|
|
3224
|
+
const De = A(B.pendingChangeFields);
|
|
3225
|
+
De.current = B.pendingChangeFields;
|
|
3226
|
+
const me = $(
|
|
3227
|
+
(U) => {
|
|
3228
|
+
const q = Bi({
|
|
3229
|
+
title: _e,
|
|
3230
|
+
description: Te,
|
|
3231
|
+
blocks: P,
|
|
3232
|
+
values: It(),
|
|
3233
|
+
liveOptions: Mt.current,
|
|
3234
|
+
formChange: U
|
|
3235
|
+
});
|
|
3236
|
+
O.reportData(q);
|
|
3237
|
+
},
|
|
3238
|
+
[_e, Te, P, It, O]
|
|
3239
|
+
), He = A(me);
|
|
3240
|
+
He.current = me, z(() => {
|
|
3241
|
+
if (!re) {
|
|
3242
|
+
ne.current = "";
|
|
3243
|
+
return;
|
|
3244
|
+
}
|
|
3245
|
+
if (!je) return;
|
|
3246
|
+
const U = `${$e}::${je}`;
|
|
3247
|
+
if (ne.current === U) return;
|
|
3248
|
+
const q = setTimeout(() => {
|
|
3249
|
+
w.current && ne.current !== U && (ne.current = U, He.current([]));
|
|
3250
|
+
}, 0);
|
|
3251
|
+
return () => clearTimeout(q);
|
|
3252
|
+
}, [re, $e, je]), z(() => {
|
|
3253
|
+
if (!(!re || B.version === 0) && De.current.length !== 0)
|
|
3254
|
+
return K.current != null && clearTimeout(K.current), K.current = setTimeout(() => {
|
|
3255
|
+
if (K.current = null, !w.current) return;
|
|
3256
|
+
const U = [...De.current];
|
|
3257
|
+
B.clearPendingChangeFields(), U.length !== 0 && He.current(U);
|
|
3258
|
+
}, ji), () => {
|
|
3259
|
+
K.current != null && (clearTimeout(K.current), K.current = null);
|
|
3260
|
+
};
|
|
3261
|
+
}, [re, B.version, B.clearPendingChangeFields]);
|
|
3262
|
+
const Ke = $(async () => {
|
|
3263
|
+
var U, q, X, xe, Et, Ut, Rt, wt;
|
|
3052
3264
|
if (!v) {
|
|
3053
3265
|
x(!0);
|
|
3054
3266
|
try {
|
|
3055
|
-
const
|
|
3056
|
-
if (
|
|
3057
|
-
(
|
|
3267
|
+
const de = ((U = M.current) == null ? void 0 : U.getValues(W)) ?? {}, Ie = Zo(P, de);
|
|
3268
|
+
if (Ie) {
|
|
3269
|
+
(q = C.current) == null || q.call(C, "error", Ie.message);
|
|
3058
3270
|
return;
|
|
3059
3271
|
}
|
|
3060
|
-
const
|
|
3272
|
+
const Pt = { ...de, ...N };
|
|
3061
3273
|
if (o === "post") {
|
|
3062
|
-
const
|
|
3063
|
-
if (!
|
|
3064
|
-
(
|
|
3274
|
+
const Bt = (r ?? "").trim();
|
|
3275
|
+
if (!Bt) {
|
|
3276
|
+
(X = C.current) == null || X.call(C, "error", "callback_url 为空,无法提交");
|
|
3065
3277
|
return;
|
|
3066
3278
|
}
|
|
3067
|
-
|
|
3279
|
+
me([]), O.reportEvent({
|
|
3068
3280
|
action: "submit",
|
|
3069
3281
|
component: "SubmitButton"
|
|
3070
3282
|
});
|
|
3071
|
-
const
|
|
3072
|
-
headers:
|
|
3283
|
+
const Ge = await vn(Bt, Pt, {
|
|
3284
|
+
headers: Z
|
|
3073
3285
|
});
|
|
3074
|
-
if (!
|
|
3075
|
-
|
|
3286
|
+
if (!w.current) return;
|
|
3287
|
+
Ge.ok ? (xe = C.current) == null || xe.call(C, "success", "提交成功") : (Et = C.current) == null || Et.call(C, "error", $i(Ge.status, Ge.body));
|
|
3076
3288
|
return;
|
|
3077
3289
|
}
|
|
3078
|
-
const
|
|
3079
|
-
context:
|
|
3290
|
+
const zt = Tt({
|
|
3291
|
+
context: ee,
|
|
3080
3292
|
payload: e,
|
|
3081
|
-
form: g ??
|
|
3082
|
-
answer:
|
|
3083
|
-
}),
|
|
3084
|
-
if (
|
|
3085
|
-
(
|
|
3293
|
+
form: g ?? F,
|
|
3294
|
+
answer: Pt
|
|
3295
|
+
}), Ot = xt(zt);
|
|
3296
|
+
if (Ot) {
|
|
3297
|
+
(Ut = C.current) == null || Ut.call(C, "error", Ot);
|
|
3086
3298
|
return;
|
|
3087
3299
|
}
|
|
3088
|
-
|
|
3300
|
+
me([]), O.reportEvent({
|
|
3089
3301
|
action: "submit",
|
|
3090
3302
|
component: "SubmitButton"
|
|
3091
3303
|
});
|
|
3092
|
-
const
|
|
3093
|
-
headers:
|
|
3304
|
+
const Nn = await Cn(zt, {
|
|
3305
|
+
headers: Z
|
|
3094
3306
|
});
|
|
3095
|
-
if (!
|
|
3096
|
-
const
|
|
3097
|
-
(
|
|
3098
|
-
} catch (
|
|
3099
|
-
if (!
|
|
3100
|
-
const
|
|
3101
|
-
(
|
|
3307
|
+
if (!w.current) return;
|
|
3308
|
+
const qt = kn(Nn);
|
|
3309
|
+
(Rt = C.current) == null || Rt.call(C, qt.type, qt.message);
|
|
3310
|
+
} catch (de) {
|
|
3311
|
+
if (!w.current) return;
|
|
3312
|
+
const Ie = de instanceof Error ? de.message : "提交失败";
|
|
3313
|
+
(wt = C.current) == null || wt.call(C, "error", Ie);
|
|
3102
3314
|
} finally {
|
|
3103
|
-
|
|
3315
|
+
w.current && x(!1);
|
|
3104
3316
|
}
|
|
3105
3317
|
}
|
|
3106
3318
|
}, [
|
|
3107
3319
|
v,
|
|
3108
|
-
|
|
3109
|
-
|
|
3320
|
+
W,
|
|
3321
|
+
P,
|
|
3322
|
+
N,
|
|
3323
|
+
me,
|
|
3110
3324
|
O,
|
|
3111
|
-
M,
|
|
3112
3325
|
o,
|
|
3113
3326
|
r,
|
|
3114
|
-
|
|
3115
|
-
|
|
3327
|
+
Z,
|
|
3328
|
+
ee,
|
|
3116
3329
|
e,
|
|
3117
3330
|
g,
|
|
3118
|
-
|
|
3119
|
-
]),
|
|
3120
|
-
|
|
3121
|
-
const
|
|
3122
|
-
(
|
|
3123
|
-
|
|
3124
|
-
|
|
3331
|
+
F
|
|
3332
|
+
]), Nt = A(Ke);
|
|
3333
|
+
Nt.current = Ke;
|
|
3334
|
+
const Ft = $(
|
|
3335
|
+
(U) => {
|
|
3336
|
+
zi(
|
|
3337
|
+
U,
|
|
3125
3338
|
{
|
|
3126
|
-
setValues: (
|
|
3127
|
-
var
|
|
3128
|
-
return (
|
|
3339
|
+
setValues: (q) => {
|
|
3340
|
+
var X;
|
|
3341
|
+
return (X = M.current) == null ? void 0 : X.setValues(q);
|
|
3129
3342
|
},
|
|
3130
|
-
getValues: (
|
|
3131
|
-
var
|
|
3132
|
-
return ((
|
|
3343
|
+
getValues: (q) => {
|
|
3344
|
+
var X;
|
|
3345
|
+
return ((X = M.current) == null ? void 0 : X.getValues(q)) ?? {};
|
|
3133
3346
|
},
|
|
3134
|
-
submit: () =>
|
|
3135
|
-
rootElement:
|
|
3347
|
+
submit: () => Nt.current(),
|
|
3348
|
+
rootElement: _.current
|
|
3136
3349
|
},
|
|
3137
3350
|
{
|
|
3138
|
-
reportEvent:
|
|
3139
|
-
runAutoControl:
|
|
3351
|
+
reportEvent: O.reportEvent,
|
|
3352
|
+
runAutoControl: O.runAutoControl
|
|
3140
3353
|
}
|
|
3141
3354
|
);
|
|
3142
3355
|
},
|
|
3143
|
-
[
|
|
3356
|
+
[O]
|
|
3144
3357
|
);
|
|
3145
|
-
return
|
|
3146
|
-
if (!
|
|
3358
|
+
return z(() => {
|
|
3359
|
+
if (!re) {
|
|
3147
3360
|
S(null);
|
|
3148
3361
|
return;
|
|
3149
3362
|
}
|
|
3150
|
-
return S(
|
|
3151
|
-
}, [
|
|
3152
|
-
|
|
3363
|
+
return S(Ft), () => S(null);
|
|
3364
|
+
}, [re, Ft, S]), f ? /* @__PURE__ */ u("div", { className: "ask-user-form-card", children: /* @__PURE__ */ u(mt, { size: "small" }) }) : !F || P.length === 0 ? /* @__PURE__ */ u(
|
|
3365
|
+
Vi,
|
|
3153
3366
|
{
|
|
3154
3367
|
payload: e,
|
|
3155
3368
|
callbackUrl: r,
|
|
3156
|
-
answerAgentContext:
|
|
3369
|
+
answerAgentContext: ee,
|
|
3157
3370
|
submitHeaders: s,
|
|
3158
|
-
unpublishedFormId: y &&
|
|
3371
|
+
unpublishedFormId: y && D ? D : void 0,
|
|
3159
3372
|
onNotify: l
|
|
3160
3373
|
}
|
|
3161
3374
|
) : /* @__PURE__ */ I(
|
|
3162
3375
|
"div",
|
|
3163
3376
|
{
|
|
3164
3377
|
className: "ask-user-form-card",
|
|
3165
|
-
ref:
|
|
3166
|
-
"data-ask-user-message-id":
|
|
3378
|
+
ref: _,
|
|
3379
|
+
"data-ask-user-message-id": J || void 0,
|
|
3167
3380
|
children: [
|
|
3168
|
-
y &&
|
|
3169
|
-
/* @__PURE__ */
|
|
3170
|
-
|
|
3381
|
+
y && D ? /* @__PURE__ */ u("div", { className: "ask-user-form-card-status", children: /* @__PURE__ */ u(pe, { title: D, children: /* @__PURE__ */ u(fe, { className: "ask-user-curl-unpublished-tag", children: "卡片 ID 未发布" }) }) }) : null,
|
|
3382
|
+
/* @__PURE__ */ u(
|
|
3383
|
+
Ii,
|
|
3171
3384
|
{
|
|
3172
|
-
ref:
|
|
3173
|
-
doc:
|
|
3174
|
-
surfaceId:
|
|
3175
|
-
fieldNames:
|
|
3385
|
+
ref: M,
|
|
3386
|
+
doc: le,
|
|
3387
|
+
surfaceId: $e,
|
|
3388
|
+
fieldNames: W,
|
|
3176
3389
|
interactive: !0,
|
|
3177
3390
|
wrapProvider: !1,
|
|
3178
|
-
resumeSearch:
|
|
3391
|
+
resumeSearch: c,
|
|
3179
3392
|
caseSearch: m
|
|
3180
3393
|
}
|
|
3181
3394
|
),
|
|
3182
|
-
/* @__PURE__ */
|
|
3183
|
-
|
|
3395
|
+
/* @__PURE__ */ u("div", { className: "ask-user-form-actions", children: /* @__PURE__ */ u(
|
|
3396
|
+
pe,
|
|
3184
3397
|
{
|
|
3185
3398
|
title: o === "post" ? "提交 JSON 到 callback_url" : "提交到 answer_agent_callback_url",
|
|
3186
|
-
children: /* @__PURE__ */
|
|
3187
|
-
|
|
3399
|
+
children: /* @__PURE__ */ u(
|
|
3400
|
+
ze,
|
|
3188
3401
|
{
|
|
3189
3402
|
type: "primary",
|
|
3190
3403
|
size: "small",
|
|
3191
3404
|
loading: v,
|
|
3192
3405
|
disabled: v,
|
|
3193
|
-
onClick: () => void
|
|
3406
|
+
onClick: () => void Ke(),
|
|
3194
3407
|
children: "提交"
|
|
3195
3408
|
}
|
|
3196
3409
|
)
|
|
@@ -3200,16 +3413,16 @@ function bi({
|
|
|
3200
3413
|
}
|
|
3201
3414
|
);
|
|
3202
3415
|
}
|
|
3203
|
-
function
|
|
3204
|
-
var
|
|
3205
|
-
const t = ((
|
|
3416
|
+
function ls(e) {
|
|
3417
|
+
var c;
|
|
3418
|
+
const t = ((c = e.askUserMessageId) == null ? void 0 : c.trim()) ?? "", n = j(() => Bo(), []), [r, o] = R(!1), i = A(null), s = $((m) => {
|
|
3206
3419
|
o(m);
|
|
3207
3420
|
}, []), a = $(
|
|
3208
3421
|
(m) => {
|
|
3209
3422
|
i.current = m;
|
|
3210
3423
|
},
|
|
3211
3424
|
[]
|
|
3212
|
-
), l =
|
|
3425
|
+
), l = j(() => !n || !t ? null : new Ri({
|
|
3213
3426
|
url: n,
|
|
3214
3427
|
askUserMessageId: t,
|
|
3215
3428
|
onAutoControl: (m) => {
|
|
@@ -3217,78 +3430,78 @@ function qi(e) {
|
|
|
3217
3430
|
(d = i.current) == null || d.call(i, m);
|
|
3218
3431
|
}
|
|
3219
3432
|
}), [n, t]);
|
|
3220
|
-
return
|
|
3433
|
+
return z(() => {
|
|
3221
3434
|
if (l)
|
|
3222
3435
|
return () => {
|
|
3223
3436
|
l.close();
|
|
3224
3437
|
};
|
|
3225
|
-
}, [l]),
|
|
3438
|
+
}, [l]), z(() => {
|
|
3226
3439
|
!l || !r || l.connect();
|
|
3227
|
-
}, [l, r]), /* @__PURE__ */
|
|
3228
|
-
|
|
3440
|
+
}, [l, r]), /* @__PURE__ */ u(ge, { children: /* @__PURE__ */ u(Rr, { client: l, children: /* @__PURE__ */ u(Nr, { children: /* @__PURE__ */ u(
|
|
3441
|
+
Di,
|
|
3229
3442
|
{
|
|
3230
3443
|
...e,
|
|
3231
3444
|
onSurfaceReadyChange: s,
|
|
3232
3445
|
onAutoControlReady: a
|
|
3233
3446
|
}
|
|
3234
|
-
) }) });
|
|
3447
|
+
) }) }) });
|
|
3235
3448
|
}
|
|
3236
3449
|
export {
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3243
|
-
|
|
3244
|
-
|
|
3245
|
-
|
|
3246
|
-
|
|
3247
|
-
|
|
3248
|
-
|
|
3249
|
-
|
|
3250
|
-
|
|
3251
|
-
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3450
|
+
ns as A2UI_PROTOCOL_VERSION,
|
|
3451
|
+
ls as AskUserFormCard,
|
|
3452
|
+
st as CaseSearchProvider,
|
|
3453
|
+
Vi as CurlSubmitBlock,
|
|
3454
|
+
zo as DEFAULT_ANSWER_AGENT_CALLBACK_URL,
|
|
3455
|
+
wo as DEFAULT_AUTH_ANSWER_AGENT_CALLBACK_URL_FIELD,
|
|
3456
|
+
Po as DEFAULT_AUTH_REALTIME_WS_URL_FIELD,
|
|
3457
|
+
bt as DEFAULT_AUTH_STORAGE_KEY,
|
|
3458
|
+
Ro as DEFAULT_AUTH_TOKEN_FIELD,
|
|
3459
|
+
Yn as FORM_MEDIA_SIZES,
|
|
3460
|
+
at as ResumeSearchProvider,
|
|
3461
|
+
as as SkoponA2uiStreamRenderer,
|
|
3462
|
+
ge as SkoponFormProvider,
|
|
3463
|
+
Ii as SkoponFormRenderer,
|
|
3464
|
+
yo as a2uiToBlocks,
|
|
3465
|
+
pn as blocksToA2ui,
|
|
3466
|
+
Tt as buildAnswerAgentBody,
|
|
3467
|
+
Eo as buildAskUserCurlBodyJson,
|
|
3468
|
+
Uo as buildAskUserCurlStatement,
|
|
3469
|
+
rs as buildAskUserSubmitCurlFromPayload,
|
|
3470
|
+
bo as buildAskUserSurface,
|
|
3471
|
+
yn as buildCurlStatement,
|
|
3472
|
+
os as copyTextToClipboard,
|
|
3473
|
+
Qo as createCaseSearchClient,
|
|
3474
|
+
Lo as createFormClient,
|
|
3475
|
+
Go as createResumeSearchClient,
|
|
3476
|
+
ss as createSkoponSdkClients,
|
|
3477
|
+
yt as extractExtraBlockValues,
|
|
3478
|
+
Co as extractSurfaceValues,
|
|
3479
|
+
kn as formatAnswerAgentSubmitMessage,
|
|
3480
|
+
Fo as getPayloadInputFieldNames,
|
|
3481
|
+
No as getPayloadRenderableBlocks,
|
|
3482
|
+
xo as intersectPayloadBlocksWithForm,
|
|
3483
|
+
ut as isA2uiSurfaceEmpty,
|
|
3484
|
+
ae as isInputBlockType,
|
|
3485
|
+
Oe as isLayoutBlockType,
|
|
3486
|
+
Ue as isMediaBlockType,
|
|
3487
|
+
ko as mapFormDefinitionFromDto,
|
|
3488
|
+
ue as normalizeFormDefinition,
|
|
3489
|
+
Be as parsePayloadBlocksJson,
|
|
3490
|
+
Mo as payloadHasInputBlocks,
|
|
3491
|
+
qo as resolveAnswerAgentCallbackUrl,
|
|
3492
|
+
_t as resolveClientHeaders,
|
|
3493
|
+
Bo as resolveRealtimeWsUrl,
|
|
3494
|
+
Sn as resolveSkoponAuthHeaders,
|
|
3495
|
+
At as resolveSubmitAuthHeaders,
|
|
3496
|
+
So as resolveSurfaceFromFormDefinition,
|
|
3497
|
+
xi as skoponAntdTheme,
|
|
3498
|
+
oe as skoponBrandColors,
|
|
3499
|
+
Cn as submitAnswerAgent,
|
|
3500
|
+
vn as submitFormJson,
|
|
3501
|
+
vo as surfaceDocToMessages,
|
|
3502
|
+
Re as syncFormDefinition,
|
|
3503
|
+
zr as useCaseSearch,
|
|
3504
|
+
Hr as useResumeSearch,
|
|
3505
|
+
xt as validateAnswerAgentBody,
|
|
3506
|
+
is as validateAnswerAgentContext
|
|
3294
3507
|
};
|