form-design-v3 1.0.0 → 1.0.2

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/index-oUADtA5r.js DELETED
@@ -1,3016 +0,0 @@
1
- import { defineComponent as D, openBlock as s, createElementBlock as m, normalizeClass as j, unref as _, createElementVNode as e, toDisplayString as h, normalizeStyle as U, Fragment as T, createTextVNode as E, computed as I, ref as A, onMounted as ee, onUnmounted as ke, createVNode as M, withCtx as z, renderList as F, createBlock as O, resolveDynamicComponent as ie, createCommentVNode as C, withModifiers as R, withDirectives as se, renderSlot as W, vShow as we, reactive as xe, Teleport as re, nextTick as $e, resolveComponent as Ce, mergeProps as ne, createSlots as X, normalizeProps as Ne, guardReactiveProps as Be, provide as je, watch as Ee, createStaticVNode as ce, onBeforeUnmount as Oe, vModelText as qe, defineAsyncComponent as Re, createApp as Ae, h as Ue } from "vue";
2
- import { defineStore as Ve } from "pinia";
3
- import { ElSelect as le, ElOption as G, ElTree as ze, ElInputNumber as Ye } from "element-plus";
4
- import "element-plus/es/components/select/style/css";
5
- import { icons as He } from "lucide-vue-next";
6
- import "element-plus/es/components/input-number/style/css";
7
- import "element-plus/es/components/tree/style/css";
8
- const ue = /* @__PURE__ */ new Map();
9
- function Q(t) {
10
- ue.set(t.type, t);
11
- }
12
- function H(t) {
13
- return ue.get(t);
14
- }
15
- function We() {
16
- return Array.from(ue.values());
17
- }
18
- function Ge(t) {
19
- const l = H(t);
20
- if (!l) throw new Error(`未注册的控件类型: ${t}`);
21
- return { ...l.createDefaultProps(), id: `${t}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 7)}` };
22
- }
23
- const Je = { class: "fd-label-name" }, Qe = /* @__PURE__ */ D({
24
- __name: "LabelDesign",
25
- props: {
26
- node: {}
27
- },
28
- setup(t) {
29
- const l = V();
30
- return (n, a) => (s(), m("div", {
31
- class: j(["fd-label-design", { "is-mobile": _(l).device === "mobile" }])
32
- }, [
33
- e("span", Je, h(t.node.label || "标题"), 1),
34
- e("span", {
35
- class: j(["fd-label-value", { "fd-label-value--link": !!t.node.bindLink }]),
36
- style: U(t.node.color ? { color: t.node.color } : void 0)
37
- }, [
38
- t.node.bindLink ? (s(), m(T, { key: 0 }, [
39
- E(h(t.node.bindField || t.node.bindLink), 1)
40
- ], 64)) : (s(), m(T, { key: 1 }, [
41
- E(h(t.node.bindField || "未绑定字段"), 1)
42
- ], 64))
43
- ], 6)
44
- ], 2));
45
- }
46
- }), L = (t, l) => {
47
- const n = t.__vccOpts || t;
48
- for (const [a, d] of l)
49
- n[a] = d;
50
- return n;
51
- }, Ze = /* @__PURE__ */ L(Qe, [["__scopeId", "data-v-b6dcc499"]]), Ke = { class: "fd-label-name" }, Xe = ["data-key"], et = ["href"], tt = /* @__PURE__ */ D({
52
- __name: "LabelRender",
53
- props: {
54
- node: {},
55
- value: {},
56
- formData: {}
57
- },
58
- setup(t) {
59
- const l = t, n = I(() => !!l.node.bindLink), a = I(() => {
60
- var v;
61
- const p = l.node.bindLink ? (v = l.formData) == null ? void 0 : v[l.node.bindLink] : void 0;
62
- return p == null ? "" : String(p);
63
- }), d = I(() => l.value !== void 0 && l.value !== null && l.value !== "" ? String(l.value) : a.value ? a.value : ""), i = V(), o = A(!1);
64
- let c = null;
65
- ee(() => {
66
- c = window.matchMedia("(max-width: 768px)"), o.value = c.matches, c.addEventListener("change", (p) => {
67
- o.value = p.matches;
68
- });
69
- }), ke(() => {
70
- c && c.removeEventListener("change", () => {
71
- });
72
- });
73
- const f = I(() => i.device === "mobile" || o.value);
74
- return (p, v) => (s(), m("div", {
75
- class: j(["fd-label-render", { "is-mobile": f.value }])
76
- }, [
77
- e("span", Ke, h(t.node.label || "标题"), 1),
78
- e("span", {
79
- class: j(["fd-label-value", { "fd-label-value--link": n.value }]),
80
- "data-key": t.node.bindField,
81
- style: U(t.node.color ? { color: t.node.color } : void 0)
82
- }, [
83
- a.value ? (s(), m("a", {
84
- key: 0,
85
- class: "fd-label-link",
86
- href: a.value,
87
- target: "_blank",
88
- rel: "noopener noreferrer"
89
- }, h(d.value), 9, et)) : (s(), m(T, { key: 1 }, [
90
- E(h(d.value), 1)
91
- ], 64))
92
- ], 14, Xe)
93
- ], 2));
94
- }
95
- }), nt = /* @__PURE__ */ L(tt, [["__scopeId", "data-v-7fe92042"]]), lt = { class: "fd-panel" }, ot = { class: "fd-panel-item" }, at = ["value"], dt = { class: "fd-panel-item" }, it = { class: "fd-panel-item" }, st = { class: "fd-panel-item" }, rt = { class: "fd-color-row" }, ct = ["value"], ut = ["value"], mt = "#344054", ft = /* @__PURE__ */ D({
96
- __name: "LabelPanel",
97
- props: {
98
- node: {},
99
- fields: {}
100
- },
101
- emits: ["update"],
102
- setup(t, { emit: l }) {
103
- const n = t, a = l, d = I(() => n.fields.filter((p) => p.dataType === "link"));
104
- function i(p) {
105
- return p && /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(p) ? p : mt;
106
- }
107
- function o(p) {
108
- a("update", { color: p.target.value });
109
- }
110
- const c = (p) => {
111
- a("update", { bindField: p ?? "" });
112
- }, f = (p) => {
113
- a("update", { bindLink: p ?? "" });
114
- };
115
- return (p, v) => (s(), m("div", lt, [
116
- e("div", ot, [
117
- v[2] || (v[2] = e("label", null, "标题", -1)),
118
- e("input", {
119
- value: t.node.label,
120
- onInput: v[0] || (v[0] = (w) => a("update", { label: w.target.value }))
121
- }, null, 40, at)
122
- ]),
123
- e("div", dt, [
124
- v[3] || (v[3] = e("label", null, "绑定字段", -1)),
125
- M(_(le), {
126
- "model-value": t.node.bindField,
127
- filterable: "",
128
- clearable: "",
129
- placeholder: "搜索并选择字段",
130
- style: { width: "100%" },
131
- "onUpdate:modelValue": c
132
- }, {
133
- default: z(() => [
134
- M(_(G), {
135
- label: "不绑定",
136
- value: ""
137
- }),
138
- (s(!0), m(T, null, F(t.fields, (w) => (s(), O(_(G), {
139
- key: w.name,
140
- label: `${w.label}(${w.name})`,
141
- value: w.name
142
- }, null, 8, ["label", "value"]))), 128))
143
- ]),
144
- _: 1
145
- }, 8, ["model-value"])
146
- ]),
147
- e("div", it, [
148
- v[4] || (v[4] = e("label", null, "绑定链接", -1)),
149
- M(_(le), {
150
- "model-value": t.node.bindLink,
151
- filterable: "",
152
- clearable: "",
153
- placeholder: "搜索并选择链接字段",
154
- style: { width: "100%" },
155
- "onUpdate:modelValue": f
156
- }, {
157
- default: z(() => [
158
- M(_(G), {
159
- label: "不绑定",
160
- value: ""
161
- }),
162
- (s(!0), m(T, null, F(d.value, (w) => (s(), O(_(G), {
163
- key: w.name,
164
- label: `${w.label}(${w.name})`,
165
- value: w.name
166
- }, null, 8, ["label", "value"]))), 128))
167
- ]),
168
- _: 1
169
- }, 8, ["model-value"])
170
- ]),
171
- e("div", st, [
172
- v[5] || (v[5] = e("label", null, "字体颜色", -1)),
173
- e("div", rt, [
174
- e("input", {
175
- type: "color",
176
- value: i(t.node.color),
177
- onInput: o
178
- }, null, 40, ct),
179
- e("input", {
180
- type: "text",
181
- value: t.node.color,
182
- onInput: v[1] || (v[1] = (w) => a("update", { color: w.target.value })),
183
- placeholder: "默认 #344054"
184
- }, null, 40, ut)
185
- ])
186
- ])
187
- ]));
188
- }
189
- }), pt = /* @__PURE__ */ L(ft, [["__scopeId", "data-v-a5d99c1e"]]), bt = {
190
- type: "label",
191
- title: "Label 文本",
192
- design: Ze,
193
- render: nt,
194
- panel: pt,
195
- isContainer: !1,
196
- createDefaultProps: () => ({
197
- id: "",
198
- type: "label",
199
- label: "Label 文本",
200
- bindField: "",
201
- bindLink: "",
202
- color: "#344054"
203
- }),
204
- serialize: (t) => t
205
- }, oe = /* @__PURE__ */ D({
206
- __name: "LucideIcon",
207
- props: {
208
- name: {},
209
- size: { default: 18 },
210
- strokeWidth: { default: 2 }
211
- },
212
- setup(t) {
213
- const l = t, n = I(() => l.name && He[l.name] || null);
214
- return (a, d) => n.value ? (s(), O(ie(n.value), {
215
- key: 0,
216
- size: t.size,
217
- "stroke-width": t.strokeWidth
218
- }, null, 8, ["size", "stroke-width"])) : C("", !0);
219
- }
220
- }), vt = { class: "fd-card-design" }, gt = { class: "fd-card-head" }, yt = { class: "fd-card-title" }, ht = ["title"], _t = { class: "fd-card-body" }, kt = /* @__PURE__ */ D({
221
- __name: "CardDesign",
222
- props: {
223
- node: {}
224
- },
225
- setup(t) {
226
- const l = t, n = V();
227
- function a() {
228
- n.setExpanded(l.node.id, !l.node.expanded);
229
- }
230
- return (d, i) => (s(), m("div", vt, [
231
- e("div", gt, [
232
- t.node.icon ? (s(), m("span", {
233
- key: 0,
234
- class: "fd-card-icon",
235
- style: U({ background: t.node.iconBgColor || void 0 })
236
- }, [
237
- M(oe, {
238
- name: t.node.icon,
239
- size: 18
240
- }, null, 8, ["name"])
241
- ], 4)) : C("", !0),
242
- e("span", yt, h(t.node.label || "卡片标题"), 1),
243
- e("span", {
244
- class: j(["fd-card-arrow", { "is-open": t.node.expanded }]),
245
- title: t.node.expanded ? "收起" : "展开",
246
- onClick: R(a, ["stop"])
247
- }, [...i[0] || (i[0] = [
248
- e("svg", {
249
- viewBox: "0 0 24 24",
250
- fill: "none",
251
- stroke: "currentColor",
252
- "stroke-width": "2",
253
- "stroke-linecap": "round",
254
- "stroke-linejoin": "round"
255
- }, [
256
- e("polyline", { points: "6 9 12 15 18 9" })
257
- ], -1)
258
- ])], 10, ht)
259
- ]),
260
- se(e("div", _t, [
261
- W(d.$slots, "children", {}, () => [
262
- i[1] || (i[1] = e("div", { class: "fd-card-empty" }, "拖拽子控件到此处", -1))
263
- ], !0)
264
- ], 512), [
265
- [we, t.node.expanded]
266
- ])
267
- ]));
268
- }
269
- }), wt = /* @__PURE__ */ L(kt, [["__scopeId", "data-v-6a46ee95"]]);
270
- function Te(t, l) {
271
- if (!t || t === "none") return !1;
272
- const n = Number(l);
273
- return t === "start" ? n === 10 : t === "not-start" ? n !== 10 : t === "not-approval" ? n !== 20 : !1;
274
- }
275
- const xt = {
276
- key: 0,
277
- class: "fd-card-render"
278
- }, $t = { class: "fd-card-title" }, Ct = { class: "fd-card-body" }, Tt = /* @__PURE__ */ D({
279
- __name: "CardRender",
280
- props: {
281
- node: {},
282
- formData: {}
283
- },
284
- setup(t) {
285
- const n = A(t.node.expanded);
286
- return (a, d) => {
287
- var i;
288
- return _(Te)(t.node.hiddenMode, (i = t.formData) == null ? void 0 : i.status) ? C("", !0) : (s(), m("div", xt, [
289
- e("div", {
290
- class: "fd-card-head",
291
- onClick: d[0] || (d[0] = (o) => n.value = !n.value)
292
- }, [
293
- t.node.icon ? (s(), m("span", {
294
- key: 0,
295
- class: "fd-card-icon",
296
- style: U({ background: t.node.iconBgColor || void 0 })
297
- }, [
298
- M(oe, {
299
- name: t.node.icon,
300
- size: 18
301
- }, null, 8, ["name"])
302
- ], 4)) : C("", !0),
303
- e("span", $t, h(t.node.label || "卡片标题"), 1),
304
- e("span", {
305
- class: j(["fd-card-arrow", { "is-open": n.value }])
306
- }, [...d[1] || (d[1] = [
307
- e("svg", {
308
- viewBox: "0 0 24 24",
309
- fill: "none",
310
- stroke: "currentColor",
311
- "stroke-width": "2",
312
- "stroke-linecap": "round",
313
- "stroke-linejoin": "round"
314
- }, [
315
- e("polyline", { points: "6 9 12 15 18 9" })
316
- ], -1)
317
- ])], 2)
318
- ]),
319
- se(e("div", Ct, [
320
- W(a.$slots, "children", {}, void 0, !0)
321
- ], 512), [
322
- [we, n.value]
323
- ])
324
- ]));
325
- };
326
- }
327
- }), St = /* @__PURE__ */ L(Tt, [["__scopeId", "data-v-bc2f6273"]]), It = ["disabled", "aria-checked"], Ft = /* @__PURE__ */ D({
328
- __name: "FdSwitch",
329
- props: {
330
- modelValue: { type: Boolean },
331
- disabled: { type: Boolean }
332
- },
333
- emits: ["update:modelValue"],
334
- setup(t, { emit: l }) {
335
- const n = l;
336
- return (a, d) => (s(), m("button", {
337
- type: "button",
338
- class: j(["fd-switch", { "is-on": t.modelValue }]),
339
- disabled: t.disabled,
340
- role: "switch",
341
- "aria-checked": t.modelValue,
342
- onClick: d[0] || (d[0] = (i) => n("update:modelValue", !t.modelValue))
343
- }, [...d[1] || (d[1] = [
344
- e("span", { class: "fd-switch-dot" }, null, -1)
345
- ])], 10, It));
346
- }
347
- }), K = /* @__PURE__ */ L(Ft, [["__scopeId", "data-v-eac909bd"]]), Dt = [
348
- // 卡片 / 布局通用
349
- "LayoutGrid",
350
- "PanelTop",
351
- "Folder",
352
- "FolderOpen",
353
- "FileText",
354
- "ClipboardList",
355
- "ClipboardCheck",
356
- // 业务语义(源自 approval-lease.html 卡片:铺位/品牌/合同/递增/免租/计费/预算/招调/指导价)
357
- "MapPin",
358
- "Store",
359
- "Building2",
360
- "Badge",
361
- "Tag",
362
- "CalendarDays",
363
- "TrendingUp",
364
- "Clock",
365
- "Calculator",
366
- "Receipt",
367
- "Target",
368
- "ChartPie",
369
- "ChartLine",
370
- "CircleDollarSign",
371
- // 通用 / 状态
372
- "Briefcase",
373
- "Scale",
374
- "ShieldCheck",
375
- "Sparkles",
376
- "ScanSearch",
377
- "MessageSquareText",
378
- "GitBranch",
379
- "Paperclip",
380
- "Download",
381
- "Upload",
382
- "Network",
383
- "Printer",
384
- "CircleCheck",
385
- "CircleAlert",
386
- "Info",
387
- "Bell",
388
- "Settings",
389
- "User",
390
- "Users",
391
- "Heart",
392
- "Star",
393
- "Lightbulb",
394
- "Award",
395
- "BookOpen",
396
- "Coins",
397
- "Wallet"
398
- ], Lt = { class: "fd-panel" }, Mt = { class: "fd-panel-item" }, Pt = ["value"], Nt = { class: "fd-panel-item" }, Bt = { class: "fd-icon-picker" }, jt = {
399
- key: 1,
400
- class: "fd-icon-placeholder"
401
- }, Et = { class: "fd-icon-grid" }, Ot = ["title", "onClick"], qt = { class: "fd-panel-item" }, Rt = ["value"], At = { class: "fd-panel-item fd-panel-item--row" }, Ut = { class: "fd-panel-item" }, Vt = ["value"], zt = { class: "fd-panel-item" }, Yt = ["value"], Ht = /* @__PURE__ */ D({
402
- __name: "CardPanel",
403
- props: {
404
- node: {},
405
- fields: {}
406
- },
407
- emits: ["update"],
408
- setup(t, { emit: l }) {
409
- const n = l, a = A(!1);
410
- function d(i) {
411
- n("update", { icon: i }), a.value = !1;
412
- }
413
- return (i, o) => (s(), m("div", Lt, [
414
- e("div", Mt, [
415
- o[8] || (o[8] = e("label", null, "标题", -1)),
416
- e("input", {
417
- value: t.node.label,
418
- onInput: o[0] || (o[0] = (c) => n("update", { label: c.target.value }))
419
- }, null, 40, Pt)
420
- ]),
421
- e("div", Nt, [
422
- o[11] || (o[11] = e("label", null, "图标", -1)),
423
- e("div", Bt, [
424
- e("button", {
425
- type: "button",
426
- class: "fd-icon-trigger",
427
- onClick: o[1] || (o[1] = (c) => a.value = !a.value)
428
- }, [
429
- t.node.icon ? (s(), O(oe, {
430
- key: 0,
431
- name: t.node.icon,
432
- size: 16
433
- }, null, 8, ["name"])) : (s(), m("span", jt, "无图标")),
434
- o[9] || (o[9] = e("svg", {
435
- class: "fd-icon-caret",
436
- viewBox: "0 0 24 24",
437
- fill: "none",
438
- stroke: "currentColor",
439
- "stroke-width": "2",
440
- "stroke-linecap": "round",
441
- "stroke-linejoin": "round"
442
- }, [
443
- e("polyline", { points: "6 9 12 15 18 9" })
444
- ], -1))
445
- ]),
446
- a.value ? (s(), m("div", {
447
- key: 0,
448
- class: "fd-icon-popover",
449
- onClick: o[3] || (o[3] = R(() => {
450
- }, ["stop"]))
451
- }, [
452
- e("div", Et, [
453
- e("button", {
454
- type: "button",
455
- class: j(["fd-icon-option", { active: !t.node.icon }]),
456
- title: "无图标",
457
- onClick: o[2] || (o[2] = (c) => d(""))
458
- }, [...o[10] || (o[10] = [
459
- e("span", { class: "fd-icon-none" }, "无", -1)
460
- ])], 2),
461
- (s(!0), m(T, null, F(_(Dt), (c) => (s(), m("button", {
462
- key: c,
463
- type: "button",
464
- class: j(["fd-icon-option", { active: t.node.icon === c }]),
465
- title: c,
466
- onClick: (f) => d(c)
467
- }, [
468
- M(oe, {
469
- name: c,
470
- size: 18
471
- }, null, 8, ["name"])
472
- ], 10, Ot))), 128))
473
- ])
474
- ])) : C("", !0)
475
- ])
476
- ]),
477
- e("div", qt, [
478
- o[12] || (o[12] = e("label", null, "图标底色", -1)),
479
- e("input", {
480
- value: t.node.iconBgColor,
481
- onInput: o[4] || (o[4] = (c) => n("update", { iconBgColor: c.target.value }))
482
- }, null, 40, Rt)
483
- ]),
484
- e("div", At, [
485
- o[13] || (o[13] = e("label", null, "初始展开", -1)),
486
- M(K, {
487
- "model-value": t.node.expanded,
488
- "onUpdate:modelValue": o[5] || (o[5] = (c) => n("update", { expanded: c }))
489
- }, null, 8, ["model-value"])
490
- ]),
491
- e("div", Ut, [
492
- o[14] || (o[14] = e("label", null, "宽度", -1)),
493
- e("input", {
494
- value: t.node.width,
495
- onInput: o[6] || (o[6] = (c) => n("update", { width: c.target.value }))
496
- }, null, 40, Vt)
497
- ]),
498
- e("div", zt, [
499
- o[16] || (o[16] = e("label", null, "是否隐藏", -1)),
500
- e("select", {
501
- value: t.node.hiddenMode || "none",
502
- onChange: o[7] || (o[7] = (c) => n("update", { hiddenMode: c.target.value }))
503
- }, [...o[15] || (o[15] = [
504
- e("option", { value: "none" }, "不隐藏", -1),
505
- e("option", { value: "start" }, "发起时隐藏", -1),
506
- e("option", { value: "not-start" }, "非发起时隐藏", -1),
507
- e("option", { value: "not-approval" }, "非审批时隐藏", -1)
508
- ])], 40, Yt)
509
- ])
510
- ]));
511
- }
512
- }), Wt = /* @__PURE__ */ L(Ht, [["__scopeId", "data-v-4585a5b8"]]), Gt = {
513
- type: "card",
514
- title: "卡片容器",
515
- design: wt,
516
- render: St,
517
- panel: Wt,
518
- isContainer: !0,
519
- createDefaultProps: () => ({
520
- id: "",
521
- type: "card",
522
- label: "卡片标题",
523
- bindField: "",
524
- icon: "",
525
- iconBgColor: "",
526
- expanded: !0,
527
- width: "",
528
- hiddenMode: "none",
529
- children: []
530
- }),
531
- serialize: (t) => t
532
- }, Jt = { class: "fd-slot-design" }, Qt = { class: "fd-slot-name" }, Zt = { class: "fd-slot-hint" }, Kt = /* @__PURE__ */ D({
533
- __name: "SlotDesign",
534
- props: {
535
- node: {}
536
- },
537
- setup(t) {
538
- return (l, n) => (s(), m("div", Jt, [
539
- n[0] || (n[0] = e("span", { class: "fd-slot-tag" }, "插槽", -1)),
540
- e("span", Qt, h(t.node.slotName || "未命名插槽"), 1),
541
- e("span", Zt, "宿主注入:" + h(t.node.slotName), 1)
542
- ]));
543
- }
544
- }), Xt = /* @__PURE__ */ L(Kt, [["__scopeId", "data-v-d3fbc11d"]]), en = {
545
- key: 0,
546
- class: "fd-slot-render"
547
- }, tn = { class: "fd-slot-missing" }, nn = /* @__PURE__ */ D({
548
- __name: "SlotRender",
549
- props: {
550
- node: {},
551
- mode: {},
552
- formId: {},
553
- formData: {}
554
- },
555
- setup(t) {
556
- return (l, n) => {
557
- var a;
558
- return _(Te)(t.node.hiddenMode, (a = t.formData) == null ? void 0 : a.status) ? C("", !0) : (s(), m("div", en, [
559
- W(l.$slots, t.node.slotName, {
560
- node: t.node,
561
- formData: t.formData,
562
- mode: t.mode,
563
- formId: t.formId
564
- }, () => [
565
- e("div", tn, "未注入插槽:" + h(t.node.slotName), 1)
566
- ], !0)
567
- ]));
568
- };
569
- }
570
- }), ln = /* @__PURE__ */ L(nn, [["__scopeId", "data-v-10795159"]]), on = { class: "fd-panel" }, an = { class: "fd-panel-item" }, dn = ["value"], sn = { class: "fd-panel-item" }, rn = ["value"], cn = { class: "fd-panel-item" }, un = ["value"], mn = /* @__PURE__ */ D({
571
- __name: "SlotPanel",
572
- props: {
573
- node: {},
574
- fields: {}
575
- },
576
- emits: ["update"],
577
- setup(t, { emit: l }) {
578
- const n = l;
579
- return (a, d) => (s(), m("div", on, [
580
- e("div", an, [
581
- d[3] || (d[3] = e("label", null, "标题", -1)),
582
- e("input", {
583
- value: t.node.label,
584
- onInput: d[0] || (d[0] = (i) => n("update", { label: i.target.value }))
585
- }, null, 40, dn)
586
- ]),
587
- e("div", sn, [
588
- d[4] || (d[4] = e("label", null, "插槽名", -1)),
589
- e("input", {
590
- value: t.node.slotName,
591
- placeholder: "如 header / basic-info",
592
- onInput: d[1] || (d[1] = (i) => n("update", { slotName: i.target.value }))
593
- }, null, 40, rn)
594
- ]),
595
- e("div", cn, [
596
- d[6] || (d[6] = e("label", null, "是否隐藏", -1)),
597
- e("select", {
598
- value: t.node.hiddenMode || "none",
599
- onChange: d[2] || (d[2] = (i) => n("update", { hiddenMode: i.target.value }))
600
- }, [...d[5] || (d[5] = [
601
- e("option", { value: "none" }, "不隐藏", -1),
602
- e("option", { value: "start" }, "发起时隐藏", -1),
603
- e("option", { value: "not-start" }, "非发起时隐藏", -1),
604
- e("option", { value: "not-approval" }, "非审批时隐藏", -1)
605
- ])], 40, un)
606
- ])
607
- ]));
608
- }
609
- }), fn = /* @__PURE__ */ L(mn, [["__scopeId", "data-v-4c380320"]]), pn = {
610
- type: "slot",
611
- title: "插槽",
612
- design: Xt,
613
- render: ln,
614
- panel: fn,
615
- isContainer: !1,
616
- createDefaultProps: () => ({
617
- id: "",
618
- type: "slot",
619
- label: "插槽",
620
- bindField: "",
621
- slotName: "",
622
- slotProps: {},
623
- hiddenMode: "none"
624
- }),
625
- serialize: (t) => t
626
- }, bn = { class: "fd-st-design" }, vn = {
627
- key: 0,
628
- class: "fd-st-table-wrap"
629
- }, gn = { class: "fd-st-table" }, yn = {
630
- key: 0,
631
- class: "fd-st-seq"
632
- }, hn = {
633
- key: 0,
634
- class: "fd-st-seq"
635
- }, _n = {
636
- key: 1,
637
- class: "fd-st-cards"
638
- }, kn = { class: "fd-st-card" }, wn = { class: "fd-st-card-label" }, xn = {
639
- key: 0,
640
- class: "fd-st-cards-empty"
641
- }, $n = /* @__PURE__ */ D({
642
- __name: "SubtableDesign",
643
- props: {
644
- node: {}
645
- },
646
- setup(t) {
647
- const l = t, n = I(() => l.node.tablestyle !== "cards");
648
- return (a, d) => (s(), m("div", bn, [
649
- n.value ? (s(), m("div", vn, [
650
- e("table", gn, [
651
- e("thead", null, [
652
- e("tr", null, [
653
- t.node.secondtableindex === "1" ? (s(), m("th", yn, "序号")) : C("", !0),
654
- (s(!0), m(T, null, F(t.node.colnums.filter((i) => i.isshow === 1), (i) => (s(), m("th", {
655
- key: i.name,
656
- style: U({ width: i.showwidth || void 0 })
657
- }, h(i.showname || i.major || i.name), 5))), 128))
658
- ])
659
- ]),
660
- e("tbody", null, [
661
- e("tr", null, [
662
- t.node.secondtableindex === "1" ? (s(), m("td", hn, "1")) : C("", !0),
663
- (s(!0), m(T, null, F(t.node.colnums.filter((i) => i.isshow === 1), (i) => (s(), m("td", {
664
- key: i.name,
665
- class: j(["fd-st-cell", { "fd-st-cell--link": !!i.bindLink }])
666
- }, h(i.name), 3))), 128))
667
- ])
668
- ])
669
- ])
670
- ])) : (s(), m("div", _n, [
671
- e("div", kn, [
672
- (s(!0), m(T, null, F(t.node.colnums.filter((i) => i.isshow === 1), (i) => (s(), m("div", {
673
- key: i.name,
674
- class: "fd-st-card-row"
675
- }, [
676
- e("span", wn, h(i.showname || i.major), 1),
677
- e("span", {
678
- class: j(["fd-st-card-value", { "fd-st-card-value--link": !!i.bindLink }])
679
- }, h(i.name), 3)
680
- ]))), 128))
681
- ]),
682
- t.node.colnums.filter((i) => i.isshow === 1).length === 0 ? (s(), m("div", xn, " 暂无列配置 ")) : C("", !0)
683
- ]))
684
- ]));
685
- }
686
- }), Cn = /* @__PURE__ */ L($n, [["__scopeId", "data-v-aba8caec"]]), Tn = ["subtable-key"], Sn = {
687
- key: 0,
688
- class: "fd-st-table-wrap"
689
- }, In = { class: "fd-st-table" }, Fn = {
690
- key: 0,
691
- class: "fd-st-seq"
692
- }, Dn = ["subtable-val"], Ln = {
693
- key: 1,
694
- class: "fd-st-op"
695
- }, Mn = {
696
- key: 0,
697
- class: "fd-st-seq"
698
- }, Pn = ["rowspan", "subtable-val"], Nn = ["href"], Bn = {
699
- key: 1,
700
- class: "fd-st-op"
701
- }, jn = ["onClick"], En = { key: 0 }, On = ["colspan"], qn = {
702
- key: 1,
703
- class: "fd-st-cards"
704
- }, Rn = { class: "fd-st-card-label" }, An = ["subtable-val"], Un = ["href"], Vn = {
705
- key: 0,
706
- class: "fd-st-card-actions"
707
- }, zn = ["onClick"], Yn = {
708
- key: 0,
709
- class: "fd-st-cards-empty"
710
- }, Hn = /* @__PURE__ */ D({
711
- __name: "SubtableRender",
712
- props: {
713
- node: {},
714
- formData: {}
715
- },
716
- setup(t) {
717
- const l = t, n = I(() => l.node.colnums.filter((x) => x.isshow === 1)), a = I(() => l.node.isreadonly === "1"), d = I(() => {
718
- var S;
719
- const x = (S = l.formData) == null ? void 0 : S[l.node.secondtable];
720
- return Array.isArray(x) ? x : [];
721
- }), i = I(() => !(l.node.nodatahidetable === "1" && d.value.length === 0)), o = I(() => l.node.tablestyle !== "cards");
722
- function c() {
723
- if (a.value) return;
724
- const x = {};
725
- n.value.forEach((S) => x[S.name] = ""), l.formData && Array.isArray(l.formData[l.node.secondtable]) && l.formData[l.node.secondtable].push(x);
726
- }
727
- function f(x) {
728
- a.value || l.formData && Array.isArray(l.formData[l.node.secondtable]) && l.formData[l.node.secondtable].splice(x, 1);
729
- }
730
- function p(x, S) {
731
- const b = x[S];
732
- return b == null ? "" : String(b);
733
- }
734
- function v(x, S) {
735
- return x.bindLink ? p(S, x.bindLink) : "";
736
- }
737
- const w = I(() => {
738
- const x = d.value, S = [], b = [];
739
- return n.value.forEach((y, k) => {
740
- S[k] = [], b[k] = [];
741
- const N = y.issamecolmerge === 1;
742
- let $ = 0;
743
- for (let r = 0; r < x.length; r++) {
744
- const u = p(x[r], y.name);
745
- N && u !== "" && r > 0 && u === p(x[r - 1], y.name) ? (b[k][r] = !0, S[k][$] += 1) : (b[k][r] = !1, S[k][r] = 1, $ = r);
746
- }
747
- }), { spans: S, skipped: b };
748
- });
749
- function B(x, S) {
750
- var b;
751
- return ((b = w.value.skipped[x]) == null ? void 0 : b[S]) === !0;
752
- }
753
- function q(x, S) {
754
- var y;
755
- const b = (y = w.value.spans[x]) == null ? void 0 : y[S];
756
- return b && b > 1 ? b : void 0;
757
- }
758
- return (x, S) => i.value ? (s(), m("div", {
759
- key: 0,
760
- class: "fd-st-render",
761
- "subtable-key": t.node.secondtable
762
- }, [
763
- o.value ? (s(), m("div", Sn, [
764
- e("table", In, [
765
- e("thead", null, [
766
- e("tr", null, [
767
- t.node.secondtableindex === "1" ? (s(), m("th", Fn, "序号")) : C("", !0),
768
- (s(!0), m(T, null, F(n.value, (b) => (s(), m("th", {
769
- key: b.name,
770
- "subtable-val": b.name,
771
- style: U({ width: b.showwidth || void 0, textAlign: b.align || "left" })
772
- }, h(b.showname || b.major || b.name), 13, Dn))), 128)),
773
- a.value ? C("", !0) : (s(), m("th", Ln, "操作"))
774
- ])
775
- ]),
776
- e("tbody", null, [
777
- (s(!0), m(T, null, F(d.value, (b, y) => (s(), m("tr", { key: y }, [
778
- t.node.secondtableindex === "1" ? (s(), m("td", Mn, h(y + 1), 1)) : C("", !0),
779
- (s(!0), m(T, null, F(n.value, (k, N) => (s(), m(T, {
780
- key: k.name
781
- }, [
782
- B(N, y) ? C("", !0) : (s(), m("td", {
783
- key: 0,
784
- rowspan: q(N, y),
785
- "subtable-val": k.name,
786
- style: U({ textAlign: k.align || "left", color: k.prospect || void 0, background: k.background || void 0 })
787
- }, [
788
- v(k, b) ? (s(), m("a", {
789
- key: 0,
790
- class: "fd-st-link",
791
- href: v(k, b),
792
- target: "_blank",
793
- rel: "noopener noreferrer"
794
- }, h(p(b, k.name)), 9, Nn)) : (s(), m(T, { key: 1 }, [
795
- E(h(p(b, k.name)), 1)
796
- ], 64))
797
- ], 12, Pn))
798
- ], 64))), 128)),
799
- a.value ? C("", !0) : (s(), m("td", Bn, [
800
- e("button", {
801
- class: "fd-btn fd-btn--danger",
802
- onClick: (k) => f(y)
803
- }, "删除", 8, jn)
804
- ]))
805
- ]))), 128)),
806
- d.value.length === 0 ? (s(), m("tr", En, [
807
- e("td", {
808
- colspan: n.value.length + (t.node.secondtableindex === "1" ? 1 : 0) + (a.value ? 0 : 1),
809
- class: "fd-st-empty"
810
- }, h(t.node.nodatatitle === "1" ? "暂无数据" : ""), 9, On)
811
- ])) : C("", !0)
812
- ])
813
- ])
814
- ])) : (s(), m("div", qn, [
815
- (s(!0), m(T, null, F(d.value, (b, y) => (s(), m("div", {
816
- key: y,
817
- class: "fd-st-card"
818
- }, [
819
- (s(!0), m(T, null, F(n.value, (k) => (s(), m("div", {
820
- key: k.name,
821
- class: "fd-st-card-row"
822
- }, [
823
- e("span", Rn, h(k.showname || k.major || k.name), 1),
824
- e("span", {
825
- class: "fd-st-card-value",
826
- "subtable-val": k.name
827
- }, [
828
- v(k, b) ? (s(), m("a", {
829
- key: 0,
830
- class: "fd-st-link",
831
- href: v(k, b),
832
- target: "_blank",
833
- rel: "noopener noreferrer"
834
- }, h(p(b, k.name)), 9, Un)) : (s(), m(T, { key: 1 }, [
835
- E(h(p(b, k.name)), 1)
836
- ], 64))
837
- ], 8, An)
838
- ]))), 128)),
839
- a.value ? C("", !0) : (s(), m("div", Vn, [
840
- e("button", {
841
- class: "fd-btn fd-btn--danger fd-btn--sm",
842
- onClick: (k) => f(y)
843
- }, "删除", 8, zn)
844
- ]))
845
- ]))), 128)),
846
- d.value.length === 0 ? (s(), m("div", Yn, h(t.node.nodatatitle === "1" ? "暂无数据" : ""), 1)) : C("", !0)
847
- ])),
848
- a.value ? C("", !0) : (s(), m("button", {
849
- key: 2,
850
- class: "fd-btn fd-btn--primary fd-st-add",
851
- onClick: c
852
- }, "新增一行"))
853
- ], 8, Tn)) : C("", !0);
854
- }
855
- }), Wn = /* @__PURE__ */ L(Hn, [["__scopeId", "data-v-a650847e"]]), Gn = "2743c35b-2138-4214-b736-6d709bd0b463", Jn = "SG_ZL_YYQHTSP", Qn = [{ name: "contract_no", label: "合同编号", dataType: "string" }, { name: "process_subject", label: "流程主题", dataType: "string" }, { name: "applicant", label: "申请人", dataType: "string" }, { name: "organization", label: "所属组织", dataType: "string" }, { name: "applicant_position", label: "申请人职位", dataType: "string" }, { name: "apply_time", label: "申请时间", dataType: "date" }, { name: "contract_name", label: "合同名称", dataType: "string" }, { name: "sign_date", label: "签订日期", dataType: "date" }, { name: "merchant_name", label: "商户名称", dataType: "string" }, { name: "brand_name", label: "品牌名称", dataType: "string" }, { name: "pay_type", label: "支付类型", dataType: "string" }, { name: "shop_no", label: "铺位号", dataType: "string" }, { name: "shop_type", label: "铺位类型", dataType: "string" }, { name: "rent_area", label: "计租面积(㎡)", dataType: "number" }, { name: "rent_amount", label: "租金金额", dataType: "money" }, { name: "contract_start_date", label: "合同开始日期", dataType: "date" }, { name: "contract_end_date", label: "合同结束日期", dataType: "date" }, { name: "special_clause", label: "特殊条款", dataType: "string" }, { name: "contract_url", label: "合同链接", dataType: "link" }, { name: "contract_view", label: "合同查看", dataType: "link" }, { name: "business_category", label: "业态分类", dataType: "string" }, { name: "e_sign_rate", label: "电签率", dataType: "number" }, { name: "notify_email", label: "指定送达邮箱", dataType: "string" }, { name: "has_stored_card", label: "是否存在储值卡业务", dataType: "string" }, { name: "prev_rent", label: "上手租费", dataType: "string" }, { name: "is_lag", label: "是否滞后", dataType: "string" }, { name: "is_e_sign", label: "是否电签", dataType: "string" }, { name: "contract_text_type", label: "合同文本类型", dataType: "string" }, { name: "merchant_detail", label: "查看商户明细", dataType: "link" }, { name: "lease_increase_rate", label: "招商递增率", dataType: "number" }, { name: "exclusive_clause", label: "排他条款", dataType: "string" }, { name: "is_substantial", label: "是否实质性招商", dataType: "string" }, { name: "tuning_summary", label: "招调概要", dataType: "string" }, { name: "orig_shop", label: "原铺", dataType: "string" }, { name: "orig_area", label: "原面积", dataType: "string" }, { name: "cur_shop", label: "现铺", dataType: "string" }, { name: "cur_area", label: "现面积", dataType: "string" }, { name: "orig_brand", label: "原品牌", dataType: "string" }, { name: "orig_level", label: "原级次", dataType: "string" }, { name: "orig_category", label: "原业态", dataType: "string" }, { name: "cur_brand", label: "现品牌", dataType: "string" }, { name: "cur_level", label: "现级次", dataType: "string" }, { name: "cur_category", label: "现业态", dataType: "string" }, { name: "orig_contract_period", label: "原合同周期", dataType: "string" }, { name: "cur_contract_period", label: "现合同周期", dataType: "string" }, { name: "rent_increase_clause", label: "租金递增", dataType: "string" }, { name: "fee_increase_clause", label: "管理费递增", dataType: "string" }, { name: "rent_deco_free", label: "租金装修免租", dataType: "string" }, { name: "rent_oper_free", label: "租金经营免租", dataType: "string" }, { name: "rent_deposit", label: "租金租押方式", dataType: "string" }, { name: "fee_deposit", label: "管理费租押方式", dataType: "string" }, { name: "rent_billing", label: "租金计费", dataType: "string" }, { name: "fee_billing", label: "管理费计费", dataType: "string" }, { name: "est_sales", label: "预估销售额", dataType: "string" }, { name: "electricity_calc", label: "电费计算方式", dataType: "string" }, { name: "electricity_price_type", label: "电价方式", dataType: "string" }, { name: "electricity_unit_price", label: "电费单价", dataType: "number" }, { name: "peak_price", label: "尖-电价", dataType: "number" }, { name: "valley_price", label: "谷-电价", dataType: "number" }, { name: "flat_price", label: "平-电价", dataType: "number" }, { name: "peak_high_price", label: "峰-电价", dataType: "number" }, { name: "deep_valley_price", label: "深谷-电价", dataType: "number" }], Zn = /* @__PURE__ */ JSON.parse('[{"id":"slot_mv8yu32v_hmt1w","type":"slot","label":"插槽","bindField":"","slotName":"header","slotProps":{}},{"id":"card_mv948xwd_0jvhg","type":"card","label":"基本信息","bindField":"","icon":"FileText","iconBgColor":"","expanded":true,"width":"","children":[{"id":"slot_mv949tn3_7tqic","type":"slot","label":"插槽","bindField":"","slotName":"base-info","slotProps":{}}]},{"id":"card_basic","type":"card","label":"商户信息","bindField":"","icon":"ClipboardList","iconBgColor":"","expanded":true,"width":"","children":[{"id":"grid_mv94fkna_a3hnc","type":"grid","label":"栅栏格","bindField":"","layout":8,"children":[{"id":"label_mv94fm19_vat4d","type":"label","label":"商户名称","bindField":"merchant_name","bindLink":"","gridSpan":8},{"id":"label_mv94gbdj_nvp81","type":"label","label":"品牌名称","bindField":"brand_name","bindLink":"merchant_detail","gridSpan":8},{"id":"label_mv94fymx_chyxm","type":"label","label":"支付类型","bindField":"pay_type","bindLink":"","gridSpan":8},{"id":"label_mv94gdg9_6j0i2","type":"label","label":"铺位号","bindField":"shop_no","bindLink":"","gridSpan":8},{"id":"label_mv94gft8_uldyd","type":"label","label":"铺位类型","bindField":"shop_type","bindLink":"","gridSpan":8},{"id":"label_mv94geqb_8vzuj","type":"label","label":"计租面积(㎡)","bindField":"rent_area","bindLink":"","gridSpan":8},{"id":"label_mv94gm46_0k0ma","type":"label","label":"合同开始日期","bindField":"contract_start_date","bindLink":"","gridSpan":8},{"id":"label_mv94ggzd_levm8","type":"label","label":"合同结束日期","bindField":"contract_end_date","bindLink":"","gridSpan":8},{"id":"label_mv94fqqu_ty2qv","type":"label","label":"特殊条款","bindField":"special_clause","bindLink":"","gridSpan":8},{"id":"label_mv94gon3_3atfb","type":"label","label":"合同查看","bindField":"contract_view","bindLink":"contract_url","gridSpan":24},{"id":"label_mv94gn83_sbqqq","type":"label","label":"业态分类","bindField":"business_category","bindLink":"","gridSpan":8},{"id":"label_mv94fzx4_j4ehr","type":"label","label":"电签率","bindField":"e_sign_rate","bindLink":"","gridSpan":8},{"id":"label_mv94gl3d_d1rk8","type":"label","label":"指定送达邮箱","bindField":"notify_email","bindLink":"","gridSpan":8},{"id":"label_mv94gj3q_pan4s","type":"label","label":"是否存在储值卡业务","bindField":"has_stored_card","bindLink":"","gridSpan":8},{"id":"label_mv94g1eu_of3la","type":"label","label":"上手租费","bindField":"prev_rent","bindLink":"","gridSpan":8},{"id":"label_mv94gs5r_igebr","type":"label","label":"是否滞后","bindField":"is_lag","bindLink":"","gridSpan":8,"color":"#ff3b30"},{"id":"label_mv94gcd4_umma1","type":"label","label":"是否电签","bindField":"is_e_sign","bindLink":"","gridSpan":8},{"id":"label_mv94gk4f_5wrbq","type":"label","label":"合同文本类型","bindField":"contract_text_type","bindLink":"","gridSpan":8},{"id":"label_mv94fnco_ovqct","type":"label","label":"查看商户明细","bindField":"merchant_detail","bindLink":"","gridSpan":8},{"id":"label_mv94foq3_zpe1l","type":"label","label":"招商递增率","bindField":"lease_increase_rate","bindLink":"","gridSpan":8},{"id":"label_mv94fve1_p8lbm","type":"label","label":"排他条款","bindField":"exclusive_clause","bindLink":"","gridSpan":8},{"id":"label_mv94fx1e_grzdz","type":"label","label":"是否实质性招商","bindField":"is_substantial","bindLink":"","gridSpan":8}]}]},{"id":"card_mv8ytz6g_pnv2y","type":"card","label":"招调信息","bindField":"","icon":"Tag","iconBgColor":"","expanded":true,"width":"","children":[{"id":"slot_mv94q6d4_2ddhk","type":"slot","label":"插槽","bindField":"","slotName":"nine-grid","slotProps":{}}]},{"id":"card_mv94pk1g_j5jrt","type":"card","label":"水电费信息","bindField":"","icon":"Receipt","iconBgColor":"","expanded":true,"width":"","children":[{"id":"grid_mv94soxq_e494j","type":"grid","label":"栅栏格","bindField":"","layout":8,"children":[{"id":"label_mv94svdn_2gx31","type":"label","label":"电费计算方式","bindField":"electricity_calc","bindLink":"","gridSpan":8},{"id":"label_mv94t0i4_fwndk","type":"label","label":"电价方式","bindField":"electricity_price_type","bindLink":"","gridSpan":16},{"id":"label_mv94suc8_o298g","type":"label","label":"电费单价","bindField":"electricity_unit_price","bindLink":"","gridSpan":8},{"id":"label_mv94szdk_o9098","type":"label","label":"尖-电价","bindField":"peak_price","bindLink":"","gridSpan":8},{"id":"label_mv94sy7f_htxqt","type":"label","label":"谷-电价","bindField":"valley_price","bindLink":"","gridSpan":8},{"id":"label_mv94st4c_ecb3x","type":"label","label":"平-电价","bindField":"flat_price","bindLink":"","gridSpan":8},{"id":"label_mv94srpm_y47eq","type":"label","label":"峰-电价","bindField":"peak_high_price","bindLink":"","gridSpan":8},{"id":"label_mv94sqc7_6qp3h","type":"label","label":"深谷-电价","bindField":"deep_valley_price","bindLink":"","gridSpan":8}]}]},{"id":"slot_mv96miro_zlbdb","type":"slot","label":"插槽","bindField":"","slotName":"link-btn","slotProps":{}},{"id":"card_sub_quit","type":"card","label":"原合同退租信息","bindField":"","icon":"Store","iconBgColor":"","expanded":true,"width":"","children":[{"id":"sub退租","type":"subtable","label":"原合同退租信息","bindField":"","firsttable":"SG_ZL_YYQHTSP","secondtable":"SG_ZL_YYQHTSPC","primarytablefiled":"ID","secondtableprimarykey":"ID","secondtablerelationfield":"PARENT_ID","tabletype":"subtable","displaytitle":"原合同退租信息","isreadonly":"1","isnull":"0","issave":"0","secondtableindex":"0","nodatahidetable":"0","nodatatitle":"1","fixedcolumn":0,"tablewidth":0,"tableheight":0,"iscompletehide":"0","iscompletehidecode":"","events":[],"colnums":[{"name":"shop_no","isshow":1,"major":"","showname":"铺位号","showwidth":"","background":"","prospect":"","issum":0,"index":1,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"brand_name","isshow":1,"major":"","showname":"品牌名称","showwidth":"","background":"","prospect":"","issum":0,"index":2,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"quit_reason","isshow":1,"major":"","showname":"合同退租原因","showwidth":"","background":"","prospect":"","issum":0,"index":3,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"quit_date","isshow":1,"major":"","showname":"合同退租日期","showwidth":"","background":"","prospect":"","issum":0,"index":4,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"deduct_amount","isshow":1,"major":"","showname":"合同扣款金额","showwidth":"","background":"","prospect":"","issum":0,"index":5,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"detail","isshow":1,"major":"","showname":"详情","showwidth":"","background":"","prospect":"","issum":0,"index":6,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[],"bindLink":"detail_url"}],"tablestyle":"table"}]},{"id":"card_mv94urk8_4xj55","type":"card","label":"预算完成情况预测(万元)","bindField":"","icon":"ChartLine","iconBgColor":"","expanded":true,"width":"","children":[{"id":"subtable_mv94vx0w_7zpmc","type":"subtable","label":"子表","bindField":"","firsttable":"","secondtable":"SG_ZL_YYQHTYS","primarytablefiled":"","secondtableprimarykey":"","secondtablerelationfield":"","tabletype":"subtable","displaytitle":"预算完成情况预测","isreadonly":"1","isnull":"0","issave":"0","secondtableindex":"0","nodatahidetable":"0","nodatatitle":"1","fixedcolumn":0,"tablewidth":0,"tableheight":0,"iscompletehide":"0","iscompletehidecode":"","colnums":[{"name":"calibers","isshow":1,"major":"","showname":"测算口径","showwidth":"","background":"","prospect":"","issum":0,"index":1,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[],"issamecolmerge":1},{"name":"fee_item","isshow":1,"major":"","showname":"费项","showwidth":"","background":"","prospect":"","issum":0,"index":2,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"annual_budget","isshow":1,"major":"","showname":"年度预算(A)","showwidth":"","background":"","prospect":"","issum":0,"index":3,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"contract_receivable","isshow":1,"major":"","showname":"合同应收(B)","showwidth":"","background":"","prospect":"","issum":0,"index":4,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"budget_gap","isshow":1,"major":"","showname":"预算缺口(C=B-A)","showwidth":"","background":"","prospect":"","issum":0,"index":5,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"forecast_income","isshow":1,"major":"","showname":"预测收入(D)","showwidth":"","background":"","prospect":"","issum":0,"index":6,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"forecast_gap","isshow":1,"major":"","showname":"预测缺口(E=D-A)","showwidth":"","background":"","prospect":"","issum":0,"index":7,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]},{"name":"light","isshow":1,"major":"","showname":"亮灯提示","showwidth":"","background":"","prospect":"","issum":0,"index":8,"align":"","iscompletehide":0,"iscompletehidecode":"","editmode":{"editmode":"text","title":"文本"},"events":[]}],"events":[]}]},{"id":"card_mv94uthb_9bilg","type":"card","label":"合同列表","bindField":"","icon":"Folder","iconBgColor":"","expanded":true,"width":"","children":[{"id":"slot_mv94y878_xa1i4","type":"slot","label":"插槽","bindField":"","slotName":"ht-list","slotProps":{}}]},{"id":"card_mvasx0tg_tii1g","type":"card","label":"交办记录","bindField":"","icon":"LayoutGrid","iconBgColor":"","expanded":true,"width":"","hiddenMode":"start","children":[{"id":"slot_mvasx3k5_feyrh","type":"slot","label":"插槽","bindField":"","slotName":"assignment-record","slotProps":{},"hiddenMode":"none"}]},{"id":"card_mv96jn84_geyfi","type":"card","label":"附件信息","bindField":"","icon":"Paperclip","iconBgColor":"","expanded":true,"width":"","children":[{"id":"slot_mv96kpam_vfbhy","type":"slot","label":"插槽","bindField":"","slotName":"file-list","slotProps":{}}]},{"id":"card_mv94uuj2_1c3kq","type":"card","label":"AI风险识别与审批意见","bindField":"","icon":"Sparkles","iconBgColor":"","expanded":true,"width":"","children":[{"id":"slot_mv94ywq4_eix4j","type":"slot","label":"插槽","bindField":"","slotName":"ai-approval","slotProps":{}}],"hiddenMode":"not-start"},{"id":"card_mv97t5ic_sps4y","type":"card","label":"发起人意见","bindField":"","icon":"MessageSquareText","iconBgColor":"","expanded":true,"width":"","children":[{"id":"slot_mv97tuvs_18x3d","type":"slot","label":"插槽","bindField":"","slotName":"initiate-opinions","slotProps":{}}],"hiddenMode":"not-start"},{"id":"card_mvaq3igb_xqh7h","type":"card","label":"退回详情","bindField":"","icon":"Lightbulb","iconBgColor":"","expanded":true,"width":"","hiddenMode":"start","children":[{"id":"slot_mvaq4yqc_uq4a4","type":"slot","label":"插槽","bindField":"","slotName":"return-details","slotProps":{},"hiddenMode":"none"}]},{"id":"card_mvan876u_biqq8","type":"card","label":"审批记录","bindField":"","icon":"ShieldCheck","iconBgColor":"","expanded":true,"width":"","hiddenMode":"not-approval","children":[{"id":"slot_mvan8xqf_oi0f5","type":"slot","label":"插槽","bindField":"","slotName":"approval-list","slotProps":{},"hiddenMode":"none"}]},{"id":"card_mvac8wl9_7h9gz","type":"card","label":"审批流程","bindField":"","icon":"Users","iconBgColor":"","expanded":true,"width":"","children":[{"id":"slot_mv9gtox1_mzty4","type":"slot","label":"插槽","bindField":"","slotName":"approval-process","slotProps":{}}],"hiddenMode":"not-start"},{"id":"card_mvanow88_b61rf","type":"card","label":"审批意见","bindField":"","icon":"User","iconBgColor":"","expanded":true,"width":"","hiddenMode":"not-approval","children":[{"id":"slot_mvanp06x_40njy","type":"slot","label":"插槽","bindField":"","slotName":"approval-opinions","slotProps":{},"hiddenMode":"none"}]},{"id":"slot_mv950x2c_zsxtw","type":"slot","label":"插槽","bindField":"","slotName":"footer","slotProps":{}}]'), Kn = { lifecycle: {}, custom: [] }, Xn = {
856
- formId: Gn,
857
- dbtable: Jn,
858
- fields: Qn,
859
- widgets: Zn,
860
- events: Kn
861
- }, Se = [
862
- {
863
- name: "SG_ZL_YYQHTSPC",
864
- label: "原合同退租信息",
865
- fields: [
866
- { name: "shop_no", label: "铺位号", dataType: "string" },
867
- { name: "brand_name", label: "品牌名称", dataType: "string" },
868
- { name: "quit_reason", label: "合同退租原因", dataType: "string" },
869
- { name: "quit_date", label: "合同退租日期", dataType: "date" },
870
- { name: "deduct_amount", label: "合同扣款金额", dataType: "money" },
871
- { name: "detail", label: "详情", dataType: "string" },
872
- { name: "detail_url", label: "详情链接", dataType: "link" }
873
- ]
874
- },
875
- {
876
- name: "SG_ZL_YYQHTYS",
877
- label: "预算完成情况预测",
878
- fields: [
879
- { name: "calibers", label: "测算口径", dataType: "string" },
880
- { name: "fee_item", label: "费项", dataType: "string" },
881
- { name: "annual_budget", label: "年度预算(A)", dataType: "money" },
882
- { name: "contract_receivable", label: "合同应收(B)", dataType: "money" },
883
- { name: "budget_gap", label: "预算缺口(C=B-A)", dataType: "money" },
884
- { name: "forecast_income", label: "预测收入(D)", dataType: "money" },
885
- { name: "forecast_gap", label: "预测缺口(E=D-A)", dataType: "money" },
886
- { name: "light", label: "亮灯提示", dataType: "string" }
887
- ]
888
- },
889
- {
890
- name: "SG_ZL_YYQHTHT",
891
- label: "合同列表",
892
- fields: [
893
- { name: "seq", label: "序号", dataType: "number" },
894
- { name: "contract_type", label: "合同类型", dataType: "string" },
895
- { name: "contract_name", label: "合同名称", dataType: "string" },
896
- { name: "party_a", label: "甲方", dataType: "string" },
897
- { name: "party_b", label: "乙方", dataType: "string" },
898
- { name: "use_template", label: "使用合同模版", dataType: "string" },
899
- { name: "operate", label: "操作", dataType: "string" }
900
- ]
901
- },
902
- {
903
- name: "SG_ZL_YYQHTJB",
904
- label: "交办记录",
905
- fields: [
906
- { name: "original_approver", label: "原审批人", dataType: "string" },
907
- { name: "delegate_to", label: "交办人", dataType: "string" },
908
- { name: "delegate_time", label: "交办时间", dataType: "date" },
909
- { name: "delegate_opinion", label: "交办意见", dataType: "string" }
910
- ]
911
- },
912
- {
913
- name: "SG_ZL_YYQHTFJ",
914
- label: "附件信息",
915
- fields: [
916
- { name: "seq", label: "序号", dataType: "number" },
917
- { name: "attachment_type", label: "附件类型", dataType: "string" },
918
- { name: "file_name", label: "文件名称", dataType: "file" },
919
- { name: "upload_user", label: "上传人", dataType: "string" },
920
- { name: "upload_time", label: "上传时间", dataType: "date" }
921
- ]
922
- },
923
- {
924
- name: "SG_ZL_YYQHTTH",
925
- label: "退回详情",
926
- fields: [
927
- { name: "approver", label: "审批人", dataType: "string" },
928
- { name: "description", label: "说明", dataType: "string" },
929
- { name: "reject_reason", label: "退回原因", dataType: "string" },
930
- { name: "reject_time", label: "时间", dataType: "date" }
931
- ]
932
- },
933
- {
934
- name: "SG_ZL_YYQHTFK",
935
- label: "合同付款计划",
936
- fields: [
937
- { name: "pay_phase", label: "期次", dataType: "string" },
938
- { name: "pay_amount", label: "金额", dataType: "money" },
939
- { name: "pay_date", label: "计划付款日", dataType: "date" },
940
- { name: "pay_status", label: "状态", dataType: "string" }
941
- ]
942
- }
943
- ], el = Se.map((t) => ({ name: t.name, label: t.label }));
944
- function pe(t) {
945
- return Se.find((l) => l.name === t);
946
- }
947
- function tl(t) {
948
- return t.fields.map((l, n) => {
949
- const a = l.dataType === "file";
950
- return {
951
- name: l.name,
952
- isshow: 1,
953
- major: "",
954
- showname: l.label,
955
- showwidth: "",
956
- background: "",
957
- prospect: "",
958
- issum: 0,
959
- index: n + 1,
960
- align: "",
961
- iscompletehide: 0,
962
- iscompletehidecode: "",
963
- issamecolmerge: 0,
964
- bindLink: "",
965
- editmode: { editmode: a ? "files" : "text", title: a ? "文件" : "文本" },
966
- events: []
967
- };
968
- });
969
- }
970
- function nl(t) {
971
- return {
972
- ...Xn,
973
- formId: t
974
- };
975
- }
976
- const ll = { class: "fd-panel" }, ol = { class: "fd-panel-item" }, al = { class: "fd-panel-item fd-panel-item--row" }, dl = { class: "fd-panel-item fd-panel-item--row" }, il = { class: "fd-panel-item" }, sl = { class: "fd-panel-item" }, rl = { class: "fd-cols-head" }, cl = {
977
- key: 0,
978
- class: "fd-cols-empty"
979
- }, ul = { class: "fd-col-card-top" }, ml = { class: "fd-col-order" }, fl = { class: "fd-col-meta" }, pl = { class: "fd-col-title" }, bl = { class: "fd-col-name-sub" }, vl = { class: "fd-col-tag" }, gl = { class: "fd-col-card-bottom" }, yl = { class: "fd-col-switch" }, hl = { class: "fd-col-actions" }, _l = ["onClick"], kl = ["onClick"], wl = {
980
- class: "fd-dialog",
981
- style: { "max-width": "560px" }
982
- }, xl = { class: "fd-dialog-head" }, $l = { class: "fd-dialog-body" }, Cl = { class: "fd-form-section" }, Tl = { class: "fd-form-grid" }, Sl = { class: "fd-form-item" }, Il = ["value"], Fl = ["value"], Dl = { class: "fd-form-item" }, Ll = ["value"], Ml = { class: "fd-form-item" }, Pl = ["value"], Nl = { class: "fd-form-item" }, Bl = ["value"], jl = { class: "fd-form-section" }, El = { class: "fd-form-grid" }, Ol = { class: "fd-form-item" }, ql = ["value"], Rl = { class: "fd-form-item" }, Al = ["value"], Ul = { class: "fd-form-item" }, Vl = { class: "fd-color-row" }, zl = ["value"], Yl = ["value"], Hl = { class: "fd-form-item" }, Wl = { class: "fd-color-row" }, Gl = ["value"], Jl = ["value"], Ql = { class: "fd-form-section" }, Zl = { class: "fd-form-grid" }, Kl = { class: "fd-form-item" }, Xl = { class: "fd-form-item" }, eo = ["value"], to = ["value"], no = /* @__PURE__ */ D({
983
- __name: "SubtablePanel",
984
- props: {
985
- node: {},
986
- fields: {}
987
- },
988
- emits: ["update"],
989
- setup(t, { emit: l }) {
990
- const n = t, a = l;
991
- function d(r, u) {
992
- a("update", { [r]: u });
993
- }
994
- function i(r) {
995
- const u = r ?? "", g = pe(u), P = { secondtable: u };
996
- g && (P.displaytitle = g.label, P.colnums = tl(g)), a("update", P);
997
- }
998
- const o = xe({
999
- open: !1,
1000
- index: -1,
1001
- draft: null
1002
- });
1003
- function c(r) {
1004
- return JSON.parse(JSON.stringify(r));
1005
- }
1006
- function f(r) {
1007
- o.index = r, o.draft = c(n.node.colnums[r]), o.open = !0;
1008
- }
1009
- function p() {
1010
- o.open = !1, o.draft = null, o.index = -1;
1011
- }
1012
- function v() {
1013
- if (o.draft && o.index >= 0) {
1014
- const r = [...n.node.colnums];
1015
- r[o.index] = o.draft, a("update", { colnums: r });
1016
- }
1017
- p();
1018
- }
1019
- function w(r, u) {
1020
- r.isshow = u ? 1 : 0, a("update", { colnums: [...n.node.colnums] });
1021
- }
1022
- async function B() {
1023
- const r = {
1024
- name: `col_${Date.now().toString(36)}`,
1025
- isshow: 1,
1026
- major: "",
1027
- showname: "新列",
1028
- showwidth: "",
1029
- background: "",
1030
- prospect: "",
1031
- issum: 0,
1032
- index: n.node.colnums.length + 1,
1033
- align: "",
1034
- iscompletehide: 0,
1035
- iscompletehidecode: "",
1036
- issamecolmerge: 0,
1037
- bindLink: "",
1038
- editmode: { editmode: "text", title: "文本" },
1039
- events: []
1040
- };
1041
- a("update", { colnums: [...n.node.colnums, r] }), await $e(), f(n.node.colnums.length - 1);
1042
- }
1043
- function q(r) {
1044
- const u = n.node.colnums.slice();
1045
- u.splice(r, 1), a("update", { colnums: u });
1046
- }
1047
- function x(r) {
1048
- return /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(r) ? r : "#ffffff";
1049
- }
1050
- function S(r, u) {
1051
- o.draft && (o.draft[r] = u.target.value);
1052
- }
1053
- const b = I(() => {
1054
- var r;
1055
- return ((r = pe(n.node.secondtable)) == null ? void 0 : r.fields) ?? [];
1056
- }), y = I(() => b.value.filter((r) => r.dataType === "link"));
1057
- function k(r) {
1058
- o.draft && (o.draft.bindLink = r ?? "");
1059
- }
1060
- function N(r) {
1061
- d("tablestyle", r || "table");
1062
- }
1063
- function $(r) {
1064
- if (!o.draft) return;
1065
- const u = r.target.value;
1066
- o.draft.name = u;
1067
- const g = b.value.find((P) => P.name === u);
1068
- if (g) {
1069
- o.draft.showname = g.label;
1070
- const P = g.dataType === "file";
1071
- o.draft.editmode.editmode = P ? "files" : "text", o.draft.editmode.title = P ? "文件" : "文本";
1072
- }
1073
- }
1074
- return (r, u) => (s(), m(T, null, [
1075
- e("div", ll, [
1076
- e("div", ol, [
1077
- u[14] || (u[14] = e("label", null, "选择子表", -1)),
1078
- M(_(le), {
1079
- "model-value": t.node.secondtable,
1080
- filterable: "",
1081
- clearable: "",
1082
- placeholder: "请选择子表",
1083
- style: { width: "100%" },
1084
- "onUpdate:modelValue": i
1085
- }, {
1086
- default: z(() => [
1087
- (s(!0), m(T, null, F(_(el), (g) => (s(), O(_(G), {
1088
- key: g.name,
1089
- label: `${g.label}(${g.name})`,
1090
- value: g.name
1091
- }, null, 8, ["label", "value"]))), 128))
1092
- ]),
1093
- _: 1
1094
- }, 8, ["model-value"])
1095
- ]),
1096
- e("div", al, [
1097
- u[15] || (u[15] = e("label", null, "只读", -1)),
1098
- M(K, {
1099
- "model-value": t.node.isreadonly === "1",
1100
- "onUpdate:modelValue": u[0] || (u[0] = (g) => d("isreadonly", g ? "1" : "0"))
1101
- }, null, 8, ["model-value"])
1102
- ]),
1103
- e("div", dl, [
1104
- u[16] || (u[16] = e("label", null, "序号列", -1)),
1105
- M(K, {
1106
- "model-value": t.node.secondtableindex === "1",
1107
- "onUpdate:modelValue": u[1] || (u[1] = (g) => d("secondtableindex", g ? "1" : "0"))
1108
- }, null, 8, ["model-value"])
1109
- ]),
1110
- e("div", il, [
1111
- u[17] || (u[17] = e("label", null, "表格样式", -1)),
1112
- M(_(le), {
1113
- "model-value": t.node.tablestyle || "table",
1114
- style: { width: "100%" },
1115
- "onUpdate:modelValue": N
1116
- }, {
1117
- default: z(() => [
1118
- M(_(G), {
1119
- label: "表格",
1120
- value: "table"
1121
- }),
1122
- M(_(G), {
1123
- label: "卡片列表",
1124
- value: "cards"
1125
- })
1126
- ]),
1127
- _: 1
1128
- }, 8, ["model-value"])
1129
- ]),
1130
- e("div", sl, [
1131
- e("div", rl, [
1132
- e("span", null, "列配置(" + h(t.node.colnums.length) + ")", 1),
1133
- e("button", {
1134
- class: "fd-btn fd-btn--primary fd-btn--sm",
1135
- onClick: B
1136
- }, "+ 新增列")
1137
- ]),
1138
- t.node.colnums.length === 0 ? (s(), m("div", cl, " 暂无列,点击「新增列」添加 ")) : C("", !0),
1139
- (s(!0), m(T, null, F(t.node.colnums, (g, P) => (s(), m("div", {
1140
- key: g.name,
1141
- class: "fd-col-card"
1142
- }, [
1143
- e("div", ul, [
1144
- e("span", ml, h(P + 1), 1),
1145
- e("div", fl, [
1146
- e("span", pl, h(g.showname || "未命名列"), 1),
1147
- e("span", bl, h(g.name), 1)
1148
- ]),
1149
- e("span", vl, h(g.bindLink ? "链接" : "文本"), 1)
1150
- ]),
1151
- e("div", gl, [
1152
- e("label", yl, [
1153
- u[18] || (u[18] = e("span", null, "显示", -1)),
1154
- M(K, {
1155
- "model-value": g.isshow === 1,
1156
- "onUpdate:modelValue": (J) => w(g, J)
1157
- }, null, 8, ["model-value", "onUpdate:modelValue"])
1158
- ]),
1159
- e("div", hl, [
1160
- e("button", {
1161
- class: "fd-btn fd-btn--ghost fd-btn--sm",
1162
- onClick: (J) => f(P)
1163
- }, "设置", 8, _l),
1164
- e("button", {
1165
- class: "fd-btn fd-btn--danger fd-btn--sm",
1166
- onClick: (J) => q(P)
1167
- }, "删除", 8, kl)
1168
- ])
1169
- ])
1170
- ]))), 128))
1171
- ])
1172
- ]),
1173
- (s(), O(re, { to: "body" }, [
1174
- o.open && o.draft ? (s(), m("div", {
1175
- key: 0,
1176
- class: "fd-dialog-mask",
1177
- onClick: R(p, ["self"])
1178
- }, [
1179
- e("div", wl, [
1180
- e("div", xl, [
1181
- e("span", null, "列设置 · " + h(o.draft.showname || o.draft.name || "新列"), 1),
1182
- e("button", {
1183
- class: "fd-dialog-close",
1184
- onClick: p,
1185
- title: "关闭"
1186
- }, "×")
1187
- ]),
1188
- e("div", $l, [
1189
- e("section", Cl, [
1190
- u[24] || (u[24] = e("h5", { class: "fd-form-section-h" }, "基本信息", -1)),
1191
- e("div", Tl, [
1192
- e("div", Sl, [
1193
- u[20] || (u[20] = e("label", null, "列字段", -1)),
1194
- e("select", {
1195
- value: o.draft.name,
1196
- onChange: u[2] || (u[2] = (g) => $(g))
1197
- }, [
1198
- u[19] || (u[19] = e("option", { value: "" }, "请选择字段", -1)),
1199
- (s(!0), m(T, null, F(b.value, (g) => (s(), m("option", {
1200
- key: g.name,
1201
- value: g.name
1202
- }, h(g.label) + "(" + h(g.name) + ")", 9, Fl))), 128))
1203
- ], 40, Il)
1204
- ]),
1205
- e("div", Dl, [
1206
- u[21] || (u[21] = e("label", null, "显示标题", -1)),
1207
- e("input", {
1208
- value: o.draft.showname,
1209
- onInput: u[3] || (u[3] = (g) => o.draft.showname = g.target.value),
1210
- placeholder: "如 姓名"
1211
- }, null, 40, Ll)
1212
- ]),
1213
- e("div", Ml, [
1214
- u[22] || (u[22] = e("label", null, "主表头分组", -1)),
1215
- e("input", {
1216
- value: o.draft.major,
1217
- onInput: u[4] || (u[4] = (g) => o.draft.major = g.target.value),
1218
- placeholder: "可合并表头分组名"
1219
- }, null, 40, Pl)
1220
- ]),
1221
- e("div", Nl, [
1222
- u[23] || (u[23] = e("label", null, "列序号", -1)),
1223
- e("input", {
1224
- type: "number",
1225
- min: "1",
1226
- value: o.draft.index,
1227
- onInput: u[5] || (u[5] = (g) => o.draft.index = Number(g.target.value))
1228
- }, null, 40, Bl)
1229
- ])
1230
- ])
1231
- ]),
1232
- e("section", jl, [
1233
- u[30] || (u[30] = e("h5", { class: "fd-form-section-h" }, "显示与样式", -1)),
1234
- e("div", El, [
1235
- e("div", Ol, [
1236
- u[25] || (u[25] = e("label", null, "列宽", -1)),
1237
- e("input", {
1238
- value: o.draft.showwidth,
1239
- onInput: u[6] || (u[6] = (g) => o.draft.showwidth = g.target.value),
1240
- placeholder: "如 120px 或 20%"
1241
- }, null, 40, ql)
1242
- ]),
1243
- e("div", Rl, [
1244
- u[27] || (u[27] = e("label", null, "对齐方式", -1)),
1245
- e("select", {
1246
- value: o.draft.align,
1247
- onChange: u[7] || (u[7] = (g) => o.draft.align = g.target.value)
1248
- }, [...u[26] || (u[26] = [
1249
- e("option", { value: "" }, "默认(左)", -1),
1250
- e("option", { value: "left" }, "左对齐", -1),
1251
- e("option", { value: "center" }, "居中", -1),
1252
- e("option", { value: "right" }, "右对齐", -1)
1253
- ])], 40, Al)
1254
- ]),
1255
- e("div", Ul, [
1256
- u[28] || (u[28] = e("label", null, "背景色", -1)),
1257
- e("div", Vl, [
1258
- e("input", {
1259
- type: "color",
1260
- value: x(o.draft.background),
1261
- onInput: u[8] || (u[8] = (g) => S("background", g))
1262
- }, null, 40, zl),
1263
- e("input", {
1264
- value: o.draft.background,
1265
- onInput: u[9] || (u[9] = (g) => o.draft.background = g.target.value),
1266
- placeholder: "如 #f5f7fa 或空"
1267
- }, null, 40, Yl)
1268
- ])
1269
- ]),
1270
- e("div", Hl, [
1271
- u[29] || (u[29] = e("label", null, "字体色", -1)),
1272
- e("div", Wl, [
1273
- e("input", {
1274
- type: "color",
1275
- value: x(o.draft.prospect),
1276
- onInput: u[10] || (u[10] = (g) => S("prospect", g))
1277
- }, null, 40, Gl),
1278
- e("input", {
1279
- value: o.draft.prospect,
1280
- onInput: u[11] || (u[11] = (g) => o.draft.prospect = g.target.value),
1281
- placeholder: "如 #f5523a 或空"
1282
- }, null, 40, Jl)
1283
- ])
1284
- ])
1285
- ])
1286
- ]),
1287
- e("section", Ql, [
1288
- u[34] || (u[34] = e("h5", { class: "fd-form-section-h" }, "编辑模式", -1)),
1289
- e("div", Zl, [
1290
- e("div", Kl, [
1291
- u[31] || (u[31] = e("label", null, "同内容合并", -1)),
1292
- M(K, {
1293
- "model-value": o.draft.issamecolmerge === 1,
1294
- "onUpdate:modelValue": u[12] || (u[12] = (g) => o.draft.issamecolmerge = g ? 1 : 0)
1295
- }, null, 8, ["model-value"])
1296
- ]),
1297
- e("div", Xl, [
1298
- u[33] || (u[33] = e("label", null, "链接", -1)),
1299
- e("select", {
1300
- value: o.draft.bindLink ?? "",
1301
- onChange: u[13] || (u[13] = (g) => k(g.target.value))
1302
- }, [
1303
- u[32] || (u[32] = e("option", { value: "" }, "不绑定", -1)),
1304
- (s(!0), m(T, null, F(y.value, (g) => (s(), m("option", {
1305
- key: g.name,
1306
- value: g.name
1307
- }, h(g.label) + "(" + h(g.name) + ")", 9, to))), 128))
1308
- ], 40, eo)
1309
- ])
1310
- ])
1311
- ])
1312
- ]),
1313
- e("div", { class: "fd-dialog-foot" }, [
1314
- e("button", {
1315
- class: "fd-btn fd-btn--ghost",
1316
- onClick: p
1317
- }, "取消"),
1318
- e("button", {
1319
- class: "fd-btn fd-btn--primary",
1320
- onClick: v
1321
- }, "确定")
1322
- ])
1323
- ])
1324
- ])) : C("", !0)
1325
- ]))
1326
- ], 64));
1327
- }
1328
- }), lo = /* @__PURE__ */ L(no, [["__scopeId", "data-v-31bf2515"]]);
1329
- function oo() {
1330
- return [
1331
- {
1332
- name: "field1",
1333
- isshow: 1,
1334
- major: "",
1335
- showname: "字段一",
1336
- showwidth: "",
1337
- background: "",
1338
- prospect: "",
1339
- issum: 0,
1340
- index: 1,
1341
- align: "",
1342
- iscompletehide: 0,
1343
- iscompletehidecode: "",
1344
- issamecolmerge: 0,
1345
- bindLink: "",
1346
- editmode: { editmode: "text", title: "文本" },
1347
- events: []
1348
- },
1349
- {
1350
- name: "field2",
1351
- isshow: 1,
1352
- major: "",
1353
- showname: "字段二",
1354
- showwidth: "",
1355
- background: "",
1356
- prospect: "",
1357
- issum: 0,
1358
- index: 2,
1359
- align: "",
1360
- iscompletehide: 0,
1361
- iscompletehidecode: "",
1362
- issamecolmerge: 0,
1363
- bindLink: "",
1364
- editmode: { editmode: "text", title: "文本" },
1365
- events: []
1366
- }
1367
- ];
1368
- }
1369
- const ao = {
1370
- type: "subtable",
1371
- title: "子表",
1372
- design: Cn,
1373
- render: Wn,
1374
- panel: lo,
1375
- isContainer: !1,
1376
- createDefaultProps: () => ({
1377
- id: "",
1378
- type: "subtable",
1379
- label: "子表",
1380
- bindField: "",
1381
- firsttable: "",
1382
- secondtable: "",
1383
- primarytablefiled: "",
1384
- secondtableprimarykey: "",
1385
- secondtablerelationfield: "",
1386
- tabletype: "subtable",
1387
- displaytitle: "",
1388
- tablestyle: "table",
1389
- isreadonly: "1",
1390
- isnull: "0",
1391
- issave: "0",
1392
- secondtableindex: "0",
1393
- nodatahidetable: "0",
1394
- nodatatitle: "1",
1395
- fixedcolumn: 0,
1396
- tablewidth: 0,
1397
- tableheight: 0,
1398
- iscompletehide: "0",
1399
- iscompletehidecode: "",
1400
- colnums: oo(),
1401
- events: []
1402
- }),
1403
- serialize: (t) => t
1404
- }, io = /* @__PURE__ */ D({
1405
- __name: "GridDesign",
1406
- props: {
1407
- node: {}
1408
- },
1409
- setup(t) {
1410
- const l = V();
1411
- return (n, a) => (s(), m("div", {
1412
- class: j(["fd-grid-design", { "is-mobile": _(l).device === "mobile" }])
1413
- }, [
1414
- W(n.$slots, "children", {}, void 0, !0)
1415
- ], 2));
1416
- }
1417
- }), so = /* @__PURE__ */ L(io, [["__scopeId", "data-v-25511a77"]]), me = /* @__PURE__ */ D({
1418
- __name: "WidgetHost",
1419
- props: {
1420
- node: {},
1421
- mode: {},
1422
- formMode: {},
1423
- formData: {},
1424
- formId: {}
1425
- },
1426
- setup(t) {
1427
- const l = t, n = I(() => H(l.node.type)), a = I(() => n.value ? l.mode === "design" ? n.value.design : n.value.render : null), d = (i) => i && l.formData ? l.formData[i] : void 0;
1428
- return (i, o) => {
1429
- var f;
1430
- const c = Ce("WidgetHost", !0);
1431
- return a.value ? (s(), O(ie(a.value), ne({
1432
- key: 0,
1433
- node: t.node,
1434
- value: d(t.node.bindField),
1435
- "form-data": t.formData
1436
- }, t.mode === "render" ? { formMode: t.formMode, formId: t.formId } : null), X({ _: 2 }, [
1437
- F(i.$slots, (p, v) => ({
1438
- name: v,
1439
- fn: z((w) => [
1440
- W(i.$slots, v, Ne(Be(w || {})))
1441
- ])
1442
- })),
1443
- (f = n.value) != null && f.isContainer && !i.$slots.children ? {
1444
- name: "children",
1445
- fn: z(() => [
1446
- (s(!0), m(T, null, F(t.node.children, (p) => (s(), O(c, {
1447
- key: p.id,
1448
- node: p,
1449
- mode: t.mode,
1450
- "form-mode": t.formMode,
1451
- "form-data": t.formData,
1452
- "form-id": t.formId
1453
- }, X({ _: 2 }, [
1454
- F(i.$slots, (v, w) => ({
1455
- name: w,
1456
- fn: z((B) => [
1457
- W(i.$slots, w, ne({ ref_for: !0 }, B || {}))
1458
- ])
1459
- }))
1460
- ]), 1032, ["node", "mode", "form-mode", "form-data", "form-id"]))), 128))
1461
- ]),
1462
- key: "0"
1463
- } : void 0
1464
- ]), 1040, ["node", "value", "form-data"])) : C("", !0);
1465
- };
1466
- }
1467
- }), ro = 24;
1468
- function Ie(t, l, n, a, d = !1) {
1469
- if (t.type !== "label" || !n.length) return "";
1470
- const i = d ? 1 : ro, o = (S) => Math.min(Math.max(S.gridSpan || a || i, 1), i), c = [];
1471
- let f = 0, p = 0;
1472
- for (const S of n) {
1473
- const b = o(S);
1474
- f + b > i && (f = 0, p++);
1475
- const y = f === 0;
1476
- f += b;
1477
- const k = f >= i;
1478
- c.push({ row: p, rowFirst: y, rowLast: k }), f >= i && (f = 0, p++);
1479
- }
1480
- const v = c[l];
1481
- if (!v) return "";
1482
- const w = c[c.length - 1].row, B = v.row === 0, q = v.row === w, x = [];
1483
- return v.rowFirst && B && x.push("is-g-corner-tl"), v.rowLast && B && x.push("is-g-corner-tr"), v.rowFirst && q && x.push("is-g-corner-bl"), v.rowLast && q && x.push("is-g-corner-br"), x.join(" ");
1484
- }
1485
- const co = /* @__PURE__ */ D({
1486
- __name: "GridRender",
1487
- props: {
1488
- node: {},
1489
- formMode: {},
1490
- formData: {},
1491
- formId: {}
1492
- },
1493
- setup(t) {
1494
- const l = V(), n = A(!1);
1495
- let a = null;
1496
- ee(() => {
1497
- a = window.matchMedia("(max-width: 768px)"), n.value = a.matches, a.addEventListener("change", (i) => {
1498
- n.value = i.matches;
1499
- });
1500
- }), ke(() => {
1501
- a && a.removeEventListener("change", () => {
1502
- });
1503
- });
1504
- const d = I(() => l.device === "mobile" || n.value);
1505
- return (i, o) => (s(), m("div", {
1506
- class: j(["fd-grid-render", { "is-mobile": d.value }])
1507
- }, [
1508
- (s(!0), m(T, null, F(t.node.children, (c, f) => (s(), m("div", {
1509
- key: c.id,
1510
- class: j(["fd-grid-cell", _(Ie)(c, f, t.node.children || [], t.node.layout || 24, d.value)]),
1511
- style: U({ gridColumn: `span ${c.gridSpan || t.node.layout}` })
1512
- }, [
1513
- M(me, {
1514
- node: c,
1515
- mode: "render",
1516
- "form-mode": t.formMode,
1517
- "form-data": t.formData,
1518
- "form-id": t.formId
1519
- }, X({ _: 2 }, [
1520
- F(i.$slots, (p, v) => ({
1521
- name: v,
1522
- fn: z((w) => [
1523
- W(i.$slots, v, ne({ ref_for: !0 }, w || {}), void 0, !0)
1524
- ])
1525
- }))
1526
- ]), 1032, ["node", "form-mode", "form-data", "form-id"])
1527
- ], 6))), 128))
1528
- ], 2));
1529
- }
1530
- }), uo = /* @__PURE__ */ L(co, [["__scopeId", "data-v-417035f9"]]), mo = { class: "fd-panel" }, fo = { class: "fd-panel-item" }, po = ["value"], bo = ["value"], vo = { class: "fd-panel-item" }, go = /* @__PURE__ */ D({
1531
- __name: "GridPanel",
1532
- props: {
1533
- node: {},
1534
- fields: {}
1535
- },
1536
- emits: ["update"],
1537
- setup(t, { emit: l }) {
1538
- const n = t, a = l, d = [
1539
- { label: "2列布局", value: 24 },
1540
- { label: "4列布局", value: 12 },
1541
- { label: "6列布局", value: 8 },
1542
- { label: "8列布局", value: 6 }
1543
- ];
1544
- function i() {
1545
- const o = n.node.layout || 24, c = (n.node.children ?? []).map((f) => ({ ...f, gridSpan: o }));
1546
- a("update", { children: c });
1547
- }
1548
- return (o, c) => (s(), m("div", mo, [
1549
- e("div", fo, [
1550
- c[1] || (c[1] = e("label", null, "布局", -1)),
1551
- e("select", {
1552
- value: t.node.layout,
1553
- onChange: c[0] || (c[0] = (f) => a("update", { layout: Number(f.target.value) }))
1554
- }, [
1555
- (s(), m(T, null, F(d, (f) => e("option", {
1556
- key: f.value,
1557
- value: f.value
1558
- }, h(f.label), 9, bo)), 64))
1559
- ], 40, po)
1560
- ]),
1561
- e("div", vo, [
1562
- c[2] || (c[2] = e("label", null, "一键布局", -1)),
1563
- e("button", {
1564
- class: "fd-btn fd-btn--primary fd-btn--sm fd-grid-apply",
1565
- onClick: i
1566
- }, " 应用到全部子组件(每项占比 " + h(t.node.layout || 24) + "/24) ", 1)
1567
- ])
1568
- ]));
1569
- }
1570
- }), yo = /* @__PURE__ */ L(go, [["__scopeId", "data-v-a333d2ea"]]), ho = {
1571
- type: "grid",
1572
- title: "栅栏格",
1573
- design: so,
1574
- render: uo,
1575
- panel: yo,
1576
- isContainer: !0,
1577
- createDefaultProps: () => ({
1578
- id: "",
1579
- type: "grid",
1580
- label: "栅栏格",
1581
- bindField: "",
1582
- // 默认 6 列布局
1583
- layout: 8,
1584
- children: []
1585
- }),
1586
- serialize: (t) => t
1587
- }, _o = /* @__PURE__ */ D({
1588
- __name: "TextDesign",
1589
- props: {
1590
- node: {}
1591
- },
1592
- setup(t) {
1593
- return (l, n) => (s(), m("div", {
1594
- class: "fd-text-design",
1595
- style: U({ display: t.node.display })
1596
- }, h(t.node.text || "文本内容"), 5));
1597
- }
1598
- }), ko = /* @__PURE__ */ L(_o, [["__scopeId", "data-v-ba382e6c"]]), wo = /* @__PURE__ */ D({
1599
- __name: "TextRender",
1600
- props: {
1601
- node: {},
1602
- value: {}
1603
- },
1604
- setup(t) {
1605
- const l = t, n = I(() => {
1606
- if (!l.node.bindField) return l.node.text;
1607
- const a = l.value;
1608
- return a == null ? "" : String(a);
1609
- });
1610
- return (a, d) => (s(), m("div", {
1611
- class: "fd-text-render",
1612
- style: U({ display: t.node.display })
1613
- }, h(n.value), 5));
1614
- }
1615
- }), xo = /* @__PURE__ */ L(wo, [["__scopeId", "data-v-3ed7b0f0"]]), $o = { class: "fd-panel" }, Co = { class: "fd-panel-item" }, To = ["value"], So = { class: "fd-panel-item" }, Io = ["value"], Fo = ["value"], Do = { class: "fd-panel-item" }, Lo = ["value"], Mo = /* @__PURE__ */ D({
1616
- __name: "TextPanel",
1617
- props: {
1618
- node: {},
1619
- fields: {}
1620
- },
1621
- emits: ["update"],
1622
- setup(t, { emit: l }) {
1623
- const n = l;
1624
- return (a, d) => (s(), m("div", $o, [
1625
- e("div", Co, [
1626
- d[3] || (d[3] = e("label", null, "文本", -1)),
1627
- e("textarea", {
1628
- rows: "4",
1629
- value: t.node.text,
1630
- onInput: d[0] || (d[0] = (i) => n("update", { text: i.target.value }))
1631
- }, null, 40, To)
1632
- ]),
1633
- e("div", So, [
1634
- d[5] || (d[5] = e("label", null, "绑定字段", -1)),
1635
- e("select", {
1636
- value: t.node.bindField,
1637
- onChange: d[1] || (d[1] = (i) => n("update", { bindField: i.target.value }))
1638
- }, [
1639
- d[4] || (d[4] = e("option", { value: "" }, "不绑定", -1)),
1640
- (s(!0), m(T, null, F(t.fields, (i) => (s(), m("option", {
1641
- key: i.name,
1642
- value: i.name
1643
- }, h(i.label) + "(" + h(i.name) + ")", 9, Fo))), 128))
1644
- ], 40, Io)
1645
- ]),
1646
- e("div", Do, [
1647
- d[7] || (d[7] = e("label", null, "对齐方式", -1)),
1648
- e("select", {
1649
- value: t.node.display,
1650
- onChange: d[2] || (d[2] = (i) => n("update", { display: i.target.value }))
1651
- }, [...d[6] || (d[6] = [
1652
- e("option", { value: "inline-block" }, "对齐", -1),
1653
- e("option", { value: "block" }, "换行", -1)
1654
- ])], 40, Lo)
1655
- ])
1656
- ]));
1657
- }
1658
- }), Po = /* @__PURE__ */ L(Mo, [["__scopeId", "data-v-3201879c"]]), No = {
1659
- type: "text",
1660
- title: "文本",
1661
- design: ko,
1662
- render: xo,
1663
- panel: Po,
1664
- isContainer: !1,
1665
- createDefaultProps: () => ({
1666
- id: "",
1667
- type: "text",
1668
- label: "文本",
1669
- bindField: "",
1670
- text: "文本内容",
1671
- display: "inline-block"
1672
- }),
1673
- serialize: (t) => t
1674
- };
1675
- let be = !1;
1676
- function fe() {
1677
- be || (be = !0, Q(bt), Q(Gt), Q(pn), Q(ao), Q(ho), Q(No));
1678
- }
1679
- fe();
1680
- const Z = (t) => JSON.parse(JSON.stringify(t));
1681
- function Y(t, l) {
1682
- for (const n of t) {
1683
- if (n.id === l) return n;
1684
- if (n.children) {
1685
- const a = Y(n.children, l);
1686
- if (a) return a;
1687
- }
1688
- }
1689
- return null;
1690
- }
1691
- function Fe(t, l) {
1692
- const n = t.findIndex((a) => a.id === l);
1693
- if (n >= 0)
1694
- return t.splice(n, 1), !0;
1695
- for (const a of t)
1696
- if (a.children && Fe(a.children, l)) return !0;
1697
- return !1;
1698
- }
1699
- const V = Ve("designer", {
1700
- state: () => ({
1701
- formId: "SG_ZL_YYQHTSP",
1702
- dbtable: "SG_ZL_YYQHTSP",
1703
- fields: [],
1704
- widgets: [],
1705
- selectedId: null,
1706
- past: [],
1707
- future: [],
1708
- draggingId: null,
1709
- device: "pc",
1710
- dragOverId: null,
1711
- dragBefore: !1,
1712
- dropContainerId: null,
1713
- selectedForm: !1,
1714
- events: { lifecycle: {}, custom: [] },
1715
- openedWithParam: !1
1716
- }),
1717
- getters: {
1718
- selectedNode: (t) => t.selectedId ? Y(t.widgets, t.selectedId) : null,
1719
- canUndo: (t) => t.past.length > 0,
1720
- canRedo: (t) => t.future.length > 0,
1721
- /** 供控件「事件」下拉选择使用的自定义事件列表 */
1722
- customEventOptions: (t) => t.events.custom
1723
- },
1724
- actions: {
1725
- /** 提交一次变更快照(用于撤销重做) */
1726
- commit() {
1727
- this.past.push(Z(this.widgets)), this.past.length > 50 && this.past.shift(), this.future = [];
1728
- },
1729
- undo() {
1730
- const t = this.past.pop();
1731
- t && (this.future.push(Z(this.widgets)), this.widgets = t, this.selectedId && !Y(this.widgets, this.selectedId) && (this.selectedId = null));
1732
- },
1733
- redo() {
1734
- const t = this.future.pop();
1735
- t && (this.past.push(Z(this.widgets)), this.widgets = t);
1736
- },
1737
- select(t) {
1738
- this.selectedId = t, this.selectedForm = !1;
1739
- },
1740
- /** 点击画板空白处:选中表单本身(用于配置表单级属性) */
1741
- selectForm() {
1742
- this.selectedId = null, this.selectedForm = !0;
1743
- },
1744
- /** 设置生命周期事件代码片段 */
1745
- setLifecycleHook(t, l) {
1746
- this.events.lifecycle[t] = l;
1747
- },
1748
- /** 新增一条自定义事件(默认占位) */
1749
- addCustomEvent() {
1750
- const t = this.events.custom.length + 1;
1751
- this.events.custom.push({ name: `event_${t}`, title: `自定义事件${t}`, handler: "" });
1752
- },
1753
- /** 更新某条自定义事件 */
1754
- updateCustomEvent(t, l) {
1755
- const n = this.events.custom[t];
1756
- n && Object.assign(n, l);
1757
- },
1758
- /** 删除某条自定义事件 */
1759
- removeCustomEvent(t) {
1760
- this.events.custom.splice(t, 1);
1761
- },
1762
- /** 新增控件:parentId 指定容器,index 指定插入位置(不传则末尾) */
1763
- addWidget(t, l, n) {
1764
- var i;
1765
- const a = Ge(t);
1766
- this.commit();
1767
- const d = l ? Y(this.widgets, l) : null;
1768
- d && ((i = H(d.type)) != null && i.isContainer) ? (d.children = d.children || [], d.type === "grid" && a.gridSpan == null && (a.gridSpan = d.layout || 24), n == null || n > d.children.length ? d.children.push(a) : d.children.splice(Math.max(0, n), 0, a)) : n == null || n > this.widgets.length ? this.widgets.push(a) : this.widgets.splice(Math.max(0, n), 0, a), this.selectedId = a.id;
1769
- },
1770
- /** 判断 maybeChild 是否为 node 的后代(防止把容器拖进自己) */
1771
- isDescendant(t, l) {
1772
- if (!t.children) return !1;
1773
- for (const n of t.children)
1774
- if (n.id === l || this.isDescendant(n, l)) return !0;
1775
- return !1;
1776
- },
1777
- /** 移动已有控件到指定容器 / 根,插入位置 index */
1778
- moveNode(t, l, n) {
1779
- var v;
1780
- if (t === l) return;
1781
- const a = Y(this.widgets, t);
1782
- if (!a || l && this.isDescendant(a, l)) return;
1783
- const d = l ? Y(this.widgets, l) : null, i = (w) => {
1784
- const B = w.findIndex((q) => q.id === t);
1785
- if (B >= 0) return { list: w, index: B };
1786
- for (const q of w)
1787
- if (q.children) {
1788
- const x = i(q.children);
1789
- if (x) return x;
1790
- }
1791
- return null;
1792
- }, o = i(this.widgets);
1793
- if (!o) return;
1794
- let c;
1795
- d && ((v = H(d.type)) != null && v.isContainer) ? (d.children = d.children || [], c = d.children) : c = this.widgets, this.commit();
1796
- let f = n;
1797
- c === o.list && o.index < n && (f = n - 1);
1798
- const [p] = o.list.splice(o.index, 1);
1799
- if (f = Math.max(0, Math.min(f, c.length)), c.splice(f, 0, p), d && d.type === "grid") {
1800
- const w = d.layout || 24;
1801
- (o.list !== c || p.gridSpan == null) && (p.gridSpan = w);
1802
- } else
1803
- delete p.gridSpan;
1804
- this.selectedId = p.id;
1805
- },
1806
- removeWidget(t) {
1807
- this.commit(), Fe(this.widgets, t), this.selectedId === t && (this.selectedId = null);
1808
- },
1809
- moveSibling(t, l) {
1810
- const n = (c) => {
1811
- if (c.findIndex((p) => p.id === t) >= 0) return c;
1812
- for (const p of c)
1813
- if (p.children) {
1814
- const v = n(p.children);
1815
- if (v) return v;
1816
- }
1817
- return null;
1818
- }, a = n(this.widgets);
1819
- if (!a) return;
1820
- const d = a.findIndex((c) => c.id === t), i = d + l;
1821
- if (i < 0 || i >= a.length) return;
1822
- this.commit();
1823
- const [o] = a.splice(d, 1);
1824
- a.splice(i, 0, o);
1825
- },
1826
- updateNode(t, l) {
1827
- const n = Y(this.widgets, t);
1828
- n && (Object.assign(n, l), this.commit());
1829
- },
1830
- setDragging(t) {
1831
- this.draggingId = t;
1832
- },
1833
- /** 展开/收起容器(设计器视图操作,不写入撤销历史) */
1834
- setExpanded(t, l) {
1835
- const n = Y(this.widgets, t);
1836
- n && "expanded" in n && (n.expanded = l);
1837
- },
1838
- /** 将 draggingId 控件移动到 targetId(容器)或根 */
1839
- dropTo(t) {
1840
- var d;
1841
- const l = this.draggingId;
1842
- if (!l || l === t) return;
1843
- this.commit();
1844
- const n = (i) => {
1845
- const o = i.findIndex((c) => c.id === l);
1846
- if (o >= 0) {
1847
- const [c] = i.splice(o, 1);
1848
- return c;
1849
- }
1850
- for (const c of i)
1851
- if (c.children) {
1852
- const f = n(c.children);
1853
- if (f) return f;
1854
- }
1855
- return null;
1856
- }, a = n(this.widgets);
1857
- if (!a) {
1858
- this.draggingId = null;
1859
- return;
1860
- }
1861
- if (t) {
1862
- const i = Y(this.widgets, t);
1863
- i && ((d = H(i.type)) != null && d.isContainer) ? (i.children = i.children || [], i.children.push(a)) : this.widgets.push(a);
1864
- } else
1865
- this.widgets.push(a);
1866
- this.draggingId = null, this.selectedId = a.id;
1867
- },
1868
- loadSchema(t) {
1869
- this.formId = t.formId, this.dbtable = t.dbtable, this.fields = t.fields, this.widgets = Z(t.widgets), this.events = t.events ? Z(t.events) : { lifecycle: {}, custom: [] }, this.selectedId = null, this.selectedForm = !1, this.past = [], this.future = [];
1870
- },
1871
- toSchema() {
1872
- return {
1873
- formId: this.formId,
1874
- dbtable: this.dbtable,
1875
- fields: this.fields,
1876
- widgets: this.widgets,
1877
- events: Z(this.events)
1878
- };
1879
- },
1880
- setFields(t) {
1881
- this.fields = t;
1882
- }
1883
- }
1884
- }), ve = { baseModule: "", apiModule: "form-designer" };
1885
- let ae = {}, de = {}, ge = {};
1886
- function De(t) {
1887
- de = { ...de, ...t };
1888
- }
1889
- function sd(t) {
1890
- ae.apiModule = t;
1891
- }
1892
- function rd(t) {
1893
- ae.baseModule = t;
1894
- }
1895
- function Bo() {
1896
- return {
1897
- baseModule: ge.baseModule ?? ae.baseModule ?? de.baseModule ?? ve.baseModule,
1898
- apiModule: ge.apiModule ?? ae.apiModule ?? de.apiModule ?? ve.apiModule
1899
- };
1900
- }
1901
- function jo(t, l = "") {
1902
- const { baseModule: n, apiModule: a } = Bo();
1903
- return `${n ? `/${n}` : ""}/api/${a}/${t}${l ? `/${l}` : ""}`;
1904
- }
1905
- async function te(t, l) {
1906
- return jo("getschema", t), JSON.parse(JSON.stringify(nl(t)));
1907
- }
1908
- const Le = "fd:form:";
1909
- function ye() {
1910
- return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
1911
- const l = Math.random() * 16 | 0;
1912
- return (t === "x" ? l : l & 3 | 8).toString(16);
1913
- });
1914
- }
1915
- function he(t, l) {
1916
- localStorage.setItem(Le + t, JSON.stringify(l));
1917
- }
1918
- function Me(t) {
1919
- const l = localStorage.getItem(Le + t);
1920
- if (!l) return null;
1921
- try {
1922
- return JSON.parse(l);
1923
- } catch {
1924
- return null;
1925
- }
1926
- }
1927
- const Eo = "fdFireEvent";
1928
- function _e(t, l = {}) {
1929
- if (!(!t || !t.trim()))
1930
- try {
1931
- return new Function("ctx", `"use strict";
1932
- ${t}`)(l);
1933
- } catch (n) {
1934
- console.error("[form-designer] 事件处理函数执行失败:", n);
1935
- return;
1936
- }
1937
- }
1938
- function Oo(t) {
1939
- if (!(!t || !t.trim() || typeof document > "u"))
1940
- try {
1941
- const l = document.createElement("script");
1942
- l.text = t, document.head.appendChild(l), l.remove();
1943
- } catch (l) {
1944
- console.error("[form-designer] 自定义方法挂载失败:", l);
1945
- }
1946
- }
1947
- const qo = { class: "fd-renderer" }, Ro = /* @__PURE__ */ D({
1948
- __name: "Renderer",
1949
- props: {
1950
- widgets: {},
1951
- formMode: {},
1952
- formData: {},
1953
- events: {},
1954
- formId: {}
1955
- },
1956
- setup(t, { expose: l }) {
1957
- const n = t, a = I(
1958
- () => n.widgets.filter((o) => {
1959
- var f;
1960
- const c = (f = H(o.type)) == null ? void 0 : f.visibleModes;
1961
- return !c || c.length === 0 ? !0 : n.formMode ? c.includes(n.formMode) : !0;
1962
- })
1963
- );
1964
- function d(o) {
1965
- var f;
1966
- const c = (f = n.events) == null ? void 0 : f.lifecycle[o];
1967
- _e(c, { formData: n.formData, event: o });
1968
- }
1969
- function i(o, c) {
1970
- var p;
1971
- const f = (p = n.events) == null ? void 0 : p.custom.find((v) => v.name === o);
1972
- f && _e(f.handler, { formData: n.formData, event: o, payload: c });
1973
- }
1974
- return je(Eo, i), ee(() => {
1975
- var o;
1976
- d("onLoad"), d("onMounted"), Oo((o = n.events) == null ? void 0 : o.lifecycle.custom);
1977
- }), Ee(
1978
- () => n.formData,
1979
- () => d("onValueChange"),
1980
- { deep: !0 }
1981
- ), l({ fireEvent: i, runLifecycle: d }), (o, c) => (s(), m("div", qo, [
1982
- (s(!0), m(T, null, F(a.value, (f) => (s(), O(me, {
1983
- key: f.id,
1984
- node: f,
1985
- mode: "render",
1986
- "form-mode": t.formMode,
1987
- "form-data": t.formData,
1988
- "form-id": t.formId
1989
- }, X({ _: 2 }, [
1990
- F(o.$slots, (p, v) => ({
1991
- name: v,
1992
- fn: z((w) => [
1993
- W(o.$slots, v, ne({ ref_for: !0 }, w || {}), void 0, !0)
1994
- ])
1995
- }))
1996
- ]), 1032, ["node", "form-mode", "form-data", "form-id"]))), 128))
1997
- ]));
1998
- }
1999
- }), Pe = /* @__PURE__ */ L(Ro, [["__scopeId", "data-v-82088c12"]]), Ao = { class: "fd-tree" }, Uo = { class: "fd-tree-head" }, Vo = {
2000
- key: 0,
2001
- class: "fd-tree-count"
2002
- }, zo = {
2003
- key: 0,
2004
- class: "fd-tree-empty"
2005
- }, Yo = { class: "fd-tree-name" }, Ho = ["title"], Wo = /* @__PURE__ */ D({
2006
- __name: "ComponentTree",
2007
- setup(t) {
2008
- const l = V();
2009
- function n(o) {
2010
- var v;
2011
- const c = H(o.type), f = o.label, p = (c == null ? void 0 : c.title) ?? o.type;
2012
- return {
2013
- id: o.id,
2014
- label: f ? `${p} · ${f}` : p,
2015
- name: p,
2016
- sub: f ?? "",
2017
- children: (v = o.children) == null ? void 0 : v.map(n)
2018
- };
2019
- }
2020
- const a = I(() => l.widgets.map(n)), d = I(() => {
2021
- const o = (c) => c.reduce((f, p) => f + 1 + o(p.children ?? []), 0);
2022
- return o(l.widgets);
2023
- });
2024
- function i(o) {
2025
- l.select(o.id), $e(() => {
2026
- var c;
2027
- (c = document.querySelector(".fd-canvas-node.is-selected")) == null || c.scrollIntoView({ block: "nearest" });
2028
- });
2029
- }
2030
- return (o, c) => (s(), m("div", Ao, [
2031
- e("div", Uo, [
2032
- c[0] || (c[0] = ce('<svg class="fd-tree-head-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-e38c14ec><rect x="3" y="3" width="7" height="7" rx="1" data-v-e38c14ec></rect><rect x="14" y="3" width="7" height="7" rx="1" data-v-e38c14ec></rect><rect x="3" y="14" width="7" height="7" rx="1" data-v-e38c14ec></rect><rect x="14" y="14" width="7" height="7" rx="1" data-v-e38c14ec></rect></svg><span class="fd-tree-title" data-v-e38c14ec>组件树</span>', 2)),
2033
- d.value ? (s(), m("span", Vo, h(d.value), 1)) : C("", !0)
2034
- ]),
2035
- d.value ? (s(), O(_(ze), {
2036
- key: 1,
2037
- class: "fd-tree-el",
2038
- data: a.value,
2039
- "node-key": "id",
2040
- "current-node-key": _(l).selectedId || "",
2041
- "highlight-current": "",
2042
- "default-expand-all": "",
2043
- "show-line": "",
2044
- "expand-on-click-node": !1,
2045
- onNodeClick: i
2046
- }, {
2047
- default: z(({ data: f }) => [
2048
- e("span", Yo, h(f.name), 1),
2049
- f.sub ? (s(), m("span", {
2050
- key: 0,
2051
- class: "fd-tree-sub",
2052
- title: f.sub
2053
- }, h(f.sub), 9, Ho)) : C("", !0)
2054
- ]),
2055
- _: 1
2056
- }, 8, ["data", "current-node-key"])) : (s(), m("div", zo, [...c[1] || (c[1] = [
2057
- e("svg", {
2058
- viewBox: "0 0 24 24",
2059
- fill: "none",
2060
- stroke: "currentColor",
2061
- "stroke-width": "1.5",
2062
- "stroke-linecap": "round",
2063
- "stroke-linejoin": "round"
2064
- }, [
2065
- e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2066
- e("polyline", { points: "17 8 12 3 7 8" }),
2067
- e("line", {
2068
- x1: "12",
2069
- y1: "3",
2070
- x2: "12",
2071
- y2: "15"
2072
- })
2073
- ], -1),
2074
- e("span", null, "暂无组件,从左侧拖拽控件到画布", -1)
2075
- ])]))
2076
- ]));
2077
- }
2078
- }), Go = /* @__PURE__ */ L(Wo, [["__scopeId", "data-v-e38c14ec"]]), Jo = { class: "fd-toolbar" }, Qo = { class: "fd-toolbar-left flex-align-center" }, Zo = ["value"], Ko = { class: "fd-device" }, Xo = {
2079
- key: 0,
2080
- class: "is-active",
2081
- title: "移动端比例(由 URL 参数 templateType 决定)"
2082
- }, ea = {
2083
- key: 1,
2084
- class: "is-active",
2085
- title: "电脑端比例(由 URL 参数 templateType 决定)"
2086
- }, ta = { class: "fd-toolbar-right flex-align-center" }, na = ["disabled"], la = ["disabled"], oa = { class: "fd-dialog fd-dialog--preview" }, aa = { class: "fd-dialog-head" }, da = { class: "fd-preview-width" }, ia = { class: "fd-dialog-body" }, sa = { class: "fd-dialog" }, ra = { class: "fd-dialog-head" }, ca = { class: "fd-dialog-code" }, ua = { class: "fd-dialog" }, ma = { class: "fd-dialog-head" }, fa = { class: "fd-dialog-body" }, pa = /* @__PURE__ */ D({
2087
- __name: "Toolbar",
2088
- setup(t) {
2089
- const l = V(), n = A(!1), a = A(!1), d = A(!1), i = A(!1);
2090
- function o() {
2091
- const $ = new URLSearchParams(window.location.search).get("templateType") || "";
2092
- return $ === "mobile" || $ === "2";
2093
- }
2094
- const c = A(o() ? 375 : 1200);
2095
- function f() {
2096
- const $ = Number(c.value);
2097
- c.value = Math.min(1200, Math.max(270, Number.isFinite($) ? $ : 1200));
2098
- }
2099
- const p = A("");
2100
- function v() {
2101
- const $ = p.value.trim();
2102
- if (!$) {
2103
- window.alert("请先粘贴表单 JSON");
2104
- return;
2105
- }
2106
- try {
2107
- l.loadSchema(JSON.parse($));
2108
- } catch {
2109
- window.alert("JSON 解析失败");
2110
- return;
2111
- }
2112
- p.value = "", i.value = !1;
2113
- }
2114
- const w = I(() => JSON.stringify(l.toSchema(), null, 2)), B = I(() => {
2115
- const $ = {};
2116
- l.fields.forEach((u) => {
2117
- $[u.name] = u.name;
2118
- });
2119
- const r = (u, g) => (u.forEach((P) => {
2120
- var J;
2121
- P.type === "subtable" && g.push(P), (J = P.children) != null && J.length && r(P.children, g);
2122
- }), g);
2123
- return r(l.widgets, []).forEach((u) => {
2124
- if (u.type !== "subtable" || !u.secondtable) return;
2125
- const g = {};
2126
- (u.colnums ?? []).forEach((P) => {
2127
- g[P.name] = P.name, P.bindLink && (g[P.bindLink] = P.bindLink);
2128
- }), $[u.secondtable] = [g];
2129
- }), $;
2130
- });
2131
- async function q() {
2132
- let $ = l.formId;
2133
- !l.openedWithParam && !$ && ($ = ye()), l.formId = $, he($, l.toSchema()), l.openedWithParam = !0, window.alert(`已保存(本地)
2134
- formId: ${$}`);
2135
- }
2136
- function x() {
2137
- const $ = ye();
2138
- l.formId = $, l.openedWithParam = !0, he($, l.toSchema()), window.alert(`已另存为新表单(本地)
2139
- formId: ${$}`);
2140
- }
2141
- async function S() {
2142
- const $ = Me(l.formId);
2143
- if ($)
2144
- l.loadSchema($);
2145
- else {
2146
- const r = await te(l.formId);
2147
- l.loadSchema(r);
2148
- }
2149
- }
2150
- function b() {
2151
- window.alert("发布成功(mock)");
2152
- }
2153
- const y = A(null), k = A(null);
2154
- function N($) {
2155
- var u, g;
2156
- if (!d.value) return;
2157
- const r = $.target;
2158
- (u = y.value) != null && u.contains(r) || (g = k.value) != null && g.contains(r) || (d.value = !1);
2159
- }
2160
- return ee(() => document.addEventListener("click", N)), Oe(() => document.removeEventListener("click", N)), ($, r) => (s(), m("div", Jo, [
2161
- e("div", Qo, [
2162
- r[17] || (r[17] = e("span", { class: "fd-toolbar-title" }, "表单设计器", -1)),
2163
- e("input", {
2164
- class: "fd-toolbar-name",
2165
- value: _(l).formId,
2166
- onInput: r[0] || (r[0] = (u) => _(l).formId = u.target.value)
2167
- }, null, 40, Zo),
2168
- e("div", Ko, [
2169
- _(l).device === "mobile" ? (s(), m("button", Xo, [...r[15] || (r[15] = [
2170
- e("svg", {
2171
- class: "fd-tool-btn-icon",
2172
- viewBox: "0 0 24 24",
2173
- fill: "none",
2174
- stroke: "currentColor",
2175
- "stroke-width": "1.8",
2176
- "stroke-linecap": "round",
2177
- "stroke-linejoin": "round"
2178
- }, [
2179
- e("rect", {
2180
- x: "5",
2181
- y: "2",
2182
- width: "14",
2183
- height: "20",
2184
- rx: "2"
2185
- }),
2186
- e("line", {
2187
- x1: "12",
2188
- y1: "18",
2189
- x2: "12.01",
2190
- y2: "18"
2191
- })
2192
- ], -1),
2193
- E(" 移动端 ", -1)
2194
- ])])) : (s(), m("button", ea, [...r[16] || (r[16] = [
2195
- e("svg", {
2196
- class: "fd-tool-btn-icon",
2197
- viewBox: "0 0 24 24",
2198
- fill: "none",
2199
- stroke: "currentColor",
2200
- "stroke-width": "1.8",
2201
- "stroke-linecap": "round",
2202
- "stroke-linejoin": "round"
2203
- }, [
2204
- e("rect", {
2205
- x: "2",
2206
- y: "3",
2207
- width: "20",
2208
- height: "14",
2209
- rx: "2"
2210
- }),
2211
- e("line", {
2212
- x1: "8",
2213
- y1: "21",
2214
- x2: "16",
2215
- y2: "21"
2216
- }),
2217
- e("line", {
2218
- x1: "12",
2219
- y1: "17",
2220
- x2: "12",
2221
- y2: "21"
2222
- })
2223
- ], -1),
2224
- E(" 电脑端 ", -1)
2225
- ])]))
2226
- ])
2227
- ]),
2228
- e("div", ta, [
2229
- e("button", {
2230
- class: "fd-tool-btn",
2231
- onClick: r[1] || (r[1] = (u) => n.value = !0)
2232
- }, [...r[18] || (r[18] = [
2233
- e("svg", {
2234
- class: "fd-tool-btn-icon",
2235
- viewBox: "0 0 24 24",
2236
- fill: "none",
2237
- stroke: "currentColor",
2238
- "stroke-width": "1.8",
2239
- "stroke-linecap": "round",
2240
- "stroke-linejoin": "round"
2241
- }, [
2242
- e("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2243
- e("circle", {
2244
- cx: "12",
2245
- cy: "12",
2246
- r: "3"
2247
- })
2248
- ], -1),
2249
- E(" 预览 ", -1)
2250
- ])]),
2251
- e("button", {
2252
- class: "fd-tool-btn",
2253
- onClick: r[2] || (r[2] = (u) => a.value = !0)
2254
- }, [...r[19] || (r[19] = [
2255
- e("svg", {
2256
- class: "fd-tool-btn-icon",
2257
- viewBox: "0 0 24 24",
2258
- fill: "none",
2259
- stroke: "currentColor",
2260
- "stroke-width": "1.8",
2261
- "stroke-linecap": "round",
2262
- "stroke-linejoin": "round"
2263
- }, [
2264
- e("polyline", { points: "16 18 22 12 16 6" }),
2265
- e("polyline", { points: "8 6 2 12 8 18" })
2266
- ], -1),
2267
- E(" 查看代码 ", -1)
2268
- ])]),
2269
- e("button", {
2270
- class: "fd-tool-btn",
2271
- onClick: r[3] || (r[3] = (u) => i.value = !0)
2272
- }, [...r[20] || (r[20] = [
2273
- e("svg", {
2274
- class: "fd-tool-btn-icon",
2275
- viewBox: "0 0 24 24",
2276
- fill: "none",
2277
- stroke: "currentColor",
2278
- "stroke-width": "1.8",
2279
- "stroke-linecap": "round",
2280
- "stroke-linejoin": "round"
2281
- }, [
2282
- e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2283
- e("polyline", { points: "17 8 12 3 7 8" }),
2284
- e("line", {
2285
- x1: "12",
2286
- y1: "3",
2287
- x2: "12",
2288
- y2: "15"
2289
- })
2290
- ], -1),
2291
- E(" 导入 ", -1)
2292
- ])]),
2293
- e("button", {
2294
- class: "fd-tool-btn",
2295
- onClick: S
2296
- }, [...r[21] || (r[21] = [
2297
- e("svg", {
2298
- class: "fd-tool-btn-icon",
2299
- viewBox: "0 0 24 24",
2300
- fill: "none",
2301
- stroke: "currentColor",
2302
- "stroke-width": "1.8",
2303
- "stroke-linecap": "round",
2304
- "stroke-linejoin": "round"
2305
- }, [
2306
- e("polyline", { points: "23 4 23 10 17 10" }),
2307
- e("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })
2308
- ], -1),
2309
- E(" 加载 ", -1)
2310
- ])]),
2311
- e("button", {
2312
- class: "fd-tool-btn",
2313
- onClick: q
2314
- }, [...r[22] || (r[22] = [
2315
- e("svg", {
2316
- class: "fd-tool-btn-icon",
2317
- viewBox: "0 0 24 24",
2318
- fill: "none",
2319
- stroke: "currentColor",
2320
- "stroke-width": "1.8",
2321
- "stroke-linecap": "round",
2322
- "stroke-linejoin": "round"
2323
- }, [
2324
- e("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }),
2325
- e("polyline", { points: "17 21 17 13 7 13 7 21" }),
2326
- e("polyline", { points: "7 3 7 8 15 8" })
2327
- ], -1),
2328
- E(" 保存 ", -1)
2329
- ])]),
2330
- e("button", {
2331
- class: "fd-tool-btn",
2332
- onClick: x
2333
- }, [...r[23] || (r[23] = [
2334
- e("svg", {
2335
- class: "fd-tool-btn-icon",
2336
- viewBox: "0 0 24 24",
2337
- fill: "none",
2338
- stroke: "currentColor",
2339
- "stroke-width": "1.8",
2340
- "stroke-linecap": "round",
2341
- "stroke-linejoin": "round"
2342
- }, [
2343
- e("rect", {
2344
- x: "9",
2345
- y: "9",
2346
- width: "13",
2347
- height: "13",
2348
- rx: "2"
2349
- }),
2350
- e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2351
- ], -1),
2352
- E(" 另存为 ", -1)
2353
- ])]),
2354
- e("button", {
2355
- class: "fd-tool-btn fd-tool-btn--primary",
2356
- onClick: b
2357
- }, [...r[24] || (r[24] = [
2358
- e("svg", {
2359
- class: "fd-tool-btn-icon",
2360
- viewBox: "0 0 24 24",
2361
- fill: "none",
2362
- stroke: "currentColor",
2363
- "stroke-width": "1.8",
2364
- "stroke-linecap": "round",
2365
- "stroke-linejoin": "round"
2366
- }, [
2367
- e("line", {
2368
- x1: "22",
2369
- y1: "2",
2370
- x2: "11",
2371
- y2: "13"
2372
- }),
2373
- e("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
2374
- ], -1),
2375
- E(" 发布 ", -1)
2376
- ])]),
2377
- r[28] || (r[28] = e("span", { class: "fd-toolbar-divider" }, null, -1)),
2378
- e("button", {
2379
- class: "fd-tool-btn fd-tool-icon-btn",
2380
- disabled: !_(l).canUndo,
2381
- title: "撤销",
2382
- onClick: r[4] || (r[4] = (u) => _(l).undo())
2383
- }, [...r[25] || (r[25] = [
2384
- e("svg", {
2385
- class: "fd-tool-icon",
2386
- viewBox: "0 0 24 24",
2387
- fill: "none",
2388
- stroke: "currentColor",
2389
- "stroke-width": "1.8",
2390
- "stroke-linecap": "round",
2391
- "stroke-linejoin": "round"
2392
- }, [
2393
- e("polyline", { points: "9 14 4 9 9 4" }),
2394
- e("path", { d: "M20 20v-7a4 4 0 0 0-4-4H4" })
2395
- ], -1)
2396
- ])], 8, na),
2397
- e("button", {
2398
- class: "fd-tool-btn fd-tool-icon-btn",
2399
- disabled: !_(l).canRedo,
2400
- title: "重做",
2401
- onClick: r[5] || (r[5] = (u) => _(l).redo())
2402
- }, [...r[26] || (r[26] = [
2403
- e("svg", {
2404
- class: "fd-tool-icon",
2405
- viewBox: "0 0 24 24",
2406
- fill: "none",
2407
- stroke: "currentColor",
2408
- "stroke-width": "1.8",
2409
- "stroke-linecap": "round",
2410
- "stroke-linejoin": "round"
2411
- }, [
2412
- e("polyline", { points: "15 14 20 9 15 4" }),
2413
- e("path", { d: "M4 20v-7a4 4 0 0 1 4-4h12" })
2414
- ], -1)
2415
- ])], 8, la),
2416
- e("button", {
2417
- ref_key: "treeBtnRef",
2418
- ref: k,
2419
- class: "fd-tool-btn",
2420
- onClick: r[6] || (r[6] = (u) => d.value = !d.value)
2421
- }, [...r[27] || (r[27] = [
2422
- ce('<svg class="fd-tool-btn-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-a394e704><line x1="8" y1="6" x2="21" y2="6" data-v-a394e704></line><line x1="8" y1="12" x2="21" y2="12" data-v-a394e704></line><line x1="8" y1="18" x2="21" y2="18" data-v-a394e704></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-a394e704></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-a394e704></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-a394e704></line></svg> 组件树 ', 2)
2423
- ])], 512)
2424
- ]),
2425
- (s(), O(re, { to: "body" }, [
2426
- n.value ? (s(), m("div", {
2427
- key: 0,
2428
- class: "fd-dialog-mask",
2429
- onClick: r[9] || (r[9] = R((u) => n.value = !1, ["self"]))
2430
- }, [
2431
- e("div", oa, [
2432
- e("div", aa, [
2433
- r[31] || (r[31] = e("span", null, "预览", -1)),
2434
- e("div", da, [
2435
- r[29] || (r[29] = e("label", { for: "fd-preview-width-input" }, "宽度", -1)),
2436
- M(_(Ye), {
2437
- id: "fd-preview-width-input",
2438
- modelValue: c.value,
2439
- "onUpdate:modelValue": r[7] || (r[7] = (u) => c.value = u),
2440
- min: 270,
2441
- max: 1200,
2442
- step: 10,
2443
- size: "small",
2444
- "controls-position": "right",
2445
- onChange: f
2446
- }, null, 8, ["modelValue"]),
2447
- r[30] || (r[30] = e("span", { class: "fd-preview-width-unit" }, "px", -1))
2448
- ]),
2449
- e("button", {
2450
- class: "fd-tool-btn",
2451
- onClick: r[8] || (r[8] = (u) => n.value = !1)
2452
- }, "关闭")
2453
- ]),
2454
- e("div", ia, [
2455
- e("div", {
2456
- class: "fd-preview-stage",
2457
- style: U({ width: c.value + "px" })
2458
- }, [
2459
- M(Pe, {
2460
- widgets: _(l).widgets,
2461
- "form-data": B.value
2462
- }, null, 8, ["widgets", "form-data"])
2463
- ], 4)
2464
- ])
2465
- ])
2466
- ])) : C("", !0),
2467
- a.value ? (s(), m("div", {
2468
- key: 1,
2469
- class: "fd-dialog-mask",
2470
- onClick: r[11] || (r[11] = R((u) => a.value = !1, ["self"]))
2471
- }, [
2472
- e("div", sa, [
2473
- e("div", ra, [
2474
- r[32] || (r[32] = e("span", null, "JSON Schema", -1)),
2475
- e("button", {
2476
- class: "fd-tool-btn",
2477
- onClick: r[10] || (r[10] = (u) => a.value = !1)
2478
- }, "关闭")
2479
- ]),
2480
- e("pre", ca, h(w.value), 1)
2481
- ])
2482
- ])) : C("", !0),
2483
- i.value ? (s(), m("div", {
2484
- key: 2,
2485
- class: "fd-dialog-mask",
2486
- onClick: r[14] || (r[14] = R((u) => i.value = !1, ["self"]))
2487
- }, [
2488
- e("div", ua, [
2489
- e("div", ma, [
2490
- r[33] || (r[33] = e("span", null, "导入(粘贴 JSON)", -1)),
2491
- e("button", {
2492
- class: "fd-tool-btn",
2493
- onClick: r[12] || (r[12] = (u) => i.value = !1)
2494
- }, "取消"),
2495
- e("button", {
2496
- class: "fd-tool-btn fd-tool-btn--primary",
2497
- onClick: v
2498
- }, "确认")
2499
- ]),
2500
- e("div", fa, [
2501
- se(e("textarea", {
2502
- "onUpdate:modelValue": r[13] || (r[13] = (u) => p.value = u),
2503
- class: "fd-dialog-import-text",
2504
- placeholder: "请粘贴表单 JSON(可从「查看代码」复制),确认后将覆盖当前表单"
2505
- }, null, 512), [
2506
- [qe, p.value]
2507
- ])
2508
- ])
2509
- ])
2510
- ])) : C("", !0),
2511
- d.value ? (s(), m("div", {
2512
- key: 3,
2513
- ref_key: "treeDrawerRef",
2514
- ref: y,
2515
- class: "fd-tree-drawer"
2516
- }, [
2517
- M(Go)
2518
- ], 512)) : C("", !0)
2519
- ]))
2520
- ]));
2521
- }
2522
- }), ba = /* @__PURE__ */ L(pa, [["__scopeId", "data-v-a394e704"]]), va = { class: "fd-palette" }, ga = { class: "fd-palette-group-title" }, ya = ["onDragstart", "onClick"], ha = { class: "fd-palette-icon" }, _a = /* @__PURE__ */ D({
2523
- __name: "WidgetPalette",
2524
- setup(t) {
2525
- const l = V(), n = We(), a = [
2526
- {
2527
- title: "基础控件",
2528
- types: ["label", "text"]
2529
- },
2530
- {
2531
- title: "高级控件",
2532
- types: ["subtable"]
2533
- },
2534
- {
2535
- title: "布局控件",
2536
- types: ["grid", "card", "slot"]
2537
- }
2538
- ], d = {
2539
- grid: "▦",
2540
- card: "▤",
2541
- slot: "⧉",
2542
- label: "T",
2543
- text: "¶",
2544
- subtable: "☰"
2545
- };
2546
- function i(f) {
2547
- return n.find((p) => p.type === f);
2548
- }
2549
- function o(f, p) {
2550
- var v;
2551
- (v = f.dataTransfer) == null || v.setData("application/x-fd-new", p), f.dataTransfer && (f.dataTransfer.effectAllowed = "copy");
2552
- }
2553
- function c(f) {
2554
- l.addWidget(f);
2555
- }
2556
- return (f, p) => (s(), m("div", va, [
2557
- p[0] || (p[0] = e("div", { class: "fd-palette-title" }, "控件库", -1)),
2558
- (s(), m(T, null, F(a, (v) => e("div", {
2559
- key: v.title,
2560
- class: "fd-palette-group"
2561
- }, [
2562
- e("div", ga, h(v.title), 1),
2563
- (s(!0), m(T, null, F(v.types, (w) => (s(), m(T, { key: w }, [
2564
- i(w) ? (s(), m("div", {
2565
- key: 0,
2566
- class: "fd-palette-item",
2567
- draggable: "true",
2568
- onDragstart: (B) => o(B, w),
2569
- onClick: (B) => c(w)
2570
- }, [
2571
- e("span", ha, h(d[w]), 1),
2572
- e("span", null, h(i(w).title), 1)
2573
- ], 40, ya)) : C("", !0)
2574
- ], 64))), 128))
2575
- ])), 64))
2576
- ]));
2577
- }
2578
- }), ka = /* @__PURE__ */ L(_a, [["__scopeId", "data-v-6a2bab90"]]), wa = [
2579
- { key: "onLoad", label: "加载完成", desc: "表单数据就绪后触发" },
2580
- { key: "onMounted", label: "渲染挂载", desc: "渲染完成并挂载到 DOM 后触发" },
2581
- { key: "onValueChange", label: "值变化", desc: "任意字段值变化时触发" },
2582
- { key: "custom", label: "自定义方法", desc: "写入的方法将挂载至全局 window,可在其他事件处理中调用" }
2583
- ], xa = { class: "fd-form-events" }, $a = { class: "fd-form-meta" }, Ca = { class: "fd-events-section" }, Ta = { class: "fd-event-head" }, Sa = ["title"], Ia = { class: "fd-event-key" }, Fa = ["onClick", "title"], Da = {
2584
- key: 0,
2585
- class: "fd-event-trigger-text"
2586
- }, La = {
2587
- key: 1,
2588
- class: "fd-event-trigger-placeholder"
2589
- }, Ma = {
2590
- class: "fd-dialog",
2591
- style: { "max-width": "600px" }
2592
- }, Pa = { class: "fd-dialog-head" }, Na = { class: "fd-dialog-body" }, Ba = /* @__PURE__ */ D({
2593
- __name: "FormEventsPanel",
2594
- setup(t) {
2595
- const l = Re(() => import("./CodeEditor-B7PzbdP9.js")), n = V(), a = xe({
2596
- open: !1,
2597
- type: "",
2598
- hookKey: "",
2599
- index: -1,
2600
- title: "",
2601
- draft: ""
2602
- });
2603
- function d(c) {
2604
- a.open = !0, a.type = "lifecycle", a.hookKey = c.key, a.title = `${c.label}(${c.key})`, a.draft = n.events.lifecycle[c.key] ?? "";
2605
- }
2606
- function i() {
2607
- a.type === "lifecycle" && a.hookKey ? n.setLifecycleHook(a.hookKey, a.draft) : a.type === "custom" && a.index >= 0 && n.updateCustomEvent(a.index, { handler: a.draft }), a.open = !1;
2608
- }
2609
- function o() {
2610
- a.open = !1;
2611
- }
2612
- return (c, f) => (s(), m("div", xa, [
2613
- f[4] || (f[4] = e("div", { class: "fd-property-title" }, "表单属性", -1)),
2614
- e("div", $a, [
2615
- e("span", null, "表单:" + h(_(n).formId), 1),
2616
- e("span", null, "主表:" + h(_(n).dbtable), 1)
2617
- ]),
2618
- e("section", Ca, [
2619
- f[2] || (f[2] = e("h4", { class: "fd-events-h" }, "全局事件 · 生命周期", -1)),
2620
- f[3] || (f[3] = e("p", { class: "fd-events-tip" }, "渲染时绑定至对应钩子函数中执行", -1)),
2621
- (s(!0), m(T, null, F(_(wa), (p) => (s(), m("div", {
2622
- key: p.key,
2623
- class: "fd-event-row"
2624
- }, [
2625
- e("div", Ta, [
2626
- e("label", {
2627
- title: p.desc
2628
- }, h(p.label), 9, Sa),
2629
- e("code", Ia, h(p.key), 1)
2630
- ]),
2631
- e("div", {
2632
- class: "fd-event-trigger",
2633
- onClick: (v) => d(p),
2634
- title: _(n).events.lifecycle[p.key] || "点击编写处理函数"
2635
- }, [
2636
- _(n).events.lifecycle[p.key] ? (s(), m("span", Da, h(_(n).events.lifecycle[p.key]), 1)) : (s(), m("span", La, "点击编写")),
2637
- f[1] || (f[1] = e("span", { class: "fd-event-trigger-arrow" }, "›", -1))
2638
- ], 8, Fa)
2639
- ]))), 128))
2640
- ]),
2641
- (s(), O(re, { to: "body" }, [
2642
- a.open ? (s(), m("div", {
2643
- key: 0,
2644
- class: "fd-dialog-mask",
2645
- onClick: R(o, ["self"])
2646
- }, [
2647
- e("div", Ma, [
2648
- e("div", Pa, [
2649
- e("span", null, "编写处理函数 - " + h(a.title), 1),
2650
- e("button", {
2651
- class: "fd-dialog-close",
2652
- onClick: o,
2653
- title: "关闭"
2654
- }, "×")
2655
- ]),
2656
- e("div", Na, [
2657
- M(_(l), {
2658
- modelValue: a.draft,
2659
- "onUpdate:modelValue": f[0] || (f[0] = (p) => a.draft = p),
2660
- language: "javascript"
2661
- }, null, 8, ["modelValue"])
2662
- ]),
2663
- e("div", { class: "fd-dialog-foot" }, [
2664
- e("button", {
2665
- class: "fd-btn fd-btn--primary",
2666
- onClick: i
2667
- }, "确定")
2668
- ])
2669
- ])
2670
- ])) : C("", !0)
2671
- ]))
2672
- ]));
2673
- }
2674
- }), ja = /* @__PURE__ */ L(Ba, [["__scopeId", "data-v-7e5a3f15"]]), Ea = { class: "fd-property" }, Oa = {
2675
- key: 1,
2676
- class: "fd-property-empty"
2677
- }, qa = {
2678
- key: 1,
2679
- class: "fd-property-item"
2680
- }, Ra = ["value"], Aa = { class: "fd-property-foot" }, Ua = { class: "fd-property-type" }, Va = /* @__PURE__ */ D({
2681
- __name: "PropertyPanel",
2682
- setup(t) {
2683
- const l = V(), n = I(() => l.selectedNode), a = I(() => n.value ? H(n.value.type) : void 0), d = I(() => {
2684
- var f;
2685
- return (f = a.value) == null ? void 0 : f.panel;
2686
- });
2687
- function i(f) {
2688
- n.value && l.updateNode(n.value.id, f);
2689
- }
2690
- const o = I(() => n.value != null && n.value.gridSpan != null);
2691
- function c(f) {
2692
- if (!n.value) return;
2693
- const p = Number(f.target.value), v = Math.min(24, Math.max(1, Number.isFinite(p) ? Math.round(p) : 24));
2694
- l.updateNode(n.value.id, { gridSpan: v });
2695
- }
2696
- return (f, p) => {
2697
- var v;
2698
- return s(), m("div", Ea, [
2699
- p[2] || (p[2] = e("div", { class: "fd-property-title" }, "属性", -1)),
2700
- _(l).selectedForm ? (s(), O(ja, { key: 0 })) : n.value ? (s(), m(T, { key: 2 }, [
2701
- d.value ? (s(), O(ie(d.value), {
2702
- key: 0,
2703
- node: n.value,
2704
- fields: _(l).fields,
2705
- onUpdate: i
2706
- }, null, 40, ["node", "fields"])) : C("", !0),
2707
- o.value ? (s(), m("div", qa, [
2708
- p[1] || (p[1] = e("label", null, "占比", -1)),
2709
- e("input", {
2710
- type: "number",
2711
- min: "1",
2712
- max: "24",
2713
- value: n.value.gridSpan,
2714
- onChange: c
2715
- }, null, 40, Ra)
2716
- ])) : C("", !0),
2717
- e("div", Aa, [
2718
- e("span", Ua, "类型:" + h((v = a.value) == null ? void 0 : v.title), 1)
2719
- ])
2720
- ], 64)) : (s(), m("div", Oa, [...p[0] || (p[0] = [
2721
- e("span", { class: "fd-property-empty-icon" }, "⚙", -1),
2722
- e("span", null, [
2723
- E("请选择左侧控件"),
2724
- e("br"),
2725
- E("或点击画板空白处设置表单属性")
2726
- ], -1)
2727
- ])]))
2728
- ]);
2729
- };
2730
- }
2731
- }), za = /* @__PURE__ */ L(Va, [["__scopeId", "data-v-e89617c7"]]), Ya = {
2732
- key: 0,
2733
- class: "fd-canvas-dropzone"
2734
- }, Ha = /* @__PURE__ */ D({
2735
- __name: "CanvasNode",
2736
- props: {
2737
- node: {},
2738
- parentId: {},
2739
- index: {}
2740
- },
2741
- setup(t) {
2742
- const l = t, n = V(), a = A(null), d = I(() => {
2743
- const b = {};
2744
- return l.node.gridSpan != null && (b.gridColumn = `span ${l.node.gridSpan}`), l.node.type === "text" && (b.display = l.node.display || "inline-block"), Object.keys(b).length ? b : void 0;
2745
- }), i = () => {
2746
- var b;
2747
- return (b = H(l.node.type)) == null ? void 0 : b.isContainer;
2748
- };
2749
- function o(b, y) {
2750
- if (l.node.type !== "grid") return "";
2751
- const k = l.node.layout || 24;
2752
- return Ie(b, y, l.node.children || [], k, n.device === "mobile");
2753
- }
2754
- function c(b) {
2755
- const y = b.dataTransfer;
2756
- return !!y && (y.types.includes("application/x-fd-new") || y.types.includes("application/x-fd-move"));
2757
- }
2758
- function f() {
2759
- n.select(l.node.id);
2760
- }
2761
- function p(b) {
2762
- var y;
2763
- b.stopPropagation(), n.setDragging(l.node.id), (y = b.dataTransfer) == null || y.setData("application/x-fd-move", l.node.id), b.dataTransfer && (b.dataTransfer.effectAllowed = "move");
2764
- }
2765
- function v() {
2766
- n.dragOverId = null, n.dropContainerId = null, n.dragBefore = !1, n.setDragging(null);
2767
- }
2768
- function w(b) {
2769
- b.stopPropagation(), v();
2770
- }
2771
- function B() {
2772
- n.dragOverId === l.node.id && (n.dragOverId = null), n.dropContainerId === l.node.id && (n.dropContainerId = null);
2773
- }
2774
- function q(b) {
2775
- if (c(b))
2776
- if (b.preventDefault(), b.stopPropagation(), i())
2777
- n.dragOverId = null, n.dragBefore = !1, n.dropContainerId = l.node.id;
2778
- else {
2779
- n.dropContainerId = null, n.dragOverId = l.node.id;
2780
- const y = a.value;
2781
- if (y) {
2782
- const k = y.getBoundingClientRect();
2783
- n.dragBefore = b.clientY - k.top < k.height / 2;
2784
- }
2785
- }
2786
- }
2787
- function x() {
2788
- B();
2789
- }
2790
- function S(b) {
2791
- var N, $, r;
2792
- if (!c(b)) return;
2793
- b.preventDefault(), b.stopPropagation();
2794
- const y = (N = b.dataTransfer) == null ? void 0 : N.getData("application/x-fd-new"), k = ($ = b.dataTransfer) == null ? void 0 : $.getData("application/x-fd-move");
2795
- if (i())
2796
- y ? n.addWidget(y, l.node.id) : k && n.moveNode(k, l.node.id, ((r = l.node.children) == null ? void 0 : r.length) ?? 0);
2797
- else {
2798
- const u = n.dragBefore ? l.index : l.index + 1;
2799
- y ? n.addWidget(y, l.parentId, u) : k && n.moveNode(k, l.parentId, u);
2800
- }
2801
- n.dragOverId = null, n.dragBefore = !1, n.dropContainerId = null;
2802
- }
2803
- return (b, y) => {
2804
- const k = Ce("CanvasNode", !0);
2805
- return s(), m("div", {
2806
- ref_key: "rootEl",
2807
- ref: a,
2808
- class: j(["fd-canvas-node", [
2809
- `fd-canvas-node--${t.node.type}`,
2810
- {
2811
- "is-selected": _(n).selectedId === t.node.id,
2812
- "drop-before": _(n).dragOverId === t.node.id && _(n).dragBefore,
2813
- "drop-target": _(n).dropContainerId === t.node.id,
2814
- "dragging-source": _(n).draggingId === t.node.id
2815
- }
2816
- ]]),
2817
- style: U(d.value),
2818
- draggable: "true",
2819
- onMousedown: R(f, ["stop"]),
2820
- onClick: y[4] || (y[4] = R(() => {
2821
- }, ["stop"])),
2822
- onDragstart: p,
2823
- onDragend: w,
2824
- onDragover: q,
2825
- onDragleave: x,
2826
- onDrop: S
2827
- }, [
2828
- e("div", {
2829
- class: "fd-canvas-node-actions",
2830
- onMousedown: y[3] || (y[3] = R(() => {
2831
- }, ["stop"]))
2832
- }, [
2833
- e("span", {
2834
- class: "fd-node-action",
2835
- title: "上移",
2836
- onClick: y[0] || (y[0] = R((N) => _(n).moveSibling(t.node.id, -1), ["stop"]))
2837
- }, [...y[5] || (y[5] = [
2838
- e("svg", {
2839
- class: "fd-node-icon",
2840
- viewBox: "0 0 24 24",
2841
- fill: "none",
2842
- stroke: "currentColor",
2843
- "stroke-width": "1.8",
2844
- "stroke-linecap": "round",
2845
- "stroke-linejoin": "round"
2846
- }, [
2847
- e("line", {
2848
- x1: "12",
2849
- y1: "20",
2850
- x2: "12",
2851
- y2: "5"
2852
- }),
2853
- e("polyline", { points: "6 11 12 5 18 11" })
2854
- ], -1)
2855
- ])]),
2856
- e("span", {
2857
- class: "fd-node-action",
2858
- title: "下移",
2859
- onClick: y[1] || (y[1] = R((N) => _(n).moveSibling(t.node.id, 1), ["stop"]))
2860
- }, [...y[6] || (y[6] = [
2861
- e("svg", {
2862
- class: "fd-node-icon",
2863
- viewBox: "0 0 24 24",
2864
- fill: "none",
2865
- stroke: "currentColor",
2866
- "stroke-width": "1.8",
2867
- "stroke-linecap": "round",
2868
- "stroke-linejoin": "round"
2869
- }, [
2870
- e("line", {
2871
- x1: "12",
2872
- y1: "4",
2873
- x2: "12",
2874
- y2: "19"
2875
- }),
2876
- e("polyline", { points: "6 13 12 19 18 13" })
2877
- ], -1)
2878
- ])]),
2879
- e("span", {
2880
- class: "fd-node-action delete",
2881
- title: "删除",
2882
- onClick: y[2] || (y[2] = R((N) => _(n).removeWidget(t.node.id), ["stop"]))
2883
- }, [...y[7] || (y[7] = [
2884
- ce('<svg class="fd-node-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" data-v-3f3a43d3><path d="M4 7h16" data-v-3f3a43d3></path><path d="M9 7V5.5a1.5 1.5 0 0 1 1.5-1.5h3A1.5 1.5 0 0 1 15 5.5V7" data-v-3f3a43d3></path><path d="M6.5 7l1 12.5h9l1-12.5" data-v-3f3a43d3></path><line x1="10" y1="11" x2="10" y2="16.5" data-v-3f3a43d3></line><line x1="14" y1="11" x2="14" y2="16.5" data-v-3f3a43d3></line></svg>', 1)
2885
- ])])
2886
- ], 32),
2887
- M(me, {
2888
- node: t.node,
2889
- mode: "design"
2890
- }, X({ _: 2 }, [
2891
- i() && t.node.children ? {
2892
- name: "children",
2893
- fn: z(() => [
2894
- (s(!0), m(T, null, F(t.node.children, (N, $) => (s(), O(k, {
2895
- key: N.id,
2896
- node: N,
2897
- "parent-id": t.node.id,
2898
- index: $,
2899
- class: j(o(N, $))
2900
- }, null, 8, ["node", "parent-id", "index", "class"]))), 128)),
2901
- !t.node.children || t.node.children.length === 0 ? (s(), m("div", Ya, "拖拽控件到此容器")) : C("", !0)
2902
- ]),
2903
- key: "0"
2904
- } : void 0
2905
- ]), 1032, ["node"])
2906
- ], 38);
2907
- };
2908
- }
2909
- }), Wa = /* @__PURE__ */ L(Ha, [["__scopeId", "data-v-3f3a43d3"]]), Ga = { class: "fd-designer" }, Ja = { class: "fd-designer-body" }, Qa = { class: "fd-designer-left" }, Za = {
2910
- key: 0,
2911
- class: "fd-canvas-empty"
2912
- }, Ka = { class: "fd-designer-right" }, Xa = /* @__PURE__ */ D({
2913
- __name: "Designer",
2914
- props: {
2915
- formId: {}
2916
- },
2917
- setup(t) {
2918
- const l = t, n = V();
2919
- ee(async () => {
2920
- const d = new URLSearchParams(window.location.search).get("templateType") || "";
2921
- n.device = d === "mobile" || d === "2" ? "mobile" : "pc";
2922
- const i = new URLSearchParams(window.location.search).get("formId") || "", o = l.formId || i || "";
2923
- if (o) {
2924
- const c = Me(o);
2925
- if (c) {
2926
- const f = await te(o);
2927
- n.loadSchema({ ...c, fields: f.fields, dbtable: f.dbtable });
2928
- } else
2929
- n.loadSchema(await te(o));
2930
- n.openedWithParam = !0;
2931
- } else {
2932
- const c = await te("");
2933
- n.loadSchema(c), n.openedWithParam = !1, n.formId = "";
2934
- }
2935
- });
2936
- function a(d) {
2937
- var c, f;
2938
- d.preventDefault();
2939
- const i = (c = d.dataTransfer) == null ? void 0 : c.getData("application/x-fd-new"), o = (f = d.dataTransfer) == null ? void 0 : f.getData("application/x-fd-move");
2940
- i ? n.addWidget(i, null, n.widgets.length) : o && n.moveNode(o, null, n.widgets.length);
2941
- }
2942
- return (d, i) => (s(), m("div", Ga, [
2943
- M(ba),
2944
- e("div", Ja, [
2945
- e("aside", Qa, [
2946
- M(ka)
2947
- ]),
2948
- e("main", {
2949
- class: "fd-designer-center",
2950
- onDragover: i[1] || (i[1] = R(() => {
2951
- }, ["prevent"])),
2952
- onDrop: a
2953
- }, [
2954
- e("div", {
2955
- class: j(["fd-canvas", { "is-mobile": _(n).device === "mobile", "is-selected": _(n).selectedForm }]),
2956
- onClick: i[0] || (i[0] = (o) => _(n).selectForm())
2957
- }, [
2958
- _(n).widgets.length === 0 ? (s(), m("div", Za, [...i[2] || (i[2] = [
2959
- e("span", { class: "fd-canvas-empty-icon" }, "▦", -1),
2960
- e("span", null, "从左侧拖拽控件到此处", -1)
2961
- ])])) : C("", !0),
2962
- (s(!0), m(T, null, F(_(n).widgets, (o, c) => (s(), O(Wa, {
2963
- key: o.id,
2964
- node: o,
2965
- "parent-id": null,
2966
- index: c
2967
- }, null, 8, ["node", "index"]))), 128))
2968
- ], 2)
2969
- ], 32),
2970
- e("aside", Ka, [
2971
- M(za)
2972
- ])
2973
- ])
2974
- ]));
2975
- }
2976
- }), ed = /* @__PURE__ */ L(Xa, [["__scopeId", "data-v-ed429565"]]);
2977
- function cd(t) {
2978
- fe(), (t.apiModule || t.baseModule) && De({ apiModule: t.apiModule, baseModule: t.baseModule });
2979
- let l = null;
2980
- const a = Ae({
2981
- render: () => Ue(Pe, {
2982
- widgets: t.widgets,
2983
- formMode: t.formMode,
2984
- formData: t.formData,
2985
- events: t.events,
2986
- formId: t.formId,
2987
- ref: (d) => {
2988
- l = d;
2989
- }
2990
- })
2991
- });
2992
- return a.mount(t.container), {
2993
- fireEvent: (d, i) => {
2994
- var o;
2995
- return (o = l == null ? void 0 : l.fireEvent) == null ? void 0 : o.call(l, d, i);
2996
- },
2997
- unmount: () => a.unmount()
2998
- };
2999
- }
3000
- const ud = {
3001
- install(t, l = {}) {
3002
- fe(), (l.apiModule || l.baseModule) && De({ apiModule: l.apiModule, baseModule: l.baseModule }), t.component("FdDesigner", ed);
3003
- }
3004
- };
3005
- export {
3006
- ed as D,
3007
- wa as L,
3008
- L as _,
3009
- ud as a,
3010
- cd as b,
3011
- De as c,
3012
- rd as d,
3013
- Q as r,
3014
- sd as s
3015
- };
3016
- //# sourceMappingURL=index-oUADtA5r.js.map