epic-designer-gold 0.0.25 → 0.0.27
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/{attributeView-BBrzwmf4.cjs → attributeView-DT3Pgu2H.cjs} +1 -1
- package/dist/{attributeView-Ck-ShAfN.js → attributeView-VgLT3_0E.js} +1 -1
- package/dist/core/components/designer/src/modules/outline/outline.vue.d.ts +2 -0
- package/dist/{index-Cewvn9wU.js → index-8jV4lvPb.js} +55 -50
- package/dist/index-B0S7YNtd.js +432 -0
- package/dist/{index-DxHwIIzt.cjs → index-B9zp9FUu.cjs} +1 -1
- package/dist/{index-4q36b3GY.cjs → index-BAbG8xrg.cjs} +1 -1
- package/dist/{index-CRL8hmqv.js → index-BWCIdFn_.js} +1 -1
- package/dist/index-BcTELKKi.cjs +1 -0
- package/dist/{index-B3vfighS.cjs → index-BfoDWeC1.cjs} +1 -1
- package/dist/{index-nkzQQCaI.js → index-C2Nctb3q.js} +1 -1
- package/dist/{index-guZtdVEN.js → index-CJaP0qUg.js} +1 -1
- package/dist/{index-Dxl77FFb.js → index-CQ_Xpn1C.js} +1 -1
- package/dist/{index-By8RSEAs.js → index-Cn2i-Eyz.js} +1 -1
- package/dist/{index-CtryGVPT.cjs → index-D-mV-SAk.cjs} +1 -1
- package/dist/{index-CrBsc5Nz.cjs → index-DKe3uW6g.cjs} +1 -1
- package/dist/{index-Bhg6gVv4.cjs → index-DkVKzqSQ.cjs} +1 -1
- package/dist/{index-DzoVPXjq.js → index-DqWY4lfL.js} +4 -4
- package/dist/index-R7VF52gK.cjs +10 -0
- package/dist/{index-CAF_naew.cjs → index-Rhk7Lv_h.cjs} +1 -1
- package/dist/index-fwa-_XEi.js +4 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/outline-CJSEUbgc.cjs +1 -0
- package/dist/outline-yy4pIEi3.js +54 -0
- package/dist/style.css +1 -1
- package/dist/{styleView-CBGRKJTF.cjs → styleView-B66KWbOm.cjs} +1 -1
- package/dist/{styleView-D-po6qQi.js → styleView-Cjdr_xer.js} +1 -1
- package/dist/tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs +1 -0
- package/dist/tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js +242 -0
- package/package.json +1 -1
- package/dist/index-8CeSyRAe.js +0 -4
- package/dist/index-B08C8MBy.cjs +0 -10
- package/dist/index-CbEEZFLc.js +0 -665
- package/dist/index-DSLPA7t_.cjs +0 -1
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { defineComponent as w, inject as p, computed as B, h as T, openBlock as u, createElementBlock as K, normalizeClass as N, unref as i, createElementVNode as S, createVNode as k, createCommentVNode as I, createBlock as V, mergeProps as j, withCtx as D, Fragment as z, renderList as H, useSlots as M, provide as b, ref as P, withDirectives as q, vShow as F } from "vue";
|
|
2
|
+
import { _ as $ } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
3
|
+
import { p as E } from "./axios-ITY6Uw7A.js";
|
|
4
|
+
import { d as G } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
5
|
+
const U = /* @__PURE__ */ w({
|
|
6
|
+
name: "ETreeNodeItem",
|
|
7
|
+
__name: "treeNodeItem",
|
|
8
|
+
props: {
|
|
9
|
+
schema: {}
|
|
10
|
+
},
|
|
11
|
+
setup(_) {
|
|
12
|
+
const s = _, m = p("slots", {}), g = p("pageSchema", {}), l = p("expandedKeys"), x = p("treeProps"), f = p("selectedKeys"), d = p("handleSelect"), v = B(() => l.value.includes(s.schema.id ?? "")), y = w({
|
|
13
|
+
setup() {
|
|
14
|
+
return () => {
|
|
15
|
+
var t;
|
|
16
|
+
return T(
|
|
17
|
+
"span",
|
|
18
|
+
{
|
|
19
|
+
class: {
|
|
20
|
+
text: !0,
|
|
21
|
+
hover: x.hoverKey === s.schema.id,
|
|
22
|
+
checked: f.value.includes(s.schema.id)
|
|
23
|
+
},
|
|
24
|
+
onClick: () => d(s.schema.id, s.schema)
|
|
25
|
+
},
|
|
26
|
+
((t = m["tree-node"]) == null ? void 0 : t.call(m, s)) ?? T(
|
|
27
|
+
"span",
|
|
28
|
+
{ class: "epic-text-padding flex" },
|
|
29
|
+
{
|
|
30
|
+
default: () => {
|
|
31
|
+
var e;
|
|
32
|
+
return [
|
|
33
|
+
T(
|
|
34
|
+
"span",
|
|
35
|
+
{ class: "max-w-full truncate" },
|
|
36
|
+
s.schema.label ?? ((e = E.getComponentConfingByType(s.schema.type)) == null ? void 0 : e.defaultSchema.label)
|
|
37
|
+
),
|
|
38
|
+
T(
|
|
39
|
+
"span",
|
|
40
|
+
{ class: "epic-node-type-text flex-1 w-0 truncate" },
|
|
41
|
+
s.schema.id
|
|
42
|
+
)
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
function c() {
|
|
52
|
+
const t = s.schema.id;
|
|
53
|
+
if (!t)
|
|
54
|
+
return !1;
|
|
55
|
+
l.value.includes(t) ? l.value = l.value.filter((e) => e !== t) : l.value.push(t);
|
|
56
|
+
}
|
|
57
|
+
function o() {
|
|
58
|
+
var e;
|
|
59
|
+
const t = s.schema.id;
|
|
60
|
+
if (!t || !((e = s.schema.children) != null && e.length))
|
|
61
|
+
return !1;
|
|
62
|
+
l.value.push(t);
|
|
63
|
+
}
|
|
64
|
+
return o(), (t, e) => {
|
|
65
|
+
var n, r, h, a, C;
|
|
66
|
+
return u(), K("li", {
|
|
67
|
+
class: N(["epic-tree-node", {
|
|
68
|
+
expanded: (n = s.schema.children) == null ? void 0 : n.length,
|
|
69
|
+
"level-1": s.schema.id === ((r = i(g).schemas[0]) == null ? void 0 : r.id)
|
|
70
|
+
}])
|
|
71
|
+
}, [
|
|
72
|
+
S("a", null, [
|
|
73
|
+
(h = s.schema.children) != null && h.length && s.schema.id !== ((a = i(g).schemas[0]) == null ? void 0 : a.id) ? (u(), K("span", {
|
|
74
|
+
key: 0,
|
|
75
|
+
class: N(["icon-expanded", { expanded: v.value }]),
|
|
76
|
+
onClick: c
|
|
77
|
+
}, [
|
|
78
|
+
k(i($), { name: "icon--epic--caret-right-outlined" })
|
|
79
|
+
], 2)) : I("", !0),
|
|
80
|
+
k(i(y))
|
|
81
|
+
]),
|
|
82
|
+
(C = s.schema.children) != null && C.length ? (u(), V(A, {
|
|
83
|
+
key: 0,
|
|
84
|
+
class: N(["epic-tree-sublist", { expanded: v.value }]),
|
|
85
|
+
schemas: s.schema.children,
|
|
86
|
+
"onUpdate:schemas": e[0] || (e[0] = (L) => s.schema.children = L),
|
|
87
|
+
parentSchema: s.schema
|
|
88
|
+
}, null, 8, ["class", "schemas", "parentSchema"])) : I("", !0)
|
|
89
|
+
], 2);
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
}), J = { key: 1 }, A = /* @__PURE__ */ w({
|
|
93
|
+
name: "ETreeNodes",
|
|
94
|
+
__name: "treeNodes",
|
|
95
|
+
props: {
|
|
96
|
+
schemas: {},
|
|
97
|
+
parentSchema: {}
|
|
98
|
+
},
|
|
99
|
+
emits: ["update:schemas"],
|
|
100
|
+
setup(_, { emit: s }) {
|
|
101
|
+
const m = p("designer"), g = p("pageSchema"), l = p("treeProps"), x = _, f = s, d = B({
|
|
102
|
+
get() {
|
|
103
|
+
return x.schemas;
|
|
104
|
+
},
|
|
105
|
+
set(c) {
|
|
106
|
+
f("update:schemas", c);
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
function v(c) {
|
|
110
|
+
m.setDisableHover(!0), m.setCheckedNode(d.value[c]);
|
|
111
|
+
}
|
|
112
|
+
function y(c) {
|
|
113
|
+
var o, t, e;
|
|
114
|
+
return c.id === ((o = g.schemas[0]) == null ? void 0 : o.id) || (e = (t = E.getComponentConfingByType(c.type)) == null ? void 0 : t.editConstraints) != null && e.immovable ? "unmover-item" : "draggable-item";
|
|
115
|
+
}
|
|
116
|
+
return (c, o) => {
|
|
117
|
+
var t, e, n, r, h;
|
|
118
|
+
return (n = (e = i(E).getComponentConfingByType(((t = x.parentSchema) == null ? void 0 : t.type) || "")) == null ? void 0 : e.editConstraints) != null && n.childImmovable ? (u(), K("ul", J, [
|
|
119
|
+
(u(!0), K(z, null, H(d.value, (a) => (u(), V(U, {
|
|
120
|
+
key: a.id,
|
|
121
|
+
schema: a
|
|
122
|
+
}, null, 8, ["schema"]))), 128))
|
|
123
|
+
])) : (u(), V(i(G), j({
|
|
124
|
+
key: 0,
|
|
125
|
+
modelValue: d.value,
|
|
126
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => d.value = a),
|
|
127
|
+
"item-key": "id",
|
|
128
|
+
"component-data": {},
|
|
129
|
+
class: "epic-draggable-range"
|
|
130
|
+
}, {
|
|
131
|
+
animation: 200,
|
|
132
|
+
tag: "ul",
|
|
133
|
+
group: "tree-draggable",
|
|
134
|
+
ghostClass: "moveing",
|
|
135
|
+
draggable: ".draggable-item",
|
|
136
|
+
disabled: !i(l).draggable || ((r = d.value[0]) == null ? void 0 : r.id) === ((h = i(g).schemas[0]) == null ? void 0 : h.id)
|
|
137
|
+
}, {
|
|
138
|
+
onStart: o[1] || (o[1] = (a) => v(a.oldIndex))
|
|
139
|
+
}), {
|
|
140
|
+
item: D(({ element: a, index: C }) => [
|
|
141
|
+
(u(), V(U, {
|
|
142
|
+
class: N(y(a)),
|
|
143
|
+
key: a.id,
|
|
144
|
+
schema: a
|
|
145
|
+
}, null, 8, ["class", "schema"]))
|
|
146
|
+
]),
|
|
147
|
+
_: 1
|
|
148
|
+
}, 16, ["modelValue"]));
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
}), O = { class: "epic-tree h-full flex flex-col" }, Q = { class: "epic-search-box px-10px py-6px" }, R = { class: "epic-tree-main flex-1 overflow-auto h-0" }, W = { class: "text-center pt-42px text-gray-400" }, te = /* @__PURE__ */ w({
|
|
152
|
+
name: "ETree",
|
|
153
|
+
__name: "tree",
|
|
154
|
+
props: {
|
|
155
|
+
options: {
|
|
156
|
+
type: Array,
|
|
157
|
+
default: () => []
|
|
158
|
+
},
|
|
159
|
+
hoverKey: {
|
|
160
|
+
type: String,
|
|
161
|
+
default: ""
|
|
162
|
+
},
|
|
163
|
+
selectedKeys: {
|
|
164
|
+
type: Array,
|
|
165
|
+
default: () => []
|
|
166
|
+
},
|
|
167
|
+
draggable: {
|
|
168
|
+
type: Boolean,
|
|
169
|
+
default: !1
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
emits: ["update:selectedKeys", "nodeClick"],
|
|
173
|
+
setup(_, { emit: s }) {
|
|
174
|
+
const m = M();
|
|
175
|
+
b("slots", m);
|
|
176
|
+
const g = E.getComponent("input"), l = P(""), x = P([]), f = _, d = s, v = B({
|
|
177
|
+
get() {
|
|
178
|
+
return f.selectedKeys;
|
|
179
|
+
},
|
|
180
|
+
set(t) {
|
|
181
|
+
d("update:selectedKeys", t);
|
|
182
|
+
}
|
|
183
|
+
}), y = B({
|
|
184
|
+
get() {
|
|
185
|
+
return c(f.options, l.value);
|
|
186
|
+
},
|
|
187
|
+
set(t) {
|
|
188
|
+
console.log(t);
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
function c(t, e) {
|
|
192
|
+
const n = [];
|
|
193
|
+
return t.forEach((r) => {
|
|
194
|
+
var h;
|
|
195
|
+
if ((h = r.label) != null && h.includes(e))
|
|
196
|
+
n.push(r);
|
|
197
|
+
else if (r.children) {
|
|
198
|
+
const a = c(r.children, e);
|
|
199
|
+
if (a.length > 0) {
|
|
200
|
+
const C = { ...r };
|
|
201
|
+
C.children = a, n.push(C);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}), n;
|
|
205
|
+
}
|
|
206
|
+
function o(t, e) {
|
|
207
|
+
v.value = [t], d("nodeClick", { id: t, componentSchema: e });
|
|
208
|
+
}
|
|
209
|
+
return b("expandedKeys", x), b("selectedKeys", v), b("treeProps", f), b("handleSelect", o), (t, e) => (u(), K("div", O, [
|
|
210
|
+
S("div", Q, [
|
|
211
|
+
k(i(g), {
|
|
212
|
+
placeholder: "搜索节点",
|
|
213
|
+
clearable: "",
|
|
214
|
+
allowClear: "",
|
|
215
|
+
modelValue: l.value,
|
|
216
|
+
"onUpdate:modelValue": e[0] || (e[0] = (n) => l.value = n),
|
|
217
|
+
value: l.value,
|
|
218
|
+
"onUpdate:value": e[1] || (e[1] = (n) => l.value = n)
|
|
219
|
+
}, {
|
|
220
|
+
prefix: D(() => [
|
|
221
|
+
k(i($), { name: "icon--epic--search-rounded" })
|
|
222
|
+
]),
|
|
223
|
+
_: 1
|
|
224
|
+
}, 8, ["modelValue", "value"])
|
|
225
|
+
]),
|
|
226
|
+
S("div", R, [
|
|
227
|
+
S("ul", null, [
|
|
228
|
+
k(A, {
|
|
229
|
+
schemas: y.value,
|
|
230
|
+
"onUpdate:schemas": e[2] || (e[2] = (n) => y.value = n)
|
|
231
|
+
}, null, 8, ["schemas"])
|
|
232
|
+
]),
|
|
233
|
+
q(S("div", W, "没有查询到的数据", 512), [
|
|
234
|
+
[F, !y.value.length]
|
|
235
|
+
])
|
|
236
|
+
])
|
|
237
|
+
]));
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
export {
|
|
241
|
+
te as _
|
|
242
|
+
};
|
package/package.json
CHANGED
package/dist/index-8CeSyRAe.js
DELETED
package/dist/index-B08C8MBy.cjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),A=require("./axios-CYGTE3lR.cjs");function U(t=10){const a="abcdefghijklmnopqrstuvwxyz0123456789";let o="";for(let r=0;r<t;r++){const n=Math.floor(Math.random()*a.length);o+=a[n]}return o}function j(t){return t.charAt(0).toUpperCase()+t.slice(1)}function V(t,a=new WeakMap){if(typeof t!="object"||t===null)return t;if(a.has(t))return a.get(t);if(Array.isArray(t)){const r=t.map(n=>V(n,a));return a.set(t,r),r}const o={};return a.set(t,o),Object.keys(t).forEach(r=>{o[r]=V(t[r],a)}),o}function he(t){const[a]=ne([V(t)],o=>{var n,s;const r={...o,id:`${o.type}_${U(8)}`};return(r.field||r.input)&&!((s=(n=A.pluginManager.getComponentConfingByType(r.type))==null?void 0:n.editConstraints)!=null&&s.fixedField)&&(r.field=r.id),r});return a}function B(t,a,o=!0){for(const[r,n]of Object.entries(a)){let s=t==null?void 0:t[r];s&&n&&typeof s=="object"&&typeof n=="object"?(Array.isArray(s)&&!Array.isArray(n)?s=t[r]={}:!Array.isArray(s)&&Array.isArray(n)&&(s=t[r]=[]),B(s,n,o)):t[r]=n}o&&Object.keys(t).reverse().forEach(r=>{a.hasOwnProperty(r)||(Array.isArray(t)?t.splice(Number(r),1):delete t[r])})}function Z(t,a,o=[],r=new WeakMap){const n=s=>{if(Array.isArray(s))return s.map(n);if(typeof s=="object"&&s!==null){if(r.has(s))return"[Circular]";r.set(s,!0);const i=Object.keys(s).sort(),c={};return i.forEach(u=>{o.includes(u)||(c[u]=n(s[u]))}),r.delete(s),c}else return s};return JSON.stringify(n(t))===JSON.stringify(n(a))}function ee(t,a){const o=[];let r=!1;function n(s){if(o.push(s),s.id===a&&(r=!0),!r&&s.children!=null&&s.children.length>0)for(let i=0;i<s.children.length&&(n(s.children[i]),!r);i++);if(!r&&s.slots)for(let i in s.slots)for(let c=0;c<s.slots[i].length&&(n(s.slots[i][c]),!r);c++);r||o.pop()}return t.forEach(n),r||console.error(`没有查询到id为${a}的节点`),o}function ve(t,a,o){const r=a.split(".");let n=t;for(let s=0;s<r.length;s++){if(n==null)return o;n=n[r[s]]}return n===void 0?o:n}function ge(t,a,o){const r=a.replace(/\[(\d+)\]/g,".$1").split(".").filter(Boolean);let n=t;for(let s=0;s<r.length-1;s++){const i=r[s];n[i]==null&&(n[i]=isNaN(Number(r[s+1]))?{}:[]),n=n[i]}return n[r[r.length-1]]=o,t}function ye(t,a="default"){return te(t,a).map(r=>r.field)}function te(t,a="default"){const o=R(t,n=>{var s;return n.type==="form"&&(((s=n.componentProps)==null?void 0:s.name)??n.name===a)},!0);return R((o==null?void 0:o.children)??[],n=>!!n.input,!1,n=>n.type!=="subform")}function R(t,a,o=!1,r){const n=[],s=[...t];for(;s.length;){const i=s.pop();if(i!=null&&i.children&&(!r||r(i))&&s.push(...i.children),i!=null&&i.slots&&(!r||r(i)))for(let c in i.slots)s.push(...i.slots[c]);if(a(i)&&(n.push(i),o))return i}return o?!1:n}function ne(t,a,o){const r=[...t];for(;r.length;){const n=r.pop();if(n!=null&&n.children&&(!o||o(n))&&r.push(...n.children),n!=null&&n.slots&&(!o||o(n)))for(let s in n.slots)r.push(...n.slots[s]);B(n,a(n))}return t}function we(t,a){const o=R(t,r=>r.id===a,!0);if(!o)throw new Error(`没有查询到id为${a}的节点`);return o}function Se(t,a){const o=[{type:"",children:t}];let r=0,n=null;if(R(o,s=>{if(n=s.children??null,!n){if(s!=null&&s.slots)for(let i in s.slots){n=s.slots[i];for(let c=0;c<n.length;c++)if(n[c].id===a)return r=c,!0}return!1}for(let i=0;i<n.length;i++)if(n[i].id===a)return r=i,!0;return!1},!0),!n)throw new Error(`没有查询到id为${a}的节点`);return{list:n,schema:n[r],index:r}}function be(t){const a={schemas:[{type:"page",id:"root",label:"页面",children:[{label:"表单",type:"form",icon:"epic-icon-daibanshixiang",labelWidth:t.config.labelWidth||100,name:"default",componentProps:{layout:t.config.layout||"horizontal",labelWidth:t.config.labelWidth||100,labelLayout:t.config.labelLayout==="flex"?"fixed":"flex",labelCol:t.config.labelCol||{span:5},wrapperCol:t.config.wrapperCol||{span:19},hideRequiredMark:t.config.hideRequiredMark||!1,colon:t.config.colon||!0,labelAlign:t.config.labelAlign||"right",size:t.config.size||"middle"},children:[],id:"form_"+U()}],componentProps:{style:{padding:"16px"}}}],script:t.script||""};return a.schemas[0].children[0].children=O(t.list),a}function O(t,a){return t.map(o=>{var u,S,v;let r=o.type??"";const n=o.options??{},s=(l,y)=>{r===l&&(r=y,n.defaultValue&&(n.defaultValue=JSON.parse(n.defaultValue)))};if(s("uploadImg","upload-image"),s("uploadFile","upload-file"),r==="date"&&n.range&&(n.type="daterange",delete n.range),(r==="date"||r==="time")&&(n.valueFormat=n.format),r==="textarea"){const{minRows:l,maxRows:y}=n;n.autoSize={minRows:l,maxRows:y},delete n.minRows,delete n.maxRows}r==="number"&&!n.precision&&delete n.precision,n.width&&(n.style={width:n.width},delete n.width),r==="grid"&&(r="row"),a&&a.type==="grid"&&(r="col",n.span=o.span,o.key=U());const i={label:o.label,type:r,icon:o.icon||"",field:o.model,componentProps:n,id:o.key};return(n.noFormItem||!n.showLabel)&&(i.noFormItem=!0,delete n.noFormItem,delete n.showLabel),n.clearable&&(n.allowClear=!0,delete n.clearable),["input","textarea","number","password","select","cascader","checkbox","radio","date","time","slider","switch","color-picker","upload-file","upload-image"].includes(r)&&(i.input=!0,((S=(u=o.rules)==null?void 0:u[0])==null?void 0:S.required)===!1&&o.rules.shift(),((v=o.rules)==null?void 0:v.length)>0&&(i.rules=o.rules)),o.list&&(i.children=O(o.list,o)),o.columns&&(i.children=O(o.columns,o)),o.trs&&(i.children=O(o.trs,o)),o.tds&&(i.children=O(o.tds,o)),i})}function Ce(t,a){let o=null;return(...r)=>{o&&clearTimeout(o),o=setTimeout(()=>{t(...r)},a)}}function Q(){const t=e.ref({}),a=e.ref({}),o=e.ref(!1),r=e.ref([]),n=e.reactive({});function s(h){return t.value[h]}function i(h,w){t.value[h]=w}function c(h){delete t.value[h]}function u(h,w=!1){const g=Object.entries(A.pluginManager.publicMethods).reduce((D,[M,_])=>(D[M]=_.handler,D),{});try{new Function(`const epic = this;${h}`).bind({...g,getComponent:s,find:s,defineExpose:S,publicMethods:g,pluginManager:A.pluginManager})()}catch(D){w&&console.error("[epic:自定义函数]异常:",D)}}function S(h){h!=null&&(a.value=h)}function v(h,...w){if(!h||h.length===0){console.warn("未提供任何动作");return}h.forEach(g=>{const D=g.args?JSON.parse(g.args):w;switch(g.type){case"public":l(g,D);break;case"custom":y(g,D);break;case"component":f(g,D);break;default:console.warn(`未知的动作类型: ${g.type}`);break}})}function l(h,w){var g;try{(g=A.pluginManager.publicMethods[h.methodName])==null||g.handler(...w)}catch(D){console.error(`[Epic:公共函数(${h.methodName})]执行异常:`,D)}}function y(h,w){var g,D;try{(D=(g=a.value)[h.methodName])==null||D.call(g,...w)}catch(M){console.error(`[Epic:自定义函数(${h.methodName})]执行异常:`,M)}}function f(h,w){const g=h.componentId!=null&&s(h.componentId);if(!g){console.warn(`[Epic:组件${h.componentId}]未找到`);return}try{g[h.methodName](...w)}catch(D){console.error(`[Epic:组件${h.componentId}函数(${h.methodName})]执行异常:`,D)}}function p(h=!0){o.value=h}function d(h){const w=R(h,()=>!0);r.value=w.map(g=>g.id)}function k(h,w="default"){if(n[w]){const g=n[w];B(h,g)}n[w]=h}function P(h,w="default"){if(n[w]){B(n[w],h,!1);return}n[w]=h}return{componentInstances:t,funcs:a,isDesignMode:o,defaultComponentIds:r,forms:n,addFormData:k,setFormData:P,getComponentInstance:s,find:s,addComponentInstance:i,removeComponentInstance:c,setMethods:u,doActions:v,setDesignMode:p,setDefaultComponentIds:d}}function oe(){const t=e.ref([]),a=e.ref([]),o=e.ref(null);let r=0;function n(u,S="插入组件"){const v=Date.now();r+150>v||(r=v,o.value!=null&&(t.value.push(o.value),a.value.splice(0,a.value.length)),o.value={type:S,componentSchema:JSON.stringify(u)},t.value.length>60&&t.value.unshift())}function s(){if(t.value.length===0)return!1;const u=t.value.pop();return o.value!=null&&a.value.push(o.value),o.value=u,JSON.parse(u.componentSchema)}function i(){if(a.value.length===0)return!1;const u=a.value.pop();return o.value!=null&&t.value.push(o.value),o.value=u,JSON.parse(u.componentSchema)}function c(){t.value=[],a.value=[],o.value=null}return{recordList:t,undoList:a,currentRecord:o,push:n,undo:s,redo:i,reset:c}}const ke=e.defineComponent({__name:"dynamicFormItem",props:{hasFormItem:{type:Boolean},formItemProps:{}},emits:["updateFormItemRef"],setup(t,{emit:a}){const o=A.pluginManager.getComponent("form-item"),r=t,n=a,s=e.ref(),i=()=>{n("updateFormItemRef",s.value)};return(c,u)=>r.hasFormItem?(e.openBlock(),e.createBlock(e.unref(o),e.mergeProps({key:0,ref_key:"formItemRef",ref:s,onVnodeMounted:i},r.formItemProps),{default:e.withCtx(()=>[e.renderSlot(c.$slots,"default")]),_:3},16,["onVnodeMounted"])):e.renderSlot(c.$slots,"default",{key:1})}}),re=e.defineComponent({name:"ENode",__name:"node",props:{componentSchema:{},modelValue:{},ruleField:{},resetFormData:{type:Boolean},name:{},dynamicId:{},sourceDateUrl:{}},emits:["update:modelValue","change","update:dynamicId"],setup(t,{emit:a}){const{proxy:o}=e.getCurrentInstance(),r=t,n=e.ref(null);let s=e.inject("formData",e.reactive({}));const i=e.inject("slots",{}),c=e.inject("pageManager",{}),u=e.inject("disabled",{value:!1}),S=e.inject("ruleFieldPrefix",null),v=e.inject("resetFormData",!1);let l=e.reactive(V(r.componentSchema));p();async function y(m){if(["cascader","checkbox","select","radio"].includes(m.type)&&m.componentProps.dynamicId&&r.sourceDateUrl){const C=(await A.axios({url:r.sourceDateUrl,method:"get",params:{id:m.componentProps.dynamicId}})).data.data;let x=await A.axios({url:C.url,method:C.method,data:JSON.parse(C.body),params:JSON.parse(C.params),headers:JSON.parse(C.headers)});if(C&&(C!=null&&C.dataPath)){const fe=C.dataPath.split(".").reduce((pe,me)=>pe[me],x.data);m.componentProps.options=f(fe,C.dataKey,C.dataValue)}else m.componentProps.options=f(x.data,C.dataKey,C.dataValue);return m}return m}function f(m,E,I){return m&&Object.prototype.toString.call(m)==="[object Array]"?m.map(C=>C.children&&C.children.length?{label:C[E],value:C[I],children:f(C.children,E,I)}:{label:C[E],value:C[I]}):[]}e.watch(()=>r.componentSchema,m=>{Z(l,m,["children"])||(B(l,V(m)),p())},{deep:!0});function p(){c.isDesignMode.value&&typeof l.field=="string"&&(l.field+="-design-mode")}(r.resetFormData||v)&&(s={});const d=a,k=e.ref(),P=e.ref(),h=m=>{P.value=m},w=e.useAttrs();Object.keys(w).length&&e.provide("nodeAttrs",w);const g=e.shallowRef(null),D=e.computed(()=>{var m,E;return(m=l.componentProps)!=null&&m.hidden?!1:typeof l.show=="boolean"?l.show:((E=l.show)==null?void 0:E.call(l,{values:s}))??!0}),M=e.computed(()=>{var C;const m=D.value&&((C=l.rules)==null?void 0:C.map(x=>({...x,validator:x.validator&&c.funcs.value[x.validator]})));let E=l.field;r.ruleField?E=r.ruleField:S&&l.field&&(E=V(S),E.push(l.field));const I={...l,rules:m,rule:m,field:E};return I.children&&delete I.children,I}),_=e.computed(()=>{var I,C;const m=((I=N.value)==null?void 0:I.bindModel)??"modelValue",E={};return l.on&&Object.keys(l.on).forEach(x=>{E[`on${j(x)}`]=(...X)=>c.doActions(l.on[x],...X)}),{...r,...l.componentProps,disabled:(u==null?void 0:u.value)||((C=l.componentProps)==null?void 0:C.disabled),bindModel:m,...E}}),N=e.computed(()=>A.pluginManager.getComponentConfingByType(l.type)??null);e.watchEffect(()=>{n.value=r.modelValue??s[l.field??""]}),e.watch(()=>n.value,()=>{n.value!==(r.modelValue??s[l.field??""])&&b(n.value)}),e.watch(()=>k.value,()=>{L()},{immediate:!0});function L(){var E;const m=k.value||o;l.id&&m&&(l.input&&(m.setValue=b,m.getValue=()=>s[l.field]||r.modelValue),m.setAttr=(I,C)=>(l.componentProps||(l.componentProps={}),l.componentProps[I]=C),m.getAttr=I=>l.componentProps[I],c.addComponentInstance(l.id,m),(E=N.value)!=null&&E.defaultSchema.input&&l.noFormItem!==!0&&P.value&&c.addComponentInstance(l.id+"formItem",P.value))}function W(){var m;l.id&&(c.removeComponentInstance(l.id),(m=N.value)!=null&&m.defaultSchema.input&&l.noFormItem!==!0&&c.removeComponentInstance(l.id+"formItem"))}async function z(){var E,I,C;if(l=await y(l),typeof((E=l.componentProps)==null?void 0:E.defaultValue)<"u"){const x=c.isDesignMode.value?(I=l.componentProps)==null?void 0:I.defaultValue:s[l.field]??((C=l.componentProps)==null?void 0:C.defaultValue);b(V(x))}if(l.type==="slot"){const x=l.slotName;if(!x)return;g.value=e.defineComponent({setup(){return()=>e.renderSlot(i,x,{componentSchema:l,model:s})}});return}const m=A.pluginManager.getComponent(l.type);if(!m){console.error(`组件${l.type}未注册`);return}if(typeof m=="function"){const x=await m();g.value=x.default??x}else g.value=m}function b(m){d("update:modelValue",m),d("change",m),l.field&&(s[l.field]=m)}function T(m){d("update:dynamicId",m)}let Y=null;return e.watch(()=>l,async m=>{const E=JSON.stringify({...m,children:void 0,componentProps:{...m.componentProps,options:null}});if(E===Y)return!1;Y=E,z()},{immediate:!0,deep:!0}),e.onUnmounted(W),(m,E)=>{var C;const I=e.resolveComponent("ENode");return g.value&&D.value?(e.openBlock(),e.createBlock(ke,{key:0,hasFormItem:e.unref(l).noFormItem!==!0&&((C=N.value)==null?void 0:C.defaultSchema.input),formItemProps:M.value,onUpdateFormItemRef:h},{default:e.withCtx(()=>[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(g.value),e.mergeProps({ref_key:"componentInstance",ref:k,onVnodeMounted:L,model:e.unref(s)},{..._.value},{[_.value.bindModel]:n.value,["onUpdate:"+_.value.bindModel]:E[0]||(E[0]=x=>n.value=x),[`onUpdate:${_.value.bindModel}`||""]:b,"onUpdate:dynamicId":T}),{node:e.withCtx(x=>[e.createVNode(I,e.mergeProps(x,{sourceDateUrl:r.sourceDateUrl}),null,16,["sourceDateUrl"])]),"edit-node":e.withCtx(()=>[e.renderSlot(m.$slots,"edit-node")]),_:3},16,["model"]))]),_:3},8,["hasFormItem","formItemProps"])):e.createCommentVNode("",!0)}}});function Ee(){const t=e.ref(!1),a=Q(),o=e.ref({});function r(){return new Promise(f=>{if(t.value)f();else{const p=e.watch(t,()=>{p(),f()})}})}async function n(f="default"){var d;await r();const p=(d=o.value)==null?void 0:d[f];if(!p)throw new Error(`表单 [name=${f}] 不存在`);return p}async function s(f,p){const d=await n(f);return V(await p(d))}async function i(f="default"){return await s(f,p=>p.getData())}function c(f,p="default"){var k;a.setFormData(f,p);const d=(k=o.value)==null?void 0:k[p];d==null||d.clearValidate()}async function u(f="default"){return await s(f,async p=>(await p.validate(),await p.getData()))}async function S(f){await r();const p={};for(const d in o.value){const k=o.value[d];k&&(p[d]=V(await f(k)))}return p}async function v(){return await S(f=>f.getData())}function l(f){for(const p in f)c(f[p],p)}async function y(){return await S(async f=>(await f.validate(),await f.getData()))}return{ready:t,pageManager:a,forms:o,getData:i,setData:c,validate:u,getForms:v,setForms:l,validateAll:y,getFormInstance:n}}const De={key:0,class:"epic-loading-box"},Ae={class:"epic-builder-main"},xe={class:"epic-loading-box"},ae=e.defineComponent({__name:"builder",props:{pageSchema:{},formData:{},disabled:{type:Boolean},sourceDateUrl:{}},emits:["ready"],setup(t,{expose:a,emit:o}){const r=A.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Cap7FkuS.cjs"))),n=o,{ready:s,pageManager:i,forms:c,getData:u,setData:S,validate:v,getForms:l,setForms:y,validateAll:f,getFormInstance:p}=Ee(),d=t,k=e.reactive({schemas:[]});e.watch(()=>d.pageSchema,g=>{B(k,g)},{immediate:!0,deep:!0}),e.watch(()=>d.formData,g=>{g&&S(g)},{immediate:!0,deep:!0}),e.watch(()=>k.script,g=>{g&&i.setMethods(g,!0)},{immediate:!0}),e.provide("slots",e.useSlots()),e.provide("pageManager",i),e.provide("forms",c),e.provide("pageSchema",k),e.provide("disabled",e.computed(()=>d.disabled));const P=e.getCurrentInstance(),h=P==null?void 0:P.proxy;function w(){e.nextTick(()=>{s.value=!0,n("ready",i),h&&i.addComponentInstance("builder",h)})}return a({ready:s,pageManager:i,getData:u,setData:S,validate:v,getForms:l,setForms:y,validateAll:f,getFormInstance:p}),(g,D)=>e.unref(A.pluginManager).initialized.value?(e.openBlock(),e.createBlock(e.Suspense,{key:1,onResolve:w},{default:e.withCtx(()=>[e.createElementVNode("div",Ae,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(k.schemas,(M,_)=>(e.openBlock(),e.createBlock(e.unref(re),{key:_,sourceDateUrl:d.sourceDateUrl,componentSchema:M},null,8,["sourceDateUrl","componentSchema"]))),128))])]),fallback:e.withCtx(()=>[e.createElementVNode("div",xe,[e.createVNode(e.unref(r))])]),_:1})):(e.openBlock(),e.createElementBlock("div",De))}});function G(t){return e.getCurrentScope()?(e.onScopeDispose(t),!0):!1}function Ie(t){let a=0,o,r;const n=()=>{a-=1,r&&a<=0&&(r.stop(),o=void 0,r=void 0)};return(...s)=>(a+=1,r||(r=e.effectScope(!0),o=r.run(()=>t(...s))),G(n),o)}function $(t){return typeof t=="function"?t():e.unref(t)}const Pe=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Me=t=>typeof t<"u",Ve=Object.prototype.toString,_e=t=>Ve.call(t)==="[object Object]",Be=()=>{};function Ne(t){return e.getCurrentInstance()}function Fe(t,a=!0,o){Ne()?e.onMounted(t,o):a?t():e.nextTick(t)}function Oe(t=!1,a={}){const{truthyValue:o=!0,falsyValue:r=!1}=a,n=e.isRef(t),s=e.ref(t);function i(c){if(arguments.length)return s.value=c,s.value;{const u=$(o);return s.value=s.value===u?$(r):u,s.value}}return n?i:[s,i]}function Re(t,a,o){const r=e.watch(t,(...n)=>(e.nextTick(()=>r()),a(...n)),o);return r}const J=Pe?window:void 0;function F(t){var a;const o=$(t);return(a=o==null?void 0:o.$el)!=null?a:o}function $e(...t){let a,o,r,n;if(typeof t[0]=="string"||Array.isArray(t[0])?([o,r,n]=t,a=J):[a,o,r,n]=t,!a)return Be;Array.isArray(o)||(o=[o]),Array.isArray(r)||(r=[r]);const s=[],i=()=>{s.forEach(v=>v()),s.length=0},c=(v,l,y,f)=>(v.addEventListener(l,y,f),()=>v.removeEventListener(l,y,f)),u=e.watch(()=>[F(a),$(n)],([v,l])=>{if(i(),!v)return;const y=_e(l)?{...l}:l;s.push(...o.flatMap(f=>r.map(p=>c(v,f,p,y))))},{immediate:!0,flush:"post"}),S=()=>{u(),i()};return G(S),S}function Te(t){return typeof t=="function"?t:typeof t=="string"?a=>a.key===t:Array.isArray(t)?a=>t.includes(a.key):()=>!0}function se(...t){let a,o,r={};t.length===3?(a=t[0],o=t[1],r=t[2]):t.length===2?typeof t[1]=="object"?(a=!0,o=t[0],r=t[1]):(a=t[0],o=t[1]):(a=!0,o=t[0]);const{target:n=J,eventName:s="keydown",passive:i=!1,dedupe:c=!1}=r,u=Te(a);return $e(n,s,v=>{v.repeat&&$(c)||u(v)&&o(v)},i)}function H(t,a,o={}){return se(t,a,{...o,eventName:"keydown"})}function K(t,a,o={}){return se(t,a,{...o,eventName:"keyup"})}function Ue(){const t=e.ref(!1),a=e.getCurrentInstance();return a&&e.onMounted(()=>{t.value=!0},a),t}function qe(t){const a=Ue();return e.computed(()=>(a.value,!!t()))}function Le(t){return JSON.parse(JSON.stringify(t))}function le(t,a,o={}){const{window:r=J,...n}=o;let s;const i=qe(()=>r&&"ResizeObserver"in r),c=()=>{s&&(s.disconnect(),s=void 0)},u=e.computed(()=>{const l=$(t);return Array.isArray(l)?l.map(y=>F(y)):[F(l)]}),S=e.watch(u,l=>{if(c(),i.value&&r){s=new ResizeObserver(a);for(const y of l)y&&s.observe(y,n)}},{immediate:!0,flush:"post"}),v=()=>{c(),S()};return G(v),{isSupported:i,stop:v}}function ze(t,a={width:0,height:0},o={}){const{window:r=J,box:n="content-box"}=o,s=e.computed(()=>{var l,y;return(y=(l=F(t))==null?void 0:l.namespaceURI)==null?void 0:y.includes("svg")}),i=e.ref(a.width),c=e.ref(a.height),{stop:u}=le(t,([l])=>{const y=n==="border-box"?l.borderBoxSize:n==="content-box"?l.contentBoxSize:l.devicePixelContentBoxSize;if(r&&s.value){const f=F(t);if(f){const p=f.getBoundingClientRect();i.value=p.width,c.value=p.height}}else if(y){const f=Array.isArray(y)?y:[y];i.value=f.reduce((p,{inlineSize:d})=>p+d,0),c.value=f.reduce((p,{blockSize:d})=>p+d,0)}else i.value=l.contentRect.width,c.value=l.contentRect.height},o);Fe(()=>{const l=F(t);l&&(i.value="offsetWidth"in l?l.offsetWidth:a.width,c.value="offsetHeight"in l?l.offsetHeight:a.height)});const S=e.watch(()=>F(t),l=>{i.value=l?a.width:0,c.value=l?a.height:0});function v(){u(),S()}return{width:i,height:c,stop:v}}function Je(t,a,o,r={}){var n,s,i;const{clone:c=!1,passive:u=!1,eventName:S,deep:v=!1,defaultValue:l,shouldEmit:y}=r,f=e.getCurrentInstance(),p=o||(f==null?void 0:f.emit)||((n=f==null?void 0:f.$emit)==null?void 0:n.bind(f))||((i=(s=f==null?void 0:f.proxy)==null?void 0:s.$emit)==null?void 0:i.bind(f==null?void 0:f.proxy));let d=S;a||(a="modelValue"),d=d||`update:${a.toString()}`;const k=w=>c?typeof c=="function"?c(w):Le(w):w,P=()=>Me(t[a])?k(t[a]):l,h=w=>{y?y(w)&&p(d,w):p(d,w)};if(u){const w=P(),g=e.ref(w);let D=!1;return e.watch(()=>t[a],M=>{D||(D=!0,g.value=k(M),e.nextTick(()=>D=!1))}),e.watch(g,M=>{!D&&(M!==t[a]||v)&&h(M)},{deep:v}),g}else return e.computed({get(){return P()},set(w){h(w)}})}function We(){const{isDark:t}=q(),a=Oe(t);return{isDark:t,toggleDark:a}}function ie(){const t=e.ref(!1);return e.onMounted(()=>{ce(t),He(t)}),e.watch(()=>t.value,()=>{t.value?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")}),{isDark:t}}function ce(t){var a=document.documentElement;a&&(a.classList.contains("dark")?t.value=!0:t.value=!1)}function He(t){var a=document.querySelector("html"),o=new MutationObserver(function(r){for(var n of r)if(n.type==="attributes"&&n.attributeName==="class"){const s=n.target;new Array(...s.classList).includes("dark")?t.value=!0:t.value=!1}});o.observe(a,{attributes:!0,attributeFilter:["class"]}),e.onUnmounted(()=>{o.disconnect()})}function ue(){const t=e.ref(1),a=e.ref(!1),{isDark:o}=ie(),{pressSpace:r,pressShift:n,pressCtrl:s}=de();return{canvasScale:t,pressSpace:r,pressShift:n,pressCtrl:s,disabledZoom:a,isDark:o}}const q=Ie(ue);function de(){const t=e.ref(!1),a=e.ref(!1),o=e.ref(!1);return H(" ",()=>{t.value=!0}),K(" ",()=>{t.value=!1}),H("Shift",r=>{r.preventDefault(),a.value=!0}),K("Shift",()=>{a.value=!1}),H("Control",r=>{r.preventDefault(),o.value=!0}),K("Control",()=>{o.value=!1}),{pressSpace:t,pressShift:a,pressCtrl:o}}function Ke(t){const{pressSpace:a}=q(),o=new Image(1,1);o.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==";let r=0,n=0;function s(u){var S;a.value&&(r=u.x,n=u.y,(S=u.dataTransfer)==null||S.setDragImage(document.createElement("div"),0,0))}function i(u){if(u.preventDefault(),!u.x||!u.y||!a.value)return;const S=u.x-r,v=u.y-n;r=u.x,n=u.y,t.value&&(t.value.scrollTop-=v,t.value.scrollLeft-=S)}function c(){a.value=!1}return{handleElementDragStart:s,handleElementDrag:i,handleElementDragEnd:c}}function Ze(t){const{pressCtrl:a,canvasScale:o,disabledZoom:r}=q();function n(s){if(!a.value||r.value)return;s.preventDefault();let i=0;s.deltaY<0?i=o.value+.05:i=o.value-.05,!(i>150||i<.5)&&(o.value=i)}return e.watch(()=>o.value,s=>{t.value&&!r.value&&(t.value.style.transform=`scale(${s})`)}),{handleZoom:n,canvasScale:o}}function Qe(t,a=16.66){let o;function r(){n(),o=window.setInterval(t,a)}function n(){window.clearInterval(o)}return{startTimedQuery:r,stopTimedQuery:n}}const Ge={class:"min-w-750px rounded"},Ye={class:"h-full rounded"},Xe=e.defineComponent({__name:"index",setup(t,{expose:a}){const o=A.pluginManager.getComponent("monacoEditor"),r=A.pluginManager.getComponent("modal"),n=e.ref(null),s=e.ref(!1),i=e.ref(!1),c=e.ref({}),u=e.inject("pageSchema"),S=e.ref(null),v=e.ref("");function l(){i.value=!1}function y(){s.value=!1}function f(){s.value=!0,v.value=U()}async function p(){try{let d=await S.value.validateAll();if(!Object.keys(d).length){alert("请添加表单组件后再尝试!");return}Object.keys(d).length===1&&(d=d.default),c.value=JSON.stringify(d,null,2),e.nextTick(()=>{var k;(k=n.value)==null||k.setValue(c.value)}),i.value=!0}catch(d){console.error(d)}}return a({handleOpen:f}),(d,k)=>(e.openBlock(),e.createBlock(e.unref(r),{modelValue:s.value,"onUpdate:modelValue":k[1]||(k[1]=P=>s.value=P),title:"预览",class:"w-900px",width:"900px",onClose:y,onOk:p,okText:"表单数据"},{default:e.withCtx(()=>[e.createElementVNode("div",Ge,[(e.openBlock(),e.createBlock(e.unref(ae),{key:v.value,ref_key:"kb",ref:S,"page-schema":e.unref(u)},null,8,["page-schema"])),e.createVNode(e.unref(r),{modelValue:i.value,"onUpdate:modelValue":k[0]||(k[0]=P=>i.value=P),title:"表单数据",class:"w-860px",width:"860px",onClose:l,onOk:l},{default:e.withCtx(()=>[e.createElementVNode("div",Ye,[e.createVNode(e.unref(o),{ref_key:"monacoEditorRef",ref:n,autoToggleTheme:"",readOnly:"",class:"h-full editor","model-value":c.value},null,8,["model-value"])])]),_:1},8,["modelValue"])])]),_:1},8,["modelValue"]))}}),je={key:0,class:"epic-loading-box"},et={class:"epic-designer-main"},tt={class:"epic-header-container"},nt={class:"epic-loading-box"},ot=e.defineComponent({__name:"designer",props:{disabledZoom:{type:Boolean,default:!1},hiddenHeader:{type:Boolean,default:!1},lockDefaultSchemaEdit:{type:Boolean,default:!1},formMode:{type:Boolean,default:!1},title:{default:"EpicDesigner默认项目"},defaultSchema:{},sourceCodeReadOnly:{type:Boolean},source:{default:[]},updateSourceId:{}},emits:["ready","save","reset","toggleDeviceMode","saveSourceData","deleteSourceData","updateSourceData"],setup(t,{expose:a,emit:o}){const r=A.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-1afOcXnV.cjs"))),n=A.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-BJlPL6eL.cjs"))),s=A.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-CtryGVPT.cjs"))),i=A.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-C6ceZM1C.cjs"))),c=A.loadAsyncComponent(()=>Promise.resolve().then(()=>require("./index-Cap7FkuS.cjs"))),u=Q(),S=oe(),v=t;let l={schemas:[{type:"form",id:"root",label:"页面",children:[],componentProps:{name:"表单",style:{padding:"16px"}}}],script:`const { defineExpose, find } = epic;
|
|
2
|
-
|
|
3
|
-
function test (){
|
|
4
|
-
console.log('test')
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
// 通过defineExpose暴露的函数或者属性
|
|
8
|
-
defineExpose({
|
|
9
|
-
test
|
|
10
|
-
})`};e.watchEffect(()=>{if(v.defaultSchema){l=v.defaultSchema;return}v.source&&A.pluginManager.setSourceData(v.source),v.formMode&&(l.schemas=A.pluginManager.formSchemas)}),u.setDesignMode(),u.setDefaultComponentIds(l.schemas);const y=o,f=e.ref(null),p=e.reactive({checkedNode:null,hoverNode:null,disableHover:!1,matched:[]}),d=e.reactive({schemas:[],script:l.script}),{disabledZoom:k}=q();e.watchEffect(()=>{k.value=v.disabledZoom}),e.watchEffect(()=>{const b=d.script;b&&b!==""&&u.setMethods(b)}),e.provide("pageSchema",d),e.provide("revoke",S),e.provide("pageManager",u),e.provide("designerProps",e.computed(()=>v)),e.provide("designer",{setCheckedNode:h,setHoverNode:w,setDisableHover:D,handleToggleDeviceMode:W,reset:N,state:p}),A.EventBus.on("saveSourceData",b=>{y("saveSourceData",b)}),A.EventBus.on("deleteSourceData",b=>{y("deleteSourceData",b)}),A.EventBus.on("updateSourceData",b=>{y("updateSourceData",b)});function P(){d.schemas=V(l.schemas),h(d.schemas[0]),S.push(d.schemas,"初始化撤销功能")}async function h(b=d.schemas[0]){p.checkedNode=b,p.matched=ee(d.schemas,b.id)}async function w(b=null){var T;if(!b||p.disableHover)return p.hoverNode=null,!1;if((b==null?void 0:b.id)===((T=p.hoverNode)==null?void 0:T.id))return!1;p.hoverNode=b}function g(){e.nextTick(()=>{y("ready",{pageManager:u})})}async function D(b=!1){p.disableHover=b}function M(b){B(d,V(b))}function _(){return e.toRaw(d)}function N(){Z(d.schemas,l.schemas)&&d.script===l.script||(B(d.schemas,l.schemas),d.script=l.script,h(d.schemas[0]),S.push(d.schemas,"重置操作"),y("reset",d))}function L(){y("save",e.toRaw(d))}function W(b){y("toggleDeviceMode",b)}function z(){f.value.handleOpen()}return P(),a({revoke:S,setData:M,getData:_,reset:N,preview:z}),(b,T)=>e.unref(A.pluginManager).initialized.value?(e.openBlock(),e.createBlock(e.Suspense,{key:1,onResolve:g},{default:e.withCtx(()=>[e.createElementVNode("div",et,[e.createElementVNode("div",tt,[e.renderSlot(b.$slots,"header",{},()=>[v.hiddenHeader?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(r),{key:0,onPreview:z,onSave:L},{header:e.withCtx(()=>[e.renderSlot(b.$slots,"header-prefix")]),prefix:e.withCtx(()=>[e.renderSlot(b.$slots,"header-prefix")]),title:e.withCtx(()=>[e.renderSlot(b.$slots,"header-title")]),"right-prefix":e.withCtx(()=>[e.renderSlot(b.$slots,"header-right-prefix")]),"right-action":e.withCtx(()=>[e.renderSlot(b.$slots,"header-right-action")]),"right-suffix":e.withCtx(()=>[e.renderSlot(b.$slots,"header-right-suffix")]),_:3}))])]),e.createElementVNode("div",{class:e.normalizeClass(["epic-split-view-container",{"hidden-header":b.hiddenHeader}])},[e.createVNode(e.unref(n)),e.createVNode(e.unref(s)),e.createVNode(e.unref(i))],2),e.createVNode(Xe,{ref_key:"previewRef",ref:f},null,512)])]),fallback:e.withCtx(()=>[e.createElementVNode("div",nt,[e.createVNode(e.unref(c))])]),_:3})):(e.openBlock(),e.createElementBlock("div",je))}}),rt={component:async()=>await Promise.resolve().then(()=>require("./index-Bhg6gVv4.cjs")),defaultSchema:{label:"代码编辑器",type:"monacoEditor",field:"monacoEditor",icon:"epic-icon-write",input:!0},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"monacoEditor",field:"componentProps.defaultValue"}]},bindModel:"model-value"},at={component:async()=>await Promise.resolve().then(()=>require("./index-Ch9jeYmj.cjs")),defaultSchema:{label:"页面",type:"page",componentProps:{},children:[]},config:{attribute:[{label:"页面名称",type:"input",componentProps:{placeholder:"请输入"},field:"componentProps.name"}]}};function st(t){t.component("EInputSize",async()=>await Promise.resolve().then(()=>require("./index-DpzLP1Zp.cjs"))),t.component("EColEditor",async()=>await Promise.resolve().then(()=>require("./index-CrBsc5Nz.cjs"))),t.component("EActionEditor",async()=>await Promise.resolve().then(()=>require("./index-DSLPA7t_.cjs"))),t.component("ERuleEditor",async()=>await Promise.resolve().then(()=>require("./index-DxHwIIzt.cjs"))),t.component("EOptionsEditor",async()=>await Promise.resolve().then(()=>require("./index-4q36b3GY.cjs"))),t.component("ENode",async()=>await Promise.resolve().then(()=>require("./index-CAF_naew.cjs"))),t.component("EDataSource",async()=>await Promise.resolve().then(()=>require("./index-B03W7FZR.cjs"))),t.registerActivitybar({id:"component_view",title:"组件",icon:"icon--epic--extension-outline",component:async()=>await Promise.resolve().then(()=>require("./index-B3vfighS.cjs"))}),t.registerRightSidebar({id:"attribute_view",title:"属性",component:async()=>await Promise.resolve().then(()=>require("./attributeView-BBrzwmf4.cjs"))}),t.registerRightSidebar({id:"style_view",title:"样式",component:async()=>await Promise.resolve().then(()=>require("./styleView-CBGRKJTF.cjs"))}),[rt,at].forEach(o=>{t.registerComponent(o)})}st(A.pluginManager);exports._sfc_main=re;exports._sfc_main$1=ae;exports._sfc_main$2=ot;exports.capitalizeFirstLetter=j;exports.convertKFormData=be;exports.debounce=Ce;exports.deepClone=V;exports.deepCompareAndModify=B;exports.deepEqual=Z;exports.findSchemaById=we;exports.findSchemaInfoById=Se;exports.findSchemas=R;exports.generateNewSchema=he;exports.getDarkState=ce;exports.getFormFields=ye;exports.getFormSchemas=te;exports.getMatchedById=ee;exports.getUUID=U;exports.getValueByPath=ve;exports.initStore=ue;exports.mapSchemas=ne;exports.recursionConvertedNode=O;exports.setValueByPath=ge;exports.useDark=ie;exports.useElementDrag=Ke;exports.useElementSize=ze;exports.useElementZoom=Ze;exports.useKeyPress=de;exports.usePageManager=Q;exports.useResizeObserver=le;exports.useRevoke=oe;exports.useStore=q;exports.useTheme=We;exports.useTimedQuery=Qe;exports.useVModel=Je;exports.watchOnce=Re;
|