@agentprismform/render-vue 0.0.0-stage → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.mjs +2632 -0
- package/dist/style.css +1 -0
- package/package.json +38 -4
- package/src/components/FormGroup.vue +50 -0
- package/src/components/FormItem.vue +171 -0
- package/src/components/FormRender.vue +127 -0
- package/src/components/controls/AddressControl.vue +255 -0
- package/src/components/controls/AgreementControl.vue +49 -0
- package/src/components/controls/CascaderControl.vue +159 -0
- package/src/components/controls/DateControl.vue +96 -0
- package/src/components/controls/ImageUploadControl.vue +135 -0
- package/src/components/controls/InputControl.vue +80 -0
- package/src/components/controls/ListControl.vue +149 -0
- package/src/components/controls/SearchControl.vue +193 -0
- package/src/components/controls/SelectControl.vue +206 -0
- package/src/components/controls/SliderControl.vue +61 -0
- package/src/components/controls/TaskControl.vue +39 -0
- package/src/components/controls/VerifyCodeControl.vue +135 -0
- package/src/components/controls/task/ApiTask.vue +99 -0
- package/src/components/controls/task/CustomerTask.vue +91 -0
- package/src/components/controls/task/H5JumpTask.vue +125 -0
- package/src/components/controls/task/InlineTask.vue +116 -0
- package/src/components/controls/task/NativeTask.vue +299 -0
- package/src/components/controls/task/SubFormTask.vue +156 -0
- package/src/composables/useFormRender.ts +63 -0
- package/src/composables/useTaskHandler.ts +11 -0
- package/src/helpers.ts +143 -0
- package/src/index.ts +5 -0
- package/src/taskHandlers.ts +4 -0
- package/README.md +0 -3
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,2632 @@
|
|
|
1
|
+
import { defineComponent as L, ref as D, watch as G, computed as C, openBlock as s, createElementBlock as r, createCommentVNode as I, createElementVNode as l, normalizeClass as R, toDisplayString as A, createVNode as X, Transition as Q, withCtx as Z, withModifiers as W, Fragment as B, renderList as U, createBlock as J, Teleport as re, normalizeStyle as oe, createTextVNode as Y, withDirectives as ce, vModelText as ue, useCssVars as de, nextTick as ve, resolveDynamicComponent as ee, inject as q, onBeforeUnmount as fe, unref as te, provide as z, renderSlot as me, reactive as pe, getCurrentInstance as he, onUnmounted as ge } from "vue";
|
|
2
|
+
import { FORM_UI_HOST_HANDLERS_KEY as ae } from "@agentprismform/render-ui";
|
|
3
|
+
import { resolveLabelPosition as ye, createFormRenderState as ke } from "@agentprismform/render";
|
|
4
|
+
import { completeTask as K, getTaskHandlers as be, classifyTask as Ce, resolveTaskByKey as se } from "@agentprismform/render-task";
|
|
5
|
+
import { setTaskHandlers as ba } from "@agentprismform/render-task";
|
|
6
|
+
const _e = { class: "ctrl-input-wrapper" }, $e = ["value", "placeholder", "disabled", "maxlength"], Te = ["type", "value", "placeholder", "disabled", "maxlength"], we = /* @__PURE__ */ L({
|
|
7
|
+
__name: "InputControl",
|
|
8
|
+
props: {
|
|
9
|
+
item: {},
|
|
10
|
+
field: {},
|
|
11
|
+
formCore: {}
|
|
12
|
+
},
|
|
13
|
+
emits: ["change"],
|
|
14
|
+
setup(t, { emit: n }) {
|
|
15
|
+
var g;
|
|
16
|
+
const e = t, y = n, u = D(((g = e.field) == null ? void 0 : g.value) || "");
|
|
17
|
+
G(() => {
|
|
18
|
+
var a;
|
|
19
|
+
return (a = e.field) == null ? void 0 : a.value;
|
|
20
|
+
}, (a) => {
|
|
21
|
+
u.value = a || "";
|
|
22
|
+
});
|
|
23
|
+
const m = C(() => e.item.type === "textarea");
|
|
24
|
+
function p(a) {
|
|
25
|
+
const o = a.target;
|
|
26
|
+
u.value = o.value;
|
|
27
|
+
}
|
|
28
|
+
function f(a) {
|
|
29
|
+
var h;
|
|
30
|
+
const i = ((h = a.target.value) == null ? void 0 : h.trim()) || "";
|
|
31
|
+
u.value = i, y("change", { value: i, eventType: "inputBlur" });
|
|
32
|
+
}
|
|
33
|
+
return (a, o) => {
|
|
34
|
+
var i, h, V, v, b;
|
|
35
|
+
return s(), r("div", _e, [
|
|
36
|
+
m.value ? (s(), r("textarea", {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "ctrl-input ctrl-textarea",
|
|
39
|
+
value: u.value,
|
|
40
|
+
placeholder: t.item.placeholder || "请输入",
|
|
41
|
+
disabled: (i = t.field) == null ? void 0 : i.disabled,
|
|
42
|
+
maxlength: (h = t.item.props) == null ? void 0 : h.maxlength,
|
|
43
|
+
rows: "3",
|
|
44
|
+
onInput: p,
|
|
45
|
+
onBlur: f
|
|
46
|
+
}, null, 40, $e)) : (s(), r("input", {
|
|
47
|
+
key: 1,
|
|
48
|
+
class: "ctrl-input",
|
|
49
|
+
type: t.item.type === "number" ? "number" : t.item.type === "phone" ? "tel" : "text",
|
|
50
|
+
value: u.value,
|
|
51
|
+
placeholder: t.item.placeholder || "请输入",
|
|
52
|
+
disabled: (V = t.field) == null ? void 0 : V.disabled,
|
|
53
|
+
maxlength: (v = t.item.props) == null ? void 0 : v.maxlength,
|
|
54
|
+
onInput: p,
|
|
55
|
+
onBlur: f
|
|
56
|
+
}, null, 40, Te)),
|
|
57
|
+
(b = t.item.props) != null && b.guideText ? (s(), r("span", {
|
|
58
|
+
key: 2,
|
|
59
|
+
class: "ctrl-guide",
|
|
60
|
+
onClick: o[0] || (o[0] = (w) => y("change", { eventType: "guideClick" }))
|
|
61
|
+
}, "查看示例")) : I("v-if", !0)
|
|
62
|
+
]);
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}), N = (t, n) => {
|
|
66
|
+
const e = t.__vccOpts || t;
|
|
67
|
+
for (const [y, u] of n)
|
|
68
|
+
e[y] = u;
|
|
69
|
+
return e;
|
|
70
|
+
}, xe = /* @__PURE__ */ N(we, [["__scopeId", "data-v-c8af62aa"]]), Se = { class: "ctrl-select" }, Ie = { class: "panel-header" }, Ae = { class: "panel-title" }, Ve = {
|
|
71
|
+
class: "panel-body",
|
|
72
|
+
role: "listbox"
|
|
73
|
+
}, Fe = ["aria-selected", "onClick"], De = { class: "option-text" }, Me = /* @__PURE__ */ L({
|
|
74
|
+
__name: "SelectControl",
|
|
75
|
+
props: {
|
|
76
|
+
item: {},
|
|
77
|
+
field: {},
|
|
78
|
+
formCore: {}
|
|
79
|
+
},
|
|
80
|
+
emits: ["change"],
|
|
81
|
+
setup(t, { emit: n }) {
|
|
82
|
+
const e = t, y = n, u = D(!1), m = C(() => {
|
|
83
|
+
var V, v;
|
|
84
|
+
const i = ((V = e.item) == null ? void 0 : V.initOptions) || [], h = (v = e.field) == null ? void 0 : v.value;
|
|
85
|
+
return h ? i.map((b) => {
|
|
86
|
+
var w;
|
|
87
|
+
return {
|
|
88
|
+
...b,
|
|
89
|
+
_selected: ((w = e.item.props) == null ? void 0 : w.isSingle) !== !1 ? (h == null ? void 0 : h.code) === b.code : Array.isArray(h) ? h.some((P) => P.code === b.code) : h === b.code
|
|
90
|
+
};
|
|
91
|
+
}) : i;
|
|
92
|
+
}), p = C(() => {
|
|
93
|
+
var h, V;
|
|
94
|
+
const i = (h = e.field) == null ? void 0 : h.value;
|
|
95
|
+
return i ? typeof i == "object" && i.name ? i.name : (V = e.field) != null && V.showValue ? e.field.showValue : String(i) : "";
|
|
96
|
+
}), f = C(() => {
|
|
97
|
+
var i;
|
|
98
|
+
return ((i = e.item.props) == null ? void 0 : i.dialogTitle) || "请选择";
|
|
99
|
+
});
|
|
100
|
+
function g() {
|
|
101
|
+
var i;
|
|
102
|
+
(i = e.field) != null && i.disabled || (u.value = !0);
|
|
103
|
+
}
|
|
104
|
+
function a() {
|
|
105
|
+
u.value = !1;
|
|
106
|
+
}
|
|
107
|
+
function o(i) {
|
|
108
|
+
var V;
|
|
109
|
+
((V = e.item.props) == null ? void 0 : V.isSingle) !== !1 && (y("change", { value: { code: i.code, name: i.name }, eventType: "pickChange" }), u.value = !1);
|
|
110
|
+
}
|
|
111
|
+
return (i, h) => {
|
|
112
|
+
var V;
|
|
113
|
+
return s(), r("div", Se, [
|
|
114
|
+
I(" 触发器 "),
|
|
115
|
+
l(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
class: R(["select-trigger", { disabled: (V = t.field) == null ? void 0 : V.disabled, placeholder: !p.value }]),
|
|
119
|
+
onClick: g
|
|
120
|
+
},
|
|
121
|
+
[
|
|
122
|
+
l(
|
|
123
|
+
"span",
|
|
124
|
+
null,
|
|
125
|
+
A(p.value || t.item.placeholder || "请选择"),
|
|
126
|
+
1
|
|
127
|
+
/* TEXT */
|
|
128
|
+
)
|
|
129
|
+
],
|
|
130
|
+
2
|
|
131
|
+
/* CLASS */
|
|
132
|
+
),
|
|
133
|
+
I(" 遮罩 + 底部弹窗 "),
|
|
134
|
+
X(Q, { name: "panel" }, {
|
|
135
|
+
default: Z(() => [
|
|
136
|
+
u.value ? (s(), r("div", {
|
|
137
|
+
key: 0,
|
|
138
|
+
class: "select-overlay",
|
|
139
|
+
onClick: a
|
|
140
|
+
}, [
|
|
141
|
+
l("div", {
|
|
142
|
+
class: "select-panel",
|
|
143
|
+
role: "dialog",
|
|
144
|
+
"aria-label": "选择选项",
|
|
145
|
+
onClick: h[0] || (h[0] = W(() => {
|
|
146
|
+
}, ["stop"]))
|
|
147
|
+
}, [
|
|
148
|
+
I(" 头部 "),
|
|
149
|
+
l("div", Ie, [
|
|
150
|
+
l(
|
|
151
|
+
"span",
|
|
152
|
+
Ae,
|
|
153
|
+
A(f.value),
|
|
154
|
+
1
|
|
155
|
+
/* TEXT */
|
|
156
|
+
),
|
|
157
|
+
l("button", {
|
|
158
|
+
class: "panel-close",
|
|
159
|
+
onClick: a,
|
|
160
|
+
"aria-label": "关闭"
|
|
161
|
+
}, "×")
|
|
162
|
+
]),
|
|
163
|
+
I(" 选项列表 "),
|
|
164
|
+
l("div", Ve, [
|
|
165
|
+
(s(!0), r(
|
|
166
|
+
B,
|
|
167
|
+
null,
|
|
168
|
+
U(m.value, (v) => (s(), r("div", {
|
|
169
|
+
key: v.code,
|
|
170
|
+
class: R(["option-card", { "option-selected": v._selected }]),
|
|
171
|
+
role: "option",
|
|
172
|
+
"aria-selected": v._selected,
|
|
173
|
+
onClick: (b) => o(v)
|
|
174
|
+
}, [
|
|
175
|
+
l(
|
|
176
|
+
"span",
|
|
177
|
+
De,
|
|
178
|
+
A(v.name),
|
|
179
|
+
1
|
|
180
|
+
/* TEXT */
|
|
181
|
+
),
|
|
182
|
+
l(
|
|
183
|
+
"span",
|
|
184
|
+
{
|
|
185
|
+
class: R(["option-btn", { "option-btn-selected": v._selected }])
|
|
186
|
+
},
|
|
187
|
+
A(v._selected ? "✓ 已选" : "选择"),
|
|
188
|
+
3
|
|
189
|
+
/* TEXT, CLASS */
|
|
190
|
+
)
|
|
191
|
+
], 10, Fe))),
|
|
192
|
+
128
|
|
193
|
+
/* KEYED_FRAGMENT */
|
|
194
|
+
))
|
|
195
|
+
]),
|
|
196
|
+
I(" iOS 安全区占位 "),
|
|
197
|
+
h[1] || (h[1] = l(
|
|
198
|
+
"div",
|
|
199
|
+
{ class: "safe-area-bottom" },
|
|
200
|
+
null,
|
|
201
|
+
-1
|
|
202
|
+
/* CACHED */
|
|
203
|
+
))
|
|
204
|
+
])
|
|
205
|
+
])) : I("v-if", !0)
|
|
206
|
+
]),
|
|
207
|
+
_: 1
|
|
208
|
+
/* STABLE */
|
|
209
|
+
})
|
|
210
|
+
]);
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
}), Pe = /* @__PURE__ */ N(Me, [["__scopeId", "data-v-352c2c2f"]]), Oe = { class: "ctrl-cascader" }, je = ["aria-label"], Re = { class: "panel-header" }, Le = { class: "panel-title" }, Ne = {
|
|
214
|
+
key: 0,
|
|
215
|
+
class: "panel-path"
|
|
216
|
+
}, Be = {
|
|
217
|
+
class: "panel-body",
|
|
218
|
+
role: "listbox"
|
|
219
|
+
}, Ee = ["onClick"], Ue = { class: "option-text" }, He = {
|
|
220
|
+
key: 0,
|
|
221
|
+
class: "option-arrow"
|
|
222
|
+
}, Ke = {
|
|
223
|
+
key: 0,
|
|
224
|
+
class: "option-empty"
|
|
225
|
+
}, Ge = /* @__PURE__ */ L({
|
|
226
|
+
__name: "CascaderControl",
|
|
227
|
+
props: {
|
|
228
|
+
item: {},
|
|
229
|
+
field: {},
|
|
230
|
+
formCore: {}
|
|
231
|
+
},
|
|
232
|
+
emits: ["change"],
|
|
233
|
+
setup(t, { emit: n }) {
|
|
234
|
+
const e = t, y = n, u = D(!1), m = D([]), p = C(() => {
|
|
235
|
+
var v;
|
|
236
|
+
return ((v = e.item) == null ? void 0 : v.initOptions) || [];
|
|
237
|
+
}), f = C(() => {
|
|
238
|
+
var v;
|
|
239
|
+
return m.value.length === 0 ? p.value : ((v = m.value[m.value.length - 1]) == null ? void 0 : v.child) || [];
|
|
240
|
+
}), g = C(() => {
|
|
241
|
+
var b, w;
|
|
242
|
+
const v = (b = e.field) == null ? void 0 : b.value;
|
|
243
|
+
if (!v) return "";
|
|
244
|
+
if (typeof v == "object" && v !== null) {
|
|
245
|
+
if (Array.isArray(v.pathNames)) return v.pathNames.join(" / ");
|
|
246
|
+
if (v.name) return String(v.name);
|
|
247
|
+
if (v.showValue) return String(v.showValue);
|
|
248
|
+
}
|
|
249
|
+
return (w = e.field) != null && w.showValue ? String(e.field.showValue) : String(v);
|
|
250
|
+
}), a = C(() => {
|
|
251
|
+
var v;
|
|
252
|
+
return ((v = e.item.props) == null ? void 0 : v.dialogTitle) || e.item.label || "请选择";
|
|
253
|
+
});
|
|
254
|
+
function o() {
|
|
255
|
+
var v;
|
|
256
|
+
(v = e.field) != null && v.disabled || (m.value = [], u.value = !0);
|
|
257
|
+
}
|
|
258
|
+
function i() {
|
|
259
|
+
u.value = !1;
|
|
260
|
+
}
|
|
261
|
+
function h(v) {
|
|
262
|
+
const b = [...m.value, v];
|
|
263
|
+
if (v.child && v.child.length > 0) {
|
|
264
|
+
m.value = b;
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
y("change", {
|
|
268
|
+
value: {
|
|
269
|
+
code: v.code,
|
|
270
|
+
name: v.name,
|
|
271
|
+
pathCodes: b.map((w) => w.code),
|
|
272
|
+
pathNames: b.map((w) => w.name)
|
|
273
|
+
},
|
|
274
|
+
eventType: "pickChange"
|
|
275
|
+
}), u.value = !1;
|
|
276
|
+
}
|
|
277
|
+
function V() {
|
|
278
|
+
m.value = m.value.slice(0, -1);
|
|
279
|
+
}
|
|
280
|
+
return (v, b) => {
|
|
281
|
+
var w;
|
|
282
|
+
return s(), r("div", Oe, [
|
|
283
|
+
l(
|
|
284
|
+
"div",
|
|
285
|
+
{
|
|
286
|
+
class: R(["cascader-trigger", { disabled: (w = t.field) == null ? void 0 : w.disabled, placeholder: !g.value }]),
|
|
287
|
+
onClick: o
|
|
288
|
+
},
|
|
289
|
+
[
|
|
290
|
+
l(
|
|
291
|
+
"span",
|
|
292
|
+
null,
|
|
293
|
+
A(g.value || t.item.placeholder || "请选择"),
|
|
294
|
+
1
|
|
295
|
+
/* TEXT */
|
|
296
|
+
)
|
|
297
|
+
],
|
|
298
|
+
2
|
|
299
|
+
/* CLASS */
|
|
300
|
+
),
|
|
301
|
+
X(Q, { name: "panel" }, {
|
|
302
|
+
default: Z(() => [
|
|
303
|
+
u.value ? (s(), r("div", {
|
|
304
|
+
key: 0,
|
|
305
|
+
class: "cascader-overlay",
|
|
306
|
+
onClick: i
|
|
307
|
+
}, [
|
|
308
|
+
l("div", {
|
|
309
|
+
class: "cascader-panel",
|
|
310
|
+
role: "dialog",
|
|
311
|
+
"aria-label": a.value,
|
|
312
|
+
onClick: b[0] || (b[0] = W(() => {
|
|
313
|
+
}, ["stop"]))
|
|
314
|
+
}, [
|
|
315
|
+
l("div", Re, [
|
|
316
|
+
m.value.length ? (s(), r("button", {
|
|
317
|
+
key: 0,
|
|
318
|
+
type: "button",
|
|
319
|
+
class: "panel-back",
|
|
320
|
+
"aria-label": "返回上一级",
|
|
321
|
+
onClick: V
|
|
322
|
+
}, " ‹ ")) : I("v-if", !0),
|
|
323
|
+
l(
|
|
324
|
+
"span",
|
|
325
|
+
Le,
|
|
326
|
+
A(a.value),
|
|
327
|
+
1
|
|
328
|
+
/* TEXT */
|
|
329
|
+
),
|
|
330
|
+
l("button", {
|
|
331
|
+
type: "button",
|
|
332
|
+
class: "panel-close",
|
|
333
|
+
"aria-label": "关闭",
|
|
334
|
+
onClick: i
|
|
335
|
+
}, "×")
|
|
336
|
+
]),
|
|
337
|
+
m.value.length ? (s(), r(
|
|
338
|
+
"div",
|
|
339
|
+
Ne,
|
|
340
|
+
A(m.value.map((P) => P.name).join(" / ")),
|
|
341
|
+
1
|
|
342
|
+
/* TEXT */
|
|
343
|
+
)) : I("v-if", !0),
|
|
344
|
+
l("div", Be, [
|
|
345
|
+
(s(!0), r(
|
|
346
|
+
B,
|
|
347
|
+
null,
|
|
348
|
+
U(f.value, (P) => {
|
|
349
|
+
var O;
|
|
350
|
+
return s(), r("div", {
|
|
351
|
+
key: P.code,
|
|
352
|
+
class: "option-card",
|
|
353
|
+
role: "option",
|
|
354
|
+
onClick: (c) => h(P)
|
|
355
|
+
}, [
|
|
356
|
+
l(
|
|
357
|
+
"span",
|
|
358
|
+
Ue,
|
|
359
|
+
A(P.name),
|
|
360
|
+
1
|
|
361
|
+
/* TEXT */
|
|
362
|
+
),
|
|
363
|
+
(O = P.child) != null && O.length ? (s(), r("span", He, "›")) : I("v-if", !0)
|
|
364
|
+
], 8, Ee);
|
|
365
|
+
}),
|
|
366
|
+
128
|
|
367
|
+
/* KEYED_FRAGMENT */
|
|
368
|
+
)),
|
|
369
|
+
f.value.length ? I("v-if", !0) : (s(), r("div", Ke, "暂无选项"))
|
|
370
|
+
]),
|
|
371
|
+
b[1] || (b[1] = l(
|
|
372
|
+
"div",
|
|
373
|
+
{ class: "safe-area-bottom" },
|
|
374
|
+
null,
|
|
375
|
+
-1
|
|
376
|
+
/* CACHED */
|
|
377
|
+
))
|
|
378
|
+
], 8, je)
|
|
379
|
+
])) : I("v-if", !0)
|
|
380
|
+
]),
|
|
381
|
+
_: 1
|
|
382
|
+
/* STABLE */
|
|
383
|
+
})
|
|
384
|
+
]);
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
}), ze = /* @__PURE__ */ N(Ge, [["__scopeId", "data-v-a66f7439"]]), Ye = { class: "ctrl-search" }, qe = ["value", "placeholder", "disabled"], We = {
|
|
388
|
+
key: 0,
|
|
389
|
+
class: "search-icon loading"
|
|
390
|
+
}, Je = ["onClick"], Xe = { class: "result-name" }, Qe = {
|
|
391
|
+
key: 0,
|
|
392
|
+
class: "result-code"
|
|
393
|
+
}, Ze = {
|
|
394
|
+
key: 0,
|
|
395
|
+
class: "search-hint"
|
|
396
|
+
}, et = /* @__PURE__ */ L({
|
|
397
|
+
__name: "SearchControl",
|
|
398
|
+
props: {
|
|
399
|
+
item: {},
|
|
400
|
+
field: {},
|
|
401
|
+
formCore: {}
|
|
402
|
+
},
|
|
403
|
+
emits: ["change"],
|
|
404
|
+
setup(t, { emit: n }) {
|
|
405
|
+
const e = t, y = n, u = D(""), m = D([]), p = D(!1), f = D(!1), g = D(!1), a = C(() => {
|
|
406
|
+
var c;
|
|
407
|
+
return ((c = e.item.props) == null ? void 0 : c.searchApi) || "";
|
|
408
|
+
}), o = D(null), i = D({});
|
|
409
|
+
G(() => {
|
|
410
|
+
var c;
|
|
411
|
+
return (c = e.field) == null ? void 0 : c.value;
|
|
412
|
+
}, (c) => {
|
|
413
|
+
g.value || (c && typeof c == "object" && c.name ? u.value = c.name : typeof c == "string" && c ? u.value = c : u.value = "");
|
|
414
|
+
}, { immediate: !0 }), C(() => {
|
|
415
|
+
var k, M;
|
|
416
|
+
const c = (k = e.field) == null ? void 0 : k.value;
|
|
417
|
+
return c ? typeof c == "object" && c.name ? c.name : (M = e.field) != null && M.showValue ? e.field.showValue : String(c) : "";
|
|
418
|
+
});
|
|
419
|
+
function h() {
|
|
420
|
+
if (!o.value) return;
|
|
421
|
+
const c = o.value.getBoundingClientRect();
|
|
422
|
+
i.value = {
|
|
423
|
+
position: "fixed",
|
|
424
|
+
top: `${c.bottom + 2}px`,
|
|
425
|
+
left: `${c.left}px`,
|
|
426
|
+
width: `${c.width}px`
|
|
427
|
+
};
|
|
428
|
+
}
|
|
429
|
+
let V = null;
|
|
430
|
+
function v(c) {
|
|
431
|
+
const k = c.target;
|
|
432
|
+
u.value = k.value, g.value = !0, V && clearTimeout(V), V = setTimeout(() => {
|
|
433
|
+
u.value.trim() ? b(u.value.trim()) : (m.value = [], p.value = !1);
|
|
434
|
+
}, 200);
|
|
435
|
+
}
|
|
436
|
+
async function b(c) {
|
|
437
|
+
if (a.value) {
|
|
438
|
+
f.value = !0;
|
|
439
|
+
try {
|
|
440
|
+
const k = await e.formCore.fetchApi(a.value, { keywords: c }), M = Array.isArray(k) ? k : (k == null ? void 0 : k.data) || (k == null ? void 0 : k.list) || [];
|
|
441
|
+
m.value = M, M.length > 0 && (h(), p.value = !0);
|
|
442
|
+
} catch {
|
|
443
|
+
m.value = [], p.value = !1;
|
|
444
|
+
} finally {
|
|
445
|
+
f.value = !1;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
function w(c) {
|
|
450
|
+
y("change", { value: c.name, eventType: "searchChange" }), u.value = c.name, g.value = !1, p.value = !1;
|
|
451
|
+
}
|
|
452
|
+
function P() {
|
|
453
|
+
m.value.length > 0 && u.value && (h(), p.value = !0);
|
|
454
|
+
}
|
|
455
|
+
function O() {
|
|
456
|
+
p.value = !1, m.value = [], g.value && y("change", { value: u.value.trim(), eventType: "inputBlur" }), g.value = !1;
|
|
457
|
+
}
|
|
458
|
+
return (c, k) => {
|
|
459
|
+
var M;
|
|
460
|
+
return s(), r("div", Ye, [
|
|
461
|
+
l(
|
|
462
|
+
"div",
|
|
463
|
+
{
|
|
464
|
+
ref_key: "wrapRef",
|
|
465
|
+
ref: o,
|
|
466
|
+
class: "search-input-wrap"
|
|
467
|
+
},
|
|
468
|
+
[
|
|
469
|
+
l("input", {
|
|
470
|
+
class: "search-input",
|
|
471
|
+
type: "text",
|
|
472
|
+
value: u.value,
|
|
473
|
+
placeholder: t.item.placeholder || "请输入关键词搜索",
|
|
474
|
+
disabled: (M = t.field) == null ? void 0 : M.disabled,
|
|
475
|
+
onInput: v,
|
|
476
|
+
onFocus: P,
|
|
477
|
+
onBlur: O
|
|
478
|
+
}, null, 40, qe),
|
|
479
|
+
f.value ? (s(), r("span", We, "⏳")) : I("v-if", !0)
|
|
480
|
+
],
|
|
481
|
+
512
|
|
482
|
+
/* NEED_PATCH */
|
|
483
|
+
),
|
|
484
|
+
I(" 下拉结果列表 — Teleport 到 body,fixed 定位避免被父容器裁剪 "),
|
|
485
|
+
(s(), J(re, { to: "body" }, [
|
|
486
|
+
p.value && m.value.length > 0 ? (s(), r(
|
|
487
|
+
"div",
|
|
488
|
+
{
|
|
489
|
+
key: 0,
|
|
490
|
+
class: "search-dropdown",
|
|
491
|
+
style: oe(i.value)
|
|
492
|
+
},
|
|
493
|
+
[
|
|
494
|
+
(s(!0), r(
|
|
495
|
+
B,
|
|
496
|
+
null,
|
|
497
|
+
U(m.value, (d) => (s(), r("div", {
|
|
498
|
+
key: d.code,
|
|
499
|
+
class: "search-result-item",
|
|
500
|
+
onMousedown: k[0] || (k[0] = W(() => {
|
|
501
|
+
}, ["prevent"])),
|
|
502
|
+
onClick: (T) => w(d)
|
|
503
|
+
}, [
|
|
504
|
+
l(
|
|
505
|
+
"span",
|
|
506
|
+
Xe,
|
|
507
|
+
A(d.name),
|
|
508
|
+
1
|
|
509
|
+
/* TEXT */
|
|
510
|
+
),
|
|
511
|
+
d.code ? (s(), r(
|
|
512
|
+
"span",
|
|
513
|
+
Qe,
|
|
514
|
+
A(d.code),
|
|
515
|
+
1
|
|
516
|
+
/* TEXT */
|
|
517
|
+
)) : I("v-if", !0)
|
|
518
|
+
], 40, Je))),
|
|
519
|
+
128
|
|
520
|
+
/* KEYED_FRAGMENT */
|
|
521
|
+
))
|
|
522
|
+
],
|
|
523
|
+
4
|
|
524
|
+
/* STYLE */
|
|
525
|
+
)) : I("v-if", !0)
|
|
526
|
+
])),
|
|
527
|
+
a.value ? I("v-if", !0) : (s(), r("div", Ze, " ⚠ 未配置 searchApi "))
|
|
528
|
+
]);
|
|
529
|
+
};
|
|
530
|
+
}
|
|
531
|
+
}), tt = /* @__PURE__ */ N(et, [["__scopeId", "data-v-1e915735"]]), lt = { class: "ctrl-address" }, at = { class: "addr-hd" }, nt = { class: "addr-crumbs" }, ot = ["onClick"], st = { class: "addr-body" }, it = {
|
|
532
|
+
key: 0,
|
|
533
|
+
class: "addr-loading"
|
|
534
|
+
}, rt = ["onClick"], ct = {
|
|
535
|
+
key: 0,
|
|
536
|
+
class: "addr-check"
|
|
537
|
+
}, ut = {
|
|
538
|
+
key: 1,
|
|
539
|
+
class: "addr-empty"
|
|
540
|
+
}, dt = /* @__PURE__ */ L({
|
|
541
|
+
__name: "AddressControl",
|
|
542
|
+
props: {
|
|
543
|
+
item: {},
|
|
544
|
+
field: {},
|
|
545
|
+
formCore: {},
|
|
546
|
+
onFetchLinkage: {}
|
|
547
|
+
},
|
|
548
|
+
emits: ["change"],
|
|
549
|
+
setup(t, { emit: n }) {
|
|
550
|
+
const e = t, y = n, u = C(() => {
|
|
551
|
+
var d, T;
|
|
552
|
+
return ((T = (d = e.item) == null ? void 0 : d.props) == null ? void 0 : T.linkageUrl) || "service/geo_code";
|
|
553
|
+
}), m = C(() => {
|
|
554
|
+
var d, T;
|
|
555
|
+
return ((T = (d = e.item) == null ? void 0 : d.props) == null ? void 0 : T.mapLevel) || 3;
|
|
556
|
+
}), p = D(!1), f = D(0), g = D(!1), a = D(!1), o = D([]), i = D([{ adcode: "", name: "请选择" }]), h = /* @__PURE__ */ new Map(), V = C(() => {
|
|
557
|
+
var T, S, $;
|
|
558
|
+
const d = (T = e.field) == null ? void 0 : T.value;
|
|
559
|
+
if (Array.isArray(d) && d.length) return d.map((F) => F.name).join("");
|
|
560
|
+
if ((S = e.field) != null && S.showValue) return e.field.showValue;
|
|
561
|
+
if (d && typeof d == "object") {
|
|
562
|
+
const F = [d.province, d.city, d.country].filter(Boolean);
|
|
563
|
+
if (F.length) return F.join("");
|
|
564
|
+
}
|
|
565
|
+
return ($ = e.field) != null && $.province ? [e.field.province, e.field.city, e.field.country].filter(Boolean).join("") : typeof d == "string" && d ? d : "";
|
|
566
|
+
}), v = C(() => i.value.slice(0, m.value));
|
|
567
|
+
function b() {
|
|
568
|
+
var d;
|
|
569
|
+
return e.onFetchLinkage ? e.onFetchLinkage : (d = e.formCore) != null && d._linkageFetcher ? e.formCore._linkageFetcher : async () => ({ data: [] });
|
|
570
|
+
}
|
|
571
|
+
async function w(d) {
|
|
572
|
+
var F, x, _;
|
|
573
|
+
g.value = !0;
|
|
574
|
+
const T = b(), S = i.value.filter((j) => j.adcode), $ = {
|
|
575
|
+
province_code: ((F = S[0]) == null ? void 0 : F.adcode) || "",
|
|
576
|
+
city_code: ((x = S[1]) == null ? void 0 : x.adcode) || "",
|
|
577
|
+
district_code: ((_ = S[2]) == null ? void 0 : _.adcode) || ""
|
|
578
|
+
};
|
|
579
|
+
try {
|
|
580
|
+
const j = await T($, u.value);
|
|
581
|
+
if (j.data === null) {
|
|
582
|
+
i.value = i.value.filter((H) => H.adcode), a.value = !0, g.value = !1, M();
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
o.value = j.data || [];
|
|
586
|
+
const E = d || $.district_code || $.city_code || $.province_code || "root";
|
|
587
|
+
o.value.length > 0 && h.set(E, o.value);
|
|
588
|
+
} catch {
|
|
589
|
+
} finally {
|
|
590
|
+
g.value = !1;
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
function P() {
|
|
594
|
+
var S, $;
|
|
595
|
+
if ((S = e.field) != null && S.disabled) return;
|
|
596
|
+
f.value = 0;
|
|
597
|
+
const d = ($ = e.field) == null ? void 0 : $.value;
|
|
598
|
+
Array.isArray(d) && d.length && d[0].code ? (i.value = d.map((F) => ({ adcode: F.code, name: F.name })), a.value = i.value.length >= 2) : (i.value = [{ adcode: "", name: "请选择" }], a.value = !1), p.value = !0;
|
|
599
|
+
const T = h.get("root");
|
|
600
|
+
T ? o.value = T : w("root");
|
|
601
|
+
}
|
|
602
|
+
function O() {
|
|
603
|
+
p.value = !1;
|
|
604
|
+
}
|
|
605
|
+
function c(d) {
|
|
606
|
+
if (g.value || !d.adcode) return;
|
|
607
|
+
const T = { 71e4: 1, 81e4: 2, 82e4: 2 }, S = [...i.value];
|
|
608
|
+
d.brother = o.value, S[f.value] = d;
|
|
609
|
+
const $ = T[d.adcode];
|
|
610
|
+
if ($ !== void 0) {
|
|
611
|
+
S.splice($, S.length - $), i.value = S.filter((_) => _.adcode), a.value = !0, M();
|
|
612
|
+
return;
|
|
613
|
+
}
|
|
614
|
+
if (f.value < m.value - 1 && (S[f.value + 1] = { adcode: "", name: "" }, S.splice(f.value + 2)), f.value += 1, i.value = S.slice(0, m.value), S.filter((_) => _.adcode).length >= m.value) {
|
|
615
|
+
a.value = !0, M();
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
const x = h.get(d.adcode);
|
|
619
|
+
x ? o.value = x : w(d.adcode);
|
|
620
|
+
}
|
|
621
|
+
function k(d) {
|
|
622
|
+
var $;
|
|
623
|
+
f.value = d, a.value = !1;
|
|
624
|
+
const T = i.value.slice(0, d + 1);
|
|
625
|
+
T[d].adcode || (T[d] = { adcode: "", name: "请选择" }), i.value = T;
|
|
626
|
+
const S = i.value[d];
|
|
627
|
+
if (S.adcode && S.brother)
|
|
628
|
+
o.value = S.brother;
|
|
629
|
+
else {
|
|
630
|
+
const F = d > 0 ? ($ = i.value[d - 1]) == null ? void 0 : $.adcode : "root", x = h.get(F);
|
|
631
|
+
x ? o.value = x : w(F);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
function M() {
|
|
635
|
+
const d = i.value.filter(($) => $.adcode);
|
|
636
|
+
if (d.length === 0) return;
|
|
637
|
+
const T = d.map(($) => ({ code: $.adcode, name: $.name })), S = { showValue: "" };
|
|
638
|
+
T.forEach(($, F) => {
|
|
639
|
+
S.showValue += $.name, F === 0 && (S.province_code = $.code, S.province = $.name), F === 1 && (S.city_code = $.code, S.city = $.name), F === 2 && (S.country_code = $.code, S.country = $.name);
|
|
640
|
+
}), y("change", { value: T, eventType: "pickChange", ...S }), p.value = !1;
|
|
641
|
+
}
|
|
642
|
+
return G(() => {
|
|
643
|
+
var d;
|
|
644
|
+
return (d = e.field) == null ? void 0 : d.value;
|
|
645
|
+
}, (d) => {
|
|
646
|
+
!p.value && Array.isArray(d) && d.length && (i.value = d.map((T) => ({ adcode: T.code, name: T.name })));
|
|
647
|
+
}), (d, T) => {
|
|
648
|
+
var S;
|
|
649
|
+
return s(), r("div", lt, [
|
|
650
|
+
l(
|
|
651
|
+
"div",
|
|
652
|
+
{
|
|
653
|
+
class: R(["address-trigger", { disabled: (S = t.field) == null ? void 0 : S.disabled, placeholder: !V.value }]),
|
|
654
|
+
onClick: P
|
|
655
|
+
},
|
|
656
|
+
[
|
|
657
|
+
l(
|
|
658
|
+
"span",
|
|
659
|
+
null,
|
|
660
|
+
A(V.value || t.item.placeholder || "请选择省市区"),
|
|
661
|
+
1
|
|
662
|
+
/* TEXT */
|
|
663
|
+
)
|
|
664
|
+
],
|
|
665
|
+
2
|
|
666
|
+
/* CLASS */
|
|
667
|
+
),
|
|
668
|
+
X(Q, { name: "addr-fade" }, {
|
|
669
|
+
default: Z(() => [
|
|
670
|
+
p.value ? (s(), r("div", {
|
|
671
|
+
key: 0,
|
|
672
|
+
class: "addr-mask",
|
|
673
|
+
onClick: O
|
|
674
|
+
}, [
|
|
675
|
+
X(Q, { name: "addr-slide" }, {
|
|
676
|
+
default: Z(() => [
|
|
677
|
+
p.value ? (s(), r("div", {
|
|
678
|
+
key: 0,
|
|
679
|
+
class: "addr-panel",
|
|
680
|
+
onClick: T[1] || (T[1] = W(() => {
|
|
681
|
+
}, ["stop"]))
|
|
682
|
+
}, [
|
|
683
|
+
l("div", at, [
|
|
684
|
+
l("span", {
|
|
685
|
+
class: "addr-hd-cancel",
|
|
686
|
+
onClick: O
|
|
687
|
+
}, "取消"),
|
|
688
|
+
T[2] || (T[2] = l(
|
|
689
|
+
"span",
|
|
690
|
+
{ class: "addr-hd-title" },
|
|
691
|
+
"选择地址",
|
|
692
|
+
-1
|
|
693
|
+
/* CACHED */
|
|
694
|
+
)),
|
|
695
|
+
l(
|
|
696
|
+
"span",
|
|
697
|
+
{
|
|
698
|
+
class: R(["addr-hd-ok", { on: a.value }]),
|
|
699
|
+
onClick: T[0] || (T[0] = ($) => a.value ? M() : null)
|
|
700
|
+
},
|
|
701
|
+
"确定",
|
|
702
|
+
2
|
|
703
|
+
/* CLASS */
|
|
704
|
+
)
|
|
705
|
+
]),
|
|
706
|
+
l("div", nt, [
|
|
707
|
+
(s(!0), r(
|
|
708
|
+
B,
|
|
709
|
+
null,
|
|
710
|
+
U(v.value, ($, F) => (s(), r(
|
|
711
|
+
B,
|
|
712
|
+
{ key: F },
|
|
713
|
+
[
|
|
714
|
+
l(
|
|
715
|
+
"span",
|
|
716
|
+
{
|
|
717
|
+
class: R(["addr-dot", { cur: F === f.value, done: !!$.adcode && F < f.value }])
|
|
718
|
+
},
|
|
719
|
+
null,
|
|
720
|
+
2
|
|
721
|
+
/* CLASS */
|
|
722
|
+
),
|
|
723
|
+
l("span", {
|
|
724
|
+
class: R(["addr-label", { cur: F === f.value, done: !!$.adcode }]),
|
|
725
|
+
onClick: (x) => $.adcode ? k(F) : null
|
|
726
|
+
}, A($.adcode ? $.name : "请选择"), 11, ot),
|
|
727
|
+
F < v.value.length - 1 ? (s(), r(
|
|
728
|
+
"span",
|
|
729
|
+
{
|
|
730
|
+
key: 0,
|
|
731
|
+
class: R(["addr-line", { done: !!$.adcode && F < f.value }])
|
|
732
|
+
},
|
|
733
|
+
null,
|
|
734
|
+
2
|
|
735
|
+
/* CLASS */
|
|
736
|
+
)) : I("v-if", !0)
|
|
737
|
+
],
|
|
738
|
+
64
|
|
739
|
+
/* STABLE_FRAGMENT */
|
|
740
|
+
))),
|
|
741
|
+
128
|
|
742
|
+
/* KEYED_FRAGMENT */
|
|
743
|
+
))
|
|
744
|
+
]),
|
|
745
|
+
l("div", st, [
|
|
746
|
+
g.value ? (s(), r("div", it, [...T[3] || (T[3] = [
|
|
747
|
+
l(
|
|
748
|
+
"span",
|
|
749
|
+
{ class: "addr-spinner" },
|
|
750
|
+
null,
|
|
751
|
+
-1
|
|
752
|
+
/* CACHED */
|
|
753
|
+
),
|
|
754
|
+
Y(
|
|
755
|
+
"加载中...",
|
|
756
|
+
-1
|
|
757
|
+
/* CACHED */
|
|
758
|
+
)
|
|
759
|
+
])])) : I("v-if", !0),
|
|
760
|
+
(s(!0), r(
|
|
761
|
+
B,
|
|
762
|
+
null,
|
|
763
|
+
U(o.value, ($) => {
|
|
764
|
+
var F, x;
|
|
765
|
+
return s(), r("div", {
|
|
766
|
+
key: $.adcode,
|
|
767
|
+
class: R(["addr-item", { sel: ((F = i.value[f.value]) == null ? void 0 : F.adcode) === $.adcode }]),
|
|
768
|
+
onClick: (_) => c($)
|
|
769
|
+
}, [
|
|
770
|
+
l(
|
|
771
|
+
"span",
|
|
772
|
+
null,
|
|
773
|
+
A($.name),
|
|
774
|
+
1
|
|
775
|
+
/* TEXT */
|
|
776
|
+
),
|
|
777
|
+
((x = i.value[f.value]) == null ? void 0 : x.adcode) === $.adcode ? (s(), r("span", ct, "✓")) : I("v-if", !0)
|
|
778
|
+
], 10, rt);
|
|
779
|
+
}),
|
|
780
|
+
128
|
|
781
|
+
/* KEYED_FRAGMENT */
|
|
782
|
+
)),
|
|
783
|
+
!g.value && o.value.length === 0 ? (s(), r("div", ut, "暂无数据")) : I("v-if", !0)
|
|
784
|
+
]),
|
|
785
|
+
T[4] || (T[4] = l(
|
|
786
|
+
"div",
|
|
787
|
+
{ class: "addr-safe" },
|
|
788
|
+
null,
|
|
789
|
+
-1
|
|
790
|
+
/* CACHED */
|
|
791
|
+
))
|
|
792
|
+
])) : I("v-if", !0)
|
|
793
|
+
]),
|
|
794
|
+
_: 1
|
|
795
|
+
/* STABLE */
|
|
796
|
+
})
|
|
797
|
+
])) : I("v-if", !0)
|
|
798
|
+
]),
|
|
799
|
+
_: 1
|
|
800
|
+
/* STABLE */
|
|
801
|
+
})
|
|
802
|
+
]);
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
}), vt = /* @__PURE__ */ N(dt, [["__scopeId", "data-v-e9b83ac3"]]), ft = { class: "ctrl-agreement" }, mt = {
|
|
806
|
+
key: 0,
|
|
807
|
+
class: "check-mark"
|
|
808
|
+
}, pt = { class: "agreement-text" }, ht = /* @__PURE__ */ L({
|
|
809
|
+
__name: "AgreementControl",
|
|
810
|
+
props: {
|
|
811
|
+
item: {},
|
|
812
|
+
field: {},
|
|
813
|
+
formCore: {}
|
|
814
|
+
},
|
|
815
|
+
emits: ["change"],
|
|
816
|
+
setup(t, { emit: n }) {
|
|
817
|
+
const e = t, y = n, u = C(() => {
|
|
818
|
+
var a;
|
|
819
|
+
return ((a = e.item.props) == null ? void 0 : a.trueValue) ?? "true";
|
|
820
|
+
}), m = C(() => {
|
|
821
|
+
var a;
|
|
822
|
+
return ((a = e.item.props) == null ? void 0 : a.falseValue) ?? "";
|
|
823
|
+
}), p = C(() => {
|
|
824
|
+
var o;
|
|
825
|
+
const a = (o = e.field) == null ? void 0 : o.value;
|
|
826
|
+
return a === u.value || a === !0 || a === 1 || a === "1";
|
|
827
|
+
}), f = C(
|
|
828
|
+
() => {
|
|
829
|
+
var a;
|
|
830
|
+
return e.item.label || ((a = e.item.props) == null ? void 0 : a.guideText) || "本人已阅读并同意相关协议";
|
|
831
|
+
}
|
|
832
|
+
);
|
|
833
|
+
function g() {
|
|
834
|
+
var o;
|
|
835
|
+
if ((o = e.field) != null && o.disabled) return;
|
|
836
|
+
const a = p.value ? m.value : u.value;
|
|
837
|
+
y("change", { value: a, eventType: "pickChange" });
|
|
838
|
+
}
|
|
839
|
+
return (a, o) => {
|
|
840
|
+
var i;
|
|
841
|
+
return s(), r("div", ft, [
|
|
842
|
+
l("label", {
|
|
843
|
+
class: "agreement-row",
|
|
844
|
+
onClick: W(g, ["prevent"])
|
|
845
|
+
}, [
|
|
846
|
+
l(
|
|
847
|
+
"span",
|
|
848
|
+
{
|
|
849
|
+
class: R(["checkbox", { checked: p.value, disabled: (i = t.field) == null ? void 0 : i.disabled }])
|
|
850
|
+
},
|
|
851
|
+
[
|
|
852
|
+
p.value ? (s(), r("span", mt, "✓")) : I("v-if", !0)
|
|
853
|
+
],
|
|
854
|
+
2
|
|
855
|
+
/* CLASS */
|
|
856
|
+
),
|
|
857
|
+
l(
|
|
858
|
+
"span",
|
|
859
|
+
pt,
|
|
860
|
+
A(f.value),
|
|
861
|
+
1
|
|
862
|
+
/* TEXT */
|
|
863
|
+
)
|
|
864
|
+
])
|
|
865
|
+
]);
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
}), gt = /* @__PURE__ */ N(ht, [["__scopeId", "data-v-16bbffa8"]]), yt = { class: "task-label" }, kt = { class: "modal-card" }, bt = { class: "modal-header" }, Ct = { class: "modal-body" }, _t = ["onUpdate:modelValue", "placeholder"], $t = /* @__PURE__ */ L({
|
|
869
|
+
__name: "SubFormTask",
|
|
870
|
+
props: {
|
|
871
|
+
item: {},
|
|
872
|
+
field: {},
|
|
873
|
+
formCore: {}
|
|
874
|
+
},
|
|
875
|
+
setup(t) {
|
|
876
|
+
const n = t, e = D(!1), y = D({}), u = C(() => {
|
|
877
|
+
var h;
|
|
878
|
+
const o = (h = n.item.props) == null ? void 0 : h.taskType, i = {
|
|
879
|
+
contact_info: [
|
|
880
|
+
{ label: "联系人姓名", key: "name", placeholder: "请输入姓名" },
|
|
881
|
+
{ label: "关系", key: "relation", placeholder: "如:朋友、同事" },
|
|
882
|
+
{ label: "联系电话", key: "phone", placeholder: "请输入手机号" }
|
|
883
|
+
],
|
|
884
|
+
business_info: [
|
|
885
|
+
{ label: "企业名称", key: "company", placeholder: "请输入企业名称" },
|
|
886
|
+
{ label: "经营范围", key: "scope", placeholder: "请输入经营范围" }
|
|
887
|
+
],
|
|
888
|
+
card_info_auth: [
|
|
889
|
+
{ label: "姓名", key: "name", placeholder: "请输入姓名" },
|
|
890
|
+
{ label: "身份证号", key: "idNumber", placeholder: "请输入身份证号" }
|
|
891
|
+
],
|
|
892
|
+
default: [
|
|
893
|
+
{ label: "字段1", key: "field1", placeholder: "请输入" },
|
|
894
|
+
{ label: "字段2", key: "field2", placeholder: "请输入" }
|
|
895
|
+
]
|
|
896
|
+
};
|
|
897
|
+
return i[o] || i.default;
|
|
898
|
+
});
|
|
899
|
+
function m() {
|
|
900
|
+
y.value = {}, u.value.forEach((o) => {
|
|
901
|
+
y.value[o.key] = "";
|
|
902
|
+
}), e.value = !0;
|
|
903
|
+
}
|
|
904
|
+
function p() {
|
|
905
|
+
e.value = !1, K(n.formCore, n.item.key, {
|
|
906
|
+
...y.value,
|
|
907
|
+
_completed: !0,
|
|
908
|
+
_completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
function f() {
|
|
912
|
+
e.value = !1;
|
|
913
|
+
}
|
|
914
|
+
function g(o) {
|
|
915
|
+
o.stopPropagation(), o.target === o.currentTarget && f();
|
|
916
|
+
}
|
|
917
|
+
const a = C(() => {
|
|
918
|
+
var i;
|
|
919
|
+
const o = (i = n.field) == null ? void 0 : i.value;
|
|
920
|
+
return o && typeof o == "object" && o._completed;
|
|
921
|
+
});
|
|
922
|
+
return (o, i) => (s(), r("div", {
|
|
923
|
+
class: "task-subform",
|
|
924
|
+
onClick: m
|
|
925
|
+
}, [
|
|
926
|
+
l(
|
|
927
|
+
"div",
|
|
928
|
+
{
|
|
929
|
+
class: R(["task-trigger", { completed: a.value }])
|
|
930
|
+
},
|
|
931
|
+
[
|
|
932
|
+
i[0] || (i[0] = l(
|
|
933
|
+
"span",
|
|
934
|
+
{ class: "task-icon" },
|
|
935
|
+
"📋",
|
|
936
|
+
-1
|
|
937
|
+
/* CACHED */
|
|
938
|
+
)),
|
|
939
|
+
l(
|
|
940
|
+
"span",
|
|
941
|
+
yt,
|
|
942
|
+
A(a.value ? "✅ 已完成" : t.item.placeholder || "点击填写子表单"),
|
|
943
|
+
1
|
|
944
|
+
/* TEXT */
|
|
945
|
+
),
|
|
946
|
+
i[1] || (i[1] = l(
|
|
947
|
+
"span",
|
|
948
|
+
{ class: "task-arrow" },
|
|
949
|
+
"▸",
|
|
950
|
+
-1
|
|
951
|
+
/* CACHED */
|
|
952
|
+
))
|
|
953
|
+
],
|
|
954
|
+
2
|
|
955
|
+
/* CLASS */
|
|
956
|
+
),
|
|
957
|
+
I(" Modal "),
|
|
958
|
+
e.value ? (s(), r("div", {
|
|
959
|
+
key: 0,
|
|
960
|
+
class: "modal-overlay",
|
|
961
|
+
onClick: g
|
|
962
|
+
}, [
|
|
963
|
+
l("div", kt, [
|
|
964
|
+
l("div", bt, [
|
|
965
|
+
l(
|
|
966
|
+
"span",
|
|
967
|
+
null,
|
|
968
|
+
A(t.item.label || "子表单"),
|
|
969
|
+
1
|
|
970
|
+
/* TEXT */
|
|
971
|
+
),
|
|
972
|
+
l("button", {
|
|
973
|
+
class: "modal-close",
|
|
974
|
+
onClick: f
|
|
975
|
+
}, "✕")
|
|
976
|
+
]),
|
|
977
|
+
l("div", Ct, [
|
|
978
|
+
(s(!0), r(
|
|
979
|
+
B,
|
|
980
|
+
null,
|
|
981
|
+
U(u.value, (h) => (s(), r("div", {
|
|
982
|
+
key: h.key,
|
|
983
|
+
class: "modal-field"
|
|
984
|
+
}, [
|
|
985
|
+
l(
|
|
986
|
+
"label",
|
|
987
|
+
null,
|
|
988
|
+
A(h.label),
|
|
989
|
+
1
|
|
990
|
+
/* TEXT */
|
|
991
|
+
),
|
|
992
|
+
ce(l("input", {
|
|
993
|
+
"onUpdate:modelValue": (V) => y.value[h.key] = V,
|
|
994
|
+
placeholder: h.placeholder,
|
|
995
|
+
class: "modal-input"
|
|
996
|
+
}, null, 8, _t), [
|
|
997
|
+
[ue, y.value[h.key]]
|
|
998
|
+
])
|
|
999
|
+
]))),
|
|
1000
|
+
128
|
|
1001
|
+
/* KEYED_FRAGMENT */
|
|
1002
|
+
))
|
|
1003
|
+
]),
|
|
1004
|
+
l("div", { class: "modal-footer" }, [
|
|
1005
|
+
l("button", {
|
|
1006
|
+
class: "btn-cancel",
|
|
1007
|
+
onClick: f
|
|
1008
|
+
}, "取消"),
|
|
1009
|
+
l("button", {
|
|
1010
|
+
class: "btn-confirm",
|
|
1011
|
+
onClick: p
|
|
1012
|
+
}, "确认")
|
|
1013
|
+
])
|
|
1014
|
+
])
|
|
1015
|
+
])) : I("v-if", !0)
|
|
1016
|
+
]));
|
|
1017
|
+
}
|
|
1018
|
+
}), ne = /* @__PURE__ */ N($t, [["__scopeId", "data-v-f15e7819"]]), Tt = { class: "task-label" }, wt = { class: "confirm-card" }, xt = { class: "confirm-url" }, St = /* @__PURE__ */ L({
|
|
1019
|
+
__name: "H5JumpTask",
|
|
1020
|
+
props: {
|
|
1021
|
+
item: {},
|
|
1022
|
+
field: {},
|
|
1023
|
+
formCore: {}
|
|
1024
|
+
},
|
|
1025
|
+
setup(t) {
|
|
1026
|
+
const n = t, e = D(!1), y = C(() => {
|
|
1027
|
+
var a, o;
|
|
1028
|
+
return ((a = n.item.props) == null ? void 0 : a.h5link) || ((o = n.item.props) == null ? void 0 : o.taxLink) || "https://example.com/task";
|
|
1029
|
+
});
|
|
1030
|
+
function u() {
|
|
1031
|
+
e.value = !0;
|
|
1032
|
+
}
|
|
1033
|
+
function m() {
|
|
1034
|
+
e.value = !1, setTimeout(() => {
|
|
1035
|
+
K(n.formCore, n.item.key, {
|
|
1036
|
+
url: y.value,
|
|
1037
|
+
_completed: !0,
|
|
1038
|
+
_completedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1039
|
+
_mock: "模拟 H5 跳转已返回"
|
|
1040
|
+
});
|
|
1041
|
+
}, 500);
|
|
1042
|
+
}
|
|
1043
|
+
function p() {
|
|
1044
|
+
e.value = !1;
|
|
1045
|
+
}
|
|
1046
|
+
function f(a, o) {
|
|
1047
|
+
a.stopPropagation(), a.target === a.currentTarget && o();
|
|
1048
|
+
}
|
|
1049
|
+
const g = C(() => {
|
|
1050
|
+
var o;
|
|
1051
|
+
const a = (o = n.field) == null ? void 0 : o.value;
|
|
1052
|
+
return a && typeof a == "object" && a._completed;
|
|
1053
|
+
});
|
|
1054
|
+
return (a, o) => (s(), r("div", {
|
|
1055
|
+
class: "task-h5",
|
|
1056
|
+
onClick: u
|
|
1057
|
+
}, [
|
|
1058
|
+
l(
|
|
1059
|
+
"div",
|
|
1060
|
+
{
|
|
1061
|
+
class: R(["task-trigger", { completed: g.value }])
|
|
1062
|
+
},
|
|
1063
|
+
[
|
|
1064
|
+
o[1] || (o[1] = l(
|
|
1065
|
+
"span",
|
|
1066
|
+
{ class: "task-icon" },
|
|
1067
|
+
"🌐",
|
|
1068
|
+
-1
|
|
1069
|
+
/* CACHED */
|
|
1070
|
+
)),
|
|
1071
|
+
l(
|
|
1072
|
+
"span",
|
|
1073
|
+
Tt,
|
|
1074
|
+
A(g.value ? "✅ 已完成" : t.item.placeholder || "点击跳转 H5 页面"),
|
|
1075
|
+
1
|
|
1076
|
+
/* TEXT */
|
|
1077
|
+
),
|
|
1078
|
+
o[2] || (o[2] = l(
|
|
1079
|
+
"span",
|
|
1080
|
+
{ class: "task-badge" },
|
|
1081
|
+
"H5",
|
|
1082
|
+
-1
|
|
1083
|
+
/* CACHED */
|
|
1084
|
+
)),
|
|
1085
|
+
o[3] || (o[3] = l(
|
|
1086
|
+
"span",
|
|
1087
|
+
{ class: "task-arrow" },
|
|
1088
|
+
"▸",
|
|
1089
|
+
-1
|
|
1090
|
+
/* CACHED */
|
|
1091
|
+
))
|
|
1092
|
+
],
|
|
1093
|
+
2
|
|
1094
|
+
/* CLASS */
|
|
1095
|
+
),
|
|
1096
|
+
I(" 确认弹窗 "),
|
|
1097
|
+
e.value ? (s(), r("div", {
|
|
1098
|
+
key: 0,
|
|
1099
|
+
class: "modal-overlay",
|
|
1100
|
+
onClick: o[0] || (o[0] = (i) => f(i, p))
|
|
1101
|
+
}, [
|
|
1102
|
+
l("div", wt, [
|
|
1103
|
+
o[4] || (o[4] = l(
|
|
1104
|
+
"div",
|
|
1105
|
+
{ class: "confirm-icon" },
|
|
1106
|
+
"🌐",
|
|
1107
|
+
-1
|
|
1108
|
+
/* CACHED */
|
|
1109
|
+
)),
|
|
1110
|
+
o[5] || (o[5] = l(
|
|
1111
|
+
"div",
|
|
1112
|
+
{ class: "confirm-title" },
|
|
1113
|
+
"即将跳转到外部页面",
|
|
1114
|
+
-1
|
|
1115
|
+
/* CACHED */
|
|
1116
|
+
)),
|
|
1117
|
+
l(
|
|
1118
|
+
"div",
|
|
1119
|
+
xt,
|
|
1120
|
+
A(y.value),
|
|
1121
|
+
1
|
|
1122
|
+
/* TEXT */
|
|
1123
|
+
),
|
|
1124
|
+
o[6] || (o[6] = l(
|
|
1125
|
+
"div",
|
|
1126
|
+
{ class: "confirm-hint" },
|
|
1127
|
+
"(Demo 模拟:实际将打开外部链接)",
|
|
1128
|
+
-1
|
|
1129
|
+
/* CACHED */
|
|
1130
|
+
)),
|
|
1131
|
+
l("div", { class: "confirm-actions" }, [
|
|
1132
|
+
l("button", {
|
|
1133
|
+
class: "btn-cancel",
|
|
1134
|
+
onClick: p
|
|
1135
|
+
}, "取消"),
|
|
1136
|
+
l("button", {
|
|
1137
|
+
class: "btn-confirm",
|
|
1138
|
+
onClick: m
|
|
1139
|
+
}, "确认跳转")
|
|
1140
|
+
])
|
|
1141
|
+
])
|
|
1142
|
+
])) : I("v-if", !0)
|
|
1143
|
+
]));
|
|
1144
|
+
}
|
|
1145
|
+
}), It = /* @__PURE__ */ N(St, [["__scopeId", "data-v-2f7717cb"]]), At = { class: "task-icon" }, Vt = { class: "task-label" }, Ft = { class: "sig-card" }, Dt = { class: "sig-header" }, Mt = { class: "sig-body" }, Pt = {
|
|
1146
|
+
key: 0,
|
|
1147
|
+
class: "sig-placeholder"
|
|
1148
|
+
}, Ot = { class: "sig-footer" }, jt = ["disabled"], Rt = { class: "map-card" }, Lt = { class: "map-header" }, Nt = { class: "native-card" }, Bt = { class: "native-icon" }, Et = { class: "native-title" }, Ut = { class: "native-desc" }, Ht = { class: "native-actions" }, Kt = /* @__PURE__ */ L({
|
|
1149
|
+
__name: "NativeTask",
|
|
1150
|
+
props: {
|
|
1151
|
+
item: {},
|
|
1152
|
+
field: {},
|
|
1153
|
+
formCore: {}
|
|
1154
|
+
},
|
|
1155
|
+
setup(t) {
|
|
1156
|
+
de((x) => ({
|
|
1157
|
+
v9ce02c4c: F.value
|
|
1158
|
+
}));
|
|
1159
|
+
const n = t, e = C(() => {
|
|
1160
|
+
var x;
|
|
1161
|
+
return ((x = n.item.props) == null ? void 0 : x.taskType) || "";
|
|
1162
|
+
}), y = D(!1), u = D(null), m = D(!1), p = D(null), f = D(!1);
|
|
1163
|
+
function g() {
|
|
1164
|
+
y.value = !0, f.value = !1, ve(() => {
|
|
1165
|
+
const x = u.value;
|
|
1166
|
+
if (!x) return;
|
|
1167
|
+
const _ = window.devicePixelRatio || 1, j = x.getBoundingClientRect();
|
|
1168
|
+
x.width = j.width * _, x.height = j.height * _;
|
|
1169
|
+
const E = x.getContext("2d");
|
|
1170
|
+
E.scale(_, _), E.strokeStyle = "#333", E.lineWidth = 3, E.lineCap = "round", E.lineJoin = "round", p.value = E;
|
|
1171
|
+
});
|
|
1172
|
+
}
|
|
1173
|
+
function a(x) {
|
|
1174
|
+
const j = u.value.getBoundingClientRect(), E = "touches" in x ? x.touches[0].clientX : x.clientX, H = "touches" in x ? x.touches[0].clientY : x.clientY;
|
|
1175
|
+
return { x: E - j.left, y: H - j.top };
|
|
1176
|
+
}
|
|
1177
|
+
function o(x) {
|
|
1178
|
+
x.preventDefault(), m.value = !0, f.value = !0;
|
|
1179
|
+
const { x: _, y: j } = a(x);
|
|
1180
|
+
p.value.beginPath(), p.value.moveTo(_, j);
|
|
1181
|
+
}
|
|
1182
|
+
function i(x) {
|
|
1183
|
+
if (x.preventDefault(), !m.value) return;
|
|
1184
|
+
const { x: _, y: j } = a(x);
|
|
1185
|
+
p.value.lineTo(_, j), p.value.stroke();
|
|
1186
|
+
}
|
|
1187
|
+
function h() {
|
|
1188
|
+
m.value = !1;
|
|
1189
|
+
}
|
|
1190
|
+
function V() {
|
|
1191
|
+
const x = u.value;
|
|
1192
|
+
p.value.clearRect(0, 0, x.width, x.height), f.value = !1;
|
|
1193
|
+
}
|
|
1194
|
+
function v() {
|
|
1195
|
+
const x = u.value.toDataURL("image/png");
|
|
1196
|
+
y.value = !1, K(n.formCore, n.item.key, {
|
|
1197
|
+
signatureDataUrl: x,
|
|
1198
|
+
_completed: !0,
|
|
1199
|
+
_completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1200
|
+
});
|
|
1201
|
+
}
|
|
1202
|
+
function b() {
|
|
1203
|
+
y.value = !1;
|
|
1204
|
+
}
|
|
1205
|
+
const w = D(!1);
|
|
1206
|
+
function P() {
|
|
1207
|
+
w.value = !0;
|
|
1208
|
+
}
|
|
1209
|
+
function O() {
|
|
1210
|
+
w.value = !1, K(n.formCore, n.item.key, {
|
|
1211
|
+
lng: 116.404 + Math.random() * 0.1,
|
|
1212
|
+
lat: 39.915 + Math.random() * 0.1,
|
|
1213
|
+
address: `模拟选点地址 ${Date.now()}`,
|
|
1214
|
+
_completed: !0,
|
|
1215
|
+
_completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1216
|
+
});
|
|
1217
|
+
}
|
|
1218
|
+
const c = D(!1);
|
|
1219
|
+
function k() {
|
|
1220
|
+
c.value = !0;
|
|
1221
|
+
}
|
|
1222
|
+
function M() {
|
|
1223
|
+
c.value = !1, K(n.formCore, n.item.key, {
|
|
1224
|
+
_completed: !0,
|
|
1225
|
+
_completedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1226
|
+
_mock: `已完成原生任务: ${e.value}`
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
function d(x, _) {
|
|
1230
|
+
x.stopPropagation(), x.target === x.currentTarget && _();
|
|
1231
|
+
}
|
|
1232
|
+
function T() {
|
|
1233
|
+
e.value === "signature" ? g() : e.value === "map" ? P() : k();
|
|
1234
|
+
}
|
|
1235
|
+
const S = C(() => {
|
|
1236
|
+
var _;
|
|
1237
|
+
const x = (_ = n.field) == null ? void 0 : _.value;
|
|
1238
|
+
return x && typeof x == "object" && x._completed;
|
|
1239
|
+
}), $ = C(() => e.value === "signature" ? "✍️" : e.value === "map" ? "📍" : "📱"), F = C(() => e.value === "signature" ? "#eb2f96" : e.value === "map" ? "#2f54eb" : "#fa8c16");
|
|
1240
|
+
return (x, _) => (s(), r("div", {
|
|
1241
|
+
class: "task-native",
|
|
1242
|
+
onClick: T
|
|
1243
|
+
}, [
|
|
1244
|
+
l(
|
|
1245
|
+
"div",
|
|
1246
|
+
{
|
|
1247
|
+
class: R(["task-trigger", { completed: S.value }])
|
|
1248
|
+
},
|
|
1249
|
+
[
|
|
1250
|
+
l(
|
|
1251
|
+
"span",
|
|
1252
|
+
At,
|
|
1253
|
+
A($.value),
|
|
1254
|
+
1
|
|
1255
|
+
/* TEXT */
|
|
1256
|
+
),
|
|
1257
|
+
l(
|
|
1258
|
+
"span",
|
|
1259
|
+
Vt,
|
|
1260
|
+
A(S.value ? "✅ 已完成" : t.item.placeholder || `点击完成${t.item.label}`),
|
|
1261
|
+
1
|
|
1262
|
+
/* TEXT */
|
|
1263
|
+
),
|
|
1264
|
+
_[4] || (_[4] = l(
|
|
1265
|
+
"span",
|
|
1266
|
+
{ class: "task-arrow" },
|
|
1267
|
+
"▸",
|
|
1268
|
+
-1
|
|
1269
|
+
/* CACHED */
|
|
1270
|
+
))
|
|
1271
|
+
],
|
|
1272
|
+
2
|
|
1273
|
+
/* CLASS */
|
|
1274
|
+
),
|
|
1275
|
+
I(" Signature Modal "),
|
|
1276
|
+
y.value ? (s(), r("div", {
|
|
1277
|
+
key: 0,
|
|
1278
|
+
class: "modal-overlay",
|
|
1279
|
+
onClick: _[0] || (_[0] = (j) => d(j, b))
|
|
1280
|
+
}, [
|
|
1281
|
+
l("div", Ft, [
|
|
1282
|
+
l("div", Dt, [
|
|
1283
|
+
l(
|
|
1284
|
+
"span",
|
|
1285
|
+
null,
|
|
1286
|
+
A(t.item.label || "手写签名"),
|
|
1287
|
+
1
|
|
1288
|
+
/* TEXT */
|
|
1289
|
+
),
|
|
1290
|
+
l("button", {
|
|
1291
|
+
class: "modal-close",
|
|
1292
|
+
onClick: b
|
|
1293
|
+
}, "✕")
|
|
1294
|
+
]),
|
|
1295
|
+
l("div", Mt, [
|
|
1296
|
+
l(
|
|
1297
|
+
"canvas",
|
|
1298
|
+
{
|
|
1299
|
+
ref_key: "canvasRef",
|
|
1300
|
+
ref: u,
|
|
1301
|
+
class: "sig-canvas",
|
|
1302
|
+
onMousedown: o,
|
|
1303
|
+
onMousemove: i,
|
|
1304
|
+
onMouseup: h,
|
|
1305
|
+
onMouseleave: h,
|
|
1306
|
+
onTouchstart: o,
|
|
1307
|
+
onTouchmove: i,
|
|
1308
|
+
onTouchend: h
|
|
1309
|
+
},
|
|
1310
|
+
null,
|
|
1311
|
+
544
|
|
1312
|
+
/* NEED_HYDRATION, NEED_PATCH */
|
|
1313
|
+
),
|
|
1314
|
+
f.value ? I("v-if", !0) : (s(), r("div", Pt, "在此处签名"))
|
|
1315
|
+
]),
|
|
1316
|
+
l("div", Ot, [
|
|
1317
|
+
l("button", {
|
|
1318
|
+
class: "btn-clear",
|
|
1319
|
+
onClick: V
|
|
1320
|
+
}, "清除"),
|
|
1321
|
+
l("button", {
|
|
1322
|
+
class: "btn-confirm-sig",
|
|
1323
|
+
onClick: v,
|
|
1324
|
+
disabled: !f.value
|
|
1325
|
+
}, "确认签名", 8, jt)
|
|
1326
|
+
])
|
|
1327
|
+
])
|
|
1328
|
+
])) : I("v-if", !0),
|
|
1329
|
+
I(" Map Modal "),
|
|
1330
|
+
w.value ? (s(), r("div", {
|
|
1331
|
+
key: 1,
|
|
1332
|
+
class: "modal-overlay",
|
|
1333
|
+
onClick: _[1] || (_[1] = (j) => d(j, O))
|
|
1334
|
+
}, [
|
|
1335
|
+
l("div", Rt, [
|
|
1336
|
+
l("div", Lt, [
|
|
1337
|
+
l(
|
|
1338
|
+
"span",
|
|
1339
|
+
null,
|
|
1340
|
+
A(t.item.label || "地图选点"),
|
|
1341
|
+
1
|
|
1342
|
+
/* TEXT */
|
|
1343
|
+
),
|
|
1344
|
+
l("button", {
|
|
1345
|
+
class: "modal-close",
|
|
1346
|
+
onClick: O
|
|
1347
|
+
}, "✕")
|
|
1348
|
+
]),
|
|
1349
|
+
_[5] || (_[5] = l(
|
|
1350
|
+
"div",
|
|
1351
|
+
{ class: "map-placeholder" },
|
|
1352
|
+
[
|
|
1353
|
+
l("span", { class: "map-pin" }, "📍"),
|
|
1354
|
+
l("p", null, "地图选点(Demo 模拟)"),
|
|
1355
|
+
l("p", { class: "map-hint" }, "点击任意位置确认选点")
|
|
1356
|
+
],
|
|
1357
|
+
-1
|
|
1358
|
+
/* CACHED */
|
|
1359
|
+
)),
|
|
1360
|
+
l("div", { class: "map-footer" }, [
|
|
1361
|
+
l("button", {
|
|
1362
|
+
class: "btn-confirm-sig",
|
|
1363
|
+
onClick: O
|
|
1364
|
+
}, "在此位置选点")
|
|
1365
|
+
])
|
|
1366
|
+
])
|
|
1367
|
+
])) : I("v-if", !0),
|
|
1368
|
+
I(" Generic Native Modal "),
|
|
1369
|
+
c.value ? (s(), r("div", {
|
|
1370
|
+
key: 2,
|
|
1371
|
+
class: "modal-overlay",
|
|
1372
|
+
onClick: _[3] || (_[3] = (j) => d(j, () => c.value = !1))
|
|
1373
|
+
}, [
|
|
1374
|
+
l("div", Nt, [
|
|
1375
|
+
l(
|
|
1376
|
+
"div",
|
|
1377
|
+
Bt,
|
|
1378
|
+
A($.value),
|
|
1379
|
+
1
|
|
1380
|
+
/* TEXT */
|
|
1381
|
+
),
|
|
1382
|
+
l(
|
|
1383
|
+
"div",
|
|
1384
|
+
Et,
|
|
1385
|
+
A(t.item.label || "原生页面任务"),
|
|
1386
|
+
1
|
|
1387
|
+
/* TEXT */
|
|
1388
|
+
),
|
|
1389
|
+
_[6] || (_[6] = l(
|
|
1390
|
+
"div",
|
|
1391
|
+
{ class: "native-hint" },
|
|
1392
|
+
"(Demo 模拟:实际将拉起原生页面)",
|
|
1393
|
+
-1
|
|
1394
|
+
/* CACHED */
|
|
1395
|
+
)),
|
|
1396
|
+
l(
|
|
1397
|
+
"div",
|
|
1398
|
+
Ut,
|
|
1399
|
+
"taskType: " + A(e.value),
|
|
1400
|
+
1
|
|
1401
|
+
/* TEXT */
|
|
1402
|
+
),
|
|
1403
|
+
l("div", Ht, [
|
|
1404
|
+
l("button", {
|
|
1405
|
+
class: "btn-cancel",
|
|
1406
|
+
onClick: _[2] || (_[2] = (j) => c.value = !1)
|
|
1407
|
+
}, "取消"),
|
|
1408
|
+
l("button", {
|
|
1409
|
+
class: "btn-confirm-sig",
|
|
1410
|
+
onClick: M
|
|
1411
|
+
}, "模拟完成")
|
|
1412
|
+
])
|
|
1413
|
+
])
|
|
1414
|
+
])) : I("v-if", !0)
|
|
1415
|
+
]));
|
|
1416
|
+
}
|
|
1417
|
+
}), le = /* @__PURE__ */ N(Kt, [["__scopeId", "data-v-d1a3f489"]]), Gt = { class: "task-icon" }, zt = { class: "task-label" }, Yt = {
|
|
1418
|
+
key: 0,
|
|
1419
|
+
class: "spinner"
|
|
1420
|
+
}, qt = {
|
|
1421
|
+
key: 1,
|
|
1422
|
+
class: "task-arrow"
|
|
1423
|
+
}, Wt = /* @__PURE__ */ L({
|
|
1424
|
+
__name: "ApiTask",
|
|
1425
|
+
props: {
|
|
1426
|
+
item: {},
|
|
1427
|
+
field: {},
|
|
1428
|
+
formCore: {}
|
|
1429
|
+
},
|
|
1430
|
+
setup(t) {
|
|
1431
|
+
const n = t, e = D(!1), y = D(""), u = C(() => {
|
|
1432
|
+
var g;
|
|
1433
|
+
return ((g = n.item.props) == null ? void 0 : g.taskType) || "";
|
|
1434
|
+
}), m = C(() => be()[u.value]);
|
|
1435
|
+
async function p() {
|
|
1436
|
+
if (!e.value) {
|
|
1437
|
+
e.value = !0, y.value = "";
|
|
1438
|
+
try {
|
|
1439
|
+
if (m.value) {
|
|
1440
|
+
const g = await m.value(n.formCore, n.item.key);
|
|
1441
|
+
e.value = !1, K(n.formCore, n.item.key, {
|
|
1442
|
+
...g,
|
|
1443
|
+
_completed: !0,
|
|
1444
|
+
_completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1445
|
+
});
|
|
1446
|
+
} else
|
|
1447
|
+
await new Promise((g) => setTimeout(g, 800)), e.value = !1, K(n.formCore, n.item.key, {
|
|
1448
|
+
code: "00",
|
|
1449
|
+
data: { id: `mock_${Date.now()}`, name: `模拟${n.item.label}结果` },
|
|
1450
|
+
_completed: !0,
|
|
1451
|
+
_completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1452
|
+
});
|
|
1453
|
+
} catch (g) {
|
|
1454
|
+
e.value = !1, y.value = (g == null ? void 0 : g.message) || "请求失败", setTimeout(() => {
|
|
1455
|
+
y.value = "";
|
|
1456
|
+
}, 3e3);
|
|
1457
|
+
}
|
|
1458
|
+
}
|
|
1459
|
+
}
|
|
1460
|
+
const f = C(() => {
|
|
1461
|
+
var a;
|
|
1462
|
+
const g = (a = n.field) == null ? void 0 : a.value;
|
|
1463
|
+
return g && typeof g == "object" && g._completed;
|
|
1464
|
+
});
|
|
1465
|
+
return (g, a) => (s(), r("div", {
|
|
1466
|
+
class: "task-api",
|
|
1467
|
+
onClick: p
|
|
1468
|
+
}, [
|
|
1469
|
+
l(
|
|
1470
|
+
"div",
|
|
1471
|
+
{
|
|
1472
|
+
class: R(["task-trigger", { completed: f.value, loading: e.value, error: !!y.value }])
|
|
1473
|
+
},
|
|
1474
|
+
[
|
|
1475
|
+
l(
|
|
1476
|
+
"span",
|
|
1477
|
+
Gt,
|
|
1478
|
+
A(e.value ? "⏳" : y.value ? "⚠️" : "🔌"),
|
|
1479
|
+
1
|
|
1480
|
+
/* TEXT */
|
|
1481
|
+
),
|
|
1482
|
+
l("span", zt, [
|
|
1483
|
+
e.value ? (s(), r(
|
|
1484
|
+
B,
|
|
1485
|
+
{ key: 0 },
|
|
1486
|
+
[
|
|
1487
|
+
Y("请求中...")
|
|
1488
|
+
],
|
|
1489
|
+
64
|
|
1490
|
+
/* STABLE_FRAGMENT */
|
|
1491
|
+
)) : y.value ? (s(), r(
|
|
1492
|
+
B,
|
|
1493
|
+
{ key: 1 },
|
|
1494
|
+
[
|
|
1495
|
+
Y(
|
|
1496
|
+
A(y.value),
|
|
1497
|
+
1
|
|
1498
|
+
/* TEXT */
|
|
1499
|
+
)
|
|
1500
|
+
],
|
|
1501
|
+
64
|
|
1502
|
+
/* STABLE_FRAGMENT */
|
|
1503
|
+
)) : f.value ? (s(), r(
|
|
1504
|
+
B,
|
|
1505
|
+
{ key: 2 },
|
|
1506
|
+
[
|
|
1507
|
+
Y("✅ 已完成")
|
|
1508
|
+
],
|
|
1509
|
+
64
|
|
1510
|
+
/* STABLE_FRAGMENT */
|
|
1511
|
+
)) : (s(), r(
|
|
1512
|
+
B,
|
|
1513
|
+
{ key: 3 },
|
|
1514
|
+
[
|
|
1515
|
+
Y(
|
|
1516
|
+
A(t.item.placeholder || `点击获取${t.item.label}`),
|
|
1517
|
+
1
|
|
1518
|
+
/* TEXT */
|
|
1519
|
+
)
|
|
1520
|
+
],
|
|
1521
|
+
64
|
|
1522
|
+
/* STABLE_FRAGMENT */
|
|
1523
|
+
))
|
|
1524
|
+
]),
|
|
1525
|
+
e.value ? (s(), r("span", Yt)) : (s(), r("span", qt, "▸"))
|
|
1526
|
+
],
|
|
1527
|
+
2
|
|
1528
|
+
/* CLASS */
|
|
1529
|
+
)
|
|
1530
|
+
]));
|
|
1531
|
+
}
|
|
1532
|
+
}), Jt = /* @__PURE__ */ N(Wt, [["__scopeId", "data-v-33fee019"]]), Xt = { class: "task-icon" }, Qt = { class: "task-label" }, Zt = {
|
|
1533
|
+
key: 0,
|
|
1534
|
+
class: "progress-bar"
|
|
1535
|
+
}, el = /* @__PURE__ */ L({
|
|
1536
|
+
__name: "CustomerTask",
|
|
1537
|
+
props: {
|
|
1538
|
+
item: {},
|
|
1539
|
+
field: {},
|
|
1540
|
+
formCore: {}
|
|
1541
|
+
},
|
|
1542
|
+
setup(t) {
|
|
1543
|
+
const n = t, e = D(!1), y = D(0), u = C(() => {
|
|
1544
|
+
var g;
|
|
1545
|
+
return ((g = n.item.props) == null ? void 0 : g.taskType) || "";
|
|
1546
|
+
});
|
|
1547
|
+
function m() {
|
|
1548
|
+
if (e.value) return;
|
|
1549
|
+
e.value = !0, y.value = 0;
|
|
1550
|
+
const g = setInterval(() => {
|
|
1551
|
+
y.value += 20, y.value >= 100 && (clearInterval(g), e.value = !1, K(n.formCore, n.item.key, {
|
|
1552
|
+
score: Math.floor(Math.random() * 30) + 70,
|
|
1553
|
+
passed: !0,
|
|
1554
|
+
_completed: !0,
|
|
1555
|
+
_completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1556
|
+
}));
|
|
1557
|
+
}, 400);
|
|
1558
|
+
}
|
|
1559
|
+
const p = C(() => {
|
|
1560
|
+
var a;
|
|
1561
|
+
const g = (a = n.field) == null ? void 0 : a.value;
|
|
1562
|
+
return g && typeof g == "object" && g._completed;
|
|
1563
|
+
}), f = C(() => u.value === "face_verify_sign" ? "👤" : "📷");
|
|
1564
|
+
return (g, a) => (s(), r("div", {
|
|
1565
|
+
class: "task-customer",
|
|
1566
|
+
onClick: m
|
|
1567
|
+
}, [
|
|
1568
|
+
l(
|
|
1569
|
+
"div",
|
|
1570
|
+
{
|
|
1571
|
+
class: R(["task-trigger", { completed: p.value, loading: e.value }])
|
|
1572
|
+
},
|
|
1573
|
+
[
|
|
1574
|
+
l(
|
|
1575
|
+
"span",
|
|
1576
|
+
Xt,
|
|
1577
|
+
A(f.value),
|
|
1578
|
+
1
|
|
1579
|
+
/* TEXT */
|
|
1580
|
+
),
|
|
1581
|
+
l(
|
|
1582
|
+
"span",
|
|
1583
|
+
Qt,
|
|
1584
|
+
A(e.value ? "检测中..." : p.value ? "✅ 已完成" : t.item.placeholder || `点击启动${t.item.label}`),
|
|
1585
|
+
1
|
|
1586
|
+
/* TEXT */
|
|
1587
|
+
),
|
|
1588
|
+
a[0] || (a[0] = l(
|
|
1589
|
+
"span",
|
|
1590
|
+
{ class: "task-badge" },
|
|
1591
|
+
"SDK",
|
|
1592
|
+
-1
|
|
1593
|
+
/* CACHED */
|
|
1594
|
+
))
|
|
1595
|
+
],
|
|
1596
|
+
2
|
|
1597
|
+
/* CLASS */
|
|
1598
|
+
),
|
|
1599
|
+
I(" Progress overlay "),
|
|
1600
|
+
e.value ? (s(), r("div", Zt, [
|
|
1601
|
+
l(
|
|
1602
|
+
"div",
|
|
1603
|
+
{
|
|
1604
|
+
class: "progress-fill",
|
|
1605
|
+
style: oe({ width: y.value + "%" })
|
|
1606
|
+
},
|
|
1607
|
+
null,
|
|
1608
|
+
4
|
|
1609
|
+
/* STYLE */
|
|
1610
|
+
)
|
|
1611
|
+
])) : I("v-if", !0)
|
|
1612
|
+
]));
|
|
1613
|
+
}
|
|
1614
|
+
}), tl = /* @__PURE__ */ N(el, [["__scopeId", "data-v-bb43982b"]]), ll = { class: "task-label" }, al = { class: "inline-card" }, nl = { class: "inline-link" }, ol = /* @__PURE__ */ L({
|
|
1615
|
+
__name: "InlineTask",
|
|
1616
|
+
props: {
|
|
1617
|
+
item: {},
|
|
1618
|
+
field: {},
|
|
1619
|
+
formCore: {}
|
|
1620
|
+
},
|
|
1621
|
+
setup(t) {
|
|
1622
|
+
const n = t, e = D(!1), y = C(() => {
|
|
1623
|
+
var a;
|
|
1624
|
+
return ((a = n.item.props) == null ? void 0 : a.taxLink) || `https://tax.example.com/copy?id=${Date.now()}`;
|
|
1625
|
+
});
|
|
1626
|
+
function u() {
|
|
1627
|
+
e.value = !0;
|
|
1628
|
+
}
|
|
1629
|
+
function m() {
|
|
1630
|
+
var a;
|
|
1631
|
+
e.value = !1, (a = navigator.clipboard) == null || a.writeText(y.value).catch(() => {
|
|
1632
|
+
}), K(n.formCore, n.item.key, {
|
|
1633
|
+
copied: !0,
|
|
1634
|
+
url: y.value,
|
|
1635
|
+
_completed: !0,
|
|
1636
|
+
_completedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
1637
|
+
});
|
|
1638
|
+
}
|
|
1639
|
+
function p() {
|
|
1640
|
+
e.value = !1;
|
|
1641
|
+
}
|
|
1642
|
+
function f(a, o) {
|
|
1643
|
+
a.stopPropagation(), a.target === a.currentTarget && o();
|
|
1644
|
+
}
|
|
1645
|
+
const g = C(() => {
|
|
1646
|
+
var o;
|
|
1647
|
+
const a = (o = n.field) == null ? void 0 : o.value;
|
|
1648
|
+
return a && typeof a == "object" && a._completed;
|
|
1649
|
+
});
|
|
1650
|
+
return (a, o) => (s(), r("div", {
|
|
1651
|
+
class: "task-inline",
|
|
1652
|
+
onClick: u
|
|
1653
|
+
}, [
|
|
1654
|
+
l(
|
|
1655
|
+
"div",
|
|
1656
|
+
{
|
|
1657
|
+
class: R(["task-trigger", { completed: g.value }])
|
|
1658
|
+
},
|
|
1659
|
+
[
|
|
1660
|
+
o[1] || (o[1] = l(
|
|
1661
|
+
"span",
|
|
1662
|
+
{ class: "task-icon" },
|
|
1663
|
+
"🔗",
|
|
1664
|
+
-1
|
|
1665
|
+
/* CACHED */
|
|
1666
|
+
)),
|
|
1667
|
+
l(
|
|
1668
|
+
"span",
|
|
1669
|
+
ll,
|
|
1670
|
+
A(g.value ? "✅ 已复制" : t.item.placeholder || "复制链接"),
|
|
1671
|
+
1
|
|
1672
|
+
/* TEXT */
|
|
1673
|
+
),
|
|
1674
|
+
o[2] || (o[2] = l(
|
|
1675
|
+
"span",
|
|
1676
|
+
{ class: "task-badge" },
|
|
1677
|
+
"inline",
|
|
1678
|
+
-1
|
|
1679
|
+
/* CACHED */
|
|
1680
|
+
))
|
|
1681
|
+
],
|
|
1682
|
+
2
|
|
1683
|
+
/* CLASS */
|
|
1684
|
+
),
|
|
1685
|
+
I(" Confirm "),
|
|
1686
|
+
e.value ? (s(), r("div", {
|
|
1687
|
+
key: 0,
|
|
1688
|
+
class: "modal-overlay",
|
|
1689
|
+
onClick: o[0] || (o[0] = (i) => f(i, p))
|
|
1690
|
+
}, [
|
|
1691
|
+
l("div", al, [
|
|
1692
|
+
o[3] || (o[3] = l(
|
|
1693
|
+
"div",
|
|
1694
|
+
{ class: "inline-icon" },
|
|
1695
|
+
"🔗",
|
|
1696
|
+
-1
|
|
1697
|
+
/* CACHED */
|
|
1698
|
+
)),
|
|
1699
|
+
o[4] || (o[4] = l(
|
|
1700
|
+
"div",
|
|
1701
|
+
{ class: "inline-title" },
|
|
1702
|
+
"复制链接",
|
|
1703
|
+
-1
|
|
1704
|
+
/* CACHED */
|
|
1705
|
+
)),
|
|
1706
|
+
l(
|
|
1707
|
+
"div",
|
|
1708
|
+
nl,
|
|
1709
|
+
A(y.value),
|
|
1710
|
+
1
|
|
1711
|
+
/* TEXT */
|
|
1712
|
+
),
|
|
1713
|
+
o[5] || (o[5] = l(
|
|
1714
|
+
"div",
|
|
1715
|
+
{ class: "inline-hint" },
|
|
1716
|
+
"(Demo 模拟:实际将复制并跳转)",
|
|
1717
|
+
-1
|
|
1718
|
+
/* CACHED */
|
|
1719
|
+
)),
|
|
1720
|
+
l("div", { class: "inline-actions" }, [
|
|
1721
|
+
l("button", {
|
|
1722
|
+
class: "btn-cancel",
|
|
1723
|
+
onClick: p
|
|
1724
|
+
}, "取消"),
|
|
1725
|
+
l("button", {
|
|
1726
|
+
class: "btn-confirm",
|
|
1727
|
+
onClick: m
|
|
1728
|
+
}, "复制并完成")
|
|
1729
|
+
])
|
|
1730
|
+
])
|
|
1731
|
+
])) : I("v-if", !0)
|
|
1732
|
+
]));
|
|
1733
|
+
}
|
|
1734
|
+
}), sl = /* @__PURE__ */ N(ol, [["__scopeId", "data-v-612f91c9"]]), il = /* @__PURE__ */ L({
|
|
1735
|
+
__name: "TaskControl",
|
|
1736
|
+
props: {
|
|
1737
|
+
item: {},
|
|
1738
|
+
field: {},
|
|
1739
|
+
formCore: {}
|
|
1740
|
+
},
|
|
1741
|
+
setup(t) {
|
|
1742
|
+
const n = t, e = C(() => {
|
|
1743
|
+
const y = Ce(n.item.props);
|
|
1744
|
+
return {
|
|
1745
|
+
subForm: ne,
|
|
1746
|
+
h5: It,
|
|
1747
|
+
signature: le,
|
|
1748
|
+
map: le,
|
|
1749
|
+
native: le,
|
|
1750
|
+
api: Jt,
|
|
1751
|
+
customer: tl,
|
|
1752
|
+
inline: sl
|
|
1753
|
+
}[y] || ne;
|
|
1754
|
+
});
|
|
1755
|
+
return (y, u) => (s(), J(ee(e.value), {
|
|
1756
|
+
item: t.item,
|
|
1757
|
+
field: t.field,
|
|
1758
|
+
formCore: t.formCore
|
|
1759
|
+
}, null, 8, ["item", "field", "formCore"]));
|
|
1760
|
+
}
|
|
1761
|
+
}), rl = { class: "list-row-head" }, cl = ["disabled", "onClick"], ul = ["value", "disabled", "onChange"], dl = { value: "" }, vl = ["value"], fl = ["type", "value", "placeholder", "disabled", "onBlur"], ml = {
|
|
1762
|
+
key: 2,
|
|
1763
|
+
class: "list-error"
|
|
1764
|
+
}, pl = {
|
|
1765
|
+
key: 0,
|
|
1766
|
+
class: "list-summary-error"
|
|
1767
|
+
}, hl = ["disabled"], gl = { class: "list-hint" }, yl = /* @__PURE__ */ L({
|
|
1768
|
+
__name: "ListControl",
|
|
1769
|
+
props: {
|
|
1770
|
+
item: {},
|
|
1771
|
+
field: {},
|
|
1772
|
+
formCore: {}
|
|
1773
|
+
},
|
|
1774
|
+
emits: ["change"],
|
|
1775
|
+
setup(t, { emit: n }) {
|
|
1776
|
+
const e = t, y = n, u = C(
|
|
1777
|
+
() => {
|
|
1778
|
+
var c;
|
|
1779
|
+
return Array.isArray((c = e.field) == null ? void 0 : c.value) ? e.field.value : [];
|
|
1780
|
+
}
|
|
1781
|
+
), m = C(() => e.item.subItems ?? []), p = C(() => {
|
|
1782
|
+
var c;
|
|
1783
|
+
return ((c = e.item.listMeta) == null ? void 0 : c.minItems) ?? 1;
|
|
1784
|
+
}), f = C(() => {
|
|
1785
|
+
var c;
|
|
1786
|
+
return (c = e.item.listMeta) == null ? void 0 : c.maxItems;
|
|
1787
|
+
}), g = C(() => f.value === void 0 || u.value.length < f.value), a = C(() => {
|
|
1788
|
+
var c;
|
|
1789
|
+
return ((c = e.item.listMeta) == null ? void 0 : c.removable) !== !1 && u.value.length > p.value;
|
|
1790
|
+
}), o = C(
|
|
1791
|
+
() => {
|
|
1792
|
+
var c;
|
|
1793
|
+
return ((c = e.field) == null ? void 0 : c.collectionErrors) ?? {};
|
|
1794
|
+
}
|
|
1795
|
+
);
|
|
1796
|
+
function i(c, k) {
|
|
1797
|
+
var M;
|
|
1798
|
+
return ((M = u.value[c]) == null ? void 0 : M[k.key]) ?? "";
|
|
1799
|
+
}
|
|
1800
|
+
function h(c) {
|
|
1801
|
+
return c && typeof c == "object" ? c.code || "" : c == null ? "" : String(c);
|
|
1802
|
+
}
|
|
1803
|
+
function V(c, k, M) {
|
|
1804
|
+
const d = u.value.map((T) => ({ ...T }));
|
|
1805
|
+
d[c] = { ...d[c] ?? {}, [k.key]: M }, y("change", { value: d, eventType: "inputBlur" });
|
|
1806
|
+
}
|
|
1807
|
+
function v(c, k, M) {
|
|
1808
|
+
const d = M.target;
|
|
1809
|
+
V(c, k, d.value.trim());
|
|
1810
|
+
}
|
|
1811
|
+
function b(c, k, M) {
|
|
1812
|
+
const d = M.target, T = (k.initOptions ?? []).find((S) => S.code === d.value);
|
|
1813
|
+
V(c, k, T ? { code: T.code, name: T.name } : "");
|
|
1814
|
+
}
|
|
1815
|
+
function w() {
|
|
1816
|
+
var c;
|
|
1817
|
+
!g.value || (c = e.field) != null && c.disabled || y("change", { value: [...u.value, {}], eventType: "inputChange" });
|
|
1818
|
+
}
|
|
1819
|
+
function P(c) {
|
|
1820
|
+
var k;
|
|
1821
|
+
!a.value || (k = e.field) != null && k.disabled || y("change", {
|
|
1822
|
+
value: u.value.filter((M, d) => d !== c),
|
|
1823
|
+
eventType: "inputChange"
|
|
1824
|
+
});
|
|
1825
|
+
}
|
|
1826
|
+
function O(c, k) {
|
|
1827
|
+
return o.value[`${e.item.key}[${c}].${k}`];
|
|
1828
|
+
}
|
|
1829
|
+
return (c, k) => {
|
|
1830
|
+
var M, d, T;
|
|
1831
|
+
return s(), r(
|
|
1832
|
+
"div",
|
|
1833
|
+
{
|
|
1834
|
+
class: R(["ctrl-list", { disabled: (M = t.field) == null ? void 0 : M.disabled }])
|
|
1835
|
+
},
|
|
1836
|
+
[
|
|
1837
|
+
(s(!0), r(
|
|
1838
|
+
B,
|
|
1839
|
+
null,
|
|
1840
|
+
U(u.value, (S, $) => {
|
|
1841
|
+
var F, x;
|
|
1842
|
+
return s(), r("article", {
|
|
1843
|
+
key: $,
|
|
1844
|
+
class: "list-row"
|
|
1845
|
+
}, [
|
|
1846
|
+
l("div", rl, [
|
|
1847
|
+
l(
|
|
1848
|
+
"strong",
|
|
1849
|
+
null,
|
|
1850
|
+
"联系人 " + A($ + 1),
|
|
1851
|
+
1
|
|
1852
|
+
/* TEXT */
|
|
1853
|
+
),
|
|
1854
|
+
((F = t.item.listMeta) == null ? void 0 : F.removable) !== !1 ? (s(), r("button", {
|
|
1855
|
+
key: 0,
|
|
1856
|
+
type: "button",
|
|
1857
|
+
class: "remove-button",
|
|
1858
|
+
disabled: !a.value || ((x = t.field) == null ? void 0 : x.disabled),
|
|
1859
|
+
onClick: (_) => P($)
|
|
1860
|
+
}, " 删除 ", 8, cl)) : I("v-if", !0)
|
|
1861
|
+
]),
|
|
1862
|
+
(s(!0), r(
|
|
1863
|
+
B,
|
|
1864
|
+
null,
|
|
1865
|
+
U(m.value, (_) => {
|
|
1866
|
+
var j, E;
|
|
1867
|
+
return s(), r("label", {
|
|
1868
|
+
key: _.key,
|
|
1869
|
+
class: "list-field"
|
|
1870
|
+
}, [
|
|
1871
|
+
l(
|
|
1872
|
+
"span",
|
|
1873
|
+
{
|
|
1874
|
+
class: R(["list-field-label", { required: _.required }])
|
|
1875
|
+
},
|
|
1876
|
+
A(_.label || _.key),
|
|
1877
|
+
3
|
|
1878
|
+
/* TEXT, CLASS */
|
|
1879
|
+
),
|
|
1880
|
+
_.type === "select" || _.type === "cascader" ? (s(), r("select", {
|
|
1881
|
+
key: 0,
|
|
1882
|
+
class: "list-input",
|
|
1883
|
+
value: h(i($, _)),
|
|
1884
|
+
disabled: ((j = t.field) == null ? void 0 : j.disabled) || _.disabled,
|
|
1885
|
+
onChange: (H) => b($, _, H)
|
|
1886
|
+
}, [
|
|
1887
|
+
l(
|
|
1888
|
+
"option",
|
|
1889
|
+
dl,
|
|
1890
|
+
A(_.placeholder || "请选择"),
|
|
1891
|
+
1
|
|
1892
|
+
/* TEXT */
|
|
1893
|
+
),
|
|
1894
|
+
(s(!0), r(
|
|
1895
|
+
B,
|
|
1896
|
+
null,
|
|
1897
|
+
U(_.initOptions || [], (H) => (s(), r("option", {
|
|
1898
|
+
key: H.code,
|
|
1899
|
+
value: H.code
|
|
1900
|
+
}, A(H.name), 9, vl))),
|
|
1901
|
+
128
|
|
1902
|
+
/* KEYED_FRAGMENT */
|
|
1903
|
+
))
|
|
1904
|
+
], 40, ul)) : (s(), r("input", {
|
|
1905
|
+
key: 1,
|
|
1906
|
+
class: "list-input",
|
|
1907
|
+
type: _.type === "number" ? "number" : _.type === "phone" ? "tel" : "text",
|
|
1908
|
+
value: i($, _),
|
|
1909
|
+
placeholder: _.placeholder || "请输入",
|
|
1910
|
+
disabled: ((E = t.field) == null ? void 0 : E.disabled) || _.disabled,
|
|
1911
|
+
onBlur: (H) => v($, _, H)
|
|
1912
|
+
}, null, 40, fl)),
|
|
1913
|
+
O($, _.key) ? (s(), r(
|
|
1914
|
+
"span",
|
|
1915
|
+
ml,
|
|
1916
|
+
A(O($, _.key)),
|
|
1917
|
+
1
|
|
1918
|
+
/* TEXT */
|
|
1919
|
+
)) : I("v-if", !0)
|
|
1920
|
+
]);
|
|
1921
|
+
}),
|
|
1922
|
+
128
|
|
1923
|
+
/* KEYED_FRAGMENT */
|
|
1924
|
+
))
|
|
1925
|
+
]);
|
|
1926
|
+
}),
|
|
1927
|
+
128
|
|
1928
|
+
/* KEYED_FRAGMENT */
|
|
1929
|
+
)),
|
|
1930
|
+
Object.keys(o.value).length ? (s(), r("p", pl, " 请修改重复或冲突的联系人手机号。 ")) : I("v-if", !0),
|
|
1931
|
+
l("button", {
|
|
1932
|
+
type: "button",
|
|
1933
|
+
class: "add-button",
|
|
1934
|
+
disabled: !g.value || ((d = t.field) == null ? void 0 : d.disabled),
|
|
1935
|
+
onClick: w
|
|
1936
|
+
}, A(((T = t.item.listMeta) == null ? void 0 : T.addButtonText) || "+ 添加联系人"), 9, hl),
|
|
1937
|
+
l(
|
|
1938
|
+
"p",
|
|
1939
|
+
gl,
|
|
1940
|
+
A(p.value) + "–" + A(f.value ?? "∞") + " 项,当前 " + A(u.value.length) + " 项",
|
|
1941
|
+
1
|
|
1942
|
+
/* TEXT */
|
|
1943
|
+
)
|
|
1944
|
+
],
|
|
1945
|
+
2
|
|
1946
|
+
/* CLASS */
|
|
1947
|
+
);
|
|
1948
|
+
};
|
|
1949
|
+
}
|
|
1950
|
+
}), kl = /* @__PURE__ */ N(yl, [["__scopeId", "data-v-e320f716"]]), bl = { class: "ctrl-date" }, Cl = ["value", "disabled", "aria-label"], _l = ["value", "disabled", "aria-label"], $l = ["value", "disabled", "aria-label"], Tl = /* @__PURE__ */ L({
|
|
1951
|
+
__name: "DateControl",
|
|
1952
|
+
props: {
|
|
1953
|
+
item: {},
|
|
1954
|
+
field: {},
|
|
1955
|
+
formCore: {}
|
|
1956
|
+
},
|
|
1957
|
+
emits: ["change"],
|
|
1958
|
+
setup(t, { emit: n }) {
|
|
1959
|
+
var h, V, v;
|
|
1960
|
+
const e = t, y = n, u = C(() => e.item.type === "dateRange"), m = D(g((h = e.field) == null ? void 0 : h.value)), p = D(a((V = e.field) == null ? void 0 : V.value)[0]), f = D(a((v = e.field) == null ? void 0 : v.value)[1]);
|
|
1961
|
+
G(
|
|
1962
|
+
() => {
|
|
1963
|
+
var b;
|
|
1964
|
+
return (b = e.field) == null ? void 0 : b.value;
|
|
1965
|
+
},
|
|
1966
|
+
(b) => {
|
|
1967
|
+
if (u.value) {
|
|
1968
|
+
const [w, P] = a(b);
|
|
1969
|
+
p.value = w, f.value = P;
|
|
1970
|
+
} else
|
|
1971
|
+
m.value = g(b);
|
|
1972
|
+
}
|
|
1973
|
+
);
|
|
1974
|
+
function g(b) {
|
|
1975
|
+
return b == null || b === "" ? "" : String(b);
|
|
1976
|
+
}
|
|
1977
|
+
function a(b) {
|
|
1978
|
+
if (Array.isArray(b)) return [String(b[0] || ""), String(b[1] || "")];
|
|
1979
|
+
if (b && typeof b == "object") {
|
|
1980
|
+
const w = b;
|
|
1981
|
+
return [String(w.start || ""), String(w.end || "")];
|
|
1982
|
+
}
|
|
1983
|
+
return ["", ""];
|
|
1984
|
+
}
|
|
1985
|
+
function o(b) {
|
|
1986
|
+
const w = b.target.value || "";
|
|
1987
|
+
m.value = w, y("change", { value: w, eventType: "pickChange" });
|
|
1988
|
+
}
|
|
1989
|
+
function i() {
|
|
1990
|
+
const b = p.value, w = f.value;
|
|
1991
|
+
y("change", { value: b || w ? [b, w] : "", eventType: "pickChange" });
|
|
1992
|
+
}
|
|
1993
|
+
return (b, w) => {
|
|
1994
|
+
var P, O, c;
|
|
1995
|
+
return s(), r("div", bl, [
|
|
1996
|
+
u.value ? (s(), r(
|
|
1997
|
+
B,
|
|
1998
|
+
{ key: 0 },
|
|
1999
|
+
[
|
|
2000
|
+
l("input", {
|
|
2001
|
+
class: "ctrl-date-input",
|
|
2002
|
+
type: "date",
|
|
2003
|
+
value: p.value,
|
|
2004
|
+
disabled: (P = t.field) == null ? void 0 : P.disabled,
|
|
2005
|
+
"aria-label": (t.item.label || "日期") + "开始",
|
|
2006
|
+
onChange: w[0] || (w[0] = (k) => {
|
|
2007
|
+
p.value = k.target.value, i();
|
|
2008
|
+
})
|
|
2009
|
+
}, null, 40, Cl),
|
|
2010
|
+
w[2] || (w[2] = l(
|
|
2011
|
+
"span",
|
|
2012
|
+
{ class: "ctrl-date-sep" },
|
|
2013
|
+
"至",
|
|
2014
|
+
-1
|
|
2015
|
+
/* CACHED */
|
|
2016
|
+
)),
|
|
2017
|
+
l("input", {
|
|
2018
|
+
class: "ctrl-date-input",
|
|
2019
|
+
type: "date",
|
|
2020
|
+
value: f.value,
|
|
2021
|
+
disabled: (O = t.field) == null ? void 0 : O.disabled,
|
|
2022
|
+
"aria-label": (t.item.label || "日期") + "结束",
|
|
2023
|
+
onChange: w[1] || (w[1] = (k) => {
|
|
2024
|
+
f.value = k.target.value, i();
|
|
2025
|
+
})
|
|
2026
|
+
}, null, 40, _l)
|
|
2027
|
+
],
|
|
2028
|
+
64
|
|
2029
|
+
/* STABLE_FRAGMENT */
|
|
2030
|
+
)) : (s(), r("input", {
|
|
2031
|
+
key: 1,
|
|
2032
|
+
class: "ctrl-date-input",
|
|
2033
|
+
type: "date",
|
|
2034
|
+
value: m.value,
|
|
2035
|
+
disabled: (c = t.field) == null ? void 0 : c.disabled,
|
|
2036
|
+
"aria-label": t.item.label || "日期",
|
|
2037
|
+
onChange: o
|
|
2038
|
+
}, null, 40, $l))
|
|
2039
|
+
]);
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
}), wl = /* @__PURE__ */ N(Tl, [["__scopeId", "data-v-fdf889db"]]), xl = { class: "ctrl-verify-wrap" }, Sl = { class: "ctrl-verify" }, Il = ["value", "placeholder", "disabled", "maxlength"], Al = ["disabled"], Vl = {
|
|
2043
|
+
key: 0,
|
|
2044
|
+
class: "ctrl-verify-error"
|
|
2045
|
+
}, Fl = /* @__PURE__ */ L({
|
|
2046
|
+
__name: "VerifyCodeControl",
|
|
2047
|
+
props: {
|
|
2048
|
+
item: {},
|
|
2049
|
+
field: {},
|
|
2050
|
+
formCore: {}
|
|
2051
|
+
},
|
|
2052
|
+
emits: ["change"],
|
|
2053
|
+
setup(t, { emit: n }) {
|
|
2054
|
+
var c;
|
|
2055
|
+
const e = t, y = n, u = q(ae, null), m = D(String(((c = e.field) == null ? void 0 : c.value) || "")), p = D(0), f = D(!1), g = D("");
|
|
2056
|
+
let a = null;
|
|
2057
|
+
G(
|
|
2058
|
+
() => {
|
|
2059
|
+
var k;
|
|
2060
|
+
return (k = e.field) == null ? void 0 : k.value;
|
|
2061
|
+
},
|
|
2062
|
+
(k) => {
|
|
2063
|
+
m.value = k == null ? "" : String(k);
|
|
2064
|
+
}
|
|
2065
|
+
);
|
|
2066
|
+
const o = C(() => {
|
|
2067
|
+
var k;
|
|
2068
|
+
return Number((k = e.item.props) == null ? void 0 : k.countTime) || 60;
|
|
2069
|
+
}), i = C(
|
|
2070
|
+
() => {
|
|
2071
|
+
var k, M;
|
|
2072
|
+
return ((k = e.item.props) == null ? void 0 : k.verifyText) || ((M = e.item.props) == null ? void 0 : M.reVerifyText) || "获取验证码";
|
|
2073
|
+
}
|
|
2074
|
+
), h = C(() => p.value > 0), V = C(() => p.value > 0 ? `${p.value}s` : f.value ? "发送中" : i.value);
|
|
2075
|
+
function v(k) {
|
|
2076
|
+
m.value = k.target.value;
|
|
2077
|
+
}
|
|
2078
|
+
function b() {
|
|
2079
|
+
const k = m.value.trim();
|
|
2080
|
+
m.value = k, y("change", { value: k, eventType: "inputBlur" });
|
|
2081
|
+
}
|
|
2082
|
+
function w() {
|
|
2083
|
+
a && (clearInterval(a), a = null);
|
|
2084
|
+
}
|
|
2085
|
+
function P() {
|
|
2086
|
+
p.value = o.value, w(), a = setInterval(() => {
|
|
2087
|
+
p.value -= 1, p.value <= 0 && w();
|
|
2088
|
+
}, 1e3);
|
|
2089
|
+
}
|
|
2090
|
+
async function O() {
|
|
2091
|
+
var k, M, d, T, S, $;
|
|
2092
|
+
if (!(h.value || f.value || (k = e.field) != null && k.disabled)) {
|
|
2093
|
+
g.value = "", f.value = !0;
|
|
2094
|
+
try {
|
|
2095
|
+
const F = te(u);
|
|
2096
|
+
if (F != null && F.sendVerifyCode) {
|
|
2097
|
+
const x = ((M = e.item.props) == null ? void 0 : M.mobileKey) || ((d = e.item.props) == null ? void 0 : d.bindMobileKey), _ = x && (($ = (S = (T = e.formCore) == null ? void 0 : T.fields) == null ? void 0 : S[x]) == null ? void 0 : $.value) != null ? String(e.formCore.fields[x].value) : void 0;
|
|
2098
|
+
await F.sendVerifyCode({ item: e.item, mobile: _ });
|
|
2099
|
+
}
|
|
2100
|
+
P();
|
|
2101
|
+
} catch (F) {
|
|
2102
|
+
g.value = (F == null ? void 0 : F.message) || "发送失败";
|
|
2103
|
+
} finally {
|
|
2104
|
+
f.value = !1;
|
|
2105
|
+
}
|
|
2106
|
+
}
|
|
2107
|
+
}
|
|
2108
|
+
return fe(w), (k, M) => {
|
|
2109
|
+
var d, T, S;
|
|
2110
|
+
return s(), r("div", xl, [
|
|
2111
|
+
l("div", Sl, [
|
|
2112
|
+
l("input", {
|
|
2113
|
+
class: "ctrl-verify-input",
|
|
2114
|
+
type: "text",
|
|
2115
|
+
inputmode: "numeric",
|
|
2116
|
+
value: m.value,
|
|
2117
|
+
placeholder: t.item.placeholder || "请输入验证码",
|
|
2118
|
+
disabled: (d = t.field) == null ? void 0 : d.disabled,
|
|
2119
|
+
maxlength: ((T = t.item.props) == null ? void 0 : T.maxlength) || 6,
|
|
2120
|
+
onInput: v,
|
|
2121
|
+
onBlur: b
|
|
2122
|
+
}, null, 40, Il),
|
|
2123
|
+
l("button", {
|
|
2124
|
+
type: "button",
|
|
2125
|
+
class: "ctrl-verify-btn",
|
|
2126
|
+
disabled: ((S = t.field) == null ? void 0 : S.disabled) || h.value || f.value,
|
|
2127
|
+
onClick: O
|
|
2128
|
+
}, A(V.value), 9, Al)
|
|
2129
|
+
]),
|
|
2130
|
+
g.value ? (s(), r(
|
|
2131
|
+
"div",
|
|
2132
|
+
Vl,
|
|
2133
|
+
A(g.value),
|
|
2134
|
+
1
|
|
2135
|
+
/* TEXT */
|
|
2136
|
+
)) : I("v-if", !0)
|
|
2137
|
+
]);
|
|
2138
|
+
};
|
|
2139
|
+
}
|
|
2140
|
+
}), Dl = /* @__PURE__ */ N(Fl, [["__scopeId", "data-v-53229668"]]), Ml = { class: "ctrl-upload-wrap" }, Pl = { class: "ctrl-upload" }, Ol = ["src"], jl = ["onClick"], Rl = {
|
|
2141
|
+
key: 0,
|
|
2142
|
+
class: "ctrl-upload-add"
|
|
2143
|
+
}, Ll = { class: "ctrl-upload-hint" }, Nl = ["multiple"], Bl = {
|
|
2144
|
+
key: 0,
|
|
2145
|
+
class: "ctrl-upload-error"
|
|
2146
|
+
}, El = /* @__PURE__ */ L({
|
|
2147
|
+
__name: "ImageUploadControl",
|
|
2148
|
+
props: {
|
|
2149
|
+
item: {},
|
|
2150
|
+
field: {},
|
|
2151
|
+
formCore: {}
|
|
2152
|
+
},
|
|
2153
|
+
emits: ["change"],
|
|
2154
|
+
setup(t, { emit: n }) {
|
|
2155
|
+
var V;
|
|
2156
|
+
const e = t, y = n, u = q(ae, null), m = D(o((V = e.field) == null ? void 0 : V.value)), p = D(!1), f = D("");
|
|
2157
|
+
G(
|
|
2158
|
+
() => {
|
|
2159
|
+
var v;
|
|
2160
|
+
return (v = e.field) == null ? void 0 : v.value;
|
|
2161
|
+
},
|
|
2162
|
+
(v) => {
|
|
2163
|
+
m.value = o(v);
|
|
2164
|
+
}
|
|
2165
|
+
);
|
|
2166
|
+
const g = C(() => {
|
|
2167
|
+
var v;
|
|
2168
|
+
return Number((v = e.item.props) == null ? void 0 : v.maxCount) || 1;
|
|
2169
|
+
}), a = C(
|
|
2170
|
+
() => {
|
|
2171
|
+
var v;
|
|
2172
|
+
return m.value.length < g.value && !((v = e.field) != null && v.disabled) && !p.value;
|
|
2173
|
+
}
|
|
2174
|
+
);
|
|
2175
|
+
function o(v) {
|
|
2176
|
+
return Array.isArray(v) ? v.map(String).filter(Boolean) : typeof v == "string" && v ? [v] : [];
|
|
2177
|
+
}
|
|
2178
|
+
async function i(v) {
|
|
2179
|
+
var c;
|
|
2180
|
+
const b = v.target, w = Array.from(b.files || []);
|
|
2181
|
+
if (b.value = "", !w.length || (c = e.field) != null && c.disabled) return;
|
|
2182
|
+
const P = g.value - m.value.length, O = w.slice(0, Math.max(0, P));
|
|
2183
|
+
if (O.length) {
|
|
2184
|
+
f.value = "", p.value = !0;
|
|
2185
|
+
try {
|
|
2186
|
+
const k = te(u);
|
|
2187
|
+
let M;
|
|
2188
|
+
if (k != null && k.uploadFile) {
|
|
2189
|
+
const d = [];
|
|
2190
|
+
for (const T of O) {
|
|
2191
|
+
const S = await k.uploadFile(
|
|
2192
|
+
{ name: T.name, size: T.size, raw: T },
|
|
2193
|
+
{ item: e.item }
|
|
2194
|
+
);
|
|
2195
|
+
if (!(S != null && S.url)) throw new Error("上传未返回 url");
|
|
2196
|
+
d.push(S.url);
|
|
2197
|
+
}
|
|
2198
|
+
M = [...m.value, ...d];
|
|
2199
|
+
} else
|
|
2200
|
+
M = [...m.value, ...O.map((d) => URL.createObjectURL(d))];
|
|
2201
|
+
m.value = M, y("change", { value: M, eventType: "pickChange" });
|
|
2202
|
+
} catch (k) {
|
|
2203
|
+
f.value = (k == null ? void 0 : k.message) || "上传失败";
|
|
2204
|
+
} finally {
|
|
2205
|
+
p.value = !1;
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
function h(v) {
|
|
2210
|
+
var w;
|
|
2211
|
+
if ((w = e.field) != null && w.disabled) return;
|
|
2212
|
+
const b = m.value.filter((P, O) => O !== v);
|
|
2213
|
+
m.value = b, y("change", { value: b, eventType: "pickChange" });
|
|
2214
|
+
}
|
|
2215
|
+
return (v, b) => (s(), r("div", Ml, [
|
|
2216
|
+
l("div", Pl, [
|
|
2217
|
+
(s(!0), r(
|
|
2218
|
+
B,
|
|
2219
|
+
null,
|
|
2220
|
+
U(m.value, (w, P) => {
|
|
2221
|
+
var O;
|
|
2222
|
+
return s(), r("div", {
|
|
2223
|
+
key: w + P,
|
|
2224
|
+
class: "ctrl-upload-thumb"
|
|
2225
|
+
}, [
|
|
2226
|
+
l("img", {
|
|
2227
|
+
src: w,
|
|
2228
|
+
alt: ""
|
|
2229
|
+
}, null, 8, Ol),
|
|
2230
|
+
(O = t.field) != null && O.disabled ? I("v-if", !0) : (s(), r("button", {
|
|
2231
|
+
key: 0,
|
|
2232
|
+
type: "button",
|
|
2233
|
+
class: "ctrl-upload-remove",
|
|
2234
|
+
"aria-label": "删除图片",
|
|
2235
|
+
onClick: (c) => h(P)
|
|
2236
|
+
}, " × ", 8, jl))
|
|
2237
|
+
]);
|
|
2238
|
+
}),
|
|
2239
|
+
128
|
|
2240
|
+
/* KEYED_FRAGMENT */
|
|
2241
|
+
)),
|
|
2242
|
+
a.value ? (s(), r("label", Rl, [
|
|
2243
|
+
b[0] || (b[0] = l(
|
|
2244
|
+
"span",
|
|
2245
|
+
null,
|
|
2246
|
+
"+",
|
|
2247
|
+
-1
|
|
2248
|
+
/* CACHED */
|
|
2249
|
+
)),
|
|
2250
|
+
l(
|
|
2251
|
+
"span",
|
|
2252
|
+
Ll,
|
|
2253
|
+
A(p.value ? "…" : t.item.placeholder || "上传"),
|
|
2254
|
+
1
|
|
2255
|
+
/* TEXT */
|
|
2256
|
+
),
|
|
2257
|
+
l("input", {
|
|
2258
|
+
type: "file",
|
|
2259
|
+
accept: "image/*",
|
|
2260
|
+
multiple: g.value > 1,
|
|
2261
|
+
hidden: "",
|
|
2262
|
+
onChange: i
|
|
2263
|
+
}, null, 40, Nl)
|
|
2264
|
+
])) : I("v-if", !0)
|
|
2265
|
+
]),
|
|
2266
|
+
f.value ? (s(), r(
|
|
2267
|
+
"div",
|
|
2268
|
+
Bl,
|
|
2269
|
+
A(f.value),
|
|
2270
|
+
1
|
|
2271
|
+
/* TEXT */
|
|
2272
|
+
)) : I("v-if", !0)
|
|
2273
|
+
]));
|
|
2274
|
+
}
|
|
2275
|
+
}), Ul = /* @__PURE__ */ N(El, [["__scopeId", "data-v-f549efb4"]]), Hl = { class: "ctrl-slider" }, Kl = ["min", "max", "step", "value", "disabled", "aria-label"], Gl = { class: "ctrl-slider-value" }, zl = /* @__PURE__ */ L({
|
|
2276
|
+
__name: "SliderControl",
|
|
2277
|
+
props: {
|
|
2278
|
+
item: {},
|
|
2279
|
+
field: {},
|
|
2280
|
+
formCore: {}
|
|
2281
|
+
},
|
|
2282
|
+
emits: ["change"],
|
|
2283
|
+
setup(t, { emit: n }) {
|
|
2284
|
+
var i;
|
|
2285
|
+
const e = t, y = n, u = C(() => {
|
|
2286
|
+
var h;
|
|
2287
|
+
return Number(((h = e.item.props) == null ? void 0 : h.min) ?? 0);
|
|
2288
|
+
}), m = C(() => {
|
|
2289
|
+
var h;
|
|
2290
|
+
return Number(((h = e.item.props) == null ? void 0 : h.max) ?? 100);
|
|
2291
|
+
}), p = C(() => {
|
|
2292
|
+
var h;
|
|
2293
|
+
return Number(((h = e.item.props) == null ? void 0 : h.step) ?? 1);
|
|
2294
|
+
}), f = D(g((i = e.field) == null ? void 0 : i.value, u.value));
|
|
2295
|
+
G(
|
|
2296
|
+
() => {
|
|
2297
|
+
var h;
|
|
2298
|
+
return (h = e.field) == null ? void 0 : h.value;
|
|
2299
|
+
},
|
|
2300
|
+
(h) => {
|
|
2301
|
+
f.value = g(h, u.value);
|
|
2302
|
+
}
|
|
2303
|
+
);
|
|
2304
|
+
function g(h, V) {
|
|
2305
|
+
const v = Number(h);
|
|
2306
|
+
return Number.isFinite(v) ? v : V;
|
|
2307
|
+
}
|
|
2308
|
+
function a(h) {
|
|
2309
|
+
f.value = Number(h.target.value);
|
|
2310
|
+
}
|
|
2311
|
+
function o(h) {
|
|
2312
|
+
const V = Number(h.target.value);
|
|
2313
|
+
f.value = V, y("change", { value: V, eventType: "pickChange" });
|
|
2314
|
+
}
|
|
2315
|
+
return (h, V) => {
|
|
2316
|
+
var v;
|
|
2317
|
+
return s(), r("div", Hl, [
|
|
2318
|
+
l("input", {
|
|
2319
|
+
class: "ctrl-slider-input",
|
|
2320
|
+
type: "range",
|
|
2321
|
+
min: u.value,
|
|
2322
|
+
max: m.value,
|
|
2323
|
+
step: p.value,
|
|
2324
|
+
value: f.value,
|
|
2325
|
+
disabled: (v = t.field) == null ? void 0 : v.disabled,
|
|
2326
|
+
"aria-label": t.item.label || "滑块",
|
|
2327
|
+
onInput: a,
|
|
2328
|
+
onChange: o
|
|
2329
|
+
}, null, 40, Kl),
|
|
2330
|
+
l(
|
|
2331
|
+
"span",
|
|
2332
|
+
Gl,
|
|
2333
|
+
A(f.value),
|
|
2334
|
+
1
|
|
2335
|
+
/* TEXT */
|
|
2336
|
+
)
|
|
2337
|
+
]);
|
|
2338
|
+
};
|
|
2339
|
+
}
|
|
2340
|
+
}), Yl = /* @__PURE__ */ N(zl, [["__scopeId", "data-v-ac8f0c27"]]), ql = {
|
|
2341
|
+
input: "InputControl",
|
|
2342
|
+
textarea: "InputControl",
|
|
2343
|
+
number: "InputControl",
|
|
2344
|
+
idcard: "InputControl",
|
|
2345
|
+
phone: "InputControl",
|
|
2346
|
+
bankCard: "InputControl",
|
|
2347
|
+
select: "SelectControl",
|
|
2348
|
+
cascader: "CascaderControl",
|
|
2349
|
+
address: "AddressControl",
|
|
2350
|
+
address5: "AddressControl",
|
|
2351
|
+
addressPinyin: "AddressControl",
|
|
2352
|
+
search: "SearchControl",
|
|
2353
|
+
agreement: "AgreementControl",
|
|
2354
|
+
task: "TaskControl",
|
|
2355
|
+
date: "DateControl",
|
|
2356
|
+
dateRange: "DateControl",
|
|
2357
|
+
verifyCode: "VerifyCodeControl",
|
|
2358
|
+
imageUpload: "ImageUploadControl",
|
|
2359
|
+
slider: "SliderControl",
|
|
2360
|
+
signature: "TaskControl",
|
|
2361
|
+
custom: "InputControl",
|
|
2362
|
+
list: "ListControl"
|
|
2363
|
+
};
|
|
2364
|
+
function Wl(t, n) {
|
|
2365
|
+
return se(t) ? "TaskControl" : ql[n] || "InputControl";
|
|
2366
|
+
}
|
|
2367
|
+
function Jl(t, n, e) {
|
|
2368
|
+
const y = se(t);
|
|
2369
|
+
return y ? {
|
|
2370
|
+
...e || {},
|
|
2371
|
+
taskType: t,
|
|
2372
|
+
taskCategory: y === "customer" ? "CUSTOMER_TASK" : y === "inline" ? "inline" : "TASKS"
|
|
2373
|
+
} : e;
|
|
2374
|
+
}
|
|
2375
|
+
function Xl(t) {
|
|
2376
|
+
if (typeof t != "object" || t === null)
|
|
2377
|
+
return { value: t };
|
|
2378
|
+
const n = t.value !== void 0 ? t.value : t, e = t.eventType, { value: y, eventType: u, ...m } = t;
|
|
2379
|
+
return Object.keys(m).length > 0 ? { value: n, eventType: e, extraFields: m } : { value: n, eventType: e };
|
|
2380
|
+
}
|
|
2381
|
+
const Ql = ["data-label-position", "data-field-key"], Zl = {
|
|
2382
|
+
key: 0,
|
|
2383
|
+
class: "form-error"
|
|
2384
|
+
}, ea = {
|
|
2385
|
+
key: 1,
|
|
2386
|
+
class: "form-icon"
|
|
2387
|
+
}, ta = { key: 0 }, la = { key: 1 }, aa = { key: 2 }, na = /* @__PURE__ */ L({
|
|
2388
|
+
__name: "FormItem",
|
|
2389
|
+
props: {
|
|
2390
|
+
item: {},
|
|
2391
|
+
field: {},
|
|
2392
|
+
formCore: {}
|
|
2393
|
+
},
|
|
2394
|
+
setup(t) {
|
|
2395
|
+
const n = t, e = q("customControls", {}), y = q("themeLabelPosition", void 0), u = {
|
|
2396
|
+
InputControl: xe,
|
|
2397
|
+
SelectControl: Pe,
|
|
2398
|
+
CascaderControl: ze,
|
|
2399
|
+
SearchControl: tt,
|
|
2400
|
+
AddressControl: vt,
|
|
2401
|
+
AgreementControl: gt,
|
|
2402
|
+
TaskControl: il,
|
|
2403
|
+
ListControl: kl,
|
|
2404
|
+
DateControl: wl,
|
|
2405
|
+
VerifyCodeControl: Dl,
|
|
2406
|
+
ImageUploadControl: Ul,
|
|
2407
|
+
SliderControl: Yl
|
|
2408
|
+
}, m = C(() => {
|
|
2409
|
+
const a = Jl(
|
|
2410
|
+
n.item.key,
|
|
2411
|
+
n.item.type,
|
|
2412
|
+
n.item.raw.props || {}
|
|
2413
|
+
);
|
|
2414
|
+
return a === n.item.raw.props ? n.item : {
|
|
2415
|
+
...n.item,
|
|
2416
|
+
raw: {
|
|
2417
|
+
...n.item.raw,
|
|
2418
|
+
props: a
|
|
2419
|
+
}
|
|
2420
|
+
};
|
|
2421
|
+
}), p = C(
|
|
2422
|
+
() => {
|
|
2423
|
+
var a;
|
|
2424
|
+
return ye(
|
|
2425
|
+
(a = n.item.raw) == null ? void 0 : a.labelPosition,
|
|
2426
|
+
te(y)
|
|
2427
|
+
);
|
|
2428
|
+
}
|
|
2429
|
+
), f = C(() => {
|
|
2430
|
+
var o;
|
|
2431
|
+
if (n.item.type === "custom") {
|
|
2432
|
+
const i = (o = n.item.raw) == null ? void 0 : o.customRender;
|
|
2433
|
+
if (i && e[i])
|
|
2434
|
+
return e[i];
|
|
2435
|
+
if (i && typeof i != "string")
|
|
2436
|
+
return i;
|
|
2437
|
+
}
|
|
2438
|
+
const a = Wl(n.item.key, n.item.type);
|
|
2439
|
+
return u[a];
|
|
2440
|
+
});
|
|
2441
|
+
function g(a) {
|
|
2442
|
+
const { value: o, eventType: i, extraFields: h } = Xl(a);
|
|
2443
|
+
n.formCore.setControlData(n.item.key, o, {
|
|
2444
|
+
eventType: i,
|
|
2445
|
+
...h ? { extraFields: h } : {}
|
|
2446
|
+
});
|
|
2447
|
+
}
|
|
2448
|
+
return (a, o) => {
|
|
2449
|
+
var i, h;
|
|
2450
|
+
return s(), r("div", {
|
|
2451
|
+
class: R(["form-item", {
|
|
2452
|
+
"form-item-error": (i = t.field) == null ? void 0 : i.errMsg,
|
|
2453
|
+
"form-item--top": p.value === "top",
|
|
2454
|
+
"form-item--left": p.value === "left"
|
|
2455
|
+
}]),
|
|
2456
|
+
"data-label-position": p.value,
|
|
2457
|
+
"data-field-key": t.item.key
|
|
2458
|
+
}, [
|
|
2459
|
+
t.item.hideLabel ? I("v-if", !0) : (s(), r(
|
|
2460
|
+
"label",
|
|
2461
|
+
{
|
|
2462
|
+
key: 0,
|
|
2463
|
+
class: R(["form-label", { required: t.item.required }])
|
|
2464
|
+
},
|
|
2465
|
+
A(t.item.label),
|
|
2466
|
+
3
|
|
2467
|
+
/* TEXT, CLASS */
|
|
2468
|
+
)),
|
|
2469
|
+
l(
|
|
2470
|
+
"div",
|
|
2471
|
+
{
|
|
2472
|
+
class: R(["form-control", { "form-control-full": t.item.hideLabel }])
|
|
2473
|
+
},
|
|
2474
|
+
[
|
|
2475
|
+
(s(), J(ee(f.value), {
|
|
2476
|
+
item: m.value.raw,
|
|
2477
|
+
field: t.field,
|
|
2478
|
+
formCore: t.formCore,
|
|
2479
|
+
onChange: g
|
|
2480
|
+
}, null, 40, ["item", "field", "formCore"])),
|
|
2481
|
+
(h = t.field) != null && h.errMsg ? (s(), r(
|
|
2482
|
+
"div",
|
|
2483
|
+
Zl,
|
|
2484
|
+
A(t.field.errMsg),
|
|
2485
|
+
1
|
|
2486
|
+
/* TEXT */
|
|
2487
|
+
)) : I("v-if", !0)
|
|
2488
|
+
],
|
|
2489
|
+
2
|
|
2490
|
+
/* CLASS */
|
|
2491
|
+
),
|
|
2492
|
+
t.item.rightIcon && !t.item.hideLabel && p.value === "left" ? (s(), r("span", ea, [
|
|
2493
|
+
t.item.rightIcon === "arrow" ? (s(), r("span", ta, "›")) : t.item.rightIcon === "location" ? (s(), r("span", la, "📍")) : t.item.rightIcon === "search" ? (s(), r("span", aa, "🔍")) : I("v-if", !0)
|
|
2494
|
+
])) : I("v-if", !0)
|
|
2495
|
+
], 10, Ql);
|
|
2496
|
+
};
|
|
2497
|
+
}
|
|
2498
|
+
}), ie = /* @__PURE__ */ N(na, [["__scopeId", "data-v-177bcff2"]]), oa = { class: "form-group" }, sa = { class: "group-body" }, ia = /* @__PURE__ */ L({
|
|
2499
|
+
__name: "FormGroup",
|
|
2500
|
+
props: {
|
|
2501
|
+
group: {},
|
|
2502
|
+
fields: {},
|
|
2503
|
+
formCore: {}
|
|
2504
|
+
},
|
|
2505
|
+
setup(t) {
|
|
2506
|
+
const n = t, e = q(
|
|
2507
|
+
"FormItemComponent",
|
|
2508
|
+
void 0
|
|
2509
|
+
), y = C(
|
|
2510
|
+
() => e ? te(e) : ie
|
|
2511
|
+
), u = C(
|
|
2512
|
+
() => n.group.items.filter((m) => {
|
|
2513
|
+
const p = n.fields[m.key];
|
|
2514
|
+
return !p || p.visible;
|
|
2515
|
+
})
|
|
2516
|
+
);
|
|
2517
|
+
return (m, p) => (s(), r("div", oa, [
|
|
2518
|
+
l("div", sa, [
|
|
2519
|
+
(s(!0), r(
|
|
2520
|
+
B,
|
|
2521
|
+
null,
|
|
2522
|
+
U(u.value, (f) => (s(), J(ee(y.value), {
|
|
2523
|
+
key: f.key,
|
|
2524
|
+
item: f,
|
|
2525
|
+
field: t.fields[f.key],
|
|
2526
|
+
formCore: t.formCore
|
|
2527
|
+
}, null, 8, ["item", "field", "formCore"]))),
|
|
2528
|
+
128
|
|
2529
|
+
/* KEYED_FRAGMENT */
|
|
2530
|
+
))
|
|
2531
|
+
])
|
|
2532
|
+
]));
|
|
2533
|
+
}
|
|
2534
|
+
}), ra = /* @__PURE__ */ N(ia, [["__scopeId", "data-v-83eda13b"]]), ca = ["data-shell", "data-label-align", "data-content-align"], ua = {
|
|
2535
|
+
key: 0,
|
|
2536
|
+
class: "form-render__title"
|
|
2537
|
+
}, da = /* @__PURE__ */ L({
|
|
2538
|
+
__name: "FormRender",
|
|
2539
|
+
props: {
|
|
2540
|
+
groups: {},
|
|
2541
|
+
fields: {},
|
|
2542
|
+
formCore: {},
|
|
2543
|
+
customControls: {},
|
|
2544
|
+
labelPosition: {},
|
|
2545
|
+
title: {},
|
|
2546
|
+
labelAlign: {},
|
|
2547
|
+
labelWidth: {},
|
|
2548
|
+
contentAlign: {},
|
|
2549
|
+
FormGroupComponent: {},
|
|
2550
|
+
FormItemComponent: {},
|
|
2551
|
+
hostHandlers: {}
|
|
2552
|
+
},
|
|
2553
|
+
setup(t) {
|
|
2554
|
+
const n = t, e = C(() => n.labelAlign === "left" || n.labelAlign === "right" || n.labelAlign === "top" ? n.labelAlign : n.labelPosition === "top" ? "top" : (n.labelPosition === "left", "left")), y = C(
|
|
2555
|
+
() => e.value === "top" ? "top" : "left"
|
|
2556
|
+
);
|
|
2557
|
+
z("customControls", n.customControls || {}), z("themeLabelPosition", y), z("formUiLayout", C(() => ({
|
|
2558
|
+
labelAlign: e.value,
|
|
2559
|
+
labelWidth: n.labelWidth ?? "81px",
|
|
2560
|
+
contentAlign: n.contentAlign ?? "left"
|
|
2561
|
+
}))), z(
|
|
2562
|
+
"FormItemComponent",
|
|
2563
|
+
C(() => n.FormItemComponent || ie)
|
|
2564
|
+
), z(
|
|
2565
|
+
ae,
|
|
2566
|
+
C(() => n.hostHandlers ?? null)
|
|
2567
|
+
);
|
|
2568
|
+
const u = C(() => n.FormGroupComponent || ra);
|
|
2569
|
+
return (m, p) => (s(), r("div", {
|
|
2570
|
+
class: "form-render",
|
|
2571
|
+
"data-shell": t.FormGroupComponent ? "override" : "default",
|
|
2572
|
+
"data-label-align": e.value,
|
|
2573
|
+
"data-content-align": t.contentAlign || "left"
|
|
2574
|
+
}, [
|
|
2575
|
+
t.title ? (s(), r(
|
|
2576
|
+
"div",
|
|
2577
|
+
ua,
|
|
2578
|
+
A(t.title),
|
|
2579
|
+
1
|
|
2580
|
+
/* TEXT */
|
|
2581
|
+
)) : I("v-if", !0),
|
|
2582
|
+
(s(!0), r(
|
|
2583
|
+
B,
|
|
2584
|
+
null,
|
|
2585
|
+
U(t.groups, (f) => (s(), J(ee(u.value), {
|
|
2586
|
+
key: f.key,
|
|
2587
|
+
group: f,
|
|
2588
|
+
fields: t.fields,
|
|
2589
|
+
formCore: t.formCore
|
|
2590
|
+
}, null, 8, ["group", "fields", "formCore"]))),
|
|
2591
|
+
128
|
|
2592
|
+
/* KEYED_FRAGMENT */
|
|
2593
|
+
)),
|
|
2594
|
+
me(m.$slots, "footer", {}, void 0, !0)
|
|
2595
|
+
], 8, ca));
|
|
2596
|
+
}
|
|
2597
|
+
}), ha = /* @__PURE__ */ N(da, [["__scopeId", "data-v-c936694c"]]);
|
|
2598
|
+
function ga(t, n, e) {
|
|
2599
|
+
const y = ke(t, void 0, e), u = pe({
|
|
2600
|
+
groups: y.groups,
|
|
2601
|
+
fields: {}
|
|
2602
|
+
});
|
|
2603
|
+
function m() {
|
|
2604
|
+
const a = {};
|
|
2605
|
+
for (const o of Object.keys(n.fields))
|
|
2606
|
+
a[o] = { ...n.fields[o] };
|
|
2607
|
+
Object.assign(u.fields, a);
|
|
2608
|
+
}
|
|
2609
|
+
function p() {
|
|
2610
|
+
m();
|
|
2611
|
+
const a = {};
|
|
2612
|
+
for (const o of Object.keys(n.fields))
|
|
2613
|
+
a[o] = n.fields[o];
|
|
2614
|
+
y.update(a), u.groups.splice(0, u.groups.length, ...y.groups);
|
|
2615
|
+
}
|
|
2616
|
+
n.on("afterChange", p);
|
|
2617
|
+
function f() {
|
|
2618
|
+
n.off("afterChange", p);
|
|
2619
|
+
}
|
|
2620
|
+
he() && ge(f), m();
|
|
2621
|
+
const g = {};
|
|
2622
|
+
for (const a of Object.keys(n.fields))
|
|
2623
|
+
g[a] = n.fields[a];
|
|
2624
|
+
return y.update(g), u.groups = y.groups, { groups: u.groups, fields: u.fields, formCore: n, destroy: f };
|
|
2625
|
+
}
|
|
2626
|
+
export {
|
|
2627
|
+
ra as FormGroup,
|
|
2628
|
+
ie as FormItem,
|
|
2629
|
+
ha as FormRender,
|
|
2630
|
+
ba as setTaskHandlers,
|
|
2631
|
+
ga as useFormRender
|
|
2632
|
+
};
|