fitful-form 0.0.3
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 +149 -0
- package/dist/form.css +2 -0
- package/dist/types/create-form/CreateForm.vue.d.ts +4 -0
- package/dist/types/create-form/CreateForm.vue.d.ts.map +1 -0
- package/dist/types/form/Form.vue.d.ts +65 -0
- package/dist/types/form/Form.vue.d.ts.map +1 -0
- package/dist/types/form/items/DynamicField.vue.d.ts +24 -0
- package/dist/types/form/items/DynamicField.vue.d.ts.map +1 -0
- package/dist/types/form/linkage.d.ts +19 -0
- package/dist/types/form/linkage.d.ts.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/types.d.ts +96 -0
- package/dist/types/types.d.ts.map +1 -0
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/vue-form.js +2321 -0
- package/dist/vue-form.umd.cjs +1 -0
- package/package.json +46 -0
package/dist/vue-form.js
ADDED
|
@@ -0,0 +1,2321 @@
|
|
|
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 C } from "vue";
|
|
2
|
+
import { ElButton as w, ElCol as T, ElForm as E, ElRow as D } from "element-plus";
|
|
3
|
+
//#region node_modules/lodash-es/_freeGlobal.js
|
|
4
|
+
var O = typeof global == "object" && global && global.Object === Object && global, k = typeof self == "object" && self && self.Object === Object && self, A = O || k || Function("return this")(), j = A.Symbol, M = Object.prototype, N = M.hasOwnProperty, P = M.toString, F = j ? j.toStringTag : void 0;
|
|
5
|
+
function I(e) {
|
|
6
|
+
var t = N.call(e, F), n = e[F];
|
|
7
|
+
try {
|
|
8
|
+
e[F] = void 0;
|
|
9
|
+
var r = !0;
|
|
10
|
+
} catch {}
|
|
11
|
+
var i = P.call(e);
|
|
12
|
+
return r && (t ? e[F] = n : delete e[F]), i;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region node_modules/lodash-es/_objectToString.js
|
|
16
|
+
var ee = Object.prototype.toString;
|
|
17
|
+
function te(e) {
|
|
18
|
+
return ee.call(e);
|
|
19
|
+
}
|
|
20
|
+
//#endregion
|
|
21
|
+
//#region node_modules/lodash-es/_baseGetTag.js
|
|
22
|
+
var ne = "[object Null]", L = "[object Undefined]", R = j ? j.toStringTag : void 0;
|
|
23
|
+
function z(e) {
|
|
24
|
+
return e == null ? e === void 0 ? L : ne : R && R in Object(e) ? I(e) : te(e);
|
|
25
|
+
}
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region node_modules/lodash-es/isObjectLike.js
|
|
28
|
+
function B(e) {
|
|
29
|
+
return typeof e == "object" && !!e;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region node_modules/lodash-es/isArray.js
|
|
33
|
+
var V = Array.isArray;
|
|
34
|
+
//#endregion
|
|
35
|
+
//#region node_modules/lodash-es/isObject.js
|
|
36
|
+
function H(e) {
|
|
37
|
+
var t = typeof e;
|
|
38
|
+
return e != null && (t == "object" || t == "function");
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region node_modules/lodash-es/isFunction.js
|
|
42
|
+
var U = "[object AsyncFunction]", re = "[object Function]", ie = "[object GeneratorFunction]", ae = "[object Proxy]";
|
|
43
|
+
function oe(e) {
|
|
44
|
+
if (!H(e)) return !1;
|
|
45
|
+
var t = z(e);
|
|
46
|
+
return t == re || t == ie || t == U || t == ae;
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region node_modules/lodash-es/_coreJsData.js
|
|
50
|
+
var se = A["__core-js_shared__"], ce = function() {
|
|
51
|
+
var e = /[^.]+$/.exec(se && se.keys && se.keys.IE_PROTO || "");
|
|
52
|
+
return e ? "Symbol(src)_1." + e : "";
|
|
53
|
+
}();
|
|
54
|
+
function le(e) {
|
|
55
|
+
return !!ce && ce in e;
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
//#region node_modules/lodash-es/_toSource.js
|
|
59
|
+
var ue = Function.prototype.toString;
|
|
60
|
+
function W(e) {
|
|
61
|
+
if (e != null) {
|
|
62
|
+
try {
|
|
63
|
+
return ue.call(e);
|
|
64
|
+
} catch {}
|
|
65
|
+
try {
|
|
66
|
+
return e + "";
|
|
67
|
+
} catch {}
|
|
68
|
+
}
|
|
69
|
+
return "";
|
|
70
|
+
}
|
|
71
|
+
//#endregion
|
|
72
|
+
//#region node_modules/lodash-es/_baseIsNative.js
|
|
73
|
+
var de = /[\\^$.*+?()[\]{}|]/g, fe = /^\[object .+?Constructor\]$/, pe = Function.prototype, me = Object.prototype, he = pe.toString, ge = me.hasOwnProperty, _e = RegExp("^" + he.call(ge).replace(de, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$");
|
|
74
|
+
function ve(e) {
|
|
75
|
+
return !H(e) || le(e) ? !1 : (oe(e) ? _e : fe).test(W(e));
|
|
76
|
+
}
|
|
77
|
+
//#endregion
|
|
78
|
+
//#region node_modules/lodash-es/_getValue.js
|
|
79
|
+
function ye(e, t) {
|
|
80
|
+
return e?.[t];
|
|
81
|
+
}
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region node_modules/lodash-es/_getNative.js
|
|
84
|
+
function G(e, t) {
|
|
85
|
+
var n = ye(e, t);
|
|
86
|
+
return ve(n) ? n : void 0;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region node_modules/lodash-es/_WeakMap.js
|
|
90
|
+
var K = G(A, "WeakMap"), be = Object.create, xe = function() {
|
|
91
|
+
function e() {}
|
|
92
|
+
return function(t) {
|
|
93
|
+
if (!H(t)) return {};
|
|
94
|
+
if (be) return be(t);
|
|
95
|
+
e.prototype = t;
|
|
96
|
+
var n = new e();
|
|
97
|
+
return e.prototype = void 0, n;
|
|
98
|
+
};
|
|
99
|
+
}();
|
|
100
|
+
//#endregion
|
|
101
|
+
//#region node_modules/lodash-es/_copyArray.js
|
|
102
|
+
function Se(e, t) {
|
|
103
|
+
var n = -1, r = e.length;
|
|
104
|
+
for (t ||= Array(r); ++n < r;) t[n] = e[n];
|
|
105
|
+
return t;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region node_modules/lodash-es/_defineProperty.js
|
|
109
|
+
var Ce = function() {
|
|
110
|
+
try {
|
|
111
|
+
var e = G(Object, "defineProperty");
|
|
112
|
+
return e({}, "", {}), e;
|
|
113
|
+
} catch {}
|
|
114
|
+
}();
|
|
115
|
+
//#endregion
|
|
116
|
+
//#region node_modules/lodash-es/_arrayEach.js
|
|
117
|
+
function we(e, t) {
|
|
118
|
+
for (var n = -1, r = e == null ? 0 : e.length; ++n < r && t(e[n], n, e) !== !1;);
|
|
119
|
+
return e;
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region node_modules/lodash-es/_isIndex.js
|
|
123
|
+
var Te = 9007199254740991, Ee = /^(?:0|[1-9]\d*)$/;
|
|
124
|
+
function De(e, t) {
|
|
125
|
+
var n = typeof e;
|
|
126
|
+
return t ??= Te, !!t && (n == "number" || n != "symbol" && Ee.test(e)) && e > -1 && e % 1 == 0 && e < t;
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region node_modules/lodash-es/_baseAssignValue.js
|
|
130
|
+
function Oe(e, t, n) {
|
|
131
|
+
t == "__proto__" && Ce ? Ce(e, t, {
|
|
132
|
+
configurable: !0,
|
|
133
|
+
enumerable: !0,
|
|
134
|
+
value: n,
|
|
135
|
+
writable: !0
|
|
136
|
+
}) : e[t] = n;
|
|
137
|
+
}
|
|
138
|
+
//#endregion
|
|
139
|
+
//#region node_modules/lodash-es/eq.js
|
|
140
|
+
function ke(e, t) {
|
|
141
|
+
return e === t || e !== e && t !== t;
|
|
142
|
+
}
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region node_modules/lodash-es/_assignValue.js
|
|
145
|
+
var Ae = Object.prototype.hasOwnProperty;
|
|
146
|
+
function je(e, t, n) {
|
|
147
|
+
var r = e[t];
|
|
148
|
+
(!(Ae.call(e, t) && ke(r, n)) || n === void 0 && !(t in e)) && Oe(e, t, n);
|
|
149
|
+
}
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region node_modules/lodash-es/_copyObject.js
|
|
152
|
+
function q(e, t, n, r) {
|
|
153
|
+
var i = !n;
|
|
154
|
+
n ||= {};
|
|
155
|
+
for (var a = -1, o = t.length; ++a < o;) {
|
|
156
|
+
var s = t[a], c = r ? r(n[s], e[s], s, n, e) : void 0;
|
|
157
|
+
c === void 0 && (c = e[s]), i ? Oe(n, s, c) : je(n, s, c);
|
|
158
|
+
}
|
|
159
|
+
return n;
|
|
160
|
+
}
|
|
161
|
+
//#endregion
|
|
162
|
+
//#region node_modules/lodash-es/isLength.js
|
|
163
|
+
var Me = 9007199254740991;
|
|
164
|
+
function Ne(e) {
|
|
165
|
+
return typeof e == "number" && e > -1 && e % 1 == 0 && e <= Me;
|
|
166
|
+
}
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region node_modules/lodash-es/isArrayLike.js
|
|
169
|
+
function Pe(e) {
|
|
170
|
+
return e != null && Ne(e.length) && !oe(e);
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region node_modules/lodash-es/_isPrototype.js
|
|
174
|
+
var Fe = Object.prototype;
|
|
175
|
+
function Ie(e) {
|
|
176
|
+
var t = e && e.constructor;
|
|
177
|
+
return e === (typeof t == "function" && t.prototype || Fe);
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region node_modules/lodash-es/_baseTimes.js
|
|
181
|
+
function Le(e, t) {
|
|
182
|
+
for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
|
|
183
|
+
return r;
|
|
184
|
+
}
|
|
185
|
+
//#endregion
|
|
186
|
+
//#region node_modules/lodash-es/_baseIsArguments.js
|
|
187
|
+
var Re = "[object Arguments]";
|
|
188
|
+
function ze(e) {
|
|
189
|
+
return B(e) && z(e) == Re;
|
|
190
|
+
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region node_modules/lodash-es/isArguments.js
|
|
193
|
+
var Be = Object.prototype, Ve = Be.hasOwnProperty, He = Be.propertyIsEnumerable, Ue = ze(function() {
|
|
194
|
+
return arguments;
|
|
195
|
+
}()) ? ze : function(e) {
|
|
196
|
+
return B(e) && Ve.call(e, "callee") && !He.call(e, "callee");
|
|
197
|
+
};
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region node_modules/lodash-es/stubFalse.js
|
|
200
|
+
function We() {
|
|
201
|
+
return !1;
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region node_modules/lodash-es/isBuffer.js
|
|
205
|
+
var Ge = typeof exports == "object" && exports && !exports.nodeType && exports, Ke = Ge && typeof module == "object" && module && !module.nodeType && module, qe = Ke && Ke.exports === Ge ? A.Buffer : void 0, Je = (qe ? qe.isBuffer : void 0) || We, Ye = "[object Arguments]", Xe = "[object Array]", Ze = "[object Boolean]", Qe = "[object Date]", $e = "[object Error]", et = "[object Function]", tt = "[object Map]", nt = "[object Number]", rt = "[object Object]", it = "[object RegExp]", at = "[object Set]", ot = "[object String]", st = "[object WeakMap]", ct = "[object ArrayBuffer]", lt = "[object DataView]", ut = "[object Float32Array]", dt = "[object Float64Array]", ft = "[object Int8Array]", pt = "[object Int16Array]", mt = "[object Int32Array]", ht = "[object Uint8Array]", gt = "[object Uint8ClampedArray]", _t = "[object Uint16Array]", vt = "[object Uint32Array]", J = {};
|
|
206
|
+
J[ut] = J[dt] = J[ft] = J[pt] = J[mt] = J[ht] = J[gt] = J[_t] = J[vt] = !0, J[Ye] = J[Xe] = J[ct] = J[Ze] = J[lt] = J[Qe] = J[$e] = J[et] = J[tt] = J[nt] = J[rt] = J[it] = J[at] = J[ot] = J[st] = !1;
|
|
207
|
+
function yt(e) {
|
|
208
|
+
return B(e) && Ne(e.length) && !!J[z(e)];
|
|
209
|
+
}
|
|
210
|
+
//#endregion
|
|
211
|
+
//#region node_modules/lodash-es/_baseUnary.js
|
|
212
|
+
function bt(e) {
|
|
213
|
+
return function(t) {
|
|
214
|
+
return e(t);
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region node_modules/lodash-es/_nodeUtil.js
|
|
219
|
+
var xt = typeof exports == "object" && exports && !exports.nodeType && exports, St = xt && typeof module == "object" && module && !module.nodeType && module, Ct = St && St.exports === xt && O.process, Y = function() {
|
|
220
|
+
try {
|
|
221
|
+
return St && St.require && St.require("util").types || Ct && Ct.binding && Ct.binding("util");
|
|
222
|
+
} catch {}
|
|
223
|
+
}(), wt = Y && Y.isTypedArray, Tt = wt ? bt(wt) : yt, Et = Object.prototype.hasOwnProperty;
|
|
224
|
+
function Dt(e, t) {
|
|
225
|
+
var n = V(e), r = !n && Ue(e), i = !n && !r && Je(e), a = !n && !r && !i && Tt(e), o = n || r || i || a, s = o ? Le(e.length, String) : [], c = s.length;
|
|
226
|
+
for (var l in e) (t || Et.call(e, l)) && !(o && (l == "length" || i && (l == "offset" || l == "parent") || a && (l == "buffer" || l == "byteLength" || l == "byteOffset") || De(l, c))) && s.push(l);
|
|
227
|
+
return s;
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region node_modules/lodash-es/_overArg.js
|
|
231
|
+
function Ot(e, t) {
|
|
232
|
+
return function(n) {
|
|
233
|
+
return e(t(n));
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
//#endregion
|
|
237
|
+
//#region node_modules/lodash-es/_nativeKeys.js
|
|
238
|
+
var kt = Ot(Object.keys, Object), At = Object.prototype.hasOwnProperty;
|
|
239
|
+
function jt(e) {
|
|
240
|
+
if (!Ie(e)) return kt(e);
|
|
241
|
+
var t = [];
|
|
242
|
+
for (var n in Object(e)) At.call(e, n) && n != "constructor" && t.push(n);
|
|
243
|
+
return t;
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region node_modules/lodash-es/keys.js
|
|
247
|
+
function Mt(e) {
|
|
248
|
+
return Pe(e) ? Dt(e) : jt(e);
|
|
249
|
+
}
|
|
250
|
+
//#endregion
|
|
251
|
+
//#region node_modules/lodash-es/_nativeKeysIn.js
|
|
252
|
+
function Nt(e) {
|
|
253
|
+
var t = [];
|
|
254
|
+
if (e != null) for (var n in Object(e)) t.push(n);
|
|
255
|
+
return t;
|
|
256
|
+
}
|
|
257
|
+
//#endregion
|
|
258
|
+
//#region node_modules/lodash-es/_baseKeysIn.js
|
|
259
|
+
var Pt = Object.prototype.hasOwnProperty;
|
|
260
|
+
function Ft(e) {
|
|
261
|
+
if (!H(e)) return Nt(e);
|
|
262
|
+
var t = Ie(e), n = [];
|
|
263
|
+
for (var r in e) r == "constructor" && (t || !Pt.call(e, r)) || n.push(r);
|
|
264
|
+
return n;
|
|
265
|
+
}
|
|
266
|
+
//#endregion
|
|
267
|
+
//#region node_modules/lodash-es/keysIn.js
|
|
268
|
+
function It(e) {
|
|
269
|
+
return Pe(e) ? Dt(e, !0) : Ft(e);
|
|
270
|
+
}
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region node_modules/lodash-es/_nativeCreate.js
|
|
273
|
+
var Lt = G(Object, "create");
|
|
274
|
+
//#endregion
|
|
275
|
+
//#region node_modules/lodash-es/_hashClear.js
|
|
276
|
+
function Rt() {
|
|
277
|
+
this.__data__ = Lt ? Lt(null) : {}, this.size = 0;
|
|
278
|
+
}
|
|
279
|
+
//#endregion
|
|
280
|
+
//#region node_modules/lodash-es/_hashDelete.js
|
|
281
|
+
function zt(e) {
|
|
282
|
+
var t = this.has(e) && delete this.__data__[e];
|
|
283
|
+
return this.size -= +!!t, t;
|
|
284
|
+
}
|
|
285
|
+
//#endregion
|
|
286
|
+
//#region node_modules/lodash-es/_hashGet.js
|
|
287
|
+
var Bt = "__lodash_hash_undefined__", Vt = Object.prototype.hasOwnProperty;
|
|
288
|
+
function Ht(e) {
|
|
289
|
+
var t = this.__data__;
|
|
290
|
+
if (Lt) {
|
|
291
|
+
var n = t[e];
|
|
292
|
+
return n === Bt ? void 0 : n;
|
|
293
|
+
}
|
|
294
|
+
return Vt.call(t, e) ? t[e] : void 0;
|
|
295
|
+
}
|
|
296
|
+
//#endregion
|
|
297
|
+
//#region node_modules/lodash-es/_hashHas.js
|
|
298
|
+
var Ut = Object.prototype.hasOwnProperty;
|
|
299
|
+
function Wt(e) {
|
|
300
|
+
var t = this.__data__;
|
|
301
|
+
return Lt ? t[e] !== void 0 : Ut.call(t, e);
|
|
302
|
+
}
|
|
303
|
+
//#endregion
|
|
304
|
+
//#region node_modules/lodash-es/_hashSet.js
|
|
305
|
+
var Gt = "__lodash_hash_undefined__";
|
|
306
|
+
function Kt(e, t) {
|
|
307
|
+
var n = this.__data__;
|
|
308
|
+
return this.size += +!this.has(e), n[e] = Lt && t === void 0 ? Gt : t, this;
|
|
309
|
+
}
|
|
310
|
+
//#endregion
|
|
311
|
+
//#region node_modules/lodash-es/_Hash.js
|
|
312
|
+
function X(e) {
|
|
313
|
+
var t = -1, n = e == null ? 0 : e.length;
|
|
314
|
+
for (this.clear(); ++t < n;) {
|
|
315
|
+
var r = e[t];
|
|
316
|
+
this.set(r[0], r[1]);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
X.prototype.clear = Rt, X.prototype.delete = zt, X.prototype.get = Ht, X.prototype.has = Wt, X.prototype.set = Kt;
|
|
320
|
+
//#endregion
|
|
321
|
+
//#region node_modules/lodash-es/_listCacheClear.js
|
|
322
|
+
function qt() {
|
|
323
|
+
this.__data__ = [], this.size = 0;
|
|
324
|
+
}
|
|
325
|
+
//#endregion
|
|
326
|
+
//#region node_modules/lodash-es/_assocIndexOf.js
|
|
327
|
+
function Jt(e, t) {
|
|
328
|
+
for (var n = e.length; n--;) if (ke(e[n][0], t)) return n;
|
|
329
|
+
return -1;
|
|
330
|
+
}
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region node_modules/lodash-es/_listCacheDelete.js
|
|
333
|
+
var Yt = Array.prototype.splice;
|
|
334
|
+
function Xt(e) {
|
|
335
|
+
var t = this.__data__, n = Jt(t, e);
|
|
336
|
+
return n < 0 ? !1 : (n == t.length - 1 ? t.pop() : Yt.call(t, n, 1), --this.size, !0);
|
|
337
|
+
}
|
|
338
|
+
//#endregion
|
|
339
|
+
//#region node_modules/lodash-es/_listCacheGet.js
|
|
340
|
+
function Zt(e) {
|
|
341
|
+
var t = this.__data__, n = Jt(t, e);
|
|
342
|
+
return n < 0 ? void 0 : t[n][1];
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
//#region node_modules/lodash-es/_listCacheHas.js
|
|
346
|
+
function Qt(e) {
|
|
347
|
+
return Jt(this.__data__, e) > -1;
|
|
348
|
+
}
|
|
349
|
+
//#endregion
|
|
350
|
+
//#region node_modules/lodash-es/_listCacheSet.js
|
|
351
|
+
function $t(e, t) {
|
|
352
|
+
var n = this.__data__, r = Jt(n, e);
|
|
353
|
+
return r < 0 ? (++this.size, n.push([e, t])) : n[r][1] = t, this;
|
|
354
|
+
}
|
|
355
|
+
//#endregion
|
|
356
|
+
//#region node_modules/lodash-es/_ListCache.js
|
|
357
|
+
function Z(e) {
|
|
358
|
+
var t = -1, n = e == null ? 0 : e.length;
|
|
359
|
+
for (this.clear(); ++t < n;) {
|
|
360
|
+
var r = e[t];
|
|
361
|
+
this.set(r[0], r[1]);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
Z.prototype.clear = qt, Z.prototype.delete = Xt, Z.prototype.get = Zt, Z.prototype.has = Qt, Z.prototype.set = $t;
|
|
365
|
+
//#endregion
|
|
366
|
+
//#region node_modules/lodash-es/_Map.js
|
|
367
|
+
var en = G(A, "Map");
|
|
368
|
+
//#endregion
|
|
369
|
+
//#region node_modules/lodash-es/_mapCacheClear.js
|
|
370
|
+
function tn() {
|
|
371
|
+
this.size = 0, this.__data__ = {
|
|
372
|
+
hash: new X(),
|
|
373
|
+
map: new (en || Z)(),
|
|
374
|
+
string: new X()
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
//#endregion
|
|
378
|
+
//#region node_modules/lodash-es/_isKeyable.js
|
|
379
|
+
function nn(e) {
|
|
380
|
+
var t = typeof e;
|
|
381
|
+
return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
|
|
382
|
+
}
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region node_modules/lodash-es/_getMapData.js
|
|
385
|
+
function rn(e, t) {
|
|
386
|
+
var n = e.__data__;
|
|
387
|
+
return nn(t) ? n[typeof t == "string" ? "string" : "hash"] : n.map;
|
|
388
|
+
}
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region node_modules/lodash-es/_mapCacheDelete.js
|
|
391
|
+
function an(e) {
|
|
392
|
+
var t = rn(this, e).delete(e);
|
|
393
|
+
return this.size -= +!!t, t;
|
|
394
|
+
}
|
|
395
|
+
//#endregion
|
|
396
|
+
//#region node_modules/lodash-es/_mapCacheGet.js
|
|
397
|
+
function on(e) {
|
|
398
|
+
return rn(this, e).get(e);
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
//#region node_modules/lodash-es/_mapCacheHas.js
|
|
402
|
+
function sn(e) {
|
|
403
|
+
return rn(this, e).has(e);
|
|
404
|
+
}
|
|
405
|
+
//#endregion
|
|
406
|
+
//#region node_modules/lodash-es/_mapCacheSet.js
|
|
407
|
+
function cn(e, t) {
|
|
408
|
+
var n = rn(this, e), r = n.size;
|
|
409
|
+
return n.set(e, t), this.size += n.size == r ? 0 : 1, this;
|
|
410
|
+
}
|
|
411
|
+
//#endregion
|
|
412
|
+
//#region node_modules/lodash-es/_MapCache.js
|
|
413
|
+
function ln(e) {
|
|
414
|
+
var t = -1, n = e == null ? 0 : e.length;
|
|
415
|
+
for (this.clear(); ++t < n;) {
|
|
416
|
+
var r = e[t];
|
|
417
|
+
this.set(r[0], r[1]);
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
ln.prototype.clear = tn, ln.prototype.delete = an, ln.prototype.get = on, ln.prototype.has = sn, ln.prototype.set = cn;
|
|
421
|
+
//#endregion
|
|
422
|
+
//#region node_modules/lodash-es/_arrayPush.js
|
|
423
|
+
function un(e, t) {
|
|
424
|
+
for (var n = -1, r = t.length, i = e.length; ++n < r;) e[i + n] = t[n];
|
|
425
|
+
return e;
|
|
426
|
+
}
|
|
427
|
+
//#endregion
|
|
428
|
+
//#region node_modules/lodash-es/_getPrototype.js
|
|
429
|
+
var dn = Ot(Object.getPrototypeOf, Object);
|
|
430
|
+
//#endregion
|
|
431
|
+
//#region node_modules/lodash-es/_stackClear.js
|
|
432
|
+
function fn() {
|
|
433
|
+
this.__data__ = new Z(), this.size = 0;
|
|
434
|
+
}
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region node_modules/lodash-es/_stackDelete.js
|
|
437
|
+
function pn(e) {
|
|
438
|
+
var t = this.__data__, n = t.delete(e);
|
|
439
|
+
return this.size = t.size, n;
|
|
440
|
+
}
|
|
441
|
+
//#endregion
|
|
442
|
+
//#region node_modules/lodash-es/_stackGet.js
|
|
443
|
+
function mn(e) {
|
|
444
|
+
return this.__data__.get(e);
|
|
445
|
+
}
|
|
446
|
+
//#endregion
|
|
447
|
+
//#region node_modules/lodash-es/_stackHas.js
|
|
448
|
+
function hn(e) {
|
|
449
|
+
return this.__data__.has(e);
|
|
450
|
+
}
|
|
451
|
+
//#endregion
|
|
452
|
+
//#region node_modules/lodash-es/_stackSet.js
|
|
453
|
+
var gn = 200;
|
|
454
|
+
function _n(e, t) {
|
|
455
|
+
var n = this.__data__;
|
|
456
|
+
if (n instanceof Z) {
|
|
457
|
+
var r = n.__data__;
|
|
458
|
+
if (!en || r.length < gn - 1) return r.push([e, t]), this.size = ++n.size, this;
|
|
459
|
+
n = this.__data__ = new ln(r);
|
|
460
|
+
}
|
|
461
|
+
return n.set(e, t), this.size = n.size, this;
|
|
462
|
+
}
|
|
463
|
+
//#endregion
|
|
464
|
+
//#region node_modules/lodash-es/_Stack.js
|
|
465
|
+
function vn(e) {
|
|
466
|
+
var t = this.__data__ = new Z(e);
|
|
467
|
+
this.size = t.size;
|
|
468
|
+
}
|
|
469
|
+
vn.prototype.clear = fn, vn.prototype.delete = pn, vn.prototype.get = mn, vn.prototype.has = hn, vn.prototype.set = _n;
|
|
470
|
+
//#endregion
|
|
471
|
+
//#region node_modules/lodash-es/_baseAssign.js
|
|
472
|
+
function yn(e, t) {
|
|
473
|
+
return e && q(t, Mt(t), e);
|
|
474
|
+
}
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region node_modules/lodash-es/_baseAssignIn.js
|
|
477
|
+
function bn(e, t) {
|
|
478
|
+
return e && q(t, It(t), e);
|
|
479
|
+
}
|
|
480
|
+
//#endregion
|
|
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 ? A.Buffer : void 0, wn = Cn ? Cn.allocUnsafe : void 0;
|
|
483
|
+
function Tn(e, t) {
|
|
484
|
+
if (t) return e.slice();
|
|
485
|
+
var n = e.length, r = wn ? wn(n) : new e.constructor(n);
|
|
486
|
+
return e.copy(r), r;
|
|
487
|
+
}
|
|
488
|
+
//#endregion
|
|
489
|
+
//#region node_modules/lodash-es/_arrayFilter.js
|
|
490
|
+
function En(e, t) {
|
|
491
|
+
for (var n = -1, r = e == null ? 0 : e.length, i = 0, a = []; ++n < r;) {
|
|
492
|
+
var o = e[n];
|
|
493
|
+
t(o, n, e) && (a[i++] = o);
|
|
494
|
+
}
|
|
495
|
+
return a;
|
|
496
|
+
}
|
|
497
|
+
//#endregion
|
|
498
|
+
//#region node_modules/lodash-es/stubArray.js
|
|
499
|
+
function Dn() {
|
|
500
|
+
return [];
|
|
501
|
+
}
|
|
502
|
+
//#endregion
|
|
503
|
+
//#region node_modules/lodash-es/_getSymbols.js
|
|
504
|
+
var On = Object.prototype.propertyIsEnumerable, kn = Object.getOwnPropertySymbols, An = kn ? function(e) {
|
|
505
|
+
return e == null ? [] : (e = Object(e), En(kn(e), function(t) {
|
|
506
|
+
return On.call(e, t);
|
|
507
|
+
}));
|
|
508
|
+
} : Dn;
|
|
509
|
+
//#endregion
|
|
510
|
+
//#region node_modules/lodash-es/_copySymbols.js
|
|
511
|
+
function jn(e, t) {
|
|
512
|
+
return q(e, An(e), t);
|
|
513
|
+
}
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region node_modules/lodash-es/_getSymbolsIn.js
|
|
516
|
+
var Mn = Object.getOwnPropertySymbols ? function(e) {
|
|
517
|
+
for (var t = []; e;) un(t, An(e)), e = dn(e);
|
|
518
|
+
return t;
|
|
519
|
+
} : Dn;
|
|
520
|
+
//#endregion
|
|
521
|
+
//#region node_modules/lodash-es/_copySymbolsIn.js
|
|
522
|
+
function Nn(e, t) {
|
|
523
|
+
return q(e, Mn(e), t);
|
|
524
|
+
}
|
|
525
|
+
//#endregion
|
|
526
|
+
//#region node_modules/lodash-es/_baseGetAllKeys.js
|
|
527
|
+
function Pn(e, t, n) {
|
|
528
|
+
var r = t(e);
|
|
529
|
+
return V(e) ? r : un(r, n(e));
|
|
530
|
+
}
|
|
531
|
+
//#endregion
|
|
532
|
+
//#region node_modules/lodash-es/_getAllKeys.js
|
|
533
|
+
function Fn(e) {
|
|
534
|
+
return Pn(e, Mt, An);
|
|
535
|
+
}
|
|
536
|
+
//#endregion
|
|
537
|
+
//#region node_modules/lodash-es/_getAllKeysIn.js
|
|
538
|
+
function In(e) {
|
|
539
|
+
return Pn(e, It, Mn);
|
|
540
|
+
}
|
|
541
|
+
//#endregion
|
|
542
|
+
//#region node_modules/lodash-es/_DataView.js
|
|
543
|
+
var Ln = G(A, "DataView"), Rn = G(A, "Promise"), zn = G(A, "Set"), Bn = "[object Map]", Vn = "[object Object]", Hn = "[object Promise]", Un = "[object Set]", Wn = "[object WeakMap]", Gn = "[object DataView]", Kn = W(Ln), qn = W(en), Jn = W(Rn), Yn = W(zn), Xn = W(K), 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 || K && Q(new K()) != Wn) && (Q = function(e) {
|
|
545
|
+
var t = z(e), n = t == Vn ? e.constructor : void 0, r = n ? W(n) : "";
|
|
546
|
+
if (r) switch (r) {
|
|
547
|
+
case Kn: return Gn;
|
|
548
|
+
case qn: return Bn;
|
|
549
|
+
case Jn: return Hn;
|
|
550
|
+
case Yn: return Un;
|
|
551
|
+
case Xn: return Wn;
|
|
552
|
+
}
|
|
553
|
+
return t;
|
|
554
|
+
});
|
|
555
|
+
var Zn = Q, Qn = Object.prototype.hasOwnProperty;
|
|
556
|
+
function $n(e) {
|
|
557
|
+
var t = e.length, n = new e.constructor(t);
|
|
558
|
+
return t && typeof e[0] == "string" && Qn.call(e, "index") && (n.index = e.index, n.input = e.input), n;
|
|
559
|
+
}
|
|
560
|
+
//#endregion
|
|
561
|
+
//#region node_modules/lodash-es/_Uint8Array.js
|
|
562
|
+
var er = A.Uint8Array;
|
|
563
|
+
//#endregion
|
|
564
|
+
//#region node_modules/lodash-es/_cloneArrayBuffer.js
|
|
565
|
+
function tr(e) {
|
|
566
|
+
var t = new e.constructor(e.byteLength);
|
|
567
|
+
return new er(t).set(new er(e)), t;
|
|
568
|
+
}
|
|
569
|
+
//#endregion
|
|
570
|
+
//#region node_modules/lodash-es/_cloneDataView.js
|
|
571
|
+
function nr(e, t) {
|
|
572
|
+
var n = t ? tr(e.buffer) : e.buffer;
|
|
573
|
+
return new e.constructor(n, e.byteOffset, e.byteLength);
|
|
574
|
+
}
|
|
575
|
+
//#endregion
|
|
576
|
+
//#region node_modules/lodash-es/_cloneRegExp.js
|
|
577
|
+
var rr = /\w*$/;
|
|
578
|
+
function ir(e) {
|
|
579
|
+
var t = new e.constructor(e.source, rr.exec(e));
|
|
580
|
+
return t.lastIndex = e.lastIndex, t;
|
|
581
|
+
}
|
|
582
|
+
//#endregion
|
|
583
|
+
//#region node_modules/lodash-es/_cloneSymbol.js
|
|
584
|
+
var ar = j ? j.prototype : void 0, or = ar ? ar.valueOf : void 0;
|
|
585
|
+
function sr(e) {
|
|
586
|
+
return or ? Object(or.call(e)) : {};
|
|
587
|
+
}
|
|
588
|
+
//#endregion
|
|
589
|
+
//#region node_modules/lodash-es/_cloneTypedArray.js
|
|
590
|
+
function cr(e, t) {
|
|
591
|
+
var n = t ? tr(e.buffer) : e.buffer;
|
|
592
|
+
return new e.constructor(n, e.byteOffset, e.length);
|
|
593
|
+
}
|
|
594
|
+
//#endregion
|
|
595
|
+
//#region node_modules/lodash-es/_initCloneByTag.js
|
|
596
|
+
var lr = "[object Boolean]", ur = "[object Date]", dr = "[object Map]", fr = "[object Number]", pr = "[object RegExp]", mr = "[object Set]", hr = "[object String]", gr = "[object Symbol]", _r = "[object ArrayBuffer]", vr = "[object DataView]", yr = "[object Float32Array]", br = "[object Float64Array]", xr = "[object Int8Array]", Sr = "[object Int16Array]", Cr = "[object Int32Array]", wr = "[object Uint8Array]", Tr = "[object Uint8ClampedArray]", Er = "[object Uint16Array]", Dr = "[object Uint32Array]";
|
|
597
|
+
function Or(e, t, n) {
|
|
598
|
+
var r = e.constructor;
|
|
599
|
+
switch (t) {
|
|
600
|
+
case _r: return tr(e);
|
|
601
|
+
case lr:
|
|
602
|
+
case ur: return new r(+e);
|
|
603
|
+
case vr: return nr(e, n);
|
|
604
|
+
case yr:
|
|
605
|
+
case br:
|
|
606
|
+
case xr:
|
|
607
|
+
case Sr:
|
|
608
|
+
case Cr:
|
|
609
|
+
case wr:
|
|
610
|
+
case Tr:
|
|
611
|
+
case Er:
|
|
612
|
+
case Dr: return cr(e, n);
|
|
613
|
+
case dr: return new r();
|
|
614
|
+
case fr:
|
|
615
|
+
case hr: return new r(e);
|
|
616
|
+
case pr: return ir(e);
|
|
617
|
+
case mr: return new r();
|
|
618
|
+
case gr: return sr(e);
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
//#endregion
|
|
622
|
+
//#region node_modules/lodash-es/_initCloneObject.js
|
|
623
|
+
function kr(e) {
|
|
624
|
+
return typeof e.constructor == "function" && !Ie(e) ? xe(dn(e)) : {};
|
|
625
|
+
}
|
|
626
|
+
//#endregion
|
|
627
|
+
//#region node_modules/lodash-es/_baseIsMap.js
|
|
628
|
+
var Ar = "[object Map]";
|
|
629
|
+
function jr(e) {
|
|
630
|
+
return B(e) && Zn(e) == Ar;
|
|
631
|
+
}
|
|
632
|
+
//#endregion
|
|
633
|
+
//#region node_modules/lodash-es/isMap.js
|
|
634
|
+
var Mr = Y && Y.isMap, Nr = Mr ? bt(Mr) : jr, Pr = "[object Set]";
|
|
635
|
+
function Fr(e) {
|
|
636
|
+
return B(e) && Zn(e) == Pr;
|
|
637
|
+
}
|
|
638
|
+
//#endregion
|
|
639
|
+
//#region node_modules/lodash-es/isSet.js
|
|
640
|
+
var Ir = Y && Y.isSet, Lr = Ir ? bt(Ir) : Fr, Rr = 1, zr = 2, Br = 4, Vr = "[object Arguments]", Hr = "[object Array]", Ur = "[object Boolean]", Wr = "[object Date]", Gr = "[object Error]", Kr = "[object Function]", qr = "[object GeneratorFunction]", Jr = "[object Map]", Yr = "[object Number]", Xr = "[object Object]", Zr = "[object RegExp]", Qr = "[object Set]", $r = "[object String]", ei = "[object Symbol]", ti = "[object WeakMap]", ni = "[object ArrayBuffer]", ri = "[object DataView]", ii = "[object Float32Array]", ai = "[object Float64Array]", oi = "[object Int8Array]", si = "[object Int16Array]", ci = "[object Int32Array]", li = "[object Uint8Array]", ui = "[object Uint8ClampedArray]", di = "[object Uint16Array]", fi = "[object Uint32Array]", $ = {};
|
|
641
|
+
$[Vr] = $[Hr] = $[ni] = $[ri] = $[Ur] = $[Wr] = $[ii] = $[ai] = $[oi] = $[si] = $[ci] = $[Jr] = $[Yr] = $[Xr] = $[Zr] = $[Qr] = $[$r] = $[ei] = $[li] = $[ui] = $[di] = $[fi] = !0, $[Gr] = $[Kr] = $[ti] = !1;
|
|
642
|
+
function pi(e, t, n, r, i, a) {
|
|
643
|
+
var o, s = t & Rr, c = t & zr, l = t & Br;
|
|
644
|
+
if (n && (o = i ? n(e, r, i, a) : n(e)), o !== void 0) return o;
|
|
645
|
+
if (!H(e)) return e;
|
|
646
|
+
var u = V(e);
|
|
647
|
+
if (u) {
|
|
648
|
+
if (o = $n(e), !s) return Se(e, o);
|
|
649
|
+
} else {
|
|
650
|
+
var d = Zn(e), f = d == Kr || d == qr;
|
|
651
|
+
if (Je(e)) return Tn(e, s);
|
|
652
|
+
if (d == Xr || d == Vr || f && !i) {
|
|
653
|
+
if (o = c || f ? {} : kr(e), !s) return c ? Nn(e, bn(o, e)) : jn(e, yn(o, e));
|
|
654
|
+
} else {
|
|
655
|
+
if (!$[d]) return i ? e : {};
|
|
656
|
+
o = Or(e, d, s);
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
a ||= new vn();
|
|
660
|
+
var p = a.get(e);
|
|
661
|
+
if (p) return p;
|
|
662
|
+
a.set(e, o), Lr(e) ? e.forEach(function(r) {
|
|
663
|
+
o.add(pi(r, t, n, r, e, a));
|
|
664
|
+
}) : Nr(e) && e.forEach(function(r, i) {
|
|
665
|
+
o.set(i, pi(r, t, n, i, e, a));
|
|
666
|
+
});
|
|
667
|
+
var m = u ? void 0 : (l ? c ? In : Fn : c ? It : Mt)(e);
|
|
668
|
+
return we(m || e, function(r, i) {
|
|
669
|
+
m && (i = r, r = e[i]), je(o, i, pi(r, t, n, i, e, a));
|
|
670
|
+
}), o;
|
|
671
|
+
}
|
|
672
|
+
//#endregion
|
|
673
|
+
//#region node_modules/lodash-es/cloneDeep.js
|
|
674
|
+
var mi = 1, hi = 4;
|
|
675
|
+
function gi(e) {
|
|
676
|
+
return pi(e, mi | hi);
|
|
677
|
+
}
|
|
678
|
+
//#endregion
|
|
679
|
+
//#region src/packages/form/items/DynamicField.vue?vue&type=script&setup=true&lang.ts
|
|
680
|
+
var _i = ["data-field-key"], vi = { class: "form-item-label" }, yi = {
|
|
681
|
+
key: 0,
|
|
682
|
+
class: "text-field"
|
|
683
|
+
}, bi = /*@__PURE__*/ c({
|
|
684
|
+
name: "DynamicField",
|
|
685
|
+
__name: "DynamicField",
|
|
686
|
+
props: {
|
|
687
|
+
child: {},
|
|
688
|
+
prop: {},
|
|
689
|
+
modelValue: { type: [
|
|
690
|
+
String,
|
|
691
|
+
Number,
|
|
692
|
+
Boolean,
|
|
693
|
+
null,
|
|
694
|
+
Date,
|
|
695
|
+
Array,
|
|
696
|
+
Object
|
|
697
|
+
] }
|
|
698
|
+
},
|
|
699
|
+
emits: ["update:modelValue"],
|
|
700
|
+
setup(r, { emit: c }) {
|
|
701
|
+
let l = r, d = c;
|
|
702
|
+
function f(e, t = l.child.options ?? []) {
|
|
703
|
+
for (let n of t) {
|
|
704
|
+
if (!n || typeof n != "object") continue;
|
|
705
|
+
let t = n.value ?? n.key ?? n;
|
|
706
|
+
if (Object.is(t, e)) return String(n.label ?? e);
|
|
707
|
+
if (t && typeof t == "object" && e && typeof e == "object") {
|
|
708
|
+
let r = l.child.valueKey ?? "value";
|
|
709
|
+
if (t[r] === e[r]) return String(n.label ?? e);
|
|
710
|
+
}
|
|
711
|
+
if (n.children) {
|
|
712
|
+
let t = f(e, n.children);
|
|
713
|
+
if (t !== null) return t;
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
return null;
|
|
717
|
+
}
|
|
718
|
+
function p(e) {
|
|
719
|
+
if (e == null || e === "") return "-";
|
|
720
|
+
if (e instanceof Date) return e.toLocaleString();
|
|
721
|
+
if (typeof e == "boolean") return e ? "是" : "否";
|
|
722
|
+
if (typeof e == "object") {
|
|
723
|
+
let t = f(e);
|
|
724
|
+
if (t !== null) return t;
|
|
725
|
+
try {
|
|
726
|
+
return JSON.stringify(e);
|
|
727
|
+
} catch {
|
|
728
|
+
return String(e);
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
return String(e);
|
|
732
|
+
}
|
|
733
|
+
function h(e) {
|
|
734
|
+
return e.map((e) => f(e) ?? p(e));
|
|
735
|
+
}
|
|
736
|
+
let g = t(() => {
|
|
737
|
+
let e = l.child.placeholder ?? x(l.child.type) ?? `${l.child.label ?? l.child.key}不能为空`, t = (l.child.rules ?? []).map((t) => {
|
|
738
|
+
let n = { ...t };
|
|
739
|
+
return n.required && !n.message && (n.message = e), n;
|
|
740
|
+
});
|
|
741
|
+
return l.child.required && !t.some((e) => e.required) && t.push({
|
|
742
|
+
required: !0,
|
|
743
|
+
message: e,
|
|
744
|
+
trigger: ["blur", "change"]
|
|
745
|
+
}), t;
|
|
746
|
+
});
|
|
747
|
+
function x(e) {
|
|
748
|
+
if ([
|
|
749
|
+
"select",
|
|
750
|
+
"cascader",
|
|
751
|
+
"treeSelect",
|
|
752
|
+
"transfer",
|
|
753
|
+
"datePicker",
|
|
754
|
+
"datetimePicker",
|
|
755
|
+
"timePicker",
|
|
756
|
+
"timeSelect",
|
|
757
|
+
"virtualizedSelect"
|
|
758
|
+
].includes(e)) return "请选择";
|
|
759
|
+
if ([
|
|
760
|
+
"input",
|
|
761
|
+
"textarea",
|
|
762
|
+
"inputNumber",
|
|
763
|
+
"inputTag",
|
|
764
|
+
"inputOTP",
|
|
765
|
+
"mention"
|
|
766
|
+
].includes(e)) return "请输入";
|
|
767
|
+
}
|
|
768
|
+
let C = t(() => {
|
|
769
|
+
let e = { ...l.child.props ?? {} }, t = [
|
|
770
|
+
"key",
|
|
771
|
+
"label",
|
|
772
|
+
"type",
|
|
773
|
+
"span",
|
|
774
|
+
"offset",
|
|
775
|
+
"labelWidth",
|
|
776
|
+
"label-width",
|
|
777
|
+
"required",
|
|
778
|
+
"options",
|
|
779
|
+
"rules",
|
|
780
|
+
"value",
|
|
781
|
+
"description",
|
|
782
|
+
"default",
|
|
783
|
+
"children",
|
|
784
|
+
"props",
|
|
785
|
+
"visible",
|
|
786
|
+
"clearOnHide",
|
|
787
|
+
"linkage",
|
|
788
|
+
"border",
|
|
789
|
+
"isText",
|
|
790
|
+
"dictCode",
|
|
791
|
+
"utc"
|
|
792
|
+
];
|
|
793
|
+
for (let [n, r] of Object.entries(l.child)) t.includes(n) || (e[n] = r);
|
|
794
|
+
if (l.child.placeholder === void 0 && !e.placeholder) {
|
|
795
|
+
let t = x(l.child.type);
|
|
796
|
+
t && (e.placeholder = t);
|
|
797
|
+
}
|
|
798
|
+
return e;
|
|
799
|
+
});
|
|
800
|
+
return (t, c) => {
|
|
801
|
+
let l = y("el-tag"), f = y("el-text"), x = y("el-input"), w = y("el-option"), T = y("el-select"), E = y("el-cascader"), D = y("el-checkbox"), O = y("el-color-picker"), k = y("el-date-picker"), A = y("el-input-number"), j = y("el-input-tag"), M = y("el-input-otp"), N = y("el-mention"), P = y("el-radio"), F = y("el-radio-group"), I = y("el-rate"), ee = y("el-select-v2"), te = y("el-slider"), ne = y("el-switch"), L = y("el-time-picker"), R = y("el-time-select"), z = y("el-transfer"), B = y("el-tree-select"), V = y("el-button"), H = y("el-upload"), U = y("el-form-item"), re = y("el-col");
|
|
802
|
+
return m(), n(re, {
|
|
803
|
+
class: "dynamic-field-col",
|
|
804
|
+
span: r.child.span ?? 6,
|
|
805
|
+
offset: r.child.offset
|
|
806
|
+
}, {
|
|
807
|
+
default: S(() => [a("div", {
|
|
808
|
+
class: "form-node",
|
|
809
|
+
"data-field-key": r.child.key
|
|
810
|
+
}, [s(U, {
|
|
811
|
+
"label-width": r.child.labelWidth ?? r.child["label-width"],
|
|
812
|
+
prop: r.prop ?? r.child.key,
|
|
813
|
+
required: r.child.required,
|
|
814
|
+
rules: g.value
|
|
815
|
+
}, {
|
|
816
|
+
label: S(() => [a("span", vi, [v(t.$slots, "action", {}, void 0, !0), a("span", null, b(r.child.label), 1)])]),
|
|
817
|
+
default: S(() => [r.child.isText ? (m(), i("div", yi, [Array.isArray(r.modelValue) ? (m(), i(e, { key: 0 }, [r.modelValue.length ? (m(!0), i(e, { key: 0 }, _(h(r.modelValue), (e, t) => (m(), n(l, {
|
|
818
|
+
key: t,
|
|
819
|
+
class: "text-field-tag"
|
|
820
|
+
}, {
|
|
821
|
+
default: S(() => [o(b(e), 1)]),
|
|
822
|
+
_: 2
|
|
823
|
+
}, 1024))), 128)) : (m(), n(f, { key: 1 }, {
|
|
824
|
+
default: S(() => [...c[22] ||= [o("-", -1)]]),
|
|
825
|
+
_: 1
|
|
826
|
+
}))], 64)) : (m(), n(f, { key: 1 }, {
|
|
827
|
+
default: S(() => [o(b(p(r.modelValue)), 1)]),
|
|
828
|
+
_: 1
|
|
829
|
+
}))])) : r.child.type === "input" ? (m(), n(x, u({ key: 1 }, C.value, {
|
|
830
|
+
"model-value": r.modelValue ?? "",
|
|
831
|
+
"onUpdate:modelValue": c[0] ||= (e) => d("update:modelValue", e)
|
|
832
|
+
}), null, 16, ["model-value"])) : r.child.type === "select" ? (m(), n(T, u({ key: 2 }, C.value, {
|
|
833
|
+
"model-value": r.modelValue,
|
|
834
|
+
"value-key": r.child.valueKey ?? "value",
|
|
835
|
+
"onUpdate:modelValue": c[1] ||= (e) => d("update:modelValue", e)
|
|
836
|
+
}), {
|
|
837
|
+
default: S(() => [(m(!0), i(e, null, _(r.child.options ?? [], (e) => (m(), n(w, {
|
|
838
|
+
key: e.label,
|
|
839
|
+
label: e.label,
|
|
840
|
+
value: e.value
|
|
841
|
+
}, null, 8, ["label", "value"]))), 128))]),
|
|
842
|
+
_: 1
|
|
843
|
+
}, 16, ["model-value", "value-key"])) : r.child.type === "cascader" ? (m(), n(E, u({ key: 3 }, C.value, {
|
|
844
|
+
"model-value": r.modelValue,
|
|
845
|
+
options: r.child.options ?? [],
|
|
846
|
+
"onUpdate:modelValue": c[2] ||= (e) => d("update:modelValue", e)
|
|
847
|
+
}), null, 16, ["model-value", "options"])) : r.child.type === "checkbox" ? (m(), n(D, u({ key: 4 }, C.value, {
|
|
848
|
+
"model-value": !!r.modelValue,
|
|
849
|
+
"onUpdate:modelValue": c[3] ||= (e) => d("update:modelValue", e)
|
|
850
|
+
}), null, 16, ["model-value"])) : r.child.type === "colorPicker" ? (m(), n(O, u({ key: 5 }, C.value, {
|
|
851
|
+
"model-value": r.modelValue ?? "",
|
|
852
|
+
"onUpdate:modelValue": c[4] ||= (e) => d("update:modelValue", e)
|
|
853
|
+
}), null, 16, ["model-value"])) : r.child.type === "datePicker" ? (m(), n(k, u({ key: 6 }, C.value, {
|
|
854
|
+
type: "date",
|
|
855
|
+
"model-value": r.modelValue,
|
|
856
|
+
"onUpdate:modelValue": c[5] ||= (e) => d("update:modelValue", e)
|
|
857
|
+
}), null, 16, ["model-value"])) : r.child.type === "datetimePicker" ? (m(), n(k, u({ key: 7 }, C.value, {
|
|
858
|
+
type: "datetime",
|
|
859
|
+
"model-value": r.modelValue,
|
|
860
|
+
"onUpdate:modelValue": c[6] ||= (e) => d("update:modelValue", e)
|
|
861
|
+
}), null, 16, ["model-value"])) : r.child.type === "inputNumber" ? (m(), n(A, u({ key: 8 }, C.value, {
|
|
862
|
+
"model-value": r.modelValue,
|
|
863
|
+
min: r.child.min,
|
|
864
|
+
max: r.child.max,
|
|
865
|
+
step: r.child.step,
|
|
866
|
+
"onUpdate:modelValue": c[7] ||= (e) => d("update:modelValue", e)
|
|
867
|
+
}), null, 16, [
|
|
868
|
+
"model-value",
|
|
869
|
+
"min",
|
|
870
|
+
"max",
|
|
871
|
+
"step"
|
|
872
|
+
])) : r.child.type === "inputTag" ? (m(), n(j, u({ key: 9 }, C.value, {
|
|
873
|
+
"model-value": Array.isArray(r.modelValue) ? r.modelValue : [],
|
|
874
|
+
"onUpdate:modelValue": c[8] ||= (e) => d("update:modelValue", e)
|
|
875
|
+
}), null, 16, ["model-value"])) : r.child.type === "inputOTP" ? (m(), n(M, u({ key: 10 }, C.value, {
|
|
876
|
+
"model-value": r.modelValue ?? "",
|
|
877
|
+
"onUpdate:modelValue": c[9] ||= (e) => d("update:modelValue", e)
|
|
878
|
+
}), null, 16, ["model-value"])) : r.child.type === "mention" ? (m(), n(N, u({ key: 11 }, C.value, {
|
|
879
|
+
"model-value": r.modelValue ?? "",
|
|
880
|
+
options: r.child.options ?? [],
|
|
881
|
+
"onUpdate:modelValue": c[10] ||= (e) => d("update:modelValue", e)
|
|
882
|
+
}), null, 16, ["model-value", "options"])) : r.child.type === "radio" ? (m(), n(F, u({ key: 12 }, C.value, {
|
|
883
|
+
"model-value": r.modelValue,
|
|
884
|
+
"onUpdate:modelValue": c[11] ||= (e) => d("update:modelValue", e)
|
|
885
|
+
}), {
|
|
886
|
+
default: S(() => [(m(!0), i(e, null, _(r.child.options ?? [], (e) => (m(), n(P, {
|
|
887
|
+
key: e.value,
|
|
888
|
+
value: e.value
|
|
889
|
+
}, {
|
|
890
|
+
default: S(() => [o(b(e.label), 1)]),
|
|
891
|
+
_: 2
|
|
892
|
+
}, 1032, ["value"]))), 128))]),
|
|
893
|
+
_: 1
|
|
894
|
+
}, 16, ["model-value"])) : r.child.type === "rate" ? (m(), n(I, u({ key: 13 }, C.value, {
|
|
895
|
+
"model-value": r.modelValue,
|
|
896
|
+
"onUpdate:modelValue": c[12] ||= (e) => d("update:modelValue", e)
|
|
897
|
+
}), null, 16, ["model-value"])) : r.child.type === "virtualizedSelect" ? (m(), n(ee, u({ key: 14 }, C.value, {
|
|
898
|
+
"model-value": r.modelValue,
|
|
899
|
+
"value-key": r.child.valueKey ?? "value",
|
|
900
|
+
options: r.child.options ?? [],
|
|
901
|
+
"onUpdate:modelValue": c[13] ||= (e) => d("update:modelValue", e)
|
|
902
|
+
}), null, 16, [
|
|
903
|
+
"model-value",
|
|
904
|
+
"value-key",
|
|
905
|
+
"options"
|
|
906
|
+
])) : r.child.type === "slider" ? (m(), n(te, u({ key: 15 }, C.value, {
|
|
907
|
+
"model-value": r.modelValue,
|
|
908
|
+
min: r.child.min,
|
|
909
|
+
max: r.child.max,
|
|
910
|
+
step: r.child.step,
|
|
911
|
+
"onUpdate:modelValue": c[14] ||= (e) => d("update:modelValue", e)
|
|
912
|
+
}), null, 16, [
|
|
913
|
+
"model-value",
|
|
914
|
+
"min",
|
|
915
|
+
"max",
|
|
916
|
+
"step"
|
|
917
|
+
])) : r.child.type === "switch" ? (m(), n(ne, u({ key: 16 }, C.value, {
|
|
918
|
+
"model-value": r.modelValue,
|
|
919
|
+
"onUpdate:modelValue": c[15] ||= (e) => d("update:modelValue", e)
|
|
920
|
+
}), null, 16, ["model-value"])) : r.child.type === "timePicker" ? (m(), n(L, u({ key: 17 }, C.value, {
|
|
921
|
+
"model-value": r.modelValue,
|
|
922
|
+
"onUpdate:modelValue": c[16] ||= (e) => d("update:modelValue", e)
|
|
923
|
+
}), null, 16, ["model-value"])) : r.child.type === "timeSelect" ? (m(), n(R, u({ key: 18 }, C.value, {
|
|
924
|
+
"model-value": r.modelValue,
|
|
925
|
+
"onUpdate:modelValue": c[17] ||= (e) => d("update:modelValue", e)
|
|
926
|
+
}), null, 16, ["model-value"])) : r.child.type === "transfer" ? (m(), n(z, u({ key: 19 }, C.value, {
|
|
927
|
+
data: r.child.options ?? [],
|
|
928
|
+
"model-value": Array.isArray(r.modelValue) ? r.modelValue : [],
|
|
929
|
+
"onUpdate:modelValue": c[18] ||= (e) => d("update:modelValue", e)
|
|
930
|
+
}), null, 16, ["data", "model-value"])) : r.child.type === "treeSelect" ? (m(), n(B, u({ key: 20 }, C.value, {
|
|
931
|
+
"model-value": r.modelValue,
|
|
932
|
+
data: r.child.options ?? [],
|
|
933
|
+
"onUpdate:modelValue": c[19] ||= (e) => d("update:modelValue", e)
|
|
934
|
+
}), null, 16, ["model-value", "data"])) : r.child.type === "upload" ? (m(), n(H, u({ key: 21 }, C.value, {
|
|
935
|
+
action: C.value.action ?? "#",
|
|
936
|
+
"auto-upload": C.value.autoUpload ?? !1,
|
|
937
|
+
"file-list": Array.isArray(r.modelValue) ? r.modelValue : [],
|
|
938
|
+
"onUpdate:fileList": c[20] ||= (e) => d("update:modelValue", e)
|
|
939
|
+
}), {
|
|
940
|
+
default: S(() => [s(V, null, {
|
|
941
|
+
default: S(() => [...c[23] ||= [o("上传文件", -1)]]),
|
|
942
|
+
_: 1
|
|
943
|
+
})]),
|
|
944
|
+
_: 1
|
|
945
|
+
}, 16, [
|
|
946
|
+
"action",
|
|
947
|
+
"auto-upload",
|
|
948
|
+
"file-list"
|
|
949
|
+
])) : (m(), n(x, u({ key: 22 }, C.value, {
|
|
950
|
+
"model-value": r.modelValue ?? "",
|
|
951
|
+
"onUpdate:modelValue": c[21] ||= (e) => d("update:modelValue", e)
|
|
952
|
+
}), null, 16, ["model-value"]))]),
|
|
953
|
+
_: 3
|
|
954
|
+
}, 8, [
|
|
955
|
+
"label-width",
|
|
956
|
+
"prop",
|
|
957
|
+
"required",
|
|
958
|
+
"rules"
|
|
959
|
+
])], 8, _i)]),
|
|
960
|
+
_: 3
|
|
961
|
+
}, 8, ["span", "offset"]);
|
|
962
|
+
};
|
|
963
|
+
}
|
|
964
|
+
}), xi = (e, t) => {
|
|
965
|
+
let n = e.__vccOpts || e;
|
|
966
|
+
for (let [e, r] of t) n[e] = r;
|
|
967
|
+
return n;
|
|
968
|
+
}, Si = /*#__PURE__*/ xi(bi, [["__scopeId", "data-v-1ac2873c"]]);
|
|
969
|
+
//#endregion
|
|
970
|
+
//#region src/packages/form/linkage.ts
|
|
971
|
+
function Ci(e) {
|
|
972
|
+
return Array.isArray(e) ? e : e.split(".").filter(Boolean);
|
|
973
|
+
}
|
|
974
|
+
function wi(e, t) {
|
|
975
|
+
let n = e;
|
|
976
|
+
for (let e of Ci(t)) {
|
|
977
|
+
if (!n || typeof n != "object" || !(e in n)) return;
|
|
978
|
+
n = n[e];
|
|
979
|
+
}
|
|
980
|
+
return n;
|
|
981
|
+
}
|
|
982
|
+
function Ti(e) {
|
|
983
|
+
return e == null || e === "" || Array.isArray(e) && e.length === 0;
|
|
984
|
+
}
|
|
985
|
+
function Ei(e, t) {
|
|
986
|
+
let n = typeof e == "number" ? e : Number(e), r = typeof t == "number" ? t : Number(t);
|
|
987
|
+
return !Number.isFinite(n) || !Number.isFinite(r) ? null : n < r ? -1 : +(n > r);
|
|
988
|
+
}
|
|
989
|
+
function Di(e, t) {
|
|
990
|
+
return typeof e == "string" ? e.includes(String(t)) : Array.isArray(e) ? e.includes(t) : !1;
|
|
991
|
+
}
|
|
992
|
+
function Oi(e, t) {
|
|
993
|
+
let n = t.field ? wi(e.model, t.field) : e.value, r = t.value;
|
|
994
|
+
switch (t.operator ?? "eq") {
|
|
995
|
+
case "eq": return n === r;
|
|
996
|
+
case "neq": return n !== r;
|
|
997
|
+
case "in": return Array.isArray(r) && r.includes(n);
|
|
998
|
+
case "notIn": return !Array.isArray(r) || !r.includes(n);
|
|
999
|
+
case "contains": return Di(n, r);
|
|
1000
|
+
case "notContains": return !Di(n, r);
|
|
1001
|
+
case "gt": return Ei(n, r) === 1;
|
|
1002
|
+
case "gte": return (Ei(n, r) ?? -1) >= 0;
|
|
1003
|
+
case "lt": return Ei(n, r) === -1;
|
|
1004
|
+
case "lte": return (Ei(n, r) ?? 1) <= 0;
|
|
1005
|
+
case "empty": return Ti(n);
|
|
1006
|
+
case "notEmpty": return !Ti(n);
|
|
1007
|
+
default: return !1;
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
function ki(e, t) {
|
|
1011
|
+
return typeof e == "boolean" ? e : typeof e == "function" ? e(t) === !0 : Oi(t, e);
|
|
1012
|
+
}
|
|
1013
|
+
function Ai(e, t) {
|
|
1014
|
+
let n = { ...e };
|
|
1015
|
+
return t.visible !== void 0 && (n.visible = t.visible), t.disabled !== void 0 && (n.disabled = t.disabled), t.required !== void 0 && (n.required = t.required), t.options !== void 0 && (n.options = t.options), t.value !== void 0 && (n.value = t.value), t.clearOnHide !== void 0 && (n.clearOnHide = t.clearOnHide), n;
|
|
1016
|
+
}
|
|
1017
|
+
function ji(e, t, n, r, i) {
|
|
1018
|
+
let a = r ? [...n, e.key] : n, o = {
|
|
1019
|
+
...e,
|
|
1020
|
+
visible: e.visible ?? !0,
|
|
1021
|
+
clearOnHide: e.clearOnHide ?? !1,
|
|
1022
|
+
border: e.border ?? !0
|
|
1023
|
+
};
|
|
1024
|
+
e.dictCode && i[e.dictCode] && (o.options = i[e.dictCode]);
|
|
1025
|
+
let s = {
|
|
1026
|
+
model: t,
|
|
1027
|
+
value: wi(t, a),
|
|
1028
|
+
getValue: (e) => wi(t, e)
|
|
1029
|
+
}, c = o;
|
|
1030
|
+
for (let t of e.linkage ?? []) ki(t.when, s) && (c = Ai(c, t.effects));
|
|
1031
|
+
delete c.linkage;
|
|
1032
|
+
let l = c;
|
|
1033
|
+
if (e.type === "block") {
|
|
1034
|
+
let a = r ? [...n, e.key] : n;
|
|
1035
|
+
l.children = (e.children ?? []).map((e) => ji(e, t, a, !0, i));
|
|
1036
|
+
}
|
|
1037
|
+
return l;
|
|
1038
|
+
}
|
|
1039
|
+
function Mi(e, t, n = {}) {
|
|
1040
|
+
return e.map((e) => ji(e, t, [], e.type !== "block", n));
|
|
1041
|
+
}
|
|
1042
|
+
function Ni(e, t, n, r) {
|
|
1043
|
+
for (let i of e) {
|
|
1044
|
+
let e = n || !i.visible;
|
|
1045
|
+
if (i.type === "block") {
|
|
1046
|
+
Ni(i.children ?? [], [...t, i.key], e, r);
|
|
1047
|
+
continue;
|
|
1048
|
+
}
|
|
1049
|
+
i.type !== "slot" && e && i.clearOnHide && r.push([...t, i.key]);
|
|
1050
|
+
}
|
|
1051
|
+
}
|
|
1052
|
+
function Pi(e, t) {
|
|
1053
|
+
let n = Mi(e, t), r = [];
|
|
1054
|
+
for (let e of n) {
|
|
1055
|
+
if (e.type === "block") {
|
|
1056
|
+
Ni(e.children ?? [], [], !e.visible, r);
|
|
1057
|
+
continue;
|
|
1058
|
+
}
|
|
1059
|
+
e.type !== "slot" && !e.visible && e.clearOnHide && r.push([e.key]);
|
|
1060
|
+
}
|
|
1061
|
+
return r;
|
|
1062
|
+
}
|
|
1063
|
+
function Fi(e, t, n) {
|
|
1064
|
+
let r = {
|
|
1065
|
+
model: t,
|
|
1066
|
+
value: wi(t, n),
|
|
1067
|
+
getValue: (e) => wi(t, e)
|
|
1068
|
+
}, i, a = e.linkage ?? [];
|
|
1069
|
+
for (let e = 0; e < a.length; e++) {
|
|
1070
|
+
let t = a[e];
|
|
1071
|
+
ki(t.when, r) && t.effects.value !== void 0 && (i = {
|
|
1072
|
+
value: t.effects.value,
|
|
1073
|
+
ruleIndex: e
|
|
1074
|
+
});
|
|
1075
|
+
}
|
|
1076
|
+
return i;
|
|
1077
|
+
}
|
|
1078
|
+
function Ii(e, t, n, r) {
|
|
1079
|
+
for (let i of e) {
|
|
1080
|
+
if (i.type === "block") {
|
|
1081
|
+
Ii(i.children ?? [], t, [...n, i.key], r);
|
|
1082
|
+
continue;
|
|
1083
|
+
}
|
|
1084
|
+
if (i.type === "slot") continue;
|
|
1085
|
+
let e = [...n, i.key], a = Fi(i, t, e);
|
|
1086
|
+
a && r.push({
|
|
1087
|
+
path: e,
|
|
1088
|
+
...a
|
|
1089
|
+
});
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
function Li(e, t) {
|
|
1093
|
+
let n = [];
|
|
1094
|
+
for (let r of e) {
|
|
1095
|
+
if (r.type === "block") {
|
|
1096
|
+
Ii(r.children ?? [], t, [], n);
|
|
1097
|
+
continue;
|
|
1098
|
+
}
|
|
1099
|
+
if (r.type === "slot") continue;
|
|
1100
|
+
let e = Fi(r, t, [r.key]);
|
|
1101
|
+
e && n.push({
|
|
1102
|
+
path: [r.key],
|
|
1103
|
+
...e
|
|
1104
|
+
});
|
|
1105
|
+
}
|
|
1106
|
+
return n;
|
|
1107
|
+
}
|
|
1108
|
+
function Ri(e) {
|
|
1109
|
+
let t = /* @__PURE__ */ new Set(), n = (e) => {
|
|
1110
|
+
for (let r of e) r.dictCode && t.add(r.dictCode), r.children && n(r.children);
|
|
1111
|
+
};
|
|
1112
|
+
return n(e), [...t];
|
|
1113
|
+
}
|
|
1114
|
+
//#endregion
|
|
1115
|
+
//#region src/packages/form/Form.vue
|
|
1116
|
+
var zi = /*#__PURE__*/ xi(c({
|
|
1117
|
+
name: "Form",
|
|
1118
|
+
props: {
|
|
1119
|
+
config: {
|
|
1120
|
+
type: Array,
|
|
1121
|
+
required: !0
|
|
1122
|
+
},
|
|
1123
|
+
modelValue: {
|
|
1124
|
+
type: Object,
|
|
1125
|
+
default: () => ({})
|
|
1126
|
+
},
|
|
1127
|
+
dicts: {
|
|
1128
|
+
type: Object,
|
|
1129
|
+
default: () => ({})
|
|
1130
|
+
},
|
|
1131
|
+
dictLoader: { type: Function },
|
|
1132
|
+
fieldAction: {
|
|
1133
|
+
type: Function,
|
|
1134
|
+
default: null
|
|
1135
|
+
},
|
|
1136
|
+
blockAction: {
|
|
1137
|
+
type: Function,
|
|
1138
|
+
default: null
|
|
1139
|
+
}
|
|
1140
|
+
},
|
|
1141
|
+
emits: [
|
|
1142
|
+
"update:modelValue",
|
|
1143
|
+
"submit",
|
|
1144
|
+
"reset"
|
|
1145
|
+
],
|
|
1146
|
+
setup(e, { emit: n, slots: r, expose: i }) {
|
|
1147
|
+
let a = g(), o = h({}), s = h(/* @__PURE__ */ new Set()), c = t(() => ({
|
|
1148
|
+
...o,
|
|
1149
|
+
...e.dicts
|
|
1150
|
+
})), u = t(() => Ri(e.config)), d = t(() => Mi(e.config, e.modelValue, c.value)), f = gi(e.modelValue), m = h(/* @__PURE__ */ new Set()), _ = /* @__PURE__ */ new Map();
|
|
1151
|
+
function v(e) {
|
|
1152
|
+
m.has(e) ? m.delete(e) : m.add(e);
|
|
1153
|
+
}
|
|
1154
|
+
function y() {
|
|
1155
|
+
if (e.dictLoader) for (let t of u.value) e.dicts[t] || o[t] || s.has(t) || b(t);
|
|
1156
|
+
}
|
|
1157
|
+
async function b(t) {
|
|
1158
|
+
if (e.dictLoader) {
|
|
1159
|
+
s.add(t);
|
|
1160
|
+
try {
|
|
1161
|
+
let n = await e.dictLoader(t);
|
|
1162
|
+
o[t] = n;
|
|
1163
|
+
} finally {
|
|
1164
|
+
s.delete(t);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
x(u, () => y(), { immediate: !0 }), x(() => e.dictLoader, () => y(), { immediate: !0 });
|
|
1169
|
+
function S(e, t) {
|
|
1170
|
+
let n = e;
|
|
1171
|
+
for (let e of t) {
|
|
1172
|
+
if (!n || typeof n != "object" || !(e in n)) return;
|
|
1173
|
+
n = n[e];
|
|
1174
|
+
}
|
|
1175
|
+
return n;
|
|
1176
|
+
}
|
|
1177
|
+
function C(t) {
|
|
1178
|
+
return S(e.modelValue, t);
|
|
1179
|
+
}
|
|
1180
|
+
function O(e, t, n) {
|
|
1181
|
+
let r = { ...e }, i = r;
|
|
1182
|
+
for (let e = 0; e < t.length - 1; e++) {
|
|
1183
|
+
let n = t[e], r = i[n];
|
|
1184
|
+
i[n] = { ...r && typeof r == "object" ? r : {} }, i = i[n];
|
|
1185
|
+
}
|
|
1186
|
+
return i[t[t.length - 1]] = n, r;
|
|
1187
|
+
}
|
|
1188
|
+
function k(e, t) {
|
|
1189
|
+
let n = gi(e), r = (e, t, i) => {
|
|
1190
|
+
for (let a of e) {
|
|
1191
|
+
if (a.type === "block") {
|
|
1192
|
+
let e = i ? [...t, a.key] : t;
|
|
1193
|
+
r(a.children ?? [], e, !0);
|
|
1194
|
+
continue;
|
|
1195
|
+
}
|
|
1196
|
+
if (a.utc) {
|
|
1197
|
+
let e = [...t, a.key], r = S(n, e);
|
|
1198
|
+
r instanceof Date && (n = O(n, e, r.toISOString()));
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
};
|
|
1202
|
+
return r(t, [], !1), n;
|
|
1203
|
+
}
|
|
1204
|
+
function A(t, r) {
|
|
1205
|
+
n("update:modelValue", O(e.modelValue, t, r));
|
|
1206
|
+
}
|
|
1207
|
+
function j(e, t) {
|
|
1208
|
+
let n = { ...e }, r = n;
|
|
1209
|
+
for (let e = 0; e < t.length - 1; e++) {
|
|
1210
|
+
let i = t[e], a = r[i];
|
|
1211
|
+
if (!a || typeof a != "object" || Array.isArray(a)) return n;
|
|
1212
|
+
r[i] = { ...a }, r = r[i];
|
|
1213
|
+
}
|
|
1214
|
+
return delete r[t[t.length - 1]], n;
|
|
1215
|
+
}
|
|
1216
|
+
function M(e) {
|
|
1217
|
+
try {
|
|
1218
|
+
return JSON.stringify(e);
|
|
1219
|
+
} catch {
|
|
1220
|
+
return String(e);
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
function N() {
|
|
1224
|
+
let t = gi(e.modelValue), r = !1, i = /* @__PURE__ */ new Map();
|
|
1225
|
+
for (let n of Li(e.config, e.modelValue)) {
|
|
1226
|
+
let e = M(n.value), a = `${n.path.join("/")}:${n.ruleIndex}:${e}`;
|
|
1227
|
+
i.set(a, e), _.get(a) !== e && S(t, n.path) !== n.value && (t = O(t, n.path, n.value), r = !0);
|
|
1228
|
+
}
|
|
1229
|
+
_ = i;
|
|
1230
|
+
let a = Pi(e.config, t);
|
|
1231
|
+
for (let e of a) S(t, e) !== void 0 && (t = j(t, e), r = !0);
|
|
1232
|
+
r && (f = gi(t), n("update:modelValue", t));
|
|
1233
|
+
}
|
|
1234
|
+
p(N), x(() => e.modelValue, () => N(), { deep: !0 });
|
|
1235
|
+
async function P() {
|
|
1236
|
+
if (a.value) try {
|
|
1237
|
+
await a.value.validate();
|
|
1238
|
+
} catch (e) {
|
|
1239
|
+
console.log(e);
|
|
1240
|
+
return;
|
|
1241
|
+
}
|
|
1242
|
+
let t = k(e.modelValue, e.config);
|
|
1243
|
+
console.log(t), n("submit", t);
|
|
1244
|
+
}
|
|
1245
|
+
function F() {
|
|
1246
|
+
return a.value ? a.value.validate().then(() => !0).catch(() => !1) : Promise.resolve(!0);
|
|
1247
|
+
}
|
|
1248
|
+
function I(e) {
|
|
1249
|
+
return !e || !a.value ? Promise.resolve(!0) : a.value.validateField(e).then(() => !0).catch(() => !1);
|
|
1250
|
+
}
|
|
1251
|
+
function ee() {
|
|
1252
|
+
a.value?.clearValidate();
|
|
1253
|
+
}
|
|
1254
|
+
function te() {
|
|
1255
|
+
ne(), a.value?.clearValidate();
|
|
1256
|
+
}
|
|
1257
|
+
i({
|
|
1258
|
+
validate: F,
|
|
1259
|
+
validateField: I,
|
|
1260
|
+
resetFields: te,
|
|
1261
|
+
clearValidate: ee
|
|
1262
|
+
});
|
|
1263
|
+
function ne() {
|
|
1264
|
+
let e = gi(f);
|
|
1265
|
+
n("update:modelValue", e), n("reset", e);
|
|
1266
|
+
}
|
|
1267
|
+
function L(e) {
|
|
1268
|
+
let t = r[e.key], n = t ? t({ node: e }) : [l("span", null, e.label || e.key)];
|
|
1269
|
+
return l(T, {
|
|
1270
|
+
key: e.key,
|
|
1271
|
+
span: e.span ?? 6,
|
|
1272
|
+
offset: e.offset
|
|
1273
|
+
}, () => [l("div", { class: "form-slot" }, n)]);
|
|
1274
|
+
}
|
|
1275
|
+
function R(t, n) {
|
|
1276
|
+
let r = C(n) ?? t.default ?? "", i = {
|
|
1277
|
+
child: t,
|
|
1278
|
+
prop: n.join("."),
|
|
1279
|
+
modelValue: r,
|
|
1280
|
+
"onUpdate:modelValue": (e) => A(n, e)
|
|
1281
|
+
}, a = e.fieldAction?.(t) ?? null;
|
|
1282
|
+
return l(Si, i, a ? { action: () => [a] } : void 0);
|
|
1283
|
+
}
|
|
1284
|
+
function z(t, n, r) {
|
|
1285
|
+
let i = [...n, t.key].join("/"), a = m.has(i), o = r ? [...n, t.key] : n, s = (t.children ?? []).map((e) => B(e, o)).filter((e) => e !== null), c = e.blockAction?.(t) ?? null, u = l(T, {
|
|
1286
|
+
key: `${t.key}-header`,
|
|
1287
|
+
span: 24
|
|
1288
|
+
}, () => [l("div", { class: "form-block-header" }, [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" }, [l("button", {
|
|
1289
|
+
class: "form-block-collapse",
|
|
1290
|
+
type: "button",
|
|
1291
|
+
"aria-expanded": !a,
|
|
1292
|
+
onClick: () => v(i)
|
|
1293
|
+
}, a ? "▸" : "▾")].filter(Boolean))])]), d = l("div", { class: ["form-block-body", { "is-collapsed": a }] }, () => [l("div", { class: "form-block-body-inner" }, () => [l(D, { gutter: 20 }, () => s.filter(Boolean))])]), f = [...n, t.key].join("/");
|
|
1294
|
+
return l("div", {
|
|
1295
|
+
class: "form-node",
|
|
1296
|
+
key: t.key,
|
|
1297
|
+
"data-block-path": f
|
|
1298
|
+
}, [l("div", { class: ["form-block", { "form-block--borderless": t.border === !1 }] }, [l(D, { gutter: 20 }, () => [u].filter(Boolean)), d])]);
|
|
1299
|
+
}
|
|
1300
|
+
function B(e, t) {
|
|
1301
|
+
return e.visible ? e.type === "block" ? l(T, {
|
|
1302
|
+
key: e.key,
|
|
1303
|
+
span: e.span ?? 24,
|
|
1304
|
+
offset: e.offset
|
|
1305
|
+
}, () => [z(e, t, !0)]) : e.type === "slot" ? L(e) : R(e, [...t, e.key]) : null;
|
|
1306
|
+
}
|
|
1307
|
+
function V(e) {
|
|
1308
|
+
return e.visible ? e.type === "block" ? z(e, [], !1) : l(D, {
|
|
1309
|
+
key: e.key,
|
|
1310
|
+
gutter: 20
|
|
1311
|
+
}, () => [B(e, [])]) : null;
|
|
1312
|
+
}
|
|
1313
|
+
return () => {
|
|
1314
|
+
let t = d.value.map(V).filter((e) => e !== null);
|
|
1315
|
+
return l(E, {
|
|
1316
|
+
ref: a,
|
|
1317
|
+
model: e.modelValue,
|
|
1318
|
+
labelWidth: "auto"
|
|
1319
|
+
}, () => [...t, l("div", { class: "form-actions" }, [l(w, {
|
|
1320
|
+
type: "primary",
|
|
1321
|
+
nativeType: "button",
|
|
1322
|
+
onClick: P
|
|
1323
|
+
}, () => "提交"), l(w, {
|
|
1324
|
+
nativeType: "button",
|
|
1325
|
+
onClick: ne
|
|
1326
|
+
}, () => "重置")])]);
|
|
1327
|
+
};
|
|
1328
|
+
}
|
|
1329
|
+
}), [["__scopeId", "data-v-acc83ef3"]]), Bi = { class: "create-form" }, Vi = { class: "builder-header" }, Hi = { class: "header-actions" }, Ui = { class: "global-config" }, Wi = { class: "builder-grid" }, Gi = { class: "palette" }, Ki = ["onDragstart"], qi = {
|
|
1330
|
+
key: 0,
|
|
1331
|
+
class: "palette-compact"
|
|
1332
|
+
}, Ji = {
|
|
1333
|
+
key: 12,
|
|
1334
|
+
class: "palette-compact"
|
|
1335
|
+
}, Yi = { class: "preview-header" }, Xi = { class: "preview-header-actions" }, Zi = { class: "breadcrumb" }, Qi = { key: 0 }, $i = { class: "linkage-editor" }, ea = { class: "linkage-rule-title" }, ta = { class: "linkage-when" }, na = { class: "linkage-effects" }, ra = { class: "option-editor" }, ia = {
|
|
1336
|
+
key: 1,
|
|
1337
|
+
class: "editor-empty"
|
|
1338
|
+
}, aa = { class: "code-panels" }, oa = { class: "code-panel" }, sa = { class: "code-panel" }, ca = /*#__PURE__*/ xi(/* @__PURE__ */ c({
|
|
1339
|
+
name: "CreateForm",
|
|
1340
|
+
__name: "CreateForm",
|
|
1341
|
+
setup(c) {
|
|
1342
|
+
let u = [
|
|
1343
|
+
{
|
|
1344
|
+
type: "block",
|
|
1345
|
+
label: "block 块"
|
|
1346
|
+
},
|
|
1347
|
+
{
|
|
1348
|
+
type: "input",
|
|
1349
|
+
label: "输入框"
|
|
1350
|
+
},
|
|
1351
|
+
{
|
|
1352
|
+
type: "textarea",
|
|
1353
|
+
label: "多行文本"
|
|
1354
|
+
},
|
|
1355
|
+
{
|
|
1356
|
+
type: "select",
|
|
1357
|
+
label: "下拉选择",
|
|
1358
|
+
options: [{
|
|
1359
|
+
label: "选项一",
|
|
1360
|
+
value: "1"
|
|
1361
|
+
}, {
|
|
1362
|
+
label: "选项二",
|
|
1363
|
+
value: "2"
|
|
1364
|
+
}]
|
|
1365
|
+
},
|
|
1366
|
+
{
|
|
1367
|
+
type: "radio",
|
|
1368
|
+
label: "单选",
|
|
1369
|
+
options: [{
|
|
1370
|
+
label: "选项一",
|
|
1371
|
+
value: "1"
|
|
1372
|
+
}, {
|
|
1373
|
+
label: "选项二",
|
|
1374
|
+
value: "2"
|
|
1375
|
+
}]
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
type: "checkbox",
|
|
1379
|
+
label: "复选框"
|
|
1380
|
+
},
|
|
1381
|
+
{
|
|
1382
|
+
type: "switch",
|
|
1383
|
+
label: "开关"
|
|
1384
|
+
},
|
|
1385
|
+
{
|
|
1386
|
+
type: "inputNumber",
|
|
1387
|
+
label: "数字输入"
|
|
1388
|
+
},
|
|
1389
|
+
{
|
|
1390
|
+
type: "datePicker",
|
|
1391
|
+
label: "日期"
|
|
1392
|
+
},
|
|
1393
|
+
{
|
|
1394
|
+
type: "datetimePicker",
|
|
1395
|
+
label: "日期时间"
|
|
1396
|
+
},
|
|
1397
|
+
{
|
|
1398
|
+
type: "timePicker",
|
|
1399
|
+
label: "时间"
|
|
1400
|
+
},
|
|
1401
|
+
{
|
|
1402
|
+
type: "inputTag",
|
|
1403
|
+
label: "标签"
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
type: "transfer",
|
|
1407
|
+
label: "穿梭框"
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
type: "rate",
|
|
1411
|
+
label: "评分"
|
|
1412
|
+
},
|
|
1413
|
+
{
|
|
1414
|
+
type: "slider",
|
|
1415
|
+
label: "滑块"
|
|
1416
|
+
},
|
|
1417
|
+
{
|
|
1418
|
+
type: "cascader",
|
|
1419
|
+
label: "级联选择"
|
|
1420
|
+
},
|
|
1421
|
+
{
|
|
1422
|
+
type: "treeSelect",
|
|
1423
|
+
label: "树选择"
|
|
1424
|
+
}
|
|
1425
|
+
], p = [
|
|
1426
|
+
"select",
|
|
1427
|
+
"radio",
|
|
1428
|
+
"cascader",
|
|
1429
|
+
"transfer",
|
|
1430
|
+
"treeSelect",
|
|
1431
|
+
"mention",
|
|
1432
|
+
"virtualizedSelect"
|
|
1433
|
+
], h = 0;
|
|
1434
|
+
function v(e, t, n) {
|
|
1435
|
+
let r = {
|
|
1436
|
+
key: t,
|
|
1437
|
+
label: n,
|
|
1438
|
+
type: e === "textarea" ? "input" : e,
|
|
1439
|
+
span: 6,
|
|
1440
|
+
visible: !0,
|
|
1441
|
+
default: ""
|
|
1442
|
+
};
|
|
1443
|
+
return e === "textarea" && (r.props = {
|
|
1444
|
+
type: "textarea",
|
|
1445
|
+
rows: 3
|
|
1446
|
+
}), e === "block" && (r.children = [], r.border = !0, r.span = 24, delete r.default), (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" ? [{
|
|
1447
|
+
label: "选项一",
|
|
1448
|
+
value: "1"
|
|
1449
|
+
}, {
|
|
1450
|
+
label: "选项二",
|
|
1451
|
+
value: "2"
|
|
1452
|
+
}] : []), r;
|
|
1453
|
+
}
|
|
1454
|
+
let w = g([]), T = g(null), E = g(null), D = g(null), O = g(null), k = g(null), A = g(null), j = g(null), M = g(!1), N = g(!1), P = g({
|
|
1455
|
+
required: !1,
|
|
1456
|
+
labelPosition: "left",
|
|
1457
|
+
span: 6,
|
|
1458
|
+
clearable: !1,
|
|
1459
|
+
filterable: !1,
|
|
1460
|
+
labelWidth: "",
|
|
1461
|
+
border: !0,
|
|
1462
|
+
isText: !1
|
|
1463
|
+
}), F = g(""), I = g(""), ee = t(() => T.value?.linkage ?? []), te = t(() => Ee(L.value[0]?.children ?? [])), ne = [
|
|
1464
|
+
"eq",
|
|
1465
|
+
"neq",
|
|
1466
|
+
"in",
|
|
1467
|
+
"notIn",
|
|
1468
|
+
"contains",
|
|
1469
|
+
"notContains",
|
|
1470
|
+
"gt",
|
|
1471
|
+
"gte",
|
|
1472
|
+
"lt",
|
|
1473
|
+
"lte",
|
|
1474
|
+
"empty",
|
|
1475
|
+
"notEmpty"
|
|
1476
|
+
], L = t(() => [{
|
|
1477
|
+
key: "root",
|
|
1478
|
+
label: "根表单",
|
|
1479
|
+
type: "block",
|
|
1480
|
+
border: !1,
|
|
1481
|
+
children: w.value
|
|
1482
|
+
}]), R = t(() => JSON.stringify(L.value, null, 2));
|
|
1483
|
+
function z(e) {
|
|
1484
|
+
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;
|
|
1485
|
+
}
|
|
1486
|
+
function B(e, t, n) {
|
|
1487
|
+
let r = e;
|
|
1488
|
+
for (let e = 0; e < t.length - 1; e++) {
|
|
1489
|
+
let n = t[e];
|
|
1490
|
+
(!r[n] || typeof r[n] != "object" || Array.isArray(r[n])) && (r[n] = {}), r = r[n];
|
|
1491
|
+
}
|
|
1492
|
+
r[t[t.length - 1]] = n;
|
|
1493
|
+
}
|
|
1494
|
+
function V(e, t = [], n = !1) {
|
|
1495
|
+
let r = {};
|
|
1496
|
+
for (let i of e) {
|
|
1497
|
+
if (i.type === "block") {
|
|
1498
|
+
let e = n ? [...t, i.key] : t;
|
|
1499
|
+
Object.assign(r, V(i.children ?? [], e, !0));
|
|
1500
|
+
continue;
|
|
1501
|
+
}
|
|
1502
|
+
B(r, [...t, i.key], z(i));
|
|
1503
|
+
}
|
|
1504
|
+
return r;
|
|
1505
|
+
}
|
|
1506
|
+
let H = t(() => E.value?.children ?? w.value), U = g({}), re = t(() => JSON.stringify(U.value, null, 2));
|
|
1507
|
+
x(w, () => {
|
|
1508
|
+
U.value = V(L.value), d(q);
|
|
1509
|
+
}, {
|
|
1510
|
+
deep: !0,
|
|
1511
|
+
immediate: !0
|
|
1512
|
+
}), x(T, () => d(q), { deep: !0 });
|
|
1513
|
+
let ie = t(() => p.includes(T.value?.type ?? ""));
|
|
1514
|
+
function ae(e) {
|
|
1515
|
+
T.value = e, ie.value && !Array.isArray(e.options) && (e.options = []), d(q);
|
|
1516
|
+
}
|
|
1517
|
+
function oe(e) {
|
|
1518
|
+
Array.isArray(e.children) || (e.children = []), E.value = e, T.value = e, d(q);
|
|
1519
|
+
}
|
|
1520
|
+
function se() {
|
|
1521
|
+
E.value = null;
|
|
1522
|
+
}
|
|
1523
|
+
function ce(e) {
|
|
1524
|
+
let t = e.target;
|
|
1525
|
+
if (!t?.closest(".field-drag-handle, .block-drag-handle, .form-item-label, .form-block-header-title")) return;
|
|
1526
|
+
let n = t?.closest("[data-field-key]");
|
|
1527
|
+
if (n?.dataset.fieldKey) {
|
|
1528
|
+
let e = De(n.dataset.fieldKey);
|
|
1529
|
+
if (e) {
|
|
1530
|
+
let t = Oe(e.key);
|
|
1531
|
+
t && t.key !== "root" && (E.value = t), ae(e), N.value = !0;
|
|
1532
|
+
return;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
let r = t?.closest("[data-block-path]");
|
|
1536
|
+
if (r?.dataset.blockPath) {
|
|
1537
|
+
let e = Te(r.dataset.blockPath.split("/"));
|
|
1538
|
+
e && (ae(e), N.value = !0);
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
function le() {
|
|
1542
|
+
let e = T.value;
|
|
1543
|
+
if (!e) return;
|
|
1544
|
+
let t = H.value.indexOf(e);
|
|
1545
|
+
t >= 0 && Pe(t), T.value || (N.value = !1);
|
|
1546
|
+
}
|
|
1547
|
+
function ue() {
|
|
1548
|
+
T.value && (N.value = !0);
|
|
1549
|
+
}
|
|
1550
|
+
function W() {
|
|
1551
|
+
let e = (t) => {
|
|
1552
|
+
for (let n of t) {
|
|
1553
|
+
if (n.type === "block") {
|
|
1554
|
+
n.border = P.value.border, e(n.children ?? []);
|
|
1555
|
+
continue;
|
|
1556
|
+
}
|
|
1557
|
+
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;
|
|
1558
|
+
}
|
|
1559
|
+
};
|
|
1560
|
+
e(w.value), d(q);
|
|
1561
|
+
}
|
|
1562
|
+
function de() {
|
|
1563
|
+
T.value && (Array.isArray(T.value.linkage) || (T.value.linkage = []), T.value.linkage.push({
|
|
1564
|
+
when: {
|
|
1565
|
+
field: "",
|
|
1566
|
+
operator: "eq",
|
|
1567
|
+
value: ""
|
|
1568
|
+
},
|
|
1569
|
+
effects: {}
|
|
1570
|
+
}));
|
|
1571
|
+
}
|
|
1572
|
+
function fe(e) {
|
|
1573
|
+
Array.isArray(T.value?.linkage) && T.value.linkage.splice(e, 1);
|
|
1574
|
+
}
|
|
1575
|
+
function pe(e) {
|
|
1576
|
+
return e ? JSON.stringify(e, null, 2) : "";
|
|
1577
|
+
}
|
|
1578
|
+
function me(e, t) {
|
|
1579
|
+
try {
|
|
1580
|
+
e.effects.options = t.trim() ? JSON.parse(t) : [];
|
|
1581
|
+
} catch {
|
|
1582
|
+
e.effects.options = [];
|
|
1583
|
+
}
|
|
1584
|
+
}
|
|
1585
|
+
function he(e) {
|
|
1586
|
+
D.value = e;
|
|
1587
|
+
}
|
|
1588
|
+
function ge() {
|
|
1589
|
+
D.value = null, Ae();
|
|
1590
|
+
}
|
|
1591
|
+
function _e(e, t) {
|
|
1592
|
+
h += 1, F.value = `${e}_${h}`, I.value = u.find((t) => t.type === e)?.label ?? e, j.value = {
|
|
1593
|
+
type: e,
|
|
1594
|
+
target: t
|
|
1595
|
+
}, M.value = !0;
|
|
1596
|
+
}
|
|
1597
|
+
function ve() {
|
|
1598
|
+
if (!j.value) return;
|
|
1599
|
+
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 = v(j.value.type, e, t), r = j.value.target;
|
|
1600
|
+
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(q);
|
|
1601
|
+
}
|
|
1602
|
+
function ye() {
|
|
1603
|
+
M.value = !1, j.value = null;
|
|
1604
|
+
}
|
|
1605
|
+
function G() {
|
|
1606
|
+
if (!D.value) return;
|
|
1607
|
+
let e = D.value, t = E.value;
|
|
1608
|
+
D.value = null, _e(e, t);
|
|
1609
|
+
}
|
|
1610
|
+
function K(e, t) {
|
|
1611
|
+
if (D.value) return;
|
|
1612
|
+
let n = De(e.key);
|
|
1613
|
+
if (!n) return;
|
|
1614
|
+
let r = Oe(n.key);
|
|
1615
|
+
r && r.key !== "root" && (E.value = r), O.value = n, t.dataTransfer?.setData("text/plain", n.key);
|
|
1616
|
+
}
|
|
1617
|
+
function be(e, t) {
|
|
1618
|
+
let n = t.getBoundingClientRect();
|
|
1619
|
+
return e.clientX < n.left + n.width / 2 ? "before" : "after";
|
|
1620
|
+
}
|
|
1621
|
+
function xe(e) {
|
|
1622
|
+
let t = O.value;
|
|
1623
|
+
if (!t || t === e) return;
|
|
1624
|
+
let n = H.value, r = n.indexOf(t), i = n.indexOf(e);
|
|
1625
|
+
if (r < 0 || i < 0) return;
|
|
1626
|
+
let [a] = n.splice(r, 1), o = k.value === "after" ? r < i ? i : i + 1 : r < i ? i - 1 : i;
|
|
1627
|
+
n.splice(o, 0, a), Se();
|
|
1628
|
+
}
|
|
1629
|
+
function Se() {
|
|
1630
|
+
O.value = null, k.value = null;
|
|
1631
|
+
}
|
|
1632
|
+
function Ce(e) {
|
|
1633
|
+
return l("span", {
|
|
1634
|
+
class: "field-drag-handle",
|
|
1635
|
+
draggable: !0,
|
|
1636
|
+
title: "拖拽调整顺序",
|
|
1637
|
+
onDragstart: (t) => K(e, t),
|
|
1638
|
+
onDragend: () => Se()
|
|
1639
|
+
}, "⠿");
|
|
1640
|
+
}
|
|
1641
|
+
function we(e) {
|
|
1642
|
+
return e.key === "root" ? null : l("span", {
|
|
1643
|
+
class: "block-drag-handle",
|
|
1644
|
+
draggable: !0,
|
|
1645
|
+
title: "拖拽调整顺序",
|
|
1646
|
+
onDragstart: (t) => K(e, t),
|
|
1647
|
+
onDragend: () => Se()
|
|
1648
|
+
}, "⠿");
|
|
1649
|
+
}
|
|
1650
|
+
function Te(e) {
|
|
1651
|
+
let t = L.value[0];
|
|
1652
|
+
if (!t) return null;
|
|
1653
|
+
let n = null, r = 0;
|
|
1654
|
+
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;
|
|
1655
|
+
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;
|
|
1656
|
+
return n;
|
|
1657
|
+
}
|
|
1658
|
+
function Ee(e, t = [], n = !1) {
|
|
1659
|
+
let r = [];
|
|
1660
|
+
for (let i of e) if (i.type === "block") {
|
|
1661
|
+
let e = n ? [...t, i.key] : t;
|
|
1662
|
+
r.push(...Ee(i.children ?? [], e, !0));
|
|
1663
|
+
} else if (i.type !== "slot") {
|
|
1664
|
+
let e = [...t, i.key].join(".");
|
|
1665
|
+
r.push({
|
|
1666
|
+
label: `${i.label || i.key} (${e})`,
|
|
1667
|
+
value: e
|
|
1668
|
+
});
|
|
1669
|
+
}
|
|
1670
|
+
return r;
|
|
1671
|
+
}
|
|
1672
|
+
function De(e, t = L.value[0]?.children ?? []) {
|
|
1673
|
+
for (let n of t) {
|
|
1674
|
+
if (n.key === e) return n;
|
|
1675
|
+
let t = De(e, n.children ?? []);
|
|
1676
|
+
if (t) return t;
|
|
1677
|
+
}
|
|
1678
|
+
return null;
|
|
1679
|
+
}
|
|
1680
|
+
function Oe(e, t = L.value[0]?.children ?? [], n = null) {
|
|
1681
|
+
for (let r of t) {
|
|
1682
|
+
if (r.key === e) return n;
|
|
1683
|
+
if (r.type === "block") {
|
|
1684
|
+
let t = Oe(e, r.children ?? [], r);
|
|
1685
|
+
if (t) return t;
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
return null;
|
|
1689
|
+
}
|
|
1690
|
+
function ke(e) {
|
|
1691
|
+
Ae();
|
|
1692
|
+
let t = e.target;
|
|
1693
|
+
if (O.value) {
|
|
1694
|
+
let e = t?.closest("[data-block-path]");
|
|
1695
|
+
if (e?.dataset.blockPath) {
|
|
1696
|
+
let t = Te(e.dataset.blockPath.split("/"));
|
|
1697
|
+
if (t && H.value.includes(t)) {
|
|
1698
|
+
xe(t);
|
|
1699
|
+
return;
|
|
1700
|
+
}
|
|
1701
|
+
}
|
|
1702
|
+
let n = t?.closest("[data-field-key]");
|
|
1703
|
+
if (n?.dataset.fieldKey) {
|
|
1704
|
+
let e = H.value.find((e) => e.key === n.dataset.fieldKey);
|
|
1705
|
+
if (e) {
|
|
1706
|
+
xe(e);
|
|
1707
|
+
return;
|
|
1708
|
+
}
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1711
|
+
let n = (t?.closest("[data-block-path]"))?.dataset.blockPath;
|
|
1712
|
+
if (n === "root") {
|
|
1713
|
+
if (D.value) {
|
|
1714
|
+
let e = D.value;
|
|
1715
|
+
D.value = null, _e(e, null);
|
|
1716
|
+
}
|
|
1717
|
+
return;
|
|
1718
|
+
}
|
|
1719
|
+
if (n) {
|
|
1720
|
+
let e = Te(n.split("/"));
|
|
1721
|
+
if (e) {
|
|
1722
|
+
Ne(e);
|
|
1723
|
+
return;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
G();
|
|
1727
|
+
}
|
|
1728
|
+
function Ae() {
|
|
1729
|
+
document.querySelectorAll("[data-block-path], [data-field-key]").forEach((e) => {
|
|
1730
|
+
e.classList.remove("drop-active", "drop-before", "drop-after");
|
|
1731
|
+
});
|
|
1732
|
+
}
|
|
1733
|
+
function je() {
|
|
1734
|
+
document.querySelectorAll(".node-selected").forEach((e) => {
|
|
1735
|
+
e.classList.remove("node-selected");
|
|
1736
|
+
});
|
|
1737
|
+
}
|
|
1738
|
+
function q() {
|
|
1739
|
+
if (je(), !T.value) return;
|
|
1740
|
+
let e = T.value.key;
|
|
1741
|
+
document.querySelectorAll("[data-field-key]").forEach((t) => {
|
|
1742
|
+
t.getAttribute("data-field-key") === e && t.classList.add("node-selected");
|
|
1743
|
+
}), document.querySelectorAll("[data-block-path]").forEach((t) => {
|
|
1744
|
+
t.getAttribute("data-block-path")?.split("/").pop() === e && t.classList.add("node-selected");
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
function Me(e) {
|
|
1748
|
+
Ae();
|
|
1749
|
+
let t = e.target;
|
|
1750
|
+
if (O.value) {
|
|
1751
|
+
let n = t?.closest("[data-field-key]");
|
|
1752
|
+
n?.dataset.fieldKey && H.value.find((e) => e.key === n.dataset.fieldKey) && (k.value = be(e, n), n.classList.add("drop-active"), n.classList.add(k.value === "before" ? "drop-before" : "drop-after"));
|
|
1753
|
+
let r = t?.closest("[data-block-path]");
|
|
1754
|
+
if (r?.dataset.blockPath) {
|
|
1755
|
+
let t = Te(r.dataset.blockPath.split("/"));
|
|
1756
|
+
t && H.value.includes(t) && (k.value = be(e, r), r.classList.add("drop-active"), r.classList.add(k.value === "before" ? "drop-before" : "drop-after"));
|
|
1757
|
+
}
|
|
1758
|
+
return;
|
|
1759
|
+
}
|
|
1760
|
+
(t?.closest("[data-block-path]"))?.classList.add("drop-active");
|
|
1761
|
+
}
|
|
1762
|
+
function Ne(e) {
|
|
1763
|
+
if (!D.value) return;
|
|
1764
|
+
let t = D.value;
|
|
1765
|
+
D.value = null, _e(t, e);
|
|
1766
|
+
}
|
|
1767
|
+
function Pe(e) {
|
|
1768
|
+
let t = H.value, n = t[e];
|
|
1769
|
+
t.splice(e, 1), E.value === n && (E.value = null), T.value === n && (T.value = null), d(q);
|
|
1770
|
+
}
|
|
1771
|
+
function Fe(e) {
|
|
1772
|
+
let t = document.createElement("textarea");
|
|
1773
|
+
t.value = e, t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select(), document.execCommand("copy"), t.remove();
|
|
1774
|
+
}
|
|
1775
|
+
async function Ie(e, t) {
|
|
1776
|
+
try {
|
|
1777
|
+
navigator.clipboard?.writeText ? await navigator.clipboard.writeText(e) : Fe(e);
|
|
1778
|
+
} catch {
|
|
1779
|
+
Fe(e);
|
|
1780
|
+
}
|
|
1781
|
+
A.value = t, window.setTimeout(() => {
|
|
1782
|
+
A.value = null;
|
|
1783
|
+
}, 1600);
|
|
1784
|
+
}
|
|
1785
|
+
return (t, c) => {
|
|
1786
|
+
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"), w = y("el-form"), D = y("el-radio"), O = y("el-radio-group"), k = y("el-checkbox"), z = y("el-date-picker"), B = y("el-time-picker"), V = y("el-input-tag"), H = y("el-rate"), ae = y("el-slider"), _e = y("el-cascader"), G = y("el-tree-select"), K = y("el-scrollbar"), be = y("el-drawer"), xe = y("el-dialog");
|
|
1787
|
+
return m(), i("div", Bi, [
|
|
1788
|
+
a("header", Vi, [c[31] ||= a("div", null, [a("h2", null, "创建表单"), a("p", null, "从左侧拖拽字段到右侧表单,生成 config 和 data。")], -1), a("div", Hi, [s(l, {
|
|
1789
|
+
type: "primary",
|
|
1790
|
+
onClick: c[0] ||= (e) => Ie(R.value, "config")
|
|
1791
|
+
}, {
|
|
1792
|
+
default: S(() => [o(b(A.value === "config" ? "已复制 config" : "复制 config"), 1)]),
|
|
1793
|
+
_: 1
|
|
1794
|
+
}), s(l, { onClick: c[1] ||= (e) => Ie(re.value, "data") }, {
|
|
1795
|
+
default: S(() => [o(b(A.value === "data" ? "已复制 data" : "复制 data"), 1)]),
|
|
1796
|
+
_: 1
|
|
1797
|
+
})])]),
|
|
1798
|
+
a("section", Ui, [c[33] ||= a("h3", null, "全局配置", -1), s(w, {
|
|
1799
|
+
inline: "",
|
|
1800
|
+
"label-position": "top"
|
|
1801
|
+
}, {
|
|
1802
|
+
default: S(() => [
|
|
1803
|
+
s(p, { label: "必填" }, {
|
|
1804
|
+
default: S(() => [s(d, {
|
|
1805
|
+
modelValue: P.value.required,
|
|
1806
|
+
"onUpdate:modelValue": c[2] ||= (e) => P.value.required = e
|
|
1807
|
+
}, null, 8, ["modelValue"])]),
|
|
1808
|
+
_: 1
|
|
1809
|
+
}),
|
|
1810
|
+
s(p, { label: "label-position" }, {
|
|
1811
|
+
default: S(() => [s(g, {
|
|
1812
|
+
modelValue: P.value.labelPosition,
|
|
1813
|
+
"onUpdate:modelValue": c[3] ||= (e) => P.value.labelPosition = e,
|
|
1814
|
+
style: { width: "110px" }
|
|
1815
|
+
}, {
|
|
1816
|
+
default: S(() => [
|
|
1817
|
+
s(h, {
|
|
1818
|
+
label: "left",
|
|
1819
|
+
value: "left"
|
|
1820
|
+
}),
|
|
1821
|
+
s(h, {
|
|
1822
|
+
label: "right",
|
|
1823
|
+
value: "right"
|
|
1824
|
+
}),
|
|
1825
|
+
s(h, {
|
|
1826
|
+
label: "top",
|
|
1827
|
+
value: "top"
|
|
1828
|
+
})
|
|
1829
|
+
]),
|
|
1830
|
+
_: 1
|
|
1831
|
+
}, 8, ["modelValue"])]),
|
|
1832
|
+
_: 1
|
|
1833
|
+
}),
|
|
1834
|
+
s(p, { label: "span" }, {
|
|
1835
|
+
default: S(() => [s(v, {
|
|
1836
|
+
modelValue: P.value.span,
|
|
1837
|
+
"onUpdate:modelValue": c[4] ||= (e) => P.value.span = e,
|
|
1838
|
+
min: 1,
|
|
1839
|
+
max: 24
|
|
1840
|
+
}, null, 8, ["modelValue"])]),
|
|
1841
|
+
_: 1
|
|
1842
|
+
}),
|
|
1843
|
+
s(p, { label: "clearable" }, {
|
|
1844
|
+
default: S(() => [s(d, {
|
|
1845
|
+
modelValue: P.value.clearable,
|
|
1846
|
+
"onUpdate:modelValue": c[5] ||= (e) => P.value.clearable = e
|
|
1847
|
+
}, null, 8, ["modelValue"])]),
|
|
1848
|
+
_: 1
|
|
1849
|
+
}),
|
|
1850
|
+
s(p, { label: "filterable" }, {
|
|
1851
|
+
default: S(() => [s(d, {
|
|
1852
|
+
modelValue: P.value.filterable,
|
|
1853
|
+
"onUpdate:modelValue": c[6] ||= (e) => P.value.filterable = e
|
|
1854
|
+
}, null, 8, ["modelValue"])]),
|
|
1855
|
+
_: 1
|
|
1856
|
+
}),
|
|
1857
|
+
s(p, { label: "label-width" }, {
|
|
1858
|
+
default: S(() => [s(x, {
|
|
1859
|
+
modelValue: P.value.labelWidth,
|
|
1860
|
+
"onUpdate:modelValue": c[7] ||= (e) => P.value.labelWidth = e,
|
|
1861
|
+
placeholder: "auto"
|
|
1862
|
+
}, null, 8, ["modelValue"])]),
|
|
1863
|
+
_: 1
|
|
1864
|
+
}),
|
|
1865
|
+
s(p, { label: "border" }, {
|
|
1866
|
+
default: S(() => [s(d, {
|
|
1867
|
+
modelValue: P.value.border,
|
|
1868
|
+
"onUpdate:modelValue": c[8] ||= (e) => P.value.border = e
|
|
1869
|
+
}, null, 8, ["modelValue"])]),
|
|
1870
|
+
_: 1
|
|
1871
|
+
}),
|
|
1872
|
+
s(p, { label: "只读展示" }, {
|
|
1873
|
+
default: S(() => [s(d, {
|
|
1874
|
+
modelValue: P.value.isText,
|
|
1875
|
+
"onUpdate:modelValue": c[9] ||= (e) => P.value.isText = e
|
|
1876
|
+
}, null, 8, ["modelValue"])]),
|
|
1877
|
+
_: 1
|
|
1878
|
+
}),
|
|
1879
|
+
s(l, {
|
|
1880
|
+
type: "primary",
|
|
1881
|
+
onClick: W
|
|
1882
|
+
}, {
|
|
1883
|
+
default: S(() => [...c[32] ||= [o("应用全局配置", -1)]]),
|
|
1884
|
+
_: 1
|
|
1885
|
+
})
|
|
1886
|
+
]),
|
|
1887
|
+
_: 1
|
|
1888
|
+
})]),
|
|
1889
|
+
a("div", Wi, [a("aside", Gi, [c[35] ||= a("h3", null, "字段库", -1), (m(), i(e, null, _(u, (t) => a("div", {
|
|
1890
|
+
key: t.type,
|
|
1891
|
+
class: "palette-item",
|
|
1892
|
+
draggable: "true",
|
|
1893
|
+
onDragstart: (e) => he(t.type),
|
|
1894
|
+
onDragend: ge
|
|
1895
|
+
}, [s(p, { label: t.label }, {
|
|
1896
|
+
default: S(() => [t.type === "block" ? (m(), i("div", qi, "block 块")) : t.type === "input" ? (m(), n(x, {
|
|
1897
|
+
key: 1,
|
|
1898
|
+
placeholder: "请输入"
|
|
1899
|
+
})) : t.type === "textarea" ? (m(), n(x, {
|
|
1900
|
+
key: 2,
|
|
1901
|
+
type: "textarea",
|
|
1902
|
+
rows: 2,
|
|
1903
|
+
placeholder: "请输入"
|
|
1904
|
+
})) : t.type === "select" ? (m(), n(g, {
|
|
1905
|
+
key: 3,
|
|
1906
|
+
"model-value": "",
|
|
1907
|
+
placeholder: "请选择"
|
|
1908
|
+
}, {
|
|
1909
|
+
default: S(() => [(m(!0), i(e, null, _(t.options ?? [], (e) => (m(), n(h, {
|
|
1910
|
+
key: e.value,
|
|
1911
|
+
label: e.label,
|
|
1912
|
+
value: e.value
|
|
1913
|
+
}, null, 8, ["label", "value"]))), 128))]),
|
|
1914
|
+
_: 2
|
|
1915
|
+
}, 1024)) : t.type === "radio" ? (m(), n(O, {
|
|
1916
|
+
key: 4,
|
|
1917
|
+
"model-value": ""
|
|
1918
|
+
}, {
|
|
1919
|
+
default: S(() => [(m(!0), i(e, null, _(t.options ?? [], (e) => (m(), n(D, {
|
|
1920
|
+
key: e.value,
|
|
1921
|
+
value: e.value
|
|
1922
|
+
}, {
|
|
1923
|
+
default: S(() => [o(b(e.label), 1)]),
|
|
1924
|
+
_: 2
|
|
1925
|
+
}, 1032, ["value"]))), 128))]),
|
|
1926
|
+
_: 2
|
|
1927
|
+
}, 1024)) : t.type === "checkbox" ? (m(), n(k, { key: 5 }, {
|
|
1928
|
+
default: S(() => [...c[34] ||= [o("复选框", -1)]]),
|
|
1929
|
+
_: 1
|
|
1930
|
+
})) : t.type === "switch" ? (m(), n(d, { key: 6 })) : t.type === "inputNumber" ? (m(), n(v, {
|
|
1931
|
+
key: 7,
|
|
1932
|
+
"model-value": 0,
|
|
1933
|
+
controls: !1
|
|
1934
|
+
})) : t.type === "datePicker" ? (m(), n(z, {
|
|
1935
|
+
key: 8,
|
|
1936
|
+
type: "date",
|
|
1937
|
+
placeholder: "选择日期"
|
|
1938
|
+
})) : t.type === "datetimePicker" ? (m(), n(z, {
|
|
1939
|
+
key: 9,
|
|
1940
|
+
type: "datetime",
|
|
1941
|
+
placeholder: "选择日期时间"
|
|
1942
|
+
})) : t.type === "timePicker" ? (m(), n(B, {
|
|
1943
|
+
key: 10,
|
|
1944
|
+
placeholder: "选择时间"
|
|
1945
|
+
})) : t.type === "inputTag" ? (m(), n(V, {
|
|
1946
|
+
key: 11,
|
|
1947
|
+
"model-value": ["标签"]
|
|
1948
|
+
})) : t.type === "transfer" ? (m(), i("div", Ji, "穿梭框")) : t.type === "rate" ? (m(), n(H, {
|
|
1949
|
+
key: 13,
|
|
1950
|
+
"model-value": 3
|
|
1951
|
+
})) : t.type === "slider" ? (m(), n(ae, {
|
|
1952
|
+
key: 14,
|
|
1953
|
+
"model-value": 40
|
|
1954
|
+
})) : t.type === "cascader" ? (m(), n(_e, {
|
|
1955
|
+
key: 15,
|
|
1956
|
+
placeholder: "请选择"
|
|
1957
|
+
})) : t.type === "treeSelect" ? (m(), n(G, {
|
|
1958
|
+
key: 16,
|
|
1959
|
+
placeholder: "请选择"
|
|
1960
|
+
})) : r("", !0)]),
|
|
1961
|
+
_: 2
|
|
1962
|
+
}, 1032, ["label"])], 40, Ki)), 64))]), a("section", {
|
|
1963
|
+
class: "preview",
|
|
1964
|
+
onDragover: C(Me, ["prevent"]),
|
|
1965
|
+
onDragleave: Ae,
|
|
1966
|
+
onDrop: C(ke, ["prevent"]),
|
|
1967
|
+
onClick: ce
|
|
1968
|
+
}, [a("div", Yi, [c[38] ||= a("h3", null, "实时表单", -1), a("div", Xi, [c[37] ||= a("span", null, "将左侧字段拖到这里", -1), s(l, {
|
|
1969
|
+
size: "small",
|
|
1970
|
+
onClick: ue
|
|
1971
|
+
}, {
|
|
1972
|
+
default: S(() => [...c[36] ||= [o("字段配置", -1)]]),
|
|
1973
|
+
_: 1
|
|
1974
|
+
})])]), s(zi, {
|
|
1975
|
+
config: L.value,
|
|
1976
|
+
modelValue: U.value,
|
|
1977
|
+
"onUpdate:modelValue": c[10] ||= (e) => U.value = e,
|
|
1978
|
+
"field-action": Ce,
|
|
1979
|
+
"block-action": we
|
|
1980
|
+
}, null, 8, ["config", "modelValue"])], 32)]),
|
|
1981
|
+
s(be, {
|
|
1982
|
+
modelValue: N.value,
|
|
1983
|
+
"onUpdate:modelValue": c[27] ||= (e) => N.value = e,
|
|
1984
|
+
title: "字段配置",
|
|
1985
|
+
size: "560px"
|
|
1986
|
+
}, {
|
|
1987
|
+
default: S(() => [s(K, {
|
|
1988
|
+
class: "drawer-scrollbar",
|
|
1989
|
+
"view-style": "padding: 0 20px 20px 0;"
|
|
1990
|
+
}, {
|
|
1991
|
+
default: S(() => [a("div", Zi, [a("button", {
|
|
1992
|
+
type: "button",
|
|
1993
|
+
class: f({ active: !E.value }),
|
|
1994
|
+
onClick: se
|
|
1995
|
+
}, " 根 ", 2), E.value ? (m(), i("span", Qi, "/ " + b(E.value.label || E.value.key), 1)) : r("", !0)]), T.value ? (m(), n(w, {
|
|
1996
|
+
key: 0,
|
|
1997
|
+
"label-position": "top"
|
|
1998
|
+
}, {
|
|
1999
|
+
default: S(() => [
|
|
2000
|
+
s(p, { label: "label" }, {
|
|
2001
|
+
default: S(() => [s(x, {
|
|
2002
|
+
modelValue: T.value.label,
|
|
2003
|
+
"onUpdate:modelValue": c[11] ||= (e) => T.value.label = e
|
|
2004
|
+
}, null, 8, ["modelValue"])]),
|
|
2005
|
+
_: 1
|
|
2006
|
+
}),
|
|
2007
|
+
s(p, { label: "key" }, {
|
|
2008
|
+
default: S(() => [s(x, {
|
|
2009
|
+
modelValue: T.value.key,
|
|
2010
|
+
"onUpdate:modelValue": c[12] ||= (e) => T.value.key = e
|
|
2011
|
+
}, null, 8, ["modelValue"])]),
|
|
2012
|
+
_: 1
|
|
2013
|
+
}),
|
|
2014
|
+
s(p, { label: "span" }, {
|
|
2015
|
+
default: S(() => [s(v, {
|
|
2016
|
+
modelValue: T.value.span,
|
|
2017
|
+
"onUpdate:modelValue": c[13] ||= (e) => T.value.span = e,
|
|
2018
|
+
min: 1,
|
|
2019
|
+
max: 24
|
|
2020
|
+
}, null, 8, ["modelValue"])]),
|
|
2021
|
+
_: 1
|
|
2022
|
+
}),
|
|
2023
|
+
T.value.type === "block" ? (m(), n(p, {
|
|
2024
|
+
key: 0,
|
|
2025
|
+
label: "进入层级"
|
|
2026
|
+
}, {
|
|
2027
|
+
default: S(() => [s(l, {
|
|
2028
|
+
size: "small",
|
|
2029
|
+
onClick: c[14] ||= (e) => oe(T.value)
|
|
2030
|
+
}, {
|
|
2031
|
+
default: S(() => [...c[39] ||= [o("进入 block", -1)]]),
|
|
2032
|
+
_: 1
|
|
2033
|
+
})]),
|
|
2034
|
+
_: 1
|
|
2035
|
+
})) : r("", !0),
|
|
2036
|
+
T.value.type === "block" ? (m(), n(p, {
|
|
2037
|
+
key: 1,
|
|
2038
|
+
label: "显示边框"
|
|
2039
|
+
}, {
|
|
2040
|
+
default: S(() => [s(d, {
|
|
2041
|
+
modelValue: T.value.border,
|
|
2042
|
+
"onUpdate:modelValue": c[15] ||= (e) => T.value.border = e
|
|
2043
|
+
}, null, 8, ["modelValue"])]),
|
|
2044
|
+
_: 1
|
|
2045
|
+
})) : r("", !0),
|
|
2046
|
+
s(p, { label: "placeholder" }, {
|
|
2047
|
+
default: S(() => [s(x, {
|
|
2048
|
+
modelValue: T.value.placeholder,
|
|
2049
|
+
"onUpdate:modelValue": c[16] ||= (e) => T.value.placeholder = e
|
|
2050
|
+
}, null, 8, ["modelValue"])]),
|
|
2051
|
+
_: 1
|
|
2052
|
+
}),
|
|
2053
|
+
s(p, { label: "默认值" }, {
|
|
2054
|
+
default: S(() => [[
|
|
2055
|
+
"inputNumber",
|
|
2056
|
+
"rate",
|
|
2057
|
+
"slider"
|
|
2058
|
+
].includes(T.value.type) ? (m(), n(v, {
|
|
2059
|
+
key: 0,
|
|
2060
|
+
modelValue: T.value.default,
|
|
2061
|
+
"onUpdate:modelValue": c[17] ||= (e) => T.value.default = e
|
|
2062
|
+
}, null, 8, ["modelValue"])) : ["switch", "checkbox"].includes(T.value.type) ? (m(), n(d, {
|
|
2063
|
+
key: 1,
|
|
2064
|
+
modelValue: T.value.default,
|
|
2065
|
+
"onUpdate:modelValue": c[18] ||= (e) => T.value.default = e
|
|
2066
|
+
}, null, 8, ["modelValue"])) : (m(), n(x, {
|
|
2067
|
+
key: 2,
|
|
2068
|
+
modelValue: T.value.default,
|
|
2069
|
+
"onUpdate:modelValue": c[19] ||= (e) => T.value.default = e
|
|
2070
|
+
}, null, 8, ["modelValue"]))]),
|
|
2071
|
+
_: 1
|
|
2072
|
+
}),
|
|
2073
|
+
s(p, { label: "必填" }, {
|
|
2074
|
+
default: S(() => [s(d, {
|
|
2075
|
+
modelValue: T.value.required,
|
|
2076
|
+
"onUpdate:modelValue": c[20] ||= (e) => T.value.required = e
|
|
2077
|
+
}, null, 8, ["modelValue"])]),
|
|
2078
|
+
_: 1
|
|
2079
|
+
}),
|
|
2080
|
+
s(p, { label: "禁用" }, {
|
|
2081
|
+
default: S(() => [s(d, {
|
|
2082
|
+
modelValue: T.value.disabled,
|
|
2083
|
+
"onUpdate:modelValue": c[21] ||= (e) => T.value.disabled = e
|
|
2084
|
+
}, null, 8, ["modelValue"])]),
|
|
2085
|
+
_: 1
|
|
2086
|
+
}),
|
|
2087
|
+
s(p, { label: "只读展示" }, {
|
|
2088
|
+
default: S(() => [s(d, {
|
|
2089
|
+
modelValue: T.value.isText,
|
|
2090
|
+
"onUpdate:modelValue": c[22] ||= (e) => T.value.isText = e
|
|
2091
|
+
}, null, 8, ["modelValue"])]),
|
|
2092
|
+
_: 1
|
|
2093
|
+
}),
|
|
2094
|
+
s(p, { label: "隐藏字段" }, {
|
|
2095
|
+
default: S(() => [s(d, {
|
|
2096
|
+
modelValue: T.value.visible,
|
|
2097
|
+
"onUpdate:modelValue": c[23] ||= (e) => T.value.visible = e
|
|
2098
|
+
}, null, 8, ["modelValue"])]),
|
|
2099
|
+
_: 1
|
|
2100
|
+
}),
|
|
2101
|
+
s(p, { label: "隐藏时清空" }, {
|
|
2102
|
+
default: S(() => [s(d, {
|
|
2103
|
+
modelValue: T.value.clearOnHide,
|
|
2104
|
+
"onUpdate:modelValue": c[24] ||= (e) => T.value.clearOnHide = e
|
|
2105
|
+
}, null, 8, ["modelValue"])]),
|
|
2106
|
+
_: 1
|
|
2107
|
+
}),
|
|
2108
|
+
[
|
|
2109
|
+
"datePicker",
|
|
2110
|
+
"datetimePicker",
|
|
2111
|
+
"timePicker"
|
|
2112
|
+
].includes(T.value.type) ? (m(), n(p, {
|
|
2113
|
+
key: 2,
|
|
2114
|
+
label: "UTC时间"
|
|
2115
|
+
}, {
|
|
2116
|
+
default: S(() => [s(d, {
|
|
2117
|
+
modelValue: T.value.utc,
|
|
2118
|
+
"onUpdate:modelValue": c[25] ||= (e) => T.value.utc = e
|
|
2119
|
+
}, null, 8, ["modelValue"])]),
|
|
2120
|
+
_: 1
|
|
2121
|
+
})) : r("", !0),
|
|
2122
|
+
s(p, { label: "联动配置" }, {
|
|
2123
|
+
default: S(() => [a("div", $i, [(m(!0), i(e, null, _(ee.value, (t, r) => (m(), i("div", {
|
|
2124
|
+
key: r,
|
|
2125
|
+
class: "linkage-rule"
|
|
2126
|
+
}, [
|
|
2127
|
+
a("div", ea, [a("span", null, "规则 " + b(r + 1), 1), s(l, {
|
|
2128
|
+
link: "",
|
|
2129
|
+
type: "danger",
|
|
2130
|
+
onClick: (e) => fe(r)
|
|
2131
|
+
}, {
|
|
2132
|
+
default: S(() => [...c[40] ||= [o(" 删除 ", -1)]]),
|
|
2133
|
+
_: 1
|
|
2134
|
+
}, 8, ["onClick"])]),
|
|
2135
|
+
a("div", ta, [
|
|
2136
|
+
s(g, {
|
|
2137
|
+
modelValue: t.when.field,
|
|
2138
|
+
"onUpdate:modelValue": (e) => t.when.field = e,
|
|
2139
|
+
placeholder: "选择源字段"
|
|
2140
|
+
}, {
|
|
2141
|
+
default: S(() => [(m(!0), i(e, null, _(te.value, (e) => (m(), n(h, {
|
|
2142
|
+
key: e.value,
|
|
2143
|
+
label: e.label,
|
|
2144
|
+
value: e.value
|
|
2145
|
+
}, null, 8, ["label", "value"]))), 128))]),
|
|
2146
|
+
_: 1
|
|
2147
|
+
}, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2148
|
+
s(g, {
|
|
2149
|
+
modelValue: t.when.operator,
|
|
2150
|
+
"onUpdate:modelValue": (e) => t.when.operator = e
|
|
2151
|
+
}, {
|
|
2152
|
+
default: S(() => [(m(), i(e, null, _(ne, (e) => s(h, {
|
|
2153
|
+
key: e,
|
|
2154
|
+
label: e,
|
|
2155
|
+
value: e
|
|
2156
|
+
}, null, 8, ["label", "value"])), 64))]),
|
|
2157
|
+
_: 1
|
|
2158
|
+
}, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2159
|
+
s(x, {
|
|
2160
|
+
modelValue: t.when.value,
|
|
2161
|
+
"onUpdate:modelValue": (e) => t.when.value = e,
|
|
2162
|
+
placeholder: "条件值"
|
|
2163
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
2164
|
+
]),
|
|
2165
|
+
a("div", na, [
|
|
2166
|
+
s(k, {
|
|
2167
|
+
modelValue: t.effects.visible,
|
|
2168
|
+
"onUpdate:modelValue": (e) => t.effects.visible = e
|
|
2169
|
+
}, {
|
|
2170
|
+
default: S(() => [...c[41] ||= [o("显示", -1)]]),
|
|
2171
|
+
_: 1
|
|
2172
|
+
}, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2173
|
+
s(k, {
|
|
2174
|
+
modelValue: t.effects.disabled,
|
|
2175
|
+
"onUpdate:modelValue": (e) => t.effects.disabled = e
|
|
2176
|
+
}, {
|
|
2177
|
+
default: S(() => [...c[42] ||= [o("禁用", -1)]]),
|
|
2178
|
+
_: 1
|
|
2179
|
+
}, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2180
|
+
s(k, {
|
|
2181
|
+
modelValue: t.effects.required,
|
|
2182
|
+
"onUpdate:modelValue": (e) => t.effects.required = e
|
|
2183
|
+
}, {
|
|
2184
|
+
default: S(() => [...c[43] ||= [o("必填", -1)]]),
|
|
2185
|
+
_: 1
|
|
2186
|
+
}, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2187
|
+
s(k, {
|
|
2188
|
+
modelValue: t.effects.clearOnHide,
|
|
2189
|
+
"onUpdate:modelValue": (e) => t.effects.clearOnHide = e
|
|
2190
|
+
}, {
|
|
2191
|
+
default: S(() => [...c[44] ||= [o("隐藏清空", -1)]]),
|
|
2192
|
+
_: 1
|
|
2193
|
+
}, 8, ["modelValue", "onUpdate:modelValue"])
|
|
2194
|
+
]),
|
|
2195
|
+
s(x, {
|
|
2196
|
+
modelValue: t.effects.value,
|
|
2197
|
+
"onUpdate:modelValue": (e) => t.effects.value = e,
|
|
2198
|
+
placeholder: "联动写入值"
|
|
2199
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2200
|
+
s(x, {
|
|
2201
|
+
type: "textarea",
|
|
2202
|
+
rows: 2,
|
|
2203
|
+
"model-value": pe(t.effects.options),
|
|
2204
|
+
onChange: (e) => me(t, e),
|
|
2205
|
+
placeholder: "联动选项 JSON"
|
|
2206
|
+
}, null, 8, ["model-value", "onChange"])
|
|
2207
|
+
]))), 128)), s(l, {
|
|
2208
|
+
size: "small",
|
|
2209
|
+
onClick: de
|
|
2210
|
+
}, {
|
|
2211
|
+
default: S(() => [...c[45] ||= [o("添加联动规则", -1)]]),
|
|
2212
|
+
_: 1
|
|
2213
|
+
})])]),
|
|
2214
|
+
_: 1
|
|
2215
|
+
}),
|
|
2216
|
+
ie.value ? (m(), n(p, {
|
|
2217
|
+
key: 3,
|
|
2218
|
+
label: "选项"
|
|
2219
|
+
}, {
|
|
2220
|
+
default: S(() => [a("div", ra, [(m(!0), i(e, null, _(T.value.options ?? [], (e, t) => (m(), i("div", {
|
|
2221
|
+
key: t,
|
|
2222
|
+
class: "option-row"
|
|
2223
|
+
}, [
|
|
2224
|
+
s(x, {
|
|
2225
|
+
modelValue: e.label,
|
|
2226
|
+
"onUpdate:modelValue": (t) => e.label = t,
|
|
2227
|
+
placeholder: "label"
|
|
2228
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2229
|
+
s(x, {
|
|
2230
|
+
modelValue: e.value,
|
|
2231
|
+
"onUpdate:modelValue": (t) => e.value = t,
|
|
2232
|
+
placeholder: "value"
|
|
2233
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"]),
|
|
2234
|
+
s(l, {
|
|
2235
|
+
link: "",
|
|
2236
|
+
type: "danger",
|
|
2237
|
+
onClick: (e) => T.value.options?.splice(t, 1)
|
|
2238
|
+
}, {
|
|
2239
|
+
default: S(() => [...c[46] ||= [o(" 删除 ", -1)]]),
|
|
2240
|
+
_: 1
|
|
2241
|
+
}, 8, ["onClick"])
|
|
2242
|
+
]))), 128)), s(l, {
|
|
2243
|
+
size: "small",
|
|
2244
|
+
onClick: c[26] ||= (e) => T.value.options?.push({
|
|
2245
|
+
label: "",
|
|
2246
|
+
value: ""
|
|
2247
|
+
})
|
|
2248
|
+
}, {
|
|
2249
|
+
default: S(() => [...c[47] ||= [o(" 添加选项 ", -1)]]),
|
|
2250
|
+
_: 1
|
|
2251
|
+
})])]),
|
|
2252
|
+
_: 1
|
|
2253
|
+
})) : r("", !0),
|
|
2254
|
+
s(p, { label: "操作" }, {
|
|
2255
|
+
default: S(() => [s(l, {
|
|
2256
|
+
type: "danger",
|
|
2257
|
+
onClick: le
|
|
2258
|
+
}, {
|
|
2259
|
+
default: S(() => [...c[48] ||= [o("删除字段", -1)]]),
|
|
2260
|
+
_: 1
|
|
2261
|
+
})]),
|
|
2262
|
+
_: 1
|
|
2263
|
+
})
|
|
2264
|
+
]),
|
|
2265
|
+
_: 1
|
|
2266
|
+
})) : (m(), i("div", ia, "点击右侧表单中的字段进行配置"))]),
|
|
2267
|
+
_: 1
|
|
2268
|
+
})]),
|
|
2269
|
+
_: 1
|
|
2270
|
+
}, 8, ["modelValue"]),
|
|
2271
|
+
a("section", aa, [a("div", oa, [c[49] ||= a("h3", null, "config", -1), a("pre", null, b(R.value), 1)]), a("div", sa, [c[50] ||= a("h3", null, "data", -1), a("pre", null, b(re.value), 1)])]),
|
|
2272
|
+
s(xe, {
|
|
2273
|
+
modelValue: M.value,
|
|
2274
|
+
"onUpdate:modelValue": c[30] ||= (e) => M.value = e,
|
|
2275
|
+
title: j.value?.type === "block" ? "添加 block" : "添加字段",
|
|
2276
|
+
width: "420px"
|
|
2277
|
+
}, {
|
|
2278
|
+
footer: S(() => [s(l, { onClick: ye }, {
|
|
2279
|
+
default: S(() => [...c[51] ||= [o("取消", -1)]]),
|
|
2280
|
+
_: 1
|
|
2281
|
+
}), s(l, {
|
|
2282
|
+
type: "primary",
|
|
2283
|
+
onClick: ve
|
|
2284
|
+
}, {
|
|
2285
|
+
default: S(() => [...c[52] ||= [o("确定", -1)]]),
|
|
2286
|
+
_: 1
|
|
2287
|
+
})]),
|
|
2288
|
+
default: S(() => [s(w, { "label-position": "top" }, {
|
|
2289
|
+
default: S(() => [s(p, {
|
|
2290
|
+
label: "key",
|
|
2291
|
+
required: ""
|
|
2292
|
+
}, {
|
|
2293
|
+
default: S(() => [s(x, {
|
|
2294
|
+
modelValue: F.value,
|
|
2295
|
+
"onUpdate:modelValue": c[28] ||= (e) => F.value = e,
|
|
2296
|
+
placeholder: "请输入 key"
|
|
2297
|
+
}, null, 8, ["modelValue"])]),
|
|
2298
|
+
_: 1
|
|
2299
|
+
}), s(p, {
|
|
2300
|
+
label: "label",
|
|
2301
|
+
required: ""
|
|
2302
|
+
}, {
|
|
2303
|
+
default: S(() => [s(x, {
|
|
2304
|
+
modelValue: I.value,
|
|
2305
|
+
"onUpdate:modelValue": c[29] ||= (e) => I.value = e,
|
|
2306
|
+
placeholder: "请输入 label"
|
|
2307
|
+
}, null, 8, ["modelValue"])]),
|
|
2308
|
+
_: 1
|
|
2309
|
+
})]),
|
|
2310
|
+
_: 1
|
|
2311
|
+
})]),
|
|
2312
|
+
_: 1
|
|
2313
|
+
}, 8, ["modelValue", "title"])
|
|
2314
|
+
]);
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
}), [["__scopeId", "data-v-1d60d7bc"]]), la = { install(e) {
|
|
2318
|
+
e.component("BreezeForm", zi), e.component("BreezeCreateForm", ca), e.component("BreezeDynamicField", Si);
|
|
2319
|
+
} };
|
|
2320
|
+
//#endregion
|
|
2321
|
+
export { la as BreezeFormPlugin, la as default, ca as CreateForm, Si as DynamicField, zi as Form };
|