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-DCHlgXXr.js DELETED
@@ -1,3033 +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 R, 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 A, 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 Be, guardReactiveProps as je, provide as Ee, watch as Te, createStaticVNode as ce, onBeforeUnmount as Oe, vModelText as qe, defineAsyncComponent as Ae, createApp as Re, 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, i] of l)
49
- n[a] = i;
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
- }), i = I(() => l.value !== void 0 && l.value !== null && l.value !== "" ? String(l.value) : a.value ? a.value : ""), d = V(), o = R(!1);
64
- let r = null;
65
- ee(() => {
66
- r = window.matchMedia("(max-width: 768px)"), o.value = r.matches, r.addEventListener("change", (p) => {
67
- o.value = p.matches;
68
- });
69
- }), ke(() => {
70
- r && r.removeEventListener("change", () => {
71
- });
72
- });
73
- const f = I(() => d.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(i.value), 9, et)) : (s(), m(T, { key: 1 }, [
90
- E(h(i.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, i = I(() => n.fields.filter((p) => p.dataType === "link"));
104
- function d(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 r = (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": r
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(i.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: d(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, i) => 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 (i, d) => (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: A(a, ["stop"])
247
- }, [...d[0] || (d[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(i.$slots, "children", {}, () => [
262
- d[1] || (d[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 Se(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 = R(t.node.expanded);
286
- return (a, i) => {
287
- var d;
288
- return _(Se)(t.node.hiddenMode, (d = t.formData) == null ? void 0 : d.status) ? C("", !0) : (s(), m("div", xt, [
289
- e("div", {
290
- class: "fd-card-head",
291
- onClick: i[0] || (i[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
- }, [...i[1] || (i[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, i) => (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: i[0] || (i[0] = (d) => n("update:modelValue", !t.modelValue))
343
- }, [...i[1] || (i[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" }, At = ["value"], Rt = { 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 = R(!1);
410
- function i(d) {
411
- n("update", { icon: d }), a.value = !1;
412
- }
413
- return (d, 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] = (r) => n("update", { label: r.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] = (r) => 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] = A(() => {
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] = (r) => i(""))
458
- }, [...o[10] || (o[10] = [
459
- e("span", { class: "fd-icon-none" }, "无", -1)
460
- ])], 2),
461
- (s(!0), m(T, null, F(_(Dt), (r) => (s(), m("button", {
462
- key: r,
463
- type: "button",
464
- class: j(["fd-icon-option", { active: t.node.icon === r }]),
465
- title: r,
466
- onClick: (f) => i(r)
467
- }, [
468
- M(oe, {
469
- name: r,
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] = (r) => n("update", { iconBgColor: r.target.value }))
482
- }, null, 40, At)
483
- ]),
484
- e("div", Rt, [
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] = (r) => n("update", { expanded: r }))
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] = (r) => n("update", { width: r.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] = (r) => n("update", { hiddenMode: r.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 _(Se)(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, i) => (s(), m("div", on, [
580
- e("div", an, [
581
- i[3] || (i[3] = e("label", null, "标题", -1)),
582
- e("input", {
583
- value: t.node.label,
584
- onInput: i[0] || (i[0] = (d) => n("update", { label: d.target.value }))
585
- }, null, 40, dn)
586
- ]),
587
- e("div", sn, [
588
- i[4] || (i[4] = e("label", null, "插槽名", -1)),
589
- e("input", {
590
- value: t.node.slotName,
591
- placeholder: "如 header / basic-info",
592
- onInput: i[1] || (i[1] = (d) => n("update", { slotName: d.target.value }))
593
- }, null, 40, rn)
594
- ]),
595
- e("div", cn, [
596
- i[6] || (i[6] = e("label", null, "是否隐藏", -1)),
597
- e("select", {
598
- value: t.node.hiddenMode || "none",
599
- onChange: i[2] || (i[2] = (d) => n("update", { hiddenMode: d.target.value }))
600
- }, [...i[5] || (i[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, i) => (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((d) => d.isshow === 1), (d) => (s(), m("th", {
655
- key: d.name,
656
- style: U({ width: d.showwidth || void 0 })
657
- }, h(d.showname || d.major || d.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((d) => d.isshow === 1), (d) => (s(), m("td", {
664
- key: d.name,
665
- class: j(["fd-st-cell", { "fd-st-cell--link": !!d.bindLink }])
666
- }, h(d.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((d) => d.isshow === 1), (d) => (s(), m("div", {
673
- key: d.name,
674
- class: "fd-st-card-row"
675
- }, [
676
- e("span", wn, h(d.showname || d.major), 1),
677
- e("span", {
678
- class: j(["fd-st-card-value", { "fd-st-card-value--link": !!d.bindLink }])
679
- }, h(d.name), 3)
680
- ]))), 128))
681
- ]),
682
- t.node.colnums.filter((d) => d.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
- }, An = { class: "fd-st-card-label" }, Rn = ["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(($) => $.isshow === 1)), a = I(() => l.node.isreadonly === "1"), i = I(() => {
718
- var S;
719
- const $ = (S = l.formData) == null ? void 0 : S[l.node.secondtable];
720
- return Array.isArray($) ? $ : [];
721
- }), d = I(() => !(l.node.nodatahidetable === "1" && i.value.length === 0)), o = I(() => l.node.tablestyle !== "cards");
722
- function r() {
723
- if (a.value) return;
724
- const $ = {};
725
- n.value.forEach((S) => $[S.name] = ""), l.formData && Array.isArray(l.formData[l.node.secondtable]) && l.formData[l.node.secondtable].push($);
726
- }
727
- function f($) {
728
- a.value || l.formData && Array.isArray(l.formData[l.node.secondtable]) && l.formData[l.node.secondtable].splice($, 1);
729
- }
730
- function p($, S) {
731
- const b = $[S];
732
- return b == null ? "" : String(b);
733
- }
734
- function v($, S) {
735
- return $.bindLink ? p(S, $.bindLink) : "";
736
- }
737
- const w = I(() => {
738
- const $ = i.value, S = [], b = [];
739
- return n.value.forEach((y, k) => {
740
- S[k] = [], b[k] = [];
741
- const N = y.issamecolmerge === 1;
742
- let x = 0;
743
- for (let c = 0; c < $.length; c++) {
744
- const u = p($[c], y.name);
745
- N && u !== "" && c > 0 && u === p($[c - 1], y.name) ? (b[k][c] = !0, S[k][x] += 1) : (b[k][c] = !1, S[k][c] = 1, x = c);
746
- }
747
- }), { spans: S, skipped: b };
748
- });
749
- function B($, S) {
750
- var b;
751
- return ((b = w.value.skipped[$]) == null ? void 0 : b[S]) === !0;
752
- }
753
- function q($, S) {
754
- var y;
755
- const b = (y = w.value.spans[$]) == null ? void 0 : y[S];
756
- return b && b > 1 ? b : void 0;
757
- }
758
- return ($, S) => d.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(i.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
- i.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(i.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", An, 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, Rn)
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
- i.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: r
852
- }, "新增一行"))
853
- ], 8, Tn)) : C("", !0);
854
- }
855
- }), Wn = /* @__PURE__ */ L(Hn, [["__scopeId", "data-v-a650847e"]]), Gn = "2743c35b-2138-4214-b736-6d709bd0b463", Jn = "PC", Qn = "SG_ZL_YYQHTSP", Zn = [{ 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" }], Kn = /* @__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":{}}]'), Xn = { lifecycle: {}, custom: [] }, el = {
856
- formId: Gn,
857
- templateType: Jn,
858
- dbtable: Qn,
859
- fields: Zn,
860
- widgets: Kn,
861
- events: Xn
862
- }, Ie = [
863
- {
864
- name: "SG_ZL_YYQHTSPC",
865
- label: "原合同退租信息",
866
- fields: [
867
- { name: "shop_no", label: "铺位号", dataType: "string" },
868
- { name: "brand_name", label: "品牌名称", dataType: "string" },
869
- { name: "quit_reason", label: "合同退租原因", dataType: "string" },
870
- { name: "quit_date", label: "合同退租日期", dataType: "date" },
871
- { name: "deduct_amount", label: "合同扣款金额", dataType: "money" },
872
- { name: "detail", label: "详情", dataType: "string" },
873
- { name: "detail_url", label: "详情链接", dataType: "link" }
874
- ]
875
- },
876
- {
877
- name: "SG_ZL_YYQHTYS",
878
- label: "预算完成情况预测",
879
- fields: [
880
- { name: "calibers", label: "测算口径", dataType: "string" },
881
- { name: "fee_item", label: "费项", dataType: "string" },
882
- { name: "annual_budget", label: "年度预算(A)", dataType: "money" },
883
- { name: "contract_receivable", label: "合同应收(B)", dataType: "money" },
884
- { name: "budget_gap", label: "预算缺口(C=B-A)", dataType: "money" },
885
- { name: "forecast_income", label: "预测收入(D)", dataType: "money" },
886
- { name: "forecast_gap", label: "预测缺口(E=D-A)", dataType: "money" },
887
- { name: "light", label: "亮灯提示", dataType: "string" }
888
- ]
889
- },
890
- {
891
- name: "SG_ZL_YYQHTHT",
892
- label: "合同列表",
893
- fields: [
894
- { name: "seq", label: "序号", dataType: "number" },
895
- { name: "contract_type", label: "合同类型", dataType: "string" },
896
- { name: "contract_name", label: "合同名称", dataType: "string" },
897
- { name: "party_a", label: "甲方", dataType: "string" },
898
- { name: "party_b", label: "乙方", dataType: "string" },
899
- { name: "use_template", label: "使用合同模版", dataType: "string" },
900
- { name: "operate", label: "操作", dataType: "string" }
901
- ]
902
- },
903
- {
904
- name: "SG_ZL_YYQHTJB",
905
- label: "交办记录",
906
- fields: [
907
- { name: "original_approver", label: "原审批人", dataType: "string" },
908
- { name: "delegate_to", label: "交办人", dataType: "string" },
909
- { name: "delegate_time", label: "交办时间", dataType: "date" },
910
- { name: "delegate_opinion", label: "交办意见", dataType: "string" }
911
- ]
912
- },
913
- {
914
- name: "SG_ZL_YYQHTFJ",
915
- label: "附件信息",
916
- fields: [
917
- { name: "seq", label: "序号", dataType: "number" },
918
- { name: "attachment_type", label: "附件类型", dataType: "string" },
919
- { name: "file_name", label: "文件名称", dataType: "file" },
920
- { name: "upload_user", label: "上传人", dataType: "string" },
921
- { name: "upload_time", label: "上传时间", dataType: "date" }
922
- ]
923
- },
924
- {
925
- name: "SG_ZL_YYQHTTH",
926
- label: "退回详情",
927
- fields: [
928
- { name: "approver", label: "审批人", dataType: "string" },
929
- { name: "description", label: "说明", dataType: "string" },
930
- { name: "reject_reason", label: "退回原因", dataType: "string" },
931
- { name: "reject_time", label: "时间", dataType: "date" }
932
- ]
933
- },
934
- {
935
- name: "SG_ZL_YYQHTFK",
936
- label: "合同付款计划",
937
- fields: [
938
- { name: "pay_phase", label: "期次", dataType: "string" },
939
- { name: "pay_amount", label: "金额", dataType: "money" },
940
- { name: "pay_date", label: "计划付款日", dataType: "date" },
941
- { name: "pay_status", label: "状态", dataType: "string" }
942
- ]
943
- }
944
- ], tl = Ie.map((t) => ({ name: t.name, label: t.label }));
945
- function pe(t) {
946
- return Ie.find((l) => l.name === t);
947
- }
948
- function nl(t) {
949
- return t.fields.map((l, n) => {
950
- const a = l.dataType === "file";
951
- return {
952
- name: l.name,
953
- isshow: 1,
954
- major: "",
955
- showname: l.label,
956
- showwidth: "",
957
- background: "",
958
- prospect: "",
959
- issum: 0,
960
- index: n + 1,
961
- align: "",
962
- iscompletehide: 0,
963
- iscompletehidecode: "",
964
- issamecolmerge: 0,
965
- bindLink: "",
966
- editmode: { editmode: a ? "files" : "text", title: a ? "文件" : "文本" },
967
- events: []
968
- };
969
- });
970
- }
971
- function ll(t) {
972
- return {
973
- ...el,
974
- formId: t
975
- };
976
- }
977
- const ol = { class: "fd-panel" }, al = { class: "fd-panel-item" }, dl = { class: "fd-panel-item fd-panel-item--row" }, il = { class: "fd-panel-item fd-panel-item--row" }, sl = { class: "fd-panel-item" }, rl = { class: "fd-panel-item" }, cl = { class: "fd-cols-head" }, ul = {
978
- key: 0,
979
- class: "fd-cols-empty"
980
- }, ml = { class: "fd-col-card-top" }, fl = { class: "fd-col-order" }, pl = { class: "fd-col-meta" }, bl = { class: "fd-col-title" }, vl = { class: "fd-col-name-sub" }, gl = { class: "fd-col-tag" }, yl = { class: "fd-col-card-bottom" }, hl = { class: "fd-col-switch" }, _l = { class: "fd-col-actions" }, kl = ["onClick"], wl = ["onClick"], xl = {
981
- class: "fd-dialog",
982
- style: { "max-width": "560px" }
983
- }, $l = { class: "fd-dialog-head" }, Cl = { class: "fd-dialog-body" }, Tl = { class: "fd-form-section" }, Sl = { class: "fd-form-grid" }, Il = { class: "fd-form-item" }, Fl = ["value"], Dl = ["value"], Ll = { class: "fd-form-item" }, Ml = ["value"], Pl = { class: "fd-form-item" }, Nl = ["value"], Bl = { class: "fd-form-item" }, jl = ["value"], El = { class: "fd-form-section" }, Ol = { class: "fd-form-grid" }, ql = { class: "fd-form-item" }, Al = ["value"], Rl = { class: "fd-form-item" }, Ul = ["value"], Vl = { class: "fd-form-item" }, zl = { class: "fd-color-row" }, Yl = ["value"], Hl = ["value"], Wl = { class: "fd-form-item" }, Gl = { class: "fd-color-row" }, Jl = ["value"], Ql = ["value"], Zl = { class: "fd-form-section" }, Kl = { class: "fd-form-grid" }, Xl = { class: "fd-form-item" }, eo = { class: "fd-form-item" }, to = ["value"], no = ["value"], lo = /* @__PURE__ */ D({
984
- __name: "SubtablePanel",
985
- props: {
986
- node: {},
987
- fields: {}
988
- },
989
- emits: ["update"],
990
- setup(t, { emit: l }) {
991
- const n = t, a = l;
992
- function i(c, u) {
993
- a("update", { [c]: u });
994
- }
995
- function d(c) {
996
- const u = c ?? "", g = pe(u), P = { secondtable: u };
997
- g && (P.displaytitle = g.label, P.colnums = nl(g)), a("update", P);
998
- }
999
- const o = xe({
1000
- open: !1,
1001
- index: -1,
1002
- draft: null
1003
- });
1004
- function r(c) {
1005
- return JSON.parse(JSON.stringify(c));
1006
- }
1007
- function f(c) {
1008
- o.index = c, o.draft = r(n.node.colnums[c]), o.open = !0;
1009
- }
1010
- function p() {
1011
- o.open = !1, o.draft = null, o.index = -1;
1012
- }
1013
- function v() {
1014
- if (o.draft && o.index >= 0) {
1015
- const c = [...n.node.colnums];
1016
- c[o.index] = o.draft, a("update", { colnums: c });
1017
- }
1018
- p();
1019
- }
1020
- function w(c, u) {
1021
- c.isshow = u ? 1 : 0, a("update", { colnums: [...n.node.colnums] });
1022
- }
1023
- async function B() {
1024
- const c = {
1025
- name: `col_${Date.now().toString(36)}`,
1026
- isshow: 1,
1027
- major: "",
1028
- showname: "新列",
1029
- showwidth: "",
1030
- background: "",
1031
- prospect: "",
1032
- issum: 0,
1033
- index: n.node.colnums.length + 1,
1034
- align: "",
1035
- iscompletehide: 0,
1036
- iscompletehidecode: "",
1037
- issamecolmerge: 0,
1038
- bindLink: "",
1039
- editmode: { editmode: "text", title: "文本" },
1040
- events: []
1041
- };
1042
- a("update", { colnums: [...n.node.colnums, c] }), await $e(), f(n.node.colnums.length - 1);
1043
- }
1044
- function q(c) {
1045
- const u = n.node.colnums.slice();
1046
- u.splice(c, 1), a("update", { colnums: u });
1047
- }
1048
- function $(c) {
1049
- return /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(c) ? c : "#ffffff";
1050
- }
1051
- function S(c, u) {
1052
- o.draft && (o.draft[c] = u.target.value);
1053
- }
1054
- const b = I(() => {
1055
- var c;
1056
- return ((c = pe(n.node.secondtable)) == null ? void 0 : c.fields) ?? [];
1057
- }), y = I(() => b.value.filter((c) => c.dataType === "link"));
1058
- function k(c) {
1059
- o.draft && (o.draft.bindLink = c ?? "");
1060
- }
1061
- function N(c) {
1062
- i("tablestyle", c || "table");
1063
- }
1064
- function x(c) {
1065
- if (!o.draft) return;
1066
- const u = c.target.value;
1067
- o.draft.name = u;
1068
- const g = b.value.find((P) => P.name === u);
1069
- if (g) {
1070
- o.draft.showname = g.label;
1071
- const P = g.dataType === "file";
1072
- o.draft.editmode.editmode = P ? "files" : "text", o.draft.editmode.title = P ? "文件" : "文本";
1073
- }
1074
- }
1075
- return (c, u) => (s(), m(T, null, [
1076
- e("div", ol, [
1077
- e("div", al, [
1078
- u[14] || (u[14] = e("label", null, "选择子表", -1)),
1079
- M(_(le), {
1080
- "model-value": t.node.secondtable,
1081
- filterable: "",
1082
- clearable: "",
1083
- placeholder: "请选择子表",
1084
- style: { width: "100%" },
1085
- "onUpdate:modelValue": d
1086
- }, {
1087
- default: z(() => [
1088
- (s(!0), m(T, null, F(_(tl), (g) => (s(), O(_(G), {
1089
- key: g.name,
1090
- label: `${g.label}(${g.name})`,
1091
- value: g.name
1092
- }, null, 8, ["label", "value"]))), 128))
1093
- ]),
1094
- _: 1
1095
- }, 8, ["model-value"])
1096
- ]),
1097
- e("div", dl, [
1098
- u[15] || (u[15] = e("label", null, "只读", -1)),
1099
- M(K, {
1100
- "model-value": t.node.isreadonly === "1",
1101
- "onUpdate:modelValue": u[0] || (u[0] = (g) => i("isreadonly", g ? "1" : "0"))
1102
- }, null, 8, ["model-value"])
1103
- ]),
1104
- e("div", il, [
1105
- u[16] || (u[16] = e("label", null, "序号列", -1)),
1106
- M(K, {
1107
- "model-value": t.node.secondtableindex === "1",
1108
- "onUpdate:modelValue": u[1] || (u[1] = (g) => i("secondtableindex", g ? "1" : "0"))
1109
- }, null, 8, ["model-value"])
1110
- ]),
1111
- e("div", sl, [
1112
- u[17] || (u[17] = e("label", null, "表格样式", -1)),
1113
- M(_(le), {
1114
- "model-value": t.node.tablestyle || "table",
1115
- style: { width: "100%" },
1116
- "onUpdate:modelValue": N
1117
- }, {
1118
- default: z(() => [
1119
- M(_(G), {
1120
- label: "表格",
1121
- value: "table"
1122
- }),
1123
- M(_(G), {
1124
- label: "卡片列表",
1125
- value: "cards"
1126
- })
1127
- ]),
1128
- _: 1
1129
- }, 8, ["model-value"])
1130
- ]),
1131
- e("div", rl, [
1132
- e("div", cl, [
1133
- e("span", null, "列配置(" + h(t.node.colnums.length) + ")", 1),
1134
- e("button", {
1135
- class: "fd-btn fd-btn--primary fd-btn--sm",
1136
- onClick: B
1137
- }, "+ 新增列")
1138
- ]),
1139
- t.node.colnums.length === 0 ? (s(), m("div", ul, " 暂无列,点击「新增列」添加 ")) : C("", !0),
1140
- (s(!0), m(T, null, F(t.node.colnums, (g, P) => (s(), m("div", {
1141
- key: g.name,
1142
- class: "fd-col-card"
1143
- }, [
1144
- e("div", ml, [
1145
- e("span", fl, h(P + 1), 1),
1146
- e("div", pl, [
1147
- e("span", bl, h(g.showname || "未命名列"), 1),
1148
- e("span", vl, h(g.name), 1)
1149
- ]),
1150
- e("span", gl, h(g.bindLink ? "链接" : "文本"), 1)
1151
- ]),
1152
- e("div", yl, [
1153
- e("label", hl, [
1154
- u[18] || (u[18] = e("span", null, "显示", -1)),
1155
- M(K, {
1156
- "model-value": g.isshow === 1,
1157
- "onUpdate:modelValue": (J) => w(g, J)
1158
- }, null, 8, ["model-value", "onUpdate:modelValue"])
1159
- ]),
1160
- e("div", _l, [
1161
- e("button", {
1162
- class: "fd-btn fd-btn--ghost fd-btn--sm",
1163
- onClick: (J) => f(P)
1164
- }, "设置", 8, kl),
1165
- e("button", {
1166
- class: "fd-btn fd-btn--danger fd-btn--sm",
1167
- onClick: (J) => q(P)
1168
- }, "删除", 8, wl)
1169
- ])
1170
- ])
1171
- ]))), 128))
1172
- ])
1173
- ]),
1174
- (s(), O(re, { to: "body" }, [
1175
- o.open && o.draft ? (s(), m("div", {
1176
- key: 0,
1177
- class: "fd-dialog-mask",
1178
- onClick: A(p, ["self"])
1179
- }, [
1180
- e("div", xl, [
1181
- e("div", $l, [
1182
- e("span", null, "列设置 · " + h(o.draft.showname || o.draft.name || "新列"), 1),
1183
- e("button", {
1184
- class: "fd-dialog-close",
1185
- onClick: p,
1186
- title: "关闭"
1187
- }, "×")
1188
- ]),
1189
- e("div", Cl, [
1190
- e("section", Tl, [
1191
- u[24] || (u[24] = e("h5", { class: "fd-form-section-h" }, "基本信息", -1)),
1192
- e("div", Sl, [
1193
- e("div", Il, [
1194
- u[20] || (u[20] = e("label", null, "列字段", -1)),
1195
- e("select", {
1196
- value: o.draft.name,
1197
- onChange: u[2] || (u[2] = (g) => x(g))
1198
- }, [
1199
- u[19] || (u[19] = e("option", { value: "" }, "请选择字段", -1)),
1200
- (s(!0), m(T, null, F(b.value, (g) => (s(), m("option", {
1201
- key: g.name,
1202
- value: g.name
1203
- }, h(g.label) + "(" + h(g.name) + ")", 9, Dl))), 128))
1204
- ], 40, Fl)
1205
- ]),
1206
- e("div", Ll, [
1207
- u[21] || (u[21] = e("label", null, "显示标题", -1)),
1208
- e("input", {
1209
- value: o.draft.showname,
1210
- onInput: u[3] || (u[3] = (g) => o.draft.showname = g.target.value),
1211
- placeholder: "如 姓名"
1212
- }, null, 40, Ml)
1213
- ]),
1214
- e("div", Pl, [
1215
- u[22] || (u[22] = e("label", null, "主表头分组", -1)),
1216
- e("input", {
1217
- value: o.draft.major,
1218
- onInput: u[4] || (u[4] = (g) => o.draft.major = g.target.value),
1219
- placeholder: "可合并表头分组名"
1220
- }, null, 40, Nl)
1221
- ]),
1222
- e("div", Bl, [
1223
- u[23] || (u[23] = e("label", null, "列序号", -1)),
1224
- e("input", {
1225
- type: "number",
1226
- min: "1",
1227
- value: o.draft.index,
1228
- onInput: u[5] || (u[5] = (g) => o.draft.index = Number(g.target.value))
1229
- }, null, 40, jl)
1230
- ])
1231
- ])
1232
- ]),
1233
- e("section", El, [
1234
- u[30] || (u[30] = e("h5", { class: "fd-form-section-h" }, "显示与样式", -1)),
1235
- e("div", Ol, [
1236
- e("div", ql, [
1237
- u[25] || (u[25] = e("label", null, "列宽", -1)),
1238
- e("input", {
1239
- value: o.draft.showwidth,
1240
- onInput: u[6] || (u[6] = (g) => o.draft.showwidth = g.target.value),
1241
- placeholder: "如 120px 或 20%"
1242
- }, null, 40, Al)
1243
- ]),
1244
- e("div", Rl, [
1245
- u[27] || (u[27] = e("label", null, "对齐方式", -1)),
1246
- e("select", {
1247
- value: o.draft.align,
1248
- onChange: u[7] || (u[7] = (g) => o.draft.align = g.target.value)
1249
- }, [...u[26] || (u[26] = [
1250
- e("option", { value: "" }, "默认(左)", -1),
1251
- e("option", { value: "left" }, "左对齐", -1),
1252
- e("option", { value: "center" }, "居中", -1),
1253
- e("option", { value: "right" }, "右对齐", -1)
1254
- ])], 40, Ul)
1255
- ]),
1256
- e("div", Vl, [
1257
- u[28] || (u[28] = e("label", null, "背景色", -1)),
1258
- e("div", zl, [
1259
- e("input", {
1260
- type: "color",
1261
- value: $(o.draft.background),
1262
- onInput: u[8] || (u[8] = (g) => S("background", g))
1263
- }, null, 40, Yl),
1264
- e("input", {
1265
- value: o.draft.background,
1266
- onInput: u[9] || (u[9] = (g) => o.draft.background = g.target.value),
1267
- placeholder: "如 #f5f7fa 或空"
1268
- }, null, 40, Hl)
1269
- ])
1270
- ]),
1271
- e("div", Wl, [
1272
- u[29] || (u[29] = e("label", null, "字体色", -1)),
1273
- e("div", Gl, [
1274
- e("input", {
1275
- type: "color",
1276
- value: $(o.draft.prospect),
1277
- onInput: u[10] || (u[10] = (g) => S("prospect", g))
1278
- }, null, 40, Jl),
1279
- e("input", {
1280
- value: o.draft.prospect,
1281
- onInput: u[11] || (u[11] = (g) => o.draft.prospect = g.target.value),
1282
- placeholder: "如 #f5523a 或空"
1283
- }, null, 40, Ql)
1284
- ])
1285
- ])
1286
- ])
1287
- ]),
1288
- e("section", Zl, [
1289
- u[34] || (u[34] = e("h5", { class: "fd-form-section-h" }, "编辑模式", -1)),
1290
- e("div", Kl, [
1291
- e("div", Xl, [
1292
- u[31] || (u[31] = e("label", null, "同内容合并", -1)),
1293
- M(K, {
1294
- "model-value": o.draft.issamecolmerge === 1,
1295
- "onUpdate:modelValue": u[12] || (u[12] = (g) => o.draft.issamecolmerge = g ? 1 : 0)
1296
- }, null, 8, ["model-value"])
1297
- ]),
1298
- e("div", eo, [
1299
- u[33] || (u[33] = e("label", null, "链接", -1)),
1300
- e("select", {
1301
- value: o.draft.bindLink ?? "",
1302
- onChange: u[13] || (u[13] = (g) => k(g.target.value))
1303
- }, [
1304
- u[32] || (u[32] = e("option", { value: "" }, "不绑定", -1)),
1305
- (s(!0), m(T, null, F(y.value, (g) => (s(), m("option", {
1306
- key: g.name,
1307
- value: g.name
1308
- }, h(g.label) + "(" + h(g.name) + ")", 9, no))), 128))
1309
- ], 40, to)
1310
- ])
1311
- ])
1312
- ])
1313
- ]),
1314
- e("div", { class: "fd-dialog-foot" }, [
1315
- e("button", {
1316
- class: "fd-btn fd-btn--ghost",
1317
- onClick: p
1318
- }, "取消"),
1319
- e("button", {
1320
- class: "fd-btn fd-btn--primary",
1321
- onClick: v
1322
- }, "确定")
1323
- ])
1324
- ])
1325
- ])) : C("", !0)
1326
- ]))
1327
- ], 64));
1328
- }
1329
- }), oo = /* @__PURE__ */ L(lo, [["__scopeId", "data-v-31bf2515"]]);
1330
- function ao() {
1331
- return [
1332
- {
1333
- name: "field1",
1334
- isshow: 1,
1335
- major: "",
1336
- showname: "字段一",
1337
- showwidth: "",
1338
- background: "",
1339
- prospect: "",
1340
- issum: 0,
1341
- index: 1,
1342
- align: "",
1343
- iscompletehide: 0,
1344
- iscompletehidecode: "",
1345
- issamecolmerge: 0,
1346
- bindLink: "",
1347
- editmode: { editmode: "text", title: "文本" },
1348
- events: []
1349
- },
1350
- {
1351
- name: "field2",
1352
- isshow: 1,
1353
- major: "",
1354
- showname: "字段二",
1355
- showwidth: "",
1356
- background: "",
1357
- prospect: "",
1358
- issum: 0,
1359
- index: 2,
1360
- align: "",
1361
- iscompletehide: 0,
1362
- iscompletehidecode: "",
1363
- issamecolmerge: 0,
1364
- bindLink: "",
1365
- editmode: { editmode: "text", title: "文本" },
1366
- events: []
1367
- }
1368
- ];
1369
- }
1370
- const io = {
1371
- type: "subtable",
1372
- title: "子表",
1373
- design: Cn,
1374
- render: Wn,
1375
- panel: oo,
1376
- isContainer: !1,
1377
- createDefaultProps: () => ({
1378
- id: "",
1379
- type: "subtable",
1380
- label: "子表",
1381
- bindField: "",
1382
- firsttable: "",
1383
- secondtable: "",
1384
- primarytablefiled: "",
1385
- secondtableprimarykey: "",
1386
- secondtablerelationfield: "",
1387
- tabletype: "subtable",
1388
- displaytitle: "",
1389
- tablestyle: "table",
1390
- isreadonly: "1",
1391
- isnull: "0",
1392
- issave: "0",
1393
- secondtableindex: "0",
1394
- nodatahidetable: "0",
1395
- nodatatitle: "1",
1396
- fixedcolumn: 0,
1397
- tablewidth: 0,
1398
- tableheight: 0,
1399
- iscompletehide: "0",
1400
- iscompletehidecode: "",
1401
- colnums: ao(),
1402
- events: []
1403
- }),
1404
- serialize: (t) => t
1405
- }, so = /* @__PURE__ */ D({
1406
- __name: "GridDesign",
1407
- props: {
1408
- node: {}
1409
- },
1410
- setup(t) {
1411
- const l = V();
1412
- return (n, a) => (s(), m("div", {
1413
- class: j(["fd-grid-design", { "is-mobile": _(l).device === "mobile" }])
1414
- }, [
1415
- W(n.$slots, "children", {}, void 0, !0)
1416
- ], 2));
1417
- }
1418
- }), ro = /* @__PURE__ */ L(so, [["__scopeId", "data-v-25511a77"]]), me = /* @__PURE__ */ D({
1419
- __name: "WidgetHost",
1420
- props: {
1421
- node: {},
1422
- mode: {},
1423
- formMode: {},
1424
- formData: {},
1425
- formId: {}
1426
- },
1427
- setup(t) {
1428
- const l = t, n = I(() => H(l.node.type)), a = I(() => n.value ? l.mode === "design" ? n.value.design : n.value.render : null), i = (d) => d && l.formData ? l.formData[d] : void 0;
1429
- return (d, o) => {
1430
- var f;
1431
- const r = Ce("WidgetHost", !0);
1432
- return a.value ? (s(), O(ie(a.value), ne({
1433
- key: 0,
1434
- node: t.node,
1435
- value: i(t.node.bindField),
1436
- "form-data": t.formData
1437
- }, t.mode === "render" ? { formMode: t.formMode, formId: t.formId } : null), X({ _: 2 }, [
1438
- F(d.$slots, (p, v) => ({
1439
- name: v,
1440
- fn: z((w) => [
1441
- W(d.$slots, v, Be(je(w || {})))
1442
- ])
1443
- })),
1444
- (f = n.value) != null && f.isContainer && !d.$slots.children ? {
1445
- name: "children",
1446
- fn: z(() => [
1447
- (s(!0), m(T, null, F(t.node.children, (p) => (s(), O(r, {
1448
- key: p.id,
1449
- node: p,
1450
- mode: t.mode,
1451
- "form-mode": t.formMode,
1452
- "form-data": t.formData,
1453
- "form-id": t.formId
1454
- }, X({ _: 2 }, [
1455
- F(d.$slots, (v, w) => ({
1456
- name: w,
1457
- fn: z((B) => [
1458
- W(d.$slots, w, ne({ ref_for: !0 }, B || {}))
1459
- ])
1460
- }))
1461
- ]), 1032, ["node", "mode", "form-mode", "form-data", "form-id"]))), 128))
1462
- ]),
1463
- key: "0"
1464
- } : void 0
1465
- ]), 1040, ["node", "value", "form-data"])) : C("", !0);
1466
- };
1467
- }
1468
- }), co = 24;
1469
- function Fe(t, l, n, a, i = !1) {
1470
- if (t.type !== "label" || !n.length) return "";
1471
- const d = i ? 1 : co, o = (S) => Math.min(Math.max(S.gridSpan || a || d, 1), d), r = [];
1472
- let f = 0, p = 0;
1473
- for (const S of n) {
1474
- const b = o(S);
1475
- f + b > d && (f = 0, p++);
1476
- const y = f === 0;
1477
- f += b;
1478
- const k = f >= d;
1479
- r.push({ row: p, rowFirst: y, rowLast: k }), f >= d && (f = 0, p++);
1480
- }
1481
- const v = r[l];
1482
- if (!v) return "";
1483
- const w = r[r.length - 1].row, B = v.row === 0, q = v.row === w, $ = [];
1484
- return v.rowFirst && B && $.push("is-g-corner-tl"), v.rowLast && B && $.push("is-g-corner-tr"), v.rowFirst && q && $.push("is-g-corner-bl"), v.rowLast && q && $.push("is-g-corner-br"), $.join(" ");
1485
- }
1486
- const uo = /* @__PURE__ */ D({
1487
- __name: "GridRender",
1488
- props: {
1489
- node: {},
1490
- formMode: {},
1491
- formData: {},
1492
- formId: {}
1493
- },
1494
- setup(t) {
1495
- const l = V(), n = R(!1);
1496
- let a = null;
1497
- ee(() => {
1498
- a = window.matchMedia("(max-width: 768px)"), n.value = a.matches, a.addEventListener("change", (d) => {
1499
- n.value = d.matches;
1500
- });
1501
- }), ke(() => {
1502
- a && a.removeEventListener("change", () => {
1503
- });
1504
- });
1505
- const i = I(() => l.device === "mobile" || n.value);
1506
- return (d, o) => (s(), m("div", {
1507
- class: j(["fd-grid-render", { "is-mobile": i.value }])
1508
- }, [
1509
- (s(!0), m(T, null, F(t.node.children, (r, f) => (s(), m("div", {
1510
- key: r.id,
1511
- class: j(["fd-grid-cell", _(Fe)(r, f, t.node.children || [], t.node.layout || 24, i.value)]),
1512
- style: U({ gridColumn: `span ${r.gridSpan || t.node.layout}` })
1513
- }, [
1514
- M(me, {
1515
- node: r,
1516
- mode: "render",
1517
- "form-mode": t.formMode,
1518
- "form-data": t.formData,
1519
- "form-id": t.formId
1520
- }, X({ _: 2 }, [
1521
- F(d.$slots, (p, v) => ({
1522
- name: v,
1523
- fn: z((w) => [
1524
- W(d.$slots, v, ne({ ref_for: !0 }, w || {}), void 0, !0)
1525
- ])
1526
- }))
1527
- ]), 1032, ["node", "form-mode", "form-data", "form-id"])
1528
- ], 6))), 128))
1529
- ], 2));
1530
- }
1531
- }), mo = /* @__PURE__ */ L(uo, [["__scopeId", "data-v-417035f9"]]), fo = { class: "fd-panel" }, po = { class: "fd-panel-item" }, bo = ["value"], vo = ["value"], go = { class: "fd-panel-item" }, yo = /* @__PURE__ */ D({
1532
- __name: "GridPanel",
1533
- props: {
1534
- node: {},
1535
- fields: {}
1536
- },
1537
- emits: ["update"],
1538
- setup(t, { emit: l }) {
1539
- const n = t, a = l, i = [
1540
- { label: "2列布局", value: 24 },
1541
- { label: "4列布局", value: 12 },
1542
- { label: "6列布局", value: 8 },
1543
- { label: "8列布局", value: 6 }
1544
- ];
1545
- function d() {
1546
- const o = n.node.layout || 24, r = (n.node.children ?? []).map((f) => ({ ...f, gridSpan: o }));
1547
- a("update", { children: r });
1548
- }
1549
- return (o, r) => (s(), m("div", fo, [
1550
- e("div", po, [
1551
- r[1] || (r[1] = e("label", null, "布局", -1)),
1552
- e("select", {
1553
- value: t.node.layout,
1554
- onChange: r[0] || (r[0] = (f) => a("update", { layout: Number(f.target.value) }))
1555
- }, [
1556
- (s(), m(T, null, F(i, (f) => e("option", {
1557
- key: f.value,
1558
- value: f.value
1559
- }, h(f.label), 9, vo)), 64))
1560
- ], 40, bo)
1561
- ]),
1562
- e("div", go, [
1563
- r[2] || (r[2] = e("label", null, "一键布局", -1)),
1564
- e("button", {
1565
- class: "fd-btn fd-btn--primary fd-btn--sm fd-grid-apply",
1566
- onClick: d
1567
- }, " 应用到全部子组件(每项占比 " + h(t.node.layout || 24) + "/24) ", 1)
1568
- ])
1569
- ]));
1570
- }
1571
- }), ho = /* @__PURE__ */ L(yo, [["__scopeId", "data-v-a333d2ea"]]), _o = {
1572
- type: "grid",
1573
- title: "栅栏格",
1574
- design: ro,
1575
- render: mo,
1576
- panel: ho,
1577
- isContainer: !0,
1578
- createDefaultProps: () => ({
1579
- id: "",
1580
- type: "grid",
1581
- label: "栅栏格",
1582
- bindField: "",
1583
- // 默认 6 列布局
1584
- layout: 8,
1585
- children: []
1586
- }),
1587
- serialize: (t) => t
1588
- }, ko = /* @__PURE__ */ D({
1589
- __name: "TextDesign",
1590
- props: {
1591
- node: {}
1592
- },
1593
- setup(t) {
1594
- return (l, n) => (s(), m("div", {
1595
- class: "fd-text-design",
1596
- style: U({ display: t.node.display })
1597
- }, h(t.node.text || "文本内容"), 5));
1598
- }
1599
- }), wo = /* @__PURE__ */ L(ko, [["__scopeId", "data-v-ba382e6c"]]), xo = /* @__PURE__ */ D({
1600
- __name: "TextRender",
1601
- props: {
1602
- node: {},
1603
- value: {}
1604
- },
1605
- setup(t) {
1606
- const l = t, n = I(() => {
1607
- if (!l.node.bindField) return l.node.text;
1608
- const a = l.value;
1609
- return a == null ? "" : String(a);
1610
- });
1611
- return (a, i) => (s(), m("div", {
1612
- class: "fd-text-render",
1613
- style: U({ display: t.node.display })
1614
- }, h(n.value), 5));
1615
- }
1616
- }), $o = /* @__PURE__ */ L(xo, [["__scopeId", "data-v-3ed7b0f0"]]), Co = { class: "fd-panel" }, To = { class: "fd-panel-item" }, So = ["value"], Io = { class: "fd-panel-item" }, Fo = ["value"], Do = ["value"], Lo = { class: "fd-panel-item" }, Mo = ["value"], Po = /* @__PURE__ */ D({
1617
- __name: "TextPanel",
1618
- props: {
1619
- node: {},
1620
- fields: {}
1621
- },
1622
- emits: ["update"],
1623
- setup(t, { emit: l }) {
1624
- const n = l;
1625
- return (a, i) => (s(), m("div", Co, [
1626
- e("div", To, [
1627
- i[3] || (i[3] = e("label", null, "文本", -1)),
1628
- e("textarea", {
1629
- rows: "4",
1630
- value: t.node.text,
1631
- onInput: i[0] || (i[0] = (d) => n("update", { text: d.target.value }))
1632
- }, null, 40, So)
1633
- ]),
1634
- e("div", Io, [
1635
- i[5] || (i[5] = e("label", null, "绑定字段", -1)),
1636
- e("select", {
1637
- value: t.node.bindField,
1638
- onChange: i[1] || (i[1] = (d) => n("update", { bindField: d.target.value }))
1639
- }, [
1640
- i[4] || (i[4] = e("option", { value: "" }, "不绑定", -1)),
1641
- (s(!0), m(T, null, F(t.fields, (d) => (s(), m("option", {
1642
- key: d.name,
1643
- value: d.name
1644
- }, h(d.label) + "(" + h(d.name) + ")", 9, Do))), 128))
1645
- ], 40, Fo)
1646
- ]),
1647
- e("div", Lo, [
1648
- i[7] || (i[7] = e("label", null, "对齐方式", -1)),
1649
- e("select", {
1650
- value: t.node.display,
1651
- onChange: i[2] || (i[2] = (d) => n("update", { display: d.target.value }))
1652
- }, [...i[6] || (i[6] = [
1653
- e("option", { value: "inline-block" }, "对齐", -1),
1654
- e("option", { value: "block" }, "换行", -1)
1655
- ])], 40, Mo)
1656
- ])
1657
- ]));
1658
- }
1659
- }), No = /* @__PURE__ */ L(Po, [["__scopeId", "data-v-3201879c"]]), Bo = {
1660
- type: "text",
1661
- title: "文本",
1662
- design: wo,
1663
- render: $o,
1664
- panel: No,
1665
- isContainer: !1,
1666
- createDefaultProps: () => ({
1667
- id: "",
1668
- type: "text",
1669
- label: "文本",
1670
- bindField: "",
1671
- text: "文本内容",
1672
- display: "inline-block"
1673
- }),
1674
- serialize: (t) => t
1675
- };
1676
- let be = !1;
1677
- function fe() {
1678
- be || (be = !0, Q(bt), Q(Gt), Q(pn), Q(io), Q(_o), Q(Bo));
1679
- }
1680
- fe();
1681
- const Z = (t) => JSON.parse(JSON.stringify(t));
1682
- function Y(t, l) {
1683
- for (const n of t) {
1684
- if (n.id === l) return n;
1685
- if (n.children) {
1686
- const a = Y(n.children, l);
1687
- if (a) return a;
1688
- }
1689
- }
1690
- return null;
1691
- }
1692
- function De(t, l) {
1693
- const n = t.findIndex((a) => a.id === l);
1694
- if (n >= 0)
1695
- return t.splice(n, 1), !0;
1696
- for (const a of t)
1697
- if (a.children && De(a.children, l)) return !0;
1698
- return !1;
1699
- }
1700
- const V = Ve("designer", {
1701
- state: () => ({
1702
- formId: "SG_ZL_YYQHTSP",
1703
- dbtable: "SG_ZL_YYQHTSP",
1704
- fields: [],
1705
- widgets: [],
1706
- selectedId: null,
1707
- past: [],
1708
- future: [],
1709
- draggingId: null,
1710
- device: "pc",
1711
- dragOverId: null,
1712
- dragBefore: !1,
1713
- dropContainerId: null,
1714
- selectedForm: !1,
1715
- events: { lifecycle: {}, custom: [] },
1716
- openedWithParam: !1
1717
- }),
1718
- getters: {
1719
- selectedNode: (t) => t.selectedId ? Y(t.widgets, t.selectedId) : null,
1720
- canUndo: (t) => t.past.length > 0,
1721
- canRedo: (t) => t.future.length > 0,
1722
- /** 供控件「事件」下拉选择使用的自定义事件列表 */
1723
- customEventOptions: (t) => t.events.custom
1724
- },
1725
- actions: {
1726
- /** 提交一次变更快照(用于撤销重做) */
1727
- commit() {
1728
- this.past.push(Z(this.widgets)), this.past.length > 50 && this.past.shift(), this.future = [];
1729
- },
1730
- undo() {
1731
- const t = this.past.pop();
1732
- t && (this.future.push(Z(this.widgets)), this.widgets = t, this.selectedId && !Y(this.widgets, this.selectedId) && (this.selectedId = null));
1733
- },
1734
- redo() {
1735
- const t = this.future.pop();
1736
- t && (this.past.push(Z(this.widgets)), this.widgets = t);
1737
- },
1738
- select(t) {
1739
- this.selectedId = t, this.selectedForm = !1;
1740
- },
1741
- /** 点击画板空白处:选中表单本身(用于配置表单级属性) */
1742
- selectForm() {
1743
- this.selectedId = null, this.selectedForm = !0;
1744
- },
1745
- /** 设置生命周期事件代码片段 */
1746
- setLifecycleHook(t, l) {
1747
- this.events.lifecycle[t] = l;
1748
- },
1749
- /** 新增一条自定义事件(默认占位) */
1750
- addCustomEvent() {
1751
- const t = this.events.custom.length + 1;
1752
- this.events.custom.push({ name: `event_${t}`, title: `自定义事件${t}`, handler: "" });
1753
- },
1754
- /** 更新某条自定义事件 */
1755
- updateCustomEvent(t, l) {
1756
- const n = this.events.custom[t];
1757
- n && Object.assign(n, l);
1758
- },
1759
- /** 删除某条自定义事件 */
1760
- removeCustomEvent(t) {
1761
- this.events.custom.splice(t, 1);
1762
- },
1763
- /** 新增控件:parentId 指定容器,index 指定插入位置(不传则末尾) */
1764
- addWidget(t, l, n) {
1765
- var d;
1766
- const a = Ge(t);
1767
- this.commit();
1768
- const i = l ? Y(this.widgets, l) : null;
1769
- i && ((d = H(i.type)) != null && d.isContainer) ? (i.children = i.children || [], i.type === "grid" && a.gridSpan == null && (a.gridSpan = i.layout || 24), n == null || n > i.children.length ? i.children.push(a) : i.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;
1770
- },
1771
- /** 判断 maybeChild 是否为 node 的后代(防止把容器拖进自己) */
1772
- isDescendant(t, l) {
1773
- if (!t.children) return !1;
1774
- for (const n of t.children)
1775
- if (n.id === l || this.isDescendant(n, l)) return !0;
1776
- return !1;
1777
- },
1778
- /** 移动已有控件到指定容器 / 根,插入位置 index */
1779
- moveNode(t, l, n) {
1780
- var v;
1781
- if (t === l) return;
1782
- const a = Y(this.widgets, t);
1783
- if (!a || l && this.isDescendant(a, l)) return;
1784
- const i = l ? Y(this.widgets, l) : null, d = (w) => {
1785
- const B = w.findIndex((q) => q.id === t);
1786
- if (B >= 0) return { list: w, index: B };
1787
- for (const q of w)
1788
- if (q.children) {
1789
- const $ = d(q.children);
1790
- if ($) return $;
1791
- }
1792
- return null;
1793
- }, o = d(this.widgets);
1794
- if (!o) return;
1795
- let r;
1796
- i && ((v = H(i.type)) != null && v.isContainer) ? (i.children = i.children || [], r = i.children) : r = this.widgets, this.commit();
1797
- let f = n;
1798
- r === o.list && o.index < n && (f = n - 1);
1799
- const [p] = o.list.splice(o.index, 1);
1800
- if (f = Math.max(0, Math.min(f, r.length)), r.splice(f, 0, p), i && i.type === "grid") {
1801
- const w = i.layout || 24;
1802
- (o.list !== r || p.gridSpan == null) && (p.gridSpan = w);
1803
- } else
1804
- delete p.gridSpan;
1805
- this.selectedId = p.id;
1806
- },
1807
- removeWidget(t) {
1808
- this.commit(), De(this.widgets, t), this.selectedId === t && (this.selectedId = null);
1809
- },
1810
- moveSibling(t, l) {
1811
- const n = (r) => {
1812
- if (r.findIndex((p) => p.id === t) >= 0) return r;
1813
- for (const p of r)
1814
- if (p.children) {
1815
- const v = n(p.children);
1816
- if (v) return v;
1817
- }
1818
- return null;
1819
- }, a = n(this.widgets);
1820
- if (!a) return;
1821
- const i = a.findIndex((r) => r.id === t), d = i + l;
1822
- if (d < 0 || d >= a.length) return;
1823
- this.commit();
1824
- const [o] = a.splice(i, 1);
1825
- a.splice(d, 0, o);
1826
- },
1827
- updateNode(t, l) {
1828
- const n = Y(this.widgets, t);
1829
- n && (Object.assign(n, l), this.commit());
1830
- },
1831
- setDragging(t) {
1832
- this.draggingId = t;
1833
- },
1834
- /** 展开/收起容器(设计器视图操作,不写入撤销历史) */
1835
- setExpanded(t, l) {
1836
- const n = Y(this.widgets, t);
1837
- n && "expanded" in n && (n.expanded = l);
1838
- },
1839
- /** 将 draggingId 控件移动到 targetId(容器)或根 */
1840
- dropTo(t) {
1841
- var i;
1842
- const l = this.draggingId;
1843
- if (!l || l === t) return;
1844
- this.commit();
1845
- const n = (d) => {
1846
- const o = d.findIndex((r) => r.id === l);
1847
- if (o >= 0) {
1848
- const [r] = d.splice(o, 1);
1849
- return r;
1850
- }
1851
- for (const r of d)
1852
- if (r.children) {
1853
- const f = n(r.children);
1854
- if (f) return f;
1855
- }
1856
- return null;
1857
- }, a = n(this.widgets);
1858
- if (!a) {
1859
- this.draggingId = null;
1860
- return;
1861
- }
1862
- if (t) {
1863
- const d = Y(this.widgets, t);
1864
- d && ((i = H(d.type)) != null && i.isContainer) ? (d.children = d.children || [], d.children.push(a)) : this.widgets.push(a);
1865
- } else
1866
- this.widgets.push(a);
1867
- this.draggingId = null, this.selectedId = a.id;
1868
- },
1869
- loadSchema(t) {
1870
- 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 = [];
1871
- },
1872
- toSchema() {
1873
- return {
1874
- formId: this.formId,
1875
- dbtable: this.dbtable,
1876
- fields: this.fields,
1877
- widgets: this.widgets,
1878
- events: Z(this.events)
1879
- };
1880
- },
1881
- setFields(t) {
1882
- this.fields = t;
1883
- }
1884
- }
1885
- }), ve = { baseModule: "", apiModule: "form-designer" };
1886
- let ae = {}, de = {}, ge = {};
1887
- function Le(t) {
1888
- de = { ...de, ...t };
1889
- }
1890
- function rd(t) {
1891
- ae.apiModule = t;
1892
- }
1893
- function cd(t) {
1894
- ae.baseModule = t;
1895
- }
1896
- function jo() {
1897
- return {
1898
- baseModule: ge.baseModule ?? ae.baseModule ?? de.baseModule ?? ve.baseModule,
1899
- apiModule: ge.apiModule ?? ae.apiModule ?? de.apiModule ?? ve.apiModule
1900
- };
1901
- }
1902
- function Eo(t, l = "") {
1903
- const { baseModule: n, apiModule: a } = jo();
1904
- return `${n ? `/${n}` : ""}/api/${a}/${t}${l ? `/${l}` : ""}`;
1905
- }
1906
- async function te(t, l) {
1907
- return Eo("getschema", t), JSON.parse(JSON.stringify(ll(t)));
1908
- }
1909
- const Me = "fd:form:";
1910
- function ye() {
1911
- return typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
1912
- const l = Math.random() * 16 | 0;
1913
- return (t === "x" ? l : l & 3 | 8).toString(16);
1914
- });
1915
- }
1916
- function he(t, l) {
1917
- localStorage.setItem(Me + t, JSON.stringify(l));
1918
- }
1919
- function Pe(t) {
1920
- const l = localStorage.getItem(Me + t);
1921
- if (!l) return null;
1922
- try {
1923
- return JSON.parse(l);
1924
- } catch {
1925
- return null;
1926
- }
1927
- }
1928
- const Oo = "fdFireEvent";
1929
- function _e(t, l = {}) {
1930
- if (!(!t || !t.trim()))
1931
- try {
1932
- return new Function("ctx", `"use strict";
1933
- ${t}`)(l);
1934
- } catch (n) {
1935
- console.error("[form-designer] 事件处理函数执行失败:", n);
1936
- return;
1937
- }
1938
- }
1939
- function qo(t) {
1940
- if (!(!t || !t.trim() || typeof document > "u"))
1941
- try {
1942
- const l = document.createElement("script");
1943
- l.text = t, document.head.appendChild(l), l.remove();
1944
- } catch (l) {
1945
- console.error("[form-designer] 自定义方法挂载失败:", l);
1946
- }
1947
- }
1948
- const Ao = { class: "fd-renderer" }, Ro = /* @__PURE__ */ D({
1949
- __name: "Renderer",
1950
- props: {
1951
- widgets: {},
1952
- formMode: {},
1953
- formData: {},
1954
- events: {},
1955
- formId: {}
1956
- },
1957
- setup(t, { expose: l }) {
1958
- const n = t, a = I(
1959
- () => n.widgets.filter((o) => {
1960
- var f;
1961
- const r = (f = H(o.type)) == null ? void 0 : f.visibleModes;
1962
- return !r || r.length === 0 ? !0 : n.formMode ? r.includes(n.formMode) : !0;
1963
- })
1964
- );
1965
- function i(o) {
1966
- var f;
1967
- const r = (f = n.events) == null ? void 0 : f.lifecycle[o];
1968
- _e(r, { formData: n.formData, event: o });
1969
- }
1970
- function d(o, r) {
1971
- var p;
1972
- const f = (p = n.events) == null ? void 0 : p.custom.find((v) => v.name === o);
1973
- f && _e(f.handler, { formData: n.formData, event: o, payload: r });
1974
- }
1975
- return Ee(Oo, d), ee(() => {
1976
- var o;
1977
- i("onLoad"), i("onMounted"), qo((o = n.events) == null ? void 0 : o.lifecycle.custom);
1978
- }), Te(
1979
- () => n.formData,
1980
- () => i("onValueChange"),
1981
- { deep: !0 }
1982
- ), l({ fireEvent: d, runLifecycle: i }), (o, r) => (s(), m("div", Ao, [
1983
- (s(!0), m(T, null, F(a.value, (f) => (s(), O(me, {
1984
- key: f.id,
1985
- node: f,
1986
- mode: "render",
1987
- "form-mode": t.formMode,
1988
- "form-data": t.formData,
1989
- "form-id": t.formId
1990
- }, X({ _: 2 }, [
1991
- F(o.$slots, (p, v) => ({
1992
- name: v,
1993
- fn: z((w) => [
1994
- W(o.$slots, v, ne({ ref_for: !0 }, w || {}), void 0, !0)
1995
- ])
1996
- }))
1997
- ]), 1032, ["node", "form-mode", "form-data", "form-id"]))), 128))
1998
- ]));
1999
- }
2000
- }), Ne = /* @__PURE__ */ L(Ro, [["__scopeId", "data-v-82088c12"]]), Uo = { class: "fd-tree" }, Vo = { class: "fd-tree-head" }, zo = {
2001
- key: 0,
2002
- class: "fd-tree-count"
2003
- }, Yo = {
2004
- key: 0,
2005
- class: "fd-tree-empty"
2006
- }, Ho = { class: "fd-tree-name" }, Wo = ["title"], Go = /* @__PURE__ */ D({
2007
- __name: "ComponentTree",
2008
- setup(t) {
2009
- const l = V();
2010
- function n(o) {
2011
- var v;
2012
- const r = H(o.type), f = o.label, p = (r == null ? void 0 : r.title) ?? o.type;
2013
- return {
2014
- id: o.id,
2015
- label: f ? `${p} · ${f}` : p,
2016
- name: p,
2017
- sub: f ?? "",
2018
- children: (v = o.children) == null ? void 0 : v.map(n)
2019
- };
2020
- }
2021
- const a = I(() => l.widgets.map(n)), i = I(() => {
2022
- const o = (r) => r.reduce((f, p) => f + 1 + o(p.children ?? []), 0);
2023
- return o(l.widgets);
2024
- });
2025
- function d(o) {
2026
- l.select(o.id), $e(() => {
2027
- var r;
2028
- (r = document.querySelector(".fd-canvas-node.is-selected")) == null || r.scrollIntoView({ block: "nearest" });
2029
- });
2030
- }
2031
- return (o, r) => (s(), m("div", Uo, [
2032
- e("div", Vo, [
2033
- r[0] || (r[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)),
2034
- i.value ? (s(), m("span", zo, h(i.value), 1)) : C("", !0)
2035
- ]),
2036
- i.value ? (s(), O(_(ze), {
2037
- key: 1,
2038
- class: "fd-tree-el",
2039
- data: a.value,
2040
- "node-key": "id",
2041
- "current-node-key": _(l).selectedId || "",
2042
- "highlight-current": "",
2043
- "default-expand-all": "",
2044
- "show-line": "",
2045
- "expand-on-click-node": !1,
2046
- onNodeClick: d
2047
- }, {
2048
- default: z(({ data: f }) => [
2049
- e("span", Ho, h(f.name), 1),
2050
- f.sub ? (s(), m("span", {
2051
- key: 0,
2052
- class: "fd-tree-sub",
2053
- title: f.sub
2054
- }, h(f.sub), 9, Wo)) : C("", !0)
2055
- ]),
2056
- _: 1
2057
- }, 8, ["data", "current-node-key"])) : (s(), m("div", Yo, [...r[1] || (r[1] = [
2058
- e("svg", {
2059
- viewBox: "0 0 24 24",
2060
- fill: "none",
2061
- stroke: "currentColor",
2062
- "stroke-width": "1.5",
2063
- "stroke-linecap": "round",
2064
- "stroke-linejoin": "round"
2065
- }, [
2066
- e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2067
- e("polyline", { points: "17 8 12 3 7 8" }),
2068
- e("line", {
2069
- x1: "12",
2070
- y1: "3",
2071
- x2: "12",
2072
- y2: "15"
2073
- })
2074
- ], -1),
2075
- e("span", null, "暂无组件,从左侧拖拽控件到画布", -1)
2076
- ])]))
2077
- ]));
2078
- }
2079
- }), Jo = /* @__PURE__ */ L(Go, [["__scopeId", "data-v-e38c14ec"]]), Qo = { class: "fd-toolbar" }, Zo = { class: "fd-toolbar-left flex-align-center" }, Ko = ["value"], Xo = { class: "fd-device" }, ea = {
2080
- key: 0,
2081
- class: "is-active",
2082
- title: "移动端比例(由 URL 参数 templateType 决定)"
2083
- }, ta = {
2084
- key: 1,
2085
- class: "is-active",
2086
- title: "电脑端比例(由 URL 参数 templateType 决定)"
2087
- }, na = { class: "fd-toolbar-right flex-align-center" }, la = ["disabled"], oa = ["disabled"], aa = { class: "fd-dialog fd-dialog--preview" }, da = { class: "fd-dialog-head" }, ia = { class: "fd-preview-width" }, sa = { class: "fd-dialog-body" }, ra = { class: "fd-dialog" }, ca = { class: "fd-dialog-head" }, ua = { class: "fd-dialog-code" }, ma = { class: "fd-dialog" }, fa = { class: "fd-dialog-head" }, pa = { class: "fd-dialog-body" }, ba = /* @__PURE__ */ D({
2088
- __name: "Toolbar",
2089
- setup(t) {
2090
- const l = V(), n = R(!1), a = R(!1), i = R(!1), d = R(!1);
2091
- function o() {
2092
- const x = new URLSearchParams(window.location.search).get("templateType") || "";
2093
- return x === "mobile" || x === "2";
2094
- }
2095
- const r = R(o() ? 375 : 1200);
2096
- function f() {
2097
- const x = Number(r.value);
2098
- r.value = Math.min(1200, Math.max(270, Number.isFinite(x) ? x : 1200));
2099
- }
2100
- Te(
2101
- () => l.device,
2102
- (x) => {
2103
- r.value = x === "mobile" ? 375 : 1200;
2104
- }
2105
- );
2106
- const p = R("");
2107
- function v() {
2108
- const x = p.value.trim();
2109
- if (!x) {
2110
- window.alert("请先粘贴表单 JSON");
2111
- return;
2112
- }
2113
- try {
2114
- l.loadSchema(JSON.parse(x));
2115
- } catch {
2116
- window.alert("JSON 解析失败");
2117
- return;
2118
- }
2119
- p.value = "", d.value = !1;
2120
- }
2121
- const w = I(() => JSON.stringify(l.toSchema(), null, 2)), B = I(() => {
2122
- const x = {};
2123
- l.fields.forEach((u) => {
2124
- x[u.name] = u.name;
2125
- });
2126
- const c = (u, g) => (u.forEach((P) => {
2127
- var J;
2128
- P.type === "subtable" && g.push(P), (J = P.children) != null && J.length && c(P.children, g);
2129
- }), g);
2130
- return c(l.widgets, []).forEach((u) => {
2131
- if (u.type !== "subtable" || !u.secondtable) return;
2132
- const g = {};
2133
- (u.colnums ?? []).forEach((P) => {
2134
- g[P.name] = P.name, P.bindLink && (g[P.bindLink] = P.bindLink);
2135
- }), x[u.secondtable] = [g];
2136
- }), x;
2137
- });
2138
- async function q() {
2139
- let x = l.formId;
2140
- !l.openedWithParam && !x && (x = ye()), l.formId = x, he(x, l.toSchema()), l.openedWithParam = !0, window.alert(`已保存(本地)
2141
- formId: ${x}`);
2142
- }
2143
- function $() {
2144
- const x = ye();
2145
- l.formId = x, l.openedWithParam = !0, he(x, l.toSchema()), window.alert(`已另存为新表单(本地)
2146
- formId: ${x}`);
2147
- }
2148
- async function S() {
2149
- const x = Pe(l.formId);
2150
- if (x)
2151
- l.loadSchema(x);
2152
- else {
2153
- const c = await te(l.formId);
2154
- l.loadSchema(c);
2155
- }
2156
- }
2157
- function b() {
2158
- window.alert("发布成功(mock)");
2159
- }
2160
- const y = R(null), k = R(null);
2161
- function N(x) {
2162
- var u, g;
2163
- if (!i.value) return;
2164
- const c = x.target;
2165
- (u = y.value) != null && u.contains(c) || (g = k.value) != null && g.contains(c) || (i.value = !1);
2166
- }
2167
- return ee(() => document.addEventListener("click", N)), Oe(() => document.removeEventListener("click", N)), (x, c) => (s(), m("div", Qo, [
2168
- e("div", Zo, [
2169
- c[17] || (c[17] = e("span", { class: "fd-toolbar-title" }, "表单设计器", -1)),
2170
- e("input", {
2171
- class: "fd-toolbar-name",
2172
- value: _(l).formId,
2173
- onInput: c[0] || (c[0] = (u) => _(l).formId = u.target.value)
2174
- }, null, 40, Ko),
2175
- e("div", Xo, [
2176
- _(l).device === "mobile" ? (s(), m("button", ea, [...c[15] || (c[15] = [
2177
- e("svg", {
2178
- class: "fd-tool-btn-icon",
2179
- viewBox: "0 0 24 24",
2180
- fill: "none",
2181
- stroke: "currentColor",
2182
- "stroke-width": "1.8",
2183
- "stroke-linecap": "round",
2184
- "stroke-linejoin": "round"
2185
- }, [
2186
- e("rect", {
2187
- x: "5",
2188
- y: "2",
2189
- width: "14",
2190
- height: "20",
2191
- rx: "2"
2192
- }),
2193
- e("line", {
2194
- x1: "12",
2195
- y1: "18",
2196
- x2: "12.01",
2197
- y2: "18"
2198
- })
2199
- ], -1),
2200
- E(" 移动端 ", -1)
2201
- ])])) : (s(), m("button", ta, [...c[16] || (c[16] = [
2202
- e("svg", {
2203
- class: "fd-tool-btn-icon",
2204
- viewBox: "0 0 24 24",
2205
- fill: "none",
2206
- stroke: "currentColor",
2207
- "stroke-width": "1.8",
2208
- "stroke-linecap": "round",
2209
- "stroke-linejoin": "round"
2210
- }, [
2211
- e("rect", {
2212
- x: "2",
2213
- y: "3",
2214
- width: "20",
2215
- height: "14",
2216
- rx: "2"
2217
- }),
2218
- e("line", {
2219
- x1: "8",
2220
- y1: "21",
2221
- x2: "16",
2222
- y2: "21"
2223
- }),
2224
- e("line", {
2225
- x1: "12",
2226
- y1: "17",
2227
- x2: "12",
2228
- y2: "21"
2229
- })
2230
- ], -1),
2231
- E(" 电脑端 ", -1)
2232
- ])]))
2233
- ])
2234
- ]),
2235
- e("div", na, [
2236
- e("button", {
2237
- class: "fd-tool-btn",
2238
- onClick: c[1] || (c[1] = (u) => n.value = !0)
2239
- }, [...c[18] || (c[18] = [
2240
- e("svg", {
2241
- class: "fd-tool-btn-icon",
2242
- viewBox: "0 0 24 24",
2243
- fill: "none",
2244
- stroke: "currentColor",
2245
- "stroke-width": "1.8",
2246
- "stroke-linecap": "round",
2247
- "stroke-linejoin": "round"
2248
- }, [
2249
- e("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
2250
- e("circle", {
2251
- cx: "12",
2252
- cy: "12",
2253
- r: "3"
2254
- })
2255
- ], -1),
2256
- E(" 预览 ", -1)
2257
- ])]),
2258
- e("button", {
2259
- class: "fd-tool-btn",
2260
- onClick: c[2] || (c[2] = (u) => a.value = !0)
2261
- }, [...c[19] || (c[19] = [
2262
- e("svg", {
2263
- class: "fd-tool-btn-icon",
2264
- viewBox: "0 0 24 24",
2265
- fill: "none",
2266
- stroke: "currentColor",
2267
- "stroke-width": "1.8",
2268
- "stroke-linecap": "round",
2269
- "stroke-linejoin": "round"
2270
- }, [
2271
- e("polyline", { points: "16 18 22 12 16 6" }),
2272
- e("polyline", { points: "8 6 2 12 8 18" })
2273
- ], -1),
2274
- E(" 查看代码 ", -1)
2275
- ])]),
2276
- e("button", {
2277
- class: "fd-tool-btn",
2278
- onClick: c[3] || (c[3] = (u) => d.value = !0)
2279
- }, [...c[20] || (c[20] = [
2280
- e("svg", {
2281
- class: "fd-tool-btn-icon",
2282
- viewBox: "0 0 24 24",
2283
- fill: "none",
2284
- stroke: "currentColor",
2285
- "stroke-width": "1.8",
2286
- "stroke-linecap": "round",
2287
- "stroke-linejoin": "round"
2288
- }, [
2289
- e("path", { d: "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" }),
2290
- e("polyline", { points: "17 8 12 3 7 8" }),
2291
- e("line", {
2292
- x1: "12",
2293
- y1: "3",
2294
- x2: "12",
2295
- y2: "15"
2296
- })
2297
- ], -1),
2298
- E(" 导入 ", -1)
2299
- ])]),
2300
- e("button", {
2301
- class: "fd-tool-btn",
2302
- onClick: S
2303
- }, [...c[21] || (c[21] = [
2304
- e("svg", {
2305
- class: "fd-tool-btn-icon",
2306
- viewBox: "0 0 24 24",
2307
- fill: "none",
2308
- stroke: "currentColor",
2309
- "stroke-width": "1.8",
2310
- "stroke-linecap": "round",
2311
- "stroke-linejoin": "round"
2312
- }, [
2313
- e("polyline", { points: "23 4 23 10 17 10" }),
2314
- e("path", { d: "M20.49 15a9 9 0 1 1-2.12-9.36L23 10" })
2315
- ], -1),
2316
- E(" 加载 ", -1)
2317
- ])]),
2318
- e("button", {
2319
- class: "fd-tool-btn",
2320
- onClick: q
2321
- }, [...c[22] || (c[22] = [
2322
- e("svg", {
2323
- class: "fd-tool-btn-icon",
2324
- viewBox: "0 0 24 24",
2325
- fill: "none",
2326
- stroke: "currentColor",
2327
- "stroke-width": "1.8",
2328
- "stroke-linecap": "round",
2329
- "stroke-linejoin": "round"
2330
- }, [
2331
- e("path", { d: "M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z" }),
2332
- e("polyline", { points: "17 21 17 13 7 13 7 21" }),
2333
- e("polyline", { points: "7 3 7 8 15 8" })
2334
- ], -1),
2335
- E(" 保存 ", -1)
2336
- ])]),
2337
- e("button", {
2338
- class: "fd-tool-btn",
2339
- onClick: $
2340
- }, [...c[23] || (c[23] = [
2341
- e("svg", {
2342
- class: "fd-tool-btn-icon",
2343
- viewBox: "0 0 24 24",
2344
- fill: "none",
2345
- stroke: "currentColor",
2346
- "stroke-width": "1.8",
2347
- "stroke-linecap": "round",
2348
- "stroke-linejoin": "round"
2349
- }, [
2350
- e("rect", {
2351
- x: "9",
2352
- y: "9",
2353
- width: "13",
2354
- height: "13",
2355
- rx: "2"
2356
- }),
2357
- e("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
2358
- ], -1),
2359
- E(" 另存为 ", -1)
2360
- ])]),
2361
- e("button", {
2362
- class: "fd-tool-btn fd-tool-btn--primary",
2363
- onClick: b
2364
- }, [...c[24] || (c[24] = [
2365
- e("svg", {
2366
- class: "fd-tool-btn-icon",
2367
- viewBox: "0 0 24 24",
2368
- fill: "none",
2369
- stroke: "currentColor",
2370
- "stroke-width": "1.8",
2371
- "stroke-linecap": "round",
2372
- "stroke-linejoin": "round"
2373
- }, [
2374
- e("line", {
2375
- x1: "22",
2376
- y1: "2",
2377
- x2: "11",
2378
- y2: "13"
2379
- }),
2380
- e("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
2381
- ], -1),
2382
- E(" 发布 ", -1)
2383
- ])]),
2384
- c[28] || (c[28] = e("span", { class: "fd-toolbar-divider" }, null, -1)),
2385
- e("button", {
2386
- class: "fd-tool-btn fd-tool-icon-btn",
2387
- disabled: !_(l).canUndo,
2388
- title: "撤销",
2389
- onClick: c[4] || (c[4] = (u) => _(l).undo())
2390
- }, [...c[25] || (c[25] = [
2391
- e("svg", {
2392
- class: "fd-tool-icon",
2393
- viewBox: "0 0 24 24",
2394
- fill: "none",
2395
- stroke: "currentColor",
2396
- "stroke-width": "1.8",
2397
- "stroke-linecap": "round",
2398
- "stroke-linejoin": "round"
2399
- }, [
2400
- e("polyline", { points: "9 14 4 9 9 4" }),
2401
- e("path", { d: "M20 20v-7a4 4 0 0 0-4-4H4" })
2402
- ], -1)
2403
- ])], 8, la),
2404
- e("button", {
2405
- class: "fd-tool-btn fd-tool-icon-btn",
2406
- disabled: !_(l).canRedo,
2407
- title: "重做",
2408
- onClick: c[5] || (c[5] = (u) => _(l).redo())
2409
- }, [...c[26] || (c[26] = [
2410
- e("svg", {
2411
- class: "fd-tool-icon",
2412
- viewBox: "0 0 24 24",
2413
- fill: "none",
2414
- stroke: "currentColor",
2415
- "stroke-width": "1.8",
2416
- "stroke-linecap": "round",
2417
- "stroke-linejoin": "round"
2418
- }, [
2419
- e("polyline", { points: "15 14 20 9 15 4" }),
2420
- e("path", { d: "M4 20v-7a4 4 0 0 1 4-4h12" })
2421
- ], -1)
2422
- ])], 8, oa),
2423
- e("button", {
2424
- ref_key: "treeBtnRef",
2425
- ref: k,
2426
- class: "fd-tool-btn",
2427
- onClick: c[6] || (c[6] = (u) => i.value = !i.value)
2428
- }, [...c[27] || (c[27] = [
2429
- 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-2d05aedb><line x1="8" y1="6" x2="21" y2="6" data-v-2d05aedb></line><line x1="8" y1="12" x2="21" y2="12" data-v-2d05aedb></line><line x1="8" y1="18" x2="21" y2="18" data-v-2d05aedb></line><line x1="3" y1="6" x2="3.01" y2="6" data-v-2d05aedb></line><line x1="3" y1="12" x2="3.01" y2="12" data-v-2d05aedb></line><line x1="3" y1="18" x2="3.01" y2="18" data-v-2d05aedb></line></svg> 组件树 ', 2)
2430
- ])], 512)
2431
- ]),
2432
- (s(), O(re, { to: "body" }, [
2433
- n.value ? (s(), m("div", {
2434
- key: 0,
2435
- class: "fd-dialog-mask",
2436
- onClick: c[9] || (c[9] = A((u) => n.value = !1, ["self"]))
2437
- }, [
2438
- e("div", aa, [
2439
- e("div", da, [
2440
- c[31] || (c[31] = e("span", null, "预览", -1)),
2441
- e("div", ia, [
2442
- c[29] || (c[29] = e("label", { for: "fd-preview-width-input" }, "宽度", -1)),
2443
- M(_(Ye), {
2444
- id: "fd-preview-width-input",
2445
- modelValue: r.value,
2446
- "onUpdate:modelValue": c[7] || (c[7] = (u) => r.value = u),
2447
- min: 270,
2448
- max: 1200,
2449
- step: 10,
2450
- size: "small",
2451
- "controls-position": "right",
2452
- onChange: f
2453
- }, null, 8, ["modelValue"]),
2454
- c[30] || (c[30] = e("span", { class: "fd-preview-width-unit" }, "px", -1))
2455
- ]),
2456
- e("button", {
2457
- class: "fd-tool-btn",
2458
- onClick: c[8] || (c[8] = (u) => n.value = !1)
2459
- }, "关闭")
2460
- ]),
2461
- e("div", sa, [
2462
- e("div", {
2463
- class: "fd-preview-stage",
2464
- style: U({ width: r.value + "px" })
2465
- }, [
2466
- M(Ne, {
2467
- widgets: _(l).widgets,
2468
- "form-data": B.value
2469
- }, null, 8, ["widgets", "form-data"])
2470
- ], 4)
2471
- ])
2472
- ])
2473
- ])) : C("", !0),
2474
- a.value ? (s(), m("div", {
2475
- key: 1,
2476
- class: "fd-dialog-mask",
2477
- onClick: c[11] || (c[11] = A((u) => a.value = !1, ["self"]))
2478
- }, [
2479
- e("div", ra, [
2480
- e("div", ca, [
2481
- c[32] || (c[32] = e("span", null, "JSON Schema", -1)),
2482
- e("button", {
2483
- class: "fd-tool-btn",
2484
- onClick: c[10] || (c[10] = (u) => a.value = !1)
2485
- }, "关闭")
2486
- ]),
2487
- e("pre", ua, h(w.value), 1)
2488
- ])
2489
- ])) : C("", !0),
2490
- d.value ? (s(), m("div", {
2491
- key: 2,
2492
- class: "fd-dialog-mask",
2493
- onClick: c[14] || (c[14] = A((u) => d.value = !1, ["self"]))
2494
- }, [
2495
- e("div", ma, [
2496
- e("div", fa, [
2497
- c[33] || (c[33] = e("span", null, "导入(粘贴 JSON)", -1)),
2498
- e("button", {
2499
- class: "fd-tool-btn",
2500
- onClick: c[12] || (c[12] = (u) => d.value = !1)
2501
- }, "取消"),
2502
- e("button", {
2503
- class: "fd-tool-btn fd-tool-btn--primary",
2504
- onClick: v
2505
- }, "确认")
2506
- ]),
2507
- e("div", pa, [
2508
- se(e("textarea", {
2509
- "onUpdate:modelValue": c[13] || (c[13] = (u) => p.value = u),
2510
- class: "fd-dialog-import-text",
2511
- placeholder: "请粘贴表单 JSON(可从「查看代码」复制),确认后将覆盖当前表单"
2512
- }, null, 512), [
2513
- [qe, p.value]
2514
- ])
2515
- ])
2516
- ])
2517
- ])) : C("", !0),
2518
- i.value ? (s(), m("div", {
2519
- key: 3,
2520
- ref_key: "treeDrawerRef",
2521
- ref: y,
2522
- class: "fd-tree-drawer"
2523
- }, [
2524
- M(Jo)
2525
- ], 512)) : C("", !0)
2526
- ]))
2527
- ]));
2528
- }
2529
- }), va = /* @__PURE__ */ L(ba, [["__scopeId", "data-v-2d05aedb"]]), ga = { class: "fd-palette" }, ya = { class: "fd-palette-group-title" }, ha = ["onDragstart", "onClick"], _a = { class: "fd-palette-icon" }, ka = /* @__PURE__ */ D({
2530
- __name: "WidgetPalette",
2531
- setup(t) {
2532
- const l = V(), n = We(), a = [
2533
- {
2534
- title: "基础控件",
2535
- types: ["label", "text"]
2536
- },
2537
- {
2538
- title: "高级控件",
2539
- types: ["subtable"]
2540
- },
2541
- {
2542
- title: "布局控件",
2543
- types: ["grid", "card", "slot"]
2544
- }
2545
- ], i = {
2546
- grid: "▦",
2547
- card: "▤",
2548
- slot: "⧉",
2549
- label: "T",
2550
- text: "¶",
2551
- subtable: "☰"
2552
- };
2553
- function d(f) {
2554
- return n.find((p) => p.type === f);
2555
- }
2556
- function o(f, p) {
2557
- var v;
2558
- (v = f.dataTransfer) == null || v.setData("application/x-fd-new", p), f.dataTransfer && (f.dataTransfer.effectAllowed = "copy");
2559
- }
2560
- function r(f) {
2561
- l.addWidget(f);
2562
- }
2563
- return (f, p) => (s(), m("div", ga, [
2564
- p[0] || (p[0] = e("div", { class: "fd-palette-title" }, "控件库", -1)),
2565
- (s(), m(T, null, F(a, (v) => e("div", {
2566
- key: v.title,
2567
- class: "fd-palette-group"
2568
- }, [
2569
- e("div", ya, h(v.title), 1),
2570
- (s(!0), m(T, null, F(v.types, (w) => (s(), m(T, { key: w }, [
2571
- d(w) ? (s(), m("div", {
2572
- key: 0,
2573
- class: "fd-palette-item",
2574
- draggable: "true",
2575
- onDragstart: (B) => o(B, w),
2576
- onClick: (B) => r(w)
2577
- }, [
2578
- e("span", _a, h(i[w]), 1),
2579
- e("span", null, h(d(w).title), 1)
2580
- ], 40, ha)) : C("", !0)
2581
- ], 64))), 128))
2582
- ])), 64))
2583
- ]));
2584
- }
2585
- }), wa = /* @__PURE__ */ L(ka, [["__scopeId", "data-v-6a2bab90"]]), xa = [
2586
- { key: "onLoad", label: "加载完成", desc: "表单数据就绪后触发" },
2587
- { key: "onMounted", label: "渲染挂载", desc: "渲染完成并挂载到 DOM 后触发" },
2588
- { key: "onValueChange", label: "值变化", desc: "任意字段值变化时触发" },
2589
- { key: "custom", label: "自定义方法", desc: "写入的方法将挂载至全局 window,可在其他事件处理中调用" }
2590
- ], $a = { class: "fd-form-events" }, Ca = { class: "fd-form-meta" }, Ta = { class: "fd-events-section" }, Sa = { class: "fd-event-head" }, Ia = ["title"], Fa = { class: "fd-event-key" }, Da = ["onClick", "title"], La = {
2591
- key: 0,
2592
- class: "fd-event-trigger-text"
2593
- }, Ma = {
2594
- key: 1,
2595
- class: "fd-event-trigger-placeholder"
2596
- }, Pa = {
2597
- class: "fd-dialog",
2598
- style: { "max-width": "600px" }
2599
- }, Na = { class: "fd-dialog-head" }, Ba = { class: "fd-dialog-body" }, ja = /* @__PURE__ */ D({
2600
- __name: "FormEventsPanel",
2601
- setup(t) {
2602
- const l = Ae(() => import("./CodeEditor-d-AMHZfA.js")), n = V(), a = xe({
2603
- open: !1,
2604
- type: "",
2605
- hookKey: "",
2606
- index: -1,
2607
- title: "",
2608
- draft: ""
2609
- });
2610
- function i(r) {
2611
- a.open = !0, a.type = "lifecycle", a.hookKey = r.key, a.title = `${r.label}(${r.key})`, a.draft = n.events.lifecycle[r.key] ?? "";
2612
- }
2613
- function d() {
2614
- 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;
2615
- }
2616
- function o() {
2617
- a.open = !1;
2618
- }
2619
- return (r, f) => (s(), m("div", $a, [
2620
- f[4] || (f[4] = e("div", { class: "fd-property-title" }, "表单属性", -1)),
2621
- e("div", Ca, [
2622
- e("span", null, "表单:" + h(_(n).formId), 1),
2623
- e("span", null, "主表:" + h(_(n).dbtable), 1)
2624
- ]),
2625
- e("section", Ta, [
2626
- f[2] || (f[2] = e("h4", { class: "fd-events-h" }, "全局事件 · 生命周期", -1)),
2627
- f[3] || (f[3] = e("p", { class: "fd-events-tip" }, "渲染时绑定至对应钩子函数中执行", -1)),
2628
- (s(!0), m(T, null, F(_(xa), (p) => (s(), m("div", {
2629
- key: p.key,
2630
- class: "fd-event-row"
2631
- }, [
2632
- e("div", Sa, [
2633
- e("label", {
2634
- title: p.desc
2635
- }, h(p.label), 9, Ia),
2636
- e("code", Fa, h(p.key), 1)
2637
- ]),
2638
- e("div", {
2639
- class: "fd-event-trigger",
2640
- onClick: (v) => i(p),
2641
- title: _(n).events.lifecycle[p.key] || "点击编写处理函数"
2642
- }, [
2643
- _(n).events.lifecycle[p.key] ? (s(), m("span", La, h(_(n).events.lifecycle[p.key]), 1)) : (s(), m("span", Ma, "点击编写")),
2644
- f[1] || (f[1] = e("span", { class: "fd-event-trigger-arrow" }, "›", -1))
2645
- ], 8, Da)
2646
- ]))), 128))
2647
- ]),
2648
- (s(), O(re, { to: "body" }, [
2649
- a.open ? (s(), m("div", {
2650
- key: 0,
2651
- class: "fd-dialog-mask",
2652
- onClick: A(o, ["self"])
2653
- }, [
2654
- e("div", Pa, [
2655
- e("div", Na, [
2656
- e("span", null, "编写处理函数 - " + h(a.title), 1),
2657
- e("button", {
2658
- class: "fd-dialog-close",
2659
- onClick: o,
2660
- title: "关闭"
2661
- }, "×")
2662
- ]),
2663
- e("div", Ba, [
2664
- M(_(l), {
2665
- modelValue: a.draft,
2666
- "onUpdate:modelValue": f[0] || (f[0] = (p) => a.draft = p),
2667
- language: "javascript"
2668
- }, null, 8, ["modelValue"])
2669
- ]),
2670
- e("div", { class: "fd-dialog-foot" }, [
2671
- e("button", {
2672
- class: "fd-btn fd-btn--primary",
2673
- onClick: d
2674
- }, "确定")
2675
- ])
2676
- ])
2677
- ])) : C("", !0)
2678
- ]))
2679
- ]));
2680
- }
2681
- }), Ea = /* @__PURE__ */ L(ja, [["__scopeId", "data-v-7e5a3f15"]]), Oa = { class: "fd-property" }, qa = {
2682
- key: 1,
2683
- class: "fd-property-empty"
2684
- }, Aa = {
2685
- key: 1,
2686
- class: "fd-property-item"
2687
- }, Ra = ["value"], Ua = { class: "fd-property-foot" }, Va = { class: "fd-property-type" }, za = /* @__PURE__ */ D({
2688
- __name: "PropertyPanel",
2689
- setup(t) {
2690
- const l = V(), n = I(() => l.selectedNode), a = I(() => n.value ? H(n.value.type) : void 0), i = I(() => {
2691
- var f;
2692
- return (f = a.value) == null ? void 0 : f.panel;
2693
- });
2694
- function d(f) {
2695
- n.value && l.updateNode(n.value.id, f);
2696
- }
2697
- const o = I(() => n.value != null && n.value.gridSpan != null);
2698
- function r(f) {
2699
- if (!n.value) return;
2700
- const p = Number(f.target.value), v = Math.min(24, Math.max(1, Number.isFinite(p) ? Math.round(p) : 24));
2701
- l.updateNode(n.value.id, { gridSpan: v });
2702
- }
2703
- return (f, p) => {
2704
- var v;
2705
- return s(), m("div", Oa, [
2706
- p[2] || (p[2] = e("div", { class: "fd-property-title" }, "属性", -1)),
2707
- _(l).selectedForm ? (s(), O(Ea, { key: 0 })) : n.value ? (s(), m(T, { key: 2 }, [
2708
- i.value ? (s(), O(ie(i.value), {
2709
- key: 0,
2710
- node: n.value,
2711
- fields: _(l).fields,
2712
- onUpdate: d
2713
- }, null, 40, ["node", "fields"])) : C("", !0),
2714
- o.value ? (s(), m("div", Aa, [
2715
- p[1] || (p[1] = e("label", null, "占比", -1)),
2716
- e("input", {
2717
- type: "number",
2718
- min: "1",
2719
- max: "24",
2720
- value: n.value.gridSpan,
2721
- onChange: r
2722
- }, null, 40, Ra)
2723
- ])) : C("", !0),
2724
- e("div", Ua, [
2725
- e("span", Va, "类型:" + h((v = a.value) == null ? void 0 : v.title), 1)
2726
- ])
2727
- ], 64)) : (s(), m("div", qa, [...p[0] || (p[0] = [
2728
- e("span", { class: "fd-property-empty-icon" }, "⚙", -1),
2729
- e("span", null, [
2730
- E("请选择左侧控件"),
2731
- e("br"),
2732
- E("或点击画板空白处设置表单属性")
2733
- ], -1)
2734
- ])]))
2735
- ]);
2736
- };
2737
- }
2738
- }), Ya = /* @__PURE__ */ L(za, [["__scopeId", "data-v-e89617c7"]]), Ha = {
2739
- key: 0,
2740
- class: "fd-canvas-dropzone"
2741
- }, Wa = /* @__PURE__ */ D({
2742
- __name: "CanvasNode",
2743
- props: {
2744
- node: {},
2745
- parentId: {},
2746
- index: {}
2747
- },
2748
- setup(t) {
2749
- const l = t, n = V(), a = R(null), i = I(() => {
2750
- const b = {};
2751
- 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;
2752
- }), d = () => {
2753
- var b;
2754
- return (b = H(l.node.type)) == null ? void 0 : b.isContainer;
2755
- };
2756
- function o(b, y) {
2757
- if (l.node.type !== "grid") return "";
2758
- const k = l.node.layout || 24;
2759
- return Fe(b, y, l.node.children || [], k, n.device === "mobile");
2760
- }
2761
- function r(b) {
2762
- const y = b.dataTransfer;
2763
- return !!y && (y.types.includes("application/x-fd-new") || y.types.includes("application/x-fd-move"));
2764
- }
2765
- function f() {
2766
- n.select(l.node.id);
2767
- }
2768
- function p(b) {
2769
- var y;
2770
- 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");
2771
- }
2772
- function v() {
2773
- n.dragOverId = null, n.dropContainerId = null, n.dragBefore = !1, n.setDragging(null);
2774
- }
2775
- function w(b) {
2776
- b.stopPropagation(), v();
2777
- }
2778
- function B() {
2779
- n.dragOverId === l.node.id && (n.dragOverId = null), n.dropContainerId === l.node.id && (n.dropContainerId = null);
2780
- }
2781
- function q(b) {
2782
- if (r(b))
2783
- if (b.preventDefault(), b.stopPropagation(), d())
2784
- n.dragOverId = null, n.dragBefore = !1, n.dropContainerId = l.node.id;
2785
- else {
2786
- n.dropContainerId = null, n.dragOverId = l.node.id;
2787
- const y = a.value;
2788
- if (y) {
2789
- const k = y.getBoundingClientRect();
2790
- n.dragBefore = b.clientY - k.top < k.height / 2;
2791
- }
2792
- }
2793
- }
2794
- function $() {
2795
- B();
2796
- }
2797
- function S(b) {
2798
- var N, x, c;
2799
- if (!r(b)) return;
2800
- b.preventDefault(), b.stopPropagation();
2801
- const y = (N = b.dataTransfer) == null ? void 0 : N.getData("application/x-fd-new"), k = (x = b.dataTransfer) == null ? void 0 : x.getData("application/x-fd-move");
2802
- if (d())
2803
- y ? n.addWidget(y, l.node.id) : k && n.moveNode(k, l.node.id, ((c = l.node.children) == null ? void 0 : c.length) ?? 0);
2804
- else {
2805
- const u = n.dragBefore ? l.index : l.index + 1;
2806
- y ? n.addWidget(y, l.parentId, u) : k && n.moveNode(k, l.parentId, u);
2807
- }
2808
- n.dragOverId = null, n.dragBefore = !1, n.dropContainerId = null;
2809
- }
2810
- return (b, y) => {
2811
- const k = Ce("CanvasNode", !0);
2812
- return s(), m("div", {
2813
- ref_key: "rootEl",
2814
- ref: a,
2815
- class: j(["fd-canvas-node", [
2816
- `fd-canvas-node--${t.node.type}`,
2817
- {
2818
- "is-selected": _(n).selectedId === t.node.id,
2819
- "drop-before": _(n).dragOverId === t.node.id && _(n).dragBefore,
2820
- "drop-target": _(n).dropContainerId === t.node.id,
2821
- "dragging-source": _(n).draggingId === t.node.id
2822
- }
2823
- ]]),
2824
- style: U(i.value),
2825
- draggable: "true",
2826
- onMousedown: A(f, ["stop"]),
2827
- onClick: y[4] || (y[4] = A(() => {
2828
- }, ["stop"])),
2829
- onDragstart: p,
2830
- onDragend: w,
2831
- onDragover: q,
2832
- onDragleave: $,
2833
- onDrop: S
2834
- }, [
2835
- e("div", {
2836
- class: "fd-canvas-node-actions",
2837
- onMousedown: y[3] || (y[3] = A(() => {
2838
- }, ["stop"]))
2839
- }, [
2840
- e("span", {
2841
- class: "fd-node-action",
2842
- title: "上移",
2843
- onClick: y[0] || (y[0] = A((N) => _(n).moveSibling(t.node.id, -1), ["stop"]))
2844
- }, [...y[5] || (y[5] = [
2845
- e("svg", {
2846
- class: "fd-node-icon",
2847
- viewBox: "0 0 24 24",
2848
- fill: "none",
2849
- stroke: "currentColor",
2850
- "stroke-width": "1.8",
2851
- "stroke-linecap": "round",
2852
- "stroke-linejoin": "round"
2853
- }, [
2854
- e("line", {
2855
- x1: "12",
2856
- y1: "20",
2857
- x2: "12",
2858
- y2: "5"
2859
- }),
2860
- e("polyline", { points: "6 11 12 5 18 11" })
2861
- ], -1)
2862
- ])]),
2863
- e("span", {
2864
- class: "fd-node-action",
2865
- title: "下移",
2866
- onClick: y[1] || (y[1] = A((N) => _(n).moveSibling(t.node.id, 1), ["stop"]))
2867
- }, [...y[6] || (y[6] = [
2868
- e("svg", {
2869
- class: "fd-node-icon",
2870
- viewBox: "0 0 24 24",
2871
- fill: "none",
2872
- stroke: "currentColor",
2873
- "stroke-width": "1.8",
2874
- "stroke-linecap": "round",
2875
- "stroke-linejoin": "round"
2876
- }, [
2877
- e("line", {
2878
- x1: "12",
2879
- y1: "4",
2880
- x2: "12",
2881
- y2: "19"
2882
- }),
2883
- e("polyline", { points: "6 13 12 19 18 13" })
2884
- ], -1)
2885
- ])]),
2886
- e("span", {
2887
- class: "fd-node-action delete",
2888
- title: "删除",
2889
- onClick: y[2] || (y[2] = A((N) => _(n).removeWidget(t.node.id), ["stop"]))
2890
- }, [...y[7] || (y[7] = [
2891
- 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)
2892
- ])])
2893
- ], 32),
2894
- M(me, {
2895
- node: t.node,
2896
- mode: "design"
2897
- }, X({ _: 2 }, [
2898
- d() && t.node.children ? {
2899
- name: "children",
2900
- fn: z(() => [
2901
- (s(!0), m(T, null, F(t.node.children, (N, x) => (s(), O(k, {
2902
- key: N.id,
2903
- node: N,
2904
- "parent-id": t.node.id,
2905
- index: x,
2906
- class: j(o(N, x))
2907
- }, null, 8, ["node", "parent-id", "index", "class"]))), 128)),
2908
- !t.node.children || t.node.children.length === 0 ? (s(), m("div", Ha, "拖拽控件到此容器")) : C("", !0)
2909
- ]),
2910
- key: "0"
2911
- } : void 0
2912
- ]), 1032, ["node"])
2913
- ], 38);
2914
- };
2915
- }
2916
- }), Ga = /* @__PURE__ */ L(Wa, [["__scopeId", "data-v-3f3a43d3"]]), Ja = { class: "fd-designer" }, Qa = { class: "fd-designer-body" }, Za = { class: "fd-designer-left" }, Ka = {
2917
- key: 0,
2918
- class: "fd-canvas-empty"
2919
- }, Xa = { class: "fd-designer-right" }, ed = /* @__PURE__ */ D({
2920
- __name: "Designer",
2921
- props: {
2922
- formId: {}
2923
- },
2924
- setup(t) {
2925
- const l = t, n = V();
2926
- function a(d) {
2927
- (d === "PC" || d === "App") && (n.device = d === "App" ? "mobile" : "pc");
2928
- }
2929
- ee(async () => {
2930
- const d = new URLSearchParams(window.location.search).get("templateType") || "";
2931
- n.device = d === "mobile" || d === "2" ? "mobile" : "pc";
2932
- const o = new URLSearchParams(window.location.search).get("formId") || "", r = l.formId || o || "";
2933
- if (r) {
2934
- const f = Pe(r);
2935
- if (f) {
2936
- const p = await te(r), v = {
2937
- ...f,
2938
- fields: p.fields,
2939
- dbtable: p.dbtable,
2940
- templateType: p.templateType ?? f.templateType
2941
- };
2942
- a(v.templateType), n.loadSchema(v);
2943
- } else {
2944
- const p = await te(r);
2945
- a(p.templateType), n.loadSchema(p);
2946
- }
2947
- n.openedWithParam = !0;
2948
- } else {
2949
- const f = await te("");
2950
- a(f.templateType), n.loadSchema(f), n.openedWithParam = !1, n.formId = "";
2951
- }
2952
- });
2953
- function i(d) {
2954
- var f, p;
2955
- d.preventDefault();
2956
- const o = (f = d.dataTransfer) == null ? void 0 : f.getData("application/x-fd-new"), r = (p = d.dataTransfer) == null ? void 0 : p.getData("application/x-fd-move");
2957
- o ? n.addWidget(o, null, n.widgets.length) : r && n.moveNode(r, null, n.widgets.length);
2958
- }
2959
- return (d, o) => (s(), m("div", Ja, [
2960
- M(va),
2961
- e("div", Qa, [
2962
- e("aside", Za, [
2963
- M(wa)
2964
- ]),
2965
- e("main", {
2966
- class: "fd-designer-center",
2967
- onDragover: o[1] || (o[1] = A(() => {
2968
- }, ["prevent"])),
2969
- onDrop: i
2970
- }, [
2971
- e("div", {
2972
- class: j(["fd-canvas", { "is-mobile": _(n).device === "mobile", "is-selected": _(n).selectedForm }]),
2973
- onClick: o[0] || (o[0] = (r) => _(n).selectForm())
2974
- }, [
2975
- _(n).widgets.length === 0 ? (s(), m("div", Ka, [...o[2] || (o[2] = [
2976
- e("span", { class: "fd-canvas-empty-icon" }, "▦", -1),
2977
- e("span", null, "从左侧拖拽控件到此处", -1)
2978
- ])])) : C("", !0),
2979
- (s(!0), m(T, null, F(_(n).widgets, (r, f) => (s(), O(Ga, {
2980
- key: r.id,
2981
- node: r,
2982
- "parent-id": null,
2983
- index: f
2984
- }, null, 8, ["node", "index"]))), 128))
2985
- ], 2)
2986
- ], 32),
2987
- e("aside", Xa, [
2988
- M(Ya)
2989
- ])
2990
- ])
2991
- ]));
2992
- }
2993
- }), td = /* @__PURE__ */ L(ed, [["__scopeId", "data-v-2f9ce87a"]]);
2994
- function ud(t) {
2995
- fe(), (t.apiModule || t.baseModule) && Le({ apiModule: t.apiModule, baseModule: t.baseModule });
2996
- let l = null;
2997
- const a = Re({
2998
- render: () => Ue(Ne, {
2999
- widgets: t.widgets,
3000
- formMode: t.formMode,
3001
- formData: t.formData,
3002
- events: t.events,
3003
- formId: t.formId,
3004
- ref: (i) => {
3005
- l = i;
3006
- }
3007
- })
3008
- });
3009
- return a.mount(t.container), {
3010
- fireEvent: (i, d) => {
3011
- var o;
3012
- return (o = l == null ? void 0 : l.fireEvent) == null ? void 0 : o.call(l, i, d);
3013
- },
3014
- unmount: () => a.unmount()
3015
- };
3016
- }
3017
- const md = {
3018
- install(t, l = {}) {
3019
- fe(), (l.apiModule || l.baseModule) && Le({ apiModule: l.apiModule, baseModule: l.baseModule }), t.component("FdDesigner", td);
3020
- }
3021
- };
3022
- export {
3023
- td as D,
3024
- xa as L,
3025
- L as _,
3026
- md as a,
3027
- ud as b,
3028
- Le as c,
3029
- cd as d,
3030
- Q as r,
3031
- rd as s
3032
- };
3033
- //# sourceMappingURL=index-DCHlgXXr.js.map