gbformdesign 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,138 @@
1
- import { computed as H, onMounted as ot, resolveComponent as O, openBlock as m, createElementBlock as w, unref as k, createVNode as f, withCtx as y, Fragment as B, renderList as z, createBlock as V, createElementVNode as o, createTextVNode as Y, toDisplayString as ae, createCommentVNode as j, inject as qe, withModifiers as X, normalizeClass as $, ref as P, watch as Re, withDirectives as pe, vShow as he, vModelText as _t, reactive as Te, normalizeStyle as Rt, provide as ke, nextTick as Ct } from "vue";
2
- import { ElMessage as oe } from "element-plus";
3
- import { Delete as Je, Plus as Ye, Upload as Vt } from "@element-plus/icons-vue";
4
- const d = {
1
+ import { defineComponent as ge, h as ee, computed as B, onMounted as st, resolveComponent as N, openBlock as f, createElementBlock as w, unref as C, createVNode as m, withCtx as y, Fragment as z, renderList as G, createBlock as k, createElementVNode as s, createTextVNode as Y, toDisplayString as se, createCommentVNode as W, inject as Ye, withModifiers as X, normalizeClass as U, ref as P, watch as ke, withDirectives as me, vShow as be, vModelText as Ct, reactive as Ne, normalizeStyle as kt, provide as Ie, nextTick as Vt } from "vue";
2
+ import { ElMessage as ae } from "element-plus";
3
+ const St = [["path", { d: "M18 6l-12 12" }], ["path", { d: "M6 6l12 12" }]], Dt = ge({
4
+ name: "Close",
5
+ props: {
6
+ size: { type: [Number, String], default: void 0 },
7
+ strokeWidth: { type: [Number, String], default: void 0 }
8
+ },
9
+ setup: (e, { attrs: l }) => () => ee(
10
+ "svg",
11
+ {
12
+ xmlns: "http://www.w3.org/2000/svg",
13
+ viewBox: "0 0 24 24",
14
+ fill: "none",
15
+ stroke: "currentColor",
16
+ "stroke-width": Number(e.strokeWidth ?? 2),
17
+ "stroke-linecap": "round",
18
+ "stroke-linejoin": "round",
19
+ width: e.size == null ? "1em" : `${e.size}px`,
20
+ height: e.size == null ? "1em" : `${e.size}px`,
21
+ ...l
22
+ },
23
+ St.map(([t, n]) => ee(t, n))
24
+ )
25
+ }), It = [["path", { d: "M7 9.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667l0 -8.666" }], ["path", { d: "M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1" }]], $t = ge({
26
+ name: "CopyDocument",
27
+ props: {
28
+ size: { type: [Number, String], default: void 0 },
29
+ strokeWidth: { type: [Number, String], default: void 0 }
30
+ },
31
+ setup: (e, { attrs: l }) => () => ee(
32
+ "svg",
33
+ {
34
+ xmlns: "http://www.w3.org/2000/svg",
35
+ viewBox: "0 0 24 24",
36
+ fill: "none",
37
+ stroke: "currentColor",
38
+ "stroke-width": Number(e.strokeWidth ?? 2),
39
+ "stroke-linecap": "round",
40
+ "stroke-linejoin": "round",
41
+ width: e.size == null ? "1em" : `${e.size}px`,
42
+ height: e.size == null ? "1em" : `${e.size}px`,
43
+ ...l
44
+ },
45
+ It.map(([t, n]) => ee(t, n))
46
+ )
47
+ }), xt = [["path", { d: "M4 7l16 0" }], ["path", { d: "M10 11l0 6" }], ["path", { d: "M14 11l0 6" }], ["path", { d: "M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12" }], ["path", { d: "M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3" }]], Ke = ge({
48
+ name: "Delete",
49
+ props: {
50
+ size: { type: [Number, String], default: void 0 },
51
+ strokeWidth: { type: [Number, String], default: void 0 }
52
+ },
53
+ setup: (e, { attrs: l }) => () => ee(
54
+ "svg",
55
+ {
56
+ xmlns: "http://www.w3.org/2000/svg",
57
+ viewBox: "0 0 24 24",
58
+ fill: "none",
59
+ stroke: "currentColor",
60
+ "stroke-width": Number(e.strokeWidth ?? 2),
61
+ "stroke-linecap": "round",
62
+ "stroke-linejoin": "round",
63
+ width: e.size == null ? "1em" : `${e.size}px`,
64
+ height: e.size == null ? "1em" : `${e.size}px`,
65
+ ...l
66
+ },
67
+ xt.map(([t, n]) => ee(t, n))
68
+ )
69
+ }), Ut = [["path", { d: "M5 12h14" }], ["path", { d: "M12 5v14" }]], Qe = ge({
70
+ name: "Plus",
71
+ props: {
72
+ size: { type: [Number, String], default: void 0 },
73
+ strokeWidth: { type: [Number, String], default: void 0 }
74
+ },
75
+ setup: (e, { attrs: l }) => () => ee(
76
+ "svg",
77
+ {
78
+ xmlns: "http://www.w3.org/2000/svg",
79
+ viewBox: "0 0 24 24",
80
+ fill: "none",
81
+ stroke: "currentColor",
82
+ "stroke-width": Number(e.strokeWidth ?? 2),
83
+ "stroke-linecap": "round",
84
+ "stroke-linejoin": "round",
85
+ width: e.size == null ? "1em" : `${e.size}px`,
86
+ height: e.size == null ? "1em" : `${e.size}px`,
87
+ ...l
88
+ },
89
+ Ut.map(([t, n]) => ee(t, n))
90
+ )
91
+ }), Pt = [["path", { d: "M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }], ["path", { d: "M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }], ["path", { d: "M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }], ["path", { d: "M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }], ["path", { d: "M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }], ["path", { d: "M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0" }]], Mt = ge({
92
+ name: "Rank",
93
+ props: {
94
+ size: { type: [Number, String], default: void 0 },
95
+ strokeWidth: { type: [Number, String], default: void 0 }
96
+ },
97
+ setup: (e, { attrs: l }) => () => ee(
98
+ "svg",
99
+ {
100
+ xmlns: "http://www.w3.org/2000/svg",
101
+ viewBox: "0 0 24 24",
102
+ fill: "none",
103
+ stroke: "currentColor",
104
+ "stroke-width": Number(e.strokeWidth ?? 2),
105
+ "stroke-linecap": "round",
106
+ "stroke-linejoin": "round",
107
+ width: e.size == null ? "1em" : `${e.size}px`,
108
+ height: e.size == null ? "1em" : `${e.size}px`,
109
+ ...l
110
+ },
111
+ Pt.map(([t, n]) => ee(t, n))
112
+ )
113
+ }), Lt = [["path", { d: "M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2" }], ["path", { d: "M7 9l5 -5l5 5" }], ["path", { d: "M12 4l0 12" }]], Ft = ge({
114
+ name: "Upload",
115
+ props: {
116
+ size: { type: [Number, String], default: void 0 },
117
+ strokeWidth: { type: [Number, String], default: void 0 }
118
+ },
119
+ setup: (e, { attrs: l }) => () => ee(
120
+ "svg",
121
+ {
122
+ xmlns: "http://www.w3.org/2000/svg",
123
+ viewBox: "0 0 24 24",
124
+ fill: "none",
125
+ stroke: "currentColor",
126
+ "stroke-width": Number(e.strokeWidth ?? 2),
127
+ "stroke-linecap": "round",
128
+ "stroke-linejoin": "round",
129
+ width: e.size == null ? "1em" : `${e.size}px`,
130
+ height: e.size == null ? "1em" : `${e.size}px`,
131
+ ...l
132
+ },
133
+ Lt.map(([t, n]) => ee(t, n))
134
+ )
135
+ }), d = {
5
136
  INPUT: "input",
6
137
  TEXTAREA: "textarea",
7
138
  INPUT_NUMBER: "input-number",
@@ -12,7 +143,7 @@ const d = {
12
143
  DATE_PICKER: "date-picker",
13
144
  ROW: "row",
14
145
  BUTTON: "button"
15
- }, xt = {
146
+ }, zt = {
16
147
  [d.INPUT]: "文本输入框",
17
148
  [d.TEXTAREA]: "多行文本",
18
149
  [d.INPUT_NUMBER]: "数字输入框",
@@ -23,16 +154,16 @@ const d = {
23
154
  [d.DATE_PICKER]: "日期选择器",
24
155
  [d.ROW]: "分栏",
25
156
  [d.BUTTON]: "按钮"
26
- }, Ke = [
157
+ }, Xe = [
27
158
  d.RADIO_GROUP,
28
159
  d.CHECKBOX_GROUP,
29
160
  d.SELECT
30
- ], Ln = {
161
+ ], Jn = {
31
162
  FULL: 100,
32
163
  HALF: 50,
33
164
  THIRD: 33.33,
34
165
  QUARTER: 25
35
- }, Mn = {
166
+ }, Yn = {
36
167
  MIN_NUMBER: 1,
37
168
  MAX_NUMBER: 100,
38
169
  DEFAULT_GUTTER: 20,
@@ -42,17 +173,17 @@ const d = {
42
173
  MIN_WIDTH: 10,
43
174
  MAX_WIDTH: 100,
44
175
  WIDTH_STEP: 5
45
- }, Qe = {
176
+ }, Ze = {
46
177
  TODAY: "today",
47
178
  TOMORROW: "tomorrow"
48
179
  };
49
- function Oe() {
180
+ function Ae() {
50
181
  return `component_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`;
51
182
  }
52
- function at(e) {
53
- return e.id || (e.id = Oe()), e;
183
+ function it(e) {
184
+ return e.id || (e.id = Ae()), e;
54
185
  }
55
- function De(e) {
186
+ function xe(e) {
56
187
  if (e == null || e === "")
57
188
  return null;
58
189
  const l = Number(e);
@@ -61,42 +192,42 @@ function De(e) {
61
192
  function rt(e) {
62
193
  return e == null || e === "";
63
194
  }
64
- function kt(e) {
195
+ function jt(e) {
65
196
  return Array.isArray(e) ? e.map((l) => typeof l == "string" ? { label: l, value: l } : { ...l }) : [];
66
197
  }
67
- function It(e, l = 100) {
198
+ function Gt(e, l = 100) {
68
199
  if (e == null)
69
200
  return l;
70
201
  if (typeof e == "number")
71
202
  return e;
72
- const t = String(e).replace("%", ""), r = parseFloat(t);
73
- return isNaN(r) ? l : r;
203
+ const t = String(e).replace("%", ""), n = parseFloat(t);
204
+ return isNaN(n) ? l : n;
74
205
  }
75
206
  function Z(e) {
76
207
  return e.props?.variableName || `field_${e.id || Date.now()}`;
77
208
  }
78
- const Xe = (e) => {
209
+ const et = (e) => {
79
210
  const l = e.defaultValue;
80
211
  if (rt(l)) return null;
81
212
  if (e.type === d.DATE_PICKER) {
82
- if (l === Qe.TODAY)
213
+ if (l === Ze.TODAY)
83
214
  return /* @__PURE__ */ new Date();
84
- if (l === Qe.TOMORROW) {
215
+ if (l === Ze.TOMORROW) {
85
216
  const t = /* @__PURE__ */ new Date();
86
217
  return t.setDate(t.getDate() + 1), t;
87
218
  }
88
219
  return null;
89
220
  }
90
- return e.type === d.INPUT_NUMBER ? De(l) : e.type === d.CHECKBOX_GROUP ? Array.isArray(l) ? [...l] : [] : l;
91
- }, st = (e, l) => {
221
+ return e.type === d.INPUT_NUMBER ? xe(l) : e.type === d.CHECKBOX_GROUP ? Array.isArray(l) ? [...l] : [] : l;
222
+ }, ut = (e, l) => {
92
223
  const t = e.__vccOpts || e;
93
- for (const [r, u] of l)
94
- t[r] = u;
224
+ for (const [n, u] of l)
225
+ t[n] = u;
95
226
  return t;
96
- }, Dt = { class: "form-viewer" }, St = {
227
+ }, Wt = { class: "form-viewer" }, Bt = {
97
228
  key: 0,
98
229
  class: "row-container"
99
- }, Ut = { class: "column-wrapper" }, $t = /* @__PURE__ */ Object.assign({ name: "FormField" }, {
230
+ }, Ht = { class: "column-wrapper" }, qt = /* @__PURE__ */ Object.assign({ name: "FormField" }, {
100
231
  __name: "FormField",
101
232
  props: {
102
233
  component: {
@@ -118,47 +249,47 @@ const Xe = (e) => {
118
249
  },
119
250
  emits: ["update:value"],
120
251
  setup(e, { emit: l }) {
121
- const t = e, r = l, u = H(() => Z(t.component));
122
- ot(() => {
252
+ const t = e, n = l, u = B(() => Z(t.component));
253
+ st(() => {
123
254
  if (!(u.value in t.formData)) {
124
- const s = Xe(t.component);
125
- s != null ? t.formData[u.value] = s : t.component.type === d.INPUT_NUMBER ? t.formData[u.value] = null : t.component.type === d.RADIO_GROUP || t.component.type === d.SELECT || t.component.type === d.TEXTAREA ? t.formData[u.value] = "" : t.component.type === d.DATE_PICKER ? t.formData[u.value] = null : t.component.type === d.CHECKBOX_GROUP ? t.formData[u.value] = [] : t.component.type === d.SWITCH ? t.formData[u.value] = !1 : t.formData[u.value] = "";
255
+ const i = et(t.component);
256
+ i != null ? t.formData[u.value] = i : t.component.type === d.INPUT_NUMBER ? t.formData[u.value] = null : t.component.type === d.RADIO_GROUP || t.component.type === d.SELECT || t.component.type === d.TEXTAREA ? t.formData[u.value] = "" : t.component.type === d.DATE_PICKER ? t.formData[u.value] = null : t.component.type === d.CHECKBOX_GROUP ? t.formData[u.value] = [] : t.component.type === d.SWITCH ? t.formData[u.value] = !1 : t.formData[u.value] = "";
126
257
  }
127
258
  });
128
- const i = H({
259
+ const r = B({
129
260
  get() {
130
- let s = t.formData[u.value];
261
+ let i = t.formData[u.value];
131
262
  if (t.component.type === d.INPUT_NUMBER)
132
- return De(s);
133
- if (rt(s) && t.component.defaultValue !== void 0 && t.component.defaultValue !== null) {
134
- const h = Xe(t.component);
263
+ return xe(i);
264
+ if (rt(i) && t.component.defaultValue !== void 0 && t.component.defaultValue !== null) {
265
+ const h = et(t.component);
135
266
  if (h != null)
136
267
  return h;
137
268
  }
138
- return s;
269
+ return i;
139
270
  },
140
- set(s) {
141
- t.component.type === d.INPUT_NUMBER ? t.formData[u.value] = De(s) : t.component.type === d.CHECKBOX_GROUP ? t.formData[u.value] = Array.isArray(s) ? [...s] : [] : t.component.type === d.SWITCH ? t.formData[u.value] = s === !0 : t.formData[u.value] = s, r("update:value", u.value, t.formData[u.value]);
271
+ set(i) {
272
+ t.component.type === d.INPUT_NUMBER ? t.formData[u.value] = xe(i) : t.component.type === d.CHECKBOX_GROUP ? t.formData[u.value] = Array.isArray(i) ? [...i] : [] : t.component.type === d.SWITCH ? t.formData[u.value] = i === !0 : t.formData[u.value] = i, n("update:value", u.value, t.formData[u.value]);
142
273
  }
143
- }), p = (s) => {
144
- r("update:value", u.value, s);
274
+ }), p = (i) => {
275
+ n("update:value", u.value, i);
145
276
  };
146
- return (s, h) => {
147
- const b = O("FormField", !0), N = O("el-col"), D = O("el-row"), _ = O("el-input"), x = O("el-form-item"), I = O("el-input-number"), A = O("el-radio"), C = O("el-radio-group"), U = O("el-option"), le = O("el-select"), re = O("el-checkbox"), K = O("el-checkbox-group"), q = O("el-switch"), E = O("el-date-picker");
148
- return m(), w("div", Dt, [
149
- e.component.type === k(d).ROW ? (m(), w("div", St, [
150
- f(D, {
277
+ return (i, h) => {
278
+ const b = N("FormField", !0), O = N("el-col"), I = N("el-row"), _ = N("el-input"), V = N("el-form-item"), D = N("el-input-number"), A = N("el-radio"), S = N("el-radio-group"), x = N("el-option"), ne = N("el-select"), ie = N("el-checkbox"), K = N("el-checkbox-group"), q = N("el-switch"), E = N("el-date-picker");
279
+ return f(), w("div", Wt, [
280
+ e.component.type === C(d).ROW ? (f(), w("div", Bt, [
281
+ m(I, {
151
282
  gutter: e.component.props?.gutter || 20
152
283
  }, {
153
284
  default: y(() => [
154
- (m(!0), w(B, null, z(e.component.props?.columns || [], (n, Q) => (m(), V(N, {
285
+ (f(!0), w(z, null, G(e.component.props?.columns || [], (o, Q) => (f(), k(O, {
155
286
  key: Q,
156
- span: n.span || 12
287
+ span: o.span || 12
157
288
  }, {
158
289
  default: y(() => [
159
- o("div", Ut, [
160
- (m(!0), w(B, null, z(e.component.children?.[Q] || [], (F, ee) => (m(), V(b, {
161
- key: ee,
290
+ s("div", Ht, [
291
+ (f(!0), w(z, null, G(e.component.children?.[Q] || [], (F, te) => (f(), k(b, {
292
+ key: te,
162
293
  component: F,
163
294
  "form-data": e.formData,
164
295
  "form-rules": e.formRules,
@@ -171,16 +302,16 @@ const Xe = (e) => {
171
302
  ]),
172
303
  _: 1
173
304
  }, 8, ["gutter"])
174
- ])) : e.component.type === k(d).INPUT ? (m(), V(x, {
305
+ ])) : e.component.type === C(d).INPUT ? (f(), k(V, {
175
306
  key: 1,
176
307
  label: e.component.props?.label || "",
177
- prop: k(Z)(e.component),
308
+ prop: C(Z)(e.component),
178
309
  required: e.component.required
179
310
  }, {
180
311
  default: y(() => [
181
- f(_, {
182
- modelValue: i.value,
183
- "onUpdate:modelValue": h[0] || (h[0] = (n) => i.value = n),
312
+ m(_, {
313
+ modelValue: r.value,
314
+ "onUpdate:modelValue": h[0] || (h[0] = (o) => r.value = o),
184
315
  placeholder: e.component.props?.placeholder || "请输入文本",
185
316
  style: { width: "100%" },
186
317
  disabled: e.readonly,
@@ -188,16 +319,16 @@ const Xe = (e) => {
188
319
  }, null, 8, ["modelValue", "placeholder", "disabled"])
189
320
  ]),
190
321
  _: 1
191
- }, 8, ["label", "prop", "required"])) : e.component.type === k(d).TEXTAREA ? (m(), V(x, {
322
+ }, 8, ["label", "prop", "required"])) : e.component.type === C(d).TEXTAREA ? (f(), k(V, {
192
323
  key: 2,
193
324
  label: e.component.props?.label || "",
194
- prop: k(Z)(e.component),
325
+ prop: C(Z)(e.component),
195
326
  required: e.component.required
196
327
  }, {
197
328
  default: y(() => [
198
- f(_, {
199
- modelValue: i.value,
200
- "onUpdate:modelValue": h[1] || (h[1] = (n) => i.value = n),
329
+ m(_, {
330
+ modelValue: r.value,
331
+ "onUpdate:modelValue": h[1] || (h[1] = (o) => r.value = o),
201
332
  type: "textarea",
202
333
  rows: e.component.props?.rows || 3,
203
334
  placeholder: e.component.props?.placeholder || "请输入内容",
@@ -207,16 +338,16 @@ const Xe = (e) => {
207
338
  }, null, 8, ["modelValue", "rows", "placeholder", "disabled"])
208
339
  ]),
209
340
  _: 1
210
- }, 8, ["label", "prop", "required"])) : e.component.type === k(d).INPUT_NUMBER ? (m(), V(x, {
341
+ }, 8, ["label", "prop", "required"])) : e.component.type === C(d).INPUT_NUMBER ? (f(), k(V, {
211
342
  key: 3,
212
343
  label: e.component.props?.label || "",
213
- prop: k(Z)(e.component),
344
+ prop: C(Z)(e.component),
214
345
  required: e.component.required
215
346
  }, {
216
347
  default: y(() => [
217
- f(I, {
218
- modelValue: i.value,
219
- "onUpdate:modelValue": h[2] || (h[2] = (n) => i.value = n),
348
+ m(D, {
349
+ modelValue: r.value,
350
+ "onUpdate:modelValue": h[2] || (h[2] = (o) => r.value = o),
220
351
  min: e.component.min || 1,
221
352
  max: e.component.max || 100,
222
353
  style: { width: "100%" },
@@ -225,27 +356,27 @@ const Xe = (e) => {
225
356
  }, null, 8, ["modelValue", "min", "max", "disabled"])
226
357
  ]),
227
358
  _: 1
228
- }, 8, ["label", "prop", "required"])) : e.component.type === k(d).RADIO_GROUP ? (m(), V(x, {
359
+ }, 8, ["label", "prop", "required"])) : e.component.type === C(d).RADIO_GROUP ? (f(), k(V, {
229
360
  key: 4,
230
361
  label: e.component.props?.label || "",
231
- prop: k(Z)(e.component),
362
+ prop: C(Z)(e.component),
232
363
  required: e.component.required
233
364
  }, {
234
365
  default: y(() => [
235
- f(C, {
236
- modelValue: i.value,
237
- "onUpdate:modelValue": h[3] || (h[3] = (n) => i.value = n),
366
+ m(S, {
367
+ modelValue: r.value,
368
+ "onUpdate:modelValue": h[3] || (h[3] = (o) => r.value = o),
238
369
  style: { width: "100%" },
239
370
  disabled: e.readonly,
240
371
  onChange: p
241
372
  }, {
242
373
  default: y(() => [
243
- (m(!0), w(B, null, z(e.component.props?.options || ["选项1", "选项2", "选项3"], (n) => (m(), V(A, {
244
- key: n.value || n,
245
- value: n.value || n
374
+ (f(!0), w(z, null, G(e.component.props?.options || ["选项1", "选项2", "选项3"], (o) => (f(), k(A, {
375
+ key: o.value || o,
376
+ value: o.value || o
246
377
  }, {
247
378
  default: y(() => [
248
- Y(ae(n.label || n), 1)
379
+ Y(se(o.label || o), 1)
249
380
  ]),
250
381
  _: 2
251
382
  }, 1032, ["value"]))), 128))
@@ -254,53 +385,53 @@ const Xe = (e) => {
254
385
  }, 8, ["modelValue", "disabled"])
255
386
  ]),
256
387
  _: 1
257
- }, 8, ["label", "prop", "required"])) : e.component.type === k(d).SELECT ? (m(), V(x, {
388
+ }, 8, ["label", "prop", "required"])) : e.component.type === C(d).SELECT ? (f(), k(V, {
258
389
  key: 5,
259
390
  label: e.component.props?.label || "",
260
- prop: k(Z)(e.component),
391
+ prop: C(Z)(e.component),
261
392
  required: e.component.required
262
393
  }, {
263
394
  default: y(() => [
264
- f(le, {
265
- modelValue: i.value,
266
- "onUpdate:modelValue": h[4] || (h[4] = (n) => i.value = n),
395
+ m(ne, {
396
+ modelValue: r.value,
397
+ "onUpdate:modelValue": h[4] || (h[4] = (o) => r.value = o),
267
398
  placeholder: e.component.props?.placeholder || "请选择",
268
399
  style: { width: "100%" },
269
400
  disabled: e.readonly,
270
401
  onChange: p
271
402
  }, {
272
403
  default: y(() => [
273
- (m(!0), w(B, null, z(e.component.props?.options || [], (n) => (m(), V(U, {
274
- key: n.value || n,
275
- label: n.label || n,
276
- value: n.value || n
404
+ (f(!0), w(z, null, G(e.component.props?.options || [], (o) => (f(), k(x, {
405
+ key: o.value || o,
406
+ label: o.label || o,
407
+ value: o.value || o
277
408
  }, null, 8, ["label", "value"]))), 128))
278
409
  ]),
279
410
  _: 1
280
411
  }, 8, ["modelValue", "placeholder", "disabled"])
281
412
  ]),
282
413
  _: 1
283
- }, 8, ["label", "prop", "required"])) : e.component.type === k(d).CHECKBOX_GROUP ? (m(), V(x, {
414
+ }, 8, ["label", "prop", "required"])) : e.component.type === C(d).CHECKBOX_GROUP ? (f(), k(V, {
284
415
  key: 6,
285
416
  label: e.component.props?.label || "",
286
- prop: k(Z)(e.component),
417
+ prop: C(Z)(e.component),
287
418
  required: e.component.required
288
419
  }, {
289
420
  default: y(() => [
290
- f(K, {
291
- modelValue: i.value,
292
- "onUpdate:modelValue": h[5] || (h[5] = (n) => i.value = n),
421
+ m(K, {
422
+ modelValue: r.value,
423
+ "onUpdate:modelValue": h[5] || (h[5] = (o) => r.value = o),
293
424
  style: { width: "100%" },
294
425
  disabled: e.readonly,
295
426
  onChange: p
296
427
  }, {
297
428
  default: y(() => [
298
- (m(!0), w(B, null, z(e.component.props?.options || [], (n) => (m(), V(re, {
299
- key: n.value || n,
300
- value: n.value || n
429
+ (f(!0), w(z, null, G(e.component.props?.options || [], (o) => (f(), k(ie, {
430
+ key: o.value || o,
431
+ value: o.value || o
301
432
  }, {
302
433
  default: y(() => [
303
- Y(ae(n.label || n), 1)
434
+ Y(se(o.label || o), 1)
304
435
  ]),
305
436
  _: 2
306
437
  }, 1032, ["value"]))), 128))
@@ -309,16 +440,16 @@ const Xe = (e) => {
309
440
  }, 8, ["modelValue", "disabled"])
310
441
  ]),
311
442
  _: 1
312
- }, 8, ["label", "prop", "required"])) : e.component.type === k(d).SWITCH ? (m(), V(x, {
443
+ }, 8, ["label", "prop", "required"])) : e.component.type === C(d).SWITCH ? (f(), k(V, {
313
444
  key: 7,
314
445
  label: e.component.props?.label || "",
315
- prop: k(Z)(e.component),
446
+ prop: C(Z)(e.component),
316
447
  required: e.component.required
317
448
  }, {
318
449
  default: y(() => [
319
- f(q, {
320
- modelValue: i.value,
321
- "onUpdate:modelValue": h[6] || (h[6] = (n) => i.value = n),
450
+ m(q, {
451
+ modelValue: r.value,
452
+ "onUpdate:modelValue": h[6] || (h[6] = (o) => r.value = o),
322
453
  "active-text": e.component.props?.activeText || "",
323
454
  "inactive-text": e.component.props?.inactiveText || "",
324
455
  disabled: e.readonly,
@@ -326,16 +457,16 @@ const Xe = (e) => {
326
457
  }, null, 8, ["modelValue", "active-text", "inactive-text", "disabled"])
327
458
  ]),
328
459
  _: 1
329
- }, 8, ["label", "prop", "required"])) : e.component.type === k(d).DATE_PICKER ? (m(), V(x, {
460
+ }, 8, ["label", "prop", "required"])) : e.component.type === C(d).DATE_PICKER ? (f(), k(V, {
330
461
  key: 8,
331
462
  label: e.component.props?.label || "",
332
- prop: k(Z)(e.component),
463
+ prop: C(Z)(e.component),
333
464
  required: e.component.required
334
465
  }, {
335
466
  default: y(() => [
336
- f(E, {
337
- modelValue: i.value,
338
- "onUpdate:modelValue": h[7] || (h[7] = (n) => i.value = n),
467
+ m(E, {
468
+ modelValue: r.value,
469
+ "onUpdate:modelValue": h[7] || (h[7] = (o) => r.value = o),
339
470
  type: "date",
340
471
  placeholder: e.component.props?.placeholder || "选择日期",
341
472
  style: { width: "100%" },
@@ -344,14 +475,14 @@ const Xe = (e) => {
344
475
  }, null, 8, ["modelValue", "placeholder", "disabled"])
345
476
  ]),
346
477
  _: 1
347
- }, 8, ["label", "prop", "required"])) : j("", !0)
478
+ }, 8, ["label", "prop", "required"])) : W("", !0)
348
479
  ]);
349
480
  };
350
481
  }
351
- }), it = /* @__PURE__ */ st($t, [["__scopeId", "data-v-63b4f62f"]]), Pt = {
482
+ }), dt = /* @__PURE__ */ ut(qt, [["__scopeId", "data-v-e2eff285"]]), Jt = {
352
483
  key: 0,
353
484
  class: "_fd-draggable-drag _fd-drag-box gb-fc-row-box"
354
- }, Lt = ["onDragover", "onDrop"], Mt = { class: "gb-fc-tools" }, Ft = ["title"], Bt = /* @__PURE__ */ Object.assign({ name: "FcCanvasField" }, {
485
+ }, Yt = ["onDragover", "onDrop"], Kt = { class: "gb-fc-tools" }, Qt = ["title"], Xt = /* @__PURE__ */ Object.assign({ name: "FcCanvasField" }, {
355
486
  __name: "FcCanvasField",
356
487
  props: {
357
488
  component: { type: Object, required: !0 },
@@ -362,186 +493,159 @@ const Xe = (e) => {
362
493
  depth: { type: Number, default: 0 }
363
494
  },
364
495
  setup(e) {
365
- const l = e, t = qe("fcCanvasOps"), r = qe("fcDragOver"), u = H(() => l.component.type === d.ROW), i = H(() => l.component.props?.columns?.length || 2);
366
- H(
496
+ const l = e, t = Ye("fcCanvasOps"), n = Ye("fcDragOver"), u = B(() => l.component.type === d.ROW), r = B(() => l.component.props?.columns?.length || 2);
497
+ B(
367
498
  () => (l.component.children || []).every((A) => !A || A.length === 0)
368
499
  );
369
500
  const p = {
370
501
  kind: "existing",
371
502
  path: l.path
372
- }, s = (A) => {
503
+ }, i = (A) => {
373
504
  A.dataTransfer.effectAllowed = "move", A.dataTransfer.setData("application/x-gb-field", JSON.stringify(p)), A.dataTransfer.setData("text/plain", "gb-field"), t.startDrag(l.path);
374
505
  }, h = () => {
375
506
  t.endDrag();
376
507
  }, b = (A) => {
377
508
  A.preventDefault();
378
- const C = A.currentTarget.getBoundingClientRect(), U = A.clientY - C.top < C.height / 2 ? "top" : "bottom";
379
- r.value = l.path.join(".") + ":" + U, A.dataTransfer.dropEffect = "move";
380
- }, N = () => {
381
- r.value?.startsWith(l.path.join(".")) && (r.value = "");
382
- }, D = (A) => {
509
+ const S = A.currentTarget.getBoundingClientRect(), x = A.clientY - S.top < S.height / 2 ? "top" : "bottom";
510
+ n.value = l.path.join(".") + ":" + x, A.dataTransfer.dropEffect = "move";
511
+ }, O = () => {
512
+ n.value?.startsWith(l.path.join(".")) && (n.value = "");
513
+ }, I = (A) => {
383
514
  A.preventDefault(), A.stopPropagation();
384
- const C = r.value?.endsWith(":top") ? "top" : "bottom", U = I(A);
385
- r.value = "", U && t.dropAt(U, { path: l.path, position: C });
515
+ const S = n.value?.endsWith(":top") ? "top" : "bottom", x = D(A);
516
+ n.value = "", x && t.dropAt(x, { path: l.path, position: S });
386
517
  }, _ = (A) => {
387
- r.value = l.path.join(".") + ":col" + A;
388
- }, x = (A, C) => {
389
- const U = I(C);
390
- r.value = "", U && t.dropAt(U, { path: l.path, column: A });
391
- }, I = (A) => {
392
- const C = A?.dataTransfer?.getData("application/x-gb-field");
393
- if (C)
518
+ n.value = l.path.join(".") + ":col" + A;
519
+ }, V = (A, S) => {
520
+ const x = D(S);
521
+ n.value = "", x && t.dropAt(x, { path: l.path, column: A });
522
+ }, D = (A) => {
523
+ const S = A?.dataTransfer?.getData("application/x-gb-field");
524
+ if (S)
394
525
  try {
395
- return JSON.parse(C);
526
+ return JSON.parse(S);
396
527
  } catch {
397
528
  return null;
398
529
  }
399
530
  return t.getDragPayload();
400
531
  };
401
- return (A, C) => {
402
- const U = O("FcCanvasField", !0), le = O("el-col"), re = O("el-row");
403
- return m(), w("div", {
404
- class: $(["_fc-draggable-item _fd-drag-item gb-fc-item", {
532
+ return (A, S) => {
533
+ const x = N("FcCanvasField", !0), ne = N("el-col"), ie = N("el-row");
534
+ return f(), w("div", {
535
+ class: U(["_fc-draggable-item _fd-drag-item gb-fc-item", {
405
536
  "is-active": e.activeId === e.component.id,
406
537
  "is-hidden": e.component.hidden,
407
- "drag-over-top": k(r) === e.path.join(".") + ":top",
408
- "drag-over-bottom": k(r) === e.path.join(".") + ":bottom"
538
+ "drag-over-top": C(n) === e.path.join(".") + ":top",
539
+ "drag-over-bottom": C(n) === e.path.join(".") + ":bottom"
409
540
  }]),
410
541
  onDragover: X(b, ["prevent"]),
411
- onDragenter: C[3] || (C[3] = X(() => {
542
+ onDragenter: S[3] || (S[3] = X(() => {
412
543
  }, ["prevent"])),
413
- onDragleave: N,
414
- onDrop: X(D, ["stop", "prevent"])
544
+ onDragleave: O,
545
+ onDrop: X(I, ["stop", "prevent"])
415
546
  }, [
416
- u.value ? (m(), w("div", Pt, [
417
- f(re, {
547
+ u.value ? (f(), w("div", Jt, [
548
+ m(ie, {
418
549
  gutter: e.component.props?.gutter || 20
419
550
  }, {
420
551
  default: y(() => [
421
- (m(!0), w(B, null, z(i.value, (K, q) => (m(), V(le, {
552
+ (f(!0), w(z, null, G(r.value, (K, q) => (f(), k(ne, {
422
553
  key: q,
423
554
  span: e.component.props?.columns?.[q]?.span || 12
424
555
  }, {
425
556
  default: y(() => [
426
- o("div", {
427
- class: $(["gb-fc-column", {
557
+ s("div", {
558
+ class: U(["gb-fc-column", {
428
559
  "_fc-child-empty": !(e.component.children?.[q] || []).length,
429
560
  "has-child": (e.component.children?.[q] || []).length
430
561
  }]),
431
562
  onDragover: X((E) => _(q), ["prevent", "stop"]),
432
- onDrop: X((E) => x(q, E), ["stop", "prevent"])
563
+ onDrop: X((E) => V(q, E), ["stop", "prevent"])
433
564
  }, [
434
- (m(!0), w(B, null, z(e.component.children?.[q] || [], (E, n) => (m(), V(U, {
435
- key: E.id || n,
565
+ (f(!0), w(z, null, G(e.component.children?.[q] || [], (E, o) => (f(), k(x, {
566
+ key: E.id || o,
436
567
  component: E,
437
- path: [...e.path, "children", q, n],
568
+ path: [...e.path, "children", q, o],
438
569
  "form-data": e.formData,
439
570
  "form-rules": e.formRules,
440
571
  "active-id": e.activeId,
441
572
  depth: e.depth + 1
442
573
  }, null, 8, ["component", "path", "form-data", "form-rules", "active-id", "depth"]))), 128))
443
- ], 42, Lt)
574
+ ], 42, Yt)
444
575
  ]),
445
576
  _: 2
446
577
  }, 1032, ["span"]))), 128))
447
578
  ]),
448
579
  _: 1
449
580
  }, 8, ["gutter"])
450
- ])) : (m(), V(it, {
581
+ ])) : (f(), k(dt, {
451
582
  key: 1,
452
583
  component: e.component,
453
584
  "form-data": e.formData,
454
585
  "form-rules": e.formRules,
455
586
  readonly: !0
456
587
  }, null, 8, ["component", "form-data", "form-rules"])),
457
- o("div", {
588
+ s("div", {
458
589
  class: "gb-fc-mask",
459
- onClick: C[2] || (C[2] = X((K) => k(t).active(e.component, e.path), ["stop"]))
590
+ onClick: S[2] || (S[2] = X((K) => C(t).active(e.component, e.path), ["stop"]))
460
591
  }, [
461
- o("div", Mt, [
462
- o("i", {
592
+ s("div", Kt, [
593
+ s("i", {
463
594
  class: "gb-fc-tool gb-fc-tool--handle",
464
595
  title: "拖拽" + (e.component.props?.label || e.component.type),
465
596
  draggable: "true",
466
- onDragstart: X(s, ["stop"]),
597
+ onDragstart: X(i, ["stop"]),
467
598
  onDragend: h
468
- }, [...C[4] || (C[4] = [
469
- o("svg", {
470
- viewBox: "0 0 1024 1024",
471
- width: "14",
472
- height: "14"
473
- }, [
474
- o("path", {
475
- fill: "currentColor",
476
- d: "M469.3 256a53.3 53.3 0 1 1-106.6 0 53.3 53.3 0 0 1 106.6 0zm0 170.7a53.3 53.3 0 1 1-106.6 0 53.3 53.3 0 0 1 106.6 0zm0 170.6a53.3 53.3 0 1 1-106.6 0 53.3 53.3 0 0 1 106.6 0zm0 170.7a53.3 53.3 0 1 1-106.6 0 53.3 53.3 0 0 1 106.6 0zM661.3 256a53.3 53.3 0 1 1-106.6 0 53.3 53.3 0 0 1 106.6 0zm0 170.7a53.3 53.3 0 1 1-106.6 0 53.3 53.3 0 0 1 106.6 0zm0 170.6a53.3 53.3 0 1 1-106.6 0 53.3 53.3 0 0 1 106.6 0zm0 170.7a53.3 53.3 0 1 1-106.6 0 53.3 53.3 0 0 1 106.6 0z"
477
- })
478
- ], -1)
479
- ])], 40, Ft),
480
- o("i", {
599
+ }, [
600
+ m(C(Mt), { style: { width: "14px", height: "14px" } })
601
+ ], 40, Qt),
602
+ s("i", {
481
603
  class: "gb-fc-tool",
482
604
  title: "复制",
483
- onClick: C[0] || (C[0] = X((K) => k(t).copy(e.path), ["stop"]))
484
- }, [...C[5] || (C[5] = [
485
- o("svg", {
486
- viewBox: "0 0 1024 1024",
487
- width: "14",
488
- height: "14"
489
- }, [
490
- o("path", {
491
- fill: "currentColor",
492
- d: "M768 832v-576H320v576h448zM320 192h448a64 64 0 0 1 64 64v576a64 64 0 0 1-64 64H320a64 64 0 0 1-64-64V256a64 64 0 0 1 64-64zm-128 64v640h64v64h-64a64 64 0 0 1-64-64V256h64z"
493
- })
494
- ], -1)
495
- ])]),
496
- o("i", {
605
+ onClick: S[0] || (S[0] = X((K) => C(t).copy(e.path), ["stop"]))
606
+ }, [
607
+ m(C($t), { style: { width: "14px", height: "14px" } })
608
+ ]),
609
+ s("i", {
497
610
  class: "gb-fc-tool gb-fc-tool--danger",
498
611
  title: "删除",
499
- onClick: C[1] || (C[1] = X((K) => k(t).remove(e.path), ["stop"]))
500
- }, [...C[6] || (C[6] = [
501
- o("svg", {
502
- viewBox: "0 0 1024 1024",
503
- width: "14",
504
- height: "14"
505
- }, [
506
- o("path", {
507
- fill: "currentColor",
508
- d: "M512 455.1L761 206a15 15 0 0 1 21.2 0l35.8 35.8a15 15 0 0 1 0 21.2L569 512l249 249a15 15 0 0 1 0 21.2l-35.8 35.8a15 15 0 0 1-21.2 0L512 569l-249 249a15 15 0 0 1-21.2 0l-35.8-35.8a15 15 0 0 1 0-21.2L455 512 206 263a15 15 0 0 1 0-21.2l35.8-35.8a15 15 0 0 1 21.2 0z"
509
- })
510
- ], -1)
511
- ])])
612
+ onClick: S[1] || (S[1] = X((K) => C(t).remove(e.path), ["stop"]))
613
+ }, [
614
+ m(C(Dt), { style: { width: "14px", height: "14px" } })
615
+ ])
512
616
  ])
513
617
  ])
514
618
  ], 34);
515
619
  };
516
620
  }
517
- }), Gt = {
621
+ }), Zt = {
518
622
  class: "_fd-config-item",
519
623
  style: { "margin-top": "12px" }
520
- }, zt = { class: "_fd-ci-head" }, jt = { class: "_fd-ci-con" }, Ht = { class: "_fc-r-config" }, Wt = { style: { "grid-area": "base" } }, qt = {
624
+ }, el = { class: "_fd-ci-head" }, tl = { class: "_fd-ci-con" }, ll = { class: "_fc-r-config" }, nl = { style: { "grid-area": "base" } }, ol = {
521
625
  key: 0,
522
626
  class: "_fd-config-item"
523
- }, Jt = { class: "_fd-ci-head" }, Yt = { class: "_fd-ci-con" }, Kt = {
627
+ }, al = { class: "_fd-ci-head" }, sl = { class: "_fd-ci-con" }, il = {
524
628
  key: 1,
525
629
  class: "_fd-config-item"
526
- }, Qt = { class: "_fd-ci-head" }, Xt = { class: "_fd-ci-con" }, Zt = {
630
+ }, rl = { class: "_fd-ci-head" }, ul = { class: "_fd-ci-con" }, dl = {
527
631
  key: 0,
528
632
  style: { display: "flex", "justify-content": "flex-end", "margin-top": "6px" }
529
- }, el = {
633
+ }, cl = {
530
634
  key: 2,
531
635
  class: "_fd-config-item"
532
- }, tl = { class: "_fd-ci-head" }, ll = { class: "_fd-ci-con" }, nl = { style: { "grid-area": "props" } }, ol = {
636
+ }, pl = { class: "_fd-ci-head" }, ml = { class: "_fd-ci-con" }, fl = { style: { "grid-area": "props" } }, vl = {
533
637
  key: 0,
534
638
  class: "_fd-config-item"
535
- }, al = { class: "_fd-ci-head" }, rl = { class: "_fd-ci-con" }, sl = { class: "_fd-config-item" }, il = { class: "_fd-ci-head" }, ul = { class: "_fd-ci-con" }, dl = { class: "_fd-config-item" }, cl = { class: "_fd-ci-head" }, pl = { class: "_fd-ci-con" }, ml = {
639
+ }, yl = { class: "_fd-ci-head" }, hl = { class: "_fd-ci-con" }, bl = { class: "_fd-config-item" }, gl = { class: "_fd-ci-head" }, Tl = { class: "_fd-ci-con" }, El = { class: "_fd-config-item" }, Nl = { class: "_fd-ci-head" }, Ol = { class: "_fd-ci-con" }, Al = {
536
640
  key: 2,
537
641
  class: "_fd-config-item"
538
- }, fl = {
642
+ }, wl = {
539
643
  class: "_fd-ci-append",
540
644
  style: { display: "block" }
541
- }, vl = { class: "_fd-config-item" }, yl = { class: "_fd-ci-head" }, hl = { class: "_fd-ci-con" }, bl = { class: "_fd-config-item" }, gl = {
645
+ }, _l = { class: "_fd-config-item" }, Rl = { class: "_fd-ci-head" }, Cl = { class: "_fd-ci-con" }, kl = { class: "_fd-config-item" }, Vl = {
542
646
  class: "_fd-ci-append",
543
647
  style: { display: "block" }
544
- }, Tl = { style: { "font-size": "12px", color: "#666", width: "60px" } }, El = { class: "_fc-r-config" }, Ol = { style: { "grid-area": "base" } }, Nl = { class: "_fd-config-item" }, Al = { class: "_fd-ci-head" }, wl = { class: "_fd-ci-con" }, _l = { class: "_fd-config-item" }, Rl = { class: "_fd-ci-head" }, Cl = { class: "_fd-ci-con" }, Vl = { class: "_fd-config-item" }, xl = { class: "_fd-ci-head" }, kl = { class: "_fd-ci-con" }, Il = { class: "_fd-config-item" }, Dl = { class: "_fd-ci-head" }, Sl = { class: "_fd-ci-con" }, Ul = /* @__PURE__ */ Object.assign({ name: "FcPropsPanel" }, {
648
+ }, Sl = { style: { "font-size": "12px", color: "#666", width: "60px" } }, Dl = { class: "_fc-r-config" }, Il = { style: { "grid-area": "base" } }, $l = { class: "_fd-config-item" }, xl = { class: "_fd-ci-head" }, Ul = { class: "_fd-ci-con" }, Pl = { class: "_fd-config-item" }, Ml = { class: "_fd-ci-head" }, Ll = { class: "_fd-ci-con" }, Fl = { class: "_fd-config-item" }, zl = { class: "_fd-ci-head" }, jl = { class: "_fd-ci-con" }, Gl = { class: "_fd-config-item" }, Wl = { class: "_fd-ci-head" }, Bl = { class: "_fd-ci-con" }, Hl = /* @__PURE__ */ Object.assign({ name: "FcPropsPanel" }, {
545
649
  __name: "FcPropsPanel",
546
650
  props: {
547
651
  component: { type: Object, default: null },
@@ -549,87 +653,87 @@ const Xe = (e) => {
549
653
  },
550
654
  emits: ["close"],
551
655
  setup(e, { emit: l }) {
552
- const t = e, r = P("props"), u = H(() => t.component?.type === d.ROW), i = H(() => Ke.includes(t.component?.type)), p = H(() => t.component?.props ? (Array.isArray(t.component.props.options) || (t.component.props.options = []), t.component.props.options) : []), s = Object.entries(xt).filter(([E]) => E !== d.BUTTON).map(([E, n]) => ({ value: E, label: n })), h = H({
656
+ const t = e, n = P("props"), u = B(() => t.component?.type === d.ROW), r = B(() => Xe.includes(t.component?.type)), p = B(() => t.component?.props ? (Array.isArray(t.component.props.options) || (t.component.props.options = []), t.component.props.options) : []), i = Object.entries(zt).filter(([E]) => E !== d.BUTTON).map(([E, o]) => ({ value: E, label: o })), h = B({
553
657
  get: () => t.component?.type,
554
658
  set: (E) => {
555
- !E || !t.component || (t.component.type = E, t.component.props || (t.component.props = {}), Ke.includes(E) && !t.component.props.options?.length && (t.component.props.options = [
659
+ !E || !t.component || (t.component.type = E, t.component.props || (t.component.props = {}), Xe.includes(E) && !t.component.props.options?.length && (t.component.props.options = [
556
660
  { label: "选项1", value: "1" },
557
661
  { label: "选项2", value: "2" }
558
- ]), E === d.ROW && (t.component.props.columns || (t.component.props.columns = [{ span: 12 }, { span: 12 }]), t.component.children || (t.component.children = [[], []]), t.component.props.gutter = t.component.props.gutter || 20, at(t.component)));
662
+ ]), E === d.ROW && (t.component.props.columns || (t.component.props.columns = [{ span: 12 }, { span: 12 }]), t.component.children || (t.component.children = [[], []]), t.component.props.gutter = t.component.props.gutter || 20, it(t.component)));
559
663
  }
560
- }), b = P("100%"), N = P(100), D = () => {
561
- const E = t.component?.style?.width, n = ["100%", "50%", "33.33%", "25%"];
664
+ }), b = P("100%"), O = P(100), I = () => {
665
+ const E = t.component?.style?.width, o = ["100%", "50%", "33.33%", "25%"];
562
666
  if (!E) {
563
667
  b.value = "100%";
564
668
  return;
565
669
  }
566
- b.value = n.includes(E) ? E : "custom", b.value === "custom" && (N.value = It(E));
670
+ b.value = o.includes(E) ? E : "custom", b.value === "custom" && (O.value = Gt(E));
567
671
  };
568
- D(), Re(() => t.component?.id, D);
672
+ I(), ke(() => t.component?.id, I);
569
673
  const _ = (E) => {
570
- t.component && (t.component.style || (t.component.style = {}), E === "custom" ? t.component.style.width = `${N.value}%` : t.component.style.width = E);
571
- }, x = (E) => {
674
+ t.component && (t.component.style || (t.component.style = {}), E === "custom" ? t.component.style.width = `${O.value}%` : t.component.style.width = E);
675
+ }, V = (E) => {
572
676
  t.component && (t.component.style || (t.component.style = {}), t.component.style.width = `${E}%`);
573
- }, I = (E) => typeof E == "string" ? E : E.label, A = (E) => typeof E == "string" ? E : E.value, C = () => {
677
+ }, D = (E) => typeof E == "string" ? E : E.label, A = (E) => typeof E == "string" ? E : E.value, S = () => {
574
678
  p.value.push({ label: `选项${p.value.length + 1}`, value: `${p.value.length + 1}` });
575
- }, U = (E) => {
679
+ }, x = (E) => {
576
680
  p.value.splice(E, 1);
577
- }, le = () => {
681
+ }, ne = () => {
578
682
  const E = t.component.props.columns;
579
683
  E.push({ span: Math.max(1, Math.round(24 / (E.length + 1))) }), t.component.children || (t.component.children = []), t.component.children.push([]);
580
- }, re = (E) => {
684
+ }, ie = (E) => {
581
685
  t.component.props.columns.splice(E, 1), t.component.children?.splice(E, 1);
582
686
  }, K = async () => {
583
687
  const E = t.component?.props?.variableName;
584
688
  if (E)
585
689
  try {
586
- await navigator.clipboard.writeText(E), oe.success("字段名已复制");
690
+ await navigator.clipboard.writeText(E), ae.success("字段名已复制");
587
691
  } catch {
588
- oe.warning("复制失败");
692
+ ae.warning("复制失败");
589
693
  }
590
694
  }, q = () => {
591
- t.component && (t.component.props.variableName = `field_${Oe().split("_").pop()}`);
695
+ t.component && (t.component.props.variableName = `field_${Ae().split("_").pop()}`);
592
696
  };
593
- return (E, n) => {
594
- const Q = O("el-header"), F = O("el-option"), ee = O("el-select"), ne = O("el-input"), me = O("el-switch"), fe = O("el-divider"), se = O("el-input-number"), ce = O("el-button"), be = O("el-main"), Ae = O("el-container");
595
- return m(), V(Ae, { style: { height: "100%" } }, {
697
+ return (E, o) => {
698
+ const Q = N("el-header"), F = N("el-option"), te = N("el-select"), oe = N("el-input"), fe = N("el-switch"), ve = N("el-divider"), re = N("el-input-number"), pe = N("el-button"), Te = N("el-main"), _e = N("el-container");
699
+ return f(), k(_e, { style: { height: "100%" } }, {
596
700
  default: y(() => [
597
- f(Q, {
701
+ m(Q, {
598
702
  height: "40px",
599
703
  class: "_fc-r-tabs"
600
704
  }, {
601
705
  default: y(() => [
602
- e.component ? (m(), w("div", {
706
+ e.component ? (f(), w("div", {
603
707
  key: 0,
604
- class: $(["_fc-r-tab", { active: r.value === "props" }]),
605
- onClick: n[0] || (n[0] = (v) => r.value = "props")
606
- }, " 组件 ", 2)) : j("", !0),
607
- o("div", {
608
- class: $(["_fc-r-tab", { active: r.value === "form" || !e.component }]),
609
- onClick: n[1] || (n[1] = (v) => r.value = "form")
708
+ class: U(["_fc-r-tab", { active: n.value === "props" }]),
709
+ onClick: o[0] || (o[0] = (v) => n.value = "props")
710
+ }, " 组件 ", 2)) : W("", !0),
711
+ s("div", {
712
+ class: U(["_fc-r-tab", { active: n.value === "form" || !e.component }]),
713
+ onClick: o[1] || (o[1] = (v) => n.value = "form")
610
714
  }, " 表单 ", 2)
611
715
  ]),
612
716
  _: 1
613
717
  }),
614
- r.value === "props" && e.component ? (m(), V(be, {
718
+ n.value === "props" && e.component ? (f(), k(Te, {
615
719
  key: 0,
616
720
  class: "_fc-r-tab-props"
617
721
  }, {
618
722
  default: y(() => [
619
- o("div", {
723
+ s("div", {
620
724
  class: "_fc-r-tools-close",
621
- onClick: n[2] || (n[2] = (v) => E.$emit("close"))
622
- }, [...n[23] || (n[23] = [
623
- o("i", { class: "fc-icon icon-add2" }, null, -1)
725
+ onClick: o[2] || (o[2] = (v) => E.$emit("close"))
726
+ }, [...o[23] || (o[23] = [
727
+ s("i", { class: "fc-icon icon-add2" }, null, -1)
624
728
  ])]),
625
- n[38] || (n[38] = o("p", { class: "_fc-r-title" }, "组件类型", -1)),
626
- f(ee, {
729
+ o[38] || (o[38] = s("p", { class: "_fc-r-title" }, "组件类型", -1)),
730
+ m(te, {
627
731
  modelValue: h.value,
628
- "onUpdate:modelValue": n[3] || (n[3] = (v) => h.value = v),
732
+ "onUpdate:modelValue": o[3] || (o[3] = (v) => h.value = v),
629
733
  style: { width: "100%" }
630
734
  }, {
631
735
  default: y(() => [
632
- (m(!0), w(B, null, z(k(s), (v) => (m(), V(F, {
736
+ (f(!0), w(z, null, G(C(i), (v) => (f(), k(F, {
633
737
  key: v.value,
634
738
  label: v.label,
635
739
  value: v.value
@@ -637,21 +741,21 @@ const Xe = (e) => {
637
741
  ]),
638
742
  _: 1
639
743
  }, 8, ["modelValue"]),
640
- n[39] || (n[39] = o("p", { class: "_fc-r-title" }, "字段名", -1)),
641
- f(ne, {
744
+ o[39] || (o[39] = s("p", { class: "_fc-r-title" }, "字段名", -1)),
745
+ m(oe, {
642
746
  modelValue: e.component.props.variableName,
643
- "onUpdate:modelValue": n[4] || (n[4] = (v) => e.component.props.variableName = v),
747
+ "onUpdate:modelValue": o[4] || (o[4] = (v) => e.component.props.variableName = v),
644
748
  class: "_fc-r-name-input"
645
749
  }, {
646
750
  suffix: y(() => [
647
- o("i", {
751
+ s("i", {
648
752
  class: "fc-icon icon-group",
649
753
  title: "复制字段名",
650
754
  onClick: K
651
755
  })
652
756
  ]),
653
757
  append: y(() => [
654
- o("i", {
758
+ s("i", {
655
759
  class: "fc-icon icon-auto",
656
760
  title: "根据标题生成",
657
761
  onClick: q
@@ -659,71 +763,71 @@ const Xe = (e) => {
659
763
  ]),
660
764
  _: 1
661
765
  }, 8, ["modelValue"]),
662
- o("div", Gt, [
663
- o("div", zt, [
664
- n[24] || (n[24] = o("div", { class: "_fd-ci-label" }, "隐藏", -1)),
665
- o("div", jt, [
666
- f(me, {
766
+ s("div", Zt, [
767
+ s("div", el, [
768
+ o[24] || (o[24] = s("div", { class: "_fd-ci-label" }, "隐藏", -1)),
769
+ s("div", tl, [
770
+ m(fe, {
667
771
  modelValue: e.component.hidden,
668
- "onUpdate:modelValue": n[5] || (n[5] = (v) => e.component.hidden = v),
772
+ "onUpdate:modelValue": o[5] || (o[5] = (v) => e.component.hidden = v),
669
773
  size: "small"
670
774
  }, null, 8, ["modelValue"])
671
775
  ])
672
776
  ])
673
777
  ]),
674
- o("div", Ht, [
675
- o("div", Wt, [
676
- f(fe, null, {
677
- default: y(() => [...n[25] || (n[25] = [
778
+ s("div", ll, [
779
+ s("div", nl, [
780
+ m(ve, null, {
781
+ default: y(() => [...o[25] || (o[25] = [
678
782
  Y("规则", -1)
679
783
  ])]),
680
784
  _: 1
681
785
  }),
682
- u.value ? j("", !0) : (m(), w("div", qt, [
683
- o("div", Jt, [
684
- n[26] || (n[26] = o("div", { class: "_fd-ci-label" }, [
685
- o("span", null, "必填")
786
+ u.value ? W("", !0) : (f(), w("div", ol, [
787
+ s("div", al, [
788
+ o[26] || (o[26] = s("div", { class: "_fd-ci-label" }, [
789
+ s("span", null, "必填")
686
790
  ], -1)),
687
- o("div", Yt, [
688
- f(me, {
791
+ s("div", sl, [
792
+ m(fe, {
689
793
  modelValue: e.component.required,
690
- "onUpdate:modelValue": n[6] || (n[6] = (v) => e.component.required = v),
794
+ "onUpdate:modelValue": o[6] || (o[6] = (v) => e.component.required = v),
691
795
  size: "small"
692
796
  }, null, 8, ["modelValue"])
693
797
  ])
694
798
  ])
695
799
  ])),
696
- u.value ? j("", !0) : (m(), w("div", Kt, [
697
- o("div", Qt, [
698
- n[27] || (n[27] = o("div", { class: "_fd-ci-label" }, [
699
- o("span", null, "字段宽度")
800
+ u.value ? W("", !0) : (f(), w("div", il, [
801
+ s("div", rl, [
802
+ o[27] || (o[27] = s("div", { class: "_fd-ci-label" }, [
803
+ s("span", null, "字段宽度")
700
804
  ], -1)),
701
- o("div", Xt, [
702
- f(ee, {
805
+ s("div", ul, [
806
+ m(te, {
703
807
  modelValue: b.value,
704
- "onUpdate:modelValue": n[7] || (n[7] = (v) => b.value = v),
808
+ "onUpdate:modelValue": o[7] || (o[7] = (v) => b.value = v),
705
809
  size: "small",
706
810
  style: { width: "120px" },
707
811
  onChange: _
708
812
  }, {
709
813
  default: y(() => [
710
- f(F, {
814
+ m(F, {
711
815
  label: "整行",
712
816
  value: "100%"
713
817
  }),
714
- f(F, {
818
+ m(F, {
715
819
  label: "1/2",
716
820
  value: "50%"
717
821
  }),
718
- f(F, {
822
+ m(F, {
719
823
  label: "1/3",
720
824
  value: "33.33%"
721
825
  }),
722
- f(F, {
826
+ m(F, {
723
827
  label: "1/4",
724
828
  value: "25%"
725
829
  }),
726
- f(F, {
830
+ m(F, {
727
831
  label: "自定义",
728
832
  value: "custom"
729
833
  })
@@ -732,95 +836,95 @@ const Xe = (e) => {
732
836
  }, 8, ["modelValue"])
733
837
  ])
734
838
  ]),
735
- b.value === "custom" ? (m(), w("div", Zt, [
736
- f(se, {
737
- modelValue: N.value,
738
- "onUpdate:modelValue": n[8] || (n[8] = (v) => N.value = v),
839
+ b.value === "custom" ? (f(), w("div", dl, [
840
+ m(re, {
841
+ modelValue: O.value,
842
+ "onUpdate:modelValue": o[8] || (o[8] = (v) => O.value = v),
739
843
  min: 10,
740
844
  max: 100,
741
845
  step: 5,
742
846
  size: "small",
743
- onChange: x
847
+ onChange: V
744
848
  }, null, 8, ["modelValue"])
745
- ])) : j("", !0)
849
+ ])) : W("", !0)
746
850
  ])),
747
- u.value ? j("", !0) : (m(), w("div", el, [
748
- o("div", tl, [
749
- n[28] || (n[28] = o("div", { class: "_fd-ci-label" }, [
750
- o("span", null, "默认值")
851
+ u.value ? W("", !0) : (f(), w("div", cl, [
852
+ s("div", pl, [
853
+ o[28] || (o[28] = s("div", { class: "_fd-ci-label" }, [
854
+ s("span", null, "默认值")
751
855
  ], -1)),
752
- o("div", ll, [
753
- ["radio-group", "select"].includes(e.component.type) ? (m(), V(ee, {
856
+ s("div", ml, [
857
+ ["radio-group", "select"].includes(e.component.type) ? (f(), k(te, {
754
858
  key: 0,
755
859
  modelValue: e.component.defaultValue,
756
- "onUpdate:modelValue": n[9] || (n[9] = (v) => e.component.defaultValue = v),
860
+ "onUpdate:modelValue": o[9] || (o[9] = (v) => e.component.defaultValue = v),
757
861
  size: "small",
758
862
  clearable: "",
759
863
  style: { width: "180px" }
760
864
  }, {
761
865
  default: y(() => [
762
- (m(!0), w(B, null, z(p.value, (v) => (m(), V(F, {
866
+ (f(!0), w(z, null, G(p.value, (v) => (f(), k(F, {
763
867
  key: A(v),
764
- label: I(v),
868
+ label: D(v),
765
869
  value: A(v)
766
870
  }, null, 8, ["label", "value"]))), 128))
767
871
  ]),
768
872
  _: 1
769
- }, 8, ["modelValue"])) : e.component.type === "checkbox-group" ? (m(), V(ee, {
873
+ }, 8, ["modelValue"])) : e.component.type === "checkbox-group" ? (f(), k(te, {
770
874
  key: 1,
771
875
  modelValue: e.component.defaultValue,
772
- "onUpdate:modelValue": n[10] || (n[10] = (v) => e.component.defaultValue = v),
876
+ "onUpdate:modelValue": o[10] || (o[10] = (v) => e.component.defaultValue = v),
773
877
  size: "small",
774
878
  multiple: "",
775
879
  clearable: "",
776
880
  style: { width: "180px" }
777
881
  }, {
778
882
  default: y(() => [
779
- (m(!0), w(B, null, z(p.value, (v) => (m(), V(F, {
883
+ (f(!0), w(z, null, G(p.value, (v) => (f(), k(F, {
780
884
  key: A(v),
781
- label: I(v),
885
+ label: D(v),
782
886
  value: A(v)
783
887
  }, null, 8, ["label", "value"]))), 128))
784
888
  ]),
785
889
  _: 1
786
- }, 8, ["modelValue"])) : e.component.type === "switch" ? (m(), V(me, {
890
+ }, 8, ["modelValue"])) : e.component.type === "switch" ? (f(), k(fe, {
787
891
  key: 2,
788
892
  modelValue: e.component.defaultValue,
789
- "onUpdate:modelValue": n[11] || (n[11] = (v) => e.component.defaultValue = v),
893
+ "onUpdate:modelValue": o[11] || (o[11] = (v) => e.component.defaultValue = v),
790
894
  size: "small"
791
- }, null, 8, ["modelValue"])) : e.component.type === "date-picker" ? (m(), V(ee, {
895
+ }, null, 8, ["modelValue"])) : e.component.type === "date-picker" ? (f(), k(te, {
792
896
  key: 3,
793
897
  modelValue: e.component.defaultValue,
794
- "onUpdate:modelValue": n[12] || (n[12] = (v) => e.component.defaultValue = v),
898
+ "onUpdate:modelValue": o[12] || (o[12] = (v) => e.component.defaultValue = v),
795
899
  size: "small",
796
900
  clearable: "",
797
901
  style: { width: "120px" }
798
902
  }, {
799
903
  default: y(() => [
800
- f(F, {
904
+ m(F, {
801
905
  label: "今天",
802
906
  value: "today"
803
907
  }),
804
- f(F, {
908
+ m(F, {
805
909
  label: "明天",
806
910
  value: "tomorrow"
807
911
  }),
808
- f(F, {
912
+ m(F, {
809
913
  label: "无",
810
914
  value: ""
811
915
  })
812
916
  ]),
813
917
  _: 1
814
- }, 8, ["modelValue"])) : e.component.type === "input-number" ? (m(), V(se, {
918
+ }, 8, ["modelValue"])) : e.component.type === "input-number" ? (f(), k(re, {
815
919
  key: 4,
816
920
  modelValue: e.component.defaultValue,
817
- "onUpdate:modelValue": n[13] || (n[13] = (v) => e.component.defaultValue = v),
921
+ "onUpdate:modelValue": o[13] || (o[13] = (v) => e.component.defaultValue = v),
818
922
  size: "small",
819
923
  style: { width: "140px" }
820
- }, null, 8, ["modelValue"])) : (m(), V(ne, {
924
+ }, null, 8, ["modelValue"])) : (f(), k(oe, {
821
925
  key: 5,
822
926
  modelValue: e.component.defaultValue,
823
- "onUpdate:modelValue": n[14] || (n[14] = (v) => e.component.defaultValue = v),
927
+ "onUpdate:modelValue": o[14] || (o[14] = (v) => e.component.defaultValue = v),
824
928
  size: "small",
825
929
  style: { width: "180px" }
826
930
  }, null, 8, ["modelValue"]))
@@ -828,116 +932,116 @@ const Xe = (e) => {
828
932
  ])
829
933
  ]))
830
934
  ]),
831
- o("div", nl, [
832
- f(fe, null, {
833
- default: y(() => [...n[29] || (n[29] = [
935
+ s("div", fl, [
936
+ m(ve, null, {
937
+ default: y(() => [...o[29] || (o[29] = [
834
938
  Y("属性", -1)
835
939
  ])]),
836
940
  _: 1
837
941
  }),
838
- ["input", "textarea", "select"].includes(e.component.type) ? (m(), w("div", ol, [
839
- o("div", al, [
840
- n[30] || (n[30] = o("div", { class: "_fd-ci-label" }, [
841
- o("span", null, "提示文字")
942
+ ["input", "textarea", "select"].includes(e.component.type) ? (f(), w("div", vl, [
943
+ s("div", yl, [
944
+ o[30] || (o[30] = s("div", { class: "_fd-ci-label" }, [
945
+ s("span", null, "提示文字")
842
946
  ], -1)),
843
- o("div", rl, [
844
- f(ne, {
947
+ s("div", hl, [
948
+ m(oe, {
845
949
  modelValue: e.component.props.placeholder,
846
- "onUpdate:modelValue": n[15] || (n[15] = (v) => e.component.props.placeholder = v),
950
+ "onUpdate:modelValue": o[15] || (o[15] = (v) => e.component.props.placeholder = v),
847
951
  size: "small",
848
952
  style: { width: "180px" }
849
953
  }, null, 8, ["modelValue"])
850
954
  ])
851
955
  ])
852
- ])) : j("", !0),
853
- e.component.type === "input-number" ? (m(), w(B, { key: 1 }, [
854
- o("div", sl, [
855
- o("div", il, [
856
- n[31] || (n[31] = o("div", { class: "_fd-ci-label" }, [
857
- o("span", null, "最小值")
956
+ ])) : W("", !0),
957
+ e.component.type === "input-number" ? (f(), w(z, { key: 1 }, [
958
+ s("div", bl, [
959
+ s("div", gl, [
960
+ o[31] || (o[31] = s("div", { class: "_fd-ci-label" }, [
961
+ s("span", null, "最小值")
858
962
  ], -1)),
859
- o("div", ul, [
860
- f(se, {
963
+ s("div", Tl, [
964
+ m(re, {
861
965
  modelValue: e.component.min,
862
- "onUpdate:modelValue": n[16] || (n[16] = (v) => e.component.min = v),
966
+ "onUpdate:modelValue": o[16] || (o[16] = (v) => e.component.min = v),
863
967
  size: "small",
864
968
  style: { width: "140px" }
865
969
  }, null, 8, ["modelValue"])
866
970
  ])
867
971
  ])
868
972
  ]),
869
- o("div", dl, [
870
- o("div", cl, [
871
- n[32] || (n[32] = o("div", { class: "_fd-ci-label" }, [
872
- o("span", null, "最大值")
973
+ s("div", El, [
974
+ s("div", Nl, [
975
+ o[32] || (o[32] = s("div", { class: "_fd-ci-label" }, [
976
+ s("span", null, "最大值")
873
977
  ], -1)),
874
- o("div", pl, [
875
- f(se, {
978
+ s("div", Ol, [
979
+ m(re, {
876
980
  modelValue: e.component.max,
877
- "onUpdate:modelValue": n[17] || (n[17] = (v) => e.component.max = v),
981
+ "onUpdate:modelValue": o[17] || (o[17] = (v) => e.component.max = v),
878
982
  size: "small",
879
983
  style: { width: "140px" }
880
984
  }, null, 8, ["modelValue"])
881
985
  ])
882
986
  ])
883
987
  ])
884
- ], 64)) : j("", !0),
885
- i.value ? (m(), w("div", ml, [
886
- n[34] || (n[34] = o("div", { class: "_fd-ci-head" }, [
887
- o("div", { class: "_fd-ci-label" }, [
888
- o("span", null, "选项配置")
988
+ ], 64)) : W("", !0),
989
+ r.value ? (f(), w("div", Al, [
990
+ o[34] || (o[34] = s("div", { class: "_fd-ci-head" }, [
991
+ s("div", { class: "_fd-ci-label" }, [
992
+ s("span", null, "选项配置")
889
993
  ])
890
994
  ], -1)),
891
- o("div", fl, [
892
- (m(!0), w(B, null, z(p.value, (v, ue) => (m(), w("div", {
893
- key: ue,
995
+ s("div", wl, [
996
+ (f(!0), w(z, null, G(p.value, (v, de) => (f(), w("div", {
997
+ key: de,
894
998
  class: "gb-fc-option"
895
999
  }, [
896
- f(ne, {
1000
+ m(oe, {
897
1001
  modelValue: v.label,
898
- "onUpdate:modelValue": (ie) => v.label = ie,
1002
+ "onUpdate:modelValue": (ue) => v.label = ue,
899
1003
  size: "small",
900
1004
  placeholder: "选项名称"
901
1005
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
902
- f(ne, {
1006
+ m(oe, {
903
1007
  modelValue: v.value,
904
- "onUpdate:modelValue": (ie) => v.value = ie,
1008
+ "onUpdate:modelValue": (ue) => v.value = ue,
905
1009
  size: "small",
906
1010
  placeholder: "选项值"
907
1011
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
908
- f(ce, {
1012
+ m(pe, {
909
1013
  type: "danger",
910
1014
  plain: "",
911
1015
  size: "small",
912
- icon: k(Je),
913
- onClick: (ie) => U(ue)
1016
+ icon: C(Ke),
1017
+ onClick: (ue) => x(de)
914
1018
  }, null, 8, ["icon", "onClick"])
915
1019
  ]))), 128)),
916
- f(ce, {
1020
+ m(pe, {
917
1021
  type: "primary",
918
1022
  plain: "",
919
1023
  size: "small",
920
- icon: k(Ye),
1024
+ icon: C(Qe),
921
1025
  style: { width: "100%" },
922
- onClick: C
1026
+ onClick: S
923
1027
  }, {
924
- default: y(() => [...n[33] || (n[33] = [
1028
+ default: y(() => [...o[33] || (o[33] = [
925
1029
  Y(" 添加选项 ", -1)
926
1030
  ])]),
927
1031
  _: 1
928
1032
  }, 8, ["icon"])
929
1033
  ])
930
- ])) : j("", !0),
931
- u.value ? (m(), w(B, { key: 3 }, [
932
- o("div", vl, [
933
- o("div", yl, [
934
- n[35] || (n[35] = o("div", { class: "_fd-ci-label" }, [
935
- o("span", null, "列间距")
1034
+ ])) : W("", !0),
1035
+ u.value ? (f(), w(z, { key: 3 }, [
1036
+ s("div", _l, [
1037
+ s("div", Rl, [
1038
+ o[35] || (o[35] = s("div", { class: "_fd-ci-label" }, [
1039
+ s("span", null, "列间距")
936
1040
  ], -1)),
937
- o("div", hl, [
938
- f(se, {
1041
+ s("div", Cl, [
1042
+ m(re, {
939
1043
  modelValue: e.component.props.gutter,
940
- "onUpdate:modelValue": n[18] || (n[18] = (v) => e.component.props.gutter = v),
1044
+ "onUpdate:modelValue": o[18] || (o[18] = (v) => e.component.props.gutter = v),
941
1045
  min: 0,
942
1046
  max: 100,
943
1047
  size: "small",
@@ -946,132 +1050,132 @@ const Xe = (e) => {
946
1050
  ])
947
1051
  ])
948
1052
  ]),
949
- o("div", bl, [
950
- n[37] || (n[37] = o("div", { class: "_fd-ci-head" }, [
951
- o("div", { class: "_fd-ci-label" }, [
952
- o("span", null, "列配置")
1053
+ s("div", kl, [
1054
+ o[37] || (o[37] = s("div", { class: "_fd-ci-head" }, [
1055
+ s("div", { class: "_fd-ci-label" }, [
1056
+ s("span", null, "列配置")
953
1057
  ])
954
1058
  ], -1)),
955
- o("div", gl, [
956
- (m(!0), w(B, null, z(e.component.props.columns, (v, ue) => (m(), w("div", {
957
- key: ue,
1059
+ s("div", Vl, [
1060
+ (f(!0), w(z, null, G(e.component.props.columns, (v, de) => (f(), w("div", {
1061
+ key: de,
958
1062
  class: "gb-fc-option"
959
1063
  }, [
960
- o("span", Tl, "第" + ae(ue + 1) + "列", 1),
961
- f(se, {
1064
+ s("span", Sl, "第" + se(de + 1) + "列", 1),
1065
+ m(re, {
962
1066
  modelValue: v.span,
963
- "onUpdate:modelValue": (ie) => v.span = ie,
1067
+ "onUpdate:modelValue": (ue) => v.span = ue,
964
1068
  min: 1,
965
1069
  max: 24,
966
1070
  size: "small"
967
1071
  }, null, 8, ["modelValue", "onUpdate:modelValue"]),
968
- f(ce, {
1072
+ m(pe, {
969
1073
  type: "danger",
970
1074
  plain: "",
971
1075
  size: "small",
972
- icon: k(Je),
1076
+ icon: C(Ke),
973
1077
  disabled: (e.component.props.columns || []).length <= 1,
974
- onClick: (ie) => re(ue)
1078
+ onClick: (ue) => ie(de)
975
1079
  }, null, 8, ["icon", "disabled", "onClick"])
976
1080
  ]))), 128)),
977
- f(ce, {
1081
+ m(pe, {
978
1082
  type: "primary",
979
1083
  plain: "",
980
1084
  size: "small",
981
- icon: k(Ye),
1085
+ icon: C(Qe),
982
1086
  style: { width: "100%" },
983
- onClick: le
1087
+ onClick: ne
984
1088
  }, {
985
- default: y(() => [...n[36] || (n[36] = [
1089
+ default: y(() => [...o[36] || (o[36] = [
986
1090
  Y(" 添加列 ", -1)
987
1091
  ])]),
988
1092
  _: 1
989
1093
  }, 8, ["icon"])
990
1094
  ])
991
1095
  ])
992
- ], 64)) : j("", !0)
1096
+ ], 64)) : W("", !0)
993
1097
  ])
994
1098
  ])
995
1099
  ]),
996
1100
  _: 1
997
- })) : j("", !0),
998
- pe(f(be, { class: "_fc-r-tab-form" }, {
1101
+ })) : W("", !0),
1102
+ me(m(Te, { class: "_fc-r-tab-form" }, {
999
1103
  default: y(() => [
1000
- o("div", El, [
1001
- o("div", Ol, [
1002
- f(fe, null, {
1003
- default: y(() => [...n[40] || (n[40] = [
1104
+ s("div", Dl, [
1105
+ s("div", Il, [
1106
+ m(ve, null, {
1107
+ default: y(() => [...o[40] || (o[40] = [
1004
1108
  Y("表单配置", -1)
1005
1109
  ])]),
1006
1110
  _: 1
1007
1111
  }),
1008
- o("div", Nl, [
1009
- o("div", Al, [
1010
- n[41] || (n[41] = o("div", { class: "_fd-ci-label" }, [
1011
- o("span", null, "表单名称")
1112
+ s("div", $l, [
1113
+ s("div", xl, [
1114
+ o[41] || (o[41] = s("div", { class: "_fd-ci-label" }, [
1115
+ s("span", null, "表单名称")
1012
1116
  ], -1)),
1013
- o("div", wl, [
1014
- f(ne, {
1117
+ s("div", Ul, [
1118
+ m(oe, {
1015
1119
  modelValue: e.formOptions.name,
1016
- "onUpdate:modelValue": n[19] || (n[19] = (v) => e.formOptions.name = v),
1120
+ "onUpdate:modelValue": o[19] || (o[19] = (v) => e.formOptions.name = v),
1017
1121
  size: "small",
1018
1122
  style: { width: "180px" }
1019
1123
  }, null, 8, ["modelValue"])
1020
1124
  ])
1021
1125
  ])
1022
1126
  ]),
1023
- o("div", _l, [
1024
- o("div", Rl, [
1025
- n[42] || (n[42] = o("div", { class: "_fd-ci-label" }, [
1026
- o("span", null, "表单描述")
1127
+ s("div", Pl, [
1128
+ s("div", Ml, [
1129
+ o[42] || (o[42] = s("div", { class: "_fd-ci-label" }, [
1130
+ s("span", null, "表单描述")
1027
1131
  ], -1)),
1028
- o("div", Cl, [
1029
- f(ne, {
1132
+ s("div", Ll, [
1133
+ m(oe, {
1030
1134
  modelValue: e.formOptions.description,
1031
- "onUpdate:modelValue": n[20] || (n[20] = (v) => e.formOptions.description = v),
1135
+ "onUpdate:modelValue": o[20] || (o[20] = (v) => e.formOptions.description = v),
1032
1136
  size: "small",
1033
1137
  style: { width: "180px" }
1034
1138
  }, null, 8, ["modelValue"])
1035
1139
  ])
1036
1140
  ])
1037
1141
  ]),
1038
- o("div", Vl, [
1039
- o("div", xl, [
1040
- n[43] || (n[43] = o("div", { class: "_fd-ci-label" }, [
1041
- o("span", null, "标签宽度")
1142
+ s("div", Fl, [
1143
+ s("div", zl, [
1144
+ o[43] || (o[43] = s("div", { class: "_fd-ci-label" }, [
1145
+ s("span", null, "标签宽度")
1042
1146
  ], -1)),
1043
- o("div", kl, [
1044
- f(ne, {
1147
+ s("div", jl, [
1148
+ m(oe, {
1045
1149
  modelValue: e.formOptions.labelWidth,
1046
- "onUpdate:modelValue": n[21] || (n[21] = (v) => e.formOptions.labelWidth = v),
1150
+ "onUpdate:modelValue": o[21] || (o[21] = (v) => e.formOptions.labelWidth = v),
1047
1151
  size: "small",
1048
1152
  style: { width: "120px" }
1049
1153
  }, null, 8, ["modelValue"])
1050
1154
  ])
1051
1155
  ])
1052
1156
  ]),
1053
- o("div", Il, [
1054
- o("div", Dl, [
1055
- n[44] || (n[44] = o("div", { class: "_fd-ci-label" }, [
1056
- o("span", null, "组件尺寸")
1157
+ s("div", Gl, [
1158
+ s("div", Wl, [
1159
+ o[44] || (o[44] = s("div", { class: "_fd-ci-label" }, [
1160
+ s("span", null, "组件尺寸")
1057
1161
  ], -1)),
1058
- o("div", Sl, [
1059
- f(ee, {
1162
+ s("div", Bl, [
1163
+ m(te, {
1060
1164
  modelValue: e.formOptions.size,
1061
- "onUpdate:modelValue": n[22] || (n[22] = (v) => e.formOptions.size = v),
1165
+ "onUpdate:modelValue": o[22] || (o[22] = (v) => e.formOptions.size = v),
1062
1166
  size: "small",
1063
1167
  style: { width: "120px" }
1064
1168
  }, {
1065
1169
  default: y(() => [
1066
- f(F, {
1170
+ m(F, {
1067
1171
  label: "较大",
1068
1172
  value: "large"
1069
1173
  }),
1070
- f(F, {
1174
+ m(F, {
1071
1175
  label: "默认",
1072
1176
  value: "default"
1073
1177
  }),
1074
- f(F, {
1178
+ m(F, {
1075
1179
  label: "较小",
1076
1180
  value: "small"
1077
1181
  })
@@ -1086,17 +1190,17 @@ const Xe = (e) => {
1086
1190
  ]),
1087
1191
  _: 1
1088
1192
  }, 512), [
1089
- [he, r.value === "form" || !e.component]
1193
+ [be, n.value === "form" || !e.component]
1090
1194
  ])
1091
1195
  ]),
1092
1196
  _: 1
1093
1197
  });
1094
1198
  };
1095
1199
  }
1096
- }), $l = { class: "_fc-json-preview-down" }, Pl = {
1200
+ }), ql = { class: "_fc-json-preview-down" }, Jl = {
1097
1201
  key: 0,
1098
1202
  class: "gb-fc-json-error"
1099
- }, Ll = /* @__PURE__ */ Object.assign({ name: "FcJsonPanel" }, {
1203
+ }, Yl = /* @__PURE__ */ Object.assign({ name: "FcJsonPanel" }, {
1100
1204
  __name: "FcJsonPanel",
1101
1205
  props: {
1102
1206
  components: { type: Array, required: !0 },
@@ -1105,57 +1209,57 @@ const Xe = (e) => {
1105
1209
  },
1106
1210
  emits: ["update:components", "update:formOptions"],
1107
1211
  setup(e, { expose: l, emit: t }) {
1108
- const r = e, u = t, i = P("rule"), p = P(JSON.stringify(r.components, null, 2)), s = P("");
1212
+ const n = e, u = t, r = P("rule"), p = P(JSON.stringify(n.components, null, 2)), i = P("");
1109
1213
  let h = "";
1110
- const b = () => i.value === "rule" ? JSON.stringify(r.components, null, 2) : JSON.stringify(r.formOptions, null, 2), N = (I) => {
1111
- i.value = I, p.value = b(), s.value = "";
1112
- }, D = () => {
1214
+ const b = () => r.value === "rule" ? JSON.stringify(n.components, null, 2) : JSON.stringify(n.formOptions, null, 2), O = (D) => {
1215
+ r.value = D, p.value = b(), i.value = "";
1216
+ }, I = () => {
1113
1217
  h = b();
1114
1218
  }, _ = () => {
1115
- if (s.value = "", p.value.trim() !== h.trim())
1219
+ if (i.value = "", p.value.trim() !== h.trim())
1116
1220
  try {
1117
- const I = JSON.parse(p.value);
1118
- if (i.value === "rule") {
1119
- if (!Array.isArray(I)) throw new Error("表单规则必须是数组");
1120
- u("update:components", I);
1221
+ const D = JSON.parse(p.value);
1222
+ if (r.value === "rule") {
1223
+ if (!Array.isArray(D)) throw new Error("表单规则必须是数组");
1224
+ u("update:components", D);
1121
1225
  } else
1122
- u("update:formOptions", I || {});
1123
- oe.success("JSON 已应用");
1124
- } catch (I) {
1125
- s.value = `JSON 解析失败:${I.message}`;
1226
+ u("update:formOptions", D || {});
1227
+ ae.success("JSON 已应用");
1228
+ } catch (D) {
1229
+ i.value = `JSON 解析失败:${D.message}`;
1126
1230
  }
1127
- }, x = () => {
1128
- const I = i.value === "rule" ? { rule: r.components, options: r.formOptions } : { options: r.formOptions, rule: r.components }, A = new Blob([JSON.stringify(I, null, 2)], { type: "application/json" }), C = URL.createObjectURL(A), U = document.createElement("a");
1129
- U.href = C, U.download = `fc-json-${Date.now()}.json`, U.click(), setTimeout(() => URL.revokeObjectURL(C), 0);
1231
+ }, V = () => {
1232
+ const D = r.value === "rule" ? { rule: n.components, options: n.formOptions } : { options: n.formOptions, rule: n.components }, A = new Blob([JSON.stringify(D, null, 2)], { type: "application/json" }), S = URL.createObjectURL(A), x = document.createElement("a");
1233
+ x.href = S, x.download = `fc-json-${Date.now()}.json`, x.click(), setTimeout(() => URL.revokeObjectURL(S), 0);
1130
1234
  };
1131
- return l({ refresh: () => p.value = b() }), (I, A) => {
1132
- const C = O("el-tooltip"), U = O("el-header"), le = O("el-main"), re = O("el-container");
1133
- return m(), V(re, { class: "_fc-json-preview" }, {
1235
+ return l({ refresh: () => p.value = b() }), (D, A) => {
1236
+ const S = N("el-tooltip"), x = N("el-header"), ne = N("el-main"), ie = N("el-container");
1237
+ return f(), k(ie, { class: "_fc-json-preview" }, {
1134
1238
  default: y(() => [
1135
- f(U, {
1239
+ m(x, {
1136
1240
  height: "40px",
1137
1241
  class: "_fc-l-tabs"
1138
1242
  }, {
1139
1243
  default: y(() => [
1140
- o("div", {
1141
- class: $(["_fc-l-tab", { active: i.value === "rule" }]),
1142
- onClick: A[0] || (A[0] = (K) => N("rule"))
1244
+ s("div", {
1245
+ class: U(["_fc-l-tab", { active: r.value === "rule" }]),
1246
+ onClick: A[0] || (A[0] = (K) => O("rule"))
1143
1247
  }, "表单规则", 2),
1144
- o("div", {
1145
- class: $(["_fc-l-tab", { active: i.value === "options" }]),
1146
- onClick: A[1] || (A[1] = (K) => N("options"))
1248
+ s("div", {
1249
+ class: U(["_fc-l-tab", { active: r.value === "options" }]),
1250
+ onClick: A[1] || (A[1] = (K) => O("options"))
1147
1251
  }, "表单配置", 2),
1148
- o("div", $l, [
1149
- f(C, {
1252
+ s("div", ql, [
1253
+ m(S, {
1150
1254
  effect: "dark",
1151
1255
  content: "导出 JSON",
1152
1256
  placement: "top",
1153
1257
  "hide-after": 0
1154
1258
  }, {
1155
1259
  default: y(() => [
1156
- o("i", {
1260
+ s("i", {
1157
1261
  class: "fc-icon icon-download",
1158
- onClick: x
1262
+ onClick: V
1159
1263
  })
1160
1264
  ]),
1161
1265
  _: 1
@@ -1164,18 +1268,18 @@ const Xe = (e) => {
1164
1268
  ]),
1165
1269
  _: 1
1166
1270
  }),
1167
- f(le, { style: { padding: "8px" } }, {
1271
+ m(ne, { style: { padding: "8px" } }, {
1168
1272
  default: y(() => [
1169
- pe(o("textarea", {
1273
+ me(s("textarea", {
1170
1274
  "onUpdate:modelValue": A[2] || (A[2] = (K) => p.value = K),
1171
1275
  class: "gb-fc-json-editor",
1172
1276
  spellcheck: "false",
1173
- onFocus: D,
1277
+ onFocus: I,
1174
1278
  onBlur: _
1175
1279
  }, null, 544), [
1176
- [_t, p.value]
1280
+ [Ct, p.value]
1177
1281
  ]),
1178
- s.value ? (m(), w("div", Pl, ae(s.value), 1)) : j("", !0)
1282
+ i.value ? (f(), w("div", Jl, se(i.value), 1)) : W("", !0)
1179
1283
  ]),
1180
1284
  _: 1
1181
1285
  })
@@ -1185,101 +1289,101 @@ const Xe = (e) => {
1185
1289
  };
1186
1290
  }
1187
1291
  });
1188
- function Ml() {
1189
- const e = (i) => {
1190
- Z(i);
1292
+ function Kl() {
1293
+ const e = (r) => {
1294
+ Z(r);
1191
1295
  const p = [];
1192
- if (i.required) {
1193
- const s = i.type === d.CHECKBOX_GROUP, h = i.type === d.RADIO_GROUP || i.type === d.SELECT;
1296
+ if (r.required) {
1297
+ const i = r.type === d.CHECKBOX_GROUP, h = r.type === d.RADIO_GROUP || r.type === d.SELECT;
1194
1298
  p.push({
1195
1299
  required: !0,
1196
- ...s ? { type: "array" } : {},
1197
- message: s || h ? `请选择${i.props?.label || "该字段"}` : `请输入${i.props?.label || "该字段"}`,
1198
- trigger: h || s ? "change" : "blur"
1300
+ ...i ? { type: "array" } : {},
1301
+ message: i || h ? `请选择${r.props?.label || "该字段"}` : `请输入${r.props?.label || "该字段"}`,
1302
+ trigger: h || i ? "change" : "blur"
1199
1303
  });
1200
1304
  }
1201
- return i.type === d.INPUT_NUMBER && (i.min !== void 0 && p.push({
1305
+ return r.type === d.INPUT_NUMBER && (r.min !== void 0 && p.push({
1202
1306
  type: "number",
1203
- min: i.min,
1204
- message: `数值不能小于 ${i.min}`,
1307
+ min: r.min,
1308
+ message: `数值不能小于 ${r.min}`,
1205
1309
  trigger: "blur"
1206
- }), i.max !== void 0 && p.push({
1310
+ }), r.max !== void 0 && p.push({
1207
1311
  type: "number",
1208
- max: i.max,
1209
- message: `数值不能大于 ${i.max}`,
1312
+ max: r.max,
1313
+ message: `数值不能大于 ${r.max}`,
1210
1314
  trigger: "blur"
1211
1315
  })), p.length > 0 ? p : void 0;
1212
1316
  };
1213
1317
  return {
1214
- generateFormRules: (i) => {
1215
- const p = {}, s = {}, h = (b) => {
1318
+ generateFormRules: (r) => {
1319
+ const p = {}, i = {}, h = (b) => {
1216
1320
  if (b.type === d.ROW) {
1217
1321
  b.children && b.children.forEach((_) => {
1218
- Array.isArray(_) && _.forEach((x) => {
1219
- h(x);
1322
+ Array.isArray(_) && _.forEach((V) => {
1323
+ h(V);
1220
1324
  });
1221
1325
  });
1222
1326
  return;
1223
1327
  }
1224
- const N = Z(b), D = e(b);
1225
- if (D && (s[N] = D), !(N in p))
1328
+ const O = Z(b), I = e(b);
1329
+ if (I && (i[O] = I), !(O in p))
1226
1330
  if (b.defaultValue !== void 0 && b.defaultValue !== null)
1227
1331
  if (b.type === d.DATE_PICKER) {
1228
1332
  const _ = b.defaultValue;
1229
1333
  if (_ === "today")
1230
- p[N] = /* @__PURE__ */ new Date();
1334
+ p[O] = /* @__PURE__ */ new Date();
1231
1335
  else if (_ === "tomorrow") {
1232
- const x = /* @__PURE__ */ new Date();
1233
- x.setDate(x.getDate() + 1), p[N] = x;
1336
+ const V = /* @__PURE__ */ new Date();
1337
+ V.setDate(V.getDate() + 1), p[O] = V;
1234
1338
  } else
1235
- p[N] = _;
1339
+ p[O] = _;
1236
1340
  } else
1237
- p[N] = b.defaultValue;
1341
+ p[O] = b.defaultValue;
1238
1342
  else
1239
- b.type === d.INPUT_NUMBER ? p[N] = null : b.type === d.RADIO_GROUP || b.type === d.SELECT || b.type === d.TEXTAREA ? p[N] = "" : b.type === d.DATE_PICKER ? p[N] = null : b.type === d.CHECKBOX_GROUP ? p[N] = [] : b.type === d.SWITCH ? p[N] = !1 : p[N] = "";
1343
+ b.type === d.INPUT_NUMBER ? p[O] = null : b.type === d.RADIO_GROUP || b.type === d.SELECT || b.type === d.TEXTAREA ? p[O] = "" : b.type === d.DATE_PICKER ? p[O] = null : b.type === d.CHECKBOX_GROUP ? p[O] = [] : b.type === d.SWITCH ? p[O] = !1 : p[O] = "";
1240
1344
  };
1241
- return Array.isArray(i) && i.forEach((b) => {
1345
+ return Array.isArray(r) && r.forEach((b) => {
1242
1346
  h(b);
1243
- }), { data: p, rules: s };
1347
+ }), { data: p, rules: i };
1244
1348
  },
1245
- validateForm: async (i) => {
1246
- if (!i)
1349
+ validateForm: async (r) => {
1350
+ if (!r)
1247
1351
  throw new Error("表单引用不存在");
1248
- return await i.validate();
1352
+ return await r.validate();
1249
1353
  },
1250
- resetForm: (i) => {
1251
- i && i.resetFields();
1354
+ resetForm: (r) => {
1355
+ r && r.resetFields();
1252
1356
  },
1253
- getFormData: (i, p) => {
1254
- const s = {}, h = (b) => {
1357
+ getFormData: (r, p) => {
1358
+ const i = {}, h = (b) => {
1255
1359
  if (b.type === d.ROW) {
1256
- b.children && b.children.forEach((D) => {
1257
- Array.isArray(D) && D.forEach((_) => {
1360
+ b.children && b.children.forEach((I) => {
1361
+ Array.isArray(I) && I.forEach((_) => {
1258
1362
  h(_);
1259
1363
  });
1260
1364
  });
1261
1365
  return;
1262
1366
  }
1263
- const N = Z(b);
1264
- N in i && (s[N] = {
1367
+ const O = Z(b);
1368
+ O in r && (i[O] = {
1265
1369
  name: b.props?.label || "",
1266
- value: i[N],
1370
+ value: r[O],
1267
1371
  type: b.type
1268
1372
  });
1269
1373
  };
1270
1374
  return Array.isArray(p) && p.forEach((b) => {
1271
1375
  h(b);
1272
- }), s;
1376
+ }), i;
1273
1377
  }
1274
1378
  };
1275
1379
  }
1276
- const Fl = { class: "form-view-container" }, Bl = { class: "form-view-content" }, Gl = ["data-width"], zl = {
1380
+ const Ql = { class: "form-view-container" }, Xl = { class: "form-view-content" }, Zl = ["data-width"], en = {
1277
1381
  key: 1,
1278
1382
  class: "empty-state"
1279
- }, jl = {
1383
+ }, tn = {
1280
1384
  key: 0,
1281
1385
  class: "form-result"
1282
- }, Hl = /* @__PURE__ */ Object.assign({ name: "GbFormViewer" }, {
1386
+ }, ln = /* @__PURE__ */ Object.assign({ name: "GbFormViewer" }, {
1283
1387
  __name: "FormViewer",
1284
1388
  props: {
1285
1389
  formConfig: {
@@ -1296,168 +1400,168 @@ const Fl = { class: "form-view-container" }, Bl = { class: "form-view-content" }
1296
1400
  }
1297
1401
  },
1298
1402
  setup(e, { expose: l }) {
1299
- const t = e, r = P(null), u = Te({}), i = Te({}), p = P(!1), { generateFormRules: s } = Ml(), h = (D) => {
1300
- if (D.type === d.ROW)
1403
+ const t = e, n = P(null), u = Ne({}), r = Ne({}), p = P(!1), { generateFormRules: i } = Kl(), h = (I) => {
1404
+ if (I.type === d.ROW)
1301
1405
  return { width: "100%" };
1302
- if (D.style?.width) {
1303
- const _ = D.style.width;
1304
- let x = _;
1305
- return typeof _ == "string" && _.includes("%") ? x = _ : typeof _ == "number" && (x = `${_}%`), {
1306
- width: x,
1307
- "--item-width": x
1406
+ if (I.style?.width) {
1407
+ const _ = I.style.width;
1408
+ let V = _;
1409
+ return typeof _ == "string" && _.includes("%") ? V = _ : typeof _ == "number" && (V = `${_}%`), {
1410
+ width: V,
1411
+ "--item-width": V
1308
1412
  };
1309
1413
  }
1310
1414
  return { width: "100%" };
1311
1415
  }, b = () => {
1312
- Object.keys(u).forEach((x) => delete u[x]), Object.keys(i).forEach((x) => delete i[x]);
1313
- const { data: D, rules: _ } = s(t.formConfig);
1314
- Object.assign(u, D), Object.assign(i, _);
1416
+ Object.keys(u).forEach((V) => delete u[V]), Object.keys(r).forEach((V) => delete r[V]);
1417
+ const { data: I, rules: _ } = i(t.formConfig);
1418
+ Object.assign(u, I), Object.assign(r, _);
1315
1419
  };
1316
- Re(() => t.formConfig, () => {
1420
+ ke(() => t.formConfig, () => {
1317
1421
  b();
1318
1422
  }, { immediate: !0, deep: !0 });
1319
- const N = (D, _) => {
1320
- u[D] = _;
1423
+ const O = (I, _) => {
1424
+ u[I] = _;
1321
1425
  };
1322
1426
  return l({
1323
1427
  formData: u,
1324
- formRef: r,
1325
- formRules: i
1326
- }), (D, _) => {
1327
- const x = O("el-form"), I = O("el-empty"), A = O("el-divider");
1328
- return m(), w("div", Fl, [
1329
- o("div", Bl, [
1330
- e.formConfig && e.formConfig.length > 0 ? (m(), V(x, {
1428
+ formRef: n,
1429
+ formRules: r
1430
+ }), (I, _) => {
1431
+ const V = N("el-form"), D = N("el-empty"), A = N("el-divider");
1432
+ return f(), w("div", Ql, [
1433
+ s("div", Xl, [
1434
+ e.formConfig && e.formConfig.length > 0 ? (f(), k(V, {
1331
1435
  key: 0,
1332
1436
  ref_key: "formRef",
1333
- ref: r,
1437
+ ref: n,
1334
1438
  model: u,
1335
- rules: i,
1439
+ rules: r,
1336
1440
  disabled: e.readonly,
1337
1441
  "label-width": "120px",
1338
1442
  class: "form-wrapper"
1339
1443
  }, {
1340
1444
  default: y(() => [
1341
- (m(!0), w(B, null, z(e.formConfig, (C, U) => (m(), w("div", {
1342
- key: U,
1343
- class: $(["form-item-wrapper", { "is-row": C.type === k(d).ROW }]),
1344
- style: Rt(h(C)),
1345
- "data-width": C.style?.width
1445
+ (f(!0), w(z, null, G(e.formConfig, (S, x) => (f(), w("div", {
1446
+ key: x,
1447
+ class: U(["form-item-wrapper", { "is-row": S.type === C(d).ROW }]),
1448
+ style: kt(h(S)),
1449
+ "data-width": S.style?.width
1346
1450
  }, [
1347
- f(it, {
1348
- component: C,
1451
+ m(dt, {
1452
+ component: S,
1349
1453
  "form-data": u,
1350
- "form-rules": i,
1454
+ "form-rules": r,
1351
1455
  readonly: e.readonly,
1352
- "onUpdate:value": N
1456
+ "onUpdate:value": O
1353
1457
  }, null, 8, ["component", "form-data", "form-rules", "readonly"])
1354
- ], 14, Gl))), 128))
1458
+ ], 14, Zl))), 128))
1355
1459
  ]),
1356
1460
  _: 1
1357
- }, 8, ["model", "rules", "disabled"])) : (m(), w("div", zl, [
1358
- f(I, { description: "暂无表单配置,请先设计表单" })
1461
+ }, 8, ["model", "rules", "disabled"])) : (f(), w("div", en, [
1462
+ m(D, { description: "暂无表单配置,请先设计表单" })
1359
1463
  ]))
1360
1464
  ]),
1361
- p.value ? (m(), w("div", jl, [
1362
- f(A, null, {
1465
+ p.value ? (f(), w("div", tn, [
1466
+ m(A, null, {
1363
1467
  default: y(() => [..._[0] || (_[0] = [
1364
1468
  Y("提交结果", -1)
1365
1469
  ])]),
1366
1470
  _: 1
1367
1471
  }),
1368
- o("pre", null, ae(JSON.stringify(u, null, 2)), 1)
1369
- ])) : j("", !0)
1472
+ s("pre", null, se(JSON.stringify(u, null, 2)), 1)
1473
+ ])) : W("", !0)
1370
1474
  ]);
1371
1475
  };
1372
1476
  }
1373
- }), ut = /* @__PURE__ */ st(Hl, [["__scopeId", "data-v-d4573d59"]]), J = (e) => String(e ?? "").replace(/"/g, "&quot;");
1374
- function Wl(e) {
1375
- const l = [], t = e.props?.label || "", r = e.props?.variableName || "";
1376
- return t && l.push(`label="${J(t)}"`), r && l.push(`prop="${J(r)}"`), e.required && l.push("required"), l.join(" ");
1477
+ }), ct = /* @__PURE__ */ ut(ln, [["__scopeId", "data-v-806779a4"]]), J = (e) => String(e ?? "").replace(/"/g, "&quot;");
1478
+ function nn(e) {
1479
+ const l = [], t = e.props?.label || "", n = e.props?.variableName || "";
1480
+ return t && l.push(`label="${J(t)}"`), n && l.push(`prop="${J(n)}"`), e.required && l.push("required"), l.join(" ");
1377
1481
  }
1378
- function Ze(e, l) {
1379
- const t = " ".repeat(l), r = Wl(e), u = e.props?.variableName || "", i = [];
1482
+ function tt(e, l) {
1483
+ const t = " ".repeat(l), n = nn(e), u = e.props?.variableName || "", r = [];
1380
1484
  switch (e.type) {
1381
1485
  case d.INPUT:
1382
- i.push(`${t} <el-input v-model="formData.${u}" placeholder="${J(e.props?.placeholder || "")}" />`);
1486
+ r.push(`${t} <el-input v-model="formData.${u}" placeholder="${J(e.props?.placeholder || "")}" />`);
1383
1487
  break;
1384
1488
  case d.TEXTAREA:
1385
- i.push(`${t} <el-input v-model="formData.${u}" type="textarea" :rows="${e.props?.rows || 3}" placeholder="${J(e.props?.placeholder || "")}" />`);
1489
+ r.push(`${t} <el-input v-model="formData.${u}" type="textarea" :rows="${e.props?.rows || 3}" placeholder="${J(e.props?.placeholder || "")}" />`);
1386
1490
  break;
1387
1491
  case d.INPUT_NUMBER:
1388
- i.push(`${t} <el-input-number v-model="formData.${u}" :min="${e.min ?? 0}" :max="${e.max ?? 100}" />`);
1492
+ r.push(`${t} <el-input-number v-model="formData.${u}" :min="${e.min ?? 0}" :max="${e.max ?? 100}" />`);
1389
1493
  break;
1390
1494
  case d.RADIO_GROUP:
1391
1495
  (e.props?.options || []).forEach((p) => {
1392
- i.push(`${t} <el-radio value="${J(p.value)}">${J(p.label)}</el-radio>`);
1393
- }), i.unshift(`${t} <el-radio-group v-model="formData.${u}">`), i.push(`${t} </el-radio-group>`);
1496
+ r.push(`${t} <el-radio value="${J(p.value)}">${J(p.label)}</el-radio>`);
1497
+ }), r.unshift(`${t} <el-radio-group v-model="formData.${u}">`), r.push(`${t} </el-radio-group>`);
1394
1498
  break;
1395
1499
  case d.CHECKBOX_GROUP:
1396
1500
  (e.props?.options || []).forEach((p) => {
1397
- i.push(`${t} <el-checkbox value="${J(p.value)}">${J(p.label)}</el-checkbox>`);
1398
- }), i.unshift(`${t} <el-checkbox-group v-model="formData.${u}">`), i.push(`${t} </el-checkbox-group>`);
1501
+ r.push(`${t} <el-checkbox value="${J(p.value)}">${J(p.label)}</el-checkbox>`);
1502
+ }), r.unshift(`${t} <el-checkbox-group v-model="formData.${u}">`), r.push(`${t} </el-checkbox-group>`);
1399
1503
  break;
1400
1504
  case d.SELECT:
1401
1505
  (e.props?.options || []).forEach((p) => {
1402
- i.push(`${t} <el-option label="${J(p.label)}" value="${J(p.value)}" />`);
1403
- }), i.unshift(`${t} <el-select v-model="formData.${u}" placeholder="${J(e.props?.placeholder || "")}">`), i.push(`${t} </el-select>`);
1506
+ r.push(`${t} <el-option label="${J(p.label)}" value="${J(p.value)}" />`);
1507
+ }), r.unshift(`${t} <el-select v-model="formData.${u}" placeholder="${J(e.props?.placeholder || "")}">`), r.push(`${t} </el-select>`);
1404
1508
  break;
1405
1509
  case d.SWITCH:
1406
- i.push(`${t} <el-switch v-model="formData.${u}" />`);
1510
+ r.push(`${t} <el-switch v-model="formData.${u}" />`);
1407
1511
  break;
1408
1512
  case d.DATE_PICKER:
1409
- i.push(`${t} <el-date-picker v-model="formData.${u}" type="date" placeholder="${J(e.props?.placeholder || "")}" />`);
1513
+ r.push(`${t} <el-date-picker v-model="formData.${u}" type="date" placeholder="${J(e.props?.placeholder || "")}" />`);
1410
1514
  break;
1411
1515
  default:
1412
- i.push(`${t} <el-input v-model="formData.${u}" />`);
1516
+ r.push(`${t} <el-input v-model="formData.${u}" />`);
1413
1517
  }
1414
- return `${t}<el-form-item ${r}>
1415
- ${i.join(`
1518
+ return `${t}<el-form-item ${n}>
1519
+ ${r.join(`
1416
1520
  `)}
1417
1521
  ${t}</el-form-item>`;
1418
1522
  }
1419
- function ql(e, l = {}) {
1523
+ function on(e, l = {}) {
1420
1524
  const t = [];
1421
- return (e || []).forEach((r) => {
1422
- if (r.type === d.ROW) {
1423
- const u = r.props?.columns || [];
1424
- t.push('<el-row :gutter="' + (r.props?.gutter || 20) + '">'), u.forEach((i, p) => {
1425
- t.push(' <el-col :span="' + (i.span || 12) + '">'), (r.children?.[p] || []).forEach((s) => {
1426
- t.push(Ze(s, 4));
1525
+ return (e || []).forEach((n) => {
1526
+ if (n.type === d.ROW) {
1527
+ const u = n.props?.columns || [];
1528
+ t.push('<el-row :gutter="' + (n.props?.gutter || 20) + '">'), u.forEach((r, p) => {
1529
+ t.push(' <el-col :span="' + (r.span || 12) + '">'), (n.children?.[p] || []).forEach((i) => {
1530
+ t.push(tt(i, 4));
1427
1531
  }), t.push(" </el-col>");
1428
1532
  }), t.push("</el-row>");
1429
1533
  } else
1430
- t.push(Ze(r, 0));
1534
+ t.push(tt(n, 0));
1431
1535
  }), `<template>
1432
1536
  <el-form :model="formData" label-width="${l.labelWidth || "120px"}"${l.size && l.size !== "default" ? ` size="${l.size}"` : ""}>
1433
1537
  ${t.join(`
1434
1538
  `).split(`
1435
- `).map((r) => " " + r).join(`
1539
+ `).map((n) => " " + n).join(`
1436
1540
  `)}
1437
1541
  </el-form>
1438
1542
  </template>`;
1439
1543
  }
1440
- function Jl(e, l = {}) {
1441
- const t = [], r = (u, i) => {
1442
- const p = " ".repeat(i), s = J(u.props?.label || ""), h = J(u.props?.variableName || "");
1544
+ function an(e, l = {}) {
1545
+ const t = [], n = (u, r) => {
1546
+ const p = " ".repeat(r), i = J(u.props?.label || ""), h = J(u.props?.variableName || "");
1443
1547
  if (u.type === d.ROW) {
1444
1548
  const b = u.props?.columns || [];
1445
- t.push(`${p}<div class="row">`), b.forEach((N, D) => {
1446
- t.push(`${p} <div class="col-${N.span || 12}">`), (u.children?.[D] || []).forEach((_) => r(_, i + 4)), t.push(`${p} </div>`);
1549
+ t.push(`${p}<div class="row">`), b.forEach((O, I) => {
1550
+ t.push(`${p} <div class="col-${O.span || 12}">`), (u.children?.[I] || []).forEach((_) => n(_, r + 4)), t.push(`${p} </div>`);
1447
1551
  }), t.push(`${p}</div>`);
1448
1552
  return;
1449
1553
  }
1450
- t.push(`${p}<div class="form-item">`), t.push(`${p} <label>${s}${u.required ? " <em>*</em>" : ""}</label>`), t.push(`${p} <div class="form-item-body" data-field="${h}" data-type="${u.type}"></div>`), t.push(`${p}</div>`);
1554
+ t.push(`${p}<div class="form-item">`), t.push(`${p} <label>${i}${u.required ? " <em>*</em>" : ""}</label>`), t.push(`${p} <div class="form-item-body" data-field="${h}" data-type="${u.type}"></div>`), t.push(`${p}</div>`);
1451
1555
  };
1452
- return (e || []).forEach((u) => r(u, 0)), `<form class="gb-flow-form"${l.labelWidth ? ` style="--label-width:${l.labelWidth}"` : ""}>
1556
+ return (e || []).forEach((u) => n(u, 0)), `<form class="gb-flow-form"${l.labelWidth ? ` style="--label-width:${l.labelWidth}"` : ""}>
1453
1557
  ${t.join(`
1454
1558
  `)}
1455
1559
  </form>`;
1456
1560
  }
1457
- const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header" }, Ql = { class: "el-tabs__nav-wrap" }, Xl = { class: "el-tabs__nav" }, Zl = ["onClick"], en = {
1561
+ const sn = { class: "_fd-preview-tabs el-tabs" }, rn = { class: "el-tabs__header" }, un = { class: "el-tabs__nav-wrap" }, dn = { class: "el-tabs__nav" }, cn = ["onClick"], pn = {
1458
1562
  key: 2,
1459
1563
  class: "_fd-preview-code"
1460
- }, tn = /* @__PURE__ */ Object.assign({ name: "FcPreviewDialog" }, {
1564
+ }, mn = /* @__PURE__ */ Object.assign({ name: "FcPreviewDialog" }, {
1461
1565
  __name: "FcPreviewDialog",
1462
1566
  props: {
1463
1567
  modelValue: { type: Boolean, default: !1 },
@@ -1470,60 +1574,59 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1470
1574
  { label: "表单模式", value: "form" },
1471
1575
  { label: "组件模式", value: "component" },
1472
1576
  { label: "HTML 模式", value: "html" }
1473
- ], r = P("form"), u = H(() => ql(l.components, l.formOptions)), i = H(() => Jl(l.components, l.formOptions)), p = async () => {
1474
- const s = r.value === "component" ? u.value : i.value;
1577
+ ], n = P("form"), u = B(() => on(l.components, l.formOptions)), r = B(() => an(l.components, l.formOptions)), p = async () => {
1578
+ const i = n.value === "component" ? u.value : r.value;
1475
1579
  try {
1476
- await navigator.clipboard.writeText(s), oe.success("代码已复制");
1580
+ await navigator.clipboard.writeText(i), ae.success("代码已复制");
1477
1581
  } catch {
1478
- oe.warning("复制失败,请手动复制");
1582
+ ae.warning("复制失败,请手动复制");
1479
1583
  }
1480
1584
  };
1481
- return (s, h) => {
1482
- const b = O("el-dialog");
1483
- return m(), V(b, {
1585
+ return (i, h) => {
1586
+ const b = N("el-dialog");
1587
+ return f(), k(b, {
1484
1588
  "model-value": e.modelValue,
1485
1589
  width: "80%",
1486
1590
  class: "_fd-preview-dialog",
1487
1591
  "append-to-body": "",
1488
- "onUpdate:modelValue": h[0] || (h[0] = (N) => s.$emit("update:modelValue", N))
1592
+ "onUpdate:modelValue": h[0] || (h[0] = (O) => i.$emit("update:modelValue", O))
1489
1593
  }, {
1490
1594
  default: y(() => [
1491
- o("div", Yl, [
1492
- o("div", Kl, [
1493
- o("div", Ql, [
1494
- o("div", Xl, [
1495
- (m(), w(B, null, z(t, (N) => o("div", {
1496
- key: N.value,
1497
- class: $(["el-tabs__item", { "is-active": r.value === N.value }]),
1498
- onClick: (D) => r.value = N.value
1499
- }, ae(N.label), 11, Zl)), 64))
1595
+ s("div", sn, [
1596
+ s("div", rn, [
1597
+ s("div", un, [
1598
+ s("div", dn, [
1599
+ (f(), w(z, null, G(t, (O) => s("div", {
1600
+ key: O.value,
1601
+ class: U(["el-tabs__item", { "is-active": n.value === O.value }]),
1602
+ onClick: (I) => n.value = O.value
1603
+ }, se(O.label), 11, cn)), 64))
1500
1604
  ])
1501
1605
  ])
1502
1606
  ])
1503
1607
  ]),
1504
- r.value !== "form" ? (m(), w("div", {
1608
+ n.value !== "form" ? (f(), w("div", {
1505
1609
  key: 0,
1506
1610
  class: "_fd-preview-copy",
1507
1611
  onClick: p
1508
1612
  }, [...h[1] || (h[1] = [
1509
- o("i", { class: "fc-icon icon-copy" }, null, -1)
1510
- ])])) : j("", !0),
1511
- r.value === "form" ? (m(), V(ut, {
1613
+ s("i", { class: "fc-icon icon-copy" }, null, -1)
1614
+ ])])) : W("", !0),
1615
+ n.value === "form" ? (f(), k(ct, {
1512
1616
  key: 1,
1513
1617
  "form-config": e.components
1514
- }, null, 8, ["form-config"])) : (m(), w("pre", en, [
1515
- o("code", null, ae(r.value === "component" ? u.value : i.value), 1)
1618
+ }, null, 8, ["form-config"])) : (f(), w("pre", pn, [
1619
+ s("code", null, se(n.value === "component" ? u.value : r.value), 1)
1516
1620
  ]))
1517
1621
  ]),
1518
1622
  _: 1
1519
1623
  }, 8, ["model-value"]);
1520
1624
  };
1521
1625
  }
1522
- }), ln = [
1626
+ }), fn = [
1523
1627
  {
1524
1628
  name: "文本输入框",
1525
1629
  type: d.INPUT,
1526
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="5" width="18" height="14" rx="2"/><line x1="7" y1="12" x2="17" y2="12"/><line x1="7" y1="9" x2="10" y2="9"/></svg>',
1527
1630
  value: "",
1528
1631
  required: !0,
1529
1632
  defaultValue: "",
@@ -1539,7 +1642,6 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1539
1642
  {
1540
1643
  name: "多行文本",
1541
1644
  type: d.TEXTAREA,
1542
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="16" rx="2"/><line x1="7" y1="9" x2="17" y2="9"/><line x1="7" y1="12" x2="17" y2="12"/><line x1="7" y1="15" x2="13" y2="15"/></svg>',
1543
1645
  value: "",
1544
1646
  required: !0,
1545
1647
  defaultValue: "",
@@ -1556,7 +1658,6 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1556
1658
  {
1557
1659
  name: "数字输入框",
1558
1660
  type: d.INPUT_NUMBER,
1559
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="5" width="18" height="14" rx="2"/><line x1="7" y1="10" x2="7" y2="14"/><line x1="10" y1="10" x2="10" y2="14"/><line x1="13" y1="10" x2="13" y2="14"/></svg>',
1560
1661
  value: null,
1561
1662
  required: !0,
1562
1663
  min: 1,
@@ -1574,7 +1675,6 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1574
1675
  {
1575
1676
  name: "单选框",
1576
1677
  type: d.RADIO_GROUP,
1577
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="12" cy="12" r="9"/><circle cx="12" cy="12" r="4" fill="currentColor"/></svg>',
1578
1678
  value: "",
1579
1679
  required: !0,
1580
1680
  defaultValue: "1",
@@ -1594,7 +1694,6 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1594
1694
  {
1595
1695
  name: "下拉选择",
1596
1696
  type: d.SELECT,
1597
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="5" width="18" height="14" rx="2"/><polyline points="8 10 12 14 16 10"/></svg>',
1598
1697
  value: "",
1599
1698
  required: !0,
1600
1699
  defaultValue: "",
@@ -1615,7 +1714,6 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1615
1714
  {
1616
1715
  name: "多选框",
1617
1716
  type: d.CHECKBOX_GROUP,
1618
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="7" height="7" rx="1"/><polyline points="4.5 7.5 6 9 9 6"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="4" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg>',
1619
1717
  value: [],
1620
1718
  required: !0,
1621
1719
  defaultValue: [],
@@ -1635,7 +1733,6 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1635
1733
  {
1636
1734
  name: "开关",
1637
1735
  type: d.SWITCH,
1638
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="7" width="20" height="10" rx="5"/><circle cx="16" cy="12" r="3" fill="currentColor"/></svg>',
1639
1736
  value: !1,
1640
1737
  required: !1,
1641
1738
  defaultValue: !1,
@@ -1652,7 +1749,6 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1652
1749
  {
1653
1750
  name: "日期选择器",
1654
1751
  type: d.DATE_PICKER,
1655
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2"/><line x1="3" y1="10" x2="21" y2="10"/><line x1="8" y1="2" x2="8" y2="6"/><line x1="16" y1="2" x2="16" y2="6"/><circle cx="12" cy="15" r="1.5" fill="currentColor"/></svg>',
1656
1752
  value: null,
1657
1753
  required: !0,
1658
1754
  defaultValue: null,
@@ -1665,11 +1761,10 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1665
1761
  width: "100%"
1666
1762
  }
1667
1763
  }
1668
- ], nn = [
1764
+ ], vn = [
1669
1765
  {
1670
1766
  name: "分栏",
1671
1767
  type: d.ROW,
1672
- icon: '<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="2" y="4" width="9" height="16" rx="1"/><rect x="13" y="4" width="9" height="16" rx="1"/></svg>',
1673
1768
  value: null,
1674
1769
  required: !1,
1675
1770
  props: {
@@ -1684,26 +1779,26 @@ const Yl = { class: "_fd-preview-tabs el-tabs" }, Kl = { class: "el-tabs__header
1684
1779
  },
1685
1780
  children: []
1686
1781
  }
1687
- ], et = [
1782
+ ], lt = [
1688
1783
  {
1689
1784
  name: "基础组件",
1690
1785
  key: "basic",
1691
- templates: ln
1786
+ templates: fn
1692
1787
  },
1693
1788
  {
1694
1789
  name: "布局组件",
1695
1790
  key: "layout",
1696
- templates: nn
1791
+ templates: vn
1697
1792
  }
1698
- ], on = "1.0.0", an = "gbflow-form";
1699
- function Ee(e) {
1793
+ ], yn = "1.0.0", hn = "gbflow-form";
1794
+ function Oe(e) {
1700
1795
  return !!e && typeof e == "object" && !Array.isArray(e);
1701
1796
  }
1702
- function rn(e) {
1797
+ function bn(e) {
1703
1798
  if (e !== void 0)
1704
1799
  return JSON.parse(JSON.stringify(e));
1705
1800
  }
1706
- function sn(e) {
1801
+ function gn(e) {
1707
1802
  if (typeof e != "string") return e;
1708
1803
  const l = e.replace(/^\uFEFF/, "").trim();
1709
1804
  if (!l) throw new Error("导入内容为空");
@@ -1713,16 +1808,16 @@ function sn(e) {
1713
1808
  throw new Error(`JSON 解析失败:${t.message}`);
1714
1809
  }
1715
1810
  }
1716
- function Se(e) {
1811
+ function Ue(e) {
1717
1812
  const l = Array.isArray(e) ? e : e?.components, t = Array.isArray(e) ? {} : e?.options || {};
1718
1813
  if (!Array.isArray(l)) return { components: [], options: { ...t }, repairs: [] };
1719
- const r = [], u = (i) => i.filter((p) => Ee(p) ? !0 : (r.push(`已忽略无效的表单组件配置:${JSON.stringify(p)}`), !1)).map((p) => {
1720
- const s = rn(p);
1721
- if (s.id || (s.id = Oe()), s.type || (s.type = d.INPUT, r.push("表单组件缺少 type,已按文本输入框处理")), Ee(s.props) || (s.props = {}), s.props.label === void 0 && (s.props.label = s.type), s.props.variableName === void 0 && (s.props.variableName = ""), s.props.options !== void 0 && (s.props.options = kt(s.props.options)), s.type === d.ROW) {
1722
- const h = Array.isArray(s.children) ? s.children : [];
1723
- s.children = h.map((b) => u(Array.isArray(b) ? b : [])), s.children.length || (s.children = [[], []]), s.props.columns || (s.props.columns = s.children.map(() => ({ span: 24 / s.children.length })));
1814
+ const n = [], u = (r) => r.filter((p) => Oe(p) ? !0 : (n.push(`已忽略无效的表单组件配置:${JSON.stringify(p)}`), !1)).map((p) => {
1815
+ const i = bn(p);
1816
+ if (i.id || (i.id = Ae()), i.type || (i.type = d.INPUT, n.push("表单组件缺少 type,已按文本输入框处理")), Oe(i.props) || (i.props = {}), i.props.label === void 0 && (i.props.label = i.type), i.props.variableName === void 0 && (i.props.variableName = ""), i.props.options !== void 0 && (i.props.options = jt(i.props.options)), i.type === d.ROW) {
1817
+ const h = Array.isArray(i.children) ? i.children : [];
1818
+ i.children = h.map((b) => u(Array.isArray(b) ? b : [])), i.children.length || (i.children = [[], []]), i.props.columns || (i.props.columns = i.children.map(() => ({ span: 24 / i.children.length })));
1724
1819
  }
1725
- return s;
1820
+ return i;
1726
1821
  });
1727
1822
  return {
1728
1823
  components: u(l),
@@ -1733,100 +1828,100 @@ function Se(e) {
1733
1828
  size: t.size || "default",
1734
1829
  ...t
1735
1830
  },
1736
- repairs: r
1831
+ repairs: n
1737
1832
  };
1738
1833
  }
1739
- function Ue(e) {
1740
- const l = Array.isArray(e) ? e : e?.components || [], t = [], r = [], u = /* @__PURE__ */ new Set(), i = (p) => {
1741
- p.forEach((s) => {
1742
- if (!s || typeof s != "object") return;
1743
- if (s.type === d.ROW) {
1744
- s.children?.forEach(i);
1834
+ function Pe(e) {
1835
+ const l = Array.isArray(e) ? e : e?.components || [], t = [], n = [], u = /* @__PURE__ */ new Set(), r = (p) => {
1836
+ p.forEach((i) => {
1837
+ if (!i || typeof i != "object") return;
1838
+ if (i.type === d.ROW) {
1839
+ i.children?.forEach(r);
1745
1840
  return;
1746
1841
  }
1747
- const h = s.props?.variableName;
1842
+ const h = i.props?.variableName;
1748
1843
  h ? (u.has(h) && t.push({
1749
1844
  code: "DUPLICATE_VARIABLE",
1750
1845
  message: `表单变量名重复:${h}`,
1751
- componentId: s.id
1752
- }), u.add(h)) : r.push({
1846
+ componentId: i.id
1847
+ }), u.add(h)) : n.push({
1753
1848
  code: "MISSING_VARIABLE",
1754
- message: `表单项「${s.props?.label || s.type}」尚未设置变量名`,
1755
- componentId: s.id
1756
- }), s.props?.label || r.push({
1849
+ message: `表单项「${i.props?.label || i.type}」尚未设置变量名`,
1850
+ componentId: i.id
1851
+ }), i.props?.label || n.push({
1757
1852
  code: "MISSING_LABEL",
1758
- message: `表单项「${s.id}」尚未设置标签`,
1759
- componentId: s.id
1760
- }), ["select", "radio-group", "checkbox-group"].includes(s.type) && (!Array.isArray(s.props?.options) || s.props.options.length === 0) && r.push({
1853
+ message: `表单项「${i.id}」尚未设置标签`,
1854
+ componentId: i.id
1855
+ }), ["select", "radio-group", "checkbox-group"].includes(i.type) && (!Array.isArray(i.props?.options) || i.props.options.length === 0) && n.push({
1761
1856
  code: "MISSING_OPTIONS",
1762
- message: `选项组件「${s.props?.label || s.type}」还没有选项`,
1763
- componentId: s.id
1857
+ message: `选项组件「${i.props?.label || i.type}」还没有选项`,
1858
+ componentId: i.id
1764
1859
  });
1765
1860
  });
1766
1861
  };
1767
- return i(l), { valid: t.length === 0, errors: t, warnings: r };
1862
+ return r(l), { valid: t.length === 0, errors: t, warnings: n };
1768
1863
  }
1769
- function un(e) {
1864
+ function Tn(e) {
1770
1865
  return Object.keys(e || {}).reduce((l, t) => (e[t] !== void 0 && e[t] !== null && (l[t] = e[t]), l), {});
1771
1866
  }
1772
- function tt(e, l = {}, t = {}) {
1773
- const r = Se(e), u = {
1774
- schemaVersion: on,
1775
- kind: an,
1776
- meta: un(l),
1777
- form: { components: r.components, options: r.options }
1867
+ function nt(e, l = {}, t = {}) {
1868
+ const n = Ue(e), u = {
1869
+ schemaVersion: yn,
1870
+ kind: hn,
1871
+ meta: Tn(l),
1872
+ form: { components: n.components, options: n.options }
1778
1873
  };
1779
1874
  return t.raw ? u : JSON.stringify(u, null, t.space ?? 2);
1780
1875
  }
1781
- function lt(e) {
1782
- const l = sn(e);
1876
+ function ot(e) {
1877
+ const l = gn(e);
1783
1878
  if (Array.isArray(l)) {
1784
- const i = Se(l);
1879
+ const r = Ue(l);
1785
1880
  return {
1786
- components: i.components,
1787
- options: i.options,
1788
- repairs: i.repairs,
1789
- validation: Ue({ components: i.components })
1881
+ components: r.components,
1882
+ options: r.options,
1883
+ repairs: r.repairs,
1884
+ validation: Pe({ components: r.components })
1790
1885
  };
1791
1886
  }
1792
- if (!Ee(l)) throw new Error("无法识别的表单导入内容");
1887
+ if (!Oe(l)) throw new Error("无法识别的表单导入内容");
1793
1888
  const t = l.form || l.formStructure || l.formConfig || l.rule || (l.components ? l : null);
1794
1889
  if (!t) throw new Error("导入内容中未找到表单(components)");
1795
- const r = Se(t), u = {
1796
- ...r.options,
1797
- ...Ee(l.options) ? l.options : {}
1890
+ const n = Ue(t), u = {
1891
+ ...n.options,
1892
+ ...Oe(l.options) ? l.options : {}
1798
1893
  };
1799
1894
  return {
1800
- components: r.components,
1895
+ components: n.components,
1801
1896
  options: u,
1802
- repairs: r.repairs,
1803
- meta: Ee(l.meta) ? l.meta : void 0,
1804
- validation: Ue({ components: r.components })
1897
+ repairs: n.repairs,
1898
+ meta: Oe(l.meta) ? l.meta : void 0,
1899
+ validation: Pe({ components: n.components })
1805
1900
  };
1806
1901
  }
1807
- function Fn(e, l = "flow") {
1902
+ function Kn(e, l = "flow") {
1808
1903
  return String(e || l).trim().replace(/[\\/:*?"<>|]/g, "-").replace(/\s+/g, "-") || l;
1809
1904
  }
1810
- function dn(e, l, t = "application/json;charset=utf-8") {
1905
+ function En(e, l, t = "application/json;charset=utf-8") {
1811
1906
  if (typeof document > "u")
1812
1907
  throw new Error("downloadText 只能在浏览器环境使用");
1813
- const r = new Blob([e], { type: t }), u = URL.createObjectURL(r), i = document.createElement("a");
1814
- i.href = u, i.download = l, i.style.display = "none", document.body.appendChild(i), i.click(), document.body.removeChild(i), setTimeout(() => URL.revokeObjectURL(u), 1e3);
1908
+ const n = new Blob([e], { type: t }), u = URL.createObjectURL(n), r = document.createElement("a");
1909
+ r.href = u, r.download = l, r.style.display = "none", document.body.appendChild(r), r.click(), document.body.removeChild(r), setTimeout(() => URL.revokeObjectURL(u), 1e3);
1815
1910
  }
1816
- function cn(e, l = "flow.json", t = 2) {
1817
- const r = typeof e == "string" ? e : JSON.stringify(e, null, t), u = l.endsWith(".json") ? l : `${l}.json`;
1818
- dn(r, u);
1911
+ function Nn(e, l = "flow.json", t = 2) {
1912
+ const n = typeof e == "string" ? e : JSON.stringify(e, null, t), u = l.endsWith(".json") ? l : `${l}.json`;
1913
+ En(n, u);
1819
1914
  }
1820
- function pn(e) {
1915
+ function On(e) {
1821
1916
  return e ? typeof e.text == "function" ? e.text() : new Promise((l, t) => {
1822
- const r = new FileReader();
1823
- r.onload = () => l(String(r.result || "")), r.onerror = () => t(r.error || new Error("读取文件失败")), r.readAsText(e, "utf-8");
1917
+ const n = new FileReader();
1918
+ n.onload = () => l(String(n.result || "")), n.onerror = () => t(n.error || new Error("读取文件失败")), n.readAsText(e, "utf-8");
1824
1919
  }) : Promise.reject(new Error("未选择文件"));
1825
1920
  }
1826
- function mn() {
1921
+ function An() {
1827
1922
  return new Promise((e) => {
1828
1923
  if (typeof document > "u") {
1829
- fn();
1924
+ wn();
1830
1925
  return;
1831
1926
  }
1832
1927
  const l = document.createElement("input");
@@ -1835,26 +1930,26 @@ function mn() {
1835
1930
  l.parentNode && l.parentNode.removeChild(l);
1836
1931
  };
1837
1932
  l.addEventListener("change", async () => {
1838
- const r = l.files?.[0];
1839
- if (!r) {
1933
+ const n = l.files?.[0];
1934
+ if (!n) {
1840
1935
  t(), e(null);
1841
1936
  return;
1842
1937
  }
1843
1938
  try {
1844
- const u = await pn(r);
1845
- t(), e({ file: r, text: u });
1939
+ const u = await On(n);
1940
+ t(), e({ file: n, text: u });
1846
1941
  } catch (u) {
1847
- t(), e({ file: r, text: "", error: u });
1942
+ t(), e({ file: n, text: "", error: u });
1848
1943
  }
1849
1944
  }), l.addEventListener("cancel", () => {
1850
1945
  t(), e(null);
1851
1946
  }), l.click();
1852
1947
  });
1853
1948
  }
1854
- function fn() {
1949
+ function wn() {
1855
1950
  throw new Error("pickJSONFile 只能在浏览器环境使用");
1856
1951
  }
1857
- const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onClick"], bn = { class: "_fc-l-icon" }, gn = { class: "_fc-l-name" }, Tn = { class: "_fc-tree-label" }, En = { class: "_fc-m-tools-l" }, On = { class: "devices" }, Nn = { class: "_fc-m-tools-r" }, An = /* @__PURE__ */ Object.assign({ name: "GbFormDesigner" }, {
1952
+ const _n = ["onClick"], Rn = { class: "_fc-l-list" }, Cn = ["onDragstart", "onClick"], kn = { class: "_fc-l-icon" }, Vn = { class: "_fc-l-name" }, Sn = { class: "_fc-tree-label" }, Dn = { class: "_fc-m-tools-l" }, In = { class: "devices" }, $n = { class: "_fc-m-tools-r" }, xn = /* @__PURE__ */ Object.assign({ name: "GbFormDesigner" }, {
1858
1953
  __name: "FormDesigner",
1859
1954
  props: {
1860
1955
  modelValue: { type: Array, default: () => [] },
@@ -1864,25 +1959,25 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
1864
1959
  },
1865
1960
  emits: ["update:modelValue", "update:options", "import", "export", "validate", "change"],
1866
1961
  setup(e, { expose: l, emit: t }) {
1867
- const r = e, u = t, i = (c) => JSON.parse(JSON.stringify(c ?? [])), p = Te({
1962
+ const n = e, u = t, r = (c) => JSON.parse(JSON.stringify(c ?? [])), p = Ne({
1868
1963
  name: "",
1869
1964
  description: "",
1870
1965
  labelWidth: "120px",
1871
1966
  size: "default",
1872
- ...r.options || {}
1873
- }), s = r.options ? Te(r.options) : p;
1874
- Re(
1875
- () => r.options,
1967
+ ...n.options || {}
1968
+ }), i = n.options ? Ne(n.options) : p;
1969
+ ke(
1970
+ () => n.options,
1876
1971
  (c) => {
1877
- !c || c === s || Object.assign(s, c);
1972
+ !c || c === i || Object.assign(i, c);
1878
1973
  },
1879
1974
  { deep: !0 }
1880
- ), ke("fcFormOptions", s);
1881
- const h = P("base"), b = P("menu"), N = P(!1), D = P(!1), _ = P("pc"), x = P(!1), I = P(""), A = P(""), C = P(null), U = {
1975
+ ), Ie("fcFormOptions", i);
1976
+ const h = P("base"), b = P("menu"), O = P(!1), I = P(!1), _ = P("pc"), V = P(!1), D = P(""), A = P(""), S = P(null), x = {
1882
1977
  "--fc-drag-empty": "'拖拽左侧列表中的组件到此处'",
1883
1978
  "--fc-child-empty": "'点击右下角 + 按钮添加一列'"
1884
- }, le = Te({}), re = {}, K = P(
1885
- et.map((c) => ({ ...c, hidden: !1 }))
1979
+ }, ne = Ne({}), ie = {}, K = P(
1980
+ lt.map((c) => ({ ...c, hidden: !1 }))
1886
1981
  ), q = {
1887
1982
  [d.INPUT]: "icon-input",
1888
1983
  [d.TEXTAREA]: "icon-textarea",
@@ -1893,223 +1988,223 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
1893
1988
  [d.SWITCH]: "icon-switch",
1894
1989
  [d.DATE_PICKER]: "icon-date",
1895
1990
  [d.ROW]: "icon-row"
1896
- }, E = (c) => q[c] || "icon-input", n = P([]), Q = P(-1);
1897
- let F = !1, ee = null;
1898
- const ne = () => JSON.stringify({ components: r.modelValue, options: { ...s } }), me = () => {
1899
- const c = ne();
1900
- n.value[Q.value] !== c && (n.value = n.value.slice(0, Q.value + 1), n.value.push(c), n.value.length > 50 && n.value.shift(), Q.value = n.value.length - 1);
1901
- }, fe = H(() => Q.value > 0), se = H(() => Q.value < n.value.length - 1), ce = () => {
1902
- const { components: c, options: a } = JSON.parse(n.value[Q.value]);
1903
- F = !0, u("update:modelValue", c), Object.assign(s, a), Ct(() => {
1991
+ }, E = (c) => q[c] || "icon-input", o = P([]), Q = P(-1);
1992
+ let F = !1, te = null;
1993
+ const oe = () => JSON.stringify({ components: n.modelValue, options: { ...i } }), fe = () => {
1994
+ const c = oe();
1995
+ o.value[Q.value] !== c && (o.value = o.value.slice(0, Q.value + 1), o.value.push(c), o.value.length > 50 && o.value.shift(), Q.value = o.value.length - 1);
1996
+ }, ve = B(() => Q.value > 0), re = B(() => Q.value < o.value.length - 1), pe = () => {
1997
+ const { components: c, options: a } = JSON.parse(o.value[Q.value]);
1998
+ F = !0, u("update:modelValue", c), Object.assign(i, a), Vt(() => {
1904
1999
  F = !1;
1905
2000
  });
1906
- }, be = () => {
1907
- fe.value && (Q.value -= 1, ce());
1908
- }, Ae = () => {
1909
- se.value && (Q.value += 1, ce());
2001
+ }, Te = () => {
2002
+ ve.value && (Q.value -= 1, pe());
2003
+ }, _e = () => {
2004
+ re.value && (Q.value += 1, pe());
1910
2005
  };
1911
- Re(
1912
- () => [r.modelValue, { ...s }],
2006
+ ke(
2007
+ () => [n.modelValue, { ...i }],
1913
2008
  () => {
1914
- F || (clearTimeout(ee), ee = setTimeout(me, 300));
2009
+ F || (clearTimeout(te), te = setTimeout(fe, 300));
1915
2010
  },
1916
2011
  { deep: !0 }
1917
- ), ot(() => {
1918
- me();
2012
+ ), st(() => {
2013
+ fe();
1919
2014
  });
1920
2015
  const v = (c) => {
1921
- u("update:modelValue", i(c));
2016
+ u("update:modelValue", r(c));
2017
+ }, de = (c) => {
2018
+ Object.assign(i, c || {}), u("update:options", { ...i });
1922
2019
  }, ue = (c) => {
1923
- Object.assign(s, c || {}), u("update:options", { ...s });
1924
- }, ie = (c) => {
1925
- for (const a of et) {
1926
- const R = a.templates.find((L) => L.type === c);
2020
+ for (const a of lt) {
2021
+ const R = a.templates.find((M) => M.type === c);
1927
2022
  if (R) return R;
1928
2023
  }
1929
2024
  return null;
1930
- }, Pe = (c) => {
1931
- const a = i(c);
1932
- return delete a.name, delete a.icon, at(a), a.props = a.props || {}, a.props.variableName || (a.props.variableName = `field_${Oe().split("_").pop()}`), a.type === d.ROW && (a.children = [[], []], a.props.columns = a.props.columns || [{ span: 12 }, { span: 12 }]), a;
1933
- }, dt = (c) => {
1934
- const a = ie(c);
1935
- return a ? Pe(a) : null;
1936
- }, ct = (c) => {
1937
- const a = Pe(c), R = [...r.modelValue, a];
1938
- v(R), I.value = a.id;
1939
- }, ve = (c) => {
1940
- if (c.length === 1) return { list: r.modelValue, index: c[0], node: null };
1941
- const [a, , R, L] = c, G = r.modelValue[a];
1942
- return { list: G?.children?.[R] || [], index: L, node: G };
1943
- }, Ce = (c, a) => {
2025
+ }, Le = (c) => {
2026
+ const a = r(c);
2027
+ return delete a.name, delete a.icon, it(a), a.props = a.props || {}, a.props.variableName || (a.props.variableName = `field_${Ae().split("_").pop()}`), a.type === d.ROW && (a.children = [[], []], a.props.columns = a.props.columns || [{ span: 12 }, { span: 12 }]), a;
2028
+ }, pt = (c) => {
2029
+ const a = ue(c);
2030
+ return a ? Le(a) : null;
2031
+ }, mt = (c) => {
2032
+ const a = Le(c), R = [...n.modelValue, a];
2033
+ v(R), D.value = a.id;
2034
+ }, ye = (c) => {
2035
+ if (c.length === 1) return { list: n.modelValue, index: c[0], node: null };
2036
+ const [a, , R, M] = c, j = n.modelValue[a];
2037
+ return { list: j?.children?.[R] || [], index: M, node: j };
2038
+ }, Ve = (c, a) => {
1944
2039
  for (const R of c || []) {
1945
2040
  if (R.id === a) return R;
1946
2041
  if (R.type === d.ROW)
1947
- for (const L of R.children || []) {
1948
- const G = Ce(L, a);
1949
- if (G) return G;
2042
+ for (const M of R.children || []) {
2043
+ const j = Ve(M, a);
2044
+ if (j) return j;
1950
2045
  }
1951
2046
  }
1952
2047
  return null;
1953
- }, pt = H(() => I.value ? Ce(r.modelValue, I.value) : null), mt = (c) => {
1954
- I.value = c.id;
1955
- }, we = () => {
1956
- I.value = "";
1957
- }, Le = (c) => (c.id = Oe(), c.type === d.ROW && (c.children || []).forEach((a) => a.forEach(Le)), c), Me = (c) => {
1958
- const a = ve(c), R = a.list[c[c.length - 1]];
2048
+ }, ft = B(() => D.value ? Ve(n.modelValue, D.value) : null), vt = (c) => {
2049
+ D.value = c.id;
2050
+ }, Re = () => {
2051
+ D.value = "";
2052
+ }, Fe = (c) => (c.id = Ae(), c.type === d.ROW && (c.children || []).forEach((a) => a.forEach(Fe)), c), ze = (c) => {
2053
+ const a = ye(c), R = a.list[c[c.length - 1]];
1959
2054
  if (!R) return;
1960
- const L = Le(i(R));
1961
- a.list.splice(a.index + 1, 0, L), v(r.modelValue), I.value = L.id;
1962
- }, Fe = (c) => {
1963
- const a = ve(c);
1964
- a.list.splice(a.index, 1), v(r.modelValue), I.value && (Ce(r.modelValue, I.value) || we());
1965
- }, de = P(null), ft = () => de.value ? de.value : null, vt = (c, a) => {
2055
+ const M = Fe(r(R));
2056
+ a.list.splice(a.index + 1, 0, M), v(n.modelValue), D.value = M.id;
2057
+ }, je = (c) => {
2058
+ const a = ye(c);
2059
+ a.list.splice(a.index, 1), v(n.modelValue), D.value && (Ve(n.modelValue, D.value) || Re());
2060
+ }, ce = P(null), yt = () => ce.value ? ce.value : null, ht = (c, a) => {
1966
2061
  const R = { kind: "new", type: a.type };
1967
- de.value = R, c.dataTransfer.effectAllowed = "copy", c.dataTransfer.setData("application/x-gb-field", JSON.stringify(R)), c.dataTransfer.setData("text/plain", a.type);
1968
- }, yt = (c) => {
1969
- de.value = { kind: "existing", path: [...c] };
1970
- }, Be = () => {
1971
- de.value = null, A.value = "";
1972
- }, ht = (c) => {
2062
+ ce.value = R, c.dataTransfer.effectAllowed = "copy", c.dataTransfer.setData("application/x-gb-field", JSON.stringify(R)), c.dataTransfer.setData("text/plain", a.type);
2063
+ }, bt = (c) => {
2064
+ ce.value = { kind: "existing", path: [...c] };
2065
+ }, Ge = () => {
2066
+ ce.value = null, A.value = "";
2067
+ }, gt = (c) => {
1973
2068
  const a = c.dataTransfer?.getData("application/x-gb-field");
1974
- let R = de.value;
2069
+ let R = ce.value;
1975
2070
  if (a)
1976
2071
  try {
1977
2072
  R = JSON.parse(a);
1978
2073
  } catch {
1979
- R = de.value;
2074
+ R = ce.value;
1980
2075
  }
1981
- A.value = "", de.value = null, R && Ge(R, { path: null, position: "bottom" });
1982
- }, Ge = (c, a) => {
2076
+ A.value = "", ce.value = null, R && We(R, { path: null, position: "bottom" });
2077
+ }, We = (c, a) => {
1983
2078
  if (!c) return;
1984
- let R = r.modelValue, L = r.modelValue.length;
2079
+ let R = n.modelValue, M = n.modelValue.length;
1985
2080
  if (a.column !== void 0 && a.path) {
1986
- const M = ve(a.path).list[a.path[a.path.length - 1]];
1987
- if (!M?.children?.[a.column]) return;
1988
- if (c.kind === "existing" && ve(c.path).list[c.path[c.path.length - 1]]?.type === d.ROW) {
1989
- oe.warning("分栏组件不能放入分栏内");
2081
+ const L = ye(a.path).list[a.path[a.path.length - 1]];
2082
+ if (!L?.children?.[a.column]) return;
2083
+ if (c.kind === "existing" && ye(c.path).list[c.path[c.path.length - 1]]?.type === d.ROW) {
2084
+ ae.warning("分栏组件不能放入分栏内");
1990
2085
  return;
1991
2086
  }
1992
- R = M.children[a.column], L = R.length;
2087
+ R = L.children[a.column], M = R.length;
1993
2088
  } else if (a.path) {
1994
- if (c.kind === "existing" && c.path.length <= a.path.length && c.path.every((ge, Ve) => ge === a.path[Ve]))
2089
+ if (c.kind === "existing" && c.path.length <= a.path.length && c.path.every((Ee, Se) => Ee === a.path[Se]))
1995
2090
  return;
1996
- const M = ve(a.path);
1997
- R = M.list, L = a.position === "top" ? M.index : M.index + 1;
2091
+ const L = ye(a.path);
2092
+ R = L.list, M = a.position === "top" ? L.index : L.index + 1;
1998
2093
  }
1999
- let G;
2094
+ let j;
2000
2095
  if (c.kind === "new") {
2001
- if (G = dt(c.type), !G) return;
2096
+ if (j = pt(c.type), !j) return;
2002
2097
  } else {
2003
- const M = ve(c.path);
2004
- if (G = M.list[M.index], !G) return;
2005
- M.list === R && M.index < L && (L -= 1), M.list.splice(M.index, 1);
2098
+ const L = ye(c.path);
2099
+ if (j = L.list[L.index], !j) return;
2100
+ L.list === R && L.index < M && (M -= 1), L.list.splice(L.index, 1);
2006
2101
  }
2007
- R.splice(L, 0, G), v(r.modelValue), I.value = G.id;
2102
+ R.splice(M, 0, j), v(n.modelValue), D.value = j.id;
2008
2103
  };
2009
- ke("fcDragOver", A), ke("fcCanvasOps", {
2010
- active: mt,
2011
- copy: Me,
2012
- remove: Fe,
2013
- startDrag: yt,
2014
- endDrag: Be,
2015
- getDragPayload: ft,
2016
- dropAt: Ge
2104
+ Ie("fcDragOver", A), Ie("fcCanvasOps", {
2105
+ active: vt,
2106
+ copy: ze,
2107
+ remove: je,
2108
+ startDrag: bt,
2109
+ endDrag: Ge,
2110
+ getDragPayload: yt,
2111
+ dropAt: We
2017
2112
  });
2018
- const ze = (c, a = []) => (c || []).map((R, L) => {
2019
- const G = [...a, L], M = {
2113
+ const Be = (c, a = []) => (c || []).map((R, M) => {
2114
+ const j = [...a, M], L = {
2020
2115
  id: R.id,
2021
2116
  label: R.props?.label || R.props?.variableName || R.type,
2022
2117
  icon: E(R.type),
2023
2118
  rule: R,
2024
- path: G
2119
+ path: j
2025
2120
  };
2026
- return R.type === d.ROW && (M.children = (R.children || []).flatMap(
2027
- (ye, ge) => ze(ye || [], [...a, L, "children", ge])
2028
- )), M;
2029
- }), bt = H(() => ze(r.modelValue)), gt = (c) => {
2030
- c.rule && (I.value = c.rule.id);
2031
- }, Tt = (c, a) => {
2032
- a.path && (c === "copy" ? Me(a.path) : c === "delete" && Fe(a.path));
2033
- }, Et = async () => {
2034
- const c = await mn();
2121
+ return R.type === d.ROW && (L.children = (R.children || []).flatMap(
2122
+ (he, Ee) => Be(he || [], [...a, M, "children", Ee])
2123
+ )), L;
2124
+ }), Tt = B(() => Be(n.modelValue)), Et = (c) => {
2125
+ c.rule && (D.value = c.rule.id);
2126
+ }, Nt = (c, a) => {
2127
+ a.path && (c === "copy" ? ze(a.path) : c === "delete" && je(a.path));
2128
+ }, Ot = async () => {
2129
+ const c = await An();
2035
2130
  if (c)
2036
2131
  try {
2037
- const a = lt(c.text);
2038
- u("update:modelValue", a.components), Object.assign(s, a.options || {}), u("import", { components: a.components, options: { ...s } }), oe.success("表单导入成功");
2132
+ const a = ot(c.text);
2133
+ u("update:modelValue", a.components), Object.assign(i, a.options || {}), u("import", { components: a.components, options: { ...i } }), ae.success("表单导入成功");
2039
2134
  } catch (a) {
2040
- oe.error(`导入失败:${a.message}`);
2135
+ ae.error(`导入失败:${a.message}`);
2041
2136
  }
2042
- }, je = () => {
2043
- u("update:modelValue", []), we(), oe.success("表单已清空");
2044
- }, Ot = () => {
2045
- const c = Ue({ components: r.modelValue });
2137
+ }, He = () => {
2138
+ u("update:modelValue", []), Re(), ae.success("表单已清空");
2139
+ }, At = () => {
2140
+ const c = Pe({ components: n.modelValue });
2046
2141
  return u("validate", c), c;
2047
- }, He = () => i(r.modelValue);
2142
+ }, qe = () => r(n.modelValue);
2048
2143
  return l({
2049
- getComponents: He,
2050
- getForm: () => ({ components: He(), options: { ...s } }),
2144
+ getComponents: qe,
2145
+ getForm: () => ({ components: qe(), options: { ...i } }),
2051
2146
  importJSON: (c) => {
2052
- const a = lt(c);
2053
- return u("update:modelValue", a.components), Object.assign(s, a.options || {}), u("import", { components: a.components, options: { ...s } }), a;
2147
+ const a = ot(c);
2148
+ return u("update:modelValue", a.components), Object.assign(i, a.options || {}), u("import", { components: a.components, options: { ...i } }), a;
2054
2149
  },
2055
2150
  exportJSON: (c = 2) => {
2056
- const a = tt(r.modelValue, { ...r.meta, name: r.meta?.name || r.fileName }, { raw: !0 });
2057
- return a.form.options = { ...s }, u("export", a), JSON.stringify(a, null, c);
2151
+ const a = nt(n.modelValue, { ...n.meta, name: n.meta?.name || n.fileName }, { raw: !0 });
2152
+ return a.form.options = { ...i }, u("export", a), JSON.stringify(a, null, c);
2058
2153
  },
2059
2154
  downloadForm: () => {
2060
- const c = tt(r.modelValue, { ...r.meta, name: r.meta?.name || r.fileName }, { raw: !0 });
2061
- c.form.options = { ...s }, cn(c, `${r.meta?.name || r.fileName}-form.json`), u("export", c), oe.success("表单 JSON 已导出");
2155
+ const c = nt(n.modelValue, { ...n.meta, name: n.meta?.name || n.fileName }, { raw: !0 });
2156
+ c.form.options = { ...i }, Nn(c, `${n.meta?.name || n.fileName}-form.json`), u("export", c), ae.success("表单 JSON 已导出");
2062
2157
  },
2063
- validate: Ot,
2064
- clearForm: je,
2065
- undo: be,
2066
- redo: Ae,
2067
- components: H(() => r.modelValue),
2068
- formOptions: s
2158
+ validate: At,
2159
+ clearForm: He,
2160
+ undo: Te,
2161
+ redo: _e,
2162
+ components: B(() => n.modelValue),
2163
+ formOptions: i
2069
2164
  }), (c, a) => {
2070
- const R = O("el-tooltip"), L = O("el-aside"), G = O("el-header"), M = O("el-main"), ye = O("el-dropdown-item"), ge = O("el-dropdown-menu"), Ve = O("el-dropdown"), Nt = O("el-tree"), _e = O("el-container"), xe = O("el-button"), At = O("el-popconfirm"), wt = O("el-form");
2071
- return m(), V(_e, {
2165
+ const R = N("el-tooltip"), M = N("el-aside"), j = N("el-header"), L = N("el-main"), he = N("el-dropdown-item"), Ee = N("el-dropdown-menu"), Se = N("el-dropdown"), wt = N("el-tree"), Ce = N("el-container"), De = N("el-button"), _t = N("el-popconfirm"), Rt = N("el-form");
2166
+ return f(), k(Ce, {
2072
2167
  class: "_fc-designer gb-fc-designer",
2073
2168
  style: { height: "100%" }
2074
2169
  }, {
2075
2170
  default: y(() => [
2076
- f(M, null, {
2171
+ m(L, null, {
2077
2172
  default: y(() => [
2078
- f(_e, { style: { height: "100%" } }, {
2173
+ m(Ce, { style: { height: "100%" } }, {
2079
2174
  default: y(() => [
2080
- f(L, {
2175
+ m(M, {
2081
2176
  class: "_fc-l-menu",
2082
2177
  width: "40px"
2083
2178
  }, {
2084
2179
  default: y(() => [
2085
- f(R, {
2180
+ m(R, {
2086
2181
  effect: "dark",
2087
2182
  content: "组件列表",
2088
2183
  placement: "right",
2089
2184
  "hide-after": 0
2090
2185
  }, {
2091
2186
  default: y(() => [
2092
- o("div", {
2093
- class: $(["_fc-l-menu-item", { active: h.value === "base" }]),
2094
- onClick: a[0] || (a[0] = (S) => h.value = "base")
2187
+ s("div", {
2188
+ class: U(["_fc-l-menu-item", { active: h.value === "base" }]),
2189
+ onClick: a[0] || (a[0] = ($) => h.value = "base")
2095
2190
  }, [...a[15] || (a[15] = [
2096
- o("i", { class: "fc-icon icon-menu" }, null, -1)
2191
+ s("i", { class: "fc-icon icon-menu" }, null, -1)
2097
2192
  ])], 2)
2098
2193
  ]),
2099
2194
  _: 1
2100
2195
  }),
2101
- f(R, {
2196
+ m(R, {
2102
2197
  effect: "dark",
2103
2198
  content: "JSON",
2104
2199
  placement: "right",
2105
2200
  "hide-after": 0
2106
2201
  }, {
2107
2202
  default: y(() => [
2108
- o("div", {
2109
- class: $(["_fc-l-menu-item", { active: h.value === "json" }]),
2110
- onClick: a[1] || (a[1] = (S) => h.value = "json")
2203
+ s("div", {
2204
+ class: U(["_fc-l-menu-item", { active: h.value === "json" }]),
2205
+ onClick: a[1] || (a[1] = ($) => h.value = "json")
2111
2206
  }, [...a[16] || (a[16] = [
2112
- o("i", { class: "fc-icon icon-script" }, null, -1)
2207
+ s("i", { class: "fc-icon icon-script" }, null, -1)
2113
2208
  ])], 2)
2114
2209
  ]),
2115
2210
  _: 1
@@ -2117,125 +2212,125 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2117
2212
  ]),
2118
2213
  _: 1
2119
2214
  }),
2120
- pe(f(L, {
2215
+ me(m(M, {
2121
2216
  class: "_fc-l",
2122
2217
  width: "266px"
2123
2218
  }, {
2124
2219
  default: y(() => [
2125
- o("div", {
2220
+ s("div", {
2126
2221
  class: "_fc-l-close",
2127
- onClick: a[2] || (a[2] = (S) => N.value = !0)
2222
+ onClick: a[2] || (a[2] = ($) => O.value = !0)
2128
2223
  }, [...a[17] || (a[17] = [
2129
- o("i", { class: "fc-icon icon-arrow" }, null, -1)
2224
+ s("i", { class: "fc-icon icon-arrow" }, null, -1)
2130
2225
  ])]),
2131
- h.value === "json" ? (m(), V(Ll, {
2226
+ h.value === "json" ? (f(), k(Yl, {
2132
2227
  key: 0,
2133
2228
  ref_key: "jsonPanelRef",
2134
- ref: C,
2229
+ ref: S,
2135
2230
  components: e.modelValue,
2136
- "form-options": k(s),
2231
+ "form-options": C(i),
2137
2232
  "onUpdate:components": v,
2138
- "onUpdate:formOptions": ue
2139
- }, null, 8, ["components", "form-options"])) : (m(), V(_e, {
2233
+ "onUpdate:formOptions": de
2234
+ }, null, 8, ["components", "form-options"])) : (f(), k(Ce, {
2140
2235
  key: 1,
2141
2236
  style: { height: "100%" }
2142
2237
  }, {
2143
2238
  default: y(() => [
2144
- f(G, {
2239
+ m(j, {
2145
2240
  height: "40px",
2146
2241
  class: "_fc-l-tabs"
2147
2242
  }, {
2148
2243
  default: y(() => [
2149
- o("div", {
2150
- class: $(["_fc-l-tab", { active: b.value === "menu" }]),
2151
- onClick: a[3] || (a[3] = (S) => b.value = "menu")
2244
+ s("div", {
2245
+ class: U(["_fc-l-tab", { active: b.value === "menu" }]),
2246
+ onClick: a[3] || (a[3] = ($) => b.value = "menu")
2152
2247
  }, " 组件 ", 2),
2153
- o("div", {
2154
- class: $(["_fc-l-tab", { active: b.value === "tree" }]),
2155
- onClick: a[4] || (a[4] = (S) => b.value = "tree")
2248
+ s("div", {
2249
+ class: U(["_fc-l-tab", { active: b.value === "tree" }]),
2250
+ onClick: a[4] || (a[4] = ($) => b.value = "tree")
2156
2251
  }, " 大纲 ", 2)
2157
2252
  ]),
2158
2253
  _: 1
2159
2254
  }),
2160
- pe(f(M, null, {
2255
+ me(m(L, null, {
2161
2256
  default: y(() => [
2162
- (m(!0), w(B, null, z(K.value, (S) => (m(), w("div", {
2163
- key: S.key,
2257
+ (f(!0), w(z, null, G(K.value, ($) => (f(), w("div", {
2258
+ key: $.key,
2164
2259
  class: "_fc-l-group"
2165
2260
  }, [
2166
- o("h4", {
2261
+ s("h4", {
2167
2262
  class: "_fc-l-title",
2168
- onClick: (te) => S.hidden = !S.hidden
2263
+ onClick: (le) => $.hidden = !$.hidden
2169
2264
  }, [
2170
- Y(ae(S.name) + " ", 1),
2171
- o("i", {
2172
- class: $(["fc-icon icon-arrow", { down: !S.hidden }])
2265
+ Y(se($.name) + " ", 1),
2266
+ s("i", {
2267
+ class: U(["fc-icon icon-arrow", { down: !$.hidden }])
2173
2268
  }, null, 2)
2174
- ], 8, vn),
2175
- pe(o("div", yn, [
2176
- (m(!0), w(B, null, z(S.templates, (te) => (m(), w("div", {
2177
- key: te.type,
2269
+ ], 8, _n),
2270
+ me(s("div", Rn, [
2271
+ (f(!0), w(z, null, G($.templates, (le) => (f(), w("div", {
2272
+ key: le.type,
2178
2273
  class: "_fc-l-item",
2179
2274
  draggable: "true",
2180
- onDragstart: (We) => vt(We, te),
2181
- onDragend: Be,
2182
- onClick: (We) => ct(te)
2275
+ onDragstart: (Je) => ht(Je, le),
2276
+ onDragend: Ge,
2277
+ onClick: (Je) => mt(le)
2183
2278
  }, [
2184
- o("div", bn, [
2185
- o("i", {
2186
- class: $(["fc-icon", E(te.type)])
2279
+ s("div", kn, [
2280
+ s("i", {
2281
+ class: U(["fc-icon", E(le.type)])
2187
2282
  }, null, 2)
2188
2283
  ]),
2189
- o("span", gn, ae(te.name), 1)
2190
- ], 40, hn))), 128))
2284
+ s("span", Vn, se(le.name), 1)
2285
+ ], 40, Cn))), 128))
2191
2286
  ], 512), [
2192
- [he, !S.hidden]
2287
+ [be, !$.hidden]
2193
2288
  ])
2194
2289
  ]))), 128))
2195
2290
  ]),
2196
2291
  _: 1
2197
2292
  }, 512), [
2198
- [he, b.value === "menu"]
2293
+ [be, b.value === "menu"]
2199
2294
  ]),
2200
- pe(f(M, null, {
2295
+ me(m(L, null, {
2201
2296
  default: y(() => [
2202
- f(Nt, {
2203
- data: bt.value,
2297
+ m(wt, {
2298
+ data: Tt.value,
2204
2299
  "node-key": "id",
2205
2300
  "expand-on-click-node": !1,
2206
2301
  "default-expand-all": "",
2207
- onNodeClick: gt
2302
+ onNodeClick: Et
2208
2303
  }, {
2209
- default: y(({ data: S }) => [
2210
- o("div", {
2211
- class: $(["_fc-tree-node", { active: I.value === S.rule?.id }])
2304
+ default: y(({ data: $ }) => [
2305
+ s("div", {
2306
+ class: U(["_fc-tree-node", { active: D.value === $.rule?.id }])
2212
2307
  }, [
2213
- o("div", Tn, [
2214
- o("i", {
2215
- class: $(["fc-icon", S.icon || "icon-cell"])
2308
+ s("div", Sn, [
2309
+ s("i", {
2310
+ class: U(["fc-icon", $.icon || "icon-cell"])
2216
2311
  }, null, 2),
2217
- o("span", null, ae(S.label), 1)
2312
+ s("span", null, se($.label), 1)
2218
2313
  ]),
2219
- o("div", {
2314
+ s("div", {
2220
2315
  class: "_fc-tree-more",
2221
2316
  onClick: a[5] || (a[5] = X(() => {
2222
2317
  }, ["stop"]))
2223
2318
  }, [
2224
- f(Ve, {
2319
+ m(Se, {
2225
2320
  trigger: "click",
2226
2321
  size: "default",
2227
- onCommand: (te) => Tt(te, S)
2322
+ onCommand: (le) => Nt(le, $)
2228
2323
  }, {
2229
2324
  dropdown: y(() => [
2230
- f(ge, null, {
2325
+ m(Ee, null, {
2231
2326
  default: y(() => [
2232
- f(ye, { command: "copy" }, {
2327
+ m(he, { command: "copy" }, {
2233
2328
  default: y(() => [...a[18] || (a[18] = [
2234
2329
  Y("复制", -1)
2235
2330
  ])]),
2236
2331
  _: 1
2237
2332
  }),
2238
- f(ye, { command: "delete" }, {
2333
+ m(he, { command: "delete" }, {
2239
2334
  default: y(() => [...a[19] || (a[19] = [
2240
2335
  Y("删除", -1)
2241
2336
  ])]),
@@ -2246,7 +2341,7 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2246
2341
  })
2247
2342
  ]),
2248
2343
  default: y(() => [
2249
- a[20] || (a[20] = o("i", { class: "fc-icon icon-more" }, null, -1))
2344
+ a[20] || (a[20] = s("i", { class: "fc-icon icon-more" }, null, -1))
2250
2345
  ]),
2251
2346
  _: 1
2252
2347
  }, 8, ["onCommand"])
@@ -2258,7 +2353,7 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2258
2353
  ]),
2259
2354
  _: 1
2260
2355
  }, 512), [
2261
- [he, b.value === "tree"]
2356
+ [be, b.value === "tree"]
2262
2357
  ])
2263
2358
  ]),
2264
2359
  _: 1
@@ -2266,81 +2361,81 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2266
2361
  ]),
2267
2362
  _: 1
2268
2363
  }, 512), [
2269
- [he, !N.value]
2364
+ [be, !O.value]
2270
2365
  ]),
2271
- f(_e, { class: "_fc-m" }, {
2366
+ m(Ce, { class: "_fc-m" }, {
2272
2367
  default: y(() => [
2273
- f(G, {
2368
+ m(j, {
2274
2369
  class: "_fc-m-tools",
2275
2370
  height: "45"
2276
2371
  }, {
2277
2372
  default: y(() => [
2278
- o("div", En, [
2279
- o("div", On, [
2280
- o("i", {
2281
- class: $(["fc-icon icon-pc", { active: _.value === "pc" }]),
2282
- onClick: a[6] || (a[6] = (S) => _.value = "pc")
2373
+ s("div", Dn, [
2374
+ s("div", In, [
2375
+ s("i", {
2376
+ class: U(["fc-icon icon-pc", { active: _.value === "pc" }]),
2377
+ onClick: a[6] || (a[6] = ($) => _.value = "pc")
2283
2378
  }, null, 2),
2284
- o("i", {
2285
- class: $(["fc-icon icon-pad", { active: _.value === "pad" }]),
2286
- onClick: a[7] || (a[7] = (S) => _.value = "pad")
2379
+ s("i", {
2380
+ class: U(["fc-icon icon-pad", { active: _.value === "pad" }]),
2381
+ onClick: a[7] || (a[7] = ($) => _.value = "pad")
2287
2382
  }, null, 2),
2288
- o("i", {
2289
- class: $(["fc-icon icon-mobile", { active: _.value === "mobile" }]),
2290
- onClick: a[8] || (a[8] = (S) => _.value = "mobile")
2383
+ s("i", {
2384
+ class: U(["fc-icon icon-mobile", { active: _.value === "mobile" }]),
2385
+ onClick: a[8] || (a[8] = ($) => _.value = "mobile")
2291
2386
  }, null, 2)
2292
2387
  ]),
2293
- a[21] || (a[21] = o("div", { class: "line" }, null, -1)),
2294
- o("div", null, [
2295
- o("i", {
2296
- class: $(["fc-icon icon-pre-step", { disabled: !fe.value }]),
2297
- onClick: be
2388
+ a[21] || (a[21] = s("div", { class: "line" }, null, -1)),
2389
+ s("div", null, [
2390
+ s("i", {
2391
+ class: U(["fc-icon icon-pre-step", { disabled: !ve.value }]),
2392
+ onClick: Te
2298
2393
  }, null, 2),
2299
- o("i", {
2300
- class: $(["fc-icon icon-next-step", { disabled: !se.value }]),
2301
- onClick: Ae
2394
+ s("i", {
2395
+ class: U(["fc-icon icon-next-step", { disabled: !re.value }]),
2396
+ onClick: _e
2302
2397
  }, null, 2)
2303
2398
  ])
2304
2399
  ]),
2305
- o("div", Nn, [
2306
- f(xe, {
2307
- icon: k(Vt),
2400
+ s("div", $n, [
2401
+ m(De, {
2402
+ icon: C(Ft),
2308
2403
  plain: "",
2309
2404
  size: "small",
2310
- onClick: Et
2405
+ onClick: Ot
2311
2406
  }, {
2312
2407
  default: y(() => [...a[22] || (a[22] = [
2313
2408
  Y("导入", -1)
2314
2409
  ])]),
2315
2410
  _: 1
2316
2411
  }, 8, ["icon"]),
2317
- f(xe, {
2412
+ m(De, {
2318
2413
  type: "primary",
2319
2414
  plain: "",
2320
2415
  size: "small",
2321
- onClick: a[9] || (a[9] = (S) => x.value = !0)
2416
+ onClick: a[9] || (a[9] = ($) => V.value = !0)
2322
2417
  }, {
2323
2418
  default: y(() => [...a[23] || (a[23] = [
2324
- o("i", { class: "fc-icon icon-preview" }, null, -1),
2419
+ s("i", { class: "fc-icon icon-preview" }, null, -1),
2325
2420
  Y(" 预览 ", -1)
2326
2421
  ])]),
2327
2422
  _: 1
2328
2423
  }),
2329
- f(At, {
2424
+ m(_t, {
2330
2425
  title: "确定清空所有组件?",
2331
2426
  width: "200px",
2332
2427
  "confirm-button-text": "清空",
2333
2428
  "cancel-button-text": "取消",
2334
- onConfirm: je
2429
+ onConfirm: He
2335
2430
  }, {
2336
2431
  reference: y(() => [
2337
- f(xe, {
2432
+ m(De, {
2338
2433
  type: "danger",
2339
2434
  plain: "",
2340
2435
  size: "small"
2341
2436
  }, {
2342
2437
  default: y(() => [...a[24] || (a[24] = [
2343
- o("i", { class: "fc-icon icon-delete" }, null, -1),
2438
+ s("i", { class: "fc-icon icon-delete" }, null, -1),
2344
2439
  Y(" 清空", -1)
2345
2440
  ])]),
2346
2441
  _: 1
@@ -2352,41 +2447,41 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2352
2447
  ]),
2353
2448
  _: 1
2354
2449
  }),
2355
- f(M, { class: "_fc-m-con" }, {
2450
+ m(L, { class: "_fc-m-con" }, {
2356
2451
  default: y(() => [
2357
- a[25] || (a[25] = o("a", {
2452
+ a[25] || (a[25] = s("a", {
2358
2453
  class: "gb-fc-watermark",
2359
2454
  href: "javascript:void(0)"
2360
2455
  }, "GbFlowDesign", -1)),
2361
- o("div", {
2456
+ s("div", {
2362
2457
  ref: "dragCon",
2363
- class: $(["_fc-m-drag", _.value]),
2364
- style: U,
2458
+ class: U(["_fc-m-drag", _.value]),
2459
+ style: x,
2365
2460
  onDragover: a[10] || (a[10] = X(() => {
2366
2461
  }, ["prevent"])),
2367
- onDrop: X(ht, ["prevent"])
2462
+ onDrop: X(gt, ["prevent"])
2368
2463
  }, [
2369
- e.modelValue.length ? (m(), V(wt, {
2464
+ e.modelValue.length ? (f(), k(Rt, {
2370
2465
  key: 0,
2371
- model: le,
2372
- "label-width": k(s).labelWidth || "120px",
2373
- size: k(s).size === "default" ? void 0 : k(s).size
2466
+ model: ne,
2467
+ "label-width": C(i).labelWidth || "120px",
2468
+ size: C(i).size === "default" ? void 0 : C(i).size
2374
2469
  }, {
2375
2470
  default: y(() => [
2376
- (m(!0), w(B, null, z(e.modelValue, (S, te) => (m(), V(Bt, {
2377
- key: S.id || te,
2378
- component: S,
2379
- path: [te],
2380
- "form-data": le,
2381
- "form-rules": re,
2382
- "active-id": I.value
2471
+ (f(!0), w(z, null, G(e.modelValue, ($, le) => (f(), k(Xt, {
2472
+ key: $.id || le,
2473
+ component: $,
2474
+ path: [le],
2475
+ "form-data": ne,
2476
+ "form-rules": ie,
2477
+ "active-id": D.value
2383
2478
  }, null, 8, ["component", "path", "form-data", "active-id"]))), 128))
2384
2479
  ]),
2385
2480
  _: 1
2386
- }, 8, ["model", "label-width", "size"])) : (m(), w("div", {
2481
+ }, 8, ["model", "label-width", "size"])) : (f(), w("div", {
2387
2482
  key: 1,
2388
2483
  class: "_fd-draggable-drag _fd-drag-box drag-holder",
2389
- onClick: we
2484
+ onClick: Re
2390
2485
  }))
2391
2486
  ], 34)
2392
2487
  ]),
@@ -2395,46 +2490,46 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2395
2490
  ]),
2396
2491
  _: 1
2397
2492
  }),
2398
- pe(f(L, {
2493
+ me(m(M, {
2399
2494
  class: "_fc-r",
2400
2495
  width: "320px"
2401
2496
  }, {
2402
2497
  default: y(() => [
2403
- o("div", {
2498
+ s("div", {
2404
2499
  class: "_fc-r-close",
2405
- onClick: a[11] || (a[11] = (S) => D.value = !0)
2500
+ onClick: a[11] || (a[11] = ($) => I.value = !0)
2406
2501
  }, [...a[26] || (a[26] = [
2407
- o("i", { class: "fc-icon icon-arrow" }, null, -1)
2502
+ s("i", { class: "fc-icon icon-arrow" }, null, -1)
2408
2503
  ])]),
2409
- f(Ul, {
2410
- component: pt.value,
2411
- "form-options": k(s),
2412
- onClose: we
2504
+ m(Hl, {
2505
+ component: ft.value,
2506
+ "form-options": C(i),
2507
+ onClose: Re
2413
2508
  }, null, 8, ["component", "form-options"])
2414
2509
  ]),
2415
2510
  _: 1
2416
2511
  }, 512), [
2417
- [he, !D.value]
2512
+ [be, !I.value]
2418
2513
  ]),
2419
- N.value ? (m(), w("div", {
2514
+ O.value ? (f(), w("div", {
2420
2515
  key: 0,
2421
2516
  class: "_fc-l-open",
2422
- onClick: a[12] || (a[12] = (S) => N.value = !1)
2517
+ onClick: a[12] || (a[12] = ($) => O.value = !1)
2423
2518
  }, [...a[27] || (a[27] = [
2424
- o("i", { class: "fc-icon icon-arrow" }, null, -1)
2425
- ])])) : j("", !0),
2426
- D.value ? (m(), w("div", {
2519
+ s("i", { class: "fc-icon icon-arrow" }, null, -1)
2520
+ ])])) : W("", !0),
2521
+ I.value ? (f(), w("div", {
2427
2522
  key: 1,
2428
2523
  class: "_fc-r-open",
2429
- onClick: a[13] || (a[13] = (S) => D.value = !1)
2524
+ onClick: a[13] || (a[13] = ($) => I.value = !1)
2430
2525
  }, [...a[28] || (a[28] = [
2431
- o("i", { class: "fc-icon icon-arrow" }, null, -1)
2432
- ])])) : j("", !0),
2433
- f(tn, {
2434
- modelValue: x.value,
2435
- "onUpdate:modelValue": a[14] || (a[14] = (S) => x.value = S),
2526
+ s("i", { class: "fc-icon icon-arrow" }, null, -1)
2527
+ ])])) : W("", !0),
2528
+ m(mn, {
2529
+ modelValue: V.value,
2530
+ "onUpdate:modelValue": a[14] || (a[14] = ($) => V.value = $),
2436
2531
  components: e.modelValue,
2437
- "form-options": k(s)
2532
+ "form-options": C(i)
2438
2533
  }, null, 8, ["modelValue", "components", "form-options"])
2439
2534
  ]),
2440
2535
  _: 1
@@ -2462,7 +2557,7 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2462
2557
  // 数组类型(checkbox)
2463
2558
  BOOLEAN: "boolean"
2464
2559
  // 布尔类型(预留)
2465
- }), W = Object.freeze({
2560
+ }), H = Object.freeze({
2466
2561
  INPUT: "input",
2467
2562
  TEXTAREA: "textarea",
2468
2563
  INPUT_NUMBER: "input-number",
@@ -2472,17 +2567,17 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2472
2567
  SWITCH: "switch",
2473
2568
  DATE_PICKER: "date-picker",
2474
2569
  ROW: "row"
2475
- }), wn = Object.freeze({
2476
- [W.INPUT]: g.STRING,
2477
- [W.TEXTAREA]: g.STRING,
2478
- [W.INPUT_NUMBER]: null,
2570
+ }), Un = Object.freeze({
2571
+ [H.INPUT]: g.STRING,
2572
+ [H.TEXTAREA]: g.STRING,
2573
+ [H.INPUT_NUMBER]: null,
2479
2574
  // 动态判断:默认为整数
2480
- [W.RADIO_GROUP]: g.STRING,
2481
- [W.SELECT]: g.STRING,
2482
- [W.CHECKBOX_GROUP]: g.ARRAY,
2483
- [W.SWITCH]: g.BOOLEAN,
2484
- [W.DATE_PICKER]: g.DATE,
2485
- [W.ROW]: null
2575
+ [H.RADIO_GROUP]: g.STRING,
2576
+ [H.SELECT]: g.STRING,
2577
+ [H.CHECKBOX_GROUP]: g.ARRAY,
2578
+ [H.SWITCH]: g.BOOLEAN,
2579
+ [H.DATE_PICKER]: g.DATE,
2580
+ [H.ROW]: null
2486
2581
  // 布局组件,不映射
2487
2582
  }), T = Object.freeze({
2488
2583
  EQUAL: "==",
@@ -2505,7 +2600,7 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2505
2600
  // 为空
2506
2601
  IS_NOT_EMPTY: "is_not_empty"
2507
2602
  // 不为空
2508
- }), _n = Object.freeze({
2603
+ }), Pn = Object.freeze({
2509
2604
  [T.EQUAL]: "等于",
2510
2605
  [T.NOT_EQUAL]: "不等于",
2511
2606
  [T.GREATER_THAN]: "大于",
@@ -2516,7 +2611,7 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2516
2611
  [T.NOT_CONTAINS]: "不包含",
2517
2612
  [T.IS_EMPTY]: "为空",
2518
2613
  [T.IS_NOT_EMPTY]: "不为空"
2519
- }), nt = Object.freeze({
2614
+ }), at = Object.freeze({
2520
2615
  [g.STRING]: [
2521
2616
  T.EQUAL,
2522
2617
  T.NOT_EQUAL,
@@ -2576,30 +2671,30 @@ const vn = ["onClick"], yn = { class: "_fc-l-list" }, hn = ["onDragstart", "onCl
2576
2671
  T.NOT_EQUAL
2577
2672
  ]
2578
2673
  });
2579
- function Rn(e) {
2674
+ function Mn(e) {
2580
2675
  if (!e || !e.type)
2581
2676
  return console.warn("组件配置无效,无法计算数据类型", e), g.STRING;
2582
2677
  const l = e.type;
2583
2678
  if (e.props, l.startsWith("internal-") || l.startsWith("text/") || l.startsWith("application/"))
2584
2679
  return console.warn(`检测到非组件类型: ${l},默认使用STRING类型`, e), g.STRING;
2585
- if (l === W.INPUT_NUMBER)
2680
+ if (l === H.INPUT_NUMBER)
2586
2681
  return g.INTEGER;
2587
- if (l === W.DATE_PICKER)
2682
+ if (l === H.DATE_PICKER)
2588
2683
  return g.DATE;
2589
- const t = wn[l];
2684
+ const t = Un[l];
2590
2685
  return t || (console.warn(`未知的组件类型: ${l},默认使用STRING类型`), g.STRING);
2591
2686
  }
2592
- function Bn(e) {
2593
- const l = nt[e];
2687
+ function Qn(e) {
2688
+ const l = at[e];
2594
2689
  return l ? l.map((t) => ({
2595
- label: _n[t],
2690
+ label: Pn[t],
2596
2691
  value: t
2597
- })) : (console.warn(`未知的数据类型: ${e},返回默认操作符`), nt[g.STRING]);
2692
+ })) : (console.warn(`未知的数据类型: ${e},返回默认操作符`), at[g.STRING]);
2598
2693
  }
2599
- function Gn(e) {
2694
+ function Xn(e) {
2600
2695
  return e !== T.IS_EMPTY && e !== T.IS_NOT_EMPTY;
2601
2696
  }
2602
- function Ie(e) {
2697
+ function $e(e) {
2603
2698
  switch (e) {
2604
2699
  case g.INTEGER:
2605
2700
  case g.DECIMAL:
@@ -2615,7 +2710,7 @@ function Ie(e) {
2615
2710
  return "";
2616
2711
  }
2617
2712
  }
2618
- function Cn(e, l) {
2713
+ function Ln(e, l) {
2619
2714
  if (e == null || e === "")
2620
2715
  return !0;
2621
2716
  switch (l) {
@@ -2636,7 +2731,7 @@ function Cn(e, l) {
2636
2731
  return !0;
2637
2732
  }
2638
2733
  }
2639
- function zn(e) {
2734
+ function Zn(e) {
2640
2735
  return {
2641
2736
  [g.STRING]: "字符串",
2642
2737
  [g.INTEGER]: "整数",
@@ -2647,13 +2742,13 @@ function zn(e) {
2647
2742
  [g.BOOLEAN]: "布尔值"
2648
2743
  }[e] || e;
2649
2744
  }
2650
- function jn(e) {
2745
+ function eo(e) {
2651
2746
  return e === g.INTEGER || e === g.DECIMAL;
2652
2747
  }
2653
- function Hn(e) {
2748
+ function to(e) {
2654
2749
  return e === g.DATE || e === g.DATETIME;
2655
2750
  }
2656
- class Ne {
2751
+ class we {
2657
2752
  /**
2658
2753
  * 构造函数
2659
2754
  *
@@ -2665,7 +2760,7 @@ class Ne {
2665
2760
  const t = l.props?.variableName;
2666
2761
  if (!t)
2667
2762
  throw new Error("FormVariable: 组件必须有props.variableName属性");
2668
- this.id = l.id, this.variableName = t, this.label = l.props?.label || t, this.componentType = l.type, this.dataType = Rn(l), this.metadata = this._extractMetadata(l), this.defaultValue = this._normalizeDefaultValue(l), this.component = l;
2763
+ this.id = l.id, this.variableName = t, this.label = l.props?.label || t, this.componentType = l.type, this.dataType = Mn(l), this.metadata = this._extractMetadata(l), this.defaultValue = this._normalizeDefaultValue(l), this.component = l;
2669
2764
  }
2670
2765
  /**
2671
2766
  * 提取组件元数据
@@ -2675,23 +2770,23 @@ class Ne {
2675
2770
  * @returns {Object} 元数据对象
2676
2771
  */
2677
2772
  _extractMetadata(l) {
2678
- const t = l.props || {}, r = {
2773
+ const t = l.props || {}, n = {
2679
2774
  placeholder: t.placeholder || "",
2680
2775
  required: l.required !== !1
2681
2776
  // 默认为true
2682
2777
  };
2683
2778
  switch (l.type) {
2684
- case W.RADIO_GROUP:
2685
- r.options = Array.isArray(t.options) ? t.options : [];
2779
+ case H.RADIO_GROUP:
2780
+ n.options = Array.isArray(t.options) ? t.options : [];
2686
2781
  break;
2687
- case W.INPUT_NUMBER:
2688
- r.min = l.min != null ? Number(l.min) : void 0, r.max = l.max != null ? Number(l.max) : void 0;
2782
+ case H.INPUT_NUMBER:
2783
+ n.min = l.min != null ? Number(l.min) : void 0, n.max = l.max != null ? Number(l.max) : void 0;
2689
2784
  break;
2690
- case W.DATE_PICKER:
2691
- r.dateFormat = "date";
2785
+ case H.DATE_PICKER:
2786
+ n.dateFormat = "date";
2692
2787
  break;
2693
2788
  }
2694
- return r;
2789
+ return n;
2695
2790
  }
2696
2791
  /**
2697
2792
  * 标准化默认值
@@ -2702,10 +2797,10 @@ class Ne {
2702
2797
  */
2703
2798
  _normalizeDefaultValue(l) {
2704
2799
  const t = l.props?.defaultValue;
2705
- return t == null || t === "" ? Ie(this.dataType) : Cn(t, this.dataType) ? this._convertValue(t, this.dataType) : (console.warn(
2800
+ return t == null || t === "" ? $e(this.dataType) : Ln(t, this.dataType) ? this._convertValue(t, this.dataType) : (console.warn(
2706
2801
  `FormVariable: 默认值 "${t}" 不符合类型 "${this.dataType}",使用类型默认值`,
2707
2802
  l
2708
- ), Ie(this.dataType));
2803
+ ), $e(this.dataType));
2709
2804
  }
2710
2805
  /**
2711
2806
  * 转换值到正确的类型
@@ -2717,7 +2812,7 @@ class Ne {
2717
2812
  */
2718
2813
  _convertValue(l, t) {
2719
2814
  if (l == null || l === "")
2720
- return Ie(t);
2815
+ return $e(t);
2721
2816
  switch (t) {
2722
2817
  case g.INTEGER:
2723
2818
  return parseInt(l, 10);
@@ -2831,7 +2926,7 @@ class Ne {
2831
2926
  ...l.metadata
2832
2927
  }
2833
2928
  };
2834
- return new Ne(t);
2929
+ return new we(t);
2835
2930
  }
2836
2931
  /**
2837
2932
  * 批量转换组件列表为FormVariable数组(新格式)
@@ -2841,11 +2936,11 @@ class Ne {
2841
2936
  * @returns {Array<FormVariable>} FormVariable数组
2842
2937
  */
2843
2938
  static fromComponents(l) {
2844
- return Array.isArray(l) ? l.filter((t) => !(!t || !t.props?.variableName || t.type === W.ROW)).map((t) => {
2939
+ return Array.isArray(l) ? l.filter((t) => !(!t || !t.props?.variableName || t.type === H.ROW)).map((t) => {
2845
2940
  try {
2846
- return new Ne(t);
2847
- } catch (r) {
2848
- return console.error("FormVariable.fromComponents: 创建FormVariable失败", r, t), null;
2941
+ return new we(t);
2942
+ } catch (n) {
2943
+ return console.error("FormVariable.fromComponents: 创建FormVariable失败", n, t), null;
2849
2944
  }
2850
2945
  }).filter((t) => t !== null) : (console.warn("FormVariable.fromComponents: components必须是数组"), []);
2851
2946
  }
@@ -2860,93 +2955,93 @@ class Ne {
2860
2955
  return l ? typeof l.variableName == "string" && typeof l.label == "string" && typeof l.componentType == "string" && typeof l.dataType == "string" && typeof l.metadata == "object" : !1;
2861
2956
  }
2862
2957
  }
2863
- function Wn(e) {
2958
+ function lo(e) {
2864
2959
  return e?.components ? e.components.filter(
2865
2960
  (l) => l?.type === "row" || l?.props?.variableName && l?.props?.label
2866
2961
  ) : [];
2867
2962
  }
2868
- function $e(e) {
2869
- return Array.isArray(e) ? e.reduce((l, t) => (t && (t.type === "row" && t.children ? t.children.forEach((r) => {
2870
- Array.isArray(r) && l.push(...$e(r));
2963
+ function Me(e) {
2964
+ return Array.isArray(e) ? e.reduce((l, t) => (t && (t.type === "row" && t.children ? t.children.forEach((n) => {
2965
+ Array.isArray(n) && l.push(...Me(n));
2871
2966
  }) : t.props?.variableName && l.push(t)), l), []) : [];
2872
2967
  }
2873
- function qn(e) {
2968
+ function no(e) {
2874
2969
  if (!Array.isArray(e)) return [];
2875
- if (e.length > 0 && e[0] instanceof Ne)
2970
+ if (e.length > 0 && e[0] instanceof we)
2876
2971
  return e;
2877
- const l = $e(e);
2878
- return Ne.fromComponents(l);
2972
+ const l = Me(e);
2973
+ return we.fromComponents(l);
2879
2974
  }
2880
- function Jn(e, l) {
2975
+ function oo(e, l) {
2881
2976
  return Array.isArray(e) && e.find((t) => t.variableName === l) || null;
2882
2977
  }
2883
- function Yn(e) {
2978
+ function ao(e) {
2884
2979
  const l = [];
2885
2980
  return e ? (e.type || l.push("组件类型不能为空"), e.props ? (e.props.variableName || l.push("变量名不能为空"), e.props.label || l.push("标签不能为空"), ["select", "radio", "checkbox"].includes(e.type) && (Array.isArray(e.props.options) && e.props.options.length > 0 || l.push(`${e.type}类型必须配置选项列表`))) : l.push("组件属性不能为空"), {
2886
2981
  valid: l.length === 0,
2887
2982
  errors: l
2888
2983
  }) : (l.push("组件配置不能为空"), { valid: !1, errors: l });
2889
2984
  }
2890
- function Kn(e) {
2891
- return $e(e).length;
2985
+ function so(e) {
2986
+ return Me(e).length;
2892
2987
  }
2893
- const Vn = [An, ut], xn = "0.1.0", Qn = {
2894
- version: xn,
2988
+ const Fn = [xn, ct], zn = "0.1.0", io = {
2989
+ version: zn,
2895
2990
  install(e) {
2896
- Vn.forEach((l) => {
2991
+ Fn.forEach((l) => {
2897
2992
  l.name && e.component(l.name, l);
2898
2993
  });
2899
2994
  }
2900
2995
  };
2901
2996
  export {
2902
2997
  g as BaseDataType,
2903
- et as COMPONENT_CATEGORIES,
2998
+ lt as COMPONENT_CATEGORIES,
2904
2999
  d as COMPONENT_TYPES,
2905
- xt as COMPONENT_TYPE_LABELS,
2906
- W as ComponentType,
3000
+ zt as COMPONENT_TYPE_LABELS,
3001
+ H as ComponentType,
2907
3002
  T as ConditionOperator,
2908
- nt as DATA_TYPE_OPERATORS_MAP,
2909
- Mn as DEFAULT_CONFIG,
2910
- an as FORM_KIND,
2911
- Bt as FcCanvasField,
2912
- An as FormDesigner,
2913
- Ne as FormVariable,
2914
- ut as FormViewer,
2915
- _n as OPERATOR_LABEL_MAP,
2916
- Ke as OPTION_COMPONENT_TYPES,
2917
- on as SCHEMA_VERSION,
2918
- Ln as WIDTH_PRESETS,
2919
- Rn as computeDataType,
2920
- Kn as countFormComponents,
2921
- Qn as default,
2922
- cn as downloadJSON,
2923
- dn as downloadText,
2924
- qn as enrichFormVariables,
2925
- at as ensureComponentId,
2926
- tt as exportForm,
2927
- Wn as filterValidComponents,
2928
- Jn as findFormVariable,
2929
- Oe as generateComponentId,
2930
- $e as getAllFormComponents,
2931
- zn as getDataTypeLabel,
3003
+ at as DATA_TYPE_OPERATORS_MAP,
3004
+ Yn as DEFAULT_CONFIG,
3005
+ hn as FORM_KIND,
3006
+ Xt as FcCanvasField,
3007
+ xn as FormDesigner,
3008
+ we as FormVariable,
3009
+ ct as FormViewer,
3010
+ Pn as OPERATOR_LABEL_MAP,
3011
+ Xe as OPTION_COMPONENT_TYPES,
3012
+ yn as SCHEMA_VERSION,
3013
+ Jn as WIDTH_PRESETS,
3014
+ Mn as computeDataType,
3015
+ so as countFormComponents,
3016
+ io as default,
3017
+ Nn as downloadJSON,
3018
+ En as downloadText,
3019
+ no as enrichFormVariables,
3020
+ it as ensureComponentId,
3021
+ nt as exportForm,
3022
+ lo as filterValidComponents,
3023
+ oo as findFormVariable,
3024
+ Ae as generateComponentId,
3025
+ Me as getAllFormComponents,
3026
+ Zn as getDataTypeLabel,
2932
3027
  Z as getFieldName,
2933
- Bn as getOperatorsForDataType,
2934
- Ie as getTypeDefaultValue,
2935
- lt as importForm,
2936
- Hn as isDateType,
3028
+ Qn as getOperatorsForDataType,
3029
+ $e as getTypeDefaultValue,
3030
+ ot as importForm,
3031
+ to as isDateType,
2937
3032
  rt as isEmpty,
2938
- jn as isNumericType,
2939
- Cn as isValidValueForType,
2940
- Se as normalizeForm,
2941
- De as normalizeNumberValue,
2942
- kt as normalizeOptions,
2943
- Gn as operatorNeedsValue,
2944
- It as parseWidth,
2945
- mn as pickJSONFile,
2946
- pn as readTextFile,
2947
- Fn as sanitizeFileName,
2948
- Yn as validateComponentConfig,
2949
- Ue as validateForm,
2950
- xn as version
3033
+ eo as isNumericType,
3034
+ Ln as isValidValueForType,
3035
+ Ue as normalizeForm,
3036
+ xe as normalizeNumberValue,
3037
+ jt as normalizeOptions,
3038
+ Xn as operatorNeedsValue,
3039
+ Gt as parseWidth,
3040
+ An as pickJSONFile,
3041
+ On as readTextFile,
3042
+ Kn as sanitizeFileName,
3043
+ ao as validateComponentConfig,
3044
+ Pe as validateForm,
3045
+ zn as version
2951
3046
  };
2952
3047
  //# sourceMappingURL=gbformdesign.js.map