@vtj/designer 0.9.0-alpha.12 → 0.9.0-alpha.14
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/dist/index.mjs +755 -738
- package/dist/style.css +1 -1
- package/package.json +6 -6
- package/types/version.d.ts +2 -2
package/dist/index.mjs
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
var il = Object.defineProperty;
|
2
2
|
var ul = (u, e, t) => e in u ? il(u, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : u[e] = t;
|
3
3
|
var F = (u, e, t) => ul(u, typeof e != "symbol" ? e + "" : e, t);
|
4
|
-
import { computed as x, unref as n, ref as S, reactive as qe, watchEffect as cl, watch as M, toValue as Et, defineComponent as E, openBlock as d, createElementBlock as j, toDisplayString as L, createVNode as v, withCtx as y, createElementVNode as V, createBlock as w, createCommentVNode as A, createTextVNode as G, mergeProps as ue, readonly as dl, getCurrentScope as pl, onScopeDispose as ml, onMounted as gt, nextTick as Ce, getCurrentInstance as fn, shallowRef as Qe, toRaw as hn, Fragment as z, renderList as W, normalizeClass as K, defineAsyncComponent as vl, h as Je, resolveDynamicComponent as bn, createSlots as gl, withDirectives as Ee, vShow as Le, renderSlot as Ve, withModifiers as Me, isRef as Dt, normalizeStyle as rt, inject as Rt, provide as fl, normalizeProps as yn, guardReactiveProps as _n, withKeys as it, onUnmounted as wn, markRaw as It, createApp as kn, shallowReactive as hl, triggerRef as
|
5
|
-
import { ElNotification as Ot, ElMessageBox as
|
4
|
+
import { computed as x, unref as n, ref as S, reactive as qe, watchEffect as cl, watch as M, toValue as Et, defineComponent as E, openBlock as d, createElementBlock as j, toDisplayString as L, createVNode as v, withCtx as y, createElementVNode as V, createBlock as w, createCommentVNode as A, createTextVNode as G, mergeProps as ue, readonly as dl, getCurrentScope as pl, onScopeDispose as ml, onMounted as gt, nextTick as Ce, getCurrentInstance as fn, shallowRef as Qe, toRaw as hn, Fragment as z, renderList as W, normalizeClass as K, defineAsyncComponent as vl, h as Je, resolveDynamicComponent as bn, createSlots as gl, withDirectives as Ee, vShow as Le, renderSlot as Ve, withModifiers as Me, isRef as Dt, normalizeStyle as rt, inject as Rt, provide as fl, normalizeProps as yn, guardReactiveProps as _n, withKeys as it, onUnmounted as wn, markRaw as It, createApp as kn, shallowReactive as hl, triggerRef as Te, KeepAlive as Sn } from "vue";
|
5
|
+
import { ElNotification as Ot, ElMessageBox as De, ElMessage as Ie, ElButton as re, ElDivider as zt, ElRadioGroup as xn, ElRadioButton as ut, ElButtonGroup as bl, ElImage as Cn, ElDropdown as Vn, ElDropdownMenu as An, ElDropdownItem as ct, ElInput as be, ElEmpty as ie, ElAlert as Ft, ElTooltip as jn, ElTag as En, ElSwitch as Dn, ElTree as Lt, ElCollapse as ft, ElCollapseItem as ht, ElRow as pt, ElCol as mt, ElDrawer as In, ElForm as we, ElFormItem as Pn, ElBreadcrumb as yl, ElBreadcrumbItem as _l, ElLoading as wl, vLoading as kl, ElAvatar as Sl, ElSelect as xl, ElOption as Cl, ElInputNumber as Vl, ElColorPicker as Al, ElUpload as jl, ElSlider as El, ElConfigProvider as Dl, ElContainer as en, ElHeader as Il, ElAside as tn, ElMain as Pl, ElFooter as Tl } from "element-plus";
|
6
6
|
import $l from "element-plus/es/locale/lang/zh-cn";
|
7
7
|
import { XDialogForm as Ae, XField as I, XIcon as Re, XDialog as Oe, XPanel as bt, XAction as ge, XTabs as Wt, XContainer as q, XForm as Nt, XAttachment as Bl, XActionBar as Rl, XInputUnit as Tn, vResizable as nn, createDialog as Ol } from "@vtj/ui";
|
8
|
-
import { jsonp as Ne, groupBy as yt, dataURLtoBlob as zl, delay as Mt, upperFirstCamelCase as $n, toRawType as Ct, cloneDeep as _t, logger as
|
8
|
+
import { jsonp as Ne, groupBy as yt, dataURLtoBlob as zl, delay as Mt, upperFirstCamelCase as $n, toRawType as Ct, cloneDeep as _t, logger as Pe, isPlainObject as Fl, fileToBase64 as Ll, merge as Jt, debounce as Wl, arrayToMap as Nl, toArray as Ml } from "@vtj/utils";
|
9
9
|
import { isBlock as ne, DirectiveModel as Bn, createNodeFrom as Jl, BUILT_IN_VUE as Ul, BUILT_IN_VUE_ROUTER as ql, BUILT_IN_NAME as Pt, emitter as oe, EVENT_PROJECT_ACTIVED as Tt, EVENT_NODE_CHANGE as Ye, NodeModel as ln, EVENT_BLOCK_CHANGE as $t, Base as Rn, BUILT_IN_LIBRARAY_MAP as Hl, ProjectModel as Gl, EVENT_PROJECT_CHANGE as Kl, EVENT_PROJECT_BLOCKS_CHANGE as Xl, EVENT_PROJECT_PAGES_CHANGE as Ql, EVENT_PROJECT_DEPS_CHANGE as Yl, EVENT_PROJECT_PUBLISH as Zl, EVENT_PROJECT_FILE_PUBLISH as ea, EVENT_HISTORY_CHANGE as ta, EVENT_HISTORY_LOAD as na, BlockModel as an, HistoryModel as la } from "@vtj/core";
|
10
10
|
import { parseExpression as Ze, parseFunction as aa, JSCodeToString as Ue, LIFE_CYCLES_LIST as sa, DATA_TYPES as oa, isJSExpression as et, ContextMode as On, parseDeps as ra, createAssetsCss as ia, createAssetScripts as sn, getRawComponent as on, createSchemaApis as ua, mockCleanup as ca, mockApis as da, Provider as pa, isJSFunction as ma } from "@vtj/renderer";
|
11
11
|
import { VtjIconBack as va, VtjIconPc as ga, VtjIconPhone as fa, VtjIconPad as ha, VtjIconUndo as ba, VtjIconRedo as ya, VtjIconTemplate as Ut, VtjIconPreview as _a, VtjIconRefresh as zn, VtjIconSetting as Fn, VtjIconPublish as wa, VtjIconProject as ka, icons as Bt, ArrowDown as Ln, Search as nt, CopyDocument as Sa, Back as xa, VtjIconPlus as Wn, EditPen as Ca, Delete as Nn, VtjIconSave as Va, ArrowUp as Aa, MoreFilled as lt, VtjIconCheck as Mn, VtjIconCopy as qt, VtjIconEdit as Jn, VtjIconRemove as wt, VtjIconLock as Un, VtjIconUnlock as ja, VtjIconInvisible as qn, VtjIconVisible as Ea, VtjIconHome as Da, VtjIconShare as Ia, VtjIconComponents as Hn, Files as Pa, VtjIconSearch as Ta, VtjIconHelp as Gn, VtjIconLayers as Kn, Rank as $a, VtjIconArrowUp as Ba, VtjIconArrowDown as Ra, IconDisplayBlock as Oa, IconDisplayFlex as za, IconDisplayInlineBlock as Fa, IconDisplayInline as La, IconEyeInvisible as Wa, IconFlexDirectionrow as Na, IconFlexDirectionrowReverse as Ma, IconFlexDirectioncolumn as Ja, IconFlexDirectioncolumnReverse as Ua, IconFlexJustifyflexStartrow as qa, IconFlexJustifyflexEndrow as Ha, IconFlexJustifycenterrow as Ga, IconFlexJustifyspaceBetweenrow as Ka, IconFlexJustifyspaceAroundrow as Xa, IconFlexAlignflexStartrow as Qa, IconFlexAlignflexEndrow as Ya, IconFlexAligncenterrow as Za, IconFlexAlignbaselinerow as es, IconFlexAlignstretchrow as ts, IconPositionTopLeft as ns, IconPositionTopRight as ls, IconPositionBottomLeft as as, IconPositionBottomRight as ss, IconPositionLeft as os, IconPositionRight as rs, IconPositionTop as is, IconPositionBottom as us, IconPositionAll as cs, IconTextAlignLeft as ds, IconTextAlignCenter as ps, IconTextAlignRight as ms, IconTextAlignJustify as vs, IconFontStyleNone as gs, IconFontStyleItalic as fs, IconCross as Xn, IconTextDecorationUnderline as hs, IconTextDecorationStrike as bs, IconTextDecorationOverline as ys, IconTileXy as _s, IconTileX as ws, IconTileY as ks, IconClose as Ss, IconBorderAll as xs, IconBorderLeft as Cs, IconBorderTop as Vs, IconBorderBottom as As, IconBorderRight as js, IconBorderStyleSolid as Es, IconBorderStyleDashed as Ds, IconBorderStyleDotted as Is, IconCursorAuto as Ps, IconCursorPointer as Ts, IconCursorNotAllowed as $s, IconCursorNone as Bs, ArrowRight as Rs, Download as Os, UserFilled as zs, VtjIconDocument as Fs, VtjIconBlock as Ls, VtjIconOutline as Ws, VtjIconHistory as Ns, VtjIconApi as Ms, VtjIconCategory as Js, HomeFilled as Us, Plus as qs, Close as Hs, VtjIconVars as Gs, VtjIconSwitch as Ks, Switch as Xs } from "@vtj/icons";
|
@@ -15,10 +15,10 @@ import Ys from "mockjs";
|
|
15
15
|
* Copyright (c) 2024, VTJ.PRO All rights reserved.
|
16
16
|
* @name @vtj/designer
|
17
17
|
* @author CHC chenhuachun1549@dingtalk.com
|
18
|
-
* @version 0.9.0-alpha.
|
18
|
+
* @version 0.9.0-alpha.14
|
19
19
|
* @license <a href="https://vtj.pro/license.html">MIT License</a>
|
20
20
|
*/
|
21
|
-
const Zs = "0.9.0-alpha.
|
21
|
+
const Zs = "0.9.0-alpha.14", rn = {
|
22
22
|
width: 390,
|
23
23
|
height: 844
|
24
24
|
}, un = {
|
@@ -69,8 +69,8 @@ function Ht(u = 160) {
|
|
69
69
|
const e = ce();
|
70
70
|
return {
|
71
71
|
span: x(() => {
|
72
|
-
const
|
73
|
-
return Math.floor(24 /
|
72
|
+
const o = e.skeleton?.skeletonRef.leftWidth || 350, s = Math.max(Math.floor(o / u), 1);
|
73
|
+
return Math.floor(24 / s);
|
74
74
|
}),
|
75
75
|
engine: e
|
76
76
|
};
|
@@ -84,26 +84,26 @@ function io() {
|
|
84
84
|
}
|
85
85
|
const uo = (u = []) => u.map((e) => e.name);
|
86
86
|
function co() {
|
87
|
-
const u = ce(), { components: e, groups: t, componentMap: l } = u.assets, a = qe({}),
|
87
|
+
const u = ce(), { components: e, groups: t, componentMap: l } = u.assets, a = qe({}), o = x(() => {
|
88
88
|
const m = {};
|
89
89
|
return t.value && t.value.forEach((f) => {
|
90
90
|
m[f.name] = f;
|
91
91
|
}), m;
|
92
|
-
}),
|
92
|
+
}), s = x(() => t.value ? t.value.map((m) => ({
|
93
93
|
label: `${m.label} (${m.count})`,
|
94
94
|
name: m.name,
|
95
95
|
disabled: !m.children?.length
|
96
|
-
})) : []), r = S(
|
96
|
+
})) : []), r = S(s.value[0]?.name), c = S(""), h = x(() => o.value[r.value]);
|
97
97
|
cl(() => {
|
98
|
-
const m =
|
98
|
+
const m = s.value.reduce(
|
99
99
|
(f, _) => (f[_.name] = uo(
|
100
|
-
|
100
|
+
o.value[_.name].children
|
101
101
|
), f),
|
102
102
|
{}
|
103
103
|
);
|
104
104
|
Object.assign(a, m);
|
105
105
|
}), M(
|
106
|
-
|
106
|
+
s,
|
107
107
|
(m) => {
|
108
108
|
m.length && !r.value && (r.value = m[0].name);
|
109
109
|
},
|
@@ -117,8 +117,8 @@ function co() {
|
|
117
117
|
components: e,
|
118
118
|
groups: t,
|
119
119
|
componentMap: l,
|
120
|
-
groupMap:
|
121
|
-
tabs:
|
120
|
+
groupMap: o,
|
121
|
+
tabs: s,
|
122
122
|
model: a,
|
123
123
|
currentTab: r,
|
124
124
|
currentGroup: h,
|
@@ -136,33 +136,33 @@ function me() {
|
|
136
136
|
};
|
137
137
|
}
|
138
138
|
function po(u, e, t, l, a) {
|
139
|
-
const
|
140
|
-
|
141
|
-
const
|
142
|
-
() => Vt("hover",
|
139
|
+
const o = ce();
|
140
|
+
o.simulator.init(u, e, t, l, a);
|
141
|
+
const s = x(() => o.simulator.designer.value), r = x(
|
142
|
+
() => Vt("hover", s.value?.hover.value)
|
143
143
|
), c = x(
|
144
|
-
() => Vt("dropping",
|
144
|
+
() => Vt("dropping", s.value?.dropping.value)
|
145
145
|
), h = x(
|
146
|
-
() => Vt("selected",
|
146
|
+
() => Vt("selected", s.value?.selected.value)
|
147
147
|
);
|
148
|
-
return M(
|
149
|
-
|
148
|
+
return M(o.changed, () => {
|
149
|
+
s.value?.updateRect();
|
150
150
|
}), {
|
151
|
-
designer:
|
151
|
+
designer: s,
|
152
152
|
dropping: c,
|
153
153
|
hover: r,
|
154
154
|
selected: h
|
155
155
|
};
|
156
156
|
}
|
157
157
|
function mo(u, e = !0) {
|
158
|
-
const { top: t, height: l, width: a, left:
|
158
|
+
const { top: t, height: l, width: a, left: o } = u || {};
|
159
159
|
if (l > 100 && a > 200)
|
160
160
|
return "inner";
|
161
|
-
let
|
162
|
-
return r = t > 30 ? "top" : "bottom",
|
161
|
+
let s, r;
|
162
|
+
return r = t > 30 ? "top" : "bottom", s = e || o < 300 && a < 300 ? "left" : "right", [s, r].join("-");
|
163
163
|
}
|
164
164
|
function vo(u) {
|
165
|
-
const { rect: e, type: t } = u, { left: l, width: a, top:
|
165
|
+
const { rect: e, type: t } = u, { left: l, width: a, top: o, height: s } = e, r = { left: l, width: a, top: o, height: s };
|
166
166
|
switch (t) {
|
167
167
|
case "left":
|
168
168
|
r.left = 0, r.width = 0;
|
@@ -181,16 +181,16 @@ function vo(u) {
|
|
181
181
|
}
|
182
182
|
function Vt(u, e) {
|
183
183
|
if (!e) return null;
|
184
|
-
const { left: t, top: l, width: a, height:
|
184
|
+
const { left: t, top: l, width: a, height: o } = u === "dropping" ? vo(e) : e.rect, s = {
|
185
185
|
left: `${t}px`,
|
186
186
|
top: `${l}px`,
|
187
187
|
width: `${a}px`,
|
188
|
-
height: `${
|
189
|
-
visibility: a ||
|
188
|
+
height: `${o}px`,
|
189
|
+
visibility: a || o ? "visible" : "hidden"
|
190
190
|
};
|
191
191
|
return {
|
192
192
|
...e,
|
193
|
-
style:
|
193
|
+
style: s,
|
194
194
|
position: mo(e.rect, u !== "selected")
|
195
195
|
};
|
196
196
|
}
|
@@ -206,10 +206,10 @@ function xe() {
|
|
206
206
|
};
|
207
207
|
}
|
208
208
|
function go(u, e) {
|
209
|
-
const t = S(""), { selected: l, isSelectBlock: a } = xe(),
|
209
|
+
const t = S(""), { selected: l, isSelectBlock: a } = xe(), o = x(() => l.value?.model.id), s = x(() => {
|
210
210
|
const c = Et(u), h = Et(e), p = [];
|
211
211
|
if (!c) return p;
|
212
|
-
const m = h?.__contextRefs[
|
212
|
+
const m = h?.__contextRefs[o.value || ""], _ = h === m || a.value ? [] : Object.keys(m?.context || {}).filter((O) => !["context", "ref"].includes(O)).map((O) => `this.context.${O}`);
|
213
213
|
_.length && p.push({ title: "上下文", items: _ });
|
214
214
|
const i = c.inject.map((O) => `this.${O.name}`);
|
215
215
|
i.length && p.push({ title: "注入", items: i });
|
@@ -234,9 +234,9 @@ function go(u, e) {
|
|
234
234
|
);
|
235
235
|
return $.length && p.push({ title: "refs", items: $ }), p;
|
236
236
|
}), r = x(() => {
|
237
|
-
if (!t.value) return
|
237
|
+
if (!t.value) return s.value;
|
238
238
|
const c = t.value.toLowerCase(), h = [];
|
239
|
-
return
|
239
|
+
return s.value.forEach((p) => {
|
240
240
|
const m = p.items.filter(
|
241
241
|
(f) => f.toLowerCase().includes(c)
|
242
242
|
);
|
@@ -248,7 +248,7 @@ function go(u, e) {
|
|
248
248
|
});
|
249
249
|
return {
|
250
250
|
keyword: t,
|
251
|
-
options:
|
251
|
+
options: s,
|
252
252
|
searchResult: r
|
253
253
|
};
|
254
254
|
}
|
@@ -298,21 +298,21 @@ function fo(u) {
|
|
298
298
|
setters: ot,
|
299
299
|
value: Array.isArray(t.value.children) ? "" : t.value.children
|
300
300
|
}
|
301
|
-
] : []),
|
301
|
+
] : []), o = x(() => {
|
302
302
|
if (!t.value) return [];
|
303
303
|
const m = l.value || e.assets.componentMap.get(t.value.name);
|
304
304
|
return m ? (m.props || []).map((_) => ({
|
305
305
|
..._,
|
306
306
|
value: t.value?.getPropValue(_.name) ?? _.defaultValue
|
307
307
|
})) : [];
|
308
|
-
}),
|
308
|
+
}), s = (m) => a.value.some((f) => f.name === m) || o.value.some((f) => f.name === m) || m === "style", r = x(() => t.value ? Object.keys(t.value.props).filter((m) => !s(m)).map((m) => ({
|
309
309
|
name: m,
|
310
310
|
setters: "InputSetter",
|
311
311
|
value: t.value?.getPropValue(m)
|
312
312
|
})) : []);
|
313
313
|
return {
|
314
314
|
commonProps: a,
|
315
|
-
componentProps:
|
315
|
+
componentProps: o,
|
316
316
|
customProps: r,
|
317
317
|
node: t,
|
318
318
|
change: (m, f) => {
|
@@ -324,7 +324,7 @@ function fo(u) {
|
|
324
324
|
removeCustom: (m) => {
|
325
325
|
t.value?.removeProp(m);
|
326
326
|
},
|
327
|
-
isExist:
|
327
|
+
isExist: s
|
328
328
|
};
|
329
329
|
}
|
330
330
|
function ae(u, e = "提示") {
|
@@ -334,21 +334,21 @@ function ae(u, e = "提示") {
|
|
334
334
|
});
|
335
335
|
}
|
336
336
|
async function He(u) {
|
337
|
-
return await
|
337
|
+
return await De.confirm(u, "提示", { type: "warning" }).catch(
|
338
338
|
() => !1
|
339
339
|
);
|
340
340
|
}
|
341
341
|
function de(u, e = "success") {
|
342
|
-
return
|
342
|
+
return Ie({
|
343
343
|
message: u,
|
344
344
|
type: e
|
345
345
|
});
|
346
346
|
}
|
347
347
|
function ho(u) {
|
348
348
|
const e = u ? { ...u } : {}, t = (l) => new Proxy(l || {}, {
|
349
|
-
get(a,
|
350
|
-
return typeof
|
351
|
-
} : t(a[
|
349
|
+
get(a, o) {
|
350
|
+
return typeof o == "symbol" ? () => {
|
351
|
+
} : t(a[o]);
|
352
352
|
}
|
353
353
|
});
|
354
354
|
return e.context = new Proxy(e.context || {}, {
|
@@ -362,10 +362,10 @@ function pe(u, e, t = !1) {
|
|
362
362
|
const a = ho(e);
|
363
363
|
try {
|
364
364
|
u.type === "JSExpression" ? Ze(u, a, t, !0) : aa(u, a, t, !0);
|
365
|
-
} catch (
|
365
|
+
} catch (o) {
|
366
366
|
l = !1, Ot.error({
|
367
367
|
title: "代码错误",
|
368
|
-
message:
|
368
|
+
message: o.message
|
369
369
|
});
|
370
370
|
}
|
371
371
|
return l;
|
@@ -380,9 +380,9 @@ function Yn() {
|
|
380
380
|
() => u.current.value ? u.history.value : null
|
381
381
|
), l = x(() => t.value?.items.length || 0), a = () => {
|
382
382
|
e.value?.cleanHelper(), t.value?.forward();
|
383
|
-
},
|
383
|
+
}, o = () => {
|
384
384
|
t.value?.backward(), e.value?.cleanHelper();
|
385
|
-
},
|
385
|
+
}, s = (h) => {
|
386
386
|
e.value?.cleanHelper(), t.value?.load(h), de("已载入历史记录", "success");
|
387
387
|
}, r = x(() => l.value <= 1 ? !0 : (t.value?.index || -1) <= 0), c = x(() => l.value <= 1 ? !0 : (t.value?.index || -1) >= l.value - 1);
|
388
388
|
return {
|
@@ -390,8 +390,8 @@ function Yn() {
|
|
390
390
|
history: t,
|
391
391
|
total: l,
|
392
392
|
forward: a,
|
393
|
-
backward:
|
394
|
-
load:
|
393
|
+
backward: o,
|
394
|
+
load: s,
|
395
395
|
forwardDisabled: r,
|
396
396
|
backwardDisabled: c
|
397
397
|
};
|
@@ -424,14 +424,14 @@ function yo(u) {
|
|
424
424
|
name: c,
|
425
425
|
event: r[c]
|
426
426
|
}));
|
427
|
-
}),
|
427
|
+
}), o = x(() => {
|
428
428
|
if (ne(t.value)) return [];
|
429
429
|
const r = t.value?.events || {};
|
430
430
|
return no.map((c) => ({
|
431
431
|
name: c,
|
432
432
|
event: r[c]
|
433
433
|
}));
|
434
|
-
}),
|
434
|
+
}), s = x(() => {
|
435
435
|
if (!t.value || ne(t.value)) return [];
|
436
436
|
const r = t.value.events || {};
|
437
437
|
return (l.value?.events || e.assets.componentMap.get(t.value.name)?.events || []).map((h) => {
|
@@ -444,8 +444,8 @@ function yo(u) {
|
|
444
444
|
});
|
445
445
|
return {
|
446
446
|
mouseEventList: a,
|
447
|
-
keyboardEventList:
|
448
|
-
componentEventList:
|
447
|
+
keyboardEventList: o,
|
448
|
+
componentEventList: s
|
449
449
|
};
|
450
450
|
}
|
451
451
|
const dn = (u, e) => new Bn({
|
@@ -462,7 +462,7 @@ function wo(u) {
|
|
462
462
|
const { props: e = [], events: t = [] } = u;
|
463
463
|
if (e.length && t.length) {
|
464
464
|
const l = t.filter((a) => (typeof a == "string" ? a : a.name).startsWith("update:")).map((a) => a = typeof a == "string" ? a : a.name);
|
465
|
-
return l.length ? e.filter((a) => l.some((
|
465
|
+
return l.length ? e.filter((a) => l.some((o) => o.endsWith(":" + a.name))) : [];
|
466
466
|
}
|
467
467
|
return [];
|
468
468
|
}
|
@@ -476,17 +476,17 @@ function ko(u) {
|
|
476
476
|
return (i ? wo(i) : []).map((b) => (t.value?.directives || []).find(
|
477
477
|
(k) => k.name === "vModel" && k.arg == b.name
|
478
478
|
) || _o(b.name));
|
479
|
-
}),
|
480
|
-
vIf:
|
481
|
-
vShow:
|
479
|
+
}), o = l("vIf"), s = l("vShow"), r = l("vBind"), c = l("vFor"), h = a(), p = {
|
480
|
+
vIf: o,
|
481
|
+
vShow: s,
|
482
482
|
vBind: r,
|
483
483
|
vFor: c
|
484
484
|
};
|
485
485
|
return {
|
486
486
|
engine: e,
|
487
487
|
node: t,
|
488
|
-
vIf:
|
489
|
-
vShow:
|
488
|
+
vIf: o,
|
489
|
+
vShow: s,
|
490
490
|
vBind: r,
|
491
491
|
vFor: c,
|
492
492
|
vModels: h,
|
@@ -528,14 +528,14 @@ function Gt() {
|
|
528
528
|
const { protocol: _, host: i, pathname: g } = location, k = `${_}//${i}${g}${l}` + "?redirect=" + encodeURIComponent(location.hash.substring(1));
|
529
529
|
location.href = `${t}/auth.html?r=${encodeURIComponent(k)}`;
|
530
530
|
}
|
531
|
-
},
|
531
|
+
}, o = async () => {
|
532
532
|
const _ = e?.getData()?.token;
|
533
533
|
if (_) {
|
534
534
|
const i = `${t}/api/open/user/${_}`, g = await Ne(i).catch(() => null);
|
535
535
|
return !!(g && g.data);
|
536
536
|
}
|
537
537
|
return !1;
|
538
|
-
},
|
538
|
+
}, s = async () => {
|
539
539
|
const _ = `${t}/api/open/templates`, i = e?.getData()?.token;
|
540
540
|
return (await Ne(_, { query: i ? { token: i } : {} }))?.data || [];
|
541
541
|
}, r = async (_) => {
|
@@ -557,8 +557,8 @@ function Gt() {
|
|
557
557
|
remote: t,
|
558
558
|
auth: l,
|
559
559
|
toRemoteAuth: a,
|
560
|
-
isLogined:
|
561
|
-
getTemplates:
|
560
|
+
isLogined: o,
|
561
|
+
getTemplates: s,
|
562
562
|
getTemplateDsl: h,
|
563
563
|
getDictOptions: p,
|
564
564
|
getTemplateCategories: () => p("TemplateCategory"),
|
@@ -582,26 +582,26 @@ function xo() {
|
|
582
582
|
toRemoteAuth: t,
|
583
583
|
isLogined: l,
|
584
584
|
getTemplates: a,
|
585
|
-
getTemplateDsl:
|
586
|
-
removeTemplate:
|
585
|
+
getTemplateDsl: o,
|
586
|
+
removeTemplate: s
|
587
587
|
} = Gt(), r = S([]), c = S(!1), h = async (f) => {
|
588
588
|
const _ = u.current.value, i = u.project.value;
|
589
589
|
if (!i) return;
|
590
590
|
if (!_) {
|
591
|
-
|
591
|
+
Ie.warning({
|
592
592
|
message: "设计区无文件,请先打开页面或区块"
|
593
593
|
});
|
594
594
|
return;
|
595
595
|
}
|
596
|
-
const g = await
|
596
|
+
const g = await o(f);
|
597
597
|
if (!g)
|
598
|
-
return await
|
598
|
+
return await De.alert("模板不可用,可能该模板没发布过版本", {
|
599
599
|
type: "error",
|
600
600
|
title: "提示"
|
601
601
|
});
|
602
602
|
const b = _.toDsl(), { id: k, name: C } = b, D = { ...g, id: k, name: C }, $ = i.currentFile;
|
603
603
|
u.onSaveBlockFileFinish(() => {
|
604
|
-
_.update(D),
|
604
|
+
_.update(D), Ie.success({
|
605
605
|
message: "模板已加载完成"
|
606
606
|
});
|
607
607
|
}), $ && ($.market = {
|
@@ -623,9 +623,9 @@ function xo() {
|
|
623
623
|
toRemoteAuth: t,
|
624
624
|
isLogined: l,
|
625
625
|
getTemplates: a,
|
626
|
-
getTemplateDsl:
|
626
|
+
getTemplateDsl: o,
|
627
627
|
installTemplate: h,
|
628
|
-
removeTemplate:
|
628
|
+
removeTemplate: s,
|
629
629
|
groups: p,
|
630
630
|
access: e,
|
631
631
|
refreshTemplates: m,
|
@@ -645,7 +645,7 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
645
645
|
const { engine: e } = me(), t = u, l = x(() => t.icon || e.project.value?.config?.logo || Co), a = () => {
|
646
646
|
t.link && (location.href = t.link);
|
647
647
|
};
|
648
|
-
return (
|
648
|
+
return (o, s) => (d(), j("div", {
|
649
649
|
class: "v-logo-widget",
|
650
650
|
onClick: a
|
651
651
|
}, [
|
@@ -669,23 +669,23 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
669
669
|
__name: "index",
|
670
670
|
emits: ["click"],
|
671
671
|
setup(u, { emit: e }) {
|
672
|
-
const t = e, { engine: l } = me(), a = x(() => l.project.value?.config?.title || l.project.value?.name),
|
672
|
+
const t = e, { engine: l } = me(), a = x(() => l.project.value?.config?.title || l.project.value?.name), o = x(() => l.project.value?.currentFile?.title), s = () => {
|
673
673
|
t("click", l.project.value);
|
674
674
|
};
|
675
675
|
return (r, c) => (d(), j("div", Io, [
|
676
676
|
v(n(re), {
|
677
677
|
size: "small",
|
678
678
|
round: "",
|
679
|
-
onClick:
|
679
|
+
onClick: s
|
680
680
|
}, {
|
681
681
|
default: y(() => [
|
682
682
|
v(n(va), { class: "v-switcher-widget__back" }),
|
683
683
|
V("span", null, L(a.value), 1),
|
684
|
-
|
684
|
+
o.value ? (d(), w(n(zt), {
|
685
685
|
key: 0,
|
686
686
|
direction: "vertical"
|
687
687
|
})) : A("", !0),
|
688
|
-
|
688
|
+
o.value ? (d(), j("span", Po, L(o.value), 1)) : A("", !0)
|
689
689
|
]),
|
690
690
|
_: 1
|
691
691
|
})
|
@@ -699,7 +699,7 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
699
699
|
preview: { type: Boolean }
|
700
700
|
},
|
701
701
|
setup(u, { expose: e }) {
|
702
|
-
const t = u, { forward: l, backward: a, forwardDisabled:
|
702
|
+
const t = u, { forward: l, backward: a, forwardDisabled: o, backwardDisabled: s } = Yn(), r = S("pc");
|
703
703
|
return e({
|
704
704
|
mode: r
|
705
705
|
}), (c, h) => (d(), j("div", $o, [
|
@@ -746,7 +746,7 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
746
746
|
type: "default",
|
747
747
|
size: "small",
|
748
748
|
onClick: n(a),
|
749
|
-
disabled: n(
|
749
|
+
disabled: n(s) || !!t.preview
|
750
750
|
}, {
|
751
751
|
default: y(() => [
|
752
752
|
v(n(ba))
|
@@ -757,7 +757,7 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
757
757
|
type: "default",
|
758
758
|
size: "small",
|
759
759
|
onClick: n(l),
|
760
|
-
disabled: n(
|
760
|
+
disabled: n(o) || !!t.preview
|
761
761
|
}, {
|
762
762
|
default: y(() => [
|
763
763
|
v(n(ya))
|
@@ -779,21 +779,25 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
779
779
|
dsl: {}
|
780
780
|
},
|
781
781
|
setup(u) {
|
782
|
-
const e = u, { getTemplateCategories: t, publishTemplate: l, getTemplateById: a, engine:
|
782
|
+
const e = u, { getTemplateCategories: t, publishTemplate: l, getTemplateById: a, engine: o } = Gt(), s = qe({
|
783
783
|
name: e.name,
|
784
784
|
label: e.label,
|
785
785
|
share: !0
|
786
786
|
}), r = S(!1);
|
787
787
|
e.id && a(e.id).then((p) => {
|
788
|
-
p && Object.assign(
|
788
|
+
p && Object.assign(s, {
|
789
789
|
category: p.category,
|
790
790
|
version: p.latest
|
791
791
|
}), r.value = !!p;
|
792
792
|
});
|
793
793
|
const c = x(() => e.canvas ? e.canvas.toDataURL("image/png") : null), h = async () => {
|
794
|
+
if (!c.value)
|
795
|
+
return await De.alert("截图失败,无法完成发布", {
|
796
|
+
type: "error"
|
797
|
+
}), !1;
|
794
798
|
const p = zl(c.value), { dsl: m, id: f } = e;
|
795
799
|
let _;
|
796
|
-
r.value && (_ = await
|
800
|
+
r.value && (_ = await De.confirm(
|
797
801
|
"该模板已存在,请确认您的操作是更新模板还是新建",
|
798
802
|
{
|
799
803
|
type: "warning",
|
@@ -809,20 +813,20 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
809
813
|
cover: p,
|
810
814
|
category: "",
|
811
815
|
version: "",
|
812
|
-
...
|
813
|
-
}, g = await l(i).catch((b) => (
|
816
|
+
...s
|
817
|
+
}, g = await l(i).catch((b) => (Ie.error({
|
814
818
|
message: b.message || b || "未知错误"
|
815
819
|
}), !1));
|
816
|
-
return g && (
|
820
|
+
return g && (Ie.success({
|
817
821
|
message: "发布模板成功!"
|
818
|
-
}),
|
822
|
+
}), o.skeleton?.getWidget("Templates")?.widgetRef.refreshTemplates()), !!g;
|
819
823
|
};
|
820
824
|
return (p, m) => (d(), w(n(Ae), {
|
821
825
|
width: "600px",
|
822
826
|
height: "760px",
|
823
827
|
icon: n(Ut),
|
824
828
|
title: "发布到模板",
|
825
|
-
model:
|
829
|
+
model: s,
|
826
830
|
"submit-method": h
|
827
831
|
}, {
|
828
832
|
default: y(() => [
|
@@ -888,7 +892,7 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
888
892
|
for (const [l, a] of e)
|
889
893
|
t[l] = a;
|
890
894
|
return t;
|
891
|
-
}, zo = /* @__PURE__ */ Kt(Oo, [["__scopeId", "data-v-
|
895
|
+
}, zo = /* @__PURE__ */ Kt(Oo, [["__scopeId", "data-v-757420d0"]]), Fo = { class: "v-actions-widget" }, Lo = /* @__PURE__ */ E({
|
892
896
|
name: "ActionsWidget",
|
893
897
|
inheritAttrs: !1,
|
894
898
|
__name: "index",
|
@@ -896,18 +900,18 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
896
900
|
coder: { type: Boolean, default: !0 }
|
897
901
|
},
|
898
902
|
setup(u) {
|
899
|
-
const { engine: e, designer: t } = xe(), { isLogined: l, toRemoteAuth: a } = Gt(),
|
900
|
-
e.current.value ? (
|
903
|
+
const { engine: e, designer: t } = xe(), { isLogined: l, toRemoteAuth: a } = Gt(), o = S(!1), s = S(!1), r = S(), c = () => {
|
904
|
+
e.current.value ? (o.value ? e.skeleton?.getWidget("Previewer")?.widgetRef.refresh() : (t.value?.setSelected(null), e.simulator.refresh()), de("刷新完成", "success")) : de("请先打开文件", "warning");
|
901
905
|
}, h = async () => {
|
902
|
-
e.current.value ? (
|
906
|
+
e.current.value ? (o.value && (e.skeleton?.closePreview(), o.value = !1, await Mt(1e3)), t.value?.setSelected(e.current.value)) : de("请先打开文件", "warning");
|
903
907
|
}, p = () => {
|
904
908
|
if (e.project.value)
|
905
909
|
if (e.current.value) {
|
906
|
-
if (
|
907
|
-
e.skeleton?.closePreview(),
|
910
|
+
if (o.value) {
|
911
|
+
e.skeleton?.closePreview(), o.value = !1;
|
908
912
|
return;
|
909
913
|
}
|
910
|
-
e.skeleton?.openPreview(""),
|
914
|
+
e.skeleton?.openPreview(""), o.value = !0;
|
911
915
|
} else
|
912
916
|
de("请先打开文件", "warning");
|
913
917
|
}, m = () => {
|
@@ -929,9 +933,9 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
929
933
|
name: b,
|
930
934
|
label: k,
|
931
935
|
dsl: e.current.value?.toDsl()
|
932
|
-
},
|
936
|
+
}, s.value = !0;
|
933
937
|
} else
|
934
|
-
await
|
938
|
+
await De.confirm(
|
935
939
|
"发布到模板需登录系统,您还没登录或登录已过期,请重新登录!",
|
936
940
|
"提示",
|
937
941
|
{
|
@@ -961,7 +965,7 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
961
965
|
A("", !0),
|
962
966
|
v(n(re), {
|
963
967
|
onClick: p,
|
964
|
-
type:
|
968
|
+
type: o.value ? "warning" : "default",
|
965
969
|
size: "small",
|
966
970
|
title: "预览"
|
967
971
|
}, {
|
@@ -1040,10 +1044,10 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
1040
1044
|
]),
|
1041
1045
|
_: 1
|
1042
1046
|
}),
|
1043
|
-
|
1047
|
+
s.value ? (d(), w(zo, ue({
|
1044
1048
|
key: 2,
|
1045
|
-
modelValue:
|
1046
|
-
"onUpdate:modelValue": g[0] || (g[0] = (b) =>
|
1049
|
+
modelValue: s.value,
|
1050
|
+
"onUpdate:modelValue": g[0] || (g[0] = (b) => s.value = b)
|
1047
1051
|
}, r.value), null, 16, ["modelValue"])) : A("", !0)
|
1048
1052
|
]));
|
1049
1053
|
}
|
@@ -1051,7 +1055,7 @@ const Co = "data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!
|
|
1051
1055
|
function Xt(u) {
|
1052
1056
|
return pl() ? (ml(u), !0) : !1;
|
1053
1057
|
}
|
1054
|
-
function
|
1058
|
+
function Be(u) {
|
1055
1059
|
return typeof u == "function" ? u() : n(u);
|
1056
1060
|
}
|
1057
1061
|
const kt = typeof window < "u" && typeof document < "u";
|
@@ -1082,17 +1086,17 @@ function Go(u, e, t = {}) {
|
|
1082
1086
|
const {
|
1083
1087
|
immediate: l = !0
|
1084
1088
|
} = t, a = S(!1);
|
1085
|
-
let
|
1086
|
-
function
|
1087
|
-
|
1089
|
+
let o = null;
|
1090
|
+
function s() {
|
1091
|
+
o && (clearTimeout(o), o = null);
|
1088
1092
|
}
|
1089
1093
|
function r() {
|
1090
|
-
a.value = !1,
|
1094
|
+
a.value = !1, s();
|
1091
1095
|
}
|
1092
1096
|
function c(...h) {
|
1093
|
-
|
1094
|
-
a.value = !1,
|
1095
|
-
},
|
1097
|
+
s(), a.value = !0, o = setTimeout(() => {
|
1098
|
+
a.value = !1, o = null, u(...h);
|
1099
|
+
}, Be(e));
|
1096
1100
|
}
|
1097
1101
|
return l && (a.value = !0, kt && c()), Xt(r), {
|
1098
1102
|
isPending: dl(a),
|
@@ -1103,7 +1107,7 @@ function Go(u, e, t = {}) {
|
|
1103
1107
|
const St = kt ? window : void 0, Zn = kt ? window.navigator : void 0;
|
1104
1108
|
function Se(u) {
|
1105
1109
|
var e;
|
1106
|
-
const t =
|
1110
|
+
const t = Be(u);
|
1107
1111
|
return (e = t?.$el) != null ? e : t;
|
1108
1112
|
}
|
1109
1113
|
function Xe(...u) {
|
@@ -1111,32 +1115,32 @@ function Xe(...u) {
|
|
1111
1115
|
if (typeof u[0] == "string" || Array.isArray(u[0]) ? ([t, l, a] = u, e = St) : [e, t, l, a] = u, !e)
|
1112
1116
|
return dt;
|
1113
1117
|
Array.isArray(t) || (t = [t]), Array.isArray(l) || (l = [l]);
|
1114
|
-
const
|
1115
|
-
|
1118
|
+
const o = [], s = () => {
|
1119
|
+
o.forEach((p) => p()), o.length = 0;
|
1116
1120
|
}, r = (p, m, f, _) => (p.addEventListener(m, f, _), () => p.removeEventListener(m, f, _)), c = M(
|
1117
|
-
() => [Se(e),
|
1121
|
+
() => [Se(e), Be(a)],
|
1118
1122
|
([p, m]) => {
|
1119
|
-
if (
|
1123
|
+
if (s(), !p)
|
1120
1124
|
return;
|
1121
1125
|
const f = No(m) ? { ...m } : m;
|
1122
|
-
|
1126
|
+
o.push(
|
1123
1127
|
...t.flatMap((_) => l.map((i) => r(p, _, i, f)))
|
1124
1128
|
);
|
1125
1129
|
},
|
1126
1130
|
{ immediate: !0, flush: "post" }
|
1127
1131
|
), h = () => {
|
1128
|
-
c(),
|
1132
|
+
c(), s();
|
1129
1133
|
};
|
1130
1134
|
return Xt(h), h;
|
1131
1135
|
}
|
1132
1136
|
let pn = !1;
|
1133
1137
|
function Ko(u, e, t = {}) {
|
1134
|
-
const { window: l = St, ignore: a = [], capture:
|
1138
|
+
const { window: l = St, ignore: a = [], capture: o = !0, detectIframe: s = !1 } = t;
|
1135
1139
|
if (!l)
|
1136
1140
|
return dt;
|
1137
1141
|
Mo && !pn && (pn = !0, Array.from(l.document.body.children).forEach((g) => g.addEventListener("click", dt)), l.document.documentElement.addEventListener("click", dt));
|
1138
1142
|
let r = !0;
|
1139
|
-
const c = (g) =>
|
1143
|
+
const c = (g) => Be(a).some((b) => {
|
1140
1144
|
if (typeof b == "string")
|
1141
1145
|
return Array.from(l.document.querySelectorAll(b)).some((k) => k === g.target || g.composedPath().includes(k));
|
1142
1146
|
{
|
@@ -1145,11 +1149,11 @@ function Ko(u, e, t = {}) {
|
|
1145
1149
|
}
|
1146
1150
|
});
|
1147
1151
|
function h(g) {
|
1148
|
-
const b =
|
1152
|
+
const b = Be(g);
|
1149
1153
|
return b && b.$.subTree.shapeFlag === 16;
|
1150
1154
|
}
|
1151
1155
|
function p(g, b) {
|
1152
|
-
const k =
|
1156
|
+
const k = Be(g), C = k.$.subTree && k.$.subTree.children;
|
1153
1157
|
return C == null || !Array.isArray(C) ? !1 : C.some((D) => D.el === b.target || b.composedPath().includes(D.el));
|
1154
1158
|
}
|
1155
1159
|
const m = (g) => {
|
@@ -1168,12 +1172,12 @@ function Ko(u, e, t = {}) {
|
|
1168
1172
|
f || (f = !0, setTimeout(() => {
|
1169
1173
|
f = !1;
|
1170
1174
|
}, 0), m(g));
|
1171
|
-
}, { passive: !0, capture:
|
1175
|
+
}, { passive: !0, capture: o }),
|
1172
1176
|
Xe(l, "pointerdown", (g) => {
|
1173
1177
|
const b = Se(u);
|
1174
1178
|
r = !c(g) && !!(b && !g.composedPath().includes(b));
|
1175
1179
|
}, { passive: !0 }),
|
1176
|
-
|
1180
|
+
s && Xe(l, "blur", (g) => {
|
1177
1181
|
setTimeout(() => {
|
1178
1182
|
var b;
|
1179
1183
|
const k = Se(u);
|
@@ -1197,23 +1201,23 @@ function mn(u, e = {}) {
|
|
1197
1201
|
const {
|
1198
1202
|
controls: t = !1,
|
1199
1203
|
navigator: l = Zn
|
1200
|
-
} = e, a = Qt(() => l && "permissions" in l),
|
1204
|
+
} = e, a = Qt(() => l && "permissions" in l), o = Qe(), s = typeof u == "string" ? { name: u } : u, r = Qe(), c = () => {
|
1201
1205
|
var p, m;
|
1202
|
-
r.value = (m = (p =
|
1206
|
+
r.value = (m = (p = o.value) == null ? void 0 : p.state) != null ? m : "prompt";
|
1203
1207
|
};
|
1204
|
-
Xe(
|
1208
|
+
Xe(o, "change", c);
|
1205
1209
|
const h = Uo(async () => {
|
1206
1210
|
if (a.value) {
|
1207
|
-
if (!
|
1211
|
+
if (!o.value)
|
1208
1212
|
try {
|
1209
|
-
|
1213
|
+
o.value = await l.permissions.query(s);
|
1210
1214
|
} catch {
|
1211
|
-
|
1215
|
+
o.value = void 0;
|
1212
1216
|
} finally {
|
1213
1217
|
c();
|
1214
1218
|
}
|
1215
1219
|
if (t)
|
1216
|
-
return hn(
|
1220
|
+
return hn(o.value);
|
1217
1221
|
}
|
1218
1222
|
});
|
1219
1223
|
return h(), t ? {
|
@@ -1228,16 +1232,16 @@ function el(u = {}) {
|
|
1228
1232
|
read: t = !1,
|
1229
1233
|
source: l,
|
1230
1234
|
copiedDuring: a = 1500,
|
1231
|
-
legacy:
|
1232
|
-
} = u,
|
1235
|
+
legacy: o = !1
|
1236
|
+
} = u, s = Qt(() => e && "clipboard" in e), r = mn("clipboard-read"), c = mn("clipboard-write"), h = x(() => s.value || o), p = S(""), m = S(!1), f = Go(() => m.value = !1, a);
|
1233
1237
|
function _() {
|
1234
|
-
|
1238
|
+
s.value && k(r.value) ? e.clipboard.readText().then((C) => {
|
1235
1239
|
p.value = C;
|
1236
1240
|
}) : p.value = b();
|
1237
1241
|
}
|
1238
1242
|
h.value && t && Xe(["copy", "cut"], _);
|
1239
|
-
async function i(C =
|
1240
|
-
h.value && C != null && (
|
1243
|
+
async function i(C = Be(l)) {
|
1244
|
+
h.value && C != null && (s.value && k(c.value) ? await e.clipboard.writeText(C) : g(C), p.value = C, m.value = !0, f.start());
|
1241
1245
|
}
|
1242
1246
|
function g(C) {
|
1243
1247
|
const D = document.createElement("textarea");
|
@@ -1259,19 +1263,19 @@ function el(u = {}) {
|
|
1259
1263
|
}
|
1260
1264
|
function Qo(u, e, t = {}) {
|
1261
1265
|
const { window: l = St, ...a } = t;
|
1262
|
-
let
|
1263
|
-
const
|
1264
|
-
|
1266
|
+
let o;
|
1267
|
+
const s = Qt(() => l && "ResizeObserver" in l), r = () => {
|
1268
|
+
o && (o.disconnect(), o = void 0);
|
1265
1269
|
}, c = x(() => {
|
1266
|
-
const m =
|
1270
|
+
const m = Be(u);
|
1267
1271
|
return Array.isArray(m) ? m.map((f) => Se(f)) : [Se(m)];
|
1268
1272
|
}), h = M(
|
1269
1273
|
c,
|
1270
1274
|
(m) => {
|
1271
|
-
if (r(),
|
1272
|
-
|
1275
|
+
if (r(), s.value && l) {
|
1276
|
+
o = new ResizeObserver(e);
|
1273
1277
|
for (const f of m)
|
1274
|
-
f &&
|
1278
|
+
f && o.observe(f, a);
|
1275
1279
|
}
|
1276
1280
|
},
|
1277
1281
|
{ immediate: !0, flush: "post" }
|
@@ -1279,47 +1283,47 @@ function Qo(u, e, t = {}) {
|
|
1279
1283
|
r(), h();
|
1280
1284
|
};
|
1281
1285
|
return Xt(p), {
|
1282
|
-
isSupported:
|
1286
|
+
isSupported: s,
|
1283
1287
|
stop: p
|
1284
1288
|
};
|
1285
1289
|
}
|
1286
1290
|
function tt(u, e = { width: 0, height: 0 }, t = {}) {
|
1287
|
-
const { window: l = St, box: a = "content-box" } = t,
|
1291
|
+
const { window: l = St, box: a = "content-box" } = t, o = x(() => {
|
1288
1292
|
var m, f;
|
1289
1293
|
return (f = (m = Se(u)) == null ? void 0 : m.namespaceURI) == null ? void 0 : f.includes("svg");
|
1290
|
-
}),
|
1294
|
+
}), s = S(e.width), r = S(e.height), { stop: c } = Qo(
|
1291
1295
|
u,
|
1292
1296
|
([m]) => {
|
1293
1297
|
const f = a === "border-box" ? m.borderBoxSize : a === "content-box" ? m.contentBoxSize : m.devicePixelContentBoxSize;
|
1294
|
-
if (l &&
|
1298
|
+
if (l && o.value) {
|
1295
1299
|
const _ = Se(u);
|
1296
1300
|
if (_) {
|
1297
1301
|
const i = _.getBoundingClientRect();
|
1298
|
-
|
1302
|
+
s.value = i.width, r.value = i.height;
|
1299
1303
|
}
|
1300
1304
|
} else if (f) {
|
1301
1305
|
const _ = Array.isArray(f) ? f : [f];
|
1302
|
-
|
1306
|
+
s.value = _.reduce((i, { inlineSize: g }) => i + g, 0), r.value = _.reduce((i, { blockSize: g }) => i + g, 0);
|
1303
1307
|
} else
|
1304
|
-
|
1308
|
+
s.value = m.contentRect.width, r.value = m.contentRect.height;
|
1305
1309
|
},
|
1306
1310
|
t
|
1307
1311
|
);
|
1308
1312
|
Ho(() => {
|
1309
1313
|
const m = Se(u);
|
1310
|
-
m && (
|
1314
|
+
m && (s.value = "offsetWidth" in m ? m.offsetWidth : e.width, r.value = "offsetHeight" in m ? m.offsetHeight : e.height);
|
1311
1315
|
});
|
1312
1316
|
const h = M(
|
1313
1317
|
() => Se(u),
|
1314
1318
|
(m) => {
|
1315
|
-
|
1319
|
+
s.value = m ? e.width : 0, r.value = m ? e.height : 0;
|
1316
1320
|
}
|
1317
1321
|
);
|
1318
1322
|
function p() {
|
1319
1323
|
c(), h();
|
1320
1324
|
}
|
1321
1325
|
return {
|
1322
|
-
width:
|
1326
|
+
width: s,
|
1323
1327
|
height: r,
|
1324
1328
|
stop: p
|
1325
1329
|
};
|
@@ -1333,17 +1337,17 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1333
1337
|
},
|
1334
1338
|
emits: ["change", "update:modelValue"],
|
1335
1339
|
setup(u, { emit: e }) {
|
1336
|
-
const t = u, l = e, a = S(!1),
|
1340
|
+
const t = u, l = e, a = S(!1), o = S(t.modelValue), s = S(""), r = x(
|
1337
1341
|
() => Bt[t.modelValue] || t.modelValue
|
1338
1342
|
), c = x(() => {
|
1339
1343
|
const _ = Object.entries(Bt);
|
1340
|
-
return
|
1344
|
+
return s.value ? _.filter((i) => i[0].toLowerCase().includes(s.value)) : _;
|
1341
1345
|
}), h = (_) => {
|
1342
|
-
|
1346
|
+
o.value = _;
|
1343
1347
|
}, p = () => {
|
1344
|
-
l("change",
|
1348
|
+
l("change", o.value), l("update:modelValue", o.value), a.value = !1;
|
1345
1349
|
}, m = () => {
|
1346
|
-
|
1350
|
+
o.value = "", l("change", ""), l("update:modelValue", ""), a.value = !1;
|
1347
1351
|
}, f = () => {
|
1348
1352
|
a.value = !0;
|
1349
1353
|
};
|
@@ -1391,15 +1395,15 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1391
1395
|
size: t.size,
|
1392
1396
|
"prefix-icon": n(nt),
|
1393
1397
|
clearable: "",
|
1394
|
-
modelValue:
|
1395
|
-
"onUpdate:modelValue": i[0] || (i[0] = (g) =>
|
1398
|
+
modelValue: s.value,
|
1399
|
+
"onUpdate:modelValue": i[0] || (i[0] = (g) => s.value = g),
|
1396
1400
|
placeholder: "请输入查询关键字"
|
1397
1401
|
}, null, 8, ["size", "prefix-icon", "modelValue"]),
|
1398
1402
|
V("div", er, [
|
1399
1403
|
(d(!0), j(z, null, W(c.value, (g) => (d(), w(n(Re), {
|
1400
1404
|
icon: g[1],
|
1401
1405
|
onClick: (b) => h(g[0]),
|
1402
|
-
class: K({ "is-active":
|
1406
|
+
class: K({ "is-active": o.value === g[0] })
|
1403
1407
|
}, null, 8, ["icon", "onClick", "class"]))), 256)),
|
1404
1408
|
c.value.length === 0 ? (d(), w(n(ie), { key: 0 })) : A("", !0)
|
1405
1409
|
])
|
@@ -1429,7 +1433,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1429
1433
|
parentId: {}
|
1430
1434
|
},
|
1431
1435
|
setup(u) {
|
1432
|
-
const e = u, { project: t, engine: l } = We(), { designer: a } = xe(),
|
1436
|
+
const e = u, { project: t, engine: l } = We(), { designer: a } = xe(), o = x(() => e.item ? "编辑页面" : "新增页面"), s = () => ({
|
1433
1437
|
dir: !1,
|
1434
1438
|
name: "",
|
1435
1439
|
title: "",
|
@@ -1439,7 +1443,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1439
1443
|
raw: !1,
|
1440
1444
|
prue: !1,
|
1441
1445
|
meta: null
|
1442
|
-
}), r = S(e.item ||
|
1446
|
+
}), r = S(e.item || s()), c = x({
|
1443
1447
|
get() {
|
1444
1448
|
return JSON.stringify(r.value.meta || {}, null, 4);
|
1445
1449
|
},
|
@@ -1456,12 +1460,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1456
1460
|
], p = (i) => {
|
1457
1461
|
r.value && (r.value.name = $n(i));
|
1458
1462
|
}, m = async (i) => t.value?.existPageName(i.name, [i.id]) ? (ae("页面名称已存在,请更换"), !1) : (e.item ? (t.value?.updatePage(i), a.value?.setSelected(null), l.simulator.refresh()) : t.value?.createPage(i, e.parentId), !0), { copy: f } = el({}), _ = (i) => {
|
1459
|
-
f(i),
|
1463
|
+
f(i), Ie.success({
|
1460
1464
|
message: "已经复制到粘贴板"
|
1461
1465
|
});
|
1462
1466
|
};
|
1463
1467
|
return (i, g) => (d(), w(n(Ae), {
|
1464
|
-
title:
|
1468
|
+
title: o.value,
|
1465
1469
|
width: "800px",
|
1466
1470
|
height: "650px",
|
1467
1471
|
"form-props": { tooltipMessage: !1 },
|
@@ -1590,21 +1594,21 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1590
1594
|
const t = u, l = e, a = x(() => ({
|
1591
1595
|
"is-active": t.active,
|
1592
1596
|
"is-open": t.open
|
1593
|
-
})),
|
1597
|
+
})), o = () => {
|
1594
1598
|
l("click");
|
1595
1599
|
};
|
1596
|
-
return (
|
1600
|
+
return (s, r) => (d(), w(n(jn), {
|
1597
1601
|
effect: "dark",
|
1598
1602
|
placement: "right",
|
1599
|
-
content:
|
1603
|
+
content: s.label,
|
1600
1604
|
"show-after": 600
|
1601
1605
|
}, {
|
1602
1606
|
default: y(() => [
|
1603
1607
|
V("div", {
|
1604
1608
|
class: K(["v-apps-region__icon", a.value]),
|
1605
|
-
onClick:
|
1609
|
+
onClick: o
|
1606
1610
|
}, [
|
1607
|
-
(d(), w(bn(
|
1611
|
+
(d(), w(bn(s.icon)))
|
1608
1612
|
], 2)
|
1609
1613
|
]),
|
1610
1614
|
_: 1
|
@@ -1636,9 +1640,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1636
1640
|
"command"
|
1637
1641
|
],
|
1638
1642
|
setup(u, { emit: e }) {
|
1639
|
-
const t = u, l = e, a = S(!1),
|
1643
|
+
const t = u, l = e, a = S(!1), o = x(() => ({
|
1640
1644
|
"is-collapsed": !!a.value
|
1641
|
-
})),
|
1645
|
+
})), s = () => {
|
1642
1646
|
l("refresh");
|
1643
1647
|
}, r = () => {
|
1644
1648
|
l("plus");
|
@@ -1664,7 +1668,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1664
1668
|
a.value = g;
|
1665
1669
|
};
|
1666
1670
|
return (g, b) => (d(), w(n(bt), {
|
1667
|
-
class: K(["v-panel",
|
1671
|
+
class: K(["v-panel", o.value]),
|
1668
1672
|
border: !1,
|
1669
1673
|
header: _.value,
|
1670
1674
|
fit: ""
|
@@ -1677,7 +1681,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1677
1681
|
icon: n(zn),
|
1678
1682
|
background: "hover",
|
1679
1683
|
title: "刷新",
|
1680
|
-
onClick:
|
1684
|
+
onClick: s
|
1681
1685
|
}, null, 8, ["size", "icon"])) : A("", !0),
|
1682
1686
|
t.plus ? (d(), w(n(ge), {
|
1683
1687
|
key: 1,
|
@@ -1786,9 +1790,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1786
1790
|
a.value = c;
|
1787
1791
|
}
|
1788
1792
|
);
|
1789
|
-
const
|
1793
|
+
const o = (c) => {
|
1790
1794
|
l("command", c);
|
1791
|
-
},
|
1795
|
+
}, s = (c) => {
|
1792
1796
|
l("remove", c);
|
1793
1797
|
}, r = (c) => {
|
1794
1798
|
l("action-click", c);
|
@@ -1807,7 +1811,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1807
1811
|
type: "card",
|
1808
1812
|
modelValue: a.value,
|
1809
1813
|
"onUpdate:modelValue": h[0] || (h[0] = (p) => a.value = p),
|
1810
|
-
onTabRemove:
|
1814
|
+
onTabRemove: s,
|
1811
1815
|
onActionClick: r,
|
1812
1816
|
stretch: t.stretch
|
1813
1817
|
}, null, 8, ["items", "modelValue", "stretch"]),
|
@@ -1823,7 +1827,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1823
1827
|
placement: "bottom-end"
|
1824
1828
|
},
|
1825
1829
|
menus: t.menus,
|
1826
|
-
onCommand:
|
1830
|
+
onCommand: o
|
1827
1831
|
}, {
|
1828
1832
|
item: y(({ item: p }) => [
|
1829
1833
|
V("span", null, [
|
@@ -1920,7 +1924,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1920
1924
|
divided: !0,
|
1921
1925
|
icon: Hn
|
1922
1926
|
}
|
1923
|
-
}, l = u, a = e,
|
1927
|
+
}, l = u, a = e, o = S(!!l.modelValue), s = x(() => l.actionInMore ? [] : l.actions.map((f) => {
|
1924
1928
|
const _ = t[f];
|
1925
1929
|
return {
|
1926
1930
|
name: f,
|
@@ -1941,7 +1945,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1941
1945
|
})), h = () => {
|
1942
1946
|
a("click", l.modelValue);
|
1943
1947
|
}, p = async (f) => {
|
1944
|
-
f === "remove" ? await
|
1948
|
+
f === "remove" ? await De.confirm("确定删除吗?", "提示", {
|
1945
1949
|
type: "warning"
|
1946
1950
|
}).catch(() => !1) && a("action", {
|
1947
1951
|
name: f,
|
@@ -1953,12 +1957,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
1953
1957
|
}, m = (f) => {
|
1954
1958
|
p(f.command);
|
1955
1959
|
};
|
1956
|
-
return M(
|
1960
|
+
return M(o, (f) => {
|
1957
1961
|
a("update:modelValue", f), a("switch", f);
|
1958
1962
|
}), M(
|
1959
1963
|
() => l.modelValue,
|
1960
1964
|
(f) => {
|
1961
|
-
|
1965
|
+
o.value = !!f;
|
1962
1966
|
}
|
1963
1967
|
), (f, _) => (d(), w(n(q), {
|
1964
1968
|
class: K(["v-item", c.value]),
|
@@ -2010,7 +2014,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2010
2014
|
}, ["stop"]))
|
2011
2015
|
}, {
|
2012
2016
|
default: y(() => [
|
2013
|
-
(d(!0), j(z, null, W(
|
2017
|
+
(d(!0), j(z, null, W(s.value, (i) => (d(), w(n(ge), {
|
2014
2018
|
name: i.name,
|
2015
2019
|
title: i.label,
|
2016
2020
|
mode: "icon",
|
@@ -2022,8 +2026,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2022
2026
|
}, null, 8, ["name", "title", "icon", "onClick"]))), 256)),
|
2023
2027
|
l.switch ? (d(), w(n(Dn), {
|
2024
2028
|
key: 0,
|
2025
|
-
modelValue:
|
2026
|
-
"onUpdate:modelValue": _[0] || (_[0] = (i) =>
|
2029
|
+
modelValue: o.value,
|
2030
|
+
"onUpdate:modelValue": _[0] || (_[0] = (i) => o.value = i),
|
2027
2031
|
class: "v-item__switch",
|
2028
2032
|
size: "small"
|
2029
2033
|
}, null, 8, ["modelValue"])) : A("", !0),
|
@@ -2079,16 +2083,16 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2079
2083
|
command: "remove",
|
2080
2084
|
icon: wt
|
2081
2085
|
}
|
2082
|
-
],
|
2086
|
+
], o = () => {
|
2083
2087
|
l("edit");
|
2084
|
-
},
|
2088
|
+
}, s = () => {
|
2085
2089
|
l("copy");
|
2086
2090
|
}, r = async () => {
|
2087
|
-
await
|
2091
|
+
await De.confirm("确认删除?", "提示", {
|
2088
2092
|
type: "warning"
|
2089
2093
|
}).catch(() => !1) && l("remove");
|
2090
2094
|
}, c = (f) => {
|
2091
|
-
f.command === "edit" &&
|
2095
|
+
f.command === "edit" && o(), f.command === "remove" && r(), f.command === "copy" && s();
|
2092
2096
|
}, h = x(() => ({
|
2093
2097
|
"is-active": t.active,
|
2094
2098
|
"is-draggable": t.draggable
|
@@ -2149,10 +2153,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2149
2153
|
},
|
2150
2154
|
emits: ["pick", "copy"],
|
2151
2155
|
setup(u, { emit: e }) {
|
2152
|
-
const t = u, l = e, a = ["$provider", "$apis", "$components", "context"],
|
2156
|
+
const t = u, l = e, a = ["$provider", "$apis", "$components", "context"], o = (p) => {
|
2153
2157
|
const m = p.value, f = Ct(m);
|
2154
2158
|
return f === "Object" || f === "Module" ? Object.keys(m || {}).length === 0 : f === "Array" ? m.length === 0 : !0;
|
2155
|
-
},
|
2159
|
+
}, s = (p, m = "this") => typeof p == "object" ? Array.isArray(p) ? p.map((_, i) => {
|
2156
2160
|
const g = `[${i}]`;
|
2157
2161
|
return {
|
2158
2162
|
label: g,
|
@@ -2172,10 +2176,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2172
2176
|
(_) => !_.label.startsWith("__") && !a.includes(_.label)
|
2173
2177
|
) : [], r = (p, m) => {
|
2174
2178
|
if (p.level === 0)
|
2175
|
-
m(
|
2179
|
+
m(s(t.context));
|
2176
2180
|
else {
|
2177
2181
|
const f = hn(p.data.value);
|
2178
|
-
m(
|
2182
|
+
m(s(f, p.data.path));
|
2179
2183
|
}
|
2180
2184
|
}, c = (p) => {
|
2181
2185
|
l("copy", p.path);
|
@@ -2188,7 +2192,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2188
2192
|
lazy: "",
|
2189
2193
|
load: r,
|
2190
2194
|
"expand-on-click-node": !1,
|
2191
|
-
props: { isLeaf:
|
2195
|
+
props: { isLeaf: o }
|
2192
2196
|
}, {
|
2193
2197
|
default: y(({ data: f }) => [
|
2194
2198
|
v(ve, {
|
@@ -2229,7 +2233,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2229
2233
|
"close"
|
2230
2234
|
],
|
2231
2235
|
setup(u, { emit: e }) {
|
2232
|
-
const t = u, l = e, { searchResult: a, keyword:
|
2236
|
+
const t = u, l = e, { searchResult: a, keyword: o } = go(t.block, t.context), { copy: s } = el({}), r = [
|
2233
2237
|
{
|
2234
2238
|
name: "normal",
|
2235
2239
|
label: "常用"
|
@@ -2251,7 +2255,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2251
2255
|
}, g = (k) => {
|
2252
2256
|
l("pick", k);
|
2253
2257
|
}, b = (k) => {
|
2254
|
-
|
2258
|
+
s(k), Ie.success({
|
2255
2259
|
message: "已经复制到粘贴板"
|
2256
2260
|
});
|
2257
2261
|
};
|
@@ -2295,8 +2299,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2295
2299
|
default: y(() => [
|
2296
2300
|
Ee(V("div", null, [
|
2297
2301
|
v(n(be), {
|
2298
|
-
modelValue: n(
|
2299
|
-
"onUpdate:modelValue": C[0] || (C[0] = (D) => Dt(
|
2302
|
+
modelValue: n(o),
|
2303
|
+
"onUpdate:modelValue": C[0] || (C[0] = (D) => Dt(o) ? o.value = D : null),
|
2300
2304
|
size: "small",
|
2301
2305
|
clearable: "",
|
2302
2306
|
"prefix-icon": n(nt),
|
@@ -2425,7 +2429,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2425
2429
|
},
|
2426
2430
|
emits: ["submit", "update:modelValue"],
|
2427
2431
|
setup(u, { emit: e }) {
|
2428
|
-
const t = u, l = e, a = S(),
|
2432
|
+
const t = u, l = e, a = S(), o = x(() => `${50 * Math.ceil(t.slots.length / 4) + 180}px`), s = (c) => {
|
2429
2433
|
a.value = c;
|
2430
2434
|
}, r = () => {
|
2431
2435
|
a.value ? (l("submit", a.value), l("update:modelValue", !1)) : ae("请选择插槽");
|
@@ -2434,7 +2438,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2434
2438
|
class: "v-slots-picker",
|
2435
2439
|
title: "选择插槽",
|
2436
2440
|
width: "600px",
|
2437
|
-
height:
|
2441
|
+
height: o.value,
|
2438
2442
|
submit: "",
|
2439
2443
|
cancel: "",
|
2440
2444
|
onSubmit: r
|
@@ -2457,7 +2461,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2457
2461
|
class: K(["v-slots-picker__item", { "is-active": p.name === a.value?.name }]),
|
2458
2462
|
grow: "",
|
2459
2463
|
flex: !1,
|
2460
|
-
onClick: (f) =>
|
2464
|
+
onClick: (f) => s(p)
|
2461
2465
|
}, {
|
2462
2466
|
default: y(() => [
|
2463
2467
|
V("span", dr, "#" + L(m + 1), 1),
|
@@ -2483,24 +2487,24 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2483
2487
|
setup(u) {
|
2484
2488
|
const e = u, t = x(() => [`is-${e.mode}`]), l = x(() => {
|
2485
2489
|
if (e.mode === "pc") return 1;
|
2486
|
-
const
|
2490
|
+
const o = e.mode === "mobile" ? rn : un, { width: s, height: r } = o, c = s > 0 ? (e.width || 0) / s : 1, h = r > 0 ? (e.height || 0) / r : 1;
|
2487
2491
|
return Math.min(c, h);
|
2488
2492
|
}), a = x(() => {
|
2489
2493
|
if (e.mode === "pc") return {};
|
2490
|
-
const
|
2494
|
+
const o = e.mode === "mobile" ? rn : un, { width: s, height: r } = o;
|
2491
2495
|
return {
|
2492
|
-
width: `${
|
2496
|
+
width: `${s}px`,
|
2493
2497
|
height: `${r}px`,
|
2494
2498
|
left: "50%",
|
2495
2499
|
top: "50%",
|
2496
2500
|
transform: `translate(-50%, -50%) scale(${l.value})`
|
2497
2501
|
};
|
2498
2502
|
});
|
2499
|
-
return (
|
2503
|
+
return (o, s) => (d(), j("div", {
|
2500
2504
|
class: K(["v-viewport", t.value]),
|
2501
2505
|
style: rt(a.value)
|
2502
2506
|
}, [
|
2503
|
-
Ve(
|
2507
|
+
Ve(o.$slots, "default")
|
2504
2508
|
], 6));
|
2505
2509
|
}
|
2506
2510
|
}), mr = /* @__PURE__ */ E({
|
@@ -2522,11 +2526,11 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2522
2526
|
name: "PagesWidget",
|
2523
2527
|
__name: "index",
|
2524
2528
|
setup(u) {
|
2525
|
-
const { project: e, engine: t } = We(), l = x(() => e.value?.pages || []), { current: a } = me(),
|
2526
|
-
r.value = void 0,
|
2529
|
+
const { project: e, engine: t } = We(), l = x(() => e.value?.pages || []), { current: a } = me(), o = S(!1), s = S(), r = S(), c = x(() => `(共 ${l.value.length} 项)`), h = () => {
|
2530
|
+
r.value = void 0, s.value = void 0, o.value = !0;
|
2527
2531
|
}, p = async (i) => {
|
2528
2532
|
const { name: g, modelValue: b } = i, { data: k, node: C } = b;
|
2529
|
-
if (g === "add" && (
|
2533
|
+
if (g === "add" && (s.value = void 0, r.value = k.id, o.value = !0), g === "edit" && (s.value = _t(k), r.value = void 0, o.value = !0), g === "remove") {
|
2530
2534
|
if (k.dir) {
|
2531
2535
|
const D = e.value?.getPage(k.id);
|
2532
2536
|
if (D && D.children?.length) {
|
@@ -2592,11 +2596,11 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2592
2596
|
]),
|
2593
2597
|
_: 1
|
2594
2598
|
}, 8, ["data"]),
|
2595
|
-
|
2599
|
+
o.value ? (d(), w(tr, {
|
2596
2600
|
key: 0,
|
2597
|
-
modelValue:
|
2598
|
-
"onUpdate:modelValue": g[0] || (g[0] = (b) =>
|
2599
|
-
item:
|
2601
|
+
modelValue: o.value,
|
2602
|
+
"onUpdate:modelValue": g[0] || (g[0] = (b) => o.value = b),
|
2603
|
+
item: s.value,
|
2600
2604
|
"parent-id": r.value
|
2601
2605
|
}, null, 8, ["modelValue", "item", "parent-id"])) : A("", !0)
|
2602
2606
|
]),
|
@@ -2612,12 +2616,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2612
2616
|
},
|
2613
2617
|
emits: ["change", "update:modelValue"],
|
2614
2618
|
setup(u, { emit: e }) {
|
2615
|
-
const t = u, l = e, { engine: a, project:
|
2619
|
+
const t = u, l = e, { engine: a, project: o } = We(), s = S([]), r = S(!1), c = (C) => Array.isArray(C) ? C.map((D) => ({
|
2616
2620
|
name: D.filename,
|
2617
2621
|
url: D.filepath
|
2618
2622
|
})) : C ? { name: C.filename, url: C.filepath } : null, h = async (C) => {
|
2619
|
-
if (a &&
|
2620
|
-
const D = await a.service.uploadStaticFile(C,
|
2623
|
+
if (a && o.value) {
|
2624
|
+
const D = await a.service.uploadStaticFile(C, o.value.id);
|
2621
2625
|
return c(D);
|
2622
2626
|
}
|
2623
2627
|
return null;
|
@@ -2631,8 +2635,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2631
2635
|
}
|
2632
2636
|
), M(r, async (C) => {
|
2633
2637
|
if (C) {
|
2634
|
-
const D = await a.service.getStaticFiles(
|
2635
|
-
|
2638
|
+
const D = await a.service.getStaticFiles(o.value?.id).catch(() => null);
|
2639
|
+
s.value = c(D);
|
2636
2640
|
}
|
2637
2641
|
});
|
2638
2642
|
const _ = () => {
|
@@ -2650,7 +2654,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2650
2654
|
}, b = () => {
|
2651
2655
|
r.value = !0;
|
2652
2656
|
}, k = (C) => {
|
2653
|
-
C.name &&
|
2657
|
+
C.name && o.value?.id && a.service.removeStaticFile(C.name, o.value?.id);
|
2654
2658
|
};
|
2655
2659
|
return (C, D) => (d(), j("div", gr, [
|
2656
2660
|
v(n(be), ue({
|
@@ -2688,8 +2692,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2688
2692
|
"list-type": "list",
|
2689
2693
|
selectable: !0,
|
2690
2694
|
uploader: h,
|
2691
|
-
modelValue:
|
2692
|
-
"onUpdate:modelValue": D[0] || (D[0] = ($) =>
|
2695
|
+
modelValue: s.value,
|
2696
|
+
"onUpdate:modelValue": D[0] || (D[0] = ($) => s.value = $),
|
2693
2697
|
"select-value": m.value,
|
2694
2698
|
"onUpdate:selectValue": D[1] || (D[1] = ($) => m.value = $)
|
2695
2699
|
}, t.attachment, { onRemove: k }), null, 16, ["modelValue", "select-value"])
|
@@ -2702,9 +2706,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2702
2706
|
name: "BlocksWidget",
|
2703
2707
|
__name: "index",
|
2704
2708
|
setup(u) {
|
2705
|
-
const { span: e } = Ht(), { blocks: t, engine: l } = io(), a = S(""),
|
2706
|
-
() => yt(
|
2707
|
-
), r = x(() => Object.keys(
|
2709
|
+
const { span: e } = Ht(), { blocks: t, engine: l } = io(), a = S(""), o = x(() => a.value ? t.value.filter((P) => P.name.includes(a.value) || P.title?.includes(a.value)) : t.value), s = x(
|
2710
|
+
() => yt(o.value, (P) => P.category || "默认分组")
|
2711
|
+
), r = x(() => Object.keys(s.value)), c = {
|
2708
2712
|
filterable: !0,
|
2709
2713
|
allowCreate: !0,
|
2710
2714
|
defaultFirstOption: !0
|
@@ -2806,12 +2810,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2806
2810
|
clearable: ""
|
2807
2811
|
}, null, 8, ["modelValue", "prefix-icon"])
|
2808
2812
|
]),
|
2809
|
-
|
2813
|
+
o.value.length ? (d(), w(n(ft), {
|
2810
2814
|
key: 1,
|
2811
2815
|
"model-value": r.value
|
2812
2816
|
}, {
|
2813
2817
|
default: y(() => [
|
2814
|
-
(d(!0), j(z, null, W(
|
2818
|
+
(d(!0), j(z, null, W(s.value, (le, Ge) => (d(), w(n(ht), {
|
2815
2819
|
name: Ge,
|
2816
2820
|
title: `${Ge} (${le.length})`
|
2817
2821
|
}, {
|
@@ -2926,7 +2930,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2926
2930
|
name: "ComponentsWidget",
|
2927
2931
|
__name: "index",
|
2928
2932
|
setup(u) {
|
2929
|
-
const { span: e, engine: t } = Ht(), { tabs: l, currentTab: a, currentGroup:
|
2933
|
+
const { span: e, engine: t } = Ht(), { tabs: l, currentTab: a, currentGroup: o, model: s, searchKey: r, searchResult: c } = co(), h = (m) => {
|
2930
2934
|
const f = t.skeleton?.getWidget("Designer")?.widgetRef?.designer;
|
2931
2935
|
f && f.setDragging(m);
|
2932
2936
|
}, p = () => {
|
@@ -2986,13 +2990,13 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
2986
2990
|
}, {
|
2987
2991
|
default: y(() => [
|
2988
2992
|
V("div", _r, [
|
2989
|
-
n(
|
2993
|
+
n(o) ? (d(), w(n(ft), {
|
2990
2994
|
key: 0,
|
2991
|
-
modelValue: n(
|
2992
|
-
"onUpdate:modelValue": f[1] || (f[1] = (_) => n(
|
2995
|
+
modelValue: n(s)[n(a)],
|
2996
|
+
"onUpdate:modelValue": f[1] || (f[1] = (_) => n(s)[n(a)] = _)
|
2993
2997
|
}, {
|
2994
2998
|
default: y(() => [
|
2995
|
-
(d(!0), j(z, null, W(n(
|
2999
|
+
(d(!0), j(z, null, W(n(o).children, (_) => (d(), w(n(ht), {
|
2996
3000
|
key: _.name,
|
2997
3001
|
name: _.name,
|
2998
3002
|
title: `${_.label} (${_.count})`
|
@@ -3040,7 +3044,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3040
3044
|
name: "OutlineWidget",
|
3041
3045
|
__name: "index",
|
3042
3046
|
setup(u) {
|
3043
|
-
const { engine: e, designer: t, selected: l } = xe(), { current: a } = me(),
|
3047
|
+
const { engine: e, designer: t, selected: l } = xe(), { current: a } = me(), o = S([]), s = (T, R) => {
|
3044
3048
|
if (R === "slot") return [];
|
3045
3049
|
if (ne(T))
|
3046
3050
|
return T.locked ? ["unlock"] : ["lock"];
|
@@ -3089,7 +3093,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3089
3093
|
}
|
3090
3094
|
];
|
3091
3095
|
}, p = async () => {
|
3092
|
-
|
3096
|
+
o.value = h(), l.value?.model && (await Ce(), t.value?.setSelected(l.value.model));
|
3093
3097
|
}, m = x(() => l.value?.model.id), f = (T) => {
|
3094
3098
|
const R = T.data;
|
3095
3099
|
if (R.type === "slot" || ne(R.model) || R.model.locked || R.model.name === "template")
|
@@ -3129,7 +3133,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3129
3133
|
N,
|
3130
3134
|
J
|
3131
3135
|
)) {
|
3132
|
-
t.value?.setDropping(null), p(),
|
3136
|
+
t.value?.setDropping(null), p(), Ie.warning({
|
3133
3137
|
message: `${Q.model.name}不能放置到该位置`
|
3134
3138
|
}), t.value?.setDragging(null);
|
3135
3139
|
return;
|
@@ -3192,7 +3196,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3192
3196
|
default: y(() => [
|
3193
3197
|
(d(), w(n(Lt), {
|
3194
3198
|
key: n(e).changed.value,
|
3195
|
-
data:
|
3199
|
+
data: o.value,
|
3196
3200
|
"node-key": "id",
|
3197
3201
|
"default-expand-all": "",
|
3198
3202
|
draggable: "",
|
@@ -3224,7 +3228,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3224
3228
|
icon: B.model.locked ? n(Un) : B.model.invisible ? n(qn) : void 0,
|
3225
3229
|
title: B.label,
|
3226
3230
|
subtitle: B.type,
|
3227
|
-
actions:
|
3231
|
+
actions: s(B.model, B.type),
|
3228
3232
|
onAction: O,
|
3229
3233
|
onMouseenter: (fe) => b(B),
|
3230
3234
|
onMouseleave: k
|
@@ -3240,9 +3244,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3240
3244
|
name: "HistoryWidget",
|
3241
3245
|
__name: "index",
|
3242
3246
|
setup(u) {
|
3243
|
-
const { history: e, load: t, total: l } = Yn(), a = x(() => `(共 ${l.value} 条)`),
|
3247
|
+
const { history: e, load: t, total: l } = Yn(), a = x(() => `(共 ${l.value} 条)`), o = (r) => {
|
3244
3248
|
r.name === "remove" && e.value?.remove(r.modelValue.id);
|
3245
|
-
},
|
3249
|
+
}, s = async () => {
|
3246
3250
|
await He("确定要清空历史记录吗?") && e.value?.clear();
|
3247
3251
|
};
|
3248
3252
|
return (r, c) => (d(), w(n(H), {
|
@@ -3250,7 +3254,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3250
3254
|
title: "历史记录",
|
3251
3255
|
subtitle: a.value,
|
3252
3256
|
remove: !!n(l),
|
3253
|
-
onRemove:
|
3257
|
+
onRemove: s
|
3254
3258
|
}, {
|
3255
3259
|
default: y(() => [
|
3256
3260
|
n(l) === 0 ? (d(), w(n(ie), {
|
@@ -3265,7 +3269,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3265
3269
|
small: "",
|
3266
3270
|
background: "",
|
3267
3271
|
actions: ["remove"],
|
3268
|
-
onAction:
|
3272
|
+
onAction: o,
|
3269
3273
|
onClick: (m) => n(t)(h.id)
|
3270
3274
|
}, null, 8, ["index", "title", "model-value", "active", "onClick"]))), 256)) : A("", !0)
|
3271
3275
|
]),
|
@@ -3278,18 +3282,18 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3278
3282
|
categories: {}
|
3279
3283
|
},
|
3280
3284
|
setup(u) {
|
3281
|
-
const e = u, t = lo.map((
|
3282
|
-
label:
|
3283
|
-
value:
|
3285
|
+
const e = u, t = lo.map((o) => ({
|
3286
|
+
label: o,
|
3287
|
+
value: o.toLowerCase()
|
3284
3288
|
})), l = {
|
3285
3289
|
filterable: !0,
|
3286
3290
|
allowCreate: !0,
|
3287
3291
|
defaultFirstOption: !0
|
3288
|
-
}, a = x(() => e.categories?.map((
|
3289
|
-
label:
|
3290
|
-
value:
|
3292
|
+
}, a = x(() => e.categories?.map((o) => ({
|
3293
|
+
label: o,
|
3294
|
+
value: o
|
3291
3295
|
})));
|
3292
|
-
return (
|
3296
|
+
return (o, s) => (d(), j("div", null, [
|
3293
3297
|
v(n(I), {
|
3294
3298
|
name: "method",
|
3295
3299
|
label: "请求类型",
|
@@ -3394,7 +3398,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3394
3398
|
dark: "",
|
3395
3399
|
height: "260px",
|
3396
3400
|
modelValue: n(t).headers.value,
|
3397
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
3401
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => n(t).headers.value = o)
|
3398
3402
|
}, null, 8, ["modelValue"])
|
3399
3403
|
]),
|
3400
3404
|
_: 1
|
@@ -3435,7 +3439,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3435
3439
|
const e = Rt("currentModel", null), { project: t } = We(), l = x(() => t.value?.config || {}), a = () => {
|
3436
3440
|
window.open("https://vtj.pro/help/mock.html");
|
3437
3441
|
};
|
3438
|
-
return (
|
3442
|
+
return (o, s) => (d(), j("div", null, [
|
3439
3443
|
l.value.mock ? A("", !0) : (d(), w(n(Ft), {
|
3440
3444
|
key: 0,
|
3441
3445
|
type: "warning",
|
@@ -3452,7 +3456,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3452
3456
|
}, null, 8, ["disabled"]),
|
3453
3457
|
v(n(q), { justify: "space-between" }, {
|
3454
3458
|
default: y(() => [
|
3455
|
-
|
3459
|
+
s[1] || (s[1] = V("span", null, "模拟数据模板", -1)),
|
3456
3460
|
v(n(ge), {
|
3457
3461
|
icon: n(Gn),
|
3458
3462
|
mode: "text",
|
@@ -3475,7 +3479,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3475
3479
|
disabled: !l.value.mock,
|
3476
3480
|
readonly: !l.value.mock,
|
3477
3481
|
modelValue: n(e).mockTemplate.value,
|
3478
|
-
"onUpdate:modelValue":
|
3482
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => n(e).mockTemplate.value = r)
|
3479
3483
|
}, null, 8, ["height", "disabled", "readonly", "modelValue"])
|
3480
3484
|
]),
|
3481
3485
|
_: 1
|
@@ -3490,7 +3494,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3490
3494
|
categories: {}
|
3491
3495
|
},
|
3492
3496
|
setup(u) {
|
3493
|
-
const e = u, t = x(() => e.model ? "编辑API" : "新增API"), l = S("base"), a = S(),
|
3497
|
+
const e = u, t = x(() => e.model ? "编辑API" : "新增API"), l = S("base"), a = S(), o = S(), s = S(e.model || {}), r = S(!1), c = S(""), h = [
|
3494
3498
|
{
|
3495
3499
|
label: "基础信息",
|
3496
3500
|
value: "base"
|
@@ -3504,35 +3508,35 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3504
3508
|
value: "mock"
|
3505
3509
|
}
|
3506
3510
|
];
|
3507
|
-
fl("currentModel",
|
3508
|
-
const p = x(() =>
|
3511
|
+
fl("currentModel", s);
|
3512
|
+
const p = x(() => s.value?.method === "jsonp");
|
3509
3513
|
M(
|
3510
3514
|
() => e.model,
|
3511
3515
|
(g) => {
|
3512
|
-
|
3516
|
+
s.value = Object.assign({}, g || {}), l.value = "base";
|
3513
3517
|
},
|
3514
3518
|
{
|
3515
3519
|
immediate: !0
|
3516
3520
|
}
|
3517
3521
|
), M(l, async () => {
|
3518
|
-
|
3522
|
+
o.value?.formRef.validate(async (g) => {
|
3519
3523
|
g || (await Ce(), l.value = "base");
|
3520
3524
|
});
|
3521
3525
|
});
|
3522
3526
|
const m = () => {
|
3523
3527
|
a.value?.cancel();
|
3524
3528
|
}, f = () => {
|
3525
|
-
|
3529
|
+
o.value?.submit();
|
3526
3530
|
}, _ = async (g) => e.project?.existApiName(
|
3527
|
-
|
3528
|
-
e.model ? [
|
3529
|
-
) ? (ae(`API名称 [ ${
|
3530
|
-
if (
|
3531
|
+
s.value.name,
|
3532
|
+
e.model ? [s.value.id] : []
|
3533
|
+
) ? (ae(`API名称 [ ${s.value.name} ] 已存在`), !1) : s.value.headers && !pe(s.value.headers, window) || s.value.mockTemplate && !pe(s.value.mockTemplate, window) ? !1 : (e.project?.setApi(s.value), a.value?.close(), !0), i = () => {
|
3534
|
+
if (s.value.mockTemplate) {
|
3531
3535
|
const g = Ze(
|
3532
|
-
|
3536
|
+
s.value.mockTemplate,
|
3533
3537
|
{},
|
3534
3538
|
!0
|
3535
|
-
), { url: b, method: k } =
|
3539
|
+
), { url: b, method: k } = s.value, C = Ys.mock(
|
3536
3540
|
g({
|
3537
3541
|
url: b,
|
3538
3542
|
type: k
|
@@ -3615,11 +3619,11 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3615
3619
|
default: y(() => [
|
3616
3620
|
v(n(Nt), {
|
3617
3621
|
ref_key: "formRef",
|
3618
|
-
ref:
|
3622
|
+
ref: o,
|
3619
3623
|
footer: !1,
|
3620
3624
|
labelPosition: "top",
|
3621
3625
|
tooltipMessage: !1,
|
3622
|
-
model:
|
3626
|
+
model: s.value,
|
3623
3627
|
submitMethod: _
|
3624
3628
|
}, {
|
3625
3629
|
default: y(() => [
|
@@ -3668,11 +3672,11 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3668
3672
|
name: "ApisWidget",
|
3669
3673
|
__name: "index",
|
3670
3674
|
setup(u) {
|
3671
|
-
const { project: e } = We(), t = S(!1), l = S(null), a = S(""),
|
3675
|
+
const { project: e } = We(), t = S(!1), l = S(null), a = S(""), o = S(!1), s = x(() => {
|
3672
3676
|
const i = e.value?.apis || [];
|
3673
3677
|
return a.value ? i.filter((g) => g.name.includes(a.value) || g.label?.includes(a.value) || g.url.includes(a.value)) : i;
|
3674
3678
|
}), r = x(
|
3675
|
-
() => yt(
|
3679
|
+
() => yt(s.value, (i) => i.category || "默认分组")
|
3676
3680
|
), c = x(() => Object.keys(r.value)), h = () => ({
|
3677
3681
|
id: "",
|
3678
3682
|
method: "get",
|
@@ -3703,7 +3707,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3703
3707
|
}`
|
3704
3708
|
}
|
3705
3709
|
}), p = () => {
|
3706
|
-
t.value = !0,
|
3710
|
+
t.value = !0, o.value = !1, l.value = h();
|
3707
3711
|
}, m = {
|
3708
3712
|
get: "success",
|
3709
3713
|
post: "primary",
|
@@ -3714,7 +3718,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3714
3718
|
}, f = (i) => {
|
3715
3719
|
i.name === "edit" && _(i.modelValue), i.name === "remove" && e.value?.removeApi(i.modelValue.name);
|
3716
3720
|
}, _ = (i) => {
|
3717
|
-
|
3721
|
+
o.value = !0, l.value = _t(i), t.value = !0;
|
3718
3722
|
};
|
3719
3723
|
return (i, g) => (d(), w(n(H), {
|
3720
3724
|
class: "v-apis-widget",
|
@@ -3759,7 +3763,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3759
3763
|
]),
|
3760
3764
|
_: 1
|
3761
3765
|
}, 8, ["model-value"]),
|
3762
|
-
|
3766
|
+
s.value.length === 0 ? (d(), w(n(ie), {
|
3763
3767
|
key: 0,
|
3764
3768
|
"image-size": 50
|
3765
3769
|
})) : A("", !0),
|
@@ -3778,19 +3782,19 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3778
3782
|
name: "DepsWidget",
|
3779
3783
|
__name: "index",
|
3780
3784
|
setup(u) {
|
3781
|
-
const { dependencies: e, engine: t } = Qn(), l = S(!1), a = S(!1),
|
3785
|
+
const { dependencies: e, engine: t } = Qn(), l = S(!1), a = S(!1), o = S({}), s = x(() => a.value ? "查看依赖" : o.value ? "编辑依赖" : "新增依赖"), r = (i) => i.required || i.official ? [] : ["edit", "remove"], c = (i) => i.official && !i.required, h = async (i) => (i.urls = i.urls.split(`
|
3782
3786
|
`), i.enabled = !0, i.official = !1, t.project.value?.setDeps(i), !0), p = (i) => {
|
3783
3787
|
t.project.value?.setDeps(i);
|
3784
3788
|
}, m = () => {
|
3785
|
-
a.value = !1, l.value = !0,
|
3789
|
+
a.value = !1, l.value = !0, o.value = null;
|
3786
3790
|
}, f = (i) => {
|
3787
|
-
a.value = !0,
|
3791
|
+
a.value = !0, o.value = {
|
3788
3792
|
...i,
|
3789
3793
|
urls: i.urls.join(`
|
3790
3794
|
`)
|
3791
3795
|
}, l.value = !0;
|
3792
3796
|
}, _ = (i, g) => {
|
3793
|
-
g.name === "edit" && (
|
3797
|
+
g.name === "edit" && (o.value = {
|
3794
3798
|
...i,
|
3795
3799
|
enabled: !0,
|
3796
3800
|
official: !1,
|
@@ -3823,8 +3827,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3823
3827
|
"onUpdate:modelValue": g[0] || (g[0] = (b) => l.value = b),
|
3824
3828
|
width: "600px",
|
3825
3829
|
height: "500px",
|
3826
|
-
title:
|
3827
|
-
model:
|
3830
|
+
title: s.value,
|
3831
|
+
model: o.value,
|
3828
3832
|
submitMethod: h,
|
3829
3833
|
formProps: {
|
3830
3834
|
disabled: a.value,
|
@@ -3836,7 +3840,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3836
3840
|
name: "package",
|
3837
3841
|
label: "包名",
|
3838
3842
|
required: "",
|
3839
|
-
disabled: !!
|
3843
|
+
disabled: !!o.value
|
3840
3844
|
}, null, 8, ["disabled"]),
|
3841
3845
|
v(n(I), {
|
3842
3846
|
name: "version",
|
@@ -3880,7 +3884,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3880
3884
|
},
|
3881
3885
|
emits: ["action", "dragstart", "dragend"],
|
3882
3886
|
setup(u, { emit: e }) {
|
3883
|
-
const t = u, l = e, a = x(() => t.model.name),
|
3887
|
+
const t = u, l = e, a = x(() => t.model.name), o = x(() => !ne(t.model) && !t.model.locked), s = x(() => t.path.map((p) => ({
|
3884
3888
|
command: p,
|
3885
3889
|
label: p.name,
|
3886
3890
|
onMouseenter: () => {
|
@@ -3932,12 +3936,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3932
3936
|
size: "small",
|
3933
3937
|
icon: n(Kn),
|
3934
3938
|
label: a.value,
|
3935
|
-
menus:
|
3939
|
+
menus: s.value,
|
3936
3940
|
background: "none",
|
3937
3941
|
onCommand: c
|
3938
3942
|
}, null, 8, ["icon", "label", "menus"]),
|
3939
3943
|
v(n(Rl), {
|
3940
|
-
disabled: !
|
3944
|
+
disabled: !o.value,
|
3941
3945
|
mode: "icon",
|
3942
3946
|
size: "small",
|
3943
3947
|
items: r,
|
@@ -3954,9 +3958,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
3954
3958
|
inheritAttrs: !1,
|
3955
3959
|
__name: "index",
|
3956
3960
|
setup(u, { expose: e }) {
|
3957
|
-
const t = S(), l = S(), { width: a, height:
|
3961
|
+
const t = S(), l = S(), { width: a, height: o } = tt(t), { dependencies: s, engine: r, apis: c, meta: h } = Qn(), { current: p, isEmpty: m } = me(), f = x(() => r.skeleton?.getWidget("Toolbar")?.widgetRef.mode ?? "pc"), _ = x(() => r.project.value?.config || {}), { designer: i, hover: g, dropping: b, selected: k } = po(
|
3958
3962
|
l,
|
3959
|
-
|
3963
|
+
s,
|
3960
3964
|
c,
|
3961
3965
|
h,
|
3962
3966
|
_
|
@@ -4003,7 +4007,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4003
4007
|
v(n(nl), {
|
4004
4008
|
mode: f.value,
|
4005
4009
|
width: n(a),
|
4006
|
-
height: n(
|
4010
|
+
height: n(o)
|
4007
4011
|
}, {
|
4008
4012
|
default: y(() => [
|
4009
4013
|
n(b) ? (d(), j("div", {
|
@@ -4067,10 +4071,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4067
4071
|
itemTitle: { type: Function, default: (u) => u.name }
|
4068
4072
|
},
|
4069
4073
|
setup(u) {
|
4070
|
-
const e = u, t = S(), l = S(), a = S(!1),
|
4071
|
-
() =>
|
4074
|
+
const e = u, t = S(), l = S(), a = S(!1), o = S(e.createEmpty()), s = S(!1), r = x(
|
4075
|
+
() => s.value ? `编辑${e.title}` : `新增${e.title}`
|
4072
4076
|
), c = () => {
|
4073
|
-
|
4077
|
+
s.value = !1, o.value = e.createEmpty(), a.value = !0;
|
4074
4078
|
}, h = (i, g) => {
|
4075
4079
|
switch (g.name) {
|
4076
4080
|
case "edit":
|
@@ -4081,12 +4085,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4081
4085
|
break;
|
4082
4086
|
}
|
4083
4087
|
}, p = (i) => {
|
4084
|
-
|
4088
|
+
o.value.value = i;
|
4085
4089
|
}, m = (i) => {
|
4086
|
-
|
4090
|
+
s.value = !0, o.value = {
|
4087
4091
|
...i
|
4088
4092
|
}, a.value = !0;
|
4089
|
-
}, f = async (i) => e.submit(i,
|
4093
|
+
}, f = async (i) => e.submit(i, s.value), _ = () => {
|
4090
4094
|
l.value?.itemRef.validate();
|
4091
4095
|
};
|
4092
4096
|
return (i, g) => (d(), w(n(H), {
|
@@ -4114,18 +4118,18 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4114
4118
|
"onUpdate:modelValue": g[1] || (g[1] = (b) => a.value = b),
|
4115
4119
|
title: r.value,
|
4116
4120
|
"submit-method": f,
|
4117
|
-
model:
|
4121
|
+
model: o.value,
|
4118
4122
|
block: i.current,
|
4119
4123
|
context: i.context,
|
4120
4124
|
onPick: p
|
4121
4125
|
}, {
|
4122
4126
|
default: y(() => [
|
4123
|
-
Ve(i.$slots, "fields", yn(_n({ model:
|
4127
|
+
Ve(i.$slots, "fields", yn(_n({ model: o.value, isEdit: s.value, nameLabel: i.nameLabel, valueLabel: i.valueLabel })), () => [
|
4124
4128
|
v(n(I), {
|
4125
4129
|
name: "name",
|
4126
4130
|
label: i.nameLabel,
|
4127
4131
|
required: "",
|
4128
|
-
disabled:
|
4132
|
+
disabled: s.value
|
4129
4133
|
}, null, 8, ["label", "disabled"]),
|
4130
4134
|
v(n(I), {
|
4131
4135
|
class: "v-binder__editor",
|
@@ -4141,8 +4145,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4141
4145
|
ref: t,
|
4142
4146
|
dark: "",
|
4143
4147
|
height: "100%",
|
4144
|
-
modelValue:
|
4145
|
-
"onUpdate:modelValue": g[0] || (g[0] = (b) =>
|
4148
|
+
modelValue: o.value.value,
|
4149
|
+
"onUpdate:modelValue": g[0] || (g[0] = (b) => o.value.value = b),
|
4146
4150
|
onBlur: _
|
4147
4151
|
}, null, 8, ["modelValue"])
|
4148
4152
|
]),
|
@@ -4166,8 +4170,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4166
4170
|
const e = u, t = x(() => Object.entries(e.current?.state || {}).map(([r, c]) => ({ name: r, value: Ue(c) }))), l = () => ({
|
4167
4171
|
name: "",
|
4168
4172
|
value: ""
|
4169
|
-
}), a = (
|
4170
|
-
const { name: c, value: h } =
|
4173
|
+
}), a = (s) => e.current?.removeState(s.name), o = async (s, r) => {
|
4174
|
+
const { name: c, value: h } = s;
|
4171
4175
|
if (!r && e.current?.state[c])
|
4172
4176
|
return ae(`名称 ${c} 已存在,请更换!`), !1;
|
4173
4177
|
const p = {
|
@@ -4176,7 +4180,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4176
4180
|
};
|
4177
4181
|
return pe(p, e.context, !0) ? (e.current?.setState(c, p), !0) : !1;
|
4178
4182
|
};
|
4179
|
-
return (
|
4183
|
+
return (s, r) => (d(), w(at, {
|
4180
4184
|
title: "状态数据",
|
4181
4185
|
current: e.current,
|
4182
4186
|
context: e.context,
|
@@ -4185,7 +4189,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4185
4189
|
valueLabel: "状态初始值 [ JSExpression ]",
|
4186
4190
|
createEmpty: l,
|
4187
4191
|
remove: a,
|
4188
|
-
submit:
|
4192
|
+
submit: o
|
4189
4193
|
}, null, 8, ["current", "context", "list"]));
|
4190
4194
|
}
|
4191
4195
|
}), Or = /* @__PURE__ */ E({
|
@@ -4198,8 +4202,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4198
4202
|
const e = u, t = x(() => Object.entries(e.current?.computed || {}).map(([r, c]) => ({ name: r, value: Ue(c) }))), l = () => ({
|
4199
4203
|
name: "",
|
4200
4204
|
value: "() => { }"
|
4201
|
-
}), a = (
|
4202
|
-
const { name: c, value: h } =
|
4205
|
+
}), a = (s) => e.current?.removeFunction("computed", s.name), o = async (s, r) => {
|
4206
|
+
const { name: c, value: h } = s;
|
4203
4207
|
if (!r && e.current?.computed[c])
|
4204
4208
|
return ae(`名称 ${c} 已存在,请更换!`), !1;
|
4205
4209
|
const p = {
|
@@ -4208,7 +4212,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4208
4212
|
};
|
4209
4213
|
return pe(p, e.context, !0) ? (e.current?.setFunction("computed", c, p), !0) : !1;
|
4210
4214
|
};
|
4211
|
-
return (
|
4215
|
+
return (s, r) => (d(), w(at, {
|
4212
4216
|
title: "计算属性",
|
4213
4217
|
current: e.current,
|
4214
4218
|
context: e.context,
|
@@ -4217,7 +4221,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4217
4221
|
valueLabel: "计算函数 [ JSFunction ]",
|
4218
4222
|
createEmpty: l,
|
4219
4223
|
remove: a,
|
4220
|
-
submit:
|
4224
|
+
submit: o
|
4221
4225
|
}, null, 8, ["current", "context", "list"]));
|
4222
4226
|
}
|
4223
4227
|
}), zr = /* @__PURE__ */ E({
|
@@ -4230,8 +4234,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4230
4234
|
const e = u, t = x(() => Object.entries(e.current?.methods || {}).map(([r, c]) => ({ name: r, value: Ue(c) }))), l = () => ({
|
4231
4235
|
name: "",
|
4232
4236
|
value: "() => { }"
|
4233
|
-
}), a = (
|
4234
|
-
const { name: c, value: h } =
|
4237
|
+
}), a = (s) => e.current?.removeFunction("methods", s.name), o = async (s, r) => {
|
4238
|
+
const { name: c, value: h } = s;
|
4235
4239
|
if (!r && e.current?.methods[c])
|
4236
4240
|
return ae(`名称 ${c} 已存在,请更换!`), !1;
|
4237
4241
|
const p = {
|
@@ -4240,7 +4244,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4240
4244
|
};
|
4241
4245
|
return pe(p, e.context, !0) ? (e.current?.setFunction("methods", c, p), !0) : !1;
|
4242
4246
|
};
|
4243
|
-
return (
|
4247
|
+
return (s, r) => (d(), w(at, {
|
4244
4248
|
title: "组件方法",
|
4245
4249
|
current: e.current,
|
4246
4250
|
context: e.context,
|
@@ -4249,7 +4253,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4249
4253
|
valueLabel: "方法函数 [ JSFunction ]",
|
4250
4254
|
createEmpty: l,
|
4251
4255
|
remove: a,
|
4252
|
-
submit:
|
4256
|
+
submit: o
|
4253
4257
|
}, null, 8, ["current", "context", "list"]));
|
4254
4258
|
}
|
4255
4259
|
}), Fr = /* @__PURE__ */ E({
|
@@ -4265,7 +4269,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4265
4269
|
}))), l = x(() => Object.entries(e.current?.lifeCycles || {}).map(([c, h]) => ({ name: c, value: Ue(h) }))), a = () => ({
|
4266
4270
|
name: "",
|
4267
4271
|
value: "() => { }"
|
4268
|
-
}),
|
4272
|
+
}), o = (r) => e.current?.removeFunction("lifeCycles", r.name), s = async (r, c) => {
|
4269
4273
|
const { name: h, value: p } = r;
|
4270
4274
|
if (!c && e.current?.lifeCycles[h])
|
4271
4275
|
return ae(`名称 ${h} 已存在,请更换!`), !1;
|
@@ -4283,8 +4287,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4283
4287
|
nameLabel: "名称",
|
4284
4288
|
valueLabel: "函数 [ JSFunction ]",
|
4285
4289
|
createEmpty: a,
|
4286
|
-
remove:
|
4287
|
-
submit:
|
4290
|
+
remove: o,
|
4291
|
+
submit: s
|
4288
4292
|
}, {
|
4289
4293
|
fields: y(({ model: h, nameLabel: p, isEdit: m, valueLabel: f }) => [
|
4290
4294
|
v(n(I), {
|
@@ -4332,7 +4336,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4332
4336
|
deep: !1,
|
4333
4337
|
immediate: !1,
|
4334
4338
|
handler: "() => { }"
|
4335
|
-
}), a = (r) => r.source,
|
4339
|
+
}), a = (r) => r.source, o = (r) => e.current?.removeWatch(r), s = async (r, c) => {
|
4336
4340
|
const h = {
|
4337
4341
|
type: "JSFunction",
|
4338
4342
|
value: r.source
|
@@ -4357,8 +4361,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4357
4361
|
nameLabel: "侦听源 [ JSFunction ]",
|
4358
4362
|
valueLabel: "处理函数 [ JSFunction ]",
|
4359
4363
|
createEmpty: l,
|
4360
|
-
remove:
|
4361
|
-
submit:
|
4364
|
+
remove: o,
|
4365
|
+
submit: s,
|
4362
4366
|
itemTitle: a,
|
4363
4367
|
grow: ""
|
4364
4368
|
}, {
|
@@ -4461,10 +4465,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4461
4465
|
setup(u, { emit: e }) {
|
4462
4466
|
const t = u, l = e, a = (c, h) => {
|
4463
4467
|
l("change", c, h);
|
4464
|
-
},
|
4468
|
+
}, o = (c) => {
|
4465
4469
|
l("remove", c);
|
4466
|
-
},
|
4467
|
-
const h = (t.items || []).map((p) =>
|
4470
|
+
}, s = (c) => c ? c.replace(/[\u0391-\uFFE5]/g, "aa").length : 0, r = x(() => {
|
4471
|
+
const h = (t.items || []).map((p) => s(p.label || p.name)).sort((p, m) => m - p)[0];
|
4468
4472
|
return h ? h * 6 + 24 : 100;
|
4469
4473
|
});
|
4470
4474
|
return (c, h) => (d(), w(n(H), {
|
@@ -4489,7 +4493,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4489
4493
|
context: t.context,
|
4490
4494
|
removable: t.removable,
|
4491
4495
|
onChange: a,
|
4492
|
-
onRemove:
|
4496
|
+
onRemove: o
|
4493
4497
|
}), null, 16, ["current", "context", "removable"]))), 128))
|
4494
4498
|
]),
|
4495
4499
|
_: 1
|
@@ -4504,8 +4508,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4504
4508
|
setup(u) {
|
4505
4509
|
const { current: e, context: t } = me(), { selected: l } = xe(), {
|
4506
4510
|
node: a,
|
4507
|
-
commonProps:
|
4508
|
-
change:
|
4511
|
+
commonProps: o,
|
4512
|
+
change: s,
|
4509
4513
|
componentProps: r,
|
4510
4514
|
customProps: c,
|
4511
4515
|
addCustom: h,
|
@@ -4534,8 +4538,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4534
4538
|
current: n(e),
|
4535
4539
|
context: n(t),
|
4536
4540
|
node: n(a),
|
4537
|
-
items: n(
|
4538
|
-
onChange: n(
|
4541
|
+
items: n(o),
|
4542
|
+
onChange: n(s)
|
4539
4543
|
}, null, 8, ["current", "context", "node", "items", "onChange"])) : A("", !0),
|
4540
4544
|
n(a) && n(r).length ? (d(), w(At, {
|
4541
4545
|
key: 1,
|
@@ -4544,7 +4548,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4544
4548
|
context: n(t),
|
4545
4549
|
node: n(a),
|
4546
4550
|
items: n(r),
|
4547
|
-
onChange: n(
|
4551
|
+
onChange: n(s)
|
4548
4552
|
}, null, 8, ["current", "context", "node", "items", "onChange"])) : A("", !0),
|
4549
4553
|
n(a) ? (d(), w(At, {
|
4550
4554
|
key: 2,
|
@@ -4553,7 +4557,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4553
4557
|
context: n(t),
|
4554
4558
|
node: n(a),
|
4555
4559
|
items: n(c),
|
4556
|
-
onChange: n(
|
4560
|
+
onChange: n(s),
|
4557
4561
|
removable: "",
|
4558
4562
|
plus: "",
|
4559
4563
|
grow: "",
|
@@ -4599,10 +4603,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4599
4603
|
const e = u, t = S(), l = qe({
|
4600
4604
|
type: "JSExpression",
|
4601
4605
|
value: e.value
|
4602
|
-
}), a = (
|
4603
|
-
t.value.getEditor().setValue(
|
4606
|
+
}), a = (o) => {
|
4607
|
+
t.value.getEditor().setValue(o), l.value = o;
|
4604
4608
|
};
|
4605
|
-
return (
|
4609
|
+
return (o, s) => (d(), w(n(Yt), {
|
4606
4610
|
title: "绑定变量",
|
4607
4611
|
"unbind-enabled": "",
|
4608
4612
|
block: e.current,
|
@@ -4622,7 +4626,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4622
4626
|
ref_key: "editorRef",
|
4623
4627
|
ref: t,
|
4624
4628
|
modelValue: l.value,
|
4625
|
-
"onUpdate:modelValue":
|
4629
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => l.value = r),
|
4626
4630
|
dark: "",
|
4627
4631
|
height: "100%"
|
4628
4632
|
}, null, 8, ["modelValue"])
|
@@ -4651,10 +4655,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4651
4655
|
type: "JSFunction",
|
4652
4656
|
value: e.event?.handler?.value || "() => {}"
|
4653
4657
|
}
|
4654
|
-
}),
|
4658
|
+
}), o = ao.map((r) => ({
|
4655
4659
|
label: r,
|
4656
4660
|
value: r
|
4657
|
-
})),
|
4661
|
+
})), s = (r) => {
|
4658
4662
|
t.value.getEditor().setValue(r), a.handler.value = r;
|
4659
4663
|
};
|
4660
4664
|
return (r, c) => (d(), w(n(Yt), {
|
@@ -4663,14 +4667,14 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4663
4667
|
block: e.current,
|
4664
4668
|
context: e.context,
|
4665
4669
|
model: a,
|
4666
|
-
onPick:
|
4670
|
+
onPick: s
|
4667
4671
|
}, {
|
4668
4672
|
default: y(() => [
|
4669
4673
|
v(n(I), {
|
4670
4674
|
name: "modifiers",
|
4671
4675
|
label: "事件修饰符",
|
4672
4676
|
editor: "checkbox",
|
4673
|
-
options: n(
|
4677
|
+
options: n(o)
|
4674
4678
|
}, null, 8, ["options"]),
|
4675
4679
|
v(n(I), {
|
4676
4680
|
class: "v-binder__editor",
|
@@ -4698,7 +4702,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4698
4702
|
name: "EventsWidget",
|
4699
4703
|
__name: "index",
|
4700
4704
|
setup(u) {
|
4701
|
-
const { current: e, context: t } = me(), { selected: l } = xe(), { mouseEventList: a, keyboardEventList:
|
4705
|
+
const { current: e, context: t } = me(), { selected: l } = xe(), { mouseEventList: a, keyboardEventList: o, componentEventList: s } = yo(l), r = S({
|
4702
4706
|
name: "",
|
4703
4707
|
event: void 0
|
4704
4708
|
}), c = S(!1), h = (i) => {
|
@@ -4731,12 +4735,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4731
4735
|
fit: !1
|
4732
4736
|
}, {
|
4733
4737
|
default: y(() => [
|
4734
|
-
n(
|
4738
|
+
n(s).length ? A("", !0) : (d(), w(n(ie), {
|
4735
4739
|
key: 0,
|
4736
4740
|
"image-size": 50,
|
4737
4741
|
description: "该组件无自带事件"
|
4738
4742
|
})),
|
4739
|
-
(d(!0), j(z, null, W(n(
|
4743
|
+
(d(!0), j(z, null, W(n(s), (b) => (d(), w(n(ve), {
|
4740
4744
|
key: `component_${b.name}`,
|
4741
4745
|
title: b.name,
|
4742
4746
|
"model-value": b,
|
@@ -4779,7 +4783,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4779
4783
|
fit: !1
|
4780
4784
|
}, {
|
4781
4785
|
default: y(() => [
|
4782
|
-
(d(!0), j(z, null, W(n(
|
4786
|
+
(d(!0), j(z, null, W(n(o), (b) => (d(), w(n(ve), {
|
4783
4787
|
key: `keyboard_${b.name}`,
|
4784
4788
|
title: b.name,
|
4785
4789
|
"model-value": b,
|
@@ -4812,19 +4816,19 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4812
4816
|
name: "CssWidget",
|
4813
4817
|
__name: "index",
|
4814
4818
|
setup(u) {
|
4815
|
-
const { current: e } = me(), t = S(), l = x(() => e.value?.css || ""), a = (
|
4816
|
-
e.value?.setCss(
|
4817
|
-
},
|
4819
|
+
const { current: e } = me(), t = S(), l = x(() => e.value?.css || ""), a = (s) => {
|
4820
|
+
e.value?.setCss(s);
|
4821
|
+
}, o = () => {
|
4818
4822
|
const r = (t.value?.getEditor()).getValue();
|
4819
4823
|
a(r), de("保存成功");
|
4820
4824
|
};
|
4821
|
-
return (
|
4825
|
+
return (s, r) => (d(), w(n(H), {
|
4822
4826
|
class: "v-css-widget v-sub-panel",
|
4823
4827
|
title: "lang:css scoped",
|
4824
4828
|
size: "small",
|
4825
4829
|
fit: "",
|
4826
4830
|
save: "",
|
4827
|
-
onSave:
|
4831
|
+
onSave: o
|
4828
4832
|
}, {
|
4829
4833
|
default: y(() => [
|
4830
4834
|
v(n(se), {
|
@@ -4846,8 +4850,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4846
4850
|
setup(u) {
|
4847
4851
|
const { current: e, context: t } = me(), { selected: l } = xe(), {
|
4848
4852
|
vIf: a,
|
4849
|
-
vShow:
|
4850
|
-
vBind:
|
4853
|
+
vShow: o,
|
4854
|
+
vBind: s,
|
4851
4855
|
vFor: r,
|
4852
4856
|
vModels: c,
|
4853
4857
|
onValueChange: h,
|
@@ -4889,7 +4893,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4889
4893
|
setters: "ExpressionSetter",
|
4890
4894
|
current: n(e),
|
4891
4895
|
context: n(t),
|
4892
|
-
value: n(
|
4896
|
+
value: n(o).value,
|
4893
4897
|
onChange: n(h)
|
4894
4898
|
}, null, 8, ["current", "context", "value", "onChange"]),
|
4895
4899
|
v(n(U), {
|
@@ -4898,7 +4902,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
4898
4902
|
setters: "ExpressionSetter",
|
4899
4903
|
current: n(e),
|
4900
4904
|
context: n(t),
|
4901
|
-
value: n(
|
4905
|
+
value: n(s).value,
|
4902
4906
|
onChange: n(h)
|
4903
4907
|
}, null, 8, ["current", "context", "value", "onChange"])
|
4904
4908
|
]),
|
@@ -5031,20 +5035,20 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5031
5035
|
},
|
5032
5036
|
e.item
|
5033
5037
|
)
|
5034
|
-
), a = Object.keys(oa).map((
|
5035
|
-
label:
|
5036
|
-
value:
|
5037
|
-
})),
|
5038
|
-
const r =
|
5039
|
-
return r && !pe(r, e.context, !0) ? !1 : (e.current.setProp(
|
5038
|
+
), a = Object.keys(oa).map((s) => ({
|
5039
|
+
label: s,
|
5040
|
+
value: s
|
5041
|
+
})), o = async (s) => {
|
5042
|
+
const r = s.default;
|
5043
|
+
return r && !pe(r, e.context, !0) ? !1 : (e.current.setProp(s), !0);
|
5040
5044
|
};
|
5041
|
-
return (
|
5045
|
+
return (s, r) => (d(), w(n(Ae), {
|
5042
5046
|
title: t.value,
|
5043
5047
|
width: "800px",
|
5044
5048
|
height: "500px",
|
5045
5049
|
model: l.value,
|
5046
5050
|
"form-props": { tooltipMessage: !1 },
|
5047
|
-
"submit-method":
|
5051
|
+
"submit-method": o
|
5048
5052
|
}, {
|
5049
5053
|
default: y(() => [
|
5050
5054
|
v(n(I), {
|
@@ -5099,8 +5103,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5099
5103
|
context: {}
|
5100
5104
|
},
|
5101
5105
|
setup(u) {
|
5102
|
-
const e = u, t = x(() => e.item ? "编辑定义事件" : "新增定义事件"), l = S(e.item), a = async (
|
5103
|
-
return (
|
5106
|
+
const e = u, t = x(() => e.item ? "编辑定义事件" : "新增定义事件"), l = S(e.item), a = async (o) => (e.item && e.current.removeEmit(e.item.name, !0), e.current.setEmit(o), !0);
|
5107
|
+
return (o, s) => (d(), w(n(Ae), {
|
5104
5108
|
title: t.value,
|
5105
5109
|
width: "600px",
|
5106
5110
|
height: "200px",
|
@@ -5151,8 +5155,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5151
5155
|
context: {}
|
5152
5156
|
},
|
5153
5157
|
setup(u) {
|
5154
|
-
const e = u, t = x(() => e.item ? "编辑定义插槽" : "新增定义插槽"), l = S(e.item), a = async (
|
5155
|
-
return (
|
5158
|
+
const e = u, t = x(() => e.item ? "编辑定义插槽" : "新增定义插槽"), l = S(e.item), a = async (o) => (e.item && e.current.removeSlot(e.item.name, !0), e.current.setSlot(o), !0);
|
5159
|
+
return (o, s) => (d(), w(n(Ae), {
|
5156
5160
|
title: t.value,
|
5157
5161
|
width: "600px",
|
5158
5162
|
height: "200px",
|
@@ -5212,11 +5216,11 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5212
5216
|
},
|
5213
5217
|
e.item
|
5214
5218
|
)
|
5215
|
-
), a = async (
|
5216
|
-
const
|
5217
|
-
return
|
5219
|
+
), a = async (o) => {
|
5220
|
+
const s = o.default;
|
5221
|
+
return s && !pe(s, e.context, !0) ? !1 : (e.current.setInject(o), !0);
|
5218
5222
|
};
|
5219
|
-
return (
|
5223
|
+
return (o, s) => (d(), w(n(Ae), {
|
5220
5224
|
title: t.value,
|
5221
5225
|
width: "800px",
|
5222
5226
|
height: "500px",
|
@@ -5249,7 +5253,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5249
5253
|
default: y(() => [
|
5250
5254
|
v(n(se), {
|
5251
5255
|
modelValue: l.value.default.value,
|
5252
|
-
"onUpdate:modelValue":
|
5256
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => l.value.default.value = r),
|
5253
5257
|
height: "200px",
|
5254
5258
|
dark: ""
|
5255
5259
|
}, null, 8, ["modelValue"])
|
@@ -5264,7 +5268,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5264
5268
|
name: "DefinedWidget",
|
5265
5269
|
__name: "index",
|
5266
5270
|
setup(u) {
|
5267
|
-
const { current: e, context: t } = me(), l = x(() => (e.value?.props || []).map((N) => typeof N == "string" ? { name: N } : N)), a = x(() => (e.value?.emits || []).map((N) => typeof N == "string" ? { name: N, params: [] } : Object.assign({ params: [] }, N))),
|
5271
|
+
const { current: e, context: t } = me(), l = x(() => (e.value?.props || []).map((N) => typeof N == "string" ? { name: N } : N)), a = x(() => (e.value?.emits || []).map((N) => typeof N == "string" ? { name: N, params: [] } : Object.assign({ params: [] }, N))), o = x(() => (e.value?.slots || []).map((N) => typeof N == "string" ? { name: N, params: [] } : Object.assign({ params: [] }, N))), s = x(() => e.value?.inject || []), r = S(!1), c = S(), h = S(!1), p = S(), m = S(!1), f = S(), _ = S(!1), i = S(), g = () => {
|
5268
5272
|
c.value = void 0, r.value = !0;
|
5269
5273
|
}, b = (N) => {
|
5270
5274
|
const { name: J, modelValue: P } = N;
|
@@ -5373,7 +5377,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5373
5377
|
onPlus: O
|
5374
5378
|
}, {
|
5375
5379
|
default: y(() => [
|
5376
|
-
(d(!0), j(z, null, W(
|
5380
|
+
(d(!0), j(z, null, W(o.value, (P) => (d(), w(n(ve), {
|
5377
5381
|
"model-value": P,
|
5378
5382
|
title: P.name,
|
5379
5383
|
border: "",
|
@@ -5381,7 +5385,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5381
5385
|
onClick: (Y) => T(P),
|
5382
5386
|
onAction: R
|
5383
5387
|
}, null, 8, ["model-value", "title", "onClick"]))), 256)),
|
5384
|
-
|
5388
|
+
o.value.length ? A("", !0) : (d(), w(n(ie), {
|
5385
5389
|
key: 0,
|
5386
5390
|
"image-size": 50
|
5387
5391
|
})),
|
@@ -5406,7 +5410,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5406
5410
|
onPlus: B
|
5407
5411
|
}, {
|
5408
5412
|
default: y(() => [
|
5409
|
-
(d(!0), j(z, null, W(
|
5413
|
+
(d(!0), j(z, null, W(s.value, (P) => (d(), w(n(ve), {
|
5410
5414
|
"model-value": P,
|
5411
5415
|
title: P.name,
|
5412
5416
|
border: "",
|
@@ -5414,7 +5418,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5414
5418
|
onClick: (Y) => Q(P),
|
5415
5419
|
onAction: fe
|
5416
5420
|
}, null, 8, ["model-value", "title", "onClick"]))), 256)),
|
5417
|
-
|
5421
|
+
s.value.length ? A("", !0) : (d(), w(n(ie), {
|
5418
5422
|
key: 0,
|
5419
5423
|
"image-size": 50
|
5420
5424
|
})),
|
@@ -5459,7 +5463,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5459
5463
|
disabled: !0,
|
5460
5464
|
border: !0
|
5461
5465
|
}
|
5462
|
-
], { apis: l, meta: a } = So(),
|
5466
|
+
], { apis: l, meta: a } = So(), s = S(
|
5463
5467
|
Object.assign({
|
5464
5468
|
type: "api",
|
5465
5469
|
ref: "",
|
@@ -5478,24 +5482,24 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5478
5482
|
})`
|
5479
5483
|
}
|
5480
5484
|
}, e.item)
|
5481
|
-
), r = S(!1), c = S(""), h = S(!1), p = x(() =>
|
5485
|
+
), r = S(!1), c = S(""), h = S(!1), p = x(() => s.value.type === "api" ? l.value.map((b) => ({
|
5482
5486
|
label: b.label || "",
|
5483
5487
|
value: b.id,
|
5484
5488
|
data: b
|
5485
|
-
})) :
|
5489
|
+
})) : s.value.type === "meta" ? a.value.map((b) => ({
|
5486
5490
|
label: b.title || "",
|
5487
5491
|
value: b.id,
|
5488
5492
|
data: b
|
5489
5493
|
})) : []), m = x(() => e.item ? "编辑数据源" : "新增数据源"), f = (b) => {
|
5490
|
-
|
5494
|
+
s.value.ref = "", s.value.name = "", s.value.label = "";
|
5491
5495
|
}, _ = (b) => {
|
5492
|
-
if (
|
5496
|
+
if (s.value.type === "api") {
|
5493
5497
|
const k = l.value.find((C) => C.id === b);
|
5494
|
-
k && (
|
5498
|
+
k && (s.value.name = k.name, s.value.label = k.label || "");
|
5495
5499
|
}
|
5496
|
-
if (
|
5500
|
+
if (s.value.type === "meta") {
|
5497
5501
|
const k = a.value.find((C) => C.id === b);
|
5498
|
-
k && (
|
5502
|
+
k && (s.value.name = k.code, s.value.label = k.title || "");
|
5499
5503
|
}
|
5500
5504
|
}, i = async (b) => {
|
5501
5505
|
const { transform: k, test: C, name: D } = b;
|
@@ -5515,30 +5519,30 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5515
5519
|
return e.current?.setDataSource(b), !0;
|
5516
5520
|
}, g = async () => {
|
5517
5521
|
if (!e.context) return;
|
5518
|
-
if (!
|
5522
|
+
if (!s.value.ref) {
|
5519
5523
|
ae("请先选择API");
|
5520
5524
|
return;
|
5521
5525
|
}
|
5522
|
-
if (!
|
5526
|
+
if (!s.value.test?.value) {
|
5523
5527
|
ae("请先填写测试用例");
|
5524
5528
|
return;
|
5525
5529
|
}
|
5526
|
-
if (!pe(
|
5530
|
+
if (!pe(s.value.test, e.context, !0))
|
5527
5531
|
return;
|
5528
5532
|
const k = async (...$) => {
|
5529
|
-
const O = e.context?.$apis[
|
5533
|
+
const O = e.context?.$apis[s.value.ref];
|
5530
5534
|
if (O)
|
5531
5535
|
return await O.apply(O, $);
|
5532
|
-
|
5533
|
-
}, C = Ze(
|
5536
|
+
Pe.warn(`API【${s.value.ref}】不存在`);
|
5537
|
+
}, C = Ze(s.value.test, {
|
5534
5538
|
runApi: k
|
5535
|
-
}), D =
|
5539
|
+
}), D = s.value.transform?.value ? Ze(s.value.transform, {}, !0) : ($) => $;
|
5536
5540
|
r.value = !0;
|
5537
5541
|
try {
|
5538
5542
|
const $ = await C();
|
5539
5543
|
c.value = JSON.stringify(await D($), null, 2);
|
5540
5544
|
} catch ($) {
|
5541
|
-
|
5545
|
+
Pe.error($);
|
5542
5546
|
}
|
5543
5547
|
r.value = !1, h.value = !0;
|
5544
5548
|
};
|
@@ -5546,7 +5550,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5546
5550
|
width: "1000px",
|
5547
5551
|
height: "700px",
|
5548
5552
|
title: m.value,
|
5549
|
-
model:
|
5553
|
+
model: s.value,
|
5550
5554
|
"form-props": { tooltipMessage: !1 },
|
5551
5555
|
"submit-method": i
|
5552
5556
|
}, {
|
@@ -5576,7 +5580,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5576
5580
|
name: "ref",
|
5577
5581
|
label: "引用",
|
5578
5582
|
editor: "select",
|
5579
|
-
key:
|
5583
|
+
key: s.value.type,
|
5580
5584
|
required: "",
|
5581
5585
|
disabled: !!e.item,
|
5582
5586
|
options: p.value,
|
@@ -5612,8 +5616,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5612
5616
|
}, {
|
5613
5617
|
default: y(() => [
|
5614
5618
|
v(n(se), {
|
5615
|
-
modelValue:
|
5616
|
-
"onUpdate:modelValue": k[0] || (k[0] = (C) =>
|
5619
|
+
modelValue: s.value.transform.value,
|
5620
|
+
"onUpdate:modelValue": k[0] || (k[0] = (C) => s.value.transform.value = C),
|
5617
5621
|
height: "200px",
|
5618
5622
|
dark: ""
|
5619
5623
|
}, null, 8, ["modelValue"])
|
@@ -5627,8 +5631,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5627
5631
|
}, {
|
5628
5632
|
default: y(() => [
|
5629
5633
|
v(n(se), {
|
5630
|
-
modelValue:
|
5631
|
-
"onUpdate:modelValue": k[1] || (k[1] = (C) =>
|
5634
|
+
modelValue: s.value.test.value,
|
5635
|
+
"onUpdate:modelValue": k[1] || (k[1] = (C) => s.value.test.value = C),
|
5632
5636
|
height: "100px",
|
5633
5637
|
dark: ""
|
5634
5638
|
}, null, 8, ["modelValue"])
|
@@ -5664,9 +5668,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5664
5668
|
name: "DataSourcesWidget",
|
5665
5669
|
__name: "index",
|
5666
5670
|
setup(u) {
|
5667
|
-
const { current: e, context: t } = me(), l = S(!1), a = S(),
|
5671
|
+
const { current: e, context: t } = me(), l = S(!1), a = S(), o = x(() => Object.values(e.value?.dataSources || {}).filter(
|
5668
5672
|
(p) => ["meta", "api"].includes(p.type)
|
5669
|
-
)),
|
5673
|
+
)), s = (p) => ({
|
5670
5674
|
api: "primary",
|
5671
5675
|
meta: "success",
|
5672
5676
|
cube: "warning"
|
@@ -5692,18 +5696,18 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5692
5696
|
onPlus: r
|
5693
5697
|
}, {
|
5694
5698
|
default: y(() => [
|
5695
|
-
(d(!0), j(z, null, W(
|
5699
|
+
(d(!0), j(z, null, W(o.value, (f) => (d(), w(n(ve), {
|
5696
5700
|
border: "",
|
5697
5701
|
title: f.name,
|
5698
5702
|
subtitle: f.label,
|
5699
5703
|
"model-value": f,
|
5700
5704
|
actions: ["edit", "remove"],
|
5701
5705
|
tag: f.type.toUpperCase(),
|
5702
|
-
"tag-type":
|
5706
|
+
"tag-type": s(f.type),
|
5703
5707
|
onAction: h,
|
5704
5708
|
onClick: (_) => c(f)
|
5705
5709
|
}, null, 8, ["title", "subtitle", "model-value", "tag", "tag-type", "onClick"]))), 256)),
|
5706
|
-
|
5710
|
+
o.value.length ? A("", !0) : (d(), w(n(ie), {
|
5707
5711
|
key: 0,
|
5708
5712
|
"image-size": 50
|
5709
5713
|
}))
|
@@ -5784,7 +5788,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5784
5788
|
value: "column-reverse",
|
5785
5789
|
svg: Ua
|
5786
5790
|
}
|
5787
|
-
],
|
5791
|
+
], o = [
|
5788
5792
|
{
|
5789
5793
|
label: "flex-start",
|
5790
5794
|
value: "flex-start",
|
@@ -5810,7 +5814,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5810
5814
|
value: "space-around",
|
5811
5815
|
svg: Xa
|
5812
5816
|
}
|
5813
|
-
],
|
5817
|
+
], s = [
|
5814
5818
|
{
|
5815
5819
|
label: "不换行",
|
5816
5820
|
value: "nowrap"
|
@@ -5888,7 +5892,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5888
5892
|
name: "justify-content",
|
5889
5893
|
label: "主轴对齐",
|
5890
5894
|
setters: { name: "TagSetter" },
|
5891
|
-
options:
|
5895
|
+
options: o,
|
5892
5896
|
variable: !1,
|
5893
5897
|
value: e.styleJson["justify-content"],
|
5894
5898
|
onChange: e.setStyle
|
@@ -5906,7 +5910,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5906
5910
|
name: "flex-wrap",
|
5907
5911
|
label: "换行模式",
|
5908
5912
|
setters: { name: "TagSetter" },
|
5909
|
-
options:
|
5913
|
+
options: s,
|
5910
5914
|
variable: !1,
|
5911
5915
|
value: e.styleJson["flex-wrap"],
|
5912
5916
|
onChange: e.setStyle
|
@@ -5928,16 +5932,16 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5928
5932
|
return ne(r) ? null : r;
|
5929
5933
|
}), a = x(
|
5930
5934
|
() => JSON.stringify(l.value?.getPropValue("style") || {}, null, 2)
|
5931
|
-
),
|
5935
|
+
), o = (r) => {
|
5932
5936
|
try {
|
5933
5937
|
const c = JSON.parse(r);
|
5934
5938
|
l.value?.setProp("style", c);
|
5935
5939
|
} catch {
|
5936
5940
|
ae("JSON格式错误");
|
5937
5941
|
}
|
5938
|
-
},
|
5942
|
+
}, s = () => {
|
5939
5943
|
const c = (t.value?.getEditor()).getValue();
|
5940
|
-
|
5944
|
+
o(c), de("保存成功");
|
5941
5945
|
};
|
5942
5946
|
return (r, c) => (d(), w(n(H), {
|
5943
5947
|
class: "v-css-widget v-sub-panel",
|
@@ -5945,7 +5949,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5945
5949
|
size: "small",
|
5946
5950
|
fit: "",
|
5947
5951
|
save: "",
|
5948
|
-
onSave:
|
5952
|
+
onSave: s
|
5949
5953
|
}, {
|
5950
5954
|
default: y(() => [
|
5951
5955
|
v(n(se), {
|
@@ -5955,7 +5959,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5955
5959
|
height: "100%",
|
5956
5960
|
lang: "json",
|
5957
5961
|
dark: "",
|
5958
|
-
onBlur:
|
5962
|
+
onBlur: o
|
5959
5963
|
}, null, 8, ["model-value"])
|
5960
5964
|
]),
|
5961
5965
|
_: 1
|
@@ -5970,8 +5974,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5970
5974
|
},
|
5971
5975
|
emits: ["close", "update:modelValue", "submit"],
|
5972
5976
|
setup(u, { emit: e }) {
|
5973
|
-
const t = [0, 10, 20, 40, 60, 100, 140, 220], l = u, a = e,
|
5974
|
-
Ko(
|
5977
|
+
const t = [0, 10, 20, 40, 60, 100, 140, 220], l = u, a = e, o = x(() => l.auto || l.name.includes("margin")), s = S(), r = S(l.modelValue), c = S("px");
|
5978
|
+
Ko(s, () => {
|
5975
5979
|
a("close");
|
5976
5980
|
});
|
5977
5981
|
const h = (_) => {
|
@@ -5989,7 +5993,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
5989
5993
|
v(n(q), {
|
5990
5994
|
class: "v-spacing-input__body",
|
5991
5995
|
ref_key: "bodyRef",
|
5992
|
-
ref:
|
5996
|
+
ref: s,
|
5993
5997
|
direction: "column"
|
5994
5998
|
}, {
|
5995
5999
|
default: y(() => [
|
@@ -6009,7 +6013,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6009
6013
|
}),
|
6010
6014
|
v(n(q), null, {
|
6011
6015
|
default: y(() => [
|
6012
|
-
|
6016
|
+
o.value ? (d(), w(n(q), {
|
6013
6017
|
key: 0,
|
6014
6018
|
class: "v-spacing-input__auto",
|
6015
6019
|
width: "20%"
|
@@ -6088,7 +6092,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6088
6092
|
setStyle: { type: Function }
|
6089
6093
|
},
|
6090
6094
|
setup(u) {
|
6091
|
-
const e = u, t = S(), l = S(), { width: a, height:
|
6095
|
+
const e = u, t = S(), l = S(), { width: a, height: o } = tt(t), { width: s, height: r } = tt(l), c = S(!1), h = S(), p = S(), m = () => {
|
6092
6096
|
c.value = !1, h.value = void 0, p.value = void 0;
|
6093
6097
|
}, f = (_) => {
|
6094
6098
|
h.value = _, p.value = e.styleJson[_], c.value = !0;
|
@@ -6108,11 +6112,11 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6108
6112
|
}, [
|
6109
6113
|
V("div", oi, [
|
6110
6114
|
V("div", ri, [
|
6111
|
-
n(a) && n(
|
6115
|
+
n(a) && n(o) ? (d(), j("svg", {
|
6112
6116
|
key: 0,
|
6113
6117
|
xmlns: "http://www.w3.org/2000/svg",
|
6114
6118
|
width: n(a),
|
6115
|
-
height: n(
|
6119
|
+
height: n(o),
|
6116
6120
|
style: { "grid-area": "1 / 1 / -1 / -1" }
|
6117
6121
|
}, [
|
6118
6122
|
V("g", null, [
|
@@ -6140,9 +6144,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6140
6144
|
fill: "currentColor",
|
6141
6145
|
d: `
|
6142
6146
|
m${n(a) - 1},1
|
6143
|
-
v${n(
|
6147
|
+
v${n(o) - 1}
|
6144
6148
|
l-${Z},-${ee}
|
6145
|
-
v-${n(
|
6149
|
+
v-${n(o) - 2 * ee}
|
6146
6150
|
l${Z},-${ee}z`,
|
6147
6151
|
"data-automation-id": "margin-right-button",
|
6148
6152
|
"aria-label": "Margin right button",
|
@@ -6157,7 +6161,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6157
6161
|
mode: "delta",
|
6158
6162
|
fill: "currentColor",
|
6159
6163
|
d: `
|
6160
|
-
m1,${n(
|
6164
|
+
m1,${n(o) - 1}
|
6161
6165
|
h${n(a) - 1}
|
6162
6166
|
l-${Z},-${ee}
|
6163
6167
|
h-${n(a) - 2 * Z}
|
@@ -6176,9 +6180,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6176
6180
|
fill: "currentColor",
|
6177
6181
|
d: `
|
6178
6182
|
m1,1
|
6179
|
-
v${n(
|
6183
|
+
v${n(o) - 1}
|
6180
6184
|
l${Z},-${ee}
|
6181
|
-
v-${n(
|
6185
|
+
v-${n(o) - 2 * ee}
|
6182
6186
|
l-${Z},-${ee}z`,
|
6183
6187
|
"data-automation-id": "margin-left-button",
|
6184
6188
|
"aria-label": "Margin left button",
|
@@ -6192,7 +6196,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6192
6196
|
x: "0",
|
6193
6197
|
y: "0",
|
6194
6198
|
width: n(a),
|
6195
|
-
height: n(
|
6199
|
+
height: n(o),
|
6196
6200
|
fill: "transparent",
|
6197
6201
|
rx: "2",
|
6198
6202
|
ry: "2",
|
@@ -6205,7 +6209,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6205
6209
|
x: "0",
|
6206
6210
|
y: "0",
|
6207
6211
|
width: n(a),
|
6208
|
-
height: n(
|
6212
|
+
height: n(o),
|
6209
6213
|
fill: "transparent",
|
6210
6214
|
rx: "2",
|
6211
6215
|
ry: "2",
|
@@ -6216,7 +6220,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6216
6220
|
x: "36",
|
6217
6221
|
y: "24",
|
6218
6222
|
width: n(a) - 2 * Z + 1,
|
6219
|
-
height: n(
|
6223
|
+
height: n(o) - 2 * ee + 1,
|
6220
6224
|
fill: "transparent",
|
6221
6225
|
rx: "2",
|
6222
6226
|
ry: "2",
|
@@ -6229,7 +6233,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6229
6233
|
x: "36",
|
6230
6234
|
y: "24",
|
6231
6235
|
width: n(a) - 2 * Z + 1,
|
6232
|
-
height: n(
|
6236
|
+
height: n(o) - 2 * ee + 1,
|
6233
6237
|
fill: "transparent",
|
6234
6238
|
rx: "2",
|
6235
6239
|
ry: "2",
|
@@ -6258,10 +6262,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6258
6262
|
ref: l,
|
6259
6263
|
class: "spacing-min-icon"
|
6260
6264
|
}, [
|
6261
|
-
n(a) && n(
|
6265
|
+
n(a) && n(o) ? (d(), j("svg", {
|
6262
6266
|
key: 0,
|
6263
6267
|
xmlns: "http://www.w3.org/2000/svg",
|
6264
|
-
width: n(
|
6268
|
+
width: n(s),
|
6265
6269
|
height: n(r),
|
6266
6270
|
style: { "grid-area": "1 / 1 / -1 / -1" }
|
6267
6271
|
}, [
|
@@ -6272,9 +6276,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6272
6276
|
fill: "currentColor",
|
6273
6277
|
d: `
|
6274
6278
|
m1,1
|
6275
|
-
h${n(
|
6279
|
+
h${n(s) - 1}
|
6276
6280
|
l-${Z},${ee}
|
6277
|
-
h-${n(
|
6281
|
+
h-${n(s) - 2 * Z}
|
6278
6282
|
l-${Z},-${ee}z`,
|
6279
6283
|
"data-automation-id": "padding-top-button",
|
6280
6284
|
"aria-label": "Padding top button",
|
@@ -6289,7 +6293,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6289
6293
|
mode: "delta",
|
6290
6294
|
fill: "currentColor",
|
6291
6295
|
d: `
|
6292
|
-
m${n(
|
6296
|
+
m${n(s) - 1},1
|
6293
6297
|
v${n(r) - 1}
|
6294
6298
|
l-${Z},-${ee}
|
6295
6299
|
v-${n(r) - 2 * ee}
|
@@ -6308,9 +6312,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6308
6312
|
fill: "currentColor",
|
6309
6313
|
d: `
|
6310
6314
|
m1,${n(r) - 1}
|
6311
|
-
h${n(
|
6315
|
+
h${n(s) - 1}
|
6312
6316
|
l-${Z},-${ee}
|
6313
|
-
h-${n(
|
6317
|
+
h-${n(s) - 2 * Z}
|
6314
6318
|
l-${Z},${ee}z`,
|
6315
6319
|
"data-automation-id": "padding-bottom-button",
|
6316
6320
|
"aria-label": "Padding bottom button",
|
@@ -6341,7 +6345,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6341
6345
|
V("rect", {
|
6342
6346
|
x: "0",
|
6343
6347
|
y: "0",
|
6344
|
-
width: n(
|
6348
|
+
width: n(s),
|
6345
6349
|
height: n(r),
|
6346
6350
|
fill: "transparent",
|
6347
6351
|
rx: "2",
|
@@ -6354,7 +6358,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6354
6358
|
"clip-path": "url(#padding-outer)",
|
6355
6359
|
x: "0",
|
6356
6360
|
y: "0",
|
6357
|
-
width: n(
|
6361
|
+
width: n(s),
|
6358
6362
|
height: n(r),
|
6359
6363
|
fill: "transparent",
|
6360
6364
|
rx: "2",
|
@@ -6365,7 +6369,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6365
6369
|
V("rect", {
|
6366
6370
|
x: "36",
|
6367
6371
|
y: "24",
|
6368
|
-
width: n(
|
6372
|
+
width: n(s) - 2 * Z + 1,
|
6369
6373
|
height: n(r) - 2 * ee + 1,
|
6370
6374
|
fill: "transparent",
|
6371
6375
|
rx: "2",
|
@@ -6378,7 +6382,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6378
6382
|
"clip-path": "url(#padding-inner)",
|
6379
6383
|
x: "36",
|
6380
6384
|
y: "24",
|
6381
|
-
width: n(
|
6385
|
+
width: n(s) - 2 * Z + 1,
|
6382
6386
|
height: n(r) - 2 * ee + 1,
|
6383
6387
|
fill: "transparent",
|
6384
6388
|
rx: "2",
|
@@ -6501,7 +6505,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6501
6505
|
]
|
6502
6506
|
}
|
6503
6507
|
];
|
6504
|
-
return (
|
6508
|
+
return (o, s) => (d(), w(n(H), {
|
6505
6509
|
title: "尺寸",
|
6506
6510
|
class: "v-sub-panel v-",
|
6507
6511
|
size: "small",
|
@@ -6523,7 +6527,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6523
6527
|
options: r.options,
|
6524
6528
|
variable: !1,
|
6525
6529
|
value: e.styleJson[r.name],
|
6526
|
-
onChange:
|
6530
|
+
onChange: o.setStyle
|
6527
6531
|
}, null, 8, ["name", "label", "setters", "options", "value", "onChange"])), 64))
|
6528
6532
|
]),
|
6529
6533
|
_: 1
|
@@ -6539,7 +6543,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6539
6543
|
setStyle: { type: Function }
|
6540
6544
|
},
|
6541
6545
|
setup(u) {
|
6542
|
-
const e = u, t = S(), { width: l, height: a } = tt(t),
|
6546
|
+
const e = u, t = S(), { width: l, height: a } = tt(t), o = S(!1), s = S(), r = S(), c = [
|
6543
6547
|
{ label: "静态", value: "static" },
|
6544
6548
|
{ label: "相对", value: "relative" },
|
6545
6549
|
{ label: "绝对", value: "absolute" },
|
@@ -6556,9 +6560,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6556
6560
|
{ label: "下", svg: us, value: "0% 0% auto 0%" },
|
6557
6561
|
{ label: "填充", svg: cs, value: "0% 0% 0% 0%" }
|
6558
6562
|
], p = x(() => (e.styleJson.inset || "").split(" ")), m = (_) => {
|
6559
|
-
|
6563
|
+
s.value = _, r.value = e.styleJson[_], o.value = !0;
|
6560
6564
|
}, f = () => {
|
6561
|
-
|
6565
|
+
o.value = !1, s.value = void 0, r.value = void 0;
|
6562
6566
|
};
|
6563
6567
|
return (_, i) => (d(), w(n(H), {
|
6564
6568
|
title: "定位",
|
@@ -6745,10 +6749,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6745
6749
|
onClick: i[7] || (i[7] = (g) => m("left"))
|
6746
6750
|
}, L(e.styleJson.left || p.value[3] || "-"), 3)
|
6747
6751
|
], 512),
|
6748
|
-
|
6752
|
+
o.value ? (d(), w(ll, {
|
6749
6753
|
key: 0,
|
6750
6754
|
auto: "",
|
6751
|
-
name:
|
6755
|
+
name: s.value,
|
6752
6756
|
modelValue: r.value,
|
6753
6757
|
"onUpdate:modelValue": i[8] || (i[8] = (g) => r.value = g),
|
6754
6758
|
onClose: f,
|
@@ -6837,13 +6841,13 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6837
6841
|
], a = [
|
6838
6842
|
{ label: "正常", value: "normal", svg: gs },
|
6839
6843
|
{ label: "斜体", value: "italic", svg: fs }
|
6840
|
-
],
|
6844
|
+
], o = [
|
6841
6845
|
{ label: "无", value: "none", svg: Xn },
|
6842
6846
|
{ label: "下划线", value: "underline", svg: hs },
|
6843
6847
|
{ label: "删除线", value: "line-through", svg: bs },
|
6844
6848
|
{ label: "上划线", value: "overline", svg: ys }
|
6845
6849
|
];
|
6846
|
-
return (
|
6850
|
+
return (s, r) => (d(), w(n(H), {
|
6847
6851
|
title: "文本",
|
6848
6852
|
class: "v-sub-panel",
|
6849
6853
|
size: "small",
|
@@ -6865,7 +6869,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6865
6869
|
options: c.options,
|
6866
6870
|
variable: !1,
|
6867
6871
|
value: e.styleJson[c.name],
|
6868
|
-
onChange:
|
6872
|
+
onChange: s.setStyle
|
6869
6873
|
}, null, 8, ["name", "label", "setters", "options", "value", "onChange"])), 64))
|
6870
6874
|
]),
|
6871
6875
|
_: 1
|
@@ -6881,7 +6885,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6881
6885
|
setters: { name: "ColorSetter" },
|
6882
6886
|
variable: !1,
|
6883
6887
|
value: e.styleJson.color,
|
6884
|
-
onChange:
|
6888
|
+
onChange: s.setStyle
|
6885
6889
|
}, null, 8, ["value", "onChange"]),
|
6886
6890
|
v(n(U), {
|
6887
6891
|
name: "text-align",
|
@@ -6890,7 +6894,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6890
6894
|
variable: !1,
|
6891
6895
|
options: l,
|
6892
6896
|
value: e.styleJson["text-align"],
|
6893
|
-
onChange:
|
6897
|
+
onChange: s.setStyle
|
6894
6898
|
}, null, 8, ["value", "onChange"]),
|
6895
6899
|
v(n(U), {
|
6896
6900
|
name: "font-style",
|
@@ -6899,16 +6903,16 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6899
6903
|
variable: !1,
|
6900
6904
|
options: a,
|
6901
6905
|
value: e.styleJson["font-style"],
|
6902
|
-
onChange:
|
6906
|
+
onChange: s.setStyle
|
6903
6907
|
}, null, 8, ["value", "onChange"]),
|
6904
6908
|
v(n(U), {
|
6905
6909
|
name: "text-decoration",
|
6906
6910
|
label: "修饰",
|
6907
6911
|
setters: { name: "TagSetter" },
|
6908
6912
|
variable: !1,
|
6909
|
-
options:
|
6913
|
+
options: o,
|
6910
6914
|
value: e.styleJson["text-decoration"],
|
6911
|
-
onChange:
|
6915
|
+
onChange: s.setStyle
|
6912
6916
|
}, null, 8, ["value", "onChange"])
|
6913
6917
|
]),
|
6914
6918
|
_: 1
|
@@ -6934,10 +6938,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6934
6938
|
{ label: "水平重复", value: "repeat-x", svg: ws },
|
6935
6939
|
{ label: "垂直重复", value: "repeat-y", svg: ks },
|
6936
6940
|
{ label: "不重复", value: "no-repeat", svg: Ss }
|
6937
|
-
],
|
6941
|
+
], o = [
|
6938
6942
|
{ label: "固定", value: "fixed" },
|
6939
6943
|
{ label: "滚动", value: "scroll" }
|
6940
|
-
],
|
6944
|
+
], s = [
|
6941
6945
|
{ label: "裁剪到填充", value: "padding-box" },
|
6942
6946
|
{ label: "裁剪到内容", value: "content-box" },
|
6943
6947
|
{ label: "裁剪到文字", value: "text" }
|
@@ -6992,7 +6996,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
6992
6996
|
setters: { name: "RadioSetter" },
|
6993
6997
|
variable: !1,
|
6994
6998
|
value: e.styleJson["background-attachment"],
|
6995
|
-
options:
|
6999
|
+
options: o,
|
6996
7000
|
onChange: e.setStyle
|
6997
7001
|
}, null, 8, ["value", "onChange"]),
|
6998
7002
|
v(n(U), {
|
@@ -7018,7 +7022,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7018
7022
|
setters: { name: "SelectSetter" },
|
7019
7023
|
variable: !1,
|
7020
7024
|
value: e.styleJson["background-clip"],
|
7021
|
-
options:
|
7025
|
+
options: s,
|
7022
7026
|
onChange: e.setStyle
|
7023
7027
|
}, null, 8, ["value", "onChange"])
|
7024
7028
|
]),
|
@@ -7044,12 +7048,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7044
7048
|
{ label: "上边框", svg: Vs, value: "border-top" },
|
7045
7049
|
{ label: "下边框", svg: As, value: "border-bottom" },
|
7046
7050
|
{ label: "右边框", svg: js, value: "border-right" }
|
7047
|
-
],
|
7051
|
+
], o = [
|
7048
7052
|
{ label: "无", value: "none", svg: Xn },
|
7049
7053
|
{ label: "实线", value: "solid", svg: Es },
|
7050
7054
|
{ label: "虚线", value: "dashed", svg: Ds },
|
7051
7055
|
{ label: "点线", value: "dotted", svg: Is }
|
7052
|
-
],
|
7056
|
+
], s = (r, c) => {
|
7053
7057
|
l.value = c;
|
7054
7058
|
};
|
7055
7059
|
return M(
|
@@ -7088,7 +7092,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7088
7092
|
variable: !1,
|
7089
7093
|
options: a,
|
7090
7094
|
value: l.value,
|
7091
|
-
onChange:
|
7095
|
+
onChange: s
|
7092
7096
|
}, null, 8, ["value"]),
|
7093
7097
|
l.value ? (d(), j(z, { key: 0 }, [
|
7094
7098
|
(d(), w(n(U), {
|
@@ -7105,7 +7109,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7105
7109
|
key: `${l.value}-style`,
|
7106
7110
|
label: "样式",
|
7107
7111
|
setters: { name: "TagSetter" },
|
7108
|
-
options:
|
7112
|
+
options: o,
|
7109
7113
|
variable: !1,
|
7110
7114
|
value: e.styleJson[`${l.value}-style`],
|
7111
7115
|
onChange: e.setStyle
|
@@ -7172,13 +7176,13 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7172
7176
|
label: "Dark",
|
7173
7177
|
value: "var(--el-box-shadow-dark)"
|
7174
7178
|
}
|
7175
|
-
], a = (
|
7179
|
+
], a = (s, r) => {
|
7176
7180
|
e.setStyle(
|
7177
7181
|
"opacity",
|
7178
7182
|
r !== void 0 ? (Number(r) || 0) / 100 : void 0
|
7179
7183
|
);
|
7180
|
-
},
|
7181
|
-
return (
|
7184
|
+
}, o = () => Number(e.styleJson.opacity ?? 1) * 100;
|
7185
|
+
return (s, r) => (d(), w(n(H), {
|
7182
7186
|
title: "效果",
|
7183
7187
|
class: "v-sub-panel",
|
7184
7188
|
size: "small",
|
@@ -7198,7 +7202,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7198
7202
|
name: "SliderSetter"
|
7199
7203
|
},
|
7200
7204
|
variable: !1,
|
7201
|
-
value:
|
7205
|
+
value: o(),
|
7202
7206
|
onChange: a
|
7203
7207
|
}, null, 8, ["value"]),
|
7204
7208
|
v(n(U), {
|
@@ -7234,15 +7238,15 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7234
7238
|
},
|
7235
7239
|
setup(u) {
|
7236
7240
|
const e = u, { selected: t } = xe(), l = x(() => {
|
7237
|
-
const
|
7238
|
-
return ne(
|
7241
|
+
const s = t.value?.model || null;
|
7242
|
+
return ne(s) ? null : s;
|
7239
7243
|
}), a = x(
|
7240
7244
|
() => l.value?.getPropValue("style") || {}
|
7241
|
-
),
|
7245
|
+
), o = (s, r) => {
|
7242
7246
|
const c = l.value?.getPropValue("style") || {};
|
7243
|
-
r !== void 0 ? c[
|
7247
|
+
r !== void 0 ? c[s] = r : delete c[s], l.value?.setProp("style", c);
|
7244
7248
|
};
|
7245
|
-
return (
|
7249
|
+
return (s, r) => e.isStyleCodeMode ? (d(), w(ni, { key: 0 })) : (d(), w(n(q), {
|
7246
7250
|
key: `widget-style-${l.value?.id}`,
|
7247
7251
|
class: "v-style-widget",
|
7248
7252
|
direction: "column",
|
@@ -7252,42 +7256,42 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7252
7256
|
(d(), w(ti, {
|
7253
7257
|
key: `Layout${l.value?.id}`,
|
7254
7258
|
"style-json": a.value,
|
7255
|
-
setStyle:
|
7259
|
+
setStyle: o
|
7256
7260
|
}, null, 8, ["style-json"])),
|
7257
7261
|
(d(), w(Pi, {
|
7258
7262
|
key: `Spacing${l.value?.id}`,
|
7259
7263
|
"style-json": a.value,
|
7260
|
-
setStyle:
|
7264
|
+
setStyle: o
|
7261
7265
|
}, null, 8, ["style-json"])),
|
7262
7266
|
(d(), w(Ti, {
|
7263
7267
|
key: `Sizing${l.value?.id}`,
|
7264
7268
|
"style-json": a.value,
|
7265
|
-
setStyle:
|
7269
|
+
setStyle: o
|
7266
7270
|
}, null, 8, ["style-json"])),
|
7267
7271
|
(d(), w(Hi, {
|
7268
7272
|
key: `Positioning${l.value?.id}`,
|
7269
7273
|
"style-json": a.value,
|
7270
|
-
setStyle:
|
7274
|
+
setStyle: o
|
7271
7275
|
}, null, 8, ["style-json"])),
|
7272
7276
|
(d(), w(Gi, {
|
7273
7277
|
key: `Texting${l.value?.id}`,
|
7274
7278
|
"style-json": a.value,
|
7275
|
-
setStyle:
|
7279
|
+
setStyle: o
|
7276
7280
|
}, null, 8, ["style-json"])),
|
7277
7281
|
(d(), w(Ki, {
|
7278
7282
|
key: `Backgound${l.value?.id}`,
|
7279
7283
|
"style-json": a.value,
|
7280
|
-
setStyle:
|
7284
|
+
setStyle: o
|
7281
7285
|
}, null, 8, ["style-json"])),
|
7282
7286
|
(d(), w(Xi, {
|
7283
7287
|
key: `Border${l.value?.id}`,
|
7284
7288
|
"style-json": a.value,
|
7285
|
-
setStyle:
|
7289
|
+
setStyle: o
|
7286
7290
|
}, null, 8, ["style-json"])),
|
7287
7291
|
(d(), w(Qi, {
|
7288
7292
|
key: `Effect${l.value?.id}`,
|
7289
7293
|
"style-json": a.value,
|
7290
|
-
setStyle:
|
7294
|
+
setStyle: o
|
7291
7295
|
}, null, 8, ["style-json"]))
|
7292
7296
|
]),
|
7293
7297
|
_: 1
|
@@ -7300,7 +7304,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7300
7304
|
path: { type: Function }
|
7301
7305
|
},
|
7302
7306
|
setup(u, { expose: e }) {
|
7303
|
-
const t = u, l = S(), a = S(Symbol()), { current:
|
7307
|
+
const t = u, l = S(), a = S(Symbol()), { current: o, engine: s } = me(), { width: r, height: c } = tt(l), h = x(() => o.value && t.path ? t.path(o.value) : null), p = x(() => s.skeleton?.getWidget("Toolbar")?.widgetRef.mode ?? "pc");
|
7304
7308
|
return e({
|
7305
7309
|
refresh: () => {
|
7306
7310
|
a.value = Symbol();
|
@@ -7333,12 +7337,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7333
7337
|
inheritAttrs: !1,
|
7334
7338
|
__name: "index",
|
7335
7339
|
setup(u) {
|
7336
|
-
const { selected: e, designer: t } = xe(), l = x(() => (e.value?.path || []).slice(0).reverse()), a = (
|
7337
|
-
t.value?.setSelected(
|
7338
|
-
},
|
7339
|
-
t.value?.setHover(
|
7340
|
+
const { selected: e, designer: t } = xe(), l = x(() => (e.value?.path || []).slice(0).reverse()), a = (s) => {
|
7341
|
+
t.value?.setSelected(s);
|
7342
|
+
}, o = (s) => {
|
7343
|
+
t.value?.setHover(s);
|
7340
7344
|
};
|
7341
|
-
return (
|
7345
|
+
return (s, r) => n(e) ? (d(), w(n(yl), {
|
7342
7346
|
key: 0,
|
7343
7347
|
class: "v-nodepath-widget",
|
7344
7348
|
"separator-icon": n(Rs)
|
@@ -7346,7 +7350,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7346
7350
|
default: y(() => [
|
7347
7351
|
(d(!0), j(z, null, W(l.value, (c) => (d(), w(n(_l), {
|
7348
7352
|
onClick: (h) => a(c),
|
7349
|
-
onMouseover: (h) =>
|
7353
|
+
onMouseover: (h) => o(c)
|
7350
7354
|
}, {
|
7351
7355
|
default: y(() => [
|
7352
7356
|
G(L(c.name), 1)
|
@@ -7363,7 +7367,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7363
7367
|
setup(u) {
|
7364
7368
|
const { current: e } = me(), t = S(), l = x(
|
7365
7369
|
() => JSON.stringify(e.value?.toDsl() || {}, null, 2)
|
7366
|
-
), a = x(() => e.value ? e.value.name : ""),
|
7370
|
+
), a = x(() => e.value ? e.value.name : ""), o = async () => {
|
7367
7371
|
const r = (t.value?.getEditor()).getValue();
|
7368
7372
|
if (r && await He(
|
7369
7373
|
"手动修改DSL有风险,可能导致页面无法加载,请确认您的操作无误。"
|
@@ -7375,14 +7379,14 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7375
7379
|
ae(h?.message);
|
7376
7380
|
}
|
7377
7381
|
};
|
7378
|
-
return (
|
7382
|
+
return (s, r) => (d(), w(n(H), {
|
7379
7383
|
class: "v-schema-widget",
|
7380
7384
|
title: a.value,
|
7381
7385
|
subtitle: "手动修改DSL有风险,可能导致页面无法加载,请确认您的操作无误。",
|
7382
7386
|
size: "small",
|
7383
7387
|
fit: "",
|
7384
7388
|
save: "",
|
7385
|
-
onSave:
|
7389
|
+
onSave: o
|
7386
7390
|
}, {
|
7387
7391
|
default: y(() => [
|
7388
7392
|
v(n(se), {
|
@@ -7401,7 +7405,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7401
7405
|
name: "SchemaWidget",
|
7402
7406
|
__name: "index",
|
7403
7407
|
setup(u) {
|
7404
|
-
const { current: e, engine: t } = me(), l = S(), a = S(""),
|
7408
|
+
const { current: e, engine: t } = me(), l = S(), a = S(""), o = x(() => e.value ? `$vtj/vue/${e.value.id}.vue` : ""), s = x(() => e.value ? e.value.name : "");
|
7405
7409
|
return M(
|
7406
7410
|
e,
|
7407
7411
|
async (r) => {
|
@@ -7417,8 +7421,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7417
7421
|
}
|
7418
7422
|
), (r, c) => (d(), w(n(H), {
|
7419
7423
|
class: "v-raw-widget",
|
7420
|
-
title:
|
7421
|
-
subtitle:
|
7424
|
+
title: s.value,
|
7425
|
+
subtitle: o.value,
|
7422
7426
|
size: "small",
|
7423
7427
|
fit: ""
|
7424
7428
|
}, {
|
@@ -7444,8 +7448,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7444
7448
|
},
|
7445
7449
|
setup(u, { expose: e }) {
|
7446
7450
|
const t = u, l = S(t.url), a = S();
|
7447
|
-
let
|
7448
|
-
const
|
7451
|
+
let o = null;
|
7452
|
+
const s = S(Symbol());
|
7449
7453
|
M(
|
7450
7454
|
() => t.url,
|
7451
7455
|
(p) => {
|
@@ -7453,17 +7457,17 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7453
7457
|
}
|
7454
7458
|
);
|
7455
7459
|
const r = () => {
|
7456
|
-
|
7460
|
+
s.value = Symbol();
|
7457
7461
|
}, c = () => {
|
7458
7462
|
l.value = "//vtj.pro/help/index.html", r();
|
7459
7463
|
};
|
7460
7464
|
gt(() => {
|
7461
|
-
|
7465
|
+
o || (o = wl.service({ target: a.value?.$el }));
|
7462
7466
|
}), wn(() => {
|
7463
|
-
h(),
|
7467
|
+
h(), o = null;
|
7464
7468
|
});
|
7465
7469
|
const h = () => {
|
7466
|
-
|
7470
|
+
o?.close();
|
7467
7471
|
};
|
7468
7472
|
return e({ refresh: r, reload: c }), (p, m) => (d(), w(n(H), {
|
7469
7473
|
class: "v-docs-widget",
|
@@ -7476,7 +7480,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7476
7480
|
}, {
|
7477
7481
|
default: y(() => [
|
7478
7482
|
(d(), j("iframe", {
|
7479
|
-
key:
|
7483
|
+
key: s.value,
|
7480
7484
|
ref: "frame",
|
7481
7485
|
src: l.value,
|
7482
7486
|
onLoad: h
|
@@ -7558,7 +7562,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7558
7562
|
const a = t.skeleton?.getRegion("Workspace");
|
7559
7563
|
a && a.regionRef.openTab("Designer");
|
7560
7564
|
}
|
7561
|
-
}), (a,
|
7565
|
+
}), (a, o) => (d(), w(n(H), {
|
7562
7566
|
class: "v-market-widget",
|
7563
7567
|
size: "small",
|
7564
7568
|
fit: "",
|
@@ -7579,8 +7583,8 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7579
7583
|
const { span: t } = Ht(240), {
|
7580
7584
|
templates: l,
|
7581
7585
|
toRemoteAuth: a,
|
7582
|
-
isLogined:
|
7583
|
-
installTemplate:
|
7586
|
+
isLogined: o,
|
7587
|
+
installTemplate: s,
|
7584
7588
|
access: r,
|
7585
7589
|
refreshTemplates: c,
|
7586
7590
|
loading: h,
|
@@ -7589,7 +7593,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7589
7593
|
const D = r?.getData()?.id;
|
7590
7594
|
return yt(f.value, ($) => $.userId === D ? "我的" : $.category);
|
7591
7595
|
}), i = x(() => Object.keys(_.value)), g = x(() => `(共 ${l.value.length} 个)`), b = async (D) => {
|
7592
|
-
await
|
7596
|
+
await o() ? await s(D.id) : await De.confirm(
|
7593
7597
|
"使用需登录,您还没登录或登录已过期,请重新登录!",
|
7594
7598
|
"提示",
|
7595
7599
|
{
|
@@ -7598,7 +7602,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7598
7602
|
}
|
7599
7603
|
).catch(() => !1) && a();
|
7600
7604
|
}, k = (D) => D.userId === r?.getData()?.id, C = async (D) => {
|
7601
|
-
await
|
7605
|
+
await De.confirm("确定删除该模版?", "提示", {
|
7602
7606
|
type: "warning"
|
7603
7607
|
}).catch(() => !1) && (await p(D.id), c());
|
7604
7608
|
};
|
@@ -7720,7 +7724,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
7720
7724
|
__name: "index",
|
7721
7725
|
setup(u) {
|
7722
7726
|
const e = ce(), { access: t } = e.adapter || {}, l = t?.getData()?.avatar;
|
7723
|
-
return (a,
|
7727
|
+
return (a, o) => (d(), w(n(Sl), {
|
7724
7728
|
class: "v-user-avatar",
|
7725
7729
|
size: 30,
|
7726
7730
|
icon: n(zs),
|
@@ -8666,11 +8670,11 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8666
8670
|
const t = (c = "") => ({
|
8667
8671
|
type: "JSExpression",
|
8668
8672
|
value: et(c) ? c.value : c
|
8669
|
-
}), l = u, a = e,
|
8673
|
+
}), l = u, a = e, o = (c) => pe(c, l.context, !0), s = S(t(l.modelValue).value);
|
8670
8674
|
M(
|
8671
8675
|
() => l.modelValue,
|
8672
8676
|
(c) => {
|
8673
|
-
|
8677
|
+
s.value = t(c).value;
|
8674
8678
|
},
|
8675
8679
|
{
|
8676
8680
|
immediate: !0
|
@@ -8681,12 +8685,12 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8681
8685
|
type: "JSExpression",
|
8682
8686
|
value: c
|
8683
8687
|
};
|
8684
|
-
|
8688
|
+
o(h) && a("change", h);
|
8685
8689
|
};
|
8686
8690
|
return (c, h) => (d(), w(n(be), {
|
8687
8691
|
class: "v-expression-setter",
|
8688
|
-
modelValue:
|
8689
|
-
"onUpdate:modelValue": h[0] || (h[0] = (p) =>
|
8692
|
+
modelValue: s.value,
|
8693
|
+
"onUpdate:modelValue": h[0] || (h[0] = (p) => s.value = p),
|
8690
8694
|
onChange: r
|
8691
8695
|
}, {
|
8692
8696
|
prefix: y(() => [
|
@@ -8724,14 +8728,14 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8724
8728
|
},
|
8725
8729
|
emits: ["change"],
|
8726
8730
|
setup(u, { emit: e }) {
|
8727
|
-
const t = u, l = e, a = x(() => et(t.modelValue) ? void 0 : Number(t.modelValue || 0)),
|
8728
|
-
l("change",
|
8731
|
+
const t = u, l = e, a = x(() => et(t.modelValue) ? void 0 : Number(t.modelValue || 0)), o = (s) => {
|
8732
|
+
l("change", s);
|
8729
8733
|
};
|
8730
|
-
return (
|
8734
|
+
return (s, r) => (d(), w(n(Vl), ue({
|
8731
8735
|
class: "v-number-setter",
|
8732
8736
|
"controls-position": "right",
|
8733
8737
|
"model-value": a.value
|
8734
|
-
},
|
8738
|
+
}, s.$attrs, { onChange: o }), null, 16, ["model-value"]));
|
8735
8739
|
}
|
8736
8740
|
}), Bu = /* @__PURE__ */ E({
|
8737
8741
|
name: "ColorSetter",
|
@@ -8750,7 +8754,7 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8750
8754
|
setup(u, { emit: e }) {
|
8751
8755
|
const t = u, l = S(), a = S(
|
8752
8756
|
typeof t.modelValue == "object" ? JSON.stringify(t.modelValue, null, 2) : void 0
|
8753
|
-
),
|
8757
|
+
), o = x(() => !!a.value), s = S(!1), r = e, c = (f) => {
|
8754
8758
|
let _ = !0;
|
8755
8759
|
try {
|
8756
8760
|
const i = JSON.parse(f);
|
@@ -8771,15 +8775,15 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8771
8775
|
const f = l.value?.getEditor();
|
8772
8776
|
if (f) {
|
8773
8777
|
const _ = f.getValue();
|
8774
|
-
c(_) && (a.value = _, r("change", JSON.parse(_)),
|
8778
|
+
c(_) && (a.value = _, r("change", JSON.parse(_)), s.value = !1);
|
8775
8779
|
}
|
8776
8780
|
}, p = () => {
|
8777
|
-
a.value = "", r("change", void 0),
|
8781
|
+
a.value = "", r("change", void 0), s.value = !1;
|
8778
8782
|
}, m = () => {
|
8779
|
-
|
8783
|
+
s.value = !0;
|
8780
8784
|
};
|
8781
8785
|
return (f, _) => (d(), j("div", {
|
8782
|
-
class: K(["v-json-setter", { "is-active":
|
8786
|
+
class: K(["v-json-setter", { "is-active": o.value }])
|
8783
8787
|
}, [
|
8784
8788
|
v(n(be), ue({
|
8785
8789
|
readonly: "",
|
@@ -8787,10 +8791,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8787
8791
|
"model-value": t.type,
|
8788
8792
|
"suffix-icon": n(lt)
|
8789
8793
|
}, f.$attrs), null, 16, ["model-value", "suffix-icon"]),
|
8790
|
-
|
8794
|
+
s.value ? (d(), w(n(Oe), {
|
8791
8795
|
key: 0,
|
8792
|
-
modelValue:
|
8793
|
-
"onUpdate:modelValue": _[0] || (_[0] = (i) =>
|
8796
|
+
modelValue: s.value,
|
8797
|
+
"onUpdate:modelValue": _[0] || (_[0] = (i) => s.value = i),
|
8794
8798
|
title: t.type,
|
8795
8799
|
width: "1000px",
|
8796
8800
|
height: "600px",
|
@@ -8837,22 +8841,22 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8837
8841
|
},
|
8838
8842
|
emits: ["change"],
|
8839
8843
|
setup(u, { emit: e }) {
|
8840
|
-
const t = u, l = S(), a = S(t.modelValue.value),
|
8844
|
+
const t = u, l = S(), a = S(t.modelValue.value), o = S(!1), s = x(() => !!a.value), r = e, c = () => {
|
8841
8845
|
const m = l.value?.getEditor();
|
8842
8846
|
if (m) {
|
8843
8847
|
const f = m.getValue(), _ = {
|
8844
8848
|
type: "JSFunction",
|
8845
8849
|
value: f
|
8846
8850
|
};
|
8847
|
-
pe(_, {}) && (a.value = f, r("change", _),
|
8851
|
+
pe(_, {}) && (a.value = f, r("change", _), o.value = !1);
|
8848
8852
|
}
|
8849
8853
|
}, h = () => {
|
8850
|
-
a.value = "", r("change", void 0),
|
8854
|
+
a.value = "", r("change", void 0), o.value = !1;
|
8851
8855
|
}, p = () => {
|
8852
|
-
|
8856
|
+
o.value = !0;
|
8853
8857
|
};
|
8854
8858
|
return (m, f) => (d(), j("div", {
|
8855
|
-
class: K(["v-function-setter", { "is-active":
|
8859
|
+
class: K(["v-function-setter", { "is-active": s.value }])
|
8856
8860
|
}, [
|
8857
8861
|
v(n(be), ue({
|
8858
8862
|
readonly: "",
|
@@ -8860,10 +8864,10 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8860
8864
|
"model-value": "JSFunction",
|
8861
8865
|
"suffix-icon": n(lt)
|
8862
8866
|
}, m.$attrs), null, 16, ["suffix-icon"]),
|
8863
|
-
|
8867
|
+
o.value ? (d(), w(n(Oe), {
|
8864
8868
|
key: 0,
|
8865
|
-
modelValue:
|
8866
|
-
"onUpdate:modelValue": f[0] || (f[0] = (_) =>
|
8869
|
+
modelValue: o.value,
|
8870
|
+
"onUpdate:modelValue": f[0] || (f[0] = (_) => o.value = _),
|
8867
8871
|
title: "JSFunction",
|
8868
8872
|
width: "1000px",
|
8869
8873
|
height: "600px",
|
@@ -8939,13 +8943,13 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8939
8943
|
},
|
8940
8944
|
emits: ["update:modelValue", "change"],
|
8941
8945
|
setup(u, { emit: e }) {
|
8942
|
-
const t = u, l = e, a = (
|
8943
|
-
|
8946
|
+
const t = u, l = e, a = (o) => {
|
8947
|
+
o.value === t.modelValue ? (l("update:modelValue", void 0), l("change", void 0)) : (l("update:modelValue", o.value), l("change", o.value));
|
8944
8948
|
};
|
8945
|
-
return (
|
8949
|
+
return (o, s) => (d(), j("div", ue({
|
8946
8950
|
class: "v-tag-setter",
|
8947
8951
|
size: "small"
|
8948
|
-
},
|
8952
|
+
}, o.$attrs), [
|
8949
8953
|
(d(!0), j(z, null, W(t.options, (r) => (d(), j("span", {
|
8950
8954
|
label: r.value,
|
8951
8955
|
title: r.label,
|
@@ -8972,23 +8976,23 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
8972
8976
|
},
|
8973
8977
|
emits: ["change"],
|
8974
8978
|
setup(u, { emit: e }) {
|
8975
|
-
const t = u, l = e, a = S(!0),
|
8979
|
+
const t = u, l = e, a = S(!0), o = x(() => a.value ? "px" : void 0), s = S(t.modelValue), r = (c) => {
|
8976
8980
|
a.value = !!Number(c);
|
8977
8981
|
};
|
8978
|
-
return M(
|
8982
|
+
return M(s, (c) => {
|
8979
8983
|
l("change", c);
|
8980
8984
|
}), M(
|
8981
8985
|
() => t.modelValue,
|
8982
8986
|
(c) => {
|
8983
|
-
c && (a.value = c.endsWith("px"),
|
8987
|
+
c && (a.value = c.endsWith("px"), s.value = c);
|
8984
8988
|
},
|
8985
8989
|
{ immediate: !0 }
|
8986
8990
|
), (c, h) => (d(), w(n(Tn), ue({
|
8987
8991
|
clearable: "",
|
8988
|
-
unit:
|
8989
|
-
"with-unit": !!
|
8990
|
-
modelValue:
|
8991
|
-
"onUpdate:modelValue": h[0] || (h[0] = (p) =>
|
8992
|
+
unit: o.value,
|
8993
|
+
"with-unit": !!o.value,
|
8994
|
+
modelValue: s.value,
|
8995
|
+
"onUpdate:modelValue": h[0] || (h[0] = (p) => s.value = p),
|
8992
8996
|
onChange: r
|
8993
8997
|
}, c.$attrs), null, 16, ["unit", "with-unit", "modelValue"]));
|
8994
8998
|
}
|
@@ -9001,9 +9005,9 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
9001
9005
|
},
|
9002
9006
|
emits: ["change", "update:modelValue"],
|
9003
9007
|
setup(u, { emit: e }) {
|
9004
|
-
const t = u, l = e, a = S([]),
|
9008
|
+
const t = u, l = e, a = S([]), o = x(() => a.value.length < t.limit), s = (c) => c.type.includes("image") ? (Ll(c).then((h) => {
|
9005
9009
|
a.value = [{ name: c.name, url: h }];
|
9006
|
-
}), !1) : (
|
9010
|
+
}), !1) : (Ie.error("只能上传图片"), !1), r = () => {
|
9007
9011
|
a.value = [];
|
9008
9012
|
};
|
9009
9013
|
return M(
|
@@ -9018,13 +9022,13 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
9018
9022
|
const c = a.value[0]?.url;
|
9019
9023
|
l("change", c), l("update:modelValue", c);
|
9020
9024
|
}), (c, h) => (d(), w(n(jl), ue({
|
9021
|
-
class: ["v-image-setter", { "v-image-setter--addable":
|
9025
|
+
class: ["v-image-setter", { "v-image-setter--addable": o.value }],
|
9022
9026
|
"list-type": "picture-card",
|
9023
9027
|
limit: 1,
|
9024
9028
|
action: "#",
|
9025
9029
|
"file-list": a.value,
|
9026
9030
|
"onUpdate:fileList": h[0] || (h[0] = (p) => a.value = p),
|
9027
|
-
"before-upload":
|
9031
|
+
"before-upload": s,
|
9028
9032
|
"auto-upload": !0,
|
9029
9033
|
"on-remove": r
|
9030
9034
|
}, c.$attrs), {
|
@@ -9048,20 +9052,20 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
9048
9052
|
const t = u, l = e, a = S(new Array(t.sections).fill(""));
|
9049
9053
|
M(
|
9050
9054
|
() => t.modelValue,
|
9051
|
-
(
|
9052
|
-
a.value =
|
9055
|
+
(s) => {
|
9056
|
+
a.value = s ? s.split(" ") : new Array(t.sections).fill("");
|
9053
9057
|
},
|
9054
9058
|
{ immediate: !0 }
|
9055
9059
|
);
|
9056
|
-
const
|
9060
|
+
const o = () => {
|
9057
9061
|
l("change", a.value.join(" ").trim());
|
9058
9062
|
};
|
9059
|
-
return (
|
9063
|
+
return (s, r) => (d(), j("div", Mu, [
|
9060
9064
|
(d(!0), j(z, null, W(t.sections, (c) => (d(), w(sl, {
|
9061
9065
|
name: c - 1,
|
9062
9066
|
modelValue: a.value[c - 1],
|
9063
9067
|
"onUpdate:modelValue": (h) => a.value[c - 1] = h,
|
9064
|
-
onChange:
|
9068
|
+
onChange: o,
|
9065
9069
|
class: "v-section-setter__item"
|
9066
9070
|
}, null, 8, ["name", "modelValue", "onUpdate:modelValue"]))), 256))
|
9067
9071
|
]));
|
@@ -9077,23 +9081,23 @@ const Yo = { class: "v-icon-setter" }, Zo = { class: "v-icon-setter__content" },
|
|
9077
9081
|
const t = u, l = e, a = S();
|
9078
9082
|
M(
|
9079
9083
|
() => t.modelValue,
|
9080
|
-
(
|
9081
|
-
a.value =
|
9084
|
+
(s) => {
|
9085
|
+
a.value = s;
|
9082
9086
|
},
|
9083
9087
|
{ immediate: !0 }
|
9084
|
-
), M(a, (
|
9085
|
-
l("change",
|
9088
|
+
), M(a, (s) => {
|
9089
|
+
l("change", s), l("update:modelValue", s);
|
9086
9090
|
});
|
9087
|
-
const
|
9091
|
+
const o = () => {
|
9088
9092
|
a.value = void 0, l("change", void 0), l("update:modelValue", void 0);
|
9089
9093
|
};
|
9090
|
-
return (
|
9091
|
-
v(n(El), ue({ size: "small" },
|
9094
|
+
return (s, r) => (d(), j("div", Uu, [
|
9095
|
+
v(n(El), ue({ size: "small" }, s.$attrs, {
|
9092
9096
|
modelValue: a.value,
|
9093
9097
|
"onUpdate:modelValue": r[0] || (r[0] = (c) => a.value = c)
|
9094
9098
|
}), null, 16, ["modelValue"]),
|
9095
9099
|
v(n(Re), {
|
9096
|
-
onClick:
|
9100
|
+
onClick: o,
|
9097
9101
|
class: "v-slider-setter__close",
|
9098
9102
|
size: 16,
|
9099
9103
|
icon: n(Hs)
|
@@ -9289,7 +9293,7 @@ class Ku {
|
|
9289
9293
|
set(e, t) {
|
9290
9294
|
const l = this.widgets[e];
|
9291
9295
|
if (!l) {
|
9292
|
-
|
9296
|
+
Pe.warn(`widget '${e}' is not found`);
|
9293
9297
|
return;
|
9294
9298
|
}
|
9295
9299
|
Jt(l, t), t.component && (l.component = t.component);
|
@@ -9304,7 +9308,7 @@ class Ku {
|
|
9304
9308
|
const l = Object.values(this.widgets);
|
9305
9309
|
return e ? l.filter(
|
9306
9310
|
(a) => a.region === e && (!t || t && t === a.group)
|
9307
|
-
).map((a,
|
9311
|
+
).map((a, o) => (a.order = a.order ?? o, a)).sort((a, o) => (a.order ?? 0) - (o.order ?? 0)) : l;
|
9308
9312
|
}
|
9309
9313
|
}
|
9310
9314
|
const ol = new Ku();
|
@@ -9342,7 +9346,7 @@ class Xu {
|
|
9342
9346
|
merge(e) {
|
9343
9347
|
const t = [];
|
9344
9348
|
for (const l of this.deps) {
|
9345
|
-
const a = e.find((
|
9349
|
+
const a = e.find((o) => o.package === l.package);
|
9346
9350
|
t.push(
|
9347
9351
|
a ? {
|
9348
9352
|
...a,
|
@@ -9352,7 +9356,7 @@ class Xu {
|
|
9352
9356
|
);
|
9353
9357
|
}
|
9354
9358
|
for (const l of e)
|
9355
|
-
this.deps.find((
|
9359
|
+
this.deps.find((o) => o.package === l.package) || t.push(l);
|
9356
9360
|
return t;
|
9357
9361
|
}
|
9358
9362
|
/**
|
@@ -9401,7 +9405,7 @@ class Yu {
|
|
9401
9405
|
set(e, t) {
|
9402
9406
|
const l = this.setters[e];
|
9403
9407
|
if (!l) {
|
9404
|
-
|
9408
|
+
Pe.warn(`setter '${e}' is not found`);
|
9405
9409
|
return;
|
9406
9410
|
}
|
9407
9411
|
Jt(l, t), t.component && (l.component = t.component);
|
@@ -9428,9 +9432,9 @@ class Zu {
|
|
9428
9432
|
a.type = "module", a.src = t, a.onload = () => l && l(), e.document.head.appendChild(a);
|
9429
9433
|
}
|
9430
9434
|
async loadScripts(e, t) {
|
9431
|
-
const l = this.engine?.project.value, { __BASE_PATH__: a = "/" } = l || {},
|
9435
|
+
const l = this.engine?.project.value, { __BASE_PATH__: a = "/" } = l || {}, o = "", s = Date.now(), r = `${o}${a}${so}?t=${s}`;
|
9432
9436
|
this.enabled === void 0 && (this.enabled = await this.checkDevtools(r)), this.enabled && this.createScript(e, r, () => {
|
9433
|
-
const c = `${
|
9437
|
+
const c = `${o}${a}${oo}?t=${s}`;
|
9434
9438
|
this.isInited ? this.createScript(e, c, t) : t();
|
9435
9439
|
});
|
9436
9440
|
}
|
@@ -9577,9 +9581,9 @@ class tc {
|
|
9577
9581
|
}
|
9578
9582
|
async getDropSlot(e) {
|
9579
9583
|
if (!e) return;
|
9580
|
-
const { engine: t, dropping: l } = this, a = l.value ? this.getVueInstance(l.value, e.id) : null,
|
9581
|
-
if (!c?.slots &&
|
9582
|
-
const p = (c?.slots || ["default"]).concat(
|
9584
|
+
const { engine: t, dropping: l } = this, a = l.value ? this.getVueInstance(l.value, e.id) : null, o = a?.$vtjDynamicSlots ? a.$vtjDynamicSlots() : [], s = t.assets, r = s.componentMap, c = await s.getBlockMaterial(e.from) || r.get(e.name);
|
9585
|
+
if (!c?.slots && o.length === 0) return;
|
9586
|
+
const p = (c?.slots || ["default"]).concat(o).map((f) => typeof f == "string" ? {
|
9583
9587
|
name: f,
|
9584
9588
|
params: []
|
9585
9589
|
} : {
|
@@ -9597,33 +9601,33 @@ class tc {
|
|
9597
9601
|
return m;
|
9598
9602
|
}
|
9599
9603
|
getVueInstance(e, t) {
|
9600
|
-
const { el: l, model: a } = e,
|
9601
|
-
if (!
|
9602
|
-
const
|
9603
|
-
return
|
9604
|
+
const { el: l, model: a } = e, o = l.__context__?.__refs;
|
9605
|
+
if (!o) return null;
|
9606
|
+
const s = o[t || a.id];
|
9607
|
+
return s?._?.exposed || s;
|
9604
9608
|
}
|
9605
9609
|
async onDrop(e) {
|
9606
9610
|
e.preventDefault();
|
9607
|
-
const { engine: t, dragging: l, dropping: a, draggingNode:
|
9608
|
-
if (!
|
9611
|
+
const { engine: t, dragging: l, dropping: a, draggingNode: o } = this, s = t.current.value, r = this.getHelper(e);
|
9612
|
+
if (!s || !l || !a.value || !r) return;
|
9609
9613
|
const c = r.model, h = a.value.type;
|
9610
9614
|
if (!await this.allowDrop(c, h)) return;
|
9611
9615
|
let p;
|
9612
|
-
if (
|
9613
|
-
p =
|
9616
|
+
if (o)
|
9617
|
+
p = o;
|
9614
9618
|
else {
|
9615
9619
|
const m = this.createNodeDsl(l);
|
9616
9620
|
p = new ln(m);
|
9617
9621
|
}
|
9618
9622
|
if (ne(c))
|
9619
|
-
|
9623
|
+
o ? (delete p.slot, s.move(p, void 0, "inner")) : s.addNode(p, void 0, h);
|
9620
9624
|
else {
|
9621
9625
|
const m = await this.getDropSlot(h === "inner" ? c : c.parent);
|
9622
9626
|
if (m === null) {
|
9623
9627
|
this.dropping.value = null;
|
9624
9628
|
return;
|
9625
9629
|
}
|
9626
|
-
p.slot = m,
|
9630
|
+
p.slot = m, o ? s.move(p, c, h) : s.addNode(p, c, h);
|
9627
9631
|
}
|
9628
9632
|
this.dropping.value = null, t.simulator.refresh(), t.assets.clearCaches();
|
9629
9633
|
}
|
@@ -9656,12 +9660,12 @@ class tc {
|
|
9656
9660
|
return ln.nodes[t] || null;
|
9657
9661
|
}
|
9658
9662
|
getDropType(e, t, l) {
|
9659
|
-
const { left: a, top:
|
9660
|
-
return t >= a && t <= a +
|
9663
|
+
const { left: a, top: o, width: s, height: r } = e;
|
9664
|
+
return t >= a && t <= a + s * 0.2 ? "left" : t >= a + s * 0.8 && t <= a + s ? "right" : l >= o && l <= o + r * 0.2 ? "top" : l >= o + r * 0.8 && l <= o + r ? "bottom" : "inner";
|
9661
9665
|
}
|
9662
9666
|
getNodePath(e = []) {
|
9663
|
-
const t = e.filter((
|
9664
|
-
return [...t.map((
|
9667
|
+
const t = e.filter((o) => this.isVtjElement(o)), l = this.engine.current.value;
|
9668
|
+
return [...t.map((o) => this.getNodeByElement(o)).filter((o) => !!o), l];
|
9665
9669
|
}
|
9666
9670
|
setDslFrom(e) {
|
9667
9671
|
const t = this.engine.assets.componentMap.get(e.name);
|
@@ -9670,12 +9674,12 @@ class tc {
|
|
9670
9674
|
this.setDslFrom(l);
|
9671
9675
|
}
|
9672
9676
|
createNodeDsl(e) {
|
9673
|
-
const { name: t, snippet: l = {}, from: a } = e,
|
9677
|
+
const { name: t, snippet: l = {}, from: a } = e, o = {
|
9674
9678
|
...l,
|
9675
9679
|
name: t,
|
9676
9680
|
from: a || e.package
|
9677
9681
|
};
|
9678
|
-
return this.setDslFrom(
|
9682
|
+
return this.setDslFrom(o), o;
|
9679
9683
|
}
|
9680
9684
|
getElmenetByModel(e) {
|
9681
9685
|
return !this.document || !e ? null : ne(e) ? this.document.body : Array.from(
|
@@ -9697,12 +9701,12 @@ class tc {
|
|
9697
9701
|
if (!l) return null;
|
9698
9702
|
const a = this.getNodeByElement(l) || this.engine.current.value;
|
9699
9703
|
if (!a) return null;
|
9700
|
-
const
|
9704
|
+
const o = l.getBoundingClientRect(), s = this.getDropType(o, e.clientX, e.clientY), r = this.getNodePath(t);
|
9701
9705
|
return {
|
9702
9706
|
el: l,
|
9703
9707
|
model: a,
|
9704
|
-
rect:
|
9705
|
-
type:
|
9708
|
+
rect: o,
|
9709
|
+
type: s,
|
9706
9710
|
path: r
|
9707
9711
|
};
|
9708
9712
|
}
|
@@ -9767,22 +9771,22 @@ class tc {
|
|
9767
9771
|
if (await Ce(), e) {
|
9768
9772
|
const l = this.getElmenetByModel(e);
|
9769
9773
|
if (!l) return;
|
9770
|
-
const a = l.getBoundingClientRect(),
|
9774
|
+
const a = l.getBoundingClientRect(), o = ne(e) ? [] : this.findPathByNode(e);
|
9771
9775
|
this.dropping.value = {
|
9772
9776
|
el: l,
|
9773
9777
|
model: e,
|
9774
9778
|
rect: a,
|
9775
9779
|
type: t,
|
9776
|
-
path:
|
9780
|
+
path: o
|
9777
9781
|
};
|
9778
9782
|
} else
|
9779
9783
|
this.dropping.value = null;
|
9780
9784
|
}
|
9781
9785
|
async allowDrop(e, t = "inner") {
|
9782
|
-
const { dragging: l, engine: a, draggingNode:
|
9783
|
-
if (!l || !
|
9786
|
+
const { dragging: l, engine: a, draggingNode: o } = this, s = a.current.value;
|
9787
|
+
if (!l || !s) return !1;
|
9784
9788
|
if (ne(e)) return !0;
|
9785
|
-
if (
|
9789
|
+
if (o && e.id === o.id || o && o.isChild(e))
|
9786
9790
|
return !1;
|
9787
9791
|
const r = a.assets.componentMap, c = t !== "inner" && e.parent || e, h = await a.assets.getBlockMaterial(c.from) || r.get(c.name);
|
9788
9792
|
if (!h) return !1;
|
@@ -9806,7 +9810,7 @@ class nc {
|
|
9806
9810
|
}
|
9807
9811
|
install(e) {
|
9808
9812
|
e.__vtj_env__ = this.env;
|
9809
|
-
const { library: t, globals: l, VueRouter: a, locales:
|
9813
|
+
const { library: t, globals: l, VueRouter: a, locales: o } = this.env;
|
9810
9814
|
if (a) {
|
9811
9815
|
const r = a.createRouter({
|
9812
9816
|
history: a.createWebHashHistory(),
|
@@ -9815,36 +9819,36 @@ class nc {
|
|
9815
9819
|
e.use(r);
|
9816
9820
|
}
|
9817
9821
|
e.use(this.provider);
|
9818
|
-
const
|
9819
|
-
Object.assign(e.config.globalProperties, l),
|
9822
|
+
const s = Object.entries(t);
|
9823
|
+
Object.assign(e.config.globalProperties, l), s.forEach(([r, c]) => {
|
9820
9824
|
if (!c) {
|
9821
9825
|
console.warn(`plugin: ${r} is undefined`);
|
9822
9826
|
return;
|
9823
9827
|
}
|
9824
9828
|
if (typeof c == "function" || typeof c.install == "function") {
|
9825
9829
|
let h = {};
|
9826
|
-
const p =
|
9830
|
+
const p = o[r];
|
9827
9831
|
p && (h.locale = p), e?.use(c, h);
|
9828
9832
|
}
|
9829
9833
|
});
|
9830
9834
|
}
|
9831
9835
|
render(e, t) {
|
9832
9836
|
this.file = t;
|
9833
|
-
const { window: l, container: a, library:
|
9834
|
-
h.id = "app", t?.type === "page" && h.classList.add("is-page"), t?.pure && h.classList.add("is-pure"), a.appendChild(h), this.dsl =
|
9837
|
+
const { window: l, container: a, library: o, Vue: s, components: r, apis: c } = this.env, h = l.document.createElement("div");
|
9838
|
+
h.id = "app", t?.type === "page" && h.classList.add("is-page"), t?.pure && h.classList.add("is-pure"), a.appendChild(h), this.dsl = s.reactive(e.toDsl());
|
9835
9839
|
const { renderer: m, context: f } = this.provider.createDslRenderer(this.dsl, {
|
9836
9840
|
window: l,
|
9837
9841
|
mode: On.Design,
|
9838
|
-
Vue:
|
9842
|
+
Vue: s,
|
9839
9843
|
components: r,
|
9840
9844
|
apis: c,
|
9841
|
-
libs:
|
9842
|
-
}), _ =
|
9845
|
+
libs: o
|
9846
|
+
}), _ = s.defineComponent({
|
9843
9847
|
render() {
|
9844
|
-
return
|
9848
|
+
return s.h(s.Suspense, [s.h(m)]);
|
9845
9849
|
}
|
9846
9850
|
});
|
9847
|
-
this.app =
|
9851
|
+
this.app = s.createApp(_), this.install(this.app), Object.assign(
|
9848
9852
|
this.app.config.globalProperties.$route.meta,
|
9849
9853
|
t?.meta || {}
|
9850
9854
|
);
|
@@ -9869,12 +9873,12 @@ class nc {
|
|
9869
9873
|
const l = t.children || t.nodes || [];
|
9870
9874
|
if (Array.isArray(l))
|
9871
9875
|
for (let a = 0; a < l.length; a++) {
|
9872
|
-
const
|
9873
|
-
if (
|
9876
|
+
const o = l[a];
|
9877
|
+
if (o.id === e.id) {
|
9874
9878
|
l.splice(a, 1, e);
|
9875
9879
|
return;
|
9876
9880
|
} else
|
9877
|
-
this.updateChild(e,
|
9881
|
+
this.updateChild(e, o);
|
9878
9882
|
}
|
9879
9883
|
}
|
9880
9884
|
__onNodeChange(e) {
|
@@ -9900,9 +9904,9 @@ class lc extends Rn {
|
|
9900
9904
|
this.refresh();
|
9901
9905
|
});
|
9902
9906
|
}
|
9903
|
-
init(t, l, a,
|
9907
|
+
init(t, l, a, o, s) {
|
9904
9908
|
M(
|
9905
|
-
[t, l, a,
|
9909
|
+
[t, l, a, o, s],
|
9906
9910
|
() => {
|
9907
9911
|
t.value && l.value.length && (this.resetReady(), this.renderer?.dispose(), this.renderer = null, this.setup(t.value, l.value), this.contentWindow && (this.designer.value?.dispose(), this.designer.value = new tc(
|
9908
9912
|
this.engine,
|
@@ -9917,14 +9921,14 @@ class lc extends Rn {
|
|
9917
9921
|
setup(t, l) {
|
9918
9922
|
const a = t.contentWindow;
|
9919
9923
|
if (!a) {
|
9920
|
-
|
9924
|
+
Pe.warn("Simulator contentWindow is null");
|
9921
9925
|
return;
|
9922
9926
|
}
|
9923
9927
|
a.__simulator__ = this;
|
9924
|
-
const
|
9928
|
+
const o = a.document;
|
9925
9929
|
this.contentWindow = a;
|
9926
9930
|
const {
|
9927
|
-
scripts:
|
9931
|
+
scripts: s,
|
9928
9932
|
css: r,
|
9929
9933
|
materials: c,
|
9930
9934
|
libraryExports: h,
|
@@ -9932,7 +9936,7 @@ class lc extends Rn {
|
|
9932
9936
|
materialMapLibrary: m,
|
9933
9937
|
libraryLocaleMap: f
|
9934
9938
|
} = ra(l, this.materialPath, !0);
|
9935
|
-
|
9939
|
+
o.open(), o.write(`
|
9936
9940
|
<!DOCTYPE html>
|
9937
9941
|
<html lang="zh-CN">
|
9938
9942
|
<head>
|
@@ -9965,7 +9969,7 @@ class lc extends Rn {
|
|
9965
9969
|
</head>
|
9966
9970
|
<body>
|
9967
9971
|
</body>
|
9968
|
-
${sn(
|
9972
|
+
${sn(s)}
|
9969
9973
|
${sn(c)}
|
9970
9974
|
<script>
|
9971
9975
|
__simulator__.emitReady(${JSON.stringify(h)},
|
@@ -9975,13 +9979,13 @@ class lc extends Rn {
|
|
9975
9979
|
);
|
9976
9980
|
<\/script>
|
9977
9981
|
</html>
|
9978
|
-
`),
|
9982
|
+
`), o.close();
|
9979
9983
|
}
|
9980
|
-
async emitReady(t = [], l = [], a = {},
|
9984
|
+
async emitReady(t = [], l = [], a = {}, o = {}) {
|
9981
9985
|
this.renderer?.dispose(), this.renderer = null;
|
9982
|
-
const
|
9986
|
+
const s = this.contentWindow, { assets: r, service: c, current: h, provider: p, project: m } = this.engine, f = p.materials || {}, _ = [];
|
9983
9987
|
for (const g of l) {
|
9984
|
-
const b = f[g] ? (await f[g]()).default :
|
9988
|
+
const b = f[g] ? (await f[g]()).default : s[g];
|
9985
9989
|
_.push(b);
|
9986
9990
|
}
|
9987
9991
|
r.load(_);
|
@@ -9989,14 +9993,14 @@ class lc extends Rn {
|
|
9989
9993
|
t,
|
9990
9994
|
a,
|
9991
9995
|
_,
|
9992
|
-
|
9996
|
+
o
|
9993
9997
|
);
|
9994
|
-
this.devtools.init(
|
9998
|
+
this.devtools.init(s, this.engine), this.renderer = new nc(i, c, p, this.designer.value), h.value && (this.renderer.render(h.value, m.value?.currentFile), this.rendered.value = Symbol()), this.triggerReady();
|
9995
9999
|
}
|
9996
|
-
createEnv(t = [], l = {}, a = [],
|
9997
|
-
const
|
9998
|
-
Object.entries(
|
9999
|
-
f[D] =
|
10000
|
+
createEnv(t = [], l = {}, a = [], o = {}) {
|
10001
|
+
const s = this.contentWindow, { engine: r } = this, { project: c, assets: h, provider: p } = r, m = t.reduce((D, $) => (D[$] = s[$], D), {}), f = {};
|
10002
|
+
Object.entries(o).forEach(([D, $]) => {
|
10003
|
+
f[D] = s[$];
|
10000
10004
|
});
|
10001
10005
|
const _ = {}, { groups: i, componentMap: g } = h;
|
10002
10006
|
for (const D of i.value) {
|
@@ -10020,16 +10024,16 @@ class lc extends Rn {
|
|
10020
10024
|
b
|
10021
10025
|
);
|
10022
10026
|
return ca(), c.value?.config?.mock && da(c.value?.apis), {
|
10023
|
-
window:
|
10024
|
-
Vue:
|
10025
|
-
VueRouter:
|
10027
|
+
window: s,
|
10028
|
+
Vue: s.Vue,
|
10029
|
+
VueRouter: s.VueRouter,
|
10026
10030
|
library: m,
|
10027
10031
|
materials: a,
|
10028
10032
|
components: _,
|
10029
|
-
container:
|
10033
|
+
container: s.document.body,
|
10030
10034
|
apis: C,
|
10031
10035
|
globals: k,
|
10032
|
-
libraryLocaleMap:
|
10036
|
+
libraryLocaleMap: o,
|
10033
10037
|
locales: f
|
10034
10038
|
};
|
10035
10039
|
}
|
@@ -10042,8 +10046,8 @@ class lc extends Rn {
|
|
10042
10046
|
return new Promise((t, l) => {
|
10043
10047
|
if (!this.contentWindow) return l(null);
|
10044
10048
|
const a = this.contentWindow.document.body;
|
10045
|
-
Qs(a).then((
|
10046
|
-
t(
|
10049
|
+
Qs(a).then((o) => {
|
10050
|
+
t(o);
|
10047
10051
|
}).catch(l);
|
10048
10052
|
});
|
10049
10053
|
}
|
@@ -10073,14 +10077,14 @@ class ac {
|
|
10073
10077
|
parseGroups(e) {
|
10074
10078
|
const t = [];
|
10075
10079
|
for (let l of e) {
|
10076
|
-
const { categories: a, components:
|
10077
|
-
if (!a || !
|
10080
|
+
const { categories: a, components: o, label: s, name: r, library: c } = l;
|
10081
|
+
if (!a || !o)
|
10078
10082
|
continue;
|
10079
|
-
const h =
|
10080
|
-
(_) => this.getCateoryComponents(_,
|
10083
|
+
const h = o.filter((_) => !!_.package).map((_) => _.name), p = a.map(
|
10084
|
+
(_) => this.getCateoryComponents(_, o)
|
10081
10085
|
), m = p.reduce((_, i) => i.count + _, 0), f = {
|
10082
10086
|
name: l.name,
|
10083
|
-
label:
|
10087
|
+
label: s || r,
|
10084
10088
|
count: m,
|
10085
10089
|
names: h,
|
10086
10090
|
library: c,
|
@@ -10106,7 +10110,7 @@ class ac {
|
|
10106
10110
|
}
|
10107
10111
|
if (!l) return null;
|
10108
10112
|
l.name = t || l.name;
|
10109
|
-
const { id: a, name:
|
10113
|
+
const { id: a, name: o, slots: s, props: r, emits: c } = l, h = (m) => {
|
10110
10114
|
const f = Array.isArray(m) ? m : [m];
|
10111
10115
|
let _ = [];
|
10112
10116
|
for (const i of f)
|
@@ -10116,9 +10120,9 @@ class ac {
|
|
10116
10120
|
return _;
|
10117
10121
|
}, p = {
|
10118
10122
|
id: a,
|
10119
|
-
name:
|
10123
|
+
name: o,
|
10120
10124
|
// 如果没有定义插槽,不能放置子组件
|
10121
|
-
childIncludes:
|
10125
|
+
childIncludes: s?.length ? void 0 : !1,
|
10122
10126
|
props: (r || []).map((m) => typeof m == "string" ? {
|
10123
10127
|
name: m
|
10124
10128
|
} : {
|
@@ -10127,10 +10131,10 @@ class ac {
|
|
10127
10131
|
setters: h(m.type)
|
10128
10132
|
}),
|
10129
10133
|
events: c,
|
10130
|
-
slots:
|
10134
|
+
slots: s,
|
10131
10135
|
from: e
|
10132
10136
|
};
|
10133
|
-
return this.componentMap.set(
|
10137
|
+
return this.componentMap.set(o, p), p;
|
10134
10138
|
}
|
10135
10139
|
clearCaches() {
|
10136
10140
|
this.caches = {};
|
@@ -10162,8 +10166,8 @@ class Uc extends Rn {
|
|
10162
10166
|
const {
|
10163
10167
|
container: l,
|
10164
10168
|
service: a,
|
10165
|
-
project:
|
10166
|
-
globals:
|
10169
|
+
project: o = {},
|
10170
|
+
globals: s = {},
|
10167
10171
|
dependencies: r,
|
10168
10172
|
materials: c,
|
10169
10173
|
materialPath: h = "./",
|
@@ -10172,8 +10176,8 @@ class Uc extends Rn {
|
|
10172
10176
|
} = this.options;
|
10173
10177
|
this.container = l, this.service = a, this.adapter = p, this.provider = new pa({
|
10174
10178
|
mode: On.Design,
|
10175
|
-
globals:
|
10176
|
-
project:
|
10179
|
+
globals: s,
|
10180
|
+
project: o,
|
10177
10181
|
service: a,
|
10178
10182
|
dependencies: r,
|
10179
10183
|
materials: c,
|
@@ -10183,10 +10187,10 @@ class Uc extends Rn {
|
|
10183
10187
|
}), this.assets = new ac(this.service, this.provider), this.simulator = new lc({
|
10184
10188
|
engine: this,
|
10185
10189
|
materialPath: h
|
10186
|
-
}), this.bindEvents(), this.init(
|
10190
|
+
}), this.bindEvents(), this.init(o), gt(this.render.bind(this)), wn(this.dispose.bind(this));
|
10187
10191
|
}
|
10188
10192
|
async init(t) {
|
10189
|
-
const l = await this.service.init(t).catch((a) => (
|
10193
|
+
const l = await this.service.init(t).catch((a) => (Pe.warn("VTJEngine service init fail.", a), null));
|
10190
10194
|
l && (l.dependencies = Qu.merge(l.dependencies || []), this.project.value = new Gl(l), this.saveMaterials(), this.triggerReady());
|
10191
10195
|
}
|
10192
10196
|
render() {
|
@@ -10195,7 +10199,7 @@ class Uc extends Rn {
|
|
10195
10199
|
const l = kn(sc);
|
10196
10200
|
this.options.install && l.use(this.options.install, this), l.provide(rl, hl(this)), l.mount(t), this.app = l;
|
10197
10201
|
} else
|
10198
|
-
|
10202
|
+
Pe.warn("VTJEngine constructor param [ container ] is undefined");
|
10199
10203
|
}
|
10200
10204
|
bindEvents() {
|
10201
10205
|
oe.on(Kl, (t) => this.saveProject(t)), oe.on(Xl, (t) => this.saveBlockFile(t)), oe.on(Ql, (t) => this.saveBlockFile(t)), oe.on(Yl, () => this.saveMaterials()), oe.on(Tt, (t) => this.activeFile(t)), oe.on(Zl, () => this.publish()), oe.on(ea, () => this.publishCurrent()), oe.on($t, (t) => this.changeFile(t)), oe.on(Ye, () => this.changeCurrentFile()), oe.on(ta, (t) => this.saveHistory(t)), oe.on(na, (t) => this.loadHistory(t));
|
@@ -10206,53 +10210,53 @@ class Uc extends Rn {
|
|
10206
10210
|
if (a) {
|
10207
10211
|
if (l.isPageFile(a) && a.raw)
|
10208
10212
|
return;
|
10209
|
-
const
|
10210
|
-
|
10213
|
+
const o = await this.service.getFile(a.id, l.toDsl());
|
10214
|
+
o && (a.dsl = o);
|
10211
10215
|
}
|
10212
10216
|
if (a?.dsl) {
|
10213
|
-
const
|
10214
|
-
this.updateCurrent(
|
10217
|
+
const o = new an(a.dsl);
|
10218
|
+
this.updateCurrent(o), this.initHistory(o);
|
10215
10219
|
} else
|
10216
10220
|
this.updateCurrent(null);
|
10217
|
-
|
10221
|
+
Te(this.project);
|
10218
10222
|
}
|
10219
10223
|
async changeFile(t) {
|
10220
10224
|
await Ce();
|
10221
10225
|
const l = t.toDsl();
|
10222
|
-
this.service.saveFile(l), this.updateCurrent(t), this.history.value?.add(l),
|
10226
|
+
this.service.saveFile(l, this.project.value?.toDsl()), this.updateCurrent(t), this.history.value?.add(l), Te(this.history);
|
10223
10227
|
}
|
10224
10228
|
changeCurrentFile() {
|
10225
|
-
this.saveCurrentFile(), this.current.value && (this.history.value?.add(this.current.value.toDsl()),
|
10229
|
+
this.saveCurrentFile(), this.current.value && (this.history.value?.add(this.current.value.toDsl()), Te(this.history));
|
10226
10230
|
}
|
10227
10231
|
async updateCurrent(t, l = !0) {
|
10228
|
-
this.current.value = t, await Ce(), this.context.value = this.simulator.renderer?.context || null, this.isEmptyCurrent.value = this.current.value?.nodes.length === 0, this.changed.value = Symbol(), l &&
|
10232
|
+
this.current.value = t, await Ce(), this.context.value = this.simulator.renderer?.context || null, this.isEmptyCurrent.value = this.current.value?.nodes.length === 0, this.changed.value = Symbol(), l && Te(this.context);
|
10229
10233
|
}
|
10230
10234
|
async saveProject(t) {
|
10231
10235
|
const a = t.model.toDsl();
|
10232
|
-
await this.service.saveProject(a),
|
10236
|
+
await this.service.saveProject(a), Te(this.project);
|
10233
10237
|
}
|
10234
10238
|
async saveBlockFile(t) {
|
10235
|
-
const l = t.type, a = t.model;
|
10239
|
+
const l = t.type, a = t.model, o = a.toDsl();
|
10236
10240
|
if (l === "create") {
|
10237
10241
|
const s = t.data;
|
10238
|
-
a.isPageFile(s) && s.raw ? (await this.service.createRawPage(s), de(`源码文件已经生成:/.vtj/vue/${s.id}.vue`, "success")) : s.dsl && await this.service.saveFile(s.dsl);
|
10242
|
+
a.isPageFile(s) && s.raw ? (await this.service.createRawPage(s, o), de(`源码文件已经生成:/.vtj/vue/${s.id}.vue`, "success")) : s.dsl && await this.service.saveFile(s.dsl, o);
|
10239
10243
|
}
|
10240
10244
|
if (l === "update") {
|
10241
10245
|
const s = t.data;
|
10242
10246
|
if (a.isPageFile(s) && (s.dir || s.raw))
|
10243
10247
|
return;
|
10244
|
-
const
|
10245
|
-
|
10248
|
+
const r = await this.service.getFile(s.id, o);
|
10249
|
+
r && (r.name = s.name, Object.assign(r, s.dsl || {}), await this.service.saveFile(r, o));
|
10246
10250
|
}
|
10247
10251
|
if (l === "delete") {
|
10248
10252
|
const s = t.data;
|
10249
|
-
s && a.isPageFile(s) && s.raw ? await this.service.removeRawPage(s.id) : s.dir || (await this.service.removeFile(s.id), await this.service.removeRawPage(s.id), await this.service.removeHistory(s.id));
|
10253
|
+
s && a.isPageFile(s) && s.raw ? await this.service.removeRawPage(s.id, o) : s.dir || (await this.service.removeFile(s.id, o), await this.service.removeRawPage(s.id, o), await this.service.removeHistory(s.id, o));
|
10250
10254
|
}
|
10251
10255
|
if (l === "clone") {
|
10252
|
-
const { source: s, target:
|
10253
|
-
|
10256
|
+
const { source: s, target: r } = t.data, c = await this.service.getFile(s.id, o);
|
10257
|
+
c && (c.id = r.id, c.name = r.name, await this.service.saveFile(c, o));
|
10254
10258
|
}
|
10255
|
-
|
10259
|
+
Te(this.project), this.emitter.emit(jt, t);
|
10256
10260
|
}
|
10257
10261
|
onSaveBlockFileFinish(t) {
|
10258
10262
|
const l = (a) => {
|
@@ -10271,11 +10275,11 @@ class Uc extends Rn {
|
|
10271
10275
|
}
|
10272
10276
|
saveCurrentFile() {
|
10273
10277
|
const t = this.current.value;
|
10274
|
-
t && (this.updateCurrent(t), this.service.saveFile(t.toDsl()));
|
10278
|
+
t && (this.updateCurrent(t), this.service.saveFile(t.toDsl(), this.project.value?.toDsl()));
|
10275
10279
|
}
|
10276
10280
|
async initHistory(t) {
|
10277
10281
|
if (t) {
|
10278
|
-
const l = await this.service.getHistory(t.id).catch(() => null);
|
10282
|
+
const l = await this.service.getHistory(t.id, this.project.value?.toDsl()).catch(() => null);
|
10279
10283
|
this.history.value = new la(
|
10280
10284
|
Object.assign(l || {}, { id: t.id })
|
10281
10285
|
);
|
@@ -10283,19 +10287,32 @@ class Uc extends Rn {
|
|
10283
10287
|
this.history.value = null;
|
10284
10288
|
}
|
10285
10289
|
async saveHistory(t) {
|
10286
|
-
const l = t.type, a = t.model;
|
10287
|
-
l === "create" && await this.service.saveHistoryItem(
|
10290
|
+
const l = t.type, a = t.model, o = this.project.value?.toDsl();
|
10291
|
+
l === "create" && await this.service.saveHistoryItem(
|
10292
|
+
a.id,
|
10293
|
+
t.data,
|
10294
|
+
o
|
10295
|
+
), l === "delete" && await this.service.removeHistoryItem(
|
10288
10296
|
a.id,
|
10289
|
-
t.data
|
10290
|
-
|
10297
|
+
t.data,
|
10298
|
+
o
|
10299
|
+
), l === "clear" && await this.service.removeHistoryItem(
|
10300
|
+
a.id,
|
10301
|
+
t.data,
|
10302
|
+
o
|
10303
|
+
);
|
10291
10304
|
const s = a.toDsl();
|
10292
|
-
await this.service.saveHistory(s),
|
10305
|
+
await this.service.saveHistory(s, o), Te(this.history);
|
10293
10306
|
}
|
10294
10307
|
async loadHistory(t) {
|
10295
|
-
const l = t.model, a = t.data, s = await this.service.getHistoryItem(
|
10308
|
+
const l = t.model, a = t.data, o = this.project.value?.toDsl(), s = await this.service.getHistoryItem(
|
10309
|
+
l.id,
|
10310
|
+
a.id,
|
10311
|
+
o
|
10312
|
+
);
|
10296
10313
|
if (s && s.dsl) {
|
10297
|
-
const
|
10298
|
-
await this.updateCurrent(
|
10314
|
+
const r = new an(s.dsl);
|
10315
|
+
await this.updateCurrent(r), this.service.saveFile(s.dsl, o), Te(this.history);
|
10299
10316
|
}
|
10300
10317
|
}
|
10301
10318
|
async publish() {
|
@@ -10322,13 +10339,13 @@ class Uc extends Rn {
|
|
10322
10339
|
this.emitter.all.clear(), this.simulator.dispose(), this.app && (this.app.unmount(), this.container = void 0);
|
10323
10340
|
}
|
10324
10341
|
async openFile(t) {
|
10325
|
-
const l = this.project.value, a = this.skeleton?.getRegion("Apps"),
|
10326
|
-
if (!l || !a || !
|
10327
|
-
const
|
10328
|
-
|
10329
|
-
l.active(
|
10342
|
+
const l = this.project.value, a = this.skeleton?.getRegion("Apps"), o = t || l?.homepage;
|
10343
|
+
if (!l || !a || !o) return;
|
10344
|
+
const s = l.getPage(o);
|
10345
|
+
s && !s.raw && (a.regionRef?.setActive("Pages"), this.simulator.ready(() => {
|
10346
|
+
l.active(s);
|
10330
10347
|
}));
|
10331
|
-
const r = l.getBlock(
|
10348
|
+
const r = l.getBlock(o);
|
10332
10349
|
r && (a.regionRef?.setActive("Blocks"), this.simulator?.ready(() => {
|
10333
10350
|
l.active(r);
|
10334
10351
|
}));
|
@@ -10336,9 +10353,9 @@ class Uc extends Rn {
|
|
10336
10353
|
}
|
10337
10354
|
function ce() {
|
10338
10355
|
const u = Rt(rl, null);
|
10339
|
-
return u ||
|
10356
|
+
return u || Pe.error("VTJEngine is not exist"), u;
|
10340
10357
|
}
|
10341
|
-
const
|
10358
|
+
const $e = E({
|
10342
10359
|
name: "RegionWrapper",
|
10343
10360
|
props: {
|
10344
10361
|
region: {
|
@@ -10442,7 +10459,7 @@ const Te = E({
|
|
10442
10459
|
getWidget(u) {
|
10443
10460
|
const e = ol.get(u);
|
10444
10461
|
if (!e) {
|
10445
|
-
|
10462
|
+
Pe.warn(`widget [ ${u} ] is not exsit`);
|
10446
10463
|
return;
|
10447
10464
|
}
|
10448
10465
|
return this.getWidgets(e.region).find((l) => l.widget.name === u);
|
@@ -10537,8 +10554,8 @@ const Te = E({
|
|
10537
10554
|
name: t,
|
10538
10555
|
label: l,
|
10539
10556
|
title: a,
|
10540
|
-
value:
|
10541
|
-
computedSetters:
|
10557
|
+
value: o,
|
10558
|
+
computedSetters: s,
|
10542
10559
|
computedOptions: r,
|
10543
10560
|
variable: c,
|
10544
10561
|
changeValue: h,
|
@@ -10552,10 +10569,10 @@ const Te = E({
|
|
10552
10569
|
name: t,
|
10553
10570
|
label: l,
|
10554
10571
|
title: a,
|
10555
|
-
setters:
|
10572
|
+
setters: s,
|
10556
10573
|
defaultSetter: p,
|
10557
10574
|
variable: c,
|
10558
|
-
value:
|
10575
|
+
value: o,
|
10559
10576
|
removable: m,
|
10560
10577
|
options: r,
|
10561
10578
|
onChange: h,
|
@@ -10584,7 +10601,7 @@ const Te = E({
|
|
10584
10601
|
footerHeight: { default: "20px" }
|
10585
10602
|
},
|
10586
10603
|
setup(u, { expose: e }) {
|
10587
|
-
const t = u, l = S(!1), a = S(parseInt(t.leftWidth)),
|
10604
|
+
const t = u, l = S(!1), a = S(parseInt(t.leftWidth)), o = S(parseInt(t.rightWidth)), s = {
|
10588
10605
|
dirs: ["e"],
|
10589
10606
|
maxWidth: 600,
|
10590
10607
|
minWidth: 49,
|
@@ -10599,10 +10616,10 @@ const Te = E({
|
|
10599
10616
|
maxWidth: 600,
|
10600
10617
|
minWidth: 2,
|
10601
10618
|
onResizing(C, D) {
|
10602
|
-
|
10619
|
+
o.value = D.elementWidth.value;
|
10603
10620
|
},
|
10604
10621
|
onEnd(C, D) {
|
10605
|
-
|
10622
|
+
o.value = D.elementWidth.value;
|
10606
10623
|
}
|
10607
10624
|
}, c = S(), h = S(), p = S(), m = S(), f = S(), _ = S(), i = S(), g = S(), b = S(!1), k = S(!1);
|
10608
10625
|
return e({
|
@@ -10616,7 +10633,7 @@ const Te = E({
|
|
10616
10633
|
collapsed: b,
|
10617
10634
|
settable: k,
|
10618
10635
|
leftWidth: a,
|
10619
|
-
rightWidth:
|
10636
|
+
rightWidth: o,
|
10620
10637
|
preview: g,
|
10621
10638
|
isPreview: l
|
10622
10639
|
}), (C, D) => (d(), w(n(Dl), { locale: n($l) }, {
|
@@ -10628,18 +10645,18 @@ const Te = E({
|
|
10628
10645
|
height: C.headerHeight
|
10629
10646
|
}, {
|
10630
10647
|
default: y(() => [
|
10631
|
-
v(n(
|
10648
|
+
v(n($e), {
|
10632
10649
|
ref_key: "brand",
|
10633
10650
|
ref: c,
|
10634
10651
|
region: "Brand"
|
10635
10652
|
}, null, 512),
|
10636
|
-
v(n(
|
10653
|
+
v(n($e), {
|
10637
10654
|
ref_key: "toolbar",
|
10638
10655
|
ref: h,
|
10639
10656
|
region: "Toolbar",
|
10640
10657
|
preview: l.value
|
10641
10658
|
}, null, 8, ["preview"]),
|
10642
|
-
v(n(
|
10659
|
+
v(n($e), {
|
10643
10660
|
ref_key: "actions",
|
10644
10661
|
ref: p,
|
10645
10662
|
region: "Actions"
|
@@ -10657,7 +10674,7 @@ const Te = E({
|
|
10657
10674
|
}])
|
10658
10675
|
}, {
|
10659
10676
|
default: y(() => [
|
10660
|
-
v(n(
|
10677
|
+
v(n($e), {
|
10661
10678
|
ref_key: "apps",
|
10662
10679
|
ref: m,
|
10663
10680
|
region: "Apps"
|
@@ -10665,18 +10682,18 @@ const Te = E({
|
|
10665
10682
|
]),
|
10666
10683
|
_: 1
|
10667
10684
|
}, 8, ["width", "class"])), [
|
10668
|
-
[n(nn),
|
10685
|
+
[n(nn), s]
|
10669
10686
|
]),
|
10670
10687
|
v(n(Pl), { class: "v-skeleton__main" }, {
|
10671
10688
|
default: y(() => [
|
10672
|
-
l.value ? (d(), w(n(
|
10689
|
+
l.value ? (d(), w(n($e), {
|
10673
10690
|
key: 0,
|
10674
10691
|
ref_key: "preview",
|
10675
10692
|
ref: g,
|
10676
10693
|
region: "Preview",
|
10677
10694
|
preview: l.value
|
10678
10695
|
}, null, 8, ["preview"])) : A("", !0),
|
10679
|
-
Ee(v(n(
|
10696
|
+
Ee(v(n($e), {
|
10680
10697
|
ref_key: "workspace",
|
10681
10698
|
ref: f,
|
10682
10699
|
region: "Workspace"
|
@@ -10692,7 +10709,7 @@ const Te = E({
|
|
10692
10709
|
class: "v-skeleton__right"
|
10693
10710
|
}, {
|
10694
10711
|
default: y(() => [
|
10695
|
-
v(n(
|
10712
|
+
v(n($e), {
|
10696
10713
|
ref_key: "settings",
|
10697
10714
|
ref: _,
|
10698
10715
|
region: "Settings"
|
@@ -10712,7 +10729,7 @@ const Te = E({
|
|
10712
10729
|
height: C.footerHeight
|
10713
10730
|
}, {
|
10714
10731
|
default: y(() => [
|
10715
|
-
v(n(
|
10732
|
+
v(n($e), {
|
10716
10733
|
ref_key: "status",
|
10717
10734
|
ref: i,
|
10718
10735
|
region: "Status"
|
@@ -10747,12 +10764,12 @@ const Te = E({
|
|
10747
10764
|
},
|
10748
10765
|
emits: ["change", "remove"],
|
10749
10766
|
setup(u, { emit: e }) {
|
10750
|
-
const t = u, l = e, a = S(!1),
|
10767
|
+
const t = u, l = e, a = S(!1), o = S(""), s = S(
|
10751
10768
|
t.setters.find((k) => k.name === t.defaultSetter) || t.setters[0]
|
10752
10769
|
), r = S(t.value), c = x(() => !!et(r.value)), h = {
|
10753
|
-
[
|
10770
|
+
[s.value.name]: r.value
|
10754
10771
|
}, p = (k) => {
|
10755
|
-
h[
|
10772
|
+
h[s.value.name] = r.value, s.value = k, r.value = h[k.name] ?? void 0, m(r.value);
|
10756
10773
|
};
|
10757
10774
|
M(
|
10758
10775
|
() => t.value,
|
@@ -10762,7 +10779,7 @@ const Te = E({
|
|
10762
10779
|
), M(
|
10763
10780
|
() => t.defaultSetter,
|
10764
10781
|
() => {
|
10765
|
-
|
10782
|
+
s.value = t.setters.find(
|
10766
10783
|
(k) => k.name === t.defaultSetter
|
10767
10784
|
) || t.setters[0];
|
10768
10785
|
}
|
@@ -10772,10 +10789,10 @@ const Te = E({
|
|
10772
10789
|
}, f = () => {
|
10773
10790
|
l("remove", t.name);
|
10774
10791
|
}, _ = () => {
|
10775
|
-
a.value = !0,
|
10792
|
+
a.value = !0, o.value = et(r.value) ? r.value.value : "";
|
10776
10793
|
}, i = () => {
|
10777
|
-
a.value = !1,
|
10778
|
-
}, g = async (k) => pe(k, t.context, !0) ? (h[
|
10794
|
+
a.value = !1, o.value = "";
|
10795
|
+
}, g = async (k) => pe(k, t.context, !0) ? (h[s.value.name] = r.value, r.value = k, l("change", k), !0) : !1, b = async () => {
|
10779
10796
|
await He("确定要解除绑定吗?") && (i(), r.value = void 0, l("change", void 0));
|
10780
10797
|
};
|
10781
10798
|
return (k, C) => (d(), w(n(Pn), {
|
@@ -10800,12 +10817,12 @@ const Te = E({
|
|
10800
10817
|
]),
|
10801
10818
|
default: y(() => [
|
10802
10819
|
V("div", ic, [
|
10803
|
-
|
10804
|
-
c.value ? A("", !0) : (d(), w(bn(
|
10820
|
+
s.value ? (d(), j("div", uc, [
|
10821
|
+
c.value ? A("", !0) : (d(), w(bn(s.value.component), ue({
|
10805
10822
|
key: 0,
|
10806
10823
|
current: t.current,
|
10807
10824
|
context: t.context
|
10808
|
-
},
|
10825
|
+
}, s.value.props, {
|
10809
10826
|
options: t.options,
|
10810
10827
|
modelValue: r.value,
|
10811
10828
|
"onUpdate:modelValue": C[0] || (C[0] = (D) => r.value = D),
|
@@ -10851,7 +10868,7 @@ const Te = E({
|
|
10851
10868
|
default: y(() => [
|
10852
10869
|
v(n(Mn), {
|
10853
10870
|
class: K({
|
10854
|
-
"is-placeholder": D.name !==
|
10871
|
+
"is-placeholder": D.name !== s.value.name
|
10855
10872
|
})
|
10856
10873
|
}, null, 8, ["class"]),
|
10857
10874
|
G(" " + L(D.label), 1)
|
@@ -10878,7 +10895,7 @@ const Te = E({
|
|
10878
10895
|
key: 0,
|
10879
10896
|
current: t.current,
|
10880
10897
|
context: t.context,
|
10881
|
-
value:
|
10898
|
+
value: o.value,
|
10882
10899
|
modelValue: a.value,
|
10883
10900
|
"onUpdate:modelValue": C[1] || (C[1] = (D) => a.value = D),
|
10884
10901
|
submitMethod: g,
|
@@ -10909,12 +10926,12 @@ const Te = E({
|
|
10909
10926
|
return e({
|
10910
10927
|
widgets: l,
|
10911
10928
|
widgetsRef: a
|
10912
|
-
}), (
|
10929
|
+
}), (o, s) => (d(), j("div", fc, [
|
10913
10930
|
(d(!0), j(z, null, W(n(l), (r) => (d(), w(n(Fe), {
|
10914
10931
|
ref_for: !0,
|
10915
10932
|
ref_key: "widgetsRef",
|
10916
10933
|
ref: a,
|
10917
|
-
region:
|
10934
|
+
region: o.region,
|
10918
10935
|
widget: r
|
10919
10936
|
}, null, 8, ["region", "widget"]))), 256))
|
10920
10937
|
]));
|
@@ -10931,14 +10948,14 @@ const Te = E({
|
|
10931
10948
|
return e({
|
10932
10949
|
widgets: l,
|
10933
10950
|
widgetsRef: a
|
10934
|
-
}), (
|
10951
|
+
}), (o, s) => (d(), j("div", bc, [
|
10935
10952
|
(d(!0), j(z, null, W(n(l), (r) => (d(), w(n(Fe), {
|
10936
10953
|
ref_for: !0,
|
10937
10954
|
ref_key: "widgetsRef",
|
10938
10955
|
ref: a,
|
10939
|
-
region:
|
10956
|
+
region: o.region,
|
10940
10957
|
widget: r,
|
10941
|
-
preview:
|
10958
|
+
preview: o.preview
|
10942
10959
|
}, null, 8, ["region", "widget", "preview"]))), 256))
|
10943
10960
|
]));
|
10944
10961
|
}
|
@@ -10954,12 +10971,12 @@ const Te = E({
|
|
10954
10971
|
return e({
|
10955
10972
|
widgets: l,
|
10956
10973
|
widgetsRef: a
|
10957
|
-
}), (
|
10974
|
+
}), (o, s) => (d(), j("div", _c, [
|
10958
10975
|
(d(!0), j(z, null, W(n(l), (r) => (d(), w(n(Fe), {
|
10959
10976
|
ref_for: !0,
|
10960
10977
|
ref_key: "widgetsRef",
|
10961
10978
|
ref: a,
|
10962
|
-
region:
|
10979
|
+
region: o.region,
|
10963
10980
|
widget: r
|
10964
10981
|
}, null, 8, ["region", "widget"]))), 256))
|
10965
10982
|
]));
|
@@ -10973,7 +10990,7 @@ const Te = E({
|
|
10973
10990
|
index: { default: 0 }
|
10974
10991
|
},
|
10975
10992
|
setup(u, { expose: e }) {
|
10976
|
-
const t = u, l = ce(), { widgets: a, widgetsRef:
|
10993
|
+
const t = u, l = ce(), { widgets: a, widgetsRef: o } = ze(t.region), s = x(() => a.value.filter((i) => i.openType === "panel")), r = x(() => a.value.filter((i) => i.openType !== "panel")), c = s.value[t.index], h = S(c), p = S(c), m = (i) => {
|
10977
10994
|
h.value = i, p.value = p.value?.name === i.name ? null : i;
|
10978
10995
|
}, f = (i) => {
|
10979
10996
|
i.openType === "link" && i.url && window.open(i.url), i.openType === "dialog" && Ol({
|
@@ -10987,15 +11004,15 @@ const Te = E({
|
|
10987
11004
|
l.skeleton?.toggleCollapse(!i);
|
10988
11005
|
}), e({
|
10989
11006
|
widgets: a,
|
10990
|
-
widgetsRef:
|
11007
|
+
widgetsRef: o,
|
10991
11008
|
setActive: (i) => {
|
10992
|
-
const g =
|
11009
|
+
const g = s.value.find((b) => b.name === i);
|
10993
11010
|
h.value = g, p.value = g;
|
10994
11011
|
}
|
10995
11012
|
}), (i, g) => (d(), j("div", kc, [
|
10996
11013
|
V("div", Sc, [
|
10997
11014
|
V("div", xc, [
|
10998
|
-
(d(!0), j(z, null, W(
|
11015
|
+
(d(!0), j(z, null, W(s.value, (b) => (d(), w(n(vn), {
|
10999
11016
|
key: `icon-${b.name}`,
|
11000
11017
|
icon: b.icon,
|
11001
11018
|
label: b.label,
|
@@ -11014,14 +11031,14 @@ const Te = E({
|
|
11014
11031
|
])
|
11015
11032
|
]),
|
11016
11033
|
V("div", Vc, [
|
11017
|
-
(d(!0), j(z, null, W(
|
11034
|
+
(d(!0), j(z, null, W(s.value, (b) => (d(), w(Sn, {
|
11018
11035
|
key: b.name
|
11019
11036
|
}, [
|
11020
11037
|
h.value?.name === b.name ? (d(), w(n(Fe), {
|
11021
11038
|
key: 0,
|
11022
11039
|
ref_for: !0,
|
11023
11040
|
ref_key: "widgetsRef",
|
11024
|
-
ref:
|
11041
|
+
ref: o,
|
11025
11042
|
region: i.region,
|
11026
11043
|
widget: b
|
11027
11044
|
}, null, 8, ["region", "widget"])) : A("", !0)
|
@@ -11036,7 +11053,7 @@ const Te = E({
|
|
11036
11053
|
region: {}
|
11037
11054
|
},
|
11038
11055
|
setup(u, { expose: e }) {
|
11039
|
-
const t = u, { widgets: l, widgetsRef: a } = ze(t.region),
|
11056
|
+
const t = u, { widgets: l, widgetsRef: a } = ze(t.region), o = qe(
|
11040
11057
|
l.value.map((i) => ({
|
11041
11058
|
name: i.name,
|
11042
11059
|
command: i.name,
|
@@ -11046,17 +11063,17 @@ const Te = E({
|
|
11046
11063
|
checked: !i.closable,
|
11047
11064
|
actions: i.actions
|
11048
11065
|
}))
|
11049
|
-
),
|
11066
|
+
), s = x(() => o?.filter((i) => !i.closable || i.checked)), r = x(() => o.map((i) => ({
|
11050
11067
|
...i,
|
11051
11068
|
disabled: !i.closable
|
11052
|
-
}))), c = S(
|
11053
|
-
const g =
|
11054
|
-
g && (g.checked = !1), c.value === i && (c.value =
|
11069
|
+
}))), c = S(s.value[0]?.name), h = x(() => o.find((g) => g.name === c.value)?.props || {}), p = (i) => {
|
11070
|
+
const g = o.find((b) => b.name === i);
|
11071
|
+
g && (g.checked = !1), c.value === i && (c.value = s.value[0]?.name);
|
11055
11072
|
}, m = (i) => {
|
11056
|
-
const g =
|
11057
|
-
g && g.closable && (g.checked = !g.checked, g.checked && (c.value = g.name), !g.checked && c.value === g.name && (c.value =
|
11073
|
+
const g = o.find((b) => b.name === i.name);
|
11074
|
+
g && g.closable && (g.checked = !g.checked, g.checked && (c.value = g.name), !g.checked && c.value === g.name && (c.value = s.value[0]?.name));
|
11058
11075
|
}, f = (i, g = {}) => {
|
11059
|
-
const b =
|
11076
|
+
const b = o.find((k) => k.name === i);
|
11060
11077
|
b && (b.props = Object.assign({}, b.props, g), b.checked = !0, c.value = b.name);
|
11061
11078
|
}, _ = (i) => {
|
11062
11079
|
if (a.value) {
|
@@ -11076,7 +11093,7 @@ const Te = E({
|
|
11076
11093
|
openTab: f
|
11077
11094
|
}), (i, g) => (d(), w(n(xt), {
|
11078
11095
|
class: "v-workspace-region",
|
11079
|
-
items:
|
11096
|
+
items: s.value,
|
11080
11097
|
menus: r.value,
|
11081
11098
|
modelValue: c.value,
|
11082
11099
|
"onUpdate:modelValue": g[0] || (g[0] = (b) => c.value = b),
|
@@ -11109,8 +11126,8 @@ const Te = E({
|
|
11109
11126
|
region: {}
|
11110
11127
|
},
|
11111
11128
|
setup(u, { expose: e }) {
|
11112
|
-
const t = u, l = ce(), { current: a } = me(), { selected:
|
11113
|
-
() =>
|
11129
|
+
const t = u, l = ce(), { current: a } = me(), { selected: o, isSelectBlock: s } = xe(), r = x(
|
11130
|
+
() => s.value ? ke.Block : ke.Node
|
11114
11131
|
), { widgets: c, widgetsRef: h } = ze(t.region, r), p = S(), m = S(!1), f = x(() => c.value.map((b) => ({
|
11115
11132
|
name: b.name,
|
11116
11133
|
label: b.label,
|
@@ -11122,7 +11139,7 @@ const Te = E({
|
|
11122
11139
|
}
|
11123
11140
|
] : void 0
|
11124
11141
|
}))), _ = x(() => {
|
11125
|
-
const b =
|
11142
|
+
const b = o.value?.model;
|
11126
11143
|
return b ? l.assets.componentMap.get(b.name)?.doc : null;
|
11127
11144
|
});
|
11128
11145
|
M(a, (b) => {
|
@@ -11156,7 +11173,7 @@ const Te = E({
|
|
11156
11173
|
direction: "column"
|
11157
11174
|
}, {
|
11158
11175
|
default: y(() => [
|
11159
|
-
n(
|
11176
|
+
n(o) ? (d(), w(n(q), {
|
11160
11177
|
key: 0,
|
11161
11178
|
flex: "",
|
11162
11179
|
justify: "space-between",
|
@@ -11168,8 +11185,8 @@ const Te = E({
|
|
11168
11185
|
default: y(() => [
|
11169
11186
|
v(n(Kn)),
|
11170
11187
|
V("span", null, [
|
11171
|
-
G(L(n(
|
11172
|
-
V("i", null, L(n(
|
11188
|
+
G(L(n(o)?.model.name) + ": ", 1),
|
11189
|
+
V("i", null, L(n(o)?.model.id), 1)
|
11173
11190
|
])
|
11174
11191
|
]),
|
11175
11192
|
_: 1
|
@@ -11188,7 +11205,7 @@ const Te = E({
|
|
11188
11205
|
]),
|
11189
11206
|
_: 1
|
11190
11207
|
})) : A("", !0),
|
11191
|
-
n(
|
11208
|
+
n(o) && !n(o).model.locked ? (d(), w(n(q), {
|
11192
11209
|
key: 1,
|
11193
11210
|
grow: "",
|
11194
11211
|
padding: !1
|
@@ -11221,11 +11238,11 @@ const Te = E({
|
|
11221
11238
|
]),
|
11222
11239
|
_: 1
|
11223
11240
|
})) : A("", !0),
|
11224
|
-
n(
|
11241
|
+
n(o) ? A("", !0) : (d(), w(n(ie), {
|
11225
11242
|
key: 2,
|
11226
11243
|
description: "请在左侧画布选中节点"
|
11227
11244
|
})),
|
11228
|
-
n(
|
11245
|
+
n(o) && n(o).model.locked ? (d(), w(n(ie), {
|
11229
11246
|
key: 3,
|
11230
11247
|
"image-size": 1,
|
11231
11248
|
description: "节点已被锁定, 禁止编辑"
|
@@ -11246,12 +11263,12 @@ const Te = E({
|
|
11246
11263
|
return e({
|
11247
11264
|
widgets: l,
|
11248
11265
|
widgetsRef: a
|
11249
|
-
}), (
|
11266
|
+
}), (o, s) => (d(), j("div", Dc, [
|
11250
11267
|
(d(!0), j(z, null, W(n(l), (r) => (d(), w(n(Fe), {
|
11251
11268
|
ref_for: !0,
|
11252
11269
|
ref_key: "widgetsRef",
|
11253
11270
|
ref: a,
|
11254
|
-
region:
|
11271
|
+
region: o.region,
|
11255
11272
|
widget: r
|
11256
11273
|
}, null, 8, ["region", "widget"]))), 256))
|
11257
11274
|
]));
|
@@ -11263,7 +11280,7 @@ const Te = E({
|
|
11263
11280
|
region: {}
|
11264
11281
|
},
|
11265
11282
|
setup(u, { expose: e }) {
|
11266
|
-
const t = u, { widgets: l, widgetsRef: a } = ze(t.region),
|
11283
|
+
const t = u, { widgets: l, widgetsRef: a } = ze(t.region), o = qe(
|
11267
11284
|
l.value.map((c) => ({
|
11268
11285
|
name: c.name,
|
11269
11286
|
command: c.name,
|
@@ -11271,14 +11288,14 @@ const Te = E({
|
|
11271
11288
|
closable: !!c.closable,
|
11272
11289
|
checked: !1
|
11273
11290
|
}))
|
11274
|
-
),
|
11291
|
+
), s = x(() => o.filter((c) => !c.closable || c.checked)), r = S(s.value[0]?.name);
|
11275
11292
|
return e({
|
11276
11293
|
currentTab: r,
|
11277
11294
|
widgets: l,
|
11278
11295
|
widgetsRef: a
|
11279
11296
|
}), (c, h) => (d(), w(n(xt), {
|
11280
11297
|
class: "v-workspace-region",
|
11281
|
-
items:
|
11298
|
+
items: s.value,
|
11282
11299
|
modelValue: r.value,
|
11283
11300
|
"onUpdate:modelValue": h[0] || (h[0] = (p) => r.value = p)
|
11284
11301
|
}, {
|
@@ -11331,7 +11348,7 @@ export {
|
|
11331
11348
|
un as PAD_SIZE,
|
11332
11349
|
H as Panel,
|
11333
11350
|
ro as RegionType,
|
11334
|
-
|
11351
|
+
$e as RegionWrapper,
|
11335
11352
|
nc as Renderer,
|
11336
11353
|
jt as SAVE_BLOCK_FILE_FINISH,
|
11337
11354
|
mc as SetterView,
|