fitful-form 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/fitful-form.css +1 -1
- package/dist/types/create-form/CreateForm.vue.d.ts.map +1 -1
- package/dist/types/form/Form.vue.d.ts.map +1 -1
- package/dist/types/form/items/DynamicField.vue.d.ts.map +1 -1
- package/dist/types/form/linkage.d.ts +1 -0
- package/dist/types/form/linkage.d.ts.map +1 -1
- package/dist/types/types.d.ts +1 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/vue-form.js +422 -337
- package/dist/vue-form.umd.cjs +1 -1
- package/package.json +1 -1
package/dist/vue-form.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, mergeProps as u, nextTick as d, normalizeClass as f, onMounted as p, openBlock as m, reactive as h, ref as g, renderList as _, renderSlot as v, resolveComponent as y, toDisplayString as b, watch as x, withCtx as S, withModifiers as
|
|
2
|
-
import { ElButton as
|
|
1
|
+
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createTextVNode as o, createVNode as s, defineComponent as c, h as l, mergeProps as u, nextTick as d, normalizeClass as f, onMounted as p, openBlock as m, reactive as h, ref as g, renderList as _, renderSlot as v, resolveComponent as y, toDisplayString as b, watch as x, withCtx as S, withModifiers as ee } from "vue";
|
|
2
|
+
import { ElButton as C, ElCol as w, ElForm as T, ElRow as E } from "element-plus";
|
|
3
3
|
//#region node_modules/lodash-es/_freeGlobal.js
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
var t =
|
|
4
|
+
var D = typeof global == "object" && global && global.Object === Object && global, O = typeof self == "object" && self && self.Object === Object && self, k = D || O || Function("return this")(), A = k.Symbol, j = Object.prototype, M = j.hasOwnProperty, N = j.toString, P = A ? A.toStringTag : void 0;
|
|
5
|
+
function F(e) {
|
|
6
|
+
var t = M.call(e, P), n = e[P];
|
|
7
7
|
try {
|
|
8
|
-
e[
|
|
8
|
+
e[P] = void 0;
|
|
9
9
|
var r = !0;
|
|
10
10
|
} catch {}
|
|
11
|
-
var i =
|
|
12
|
-
return r && (t ? e[
|
|
11
|
+
var i = N.call(e);
|
|
12
|
+
return r && (t ? e[P] = n : delete e[P]), i;
|
|
13
13
|
}
|
|
14
14
|
//#endregion
|
|
15
15
|
//#region node_modules/lodash-es/_objectToString.js
|
|
16
|
-
var
|
|
16
|
+
var I = Object.prototype.toString;
|
|
17
17
|
function te(e) {
|
|
18
|
-
return
|
|
18
|
+
return I.call(e);
|
|
19
19
|
}
|
|
20
20
|
//#endregion
|
|
21
21
|
//#region node_modules/lodash-es/_baseGetTag.js
|
|
22
|
-
var ne = "[object Null]", L = "[object Undefined]", R =
|
|
22
|
+
var ne = "[object Null]", L = "[object Undefined]", R = A ? A.toStringTag : void 0;
|
|
23
23
|
function z(e) {
|
|
24
|
-
return e == null ? e === void 0 ? L : ne : R && R in Object(e) ?
|
|
24
|
+
return e == null ? e === void 0 ? L : ne : R && R in Object(e) ? F(e) : te(e);
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
27
|
//#region node_modules/lodash-es/isObjectLike.js
|
|
@@ -39,28 +39,28 @@ function H(e) {
|
|
|
39
39
|
}
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region node_modules/lodash-es/isFunction.js
|
|
42
|
-
var U = "[object AsyncFunction]", re = "[object Function]",
|
|
43
|
-
function
|
|
42
|
+
var U = "[object AsyncFunction]", re = "[object Function]", W = "[object GeneratorFunction]", ie = "[object Proxy]";
|
|
43
|
+
function ae(e) {
|
|
44
44
|
if (!H(e)) return !1;
|
|
45
45
|
var t = z(e);
|
|
46
|
-
return t == re || t ==
|
|
46
|
+
return t == re || t == W || t == U || t == ie;
|
|
47
47
|
}
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region node_modules/lodash-es/_coreJsData.js
|
|
50
|
-
var
|
|
51
|
-
var e = /[^.]+$/.exec(
|
|
50
|
+
var G = k["__core-js_shared__"], oe = function() {
|
|
51
|
+
var e = /[^.]+$/.exec(G && G.keys && G.keys.IE_PROTO || "");
|
|
52
52
|
return e ? "Symbol(src)_1." + e : "";
|
|
53
53
|
}();
|
|
54
|
-
function
|
|
55
|
-
return !!
|
|
54
|
+
function se(e) {
|
|
55
|
+
return !!oe && oe in e;
|
|
56
56
|
}
|
|
57
57
|
//#endregion
|
|
58
58
|
//#region node_modules/lodash-es/_toSource.js
|
|
59
|
-
var
|
|
60
|
-
function
|
|
59
|
+
var ce = Function.prototype.toString;
|
|
60
|
+
function K(e) {
|
|
61
61
|
if (e != null) {
|
|
62
62
|
try {
|
|
63
|
-
return
|
|
63
|
+
return ce.call(e);
|
|
64
64
|
} catch {}
|
|
65
65
|
try {
|
|
66
66
|
return e + "";
|
|
@@ -70,24 +70,24 @@ function W(e) {
|
|
|
70
70
|
}
|
|
71
71
|
//#endregion
|
|
72
72
|
//#region node_modules/lodash-es/_baseIsNative.js
|
|
73
|
-
var
|
|
74
|
-
function
|
|
75
|
-
return !H(e) ||
|
|
73
|
+
var le = /[\\^$.*+?()[\]{}|]/g, ue = /^\[object .+?Constructor\]$/, de = Function.prototype, fe = Object.prototype, pe = de.toString, me = fe.hasOwnProperty, he = RegExp("^" + pe.call(me).replace(le, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
74
|
+
function ge(e) {
|
|
75
|
+
return !H(e) || se(e) ? !1 : (ae(e) ? he : ue).test(K(e));
|
|
76
76
|
}
|
|
77
77
|
//#endregion
|
|
78
78
|
//#region node_modules/lodash-es/_getValue.js
|
|
79
|
-
function
|
|
79
|
+
function _e(e, t) {
|
|
80
80
|
return e?.[t];
|
|
81
81
|
}
|
|
82
82
|
//#endregion
|
|
83
83
|
//#region node_modules/lodash-es/_getNative.js
|
|
84
|
-
function
|
|
85
|
-
var n =
|
|
86
|
-
return
|
|
84
|
+
function q(e, t) {
|
|
85
|
+
var n = _e(e, t);
|
|
86
|
+
return ge(n) ? n : void 0;
|
|
87
87
|
}
|
|
88
88
|
//#endregion
|
|
89
89
|
//#region node_modules/lodash-es/_WeakMap.js
|
|
90
|
-
var
|
|
90
|
+
var ve = q(k, "WeakMap"), ye = Object.create, be = function() {
|
|
91
91
|
function e() {}
|
|
92
92
|
return function(t) {
|
|
93
93
|
if (!H(t)) return {};
|
|
@@ -108,7 +108,7 @@ function xe(e, t) {
|
|
|
108
108
|
//#region node_modules/lodash-es/_defineProperty.js
|
|
109
109
|
var Se = function() {
|
|
110
110
|
try {
|
|
111
|
-
var e =
|
|
111
|
+
var e = q(Object, "defineProperty");
|
|
112
112
|
return e({}, "", {}), e;
|
|
113
113
|
} catch {}
|
|
114
114
|
}();
|
|
@@ -149,7 +149,7 @@ function Ae(e, t, n) {
|
|
|
149
149
|
}
|
|
150
150
|
//#endregion
|
|
151
151
|
//#region node_modules/lodash-es/_copyObject.js
|
|
152
|
-
function
|
|
152
|
+
function je(e, t, n, r) {
|
|
153
153
|
var i = !n;
|
|
154
154
|
n ||= {};
|
|
155
155
|
for (var a = -1, o = t.length; ++a < o;) {
|
|
@@ -160,14 +160,14 @@ function J(e, t, n, r) {
|
|
|
160
160
|
}
|
|
161
161
|
//#endregion
|
|
162
162
|
//#region node_modules/lodash-es/isLength.js
|
|
163
|
-
var
|
|
164
|
-
function
|
|
165
|
-
return typeof e == "number" && e > -1 && e % 1 == 0 && e <=
|
|
163
|
+
var Me = 9007199254740991;
|
|
164
|
+
function Ne(e) {
|
|
165
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Me;
|
|
166
166
|
}
|
|
167
167
|
//#endregion
|
|
168
168
|
//#region node_modules/lodash-es/isArrayLike.js
|
|
169
|
-
function
|
|
170
|
-
return e != null &&
|
|
169
|
+
function J(e) {
|
|
170
|
+
return e != null && Ne(e.length) && !ae(e);
|
|
171
171
|
}
|
|
172
172
|
//#endregion
|
|
173
173
|
//#region node_modules/lodash-es/_isPrototype.js
|
|
@@ -202,10 +202,10 @@ function Ue() {
|
|
|
202
202
|
}
|
|
203
203
|
//#endregion
|
|
204
204
|
//#region node_modules/lodash-es/isBuffer.js
|
|
205
|
-
var We = typeof exports == "object" && exports && !exports.nodeType && exports, Ge = We && typeof module == "object" && module && !module.nodeType && module, Ke = Ge && Ge.exports === We ?
|
|
205
|
+
var We = typeof exports == "object" && exports && !exports.nodeType && exports, Ge = We && typeof module == "object" && module && !module.nodeType && module, Ke = Ge && Ge.exports === We ? k.Buffer : void 0, qe = (Ke ? Ke.isBuffer : void 0) || Ue, Je = "[object Arguments]", Ye = "[object Array]", Xe = "[object Boolean]", Ze = "[object Date]", Qe = "[object Error]", $e = "[object Function]", et = "[object Map]", tt = "[object Number]", nt = "[object Object]", rt = "[object RegExp]", it = "[object Set]", at = "[object String]", ot = "[object WeakMap]", st = "[object ArrayBuffer]", ct = "[object DataView]", lt = "[object Float32Array]", ut = "[object Float64Array]", dt = "[object Int8Array]", ft = "[object Int16Array]", pt = "[object Int32Array]", mt = "[object Uint8Array]", ht = "[object Uint8ClampedArray]", gt = "[object Uint16Array]", _t = "[object Uint32Array]", Y = {};
|
|
206
206
|
Y[lt] = Y[ut] = Y[dt] = Y[ft] = Y[pt] = Y[mt] = Y[ht] = Y[gt] = Y[_t] = !0, Y[Je] = Y[Ye] = Y[st] = Y[Xe] = Y[ct] = Y[Ze] = Y[Qe] = Y[$e] = Y[et] = Y[tt] = Y[nt] = Y[rt] = Y[it] = Y[at] = Y[ot] = !1;
|
|
207
207
|
function vt(e) {
|
|
208
|
-
return B(e) &&
|
|
208
|
+
return B(e) && Ne(e.length) && !!Y[z(e)];
|
|
209
209
|
}
|
|
210
210
|
//#endregion
|
|
211
211
|
//#region node_modules/lodash-es/_baseUnary.js
|
|
@@ -216,7 +216,7 @@ function yt(e) {
|
|
|
216
216
|
}
|
|
217
217
|
//#endregion
|
|
218
218
|
//#region node_modules/lodash-es/_nodeUtil.js
|
|
219
|
-
var bt = typeof exports == "object" && exports && !exports.nodeType && exports, xt = bt && typeof module == "object" && module && !module.nodeType && module, St = xt && xt.exports === bt &&
|
|
219
|
+
var bt = typeof exports == "object" && exports && !exports.nodeType && exports, xt = bt && typeof module == "object" && module && !module.nodeType && module, St = xt && xt.exports === bt && D.process, Ct = function() {
|
|
220
220
|
try {
|
|
221
221
|
return xt && xt.require && xt.require("util").types || St && St.binding && St.binding("util");
|
|
222
222
|
} catch {}
|
|
@@ -245,7 +245,7 @@ function jt(e) {
|
|
|
245
245
|
//#endregion
|
|
246
246
|
//#region node_modules/lodash-es/keys.js
|
|
247
247
|
function Mt(e) {
|
|
248
|
-
return
|
|
248
|
+
return J(e) ? Dt(e) : jt(e);
|
|
249
249
|
}
|
|
250
250
|
//#endregion
|
|
251
251
|
//#region node_modules/lodash-es/_nativeKeysIn.js
|
|
@@ -266,11 +266,11 @@ function Ft(e) {
|
|
|
266
266
|
//#endregion
|
|
267
267
|
//#region node_modules/lodash-es/keysIn.js
|
|
268
268
|
function It(e) {
|
|
269
|
-
return
|
|
269
|
+
return J(e) ? Dt(e, !0) : Ft(e);
|
|
270
270
|
}
|
|
271
271
|
//#endregion
|
|
272
272
|
//#region node_modules/lodash-es/_nativeCreate.js
|
|
273
|
-
var Lt =
|
|
273
|
+
var Lt = q(Object, "create");
|
|
274
274
|
//#endregion
|
|
275
275
|
//#region node_modules/lodash-es/_hashClear.js
|
|
276
276
|
function Rt() {
|
|
@@ -364,7 +364,7 @@ function Z(e) {
|
|
|
364
364
|
Z.prototype.clear = qt, Z.prototype.delete = Xt, Z.prototype.get = Zt, Z.prototype.has = Qt, Z.prototype.set = $t;
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region node_modules/lodash-es/_Map.js
|
|
367
|
-
var en =
|
|
367
|
+
var en = q(k, "Map");
|
|
368
368
|
//#endregion
|
|
369
369
|
//#region node_modules/lodash-es/_mapCacheClear.js
|
|
370
370
|
function tn() {
|
|
@@ -470,16 +470,16 @@ vn.prototype.clear = fn, vn.prototype.delete = pn, vn.prototype.get = mn, vn.pro
|
|
|
470
470
|
//#endregion
|
|
471
471
|
//#region node_modules/lodash-es/_baseAssign.js
|
|
472
472
|
function yn(e, t) {
|
|
473
|
-
return e &&
|
|
473
|
+
return e && je(t, Mt(t), e);
|
|
474
474
|
}
|
|
475
475
|
//#endregion
|
|
476
476
|
//#region node_modules/lodash-es/_baseAssignIn.js
|
|
477
477
|
function bn(e, t) {
|
|
478
|
-
return e &&
|
|
478
|
+
return e && je(t, It(t), e);
|
|
479
479
|
}
|
|
480
480
|
//#endregion
|
|
481
481
|
//#region node_modules/lodash-es/_cloneBuffer.js
|
|
482
|
-
var xn = typeof exports == "object" && exports && !exports.nodeType && exports, Sn = xn && typeof module == "object" && module && !module.nodeType && module, Cn = Sn && Sn.exports === xn ?
|
|
482
|
+
var xn = typeof exports == "object" && exports && !exports.nodeType && exports, Sn = xn && typeof module == "object" && module && !module.nodeType && module, Cn = Sn && Sn.exports === xn ? k.Buffer : void 0, wn = Cn ? Cn.allocUnsafe : void 0;
|
|
483
483
|
function Tn(e, t) {
|
|
484
484
|
if (t) return e.slice();
|
|
485
485
|
var n = e.length, r = wn ? wn(n) : new e.constructor(n);
|
|
@@ -509,7 +509,7 @@ var On = Object.prototype.propertyIsEnumerable, kn = Object.getOwnPropertySymbol
|
|
|
509
509
|
//#endregion
|
|
510
510
|
//#region node_modules/lodash-es/_copySymbols.js
|
|
511
511
|
function jn(e, t) {
|
|
512
|
-
return
|
|
512
|
+
return je(e, An(e), t);
|
|
513
513
|
}
|
|
514
514
|
//#endregion
|
|
515
515
|
//#region node_modules/lodash-es/_getSymbolsIn.js
|
|
@@ -520,7 +520,7 @@ var Mn = Object.getOwnPropertySymbols ? function(e) {
|
|
|
520
520
|
//#endregion
|
|
521
521
|
//#region node_modules/lodash-es/_copySymbolsIn.js
|
|
522
522
|
function Nn(e, t) {
|
|
523
|
-
return
|
|
523
|
+
return je(e, Mn(e), t);
|
|
524
524
|
}
|
|
525
525
|
//#endregion
|
|
526
526
|
//#region node_modules/lodash-es/_baseGetAllKeys.js
|
|
@@ -540,9 +540,9 @@ function In(e) {
|
|
|
540
540
|
}
|
|
541
541
|
//#endregion
|
|
542
542
|
//#region node_modules/lodash-es/_DataView.js
|
|
543
|
-
var Ln =
|
|
544
|
-
(Ln && Q(new Ln(/* @__PURE__ */ new ArrayBuffer(1))) != Gn || en && Q(new en()) != Bn || Rn && Q(Rn.resolve()) != Hn || zn && Q(new zn()) != Un ||
|
|
545
|
-
var t = z(e), n = t == Vn ? e.constructor : void 0, r = n ?
|
|
543
|
+
var Ln = q(k, "DataView"), Rn = q(k, "Promise"), zn = q(k, "Set"), Bn = "[object Map]", Vn = "[object Object]", Hn = "[object Promise]", Un = "[object Set]", Wn = "[object WeakMap]", Gn = "[object DataView]", Kn = K(Ln), qn = K(en), Jn = K(Rn), Yn = K(zn), Xn = K(ve), Q = z;
|
|
544
|
+
(Ln && Q(new Ln(/* @__PURE__ */ new ArrayBuffer(1))) != Gn || en && Q(new en()) != Bn || Rn && Q(Rn.resolve()) != Hn || zn && Q(new zn()) != Un || ve && Q(new ve()) != Wn) && (Q = function(e) {
|
|
545
|
+
var t = z(e), n = t == Vn ? e.constructor : void 0, r = n ? K(n) : "";
|
|
546
546
|
if (r) switch (r) {
|
|
547
547
|
case Kn: return Gn;
|
|
548
548
|
case qn: return Bn;
|
|
@@ -559,7 +559,7 @@ function $n(e) {
|
|
|
559
559
|
}
|
|
560
560
|
//#endregion
|
|
561
561
|
//#region node_modules/lodash-es/_Uint8Array.js
|
|
562
|
-
var er =
|
|
562
|
+
var er = k.Uint8Array;
|
|
563
563
|
//#endregion
|
|
564
564
|
//#region node_modules/lodash-es/_cloneArrayBuffer.js
|
|
565
565
|
function tr(e) {
|
|
@@ -581,7 +581,7 @@ function ir(e) {
|
|
|
581
581
|
}
|
|
582
582
|
//#endregion
|
|
583
583
|
//#region node_modules/lodash-es/_cloneSymbol.js
|
|
584
|
-
var ar =
|
|
584
|
+
var ar = A ? A.prototype : void 0, or = ar ? ar.valueOf : void 0;
|
|
585
585
|
function sr(e) {
|
|
586
586
|
return or ? Object(or.call(e)) : {};
|
|
587
587
|
}
|
|
@@ -761,20 +761,20 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
761
761
|
function x(e) {
|
|
762
762
|
return Array.isArray(e) ? e.map((e) => g(e)) : typeof e == "string" && e || e && typeof e == "object" ? [g(e)] : [];
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function C(e) {
|
|
765
765
|
let t = `${e.uploadType ?? ""} ${e.mimeType ?? ""}`.toLowerCase(), n = `${e.name} ${e.url}`.toLowerCase();
|
|
766
766
|
return t.includes("image/") || t === "image" || /\.(png|jpe?g|gif|webp|bmp|svg|avif|heic|heif)(?:[?#].*)?$/.test(n);
|
|
767
767
|
}
|
|
768
|
-
function
|
|
768
|
+
function w(e, t) {
|
|
769
769
|
return String(e.uid ?? e.id ?? `${e.url}-${t}`);
|
|
770
770
|
}
|
|
771
|
-
function
|
|
772
|
-
return
|
|
771
|
+
function T(e) {
|
|
772
|
+
return F.value.slice(0, e).filter((e) => !!e.url && C(e)).length;
|
|
773
773
|
}
|
|
774
|
-
function
|
|
774
|
+
function E(e) {
|
|
775
775
|
f("update:modelValue", e);
|
|
776
776
|
}
|
|
777
|
-
function
|
|
777
|
+
function D(e) {
|
|
778
778
|
let t = d.modelValue;
|
|
779
779
|
if (Array.isArray(t)) {
|
|
780
780
|
f("update:modelValue", t.filter((t, n) => n !== e));
|
|
@@ -782,10 +782,10 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
782
782
|
}
|
|
783
783
|
f("update:modelValue", []);
|
|
784
784
|
}
|
|
785
|
-
function
|
|
785
|
+
function O(e) {
|
|
786
786
|
e.url && window.open(e.url, "_blank", "noopener,noreferrer");
|
|
787
787
|
}
|
|
788
|
-
function
|
|
788
|
+
function k(e, t = d.child.options ?? []) {
|
|
789
789
|
for (let n of t) {
|
|
790
790
|
if (!n || typeof n != "object") continue;
|
|
791
791
|
let t = n.value ?? n.key ?? n;
|
|
@@ -795,18 +795,18 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
795
795
|
if (t[r] === e[r]) return String(n.label ?? e);
|
|
796
796
|
}
|
|
797
797
|
if (n.children) {
|
|
798
|
-
let t =
|
|
798
|
+
let t = k(e, n.children);
|
|
799
799
|
if (t !== null) return t;
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
802
|
return null;
|
|
803
803
|
}
|
|
804
|
-
function
|
|
804
|
+
function A(e) {
|
|
805
805
|
if (e == null || e === "") return "-";
|
|
806
806
|
if (e instanceof Date) return e.toLocaleString();
|
|
807
807
|
if (typeof e == "boolean") return e ? "是" : "否";
|
|
808
808
|
if (typeof e == "object") {
|
|
809
|
-
let t =
|
|
809
|
+
let t = k(e);
|
|
810
810
|
if (t !== null) return t;
|
|
811
811
|
try {
|
|
812
812
|
return JSON.stringify(e);
|
|
@@ -816,10 +816,10 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
816
816
|
}
|
|
817
817
|
return String(e);
|
|
818
818
|
}
|
|
819
|
-
function
|
|
820
|
-
return e.map((e) =>
|
|
819
|
+
function j(e) {
|
|
820
|
+
return e.map((e) => k(e) ?? A(e));
|
|
821
821
|
}
|
|
822
|
-
let
|
|
822
|
+
let M = t(() => {
|
|
823
823
|
let e = d.child.placeholder ?? R(d.child.type) ?? `${d.child.label ?? d.child.key}不能为空`, t = (d.child.rules ?? []).map((t) => {
|
|
824
824
|
let n = { ...t };
|
|
825
825
|
return n.required && !n.message && (n.message = e), n;
|
|
@@ -829,10 +829,10 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
829
829
|
message: e,
|
|
830
830
|
trigger: ["blur", "change"]
|
|
831
831
|
}), t;
|
|
832
|
-
}),
|
|
832
|
+
}), N = t(() => !!d.child.isText), P = t(() => !N.value && z.value.disabled !== !0), F = t(() => x(d.modelValue ?? "")), I = t(() => Array.isArray(d.modelValue) ? d.modelValue : []), te = t(() => F.value.filter((e) => !!e.url && C(e)).map((e) => e.url)), ne = t(() => {
|
|
833
833
|
let e = Number(d.child.limit ?? z.value.limit);
|
|
834
834
|
return Number.isFinite(e) && e > 0 ? e : Infinity;
|
|
835
|
-
}), L = t(() =>
|
|
835
|
+
}), L = t(() => F.value.length < ne.value);
|
|
836
836
|
function R(e) {
|
|
837
837
|
if ([
|
|
838
838
|
"select",
|
|
@@ -887,8 +887,8 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
887
887
|
return e;
|
|
888
888
|
});
|
|
889
889
|
return (t, l) => {
|
|
890
|
-
let d = y("el-text"), p = y("el-image"), h = y("el-button"), g = y("el-upload"), x = y("el-tag"),
|
|
891
|
-
return m(), n(
|
|
890
|
+
let d = y("el-text"), p = y("el-image"), h = y("el-button"), g = y("el-upload"), x = y("el-tag"), k = y("el-input"), ne = y("el-option"), R = y("el-select"), B = y("el-cascader"), V = y("el-checkbox"), H = y("el-color-picker"), U = y("el-date-picker"), re = y("el-input-number"), W = y("el-input-tag"), ie = y("el-input-otp"), ae = y("el-mention"), G = y("el-radio"), oe = y("el-radio-group"), se = y("el-rate"), ce = y("el-select-v2"), K = y("el-slider"), le = y("el-switch"), ue = y("el-time-picker"), de = y("el-time-select"), fe = y("el-transfer"), pe = y("el-tree-select"), me = y("el-form-item"), he = y("el-col");
|
|
891
|
+
return m(), n(he, {
|
|
892
892
|
class: "dynamic-field-col",
|
|
893
893
|
span: c.child.span ?? 6,
|
|
894
894
|
offset: c.child.offset
|
|
@@ -896,28 +896,28 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
896
896
|
default: S(() => [a("div", {
|
|
897
897
|
class: "form-node",
|
|
898
898
|
"data-field-key": c.child.key
|
|
899
|
-
}, [s(
|
|
899
|
+
}, [s(me, {
|
|
900
900
|
"label-width": c.child.labelWidth ?? c.child["label-width"],
|
|
901
901
|
prop: c.prop ?? c.child.key,
|
|
902
902
|
required: c.child.required,
|
|
903
|
-
rules:
|
|
903
|
+
rules: M.value
|
|
904
904
|
}, {
|
|
905
905
|
label: S(() => [a("span", vi, [v(t.$slots, "action", {}, void 0, !0), a("span", null, b(c.child.label), 1)])]),
|
|
906
906
|
default: S(() => [c.child.type === "upload" ? (m(), i("div", yi, [
|
|
907
|
-
|
|
907
|
+
N.value && !F.value.length ? (m(), n(d, { key: 0 }, {
|
|
908
908
|
default: S(() => [...l[21] ||= [o("-", -1)]]),
|
|
909
909
|
_: 1
|
|
910
910
|
})) : r("", !0),
|
|
911
|
-
|
|
912
|
-
key:
|
|
911
|
+
F.value.length ? (m(), i("div", bi, [(m(!0), i(e, null, _(F.value, (e, t) => (m(), i("div", {
|
|
912
|
+
key: w(e, t),
|
|
913
913
|
class: "upload-list-item"
|
|
914
914
|
}, [e.url ? (m(), n(p, {
|
|
915
915
|
key: 0,
|
|
916
916
|
class: "upload-list-image",
|
|
917
917
|
src: e.url,
|
|
918
918
|
alt: e.name,
|
|
919
|
-
"preview-src-list":
|
|
920
|
-
"initial-index":
|
|
919
|
+
"preview-src-list": C(e) ? te.value : [],
|
|
920
|
+
"initial-index": C(e) ? T(t) : 0,
|
|
921
921
|
fit: "cover",
|
|
922
922
|
"preview-teleported": "",
|
|
923
923
|
"z-index": 3e3
|
|
@@ -925,7 +925,7 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
925
925
|
error: S(() => [a("div", {
|
|
926
926
|
class: "upload-list-file",
|
|
927
927
|
title: e.name,
|
|
928
|
-
onClick:
|
|
928
|
+
onClick: ee((t) => O(e), ["stop"])
|
|
929
929
|
}, [a("span", null, b(e.name || "文件"), 1)], 8, xi)]),
|
|
930
930
|
_: 2
|
|
931
931
|
}, 1032, [
|
|
@@ -937,20 +937,20 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
937
937
|
key: 1,
|
|
938
938
|
class: "upload-list-file",
|
|
939
939
|
title: e.name
|
|
940
|
-
}, [a("span", null, b(e.name || "文件"), 1)], 8, Si)),
|
|
940
|
+
}, [a("span", null, b(e.name || "文件"), 1)], 8, Si)), P.value ? (m(), i("button", {
|
|
941
941
|
key: 2,
|
|
942
942
|
class: "upload-list-remove",
|
|
943
943
|
type: "button",
|
|
944
944
|
"aria-label": "移除文件",
|
|
945
|
-
onClick:
|
|
945
|
+
onClick: ee((e) => D(t), ["stop"])
|
|
946
946
|
}, " × ", 8, Ci)) : r("", !0)]))), 128))])) : r("", !0),
|
|
947
|
-
|
|
947
|
+
P.value && L.value ? (m(), n(g, u({ key: 2 }, z.value, {
|
|
948
948
|
class: "upload-field-trigger",
|
|
949
949
|
action: z.value.action ?? "#",
|
|
950
950
|
"auto-upload": z.value.autoUpload ?? !1,
|
|
951
|
-
"file-list":
|
|
951
|
+
"file-list": I.value,
|
|
952
952
|
"show-file-list": !1,
|
|
953
|
-
"onUpdate:fileList":
|
|
953
|
+
"onUpdate:fileList": E
|
|
954
954
|
}), {
|
|
955
955
|
default: S(() => [s(h, null, {
|
|
956
956
|
default: S(() => [...l[22] ||= [o("上传文件", -1)]]),
|
|
@@ -962,7 +962,7 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
962
962
|
"auto-upload",
|
|
963
963
|
"file-list"
|
|
964
964
|
])) : r("", !0)
|
|
965
|
-
])) : c.child.isText ? (m(), i("div", wi, [Array.isArray(c.modelValue) ? (m(), i(e, { key: 0 }, [c.modelValue.length ? (m(!0), i(e, { key: 0 }, _(
|
|
965
|
+
])) : c.child.isText ? (m(), i("div", wi, [Array.isArray(c.modelValue) ? (m(), i(e, { key: 0 }, [c.modelValue.length ? (m(!0), i(e, { key: 0 }, _(j(c.modelValue), (e, t) => (m(), n(x, {
|
|
966
966
|
key: t,
|
|
967
967
|
class: "text-field-tag"
|
|
968
968
|
}, {
|
|
@@ -972,9 +972,9 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
972
972
|
default: S(() => [...l[23] ||= [o("-", -1)]]),
|
|
973
973
|
_: 1
|
|
974
974
|
}))], 64)) : (m(), n(d, { key: 1 }, {
|
|
975
|
-
default: S(() => [o(b(
|
|
975
|
+
default: S(() => [o(b(A(c.modelValue)), 1)]),
|
|
976
976
|
_: 1
|
|
977
|
-
}))])) : c.child.type === "input" ? (m(), n(
|
|
977
|
+
}))])) : c.child.type === "input" ? (m(), n(k, u({ key: 2 }, z.value, {
|
|
978
978
|
"model-value": c.modelValue ?? "",
|
|
979
979
|
"onUpdate:modelValue": l[0] ||= (e) => f("update:modelValue", e)
|
|
980
980
|
}), null, 16, ["model-value"])) : c.child.type === "select" ? (m(), n(R, u({ key: 3 }, z.value, {
|
|
@@ -1017,21 +1017,21 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
1017
1017
|
"min",
|
|
1018
1018
|
"max",
|
|
1019
1019
|
"step"
|
|
1020
|
-
])) : c.child.type === "inputTag" ? (m(), n(
|
|
1020
|
+
])) : c.child.type === "inputTag" ? (m(), n(W, u({ key: 10 }, z.value, {
|
|
1021
1021
|
"model-value": Array.isArray(c.modelValue) ? c.modelValue : [],
|
|
1022
1022
|
"onUpdate:modelValue": l[8] ||= (e) => f("update:modelValue", e)
|
|
1023
|
-
}), null, 16, ["model-value"])) : c.child.type === "inputOTP" ? (m(), n(
|
|
1023
|
+
}), null, 16, ["model-value"])) : c.child.type === "inputOTP" ? (m(), n(ie, u({ key: 11 }, z.value, {
|
|
1024
1024
|
"model-value": c.modelValue ?? "",
|
|
1025
1025
|
"onUpdate:modelValue": l[9] ||= (e) => f("update:modelValue", e)
|
|
1026
|
-
}), null, 16, ["model-value"])) : c.child.type === "mention" ? (m(), n(
|
|
1026
|
+
}), null, 16, ["model-value"])) : c.child.type === "mention" ? (m(), n(ae, u({ key: 12 }, z.value, {
|
|
1027
1027
|
"model-value": c.modelValue ?? "",
|
|
1028
1028
|
options: c.child.options ?? [],
|
|
1029
1029
|
"onUpdate:modelValue": l[10] ||= (e) => f("update:modelValue", e)
|
|
1030
|
-
}), null, 16, ["model-value", "options"])) : c.child.type === "radio" ? (m(), n(
|
|
1030
|
+
}), null, 16, ["model-value", "options"])) : c.child.type === "radio" ? (m(), n(oe, u({ key: 13 }, z.value, {
|
|
1031
1031
|
"model-value": c.modelValue,
|
|
1032
1032
|
"onUpdate:modelValue": l[11] ||= (e) => f("update:modelValue", e)
|
|
1033
1033
|
}), {
|
|
1034
|
-
default: S(() => [(m(!0), i(e, null, _(c.child.options ?? [], (e) => (m(), n(
|
|
1034
|
+
default: S(() => [(m(!0), i(e, null, _(c.child.options ?? [], (e) => (m(), n(G, {
|
|
1035
1035
|
key: e.value,
|
|
1036
1036
|
value: e.value
|
|
1037
1037
|
}, {
|
|
@@ -1039,10 +1039,10 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
1039
1039
|
_: 2
|
|
1040
1040
|
}, 1032, ["value"]))), 128))]),
|
|
1041
1041
|
_: 1
|
|
1042
|
-
}, 16, ["model-value"])) : c.child.type === "rate" ? (m(), n(
|
|
1042
|
+
}, 16, ["model-value"])) : c.child.type === "rate" ? (m(), n(se, u({ key: 14 }, z.value, {
|
|
1043
1043
|
"model-value": c.modelValue,
|
|
1044
1044
|
"onUpdate:modelValue": l[12] ||= (e) => f("update:modelValue", e)
|
|
1045
|
-
}), null, 16, ["model-value"])) : c.child.type === "virtualizedSelect" ? (m(), n(
|
|
1045
|
+
}), null, 16, ["model-value"])) : c.child.type === "virtualizedSelect" ? (m(), n(ce, u({ key: 15 }, z.value, {
|
|
1046
1046
|
"model-value": c.modelValue,
|
|
1047
1047
|
"value-key": c.child.valueKey ?? "value",
|
|
1048
1048
|
options: c.child.options ?? [],
|
|
@@ -1051,7 +1051,7 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
1051
1051
|
"model-value",
|
|
1052
1052
|
"value-key",
|
|
1053
1053
|
"options"
|
|
1054
|
-
])) : c.child.type === "slider" ? (m(), n(
|
|
1054
|
+
])) : c.child.type === "slider" ? (m(), n(K, u({ key: 16 }, z.value, {
|
|
1055
1055
|
"model-value": c.modelValue,
|
|
1056
1056
|
min: c.child.min,
|
|
1057
1057
|
max: c.child.max,
|
|
@@ -1062,24 +1062,24 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
1062
1062
|
"min",
|
|
1063
1063
|
"max",
|
|
1064
1064
|
"step"
|
|
1065
|
-
])) : c.child.type === "switch" ? (m(), n(
|
|
1065
|
+
])) : c.child.type === "switch" ? (m(), n(le, u({ key: 17 }, z.value, {
|
|
1066
1066
|
"model-value": c.modelValue,
|
|
1067
1067
|
"onUpdate:modelValue": l[15] ||= (e) => f("update:modelValue", e)
|
|
1068
|
-
}), null, 16, ["model-value"])) : c.child.type === "timePicker" ? (m(), n(
|
|
1068
|
+
}), null, 16, ["model-value"])) : c.child.type === "timePicker" ? (m(), n(ue, u({ key: 18 }, z.value, {
|
|
1069
1069
|
"model-value": c.modelValue,
|
|
1070
1070
|
"onUpdate:modelValue": l[16] ||= (e) => f("update:modelValue", e)
|
|
1071
|
-
}), null, 16, ["model-value"])) : c.child.type === "timeSelect" ? (m(), n(
|
|
1071
|
+
}), null, 16, ["model-value"])) : c.child.type === "timeSelect" ? (m(), n(de, u({ key: 19 }, z.value, {
|
|
1072
1072
|
"model-value": c.modelValue,
|
|
1073
1073
|
"onUpdate:modelValue": l[17] ||= (e) => f("update:modelValue", e)
|
|
1074
|
-
}), null, 16, ["model-value"])) : c.child.type === "transfer" ? (m(), n(
|
|
1074
|
+
}), null, 16, ["model-value"])) : c.child.type === "transfer" ? (m(), n(fe, u({ key: 20 }, z.value, {
|
|
1075
1075
|
data: c.child.options ?? [],
|
|
1076
1076
|
"model-value": Array.isArray(c.modelValue) ? c.modelValue : [],
|
|
1077
1077
|
"onUpdate:modelValue": l[18] ||= (e) => f("update:modelValue", e)
|
|
1078
|
-
}), null, 16, ["data", "model-value"])) : c.child.type === "treeSelect" ? (m(), n(
|
|
1078
|
+
}), null, 16, ["data", "model-value"])) : c.child.type === "treeSelect" ? (m(), n(pe, u({ key: 21 }, z.value, {
|
|
1079
1079
|
"model-value": c.modelValue,
|
|
1080
1080
|
data: c.child.options ?? [],
|
|
1081
1081
|
"onUpdate:modelValue": l[19] ||= (e) => f("update:modelValue", e)
|
|
1082
|
-
}), null, 16, ["model-value", "data"])) : (m(), n(
|
|
1082
|
+
}), null, 16, ["model-value", "data"])) : (m(), n(k, u({ key: 22 }, z.value, {
|
|
1083
1083
|
"model-value": c.modelValue ?? "",
|
|
1084
1084
|
"onUpdate:modelValue": l[20] ||= (e) => f("update:modelValue", e)
|
|
1085
1085
|
}), null, 16, ["model-value"]))]),
|
|
@@ -1098,7 +1098,7 @@ var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
|
1098
1098
|
let n = e.__vccOpts || e;
|
|
1099
1099
|
for (let [e, r] of t) n[e] = r;
|
|
1100
1100
|
return n;
|
|
1101
|
-
}, Di = /*#__PURE__*/ Ei(Ti, [["__scopeId", "data-v-
|
|
1101
|
+
}, Di = /*#__PURE__*/ Ei(Ti, [["__scopeId", "data-v-96753d91"]]);
|
|
1102
1102
|
//#endregion
|
|
1103
1103
|
//#region src/packages/form/linkage.ts
|
|
1104
1104
|
function Oi(e) {
|
|
@@ -1152,7 +1152,8 @@ function Ii(e, t, n, r, i) {
|
|
|
1152
1152
|
...e,
|
|
1153
1153
|
visible: e.visible ?? !0,
|
|
1154
1154
|
clearOnHide: e.clearOnHide ?? !1,
|
|
1155
|
-
border: e.border ?? !0
|
|
1155
|
+
border: e.border ?? !0,
|
|
1156
|
+
animate: e.animate ?? !1
|
|
1156
1157
|
};
|
|
1157
1158
|
e.dictCode && i[e.dictCode] && (o.options = i[e.dictCode]);
|
|
1158
1159
|
let s = {
|
|
@@ -1314,10 +1315,10 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1314
1315
|
function S() {
|
|
1315
1316
|
for (let e of y(d.value, [], !1)) m.add(e);
|
|
1316
1317
|
}
|
|
1317
|
-
function
|
|
1318
|
-
if (e.dictLoader) for (let t of u.value) e.dicts[t] || o[t] || s.has(t) ||
|
|
1318
|
+
function ee() {
|
|
1319
|
+
if (e.dictLoader) for (let t of u.value) e.dicts[t] || o[t] || s.has(t) || D(t);
|
|
1319
1320
|
}
|
|
1320
|
-
async function
|
|
1321
|
+
async function D(t) {
|
|
1321
1322
|
if (e.dictLoader) {
|
|
1322
1323
|
s.add(t);
|
|
1323
1324
|
try {
|
|
@@ -1328,8 +1329,8 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1328
1329
|
}
|
|
1329
1330
|
}
|
|
1330
1331
|
}
|
|
1331
|
-
x(u, () =>
|
|
1332
|
-
function
|
|
1332
|
+
x(u, () => ee(), { immediate: !0 }), x(() => e.dictLoader, () => ee(), { immediate: !0 });
|
|
1333
|
+
function O(e, t) {
|
|
1333
1334
|
let n = e;
|
|
1334
1335
|
for (let e of t) {
|
|
1335
1336
|
if (!n || typeof n != "object" || !(e in n)) return;
|
|
@@ -1337,10 +1338,10 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1337
1338
|
}
|
|
1338
1339
|
return n;
|
|
1339
1340
|
}
|
|
1340
|
-
function
|
|
1341
|
-
return
|
|
1341
|
+
function k(t) {
|
|
1342
|
+
return O(e.modelValue, t);
|
|
1342
1343
|
}
|
|
1343
|
-
function
|
|
1344
|
+
function A(e, t, n) {
|
|
1344
1345
|
let r = { ...e }, i = r;
|
|
1345
1346
|
for (let e = 0; e < t.length - 1; e++) {
|
|
1346
1347
|
let n = t[e], r = i[n];
|
|
@@ -1348,7 +1349,7 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1348
1349
|
}
|
|
1349
1350
|
return i[t[t.length - 1]] = n, r;
|
|
1350
1351
|
}
|
|
1351
|
-
function
|
|
1352
|
+
function j(e, t) {
|
|
1352
1353
|
let n = gi(e), r = (e, t, i) => {
|
|
1353
1354
|
for (let a of e) {
|
|
1354
1355
|
if (a.type === "block") {
|
|
@@ -1357,18 +1358,18 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1357
1358
|
continue;
|
|
1358
1359
|
}
|
|
1359
1360
|
if (a.utc) {
|
|
1360
|
-
let e = [...t, a.key], r =
|
|
1361
|
-
r instanceof Date && (n =
|
|
1361
|
+
let e = [...t, a.key], r = O(n, e);
|
|
1362
|
+
r instanceof Date && (n = A(n, e, r.toISOString()));
|
|
1362
1363
|
}
|
|
1363
1364
|
}
|
|
1364
1365
|
};
|
|
1365
1366
|
return r(t, [], !1), n;
|
|
1366
1367
|
}
|
|
1367
|
-
function
|
|
1368
|
-
let i =
|
|
1368
|
+
function M(t, r) {
|
|
1369
|
+
let i = A(e.modelValue, t, r);
|
|
1369
1370
|
n("update:modelValue", i), n("change", i, t.join("."), r);
|
|
1370
1371
|
}
|
|
1371
|
-
function
|
|
1372
|
+
function N(e, t) {
|
|
1372
1373
|
let n = { ...e }, r = n;
|
|
1373
1374
|
for (let e = 0; e < t.length - 1; e++) {
|
|
1374
1375
|
let i = t[e], a = r[i];
|
|
@@ -1377,33 +1378,33 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1377
1378
|
}
|
|
1378
1379
|
return delete r[t[t.length - 1]], n;
|
|
1379
1380
|
}
|
|
1380
|
-
function
|
|
1381
|
+
function P(e) {
|
|
1381
1382
|
try {
|
|
1382
1383
|
return JSON.stringify(e);
|
|
1383
1384
|
} catch {
|
|
1384
1385
|
return String(e);
|
|
1385
1386
|
}
|
|
1386
1387
|
}
|
|
1387
|
-
function
|
|
1388
|
+
function F() {
|
|
1388
1389
|
let t = gi(e.modelValue), r = !1, i = /* @__PURE__ */ new Map();
|
|
1389
1390
|
for (let n of Hi(e.config, e.modelValue)) {
|
|
1390
|
-
let e =
|
|
1391
|
-
i.set(a, e), _.get(a) !== e &&
|
|
1391
|
+
let e = P(n.value), a = `${n.path.join("/")}:${n.ruleIndex}:${e}`;
|
|
1392
|
+
i.set(a, e), _.get(a) !== e && O(t, n.path) !== n.value && (t = A(t, n.path, n.value), r = !0);
|
|
1392
1393
|
}
|
|
1393
1394
|
_ = i;
|
|
1394
1395
|
let a = zi(e.config, t);
|
|
1395
|
-
for (let e of a)
|
|
1396
|
+
for (let e of a) O(t, e) !== void 0 && (t = N(t, e), r = !0);
|
|
1396
1397
|
r && (f = gi(t), n("update:modelValue", t), n("change", t));
|
|
1397
1398
|
}
|
|
1398
|
-
p(
|
|
1399
|
-
async function
|
|
1399
|
+
p(F), x(() => e.modelValue, () => F(), { deep: !0 });
|
|
1400
|
+
async function I() {
|
|
1400
1401
|
if (a.value) try {
|
|
1401
1402
|
await a.value.validate();
|
|
1402
1403
|
} catch (e) {
|
|
1403
1404
|
console.log(e);
|
|
1404
1405
|
return;
|
|
1405
1406
|
}
|
|
1406
|
-
let t =
|
|
1407
|
+
let t = j(e.modelValue, e.config);
|
|
1407
1408
|
console.log(t), n("submit", t);
|
|
1408
1409
|
}
|
|
1409
1410
|
function te() {
|
|
@@ -1430,23 +1431,23 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1430
1431
|
}
|
|
1431
1432
|
function B(e) {
|
|
1432
1433
|
let t = r[e.key], n = t ? t({ node: e }) : [l("span", null, e.label || e.key)];
|
|
1433
|
-
return l(
|
|
1434
|
+
return l(w, {
|
|
1434
1435
|
key: e.key,
|
|
1435
1436
|
span: e.span ?? 6,
|
|
1436
1437
|
offset: e.offset
|
|
1437
1438
|
}, () => [l("div", { class: "form-slot" }, n)]);
|
|
1438
1439
|
}
|
|
1439
1440
|
function V(t, n) {
|
|
1440
|
-
let r =
|
|
1441
|
+
let r = k(n) ?? t.default ?? "", i = {
|
|
1441
1442
|
child: t,
|
|
1442
1443
|
prop: n.join("."),
|
|
1443
1444
|
modelValue: r,
|
|
1444
|
-
"onUpdate:modelValue": (e) =>
|
|
1445
|
+
"onUpdate:modelValue": (e) => M(n, e)
|
|
1445
1446
|
}, a = e.fieldAction?.(t) ?? null;
|
|
1446
1447
|
return l(Di, i, a ? { action: () => [a] } : void 0);
|
|
1447
1448
|
}
|
|
1448
1449
|
function H(t, n, r) {
|
|
1449
|
-
let i = [...n, t.key].join("/"), a = m.has(i), o = r ? [...n, t.key] : n, s = (t.children ?? []).map((e) => U(e, o)).filter((e) => e !== null), c = e.blockAction?.(t) ?? null, u = ["form-block-header"], d = l(
|
|
1450
|
+
let i = [...n, t.key].join("/"), a = m.has(i), o = r ? [...n, t.key] : n, s = (t.children ?? []).map((e) => U(e, o)).filter((e) => e !== null), c = e.blockAction?.(t) ?? null, u = ["form-block-header"], d = l(w, {
|
|
1450
1451
|
key: `${t.key}-header`,
|
|
1451
1452
|
span: 24
|
|
1452
1453
|
}, () => [l("div", { class: u }, [l("div", { class: "form-block-header-content" }, [l("div", { class: "form-block-header-title" }, [c, t.label ? l("h3", { class: "form-block-title" }, t.label) : null].filter(Boolean)), t.description ? l("p", { class: "form-block-description" }, t.description) : null].filter(Boolean)), l("div", { class: "form-block-header-actions" }, [e.showCollapse ? l("button", {
|
|
@@ -1454,35 +1455,38 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1454
1455
|
type: "button",
|
|
1455
1456
|
"aria-expanded": !a,
|
|
1456
1457
|
onClick: () => v(i)
|
|
1457
|
-
}, a ? "▸" : "▾") : null].filter(Boolean))])]), f = l("div", { class: ["form-block-body", { "is-collapsed": a }] }, () => [l("div", { class: "form-block-body-inner" }, () => [l(
|
|
1458
|
+
}, a ? "▸" : "▾") : null].filter(Boolean))])]), f = l("div", { class: ["form-block-body", { "is-collapsed": a }] }, () => [l("div", { class: "form-block-body-inner" }, () => [l(E, { gutter: 20 }, () => s.filter(Boolean))])]), p = [...n, t.key].join("/");
|
|
1458
1459
|
return l("div", {
|
|
1459
1460
|
class: "form-node",
|
|
1460
1461
|
key: t.key,
|
|
1461
1462
|
"data-block-path": p
|
|
1462
1463
|
}, [l("div", {
|
|
1463
|
-
class: ["form-block", {
|
|
1464
|
+
class: ["form-block", {
|
|
1465
|
+
"form-block--borderless": t.border === !1,
|
|
1466
|
+
"form-block--animate": t.animate === !0
|
|
1467
|
+
}],
|
|
1464
1468
|
style: t.indent ? { marginLeft: `${t.indent}px` } : void 0
|
|
1465
|
-
}, [l(
|
|
1469
|
+
}, [l(E, { gutter: 20 }, () => [d].filter(Boolean)), f])]);
|
|
1466
1470
|
}
|
|
1467
1471
|
function U(e, t) {
|
|
1468
|
-
return e.visible ? e.type === "block" ? l(
|
|
1472
|
+
return e.visible ? e.type === "block" ? l(w, {
|
|
1469
1473
|
key: e.key,
|
|
1470
1474
|
span: e.span ?? 24,
|
|
1471
1475
|
offset: e.offset
|
|
1472
1476
|
}, () => [H(e, t, !0)]) : e.type === "slot" ? B(e) : V(e, [...t, e.key]) : null;
|
|
1473
1477
|
}
|
|
1474
1478
|
function re(e) {
|
|
1475
|
-
return e.visible ? e.type === "block" ? H(e, [], !1) : l(
|
|
1479
|
+
return e.visible ? e.type === "block" ? H(e, [], !1) : l(E, {
|
|
1476
1480
|
key: e.key,
|
|
1477
1481
|
gutter: 20
|
|
1478
1482
|
}, () => [U(e, [])]) : null;
|
|
1479
1483
|
}
|
|
1480
1484
|
return () => {
|
|
1481
|
-
let t = d.value.map(re).filter((e) => e !== null), n = [e.showSubmit ? l(
|
|
1485
|
+
let t = d.value.map(re).filter((e) => e !== null), n = [e.showSubmit ? l(C, {
|
|
1482
1486
|
type: "primary",
|
|
1483
1487
|
nativeType: "button",
|
|
1484
|
-
onClick:
|
|
1485
|
-
}, () => "提交") : null, e.showReset ? l(
|
|
1488
|
+
onClick: I
|
|
1489
|
+
}, () => "提交") : null, e.showReset ? l(C, {
|
|
1486
1490
|
nativeType: "button",
|
|
1487
1491
|
onClick: z
|
|
1488
1492
|
}, () => "重置") : null].filter((e) => e !== null), r = y(d.value, [], !1), i = e.showCollapse && r.length > 0 ? l("div", { class: "form-toolbar" }, [l("button", {
|
|
@@ -1493,7 +1497,7 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1493
1497
|
class: "form-block-header-action",
|
|
1494
1498
|
type: "button",
|
|
1495
1499
|
onClick: S
|
|
1496
|
-
}, "全部收起")]) : null, o = l(
|
|
1500
|
+
}, "全部收起")]) : null, o = l(T, {
|
|
1497
1501
|
ref: a,
|
|
1498
1502
|
class: "form-engine",
|
|
1499
1503
|
model: e.modelValue,
|
|
@@ -1502,16 +1506,19 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1502
1506
|
return l("div", { class: "form-wrapper" }, () => [i, o].filter(Boolean));
|
|
1503
1507
|
};
|
|
1504
1508
|
}
|
|
1505
|
-
}), [["__scopeId", "data-v-
|
|
1509
|
+
}), [["__scopeId", "data-v-49b04ea7"]]), Gi = { class: "create-form" }, Ki = { class: "builder-header" }, qi = { class: "header-actions" }, Ji = { class: "global-config" }, Yi = { class: "builder-grid" }, Xi = { class: "palette" }, Zi = ["onDragstart"], Qi = {
|
|
1506
1510
|
key: 0,
|
|
1507
1511
|
class: "palette-compact"
|
|
1508
1512
|
}, $i = {
|
|
1509
1513
|
key: 12,
|
|
1510
1514
|
class: "palette-compact"
|
|
1511
|
-
}, ea = {
|
|
1515
|
+
}, ea = {
|
|
1516
|
+
key: 13,
|
|
1517
|
+
class: "palette-compact"
|
|
1518
|
+
}, ta = { class: "preview-header" }, na = { class: "preview-header-actions" }, ra = { class: "breadcrumb" }, ia = { key: 0 }, aa = { class: "linkage-editor" }, oa = { class: "linkage-rule-title" }, sa = { class: "linkage-when" }, ca = { class: "linkage-effects" }, la = { class: "option-editor" }, ua = {
|
|
1512
1519
|
key: 1,
|
|
1513
1520
|
class: "editor-empty"
|
|
1514
|
-
},
|
|
1521
|
+
}, da = { class: "code-panels" }, fa = { class: "code-panel" }, pa = { class: "code-panel" }, ma = /*#__PURE__*/ Ei(/* @__PURE__ */ c({
|
|
1515
1522
|
name: "CreateForm",
|
|
1516
1523
|
__name: "CreateForm",
|
|
1517
1524
|
setup(c) {
|
|
@@ -1582,6 +1589,10 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1582
1589
|
type: "transfer",
|
|
1583
1590
|
label: "穿梭框"
|
|
1584
1591
|
},
|
|
1592
|
+
{
|
|
1593
|
+
type: "upload",
|
|
1594
|
+
label: "附件"
|
|
1595
|
+
},
|
|
1585
1596
|
{
|
|
1586
1597
|
type: "rate",
|
|
1587
1598
|
label: "评分"
|
|
@@ -1607,7 +1618,15 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1607
1618
|
"mention",
|
|
1608
1619
|
"virtualizedSelect"
|
|
1609
1620
|
], h = 0;
|
|
1610
|
-
function v(e
|
|
1621
|
+
function v(e) {
|
|
1622
|
+
let t = URL.createObjectURL(e.file), n = {
|
|
1623
|
+
id: `local-${Date.now()}`,
|
|
1624
|
+
url: t,
|
|
1625
|
+
path: t
|
|
1626
|
+
};
|
|
1627
|
+
return e.file.url = t, e.onSuccess(n, e.file), Promise.resolve(n);
|
|
1628
|
+
}
|
|
1629
|
+
function C(e, t, n) {
|
|
1611
1630
|
let r = {
|
|
1612
1631
|
key: t,
|
|
1613
1632
|
label: n,
|
|
@@ -1619,7 +1638,14 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1619
1638
|
return e === "textarea" && (r.props = {
|
|
1620
1639
|
type: "textarea",
|
|
1621
1640
|
rows: 3
|
|
1622
|
-
}), e === "block" && (r.children = [], r.border = !0, r.span = 24, r.indent = 0, delete r.default),
|
|
1641
|
+
}), e === "block" && (r.children = [], r.border = !0, r.animate = !1, r.span = 24, r.indent = 0, delete r.default), e === "upload" && (r.default = [], r.span = 24, r.props = {
|
|
1642
|
+
action: "/api/v1/admin/upload",
|
|
1643
|
+
autoUpload: !0,
|
|
1644
|
+
multiple: !0,
|
|
1645
|
+
accept: "image/*,.pdf,.txt",
|
|
1646
|
+
"list-type": "picture-card",
|
|
1647
|
+
httpRequest: v
|
|
1648
|
+
}), (e === "switch" || e === "checkbox") && (r.default = !1), (e === "inputNumber" || e === "rate" || e === "slider") && (r.default = 0), (e === "inputTag" || e === "transfer") && (r.default = []), p.includes(e) && (r.options = e === "select" || e === "radio" ? [{
|
|
1623
1649
|
label: "选项一",
|
|
1624
1650
|
value: "1"
|
|
1625
1651
|
}, {
|
|
@@ -1635,8 +1661,17 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1635
1661
|
filterable: !1,
|
|
1636
1662
|
labelWidth: "",
|
|
1637
1663
|
border: !0,
|
|
1664
|
+
animate: !1,
|
|
1638
1665
|
isText: !1
|
|
1639
|
-
}), F = g(""), I = g(""),
|
|
1666
|
+
}), F = g(""), I = g(""), te = t(() => T.value?.linkage ?? []), ne = t(() => Oe(B.value[0]?.children ?? []));
|
|
1667
|
+
function L(e, t) {
|
|
1668
|
+
let n = T.value?.props;
|
|
1669
|
+
return !n || typeof n != "object" ? t : n[e] ?? t;
|
|
1670
|
+
}
|
|
1671
|
+
function R(e, t) {
|
|
1672
|
+
T.value && ((!T.value.props || typeof T.value.props != "object") && (T.value.props = {}), T.value.props[e] = t);
|
|
1673
|
+
}
|
|
1674
|
+
let z = [
|
|
1640
1675
|
"eq",
|
|
1641
1676
|
"neq",
|
|
1642
1677
|
"in",
|
|
@@ -1649,18 +1684,18 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1649
1684
|
"lte",
|
|
1650
1685
|
"empty",
|
|
1651
1686
|
"notEmpty"
|
|
1652
|
-
],
|
|
1687
|
+
], B = t(() => [{
|
|
1653
1688
|
key: "root",
|
|
1654
1689
|
label: "根表单",
|
|
1655
1690
|
type: "block",
|
|
1656
1691
|
border: !1,
|
|
1657
1692
|
indent: 0,
|
|
1658
1693
|
children: w.value
|
|
1659
|
-
}]),
|
|
1660
|
-
function
|
|
1661
|
-
return e.default === void 0 ? e.type === "switch" || e.type === "checkbox" ? !1 : e.type === "inputNumber" || e.type === "rate" || e.type === "slider" ? 0 : e.type === "inputTag" || e.type === "transfer" ? [] : "" : e.default;
|
|
1694
|
+
}]), V = t(() => JSON.stringify(B.value, null, 2));
|
|
1695
|
+
function H(e) {
|
|
1696
|
+
return e.default === void 0 ? e.type === "switch" || e.type === "checkbox" ? !1 : e.type === "inputNumber" || e.type === "rate" || e.type === "slider" ? 0 : e.type === "inputTag" || e.type === "transfer" || e.type === "upload" ? [] : "" : e.default;
|
|
1662
1697
|
}
|
|
1663
|
-
function
|
|
1698
|
+
function U(e, t, n) {
|
|
1664
1699
|
let r = e;
|
|
1665
1700
|
for (let e = 0; e < t.length - 1; e++) {
|
|
1666
1701
|
let n = t[e];
|
|
@@ -1668,67 +1703,67 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1668
1703
|
}
|
|
1669
1704
|
r[t[t.length - 1]] = n;
|
|
1670
1705
|
}
|
|
1671
|
-
function
|
|
1706
|
+
function re(e, t = [], n = !1) {
|
|
1672
1707
|
let r = {};
|
|
1673
1708
|
for (let i of e) {
|
|
1674
1709
|
if (i.type === "block") {
|
|
1675
1710
|
let e = n ? [...t, i.key] : t;
|
|
1676
|
-
Object.assign(r,
|
|
1711
|
+
Object.assign(r, re(i.children ?? [], e, !0));
|
|
1677
1712
|
continue;
|
|
1678
1713
|
}
|
|
1679
|
-
|
|
1714
|
+
U(r, [...t, i.key], H(i));
|
|
1680
1715
|
}
|
|
1681
1716
|
return r;
|
|
1682
1717
|
}
|
|
1683
|
-
let
|
|
1718
|
+
let W = t(() => E.value?.children ?? w.value), ie = g({}), ae = t(() => JSON.stringify(ie.value, null, 2));
|
|
1684
1719
|
x(w, () => {
|
|
1685
|
-
|
|
1720
|
+
ie.value = re(B.value), d(J);
|
|
1686
1721
|
}, {
|
|
1687
1722
|
deep: !0,
|
|
1688
1723
|
immediate: !0
|
|
1689
1724
|
}), x(T, () => d(J), { deep: !0 });
|
|
1690
|
-
let
|
|
1691
|
-
function ae(e) {
|
|
1692
|
-
T.value = e, ie.value && !Array.isArray(e.options) && (e.options = []), d(J);
|
|
1693
|
-
}
|
|
1725
|
+
let G = t(() => p.includes(T.value?.type ?? ""));
|
|
1694
1726
|
function oe(e) {
|
|
1727
|
+
T.value = e, G.value && !Array.isArray(e.options) && (e.options = []), d(J);
|
|
1728
|
+
}
|
|
1729
|
+
function se(e) {
|
|
1695
1730
|
Array.isArray(e.children) || (e.children = []), E.value = e, T.value = e, d(J);
|
|
1696
1731
|
}
|
|
1697
|
-
function
|
|
1732
|
+
function ce() {
|
|
1698
1733
|
E.value = null;
|
|
1699
1734
|
}
|
|
1700
|
-
function
|
|
1735
|
+
function K(e) {
|
|
1701
1736
|
let t = e.target;
|
|
1702
1737
|
if (!t?.closest(".field-drag-handle, .block-drag-handle, .form-item-label, .form-block-header-title")) return;
|
|
1703
1738
|
let n = t?.closest("[data-field-key]");
|
|
1704
1739
|
if (n?.dataset.fieldKey) {
|
|
1705
|
-
let e =
|
|
1740
|
+
let e = ke(n.dataset.fieldKey);
|
|
1706
1741
|
if (e) {
|
|
1707
|
-
let t =
|
|
1708
|
-
t && t.key !== "root" && (E.value = t),
|
|
1742
|
+
let t = Ae(e.key);
|
|
1743
|
+
t && t.key !== "root" && (E.value = t), oe(e), N.value = !0;
|
|
1709
1744
|
return;
|
|
1710
1745
|
}
|
|
1711
1746
|
}
|
|
1712
1747
|
let r = t?.closest("[data-block-path]");
|
|
1713
1748
|
if (r?.dataset.blockPath) {
|
|
1714
|
-
let e =
|
|
1715
|
-
e && (
|
|
1749
|
+
let e = De(r.dataset.blockPath.split("/"));
|
|
1750
|
+
e && (oe(e), N.value = !0);
|
|
1716
1751
|
}
|
|
1717
1752
|
}
|
|
1718
1753
|
function le() {
|
|
1719
1754
|
let e = T.value;
|
|
1720
1755
|
if (!e) return;
|
|
1721
|
-
let t =
|
|
1722
|
-
t >= 0 &&
|
|
1756
|
+
let t = W.value.indexOf(e);
|
|
1757
|
+
t >= 0 && Ie(t), T.value || (N.value = !1);
|
|
1723
1758
|
}
|
|
1724
1759
|
function ue() {
|
|
1725
1760
|
T.value && (N.value = !0);
|
|
1726
1761
|
}
|
|
1727
|
-
function
|
|
1762
|
+
function de() {
|
|
1728
1763
|
let e = (t) => {
|
|
1729
1764
|
for (let n of t) {
|
|
1730
1765
|
if (n.type === "block") {
|
|
1731
|
-
n.border = P.value.border, e(n.children ?? []);
|
|
1766
|
+
n.border = P.value.border, n.animate = P.value.animate, e(n.children ?? []);
|
|
1732
1767
|
continue;
|
|
1733
1768
|
}
|
|
1734
1769
|
n.required = P.value.required, n.labelPosition = P.value.labelPosition, n.span = P.value.span, n.clearable = P.value.clearable, p.includes(n.type) && (n.filterable = P.value.filterable), n.isText = P.value.isText, P.value.labelWidth ? n.labelWidth = P.value.labelWidth : delete n.labelWidth;
|
|
@@ -1736,7 +1771,7 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1736
1771
|
};
|
|
1737
1772
|
e(w.value), d(J);
|
|
1738
1773
|
}
|
|
1739
|
-
function
|
|
1774
|
+
function fe() {
|
|
1740
1775
|
T.value && (Array.isArray(T.value.linkage) || (T.value.linkage = []), T.value.linkage.push({
|
|
1741
1776
|
when: {
|
|
1742
1777
|
field: "",
|
|
@@ -1746,97 +1781,97 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1746
1781
|
effects: {}
|
|
1747
1782
|
}));
|
|
1748
1783
|
}
|
|
1749
|
-
function
|
|
1784
|
+
function pe(e) {
|
|
1750
1785
|
Array.isArray(T.value?.linkage) && T.value.linkage.splice(e, 1);
|
|
1751
1786
|
}
|
|
1752
|
-
function
|
|
1787
|
+
function me(e) {
|
|
1753
1788
|
return e ? JSON.stringify(e, null, 2) : "";
|
|
1754
1789
|
}
|
|
1755
|
-
function
|
|
1790
|
+
function he(e, t) {
|
|
1756
1791
|
try {
|
|
1757
1792
|
e.effects.options = t.trim() ? JSON.parse(t) : [];
|
|
1758
1793
|
} catch {
|
|
1759
1794
|
e.effects.options = [];
|
|
1760
1795
|
}
|
|
1761
1796
|
}
|
|
1762
|
-
function
|
|
1797
|
+
function ge(e) {
|
|
1763
1798
|
D.value = e;
|
|
1764
1799
|
}
|
|
1765
|
-
function
|
|
1766
|
-
D.value = null,
|
|
1800
|
+
function _e() {
|
|
1801
|
+
D.value = null, Me();
|
|
1767
1802
|
}
|
|
1768
|
-
function
|
|
1803
|
+
function q(e, t) {
|
|
1769
1804
|
h += 1, F.value = `${e}_${h}`, I.value = u.find((t) => t.type === e)?.label ?? e, j.value = {
|
|
1770
1805
|
type: e,
|
|
1771
1806
|
target: t
|
|
1772
1807
|
}, M.value = !0;
|
|
1773
1808
|
}
|
|
1774
|
-
function
|
|
1809
|
+
function ve() {
|
|
1775
1810
|
if (!j.value) return;
|
|
1776
|
-
let e = F.value.trim() || `${j.value.type}_${h}`, t = I.value.trim() || u.find((e) => e.type === j.value?.type)?.label || j.value.type, n =
|
|
1811
|
+
let e = F.value.trim() || `${j.value.type}_${h}`, t = I.value.trim() || u.find((e) => e.type === j.value?.type)?.label || j.value.type, n = C(j.value.type, e, t), r = j.value.target;
|
|
1777
1812
|
r ? (Array.isArray(r.children) || (r.children = []), r.children.push(n), E.value = r) : w.value.push(n), T.value = n, M.value = !1, j.value = null, d(J);
|
|
1778
1813
|
}
|
|
1779
|
-
function
|
|
1814
|
+
function ye() {
|
|
1780
1815
|
M.value = !1, j.value = null;
|
|
1781
1816
|
}
|
|
1782
|
-
function
|
|
1817
|
+
function be() {
|
|
1783
1818
|
if (!D.value) return;
|
|
1784
1819
|
let e = D.value, t = E.value;
|
|
1785
|
-
D.value = null,
|
|
1820
|
+
D.value = null, q(e, t);
|
|
1786
1821
|
}
|
|
1787
|
-
function
|
|
1822
|
+
function xe(e, t) {
|
|
1788
1823
|
if (D.value) return;
|
|
1789
|
-
let n =
|
|
1824
|
+
let n = ke(e.key);
|
|
1790
1825
|
if (!n) return;
|
|
1791
|
-
let r =
|
|
1826
|
+
let r = Ae(n.key);
|
|
1792
1827
|
r && r.key !== "root" && (E.value = r), O.value = n, t.dataTransfer?.setData("text/plain", n.key);
|
|
1793
1828
|
}
|
|
1794
|
-
function
|
|
1829
|
+
function Se(e, t) {
|
|
1795
1830
|
let n = t.getBoundingClientRect();
|
|
1796
1831
|
return e.clientX < n.left + n.width / 2 ? "before" : "after";
|
|
1797
1832
|
}
|
|
1798
|
-
function
|
|
1833
|
+
function Ce(e) {
|
|
1799
1834
|
let t = O.value;
|
|
1800
1835
|
if (!t || t === e) return;
|
|
1801
|
-
let n =
|
|
1836
|
+
let n = W.value, r = n.indexOf(t), i = n.indexOf(e);
|
|
1802
1837
|
if (r < 0 || i < 0) return;
|
|
1803
1838
|
let [a] = n.splice(r, 1), o = k.value === "after" ? r < i ? i : i + 1 : r < i ? i - 1 : i;
|
|
1804
|
-
n.splice(o, 0, a),
|
|
1839
|
+
n.splice(o, 0, a), we();
|
|
1805
1840
|
}
|
|
1806
|
-
function
|
|
1841
|
+
function we() {
|
|
1807
1842
|
O.value = null, k.value = null;
|
|
1808
1843
|
}
|
|
1809
|
-
function
|
|
1844
|
+
function Te(e) {
|
|
1810
1845
|
return l("span", {
|
|
1811
1846
|
class: "field-drag-handle",
|
|
1812
1847
|
draggable: !0,
|
|
1813
1848
|
title: "拖拽调整顺序",
|
|
1814
|
-
onDragstart: (t) =>
|
|
1815
|
-
onDragend: () =>
|
|
1849
|
+
onDragstart: (t) => xe(e, t),
|
|
1850
|
+
onDragend: () => we()
|
|
1816
1851
|
}, "⠿");
|
|
1817
1852
|
}
|
|
1818
|
-
function
|
|
1853
|
+
function Ee(e) {
|
|
1819
1854
|
return e.key === "root" ? null : l("span", {
|
|
1820
1855
|
class: "block-drag-handle",
|
|
1821
1856
|
draggable: !0,
|
|
1822
1857
|
title: "拖拽调整顺序",
|
|
1823
|
-
onDragstart: (t) =>
|
|
1824
|
-
onDragend: () =>
|
|
1858
|
+
onDragstart: (t) => xe(e, t),
|
|
1859
|
+
onDragend: () => we()
|
|
1825
1860
|
}, "⠿");
|
|
1826
1861
|
}
|
|
1827
|
-
function
|
|
1828
|
-
let t =
|
|
1862
|
+
function De(e) {
|
|
1863
|
+
let t = B.value[0];
|
|
1829
1864
|
if (!t) return null;
|
|
1830
1865
|
let n = null, r = 0;
|
|
1831
1866
|
if (t.key === e[0] ? (n = t, r = 1) : (n = t.children?.find((t) => t.type === "block" && t.key === e[0]) ?? null, r = 1), !n) return null;
|
|
1832
1867
|
for (let t = r; t < e.length; t++) if (n = n.children?.find((n) => n.type === "block" && n.key === e[t]) ?? null, !n) return null;
|
|
1833
1868
|
return n;
|
|
1834
1869
|
}
|
|
1835
|
-
function
|
|
1870
|
+
function Oe(e, t = [], n = !1) {
|
|
1836
1871
|
let r = [];
|
|
1837
1872
|
for (let i of e) if (i.type === "block") {
|
|
1838
1873
|
let e = n ? [...t, i.key] : t;
|
|
1839
|
-
r.push(...
|
|
1874
|
+
r.push(...Oe(i.children ?? [], e, !0));
|
|
1840
1875
|
} else if (i.type !== "slot") {
|
|
1841
1876
|
let e = [...t, i.key].join(".");
|
|
1842
1877
|
r.push({
|
|
@@ -1846,41 +1881,41 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1846
1881
|
}
|
|
1847
1882
|
return r;
|
|
1848
1883
|
}
|
|
1849
|
-
function
|
|
1884
|
+
function ke(e, t = B.value[0]?.children ?? []) {
|
|
1850
1885
|
for (let n of t) {
|
|
1851
1886
|
if (n.key === e) return n;
|
|
1852
|
-
let t =
|
|
1887
|
+
let t = ke(e, n.children ?? []);
|
|
1853
1888
|
if (t) return t;
|
|
1854
1889
|
}
|
|
1855
1890
|
return null;
|
|
1856
1891
|
}
|
|
1857
|
-
function
|
|
1892
|
+
function Ae(e, t = B.value[0]?.children ?? [], n = null) {
|
|
1858
1893
|
for (let r of t) {
|
|
1859
1894
|
if (r.key === e) return n;
|
|
1860
1895
|
if (r.type === "block") {
|
|
1861
|
-
let t =
|
|
1896
|
+
let t = Ae(e, r.children ?? [], r);
|
|
1862
1897
|
if (t) return t;
|
|
1863
1898
|
}
|
|
1864
1899
|
}
|
|
1865
1900
|
return null;
|
|
1866
1901
|
}
|
|
1867
|
-
function
|
|
1868
|
-
|
|
1902
|
+
function je(e) {
|
|
1903
|
+
Me();
|
|
1869
1904
|
let t = e.target;
|
|
1870
1905
|
if (O.value) {
|
|
1871
1906
|
let e = t?.closest("[data-block-path]");
|
|
1872
1907
|
if (e?.dataset.blockPath) {
|
|
1873
|
-
let t =
|
|
1874
|
-
if (t &&
|
|
1875
|
-
|
|
1908
|
+
let t = De(e.dataset.blockPath.split("/"));
|
|
1909
|
+
if (t && W.value.includes(t)) {
|
|
1910
|
+
Ce(t);
|
|
1876
1911
|
return;
|
|
1877
1912
|
}
|
|
1878
1913
|
}
|
|
1879
1914
|
let n = t?.closest("[data-field-key]");
|
|
1880
1915
|
if (n?.dataset.fieldKey) {
|
|
1881
|
-
let e =
|
|
1916
|
+
let e = W.value.find((e) => e.key === n.dataset.fieldKey);
|
|
1882
1917
|
if (e) {
|
|
1883
|
-
|
|
1918
|
+
Ce(e);
|
|
1884
1919
|
return;
|
|
1885
1920
|
}
|
|
1886
1921
|
}
|
|
@@ -1889,31 +1924,31 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1889
1924
|
if (n === "root") {
|
|
1890
1925
|
if (D.value) {
|
|
1891
1926
|
let e = D.value;
|
|
1892
|
-
D.value = null,
|
|
1927
|
+
D.value = null, q(e, null);
|
|
1893
1928
|
}
|
|
1894
1929
|
return;
|
|
1895
1930
|
}
|
|
1896
1931
|
if (n) {
|
|
1897
|
-
let e =
|
|
1932
|
+
let e = De(n.split("/"));
|
|
1898
1933
|
if (e) {
|
|
1899
|
-
|
|
1934
|
+
Fe(e);
|
|
1900
1935
|
return;
|
|
1901
1936
|
}
|
|
1902
1937
|
}
|
|
1903
|
-
|
|
1938
|
+
be();
|
|
1904
1939
|
}
|
|
1905
|
-
function
|
|
1940
|
+
function Me() {
|
|
1906
1941
|
document.querySelectorAll("[data-block-path], [data-field-key]").forEach((e) => {
|
|
1907
1942
|
e.classList.remove("drop-active", "drop-before", "drop-after");
|
|
1908
1943
|
});
|
|
1909
1944
|
}
|
|
1910
|
-
function
|
|
1945
|
+
function Ne() {
|
|
1911
1946
|
document.querySelectorAll(".node-selected").forEach((e) => {
|
|
1912
1947
|
e.classList.remove("node-selected");
|
|
1913
1948
|
});
|
|
1914
1949
|
}
|
|
1915
1950
|
function J() {
|
|
1916
|
-
if (
|
|
1951
|
+
if (Ne(), !T.value) return;
|
|
1917
1952
|
let e = T.value.key;
|
|
1918
1953
|
document.querySelectorAll("[data-field-key]").forEach((t) => {
|
|
1919
1954
|
t.getAttribute("data-field-key") === e && t.classList.add("node-selected");
|
|
@@ -1921,58 +1956,58 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
1921
1956
|
t.getAttribute("data-block-path")?.split("/").pop() === e && t.classList.add("node-selected");
|
|
1922
1957
|
});
|
|
1923
1958
|
}
|
|
1924
|
-
function
|
|
1925
|
-
|
|
1959
|
+
function Pe(e) {
|
|
1960
|
+
Me();
|
|
1926
1961
|
let t = e.target;
|
|
1927
1962
|
if (O.value) {
|
|
1928
1963
|
let n = t?.closest("[data-field-key]");
|
|
1929
|
-
n?.dataset.fieldKey &&
|
|
1964
|
+
n?.dataset.fieldKey && W.value.find((e) => e.key === n.dataset.fieldKey) && (k.value = Se(e, n), n.classList.add("drop-active"), n.classList.add(k.value === "before" ? "drop-before" : "drop-after"));
|
|
1930
1965
|
let r = t?.closest("[data-block-path]");
|
|
1931
1966
|
if (r?.dataset.blockPath) {
|
|
1932
|
-
let t =
|
|
1933
|
-
t &&
|
|
1967
|
+
let t = De(r.dataset.blockPath.split("/"));
|
|
1968
|
+
t && W.value.includes(t) && (k.value = Se(e, r), r.classList.add("drop-active"), r.classList.add(k.value === "before" ? "drop-before" : "drop-after"));
|
|
1934
1969
|
}
|
|
1935
1970
|
return;
|
|
1936
1971
|
}
|
|
1937
1972
|
(t?.closest("[data-block-path]"))?.classList.add("drop-active");
|
|
1938
1973
|
}
|
|
1939
|
-
function
|
|
1974
|
+
function Fe(e) {
|
|
1940
1975
|
if (!D.value) return;
|
|
1941
1976
|
let t = D.value;
|
|
1942
|
-
D.value = null,
|
|
1977
|
+
D.value = null, q(t, e);
|
|
1943
1978
|
}
|
|
1944
|
-
function
|
|
1945
|
-
let t =
|
|
1979
|
+
function Ie(e) {
|
|
1980
|
+
let t = W.value, n = t[e];
|
|
1946
1981
|
t.splice(e, 1), E.value === n && (E.value = null), T.value === n && (T.value = null), d(J);
|
|
1947
1982
|
}
|
|
1948
|
-
function
|
|
1983
|
+
function Le(e) {
|
|
1949
1984
|
let t = document.createElement("textarea");
|
|
1950
1985
|
t.value = e, t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
|
|
1951
1986
|
}
|
|
1952
|
-
async function
|
|
1987
|
+
async function Re(e, t) {
|
|
1953
1988
|
try {
|
|
1954
|
-
navigator.clipboard?.writeText ? await navigator.clipboard.writeText(e) :
|
|
1989
|
+
navigator.clipboard?.writeText ? await navigator.clipboard.writeText(e) : Le(e);
|
|
1955
1990
|
} catch {
|
|
1956
|
-
|
|
1991
|
+
Le(e);
|
|
1957
1992
|
}
|
|
1958
1993
|
A.value = t, window.setTimeout(() => {
|
|
1959
1994
|
A.value = null;
|
|
1960
1995
|
}, 1600);
|
|
1961
1996
|
}
|
|
1962
1997
|
return (t, c) => {
|
|
1963
|
-
let l = y("el-button"), d = y("el-switch"), p = y("el-form-item"), h = y("el-option"), g = y("el-select"), v = y("el-input-number"), x = y("el-input"),
|
|
1998
|
+
let l = y("el-button"), d = y("el-switch"), p = y("el-form-item"), h = y("el-option"), g = y("el-select"), v = y("el-input-number"), x = y("el-input"), C = y("el-form"), w = y("el-radio"), D = y("el-radio-group"), O = y("el-checkbox"), k = y("el-date-picker"), H = y("el-time-picker"), U = y("el-input-tag"), re = y("el-rate"), W = y("el-slider"), oe = y("el-cascader"), q = y("el-tree-select"), be = y("el-scrollbar"), xe = y("el-drawer"), Se = y("el-dialog");
|
|
1964
1999
|
return m(), i("div", Gi, [
|
|
1965
|
-
a("header", Ki, [c[
|
|
2000
|
+
a("header", Ki, [c[38] ||= a("div", null, [a("h2", null, "创建表单"), a("p", null, "从左侧拖拽字段到右侧表单,生成 config 和 data。")], -1), a("div", qi, [s(l, {
|
|
1966
2001
|
type: "primary",
|
|
1967
|
-
onClick: c[0] ||= (e) =>
|
|
2002
|
+
onClick: c[0] ||= (e) => Re(V.value, "config")
|
|
1968
2003
|
}, {
|
|
1969
2004
|
default: S(() => [o(b(A.value === "config" ? "已复制 config" : "复制 config"), 1)]),
|
|
1970
2005
|
_: 1
|
|
1971
|
-
}), s(l, { onClick: c[1] ||= (e) =>
|
|
2006
|
+
}), s(l, { onClick: c[1] ||= (e) => Re(ae.value, "data") }, {
|
|
1972
2007
|
default: S(() => [o(b(A.value === "data" ? "已复制 data" : "复制 data"), 1)]),
|
|
1973
2008
|
_: 1
|
|
1974
2009
|
})])]),
|
|
1975
|
-
a("section", Ji, [c[
|
|
2010
|
+
a("section", Ji, [c[40] ||= a("h3", null, "全局配置", -1), s(C, {
|
|
1976
2011
|
inline: "",
|
|
1977
2012
|
"label-position": "top"
|
|
1978
2013
|
}, {
|
|
@@ -2046,29 +2081,36 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2046
2081
|
}, null, 8, ["modelValue"])]),
|
|
2047
2082
|
_: 1
|
|
2048
2083
|
}),
|
|
2084
|
+
s(p, { label: "animate" }, {
|
|
2085
|
+
default: S(() => [s(d, {
|
|
2086
|
+
modelValue: P.value.animate,
|
|
2087
|
+
"onUpdate:modelValue": c[9] ||= (e) => P.value.animate = e
|
|
2088
|
+
}, null, 8, ["modelValue"])]),
|
|
2089
|
+
_: 1
|
|
2090
|
+
}),
|
|
2049
2091
|
s(p, { label: "只读展示" }, {
|
|
2050
2092
|
default: S(() => [s(d, {
|
|
2051
2093
|
modelValue: P.value.isText,
|
|
2052
|
-
"onUpdate:modelValue": c[
|
|
2094
|
+
"onUpdate:modelValue": c[10] ||= (e) => P.value.isText = e
|
|
2053
2095
|
}, null, 8, ["modelValue"])]),
|
|
2054
2096
|
_: 1
|
|
2055
2097
|
}),
|
|
2056
2098
|
s(l, {
|
|
2057
2099
|
type: "primary",
|
|
2058
|
-
onClick:
|
|
2100
|
+
onClick: de
|
|
2059
2101
|
}, {
|
|
2060
|
-
default: S(() => [...c[
|
|
2102
|
+
default: S(() => [...c[39] ||= [o("应用全局配置", -1)]]),
|
|
2061
2103
|
_: 1
|
|
2062
2104
|
})
|
|
2063
2105
|
]),
|
|
2064
2106
|
_: 1
|
|
2065
2107
|
})]),
|
|
2066
|
-
a("div", Yi, [a("aside", Xi, [c[
|
|
2108
|
+
a("div", Yi, [a("aside", Xi, [c[42] ||= a("h3", null, "字段库", -1), (m(), i(e, null, _(u, (t) => a("div", {
|
|
2067
2109
|
key: t.type,
|
|
2068
2110
|
class: "palette-item",
|
|
2069
2111
|
draggable: "true",
|
|
2070
|
-
onDragstart: (e) =>
|
|
2071
|
-
onDragend:
|
|
2112
|
+
onDragstart: (e) => ge(t.type),
|
|
2113
|
+
onDragend: _e
|
|
2072
2114
|
}, [s(p, { label: t.label }, {
|
|
2073
2115
|
default: S(() => [t.type === "block" ? (m(), i("div", Qi, "block 块")) : t.type === "input" ? (m(), n(x, {
|
|
2074
2116
|
key: 1,
|
|
@@ -2089,11 +2131,11 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2089
2131
|
value: e.value
|
|
2090
2132
|
}, null, 8, ["label", "value"]))), 128))]),
|
|
2091
2133
|
_: 2
|
|
2092
|
-
}, 1024)) : t.type === "radio" ? (m(), n(
|
|
2134
|
+
}, 1024)) : t.type === "radio" ? (m(), n(D, {
|
|
2093
2135
|
key: 4,
|
|
2094
2136
|
"model-value": ""
|
|
2095
2137
|
}, {
|
|
2096
|
-
default: S(() => [(m(!0), i(e, null, _(t.options ?? [], (e) => (m(), n(
|
|
2138
|
+
default: S(() => [(m(!0), i(e, null, _(t.options ?? [], (e) => (m(), n(w, {
|
|
2097
2139
|
key: e.value,
|
|
2098
2140
|
value: e.value
|
|
2099
2141
|
}, {
|
|
@@ -2101,77 +2143,77 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2101
2143
|
_: 2
|
|
2102
2144
|
}, 1032, ["value"]))), 128))]),
|
|
2103
2145
|
_: 2
|
|
2104
|
-
}, 1024)) : t.type === "checkbox" ? (m(), n(
|
|
2105
|
-
default: S(() => [...c[
|
|
2146
|
+
}, 1024)) : t.type === "checkbox" ? (m(), n(O, { key: 5 }, {
|
|
2147
|
+
default: S(() => [...c[41] ||= [o("复选框", -1)]]),
|
|
2106
2148
|
_: 1
|
|
2107
2149
|
})) : t.type === "switch" ? (m(), n(d, { key: 6 })) : t.type === "inputNumber" ? (m(), n(v, {
|
|
2108
2150
|
key: 7,
|
|
2109
2151
|
"model-value": 0,
|
|
2110
2152
|
controls: !1
|
|
2111
|
-
})) : t.type === "datePicker" ? (m(), n(
|
|
2153
|
+
})) : t.type === "datePicker" ? (m(), n(k, {
|
|
2112
2154
|
key: 8,
|
|
2113
2155
|
type: "date",
|
|
2114
2156
|
placeholder: "选择日期"
|
|
2115
|
-
})) : t.type === "datetimePicker" ? (m(), n(
|
|
2157
|
+
})) : t.type === "datetimePicker" ? (m(), n(k, {
|
|
2116
2158
|
key: 9,
|
|
2117
2159
|
type: "datetime",
|
|
2118
2160
|
placeholder: "选择日期时间"
|
|
2119
|
-
})) : t.type === "timePicker" ? (m(), n(
|
|
2161
|
+
})) : t.type === "timePicker" ? (m(), n(H, {
|
|
2120
2162
|
key: 10,
|
|
2121
2163
|
placeholder: "选择时间"
|
|
2122
|
-
})) : t.type === "inputTag" ? (m(), n(
|
|
2164
|
+
})) : t.type === "inputTag" ? (m(), n(U, {
|
|
2123
2165
|
key: 11,
|
|
2124
2166
|
"model-value": ["标签"]
|
|
2125
|
-
})) : t.type === "transfer" ? (m(), i("div", $i, "穿梭框")) : t.type === "rate" ? (m(), n(
|
|
2126
|
-
key: 13,
|
|
2127
|
-
"model-value": 3
|
|
2128
|
-
})) : t.type === "slider" ? (m(), n(ae, {
|
|
2167
|
+
})) : t.type === "transfer" ? (m(), i("div", $i, "穿梭框")) : t.type === "upload" ? (m(), i("div", ea, "附件")) : t.type === "rate" ? (m(), n(re, {
|
|
2129
2168
|
key: 14,
|
|
2130
|
-
"model-value":
|
|
2131
|
-
})) : t.type === "
|
|
2169
|
+
"model-value": 3
|
|
2170
|
+
})) : t.type === "slider" ? (m(), n(W, {
|
|
2132
2171
|
key: 15,
|
|
2133
|
-
|
|
2134
|
-
})) : t.type === "
|
|
2172
|
+
"model-value": 40
|
|
2173
|
+
})) : t.type === "cascader" ? (m(), n(oe, {
|
|
2135
2174
|
key: 16,
|
|
2136
2175
|
placeholder: "请选择"
|
|
2176
|
+
})) : t.type === "treeSelect" ? (m(), n(q, {
|
|
2177
|
+
key: 17,
|
|
2178
|
+
placeholder: "请选择"
|
|
2137
2179
|
})) : r("", !0)]),
|
|
2138
2180
|
_: 2
|
|
2139
2181
|
}, 1032, ["label"])], 40, Zi)), 64))]), a("section", {
|
|
2140
2182
|
class: "preview",
|
|
2141
|
-
onDragover:
|
|
2142
|
-
onDragleave:
|
|
2143
|
-
onDrop:
|
|
2144
|
-
onClick:
|
|
2145
|
-
}, [a("div",
|
|
2183
|
+
onDragover: ee(Pe, ["prevent"]),
|
|
2184
|
+
onDragleave: Me,
|
|
2185
|
+
onDrop: ee(je, ["prevent"]),
|
|
2186
|
+
onClick: K
|
|
2187
|
+
}, [a("div", ta, [c[45] ||= a("h3", null, "实时表单", -1), a("div", na, [c[44] ||= a("span", null, "将左侧字段拖到这里", -1), s(l, {
|
|
2146
2188
|
size: "small",
|
|
2147
2189
|
onClick: ue
|
|
2148
2190
|
}, {
|
|
2149
|
-
default: S(() => [...c[
|
|
2191
|
+
default: S(() => [...c[43] ||= [o("字段配置", -1)]]),
|
|
2150
2192
|
_: 1
|
|
2151
2193
|
})])]), s(Wi, {
|
|
2152
|
-
config:
|
|
2153
|
-
modelValue:
|
|
2154
|
-
"onUpdate:modelValue": c[
|
|
2194
|
+
config: B.value,
|
|
2195
|
+
modelValue: ie.value,
|
|
2196
|
+
"onUpdate:modelValue": c[11] ||= (e) => ie.value = e,
|
|
2155
2197
|
"show-submit": "",
|
|
2156
2198
|
"show-reset": "",
|
|
2157
|
-
"field-action":
|
|
2158
|
-
"block-action":
|
|
2199
|
+
"field-action": Te,
|
|
2200
|
+
"block-action": Ee
|
|
2159
2201
|
}, null, 8, ["config", "modelValue"])], 32)]),
|
|
2160
|
-
s(
|
|
2202
|
+
s(xe, {
|
|
2161
2203
|
modelValue: N.value,
|
|
2162
|
-
"onUpdate:modelValue": c[
|
|
2204
|
+
"onUpdate:modelValue": c[34] ||= (e) => N.value = e,
|
|
2163
2205
|
title: "字段配置",
|
|
2164
2206
|
size: "560px"
|
|
2165
2207
|
}, {
|
|
2166
|
-
default: S(() => [s(
|
|
2208
|
+
default: S(() => [s(be, {
|
|
2167
2209
|
class: "drawer-scrollbar",
|
|
2168
2210
|
"view-style": "padding: 0 20px 20px 0;"
|
|
2169
2211
|
}, {
|
|
2170
|
-
default: S(() => [a("div",
|
|
2212
|
+
default: S(() => [a("div", ra, [a("button", {
|
|
2171
2213
|
type: "button",
|
|
2172
2214
|
class: f({ active: !E.value }),
|
|
2173
|
-
onClick:
|
|
2174
|
-
}, " 根 ", 2), E.value ? (m(), i("span",
|
|
2215
|
+
onClick: ce
|
|
2216
|
+
}, " 根 ", 2), E.value ? (m(), i("span", ia, "/ " + b(E.value.label || E.value.key), 1)) : r("", !0)]), T.value ? (m(), n(C, {
|
|
2175
2217
|
key: 0,
|
|
2176
2218
|
"label-position": "top"
|
|
2177
2219
|
}, {
|
|
@@ -2179,21 +2221,21 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2179
2221
|
s(p, { label: "label" }, {
|
|
2180
2222
|
default: S(() => [s(x, {
|
|
2181
2223
|
modelValue: T.value.label,
|
|
2182
|
-
"onUpdate:modelValue": c[
|
|
2224
|
+
"onUpdate:modelValue": c[12] ||= (e) => T.value.label = e
|
|
2183
2225
|
}, null, 8, ["modelValue"])]),
|
|
2184
2226
|
_: 1
|
|
2185
2227
|
}),
|
|
2186
2228
|
s(p, { label: "key" }, {
|
|
2187
2229
|
default: S(() => [s(x, {
|
|
2188
2230
|
modelValue: T.value.key,
|
|
2189
|
-
"onUpdate:modelValue": c[
|
|
2231
|
+
"onUpdate:modelValue": c[13] ||= (e) => T.value.key = e
|
|
2190
2232
|
}, null, 8, ["modelValue"])]),
|
|
2191
2233
|
_: 1
|
|
2192
2234
|
}),
|
|
2193
2235
|
s(p, { label: "span" }, {
|
|
2194
2236
|
default: S(() => [s(v, {
|
|
2195
2237
|
modelValue: T.value.span,
|
|
2196
|
-
"onUpdate:modelValue": c[
|
|
2238
|
+
"onUpdate:modelValue": c[14] ||= (e) => T.value.span = e,
|
|
2197
2239
|
min: 1,
|
|
2198
2240
|
max: 24
|
|
2199
2241
|
}, null, 8, ["modelValue"])]),
|
|
@@ -2205,9 +2247,9 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2205
2247
|
}, {
|
|
2206
2248
|
default: S(() => [s(l, {
|
|
2207
2249
|
size: "small",
|
|
2208
|
-
onClick: c[
|
|
2250
|
+
onClick: c[15] ||= (e) => se(T.value)
|
|
2209
2251
|
}, {
|
|
2210
|
-
default: S(() => [...c[
|
|
2252
|
+
default: S(() => [...c[46] ||= [o("进入 block", -1)]]),
|
|
2211
2253
|
_: 1
|
|
2212
2254
|
})]),
|
|
2213
2255
|
_: 1
|
|
@@ -2218,7 +2260,7 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2218
2260
|
}, {
|
|
2219
2261
|
default: S(() => [s(v, {
|
|
2220
2262
|
modelValue: T.value.indent,
|
|
2221
|
-
"onUpdate:modelValue": c[
|
|
2263
|
+
"onUpdate:modelValue": c[16] ||= (e) => T.value.indent = e,
|
|
2222
2264
|
min: 0,
|
|
2223
2265
|
step: 8
|
|
2224
2266
|
}, null, 8, ["modelValue"])]),
|
|
@@ -2230,18 +2272,31 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2230
2272
|
}, {
|
|
2231
2273
|
default: S(() => [s(d, {
|
|
2232
2274
|
modelValue: T.value.border,
|
|
2233
|
-
"onUpdate:modelValue": c[
|
|
2275
|
+
"onUpdate:modelValue": c[17] ||= (e) => T.value.border = e
|
|
2276
|
+
}, null, 8, ["modelValue"])]),
|
|
2277
|
+
_: 1
|
|
2278
|
+
})) : r("", !0),
|
|
2279
|
+
T.value.type === "block" ? (m(), n(p, {
|
|
2280
|
+
key: 3,
|
|
2281
|
+
label: "animate"
|
|
2282
|
+
}, {
|
|
2283
|
+
default: S(() => [s(d, {
|
|
2284
|
+
modelValue: T.value.animate,
|
|
2285
|
+
"onUpdate:modelValue": c[18] ||= (e) => T.value.animate = e
|
|
2234
2286
|
}, null, 8, ["modelValue"])]),
|
|
2235
2287
|
_: 1
|
|
2236
2288
|
})) : r("", !0),
|
|
2237
2289
|
s(p, { label: "placeholder" }, {
|
|
2238
2290
|
default: S(() => [s(x, {
|
|
2239
2291
|
modelValue: T.value.placeholder,
|
|
2240
|
-
"onUpdate:modelValue": c[
|
|
2292
|
+
"onUpdate:modelValue": c[19] ||= (e) => T.value.placeholder = e
|
|
2241
2293
|
}, null, 8, ["modelValue"])]),
|
|
2242
2294
|
_: 1
|
|
2243
2295
|
}),
|
|
2244
|
-
|
|
2296
|
+
T.value.type === "upload" ? r("", !0) : (m(), n(p, {
|
|
2297
|
+
key: 4,
|
|
2298
|
+
label: "默认值"
|
|
2299
|
+
}, {
|
|
2245
2300
|
default: S(() => [[
|
|
2246
2301
|
"inputNumber",
|
|
2247
2302
|
"rate",
|
|
@@ -2249,50 +2304,80 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2249
2304
|
].includes(T.value.type) ? (m(), n(v, {
|
|
2250
2305
|
key: 0,
|
|
2251
2306
|
modelValue: T.value.default,
|
|
2252
|
-
"onUpdate:modelValue": c[
|
|
2307
|
+
"onUpdate:modelValue": c[20] ||= (e) => T.value.default = e
|
|
2253
2308
|
}, null, 8, ["modelValue"])) : ["switch", "checkbox"].includes(T.value.type) ? (m(), n(d, {
|
|
2254
2309
|
key: 1,
|
|
2255
2310
|
modelValue: T.value.default,
|
|
2256
|
-
"onUpdate:modelValue": c[
|
|
2311
|
+
"onUpdate:modelValue": c[21] ||= (e) => T.value.default = e
|
|
2257
2312
|
}, null, 8, ["modelValue"])) : (m(), n(x, {
|
|
2258
2313
|
key: 2,
|
|
2259
2314
|
modelValue: T.value.default,
|
|
2260
|
-
"onUpdate:modelValue": c[
|
|
2315
|
+
"onUpdate:modelValue": c[22] ||= (e) => T.value.default = e
|
|
2261
2316
|
}, null, 8, ["modelValue"]))]),
|
|
2262
2317
|
_: 1
|
|
2263
|
-
}),
|
|
2318
|
+
})),
|
|
2319
|
+
T.value.type === "upload" ? (m(), i(e, { key: 5 }, [
|
|
2320
|
+
s(p, { label: "上传地址" }, {
|
|
2321
|
+
default: S(() => [s(x, {
|
|
2322
|
+
"model-value": String(L("action", "/api/v1/admin/upload")),
|
|
2323
|
+
"onUpdate:modelValue": c[23] ||= (e) => R("action", e)
|
|
2324
|
+
}, null, 8, ["model-value"])]),
|
|
2325
|
+
_: 1
|
|
2326
|
+
}),
|
|
2327
|
+
s(p, { label: "自动上传" }, {
|
|
2328
|
+
default: S(() => [s(d, {
|
|
2329
|
+
"model-value": !!L("autoUpload", !0),
|
|
2330
|
+
"onUpdate:modelValue": c[24] ||= (e) => R("autoUpload", e)
|
|
2331
|
+
}, null, 8, ["model-value"])]),
|
|
2332
|
+
_: 1
|
|
2333
|
+
}),
|
|
2334
|
+
s(p, { label: "多文件" }, {
|
|
2335
|
+
default: S(() => [s(d, {
|
|
2336
|
+
"model-value": !!L("multiple", !0),
|
|
2337
|
+
"onUpdate:modelValue": c[25] ||= (e) => R("multiple", e)
|
|
2338
|
+
}, null, 8, ["model-value"])]),
|
|
2339
|
+
_: 1
|
|
2340
|
+
}),
|
|
2341
|
+
s(p, { label: "文件类型" }, {
|
|
2342
|
+
default: S(() => [s(x, {
|
|
2343
|
+
"model-value": String(L("accept", "image/*,.pdf,.txt")),
|
|
2344
|
+
"onUpdate:modelValue": c[26] ||= (e) => R("accept", e)
|
|
2345
|
+
}, null, 8, ["model-value"])]),
|
|
2346
|
+
_: 1
|
|
2347
|
+
})
|
|
2348
|
+
], 64)) : r("", !0),
|
|
2264
2349
|
s(p, { label: "必填" }, {
|
|
2265
2350
|
default: S(() => [s(d, {
|
|
2266
2351
|
modelValue: T.value.required,
|
|
2267
|
-
"onUpdate:modelValue": c[
|
|
2352
|
+
"onUpdate:modelValue": c[27] ||= (e) => T.value.required = e
|
|
2268
2353
|
}, null, 8, ["modelValue"])]),
|
|
2269
2354
|
_: 1
|
|
2270
2355
|
}),
|
|
2271
2356
|
s(p, { label: "禁用" }, {
|
|
2272
2357
|
default: S(() => [s(d, {
|
|
2273
2358
|
modelValue: T.value.disabled,
|
|
2274
|
-
"onUpdate:modelValue": c[
|
|
2359
|
+
"onUpdate:modelValue": c[28] ||= (e) => T.value.disabled = e
|
|
2275
2360
|
}, null, 8, ["modelValue"])]),
|
|
2276
2361
|
_: 1
|
|
2277
2362
|
}),
|
|
2278
2363
|
s(p, { label: "只读展示" }, {
|
|
2279
2364
|
default: S(() => [s(d, {
|
|
2280
2365
|
modelValue: T.value.isText,
|
|
2281
|
-
"onUpdate:modelValue": c[
|
|
2366
|
+
"onUpdate:modelValue": c[29] ||= (e) => T.value.isText = e
|
|
2282
2367
|
}, null, 8, ["modelValue"])]),
|
|
2283
2368
|
_: 1
|
|
2284
2369
|
}),
|
|
2285
2370
|
s(p, { label: "隐藏字段" }, {
|
|
2286
2371
|
default: S(() => [s(d, {
|
|
2287
2372
|
modelValue: T.value.visible,
|
|
2288
|
-
"onUpdate:modelValue": c[
|
|
2373
|
+
"onUpdate:modelValue": c[30] ||= (e) => T.value.visible = e
|
|
2289
2374
|
}, null, 8, ["modelValue"])]),
|
|
2290
2375
|
_: 1
|
|
2291
2376
|
}),
|
|
2292
2377
|
s(p, { label: "隐藏时清空" }, {
|
|
2293
2378
|
default: S(() => [s(d, {
|
|
2294
2379
|
modelValue: T.value.clearOnHide,
|
|
2295
|
-
"onUpdate:modelValue": c[
|
|
2380
|
+
"onUpdate:modelValue": c[31] ||= (e) => T.value.clearOnHide = e
|
|
2296
2381
|
}, null, 8, ["modelValue"])]),
|
|
2297
2382
|
_: 1
|
|
2298
2383
|
}),
|
|
@@ -2301,35 +2386,35 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2301
2386
|
"datetimePicker",
|
|
2302
2387
|
"timePicker"
|
|
2303
2388
|
].includes(T.value.type) ? (m(), n(p, {
|
|
2304
|
-
key:
|
|
2389
|
+
key: 6,
|
|
2305
2390
|
label: "UTC时间"
|
|
2306
2391
|
}, {
|
|
2307
2392
|
default: S(() => [s(d, {
|
|
2308
2393
|
modelValue: T.value.utc,
|
|
2309
|
-
"onUpdate:modelValue": c[
|
|
2394
|
+
"onUpdate:modelValue": c[32] ||= (e) => T.value.utc = e
|
|
2310
2395
|
}, null, 8, ["modelValue"])]),
|
|
2311
2396
|
_: 1
|
|
2312
2397
|
})) : r("", !0),
|
|
2313
2398
|
s(p, { label: "联动配置" }, {
|
|
2314
|
-
default: S(() => [a("div",
|
|
2399
|
+
default: S(() => [a("div", aa, [(m(!0), i(e, null, _(te.value, (t, r) => (m(), i("div", {
|
|
2315
2400
|
key: r,
|
|
2316
2401
|
class: "linkage-rule"
|
|
2317
2402
|
}, [
|
|
2318
|
-
a("div",
|
|
2403
|
+
a("div", oa, [a("span", null, "规则 " + b(r + 1), 1), s(l, {
|
|
2319
2404
|
link: "",
|
|
2320
2405
|
type: "danger",
|
|
2321
|
-
onClick: (e) =>
|
|
2406
|
+
onClick: (e) => pe(r)
|
|
2322
2407
|
}, {
|
|
2323
|
-
default: S(() => [...c[
|
|
2408
|
+
default: S(() => [...c[47] ||= [o(" 删除 ", -1)]]),
|
|
2324
2409
|
_: 1
|
|
2325
2410
|
}, 8, ["onClick"])]),
|
|
2326
|
-
a("div",
|
|
2411
|
+
a("div", sa, [
|
|
2327
2412
|
s(g, {
|
|
2328
2413
|
modelValue: t.when.field,
|
|
2329
2414
|
"onUpdate:modelValue": (e) => t.when.field = e,
|
|
2330
2415
|
placeholder: "选择源字段"
|
|
2331
2416
|
}, {
|
|
2332
|
-
default: S(() => [(m(!0), i(e, null, _(
|
|
2417
|
+
default: S(() => [(m(!0), i(e, null, _(ne.value, (e) => (m(), n(h, {
|
|
2333
2418
|
key: e.value,
|
|
2334
2419
|
label: e.label,
|
|
2335
2420
|
value: e.value
|
|
@@ -2340,7 +2425,7 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2340
2425
|
modelValue: t.when.operator,
|
|
2341
2426
|
"onUpdate:modelValue": (e) => t.when.operator = e
|
|
2342
2427
|
}, {
|
|
2343
|
-
default: S(() => [(m(), i(e, null, _(
|
|
2428
|
+
default: S(() => [(m(), i(e, null, _(z, (e) => s(h, {
|
|
2344
2429
|
key: e,
|
|
2345
2430
|
label: e,
|
|
2346
2431
|
value: e
|
|
@@ -2353,33 +2438,33 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2353
2438
|
placeholder: "条件值"
|
|
2354
2439
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
2355
2440
|
]),
|
|
2356
|
-
a("div",
|
|
2357
|
-
s(
|
|
2441
|
+
a("div", ca, [
|
|
2442
|
+
s(O, {
|
|
2358
2443
|
modelValue: t.effects.visible,
|
|
2359
2444
|
"onUpdate:modelValue": (e) => t.effects.visible = e
|
|
2360
2445
|
}, {
|
|
2361
|
-
default: S(() => [...c[
|
|
2446
|
+
default: S(() => [...c[48] ||= [o("显示", -1)]]),
|
|
2362
2447
|
_: 1
|
|
2363
2448
|
}, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2364
|
-
s(
|
|
2449
|
+
s(O, {
|
|
2365
2450
|
modelValue: t.effects.disabled,
|
|
2366
2451
|
"onUpdate:modelValue": (e) => t.effects.disabled = e
|
|
2367
2452
|
}, {
|
|
2368
|
-
default: S(() => [...c[
|
|
2453
|
+
default: S(() => [...c[49] ||= [o("禁用", -1)]]),
|
|
2369
2454
|
_: 1
|
|
2370
2455
|
}, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2371
|
-
s(
|
|
2456
|
+
s(O, {
|
|
2372
2457
|
modelValue: t.effects.required,
|
|
2373
2458
|
"onUpdate:modelValue": (e) => t.effects.required = e
|
|
2374
2459
|
}, {
|
|
2375
|
-
default: S(() => [...c[
|
|
2460
|
+
default: S(() => [...c[50] ||= [o("必填", -1)]]),
|
|
2376
2461
|
_: 1
|
|
2377
2462
|
}, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2378
|
-
s(
|
|
2463
|
+
s(O, {
|
|
2379
2464
|
modelValue: t.effects.clearOnHide,
|
|
2380
2465
|
"onUpdate:modelValue": (e) => t.effects.clearOnHide = e
|
|
2381
2466
|
}, {
|
|
2382
|
-
default: S(() => [...c[
|
|
2467
|
+
default: S(() => [...c[51] ||= [o("隐藏清空", -1)]]),
|
|
2383
2468
|
_: 1
|
|
2384
2469
|
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
2385
2470
|
]),
|
|
@@ -2391,24 +2476,24 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2391
2476
|
s(x, {
|
|
2392
2477
|
type: "textarea",
|
|
2393
2478
|
rows: 2,
|
|
2394
|
-
"model-value":
|
|
2395
|
-
onChange: (e) =>
|
|
2479
|
+
"model-value": me(t.effects.options),
|
|
2480
|
+
onChange: (e) => he(t, e),
|
|
2396
2481
|
placeholder: "联动选项 JSON"
|
|
2397
2482
|
}, null, 8, ["model-value", "onChange"])
|
|
2398
2483
|
]))), 128)), s(l, {
|
|
2399
2484
|
size: "small",
|
|
2400
|
-
onClick:
|
|
2485
|
+
onClick: fe
|
|
2401
2486
|
}, {
|
|
2402
|
-
default: S(() => [...c[
|
|
2487
|
+
default: S(() => [...c[52] ||= [o("添加联动规则", -1)]]),
|
|
2403
2488
|
_: 1
|
|
2404
2489
|
})])]),
|
|
2405
2490
|
_: 1
|
|
2406
2491
|
}),
|
|
2407
|
-
|
|
2408
|
-
key:
|
|
2492
|
+
G.value ? (m(), n(p, {
|
|
2493
|
+
key: 7,
|
|
2409
2494
|
label: "选项"
|
|
2410
2495
|
}, {
|
|
2411
|
-
default: S(() => [a("div",
|
|
2496
|
+
default: S(() => [a("div", la, [(m(!0), i(e, null, _(T.value.options ?? [], (e, t) => (m(), i("div", {
|
|
2412
2497
|
key: t,
|
|
2413
2498
|
class: "option-row"
|
|
2414
2499
|
}, [
|
|
@@ -2427,17 +2512,17 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2427
2512
|
type: "danger",
|
|
2428
2513
|
onClick: (e) => T.value.options?.splice(t, 1)
|
|
2429
2514
|
}, {
|
|
2430
|
-
default: S(() => [...c[
|
|
2515
|
+
default: S(() => [...c[53] ||= [o(" 删除 ", -1)]]),
|
|
2431
2516
|
_: 1
|
|
2432
2517
|
}, 8, ["onClick"])
|
|
2433
2518
|
]))), 128)), s(l, {
|
|
2434
2519
|
size: "small",
|
|
2435
|
-
onClick: c[
|
|
2520
|
+
onClick: c[33] ||= (e) => T.value.options?.push({
|
|
2436
2521
|
label: "",
|
|
2437
2522
|
value: ""
|
|
2438
2523
|
})
|
|
2439
2524
|
}, {
|
|
2440
|
-
default: S(() => [...c[
|
|
2525
|
+
default: S(() => [...c[54] ||= [o(" 添加选项 ", -1)]]),
|
|
2441
2526
|
_: 1
|
|
2442
2527
|
})])]),
|
|
2443
2528
|
_: 1
|
|
@@ -2447,43 +2532,43 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2447
2532
|
type: "danger",
|
|
2448
2533
|
onClick: le
|
|
2449
2534
|
}, {
|
|
2450
|
-
default: S(() => [...c[
|
|
2535
|
+
default: S(() => [...c[55] ||= [o("删除字段", -1)]]),
|
|
2451
2536
|
_: 1
|
|
2452
2537
|
})]),
|
|
2453
2538
|
_: 1
|
|
2454
2539
|
})
|
|
2455
2540
|
]),
|
|
2456
2541
|
_: 1
|
|
2457
|
-
})) : (m(), i("div",
|
|
2542
|
+
})) : (m(), i("div", ua, "点击右侧表单中的字段进行配置"))]),
|
|
2458
2543
|
_: 1
|
|
2459
2544
|
})]),
|
|
2460
2545
|
_: 1
|
|
2461
2546
|
}, 8, ["modelValue"]),
|
|
2462
|
-
a("section",
|
|
2463
|
-
s(
|
|
2547
|
+
a("section", da, [a("div", fa, [c[56] ||= a("h3", null, "config", -1), a("pre", null, b(V.value), 1)]), a("div", pa, [c[57] ||= a("h3", null, "data", -1), a("pre", null, b(ae.value), 1)])]),
|
|
2548
|
+
s(Se, {
|
|
2464
2549
|
modelValue: M.value,
|
|
2465
|
-
"onUpdate:modelValue": c[
|
|
2550
|
+
"onUpdate:modelValue": c[37] ||= (e) => M.value = e,
|
|
2466
2551
|
title: j.value?.type === "block" ? "添加 block" : "添加字段",
|
|
2467
2552
|
width: "420px"
|
|
2468
2553
|
}, {
|
|
2469
|
-
footer: S(() => [s(l, { onClick:
|
|
2470
|
-
default: S(() => [...c[
|
|
2554
|
+
footer: S(() => [s(l, { onClick: ye }, {
|
|
2555
|
+
default: S(() => [...c[58] ||= [o("取消", -1)]]),
|
|
2471
2556
|
_: 1
|
|
2472
2557
|
}), s(l, {
|
|
2473
2558
|
type: "primary",
|
|
2474
|
-
onClick:
|
|
2559
|
+
onClick: ve
|
|
2475
2560
|
}, {
|
|
2476
|
-
default: S(() => [...c[
|
|
2561
|
+
default: S(() => [...c[59] ||= [o("确定", -1)]]),
|
|
2477
2562
|
_: 1
|
|
2478
2563
|
})]),
|
|
2479
|
-
default: S(() => [s(
|
|
2564
|
+
default: S(() => [s(C, { "label-position": "top" }, {
|
|
2480
2565
|
default: S(() => [s(p, {
|
|
2481
2566
|
label: "key",
|
|
2482
2567
|
required: ""
|
|
2483
2568
|
}, {
|
|
2484
2569
|
default: S(() => [s(x, {
|
|
2485
2570
|
modelValue: F.value,
|
|
2486
|
-
"onUpdate:modelValue": c[
|
|
2571
|
+
"onUpdate:modelValue": c[35] ||= (e) => F.value = e,
|
|
2487
2572
|
placeholder: "请输入 key"
|
|
2488
2573
|
}, null, 8, ["modelValue"])]),
|
|
2489
2574
|
_: 1
|
|
@@ -2493,7 +2578,7 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2493
2578
|
}, {
|
|
2494
2579
|
default: S(() => [s(x, {
|
|
2495
2580
|
modelValue: I.value,
|
|
2496
|
-
"onUpdate:modelValue": c[
|
|
2581
|
+
"onUpdate:modelValue": c[36] ||= (e) => I.value = e,
|
|
2497
2582
|
placeholder: "请输入 label"
|
|
2498
2583
|
}, null, 8, ["modelValue"])]),
|
|
2499
2584
|
_: 1
|
|
@@ -2505,8 +2590,8 @@ var Wi = /*#__PURE__*/ Ei(c({
|
|
|
2505
2590
|
]);
|
|
2506
2591
|
};
|
|
2507
2592
|
}
|
|
2508
|
-
}), [["__scopeId", "data-v-
|
|
2509
|
-
e.component("FitfulForm", Wi), e.component("FitfulCreateForm",
|
|
2593
|
+
}), [["__scopeId", "data-v-d32305ca"]]), ha = { install(e) {
|
|
2594
|
+
e.component("FitfulForm", Wi), e.component("FitfulCreateForm", ma), e.component("FitfulDynamicField", Di);
|
|
2510
2595
|
} };
|
|
2511
2596
|
//#endregion
|
|
2512
|
-
export {
|
|
2597
|
+
export { ma as CreateForm, Di as DynamicField, ha as FitfulFormPlugin, ha as default, Wi as Form };
|