epic-designer-gold 0.0.26 → 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-DCzZRUVR.cjs → attributeView-DT3Pgu2H.cjs} +1 -1
- package/dist/{attributeView-kN43pWbg.js → attributeView-VgLT3_0E.js} +1 -1
- package/dist/core/components/designer/src/modules/outline/outline.vue.d.ts +2 -0
- package/dist/{index-DLBhfrNB.js → index-8jV4lvPb.js} +53 -48
- package/dist/index-B0S7YNtd.js +432 -0
- package/dist/{index-DY-o9yrn.cjs → index-B9zp9FUu.cjs} +1 -1
- package/dist/{index-jHZMacL0.cjs → index-BAbG8xrg.cjs} +1 -1
- package/dist/{index-BEe15yy8.js → index-BWCIdFn_.js} +1 -1
- package/dist/index-BcTELKKi.cjs +1 -0
- package/dist/{index-CbGpPxHm.cjs → index-BfoDWeC1.cjs} +1 -1
- package/dist/{index-DxN8RjEN.js → index-C2Nctb3q.js} +1 -1
- package/dist/{index-CaTuGyqu.js → index-CJaP0qUg.js} +1 -1
- package/dist/{index-Bjx88DqX.js → index-CQ_Xpn1C.js} +1 -1
- package/dist/{index-Dk4znWYz.js → index-Cn2i-Eyz.js} +1 -1
- package/dist/{index-CPUaKvrZ.cjs → index-D-mV-SAk.cjs} +1 -1
- package/dist/{index-Dzlg11UJ.cjs → index-DKe3uW6g.cjs} +1 -1
- package/dist/{index-XFxcgCZv.cjs → index-DkVKzqSQ.cjs} +1 -1
- package/dist/{index-Cj4ZeanZ.js → index-DqWY4lfL.js} +1 -1
- package/dist/{index-CEYb2hAA.cjs → index-R7VF52gK.cjs} +2 -2
- package/dist/{index-CIA7md14.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-CzuVNY_C.cjs → styleView-B66KWbOm.cjs} +1 -1
- package/dist/{styleView-CW51rl71.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-AtPqwiGo.js +0 -665
- package/dist/index-CV6j5M_g.cjs +0 -1
- package/dist/index-CbNFt3RR.js +0 -4
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
import { defineComponent as U, inject as L, openBlock as p, createElementBlock as g, Fragment as A, renderList as T, createElementVNode as i, toDisplayString as O, createVNode as C, unref as _, withCtx as R, createCommentVNode as G, createTextVNode as J, ref as E, computed as S, withDirectives as F, normalizeClass as j, vShow as P, reactive as H, createBlock as K, nextTick as Q, toRaw as z, watch as W } from "vue";
|
|
2
|
+
import { l as q, _ as X, k as Y, m as Z } from "./index-8jV4lvPb.js";
|
|
3
|
+
import { p as w } from "./axios-ITY6Uw7A.js";
|
|
4
|
+
import { _ as D } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
|
+
import { d as ee } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
6
|
+
import { _ as te } from "./tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js";
|
|
7
|
+
const ne = { class: "epic-event-info" }, oe = ["title"], le = { class: "epic-event-btn text-lg flex items-center text-$epic-text-secondary" }, ae = { class: "epic-action-editor-main" }, se = { class: "epic-editor-item rounded" }, ie = { class: "w-36px flex items-center text-lg" }, ce = { class: "flex-1" }, de = { key: 0 }, ue = { key: 1 }, re = { key: 2 }, pe = { class: "epic-action-box text-lg text-$epic-text-medium" }, me = ["onClick"], ve = ["onClick"], fe = /* @__PURE__ */ U({
|
|
8
|
+
__name: "EActionEditorItem",
|
|
9
|
+
props: {
|
|
10
|
+
itemEvents: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
allEvents: {
|
|
15
|
+
type: Array,
|
|
16
|
+
default: () => []
|
|
17
|
+
},
|
|
18
|
+
modelValue: {
|
|
19
|
+
type: Object,
|
|
20
|
+
default: () => []
|
|
21
|
+
},
|
|
22
|
+
events: {
|
|
23
|
+
type: Object,
|
|
24
|
+
default: () => ({})
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
emits: ["add", "edit", "update:modelValue"],
|
|
28
|
+
setup(b, { emit: k }) {
|
|
29
|
+
const m = b, x = k, f = L("pageSchema");
|
|
30
|
+
function V(v) {
|
|
31
|
+
x("add", v);
|
|
32
|
+
}
|
|
33
|
+
function h(v) {
|
|
34
|
+
return q(f.schemas, v).label;
|
|
35
|
+
}
|
|
36
|
+
function r(v, c) {
|
|
37
|
+
var e;
|
|
38
|
+
const l = n(c);
|
|
39
|
+
l[c] = m.events[c].filter(($, N) => v !== N), (e = l[c]) != null && e.length || delete l[c], x("update:modelValue", l);
|
|
40
|
+
}
|
|
41
|
+
function u(v, c, l) {
|
|
42
|
+
x("edit", v, c, l);
|
|
43
|
+
}
|
|
44
|
+
function n(v) {
|
|
45
|
+
const c = {};
|
|
46
|
+
return m.allEvents.forEach((l) => {
|
|
47
|
+
if (!m.events[l.type].length || l.type === v)
|
|
48
|
+
return !1;
|
|
49
|
+
c[l.type] = m.events[l.type];
|
|
50
|
+
}), c;
|
|
51
|
+
}
|
|
52
|
+
return (v, c) => (p(!0), g(A, null, T(b.itemEvents, (l) => (p(), g("div", {
|
|
53
|
+
key: l.type,
|
|
54
|
+
class: "epic-event-item"
|
|
55
|
+
}, [
|
|
56
|
+
i("div", ne, [
|
|
57
|
+
i("div", {
|
|
58
|
+
class: "epic-event-label",
|
|
59
|
+
title: l.describe
|
|
60
|
+
}, O(l.describe), 9, oe),
|
|
61
|
+
i("div", le, [
|
|
62
|
+
C(_(D), {
|
|
63
|
+
name: "icon--epic--add-rounded",
|
|
64
|
+
onClick: (e) => V(l.type)
|
|
65
|
+
}, null, 8, ["onClick"])
|
|
66
|
+
])
|
|
67
|
+
]),
|
|
68
|
+
i("div", ae, [
|
|
69
|
+
C(_(ee), {
|
|
70
|
+
modelValue: m.events[l.type],
|
|
71
|
+
"onUpdate:modelValue": (e) => m.events[l.type] = e,
|
|
72
|
+
"item-key": "id",
|
|
73
|
+
"component-data": {
|
|
74
|
+
type: "transition-group"
|
|
75
|
+
},
|
|
76
|
+
group: "option-list",
|
|
77
|
+
handle: ".handle",
|
|
78
|
+
animation: 200
|
|
79
|
+
}, {
|
|
80
|
+
item: R(({ element: e, index: $ }) => [
|
|
81
|
+
i("div", se, [
|
|
82
|
+
i("div", ie, [
|
|
83
|
+
C(_(D), {
|
|
84
|
+
class: "mr-2 text-lg cursor-move handle text-$epic-text-medium",
|
|
85
|
+
name: "icon--epic--drag"
|
|
86
|
+
})
|
|
87
|
+
]),
|
|
88
|
+
i("div", ce, [
|
|
89
|
+
e.type === "component" ? (p(), g("div", de, O(h(e.componentId)), 1)) : e.type === "custom" ? (p(), g("div", ue, " 自定义函数 ")) : e.type === "public" ? (p(), g("div", re, " 公共函数 ")) : G("", !0),
|
|
90
|
+
J(" " + O(e.methodName), 1)
|
|
91
|
+
]),
|
|
92
|
+
i("div", pe, [
|
|
93
|
+
i("div", {
|
|
94
|
+
class: "epic-edit-btn",
|
|
95
|
+
onClick: (N) => u($, l.type, e)
|
|
96
|
+
}, [
|
|
97
|
+
C(_(D), { name: "icon--epic--page-info-outline-rounded" })
|
|
98
|
+
], 8, me),
|
|
99
|
+
i("div", {
|
|
100
|
+
class: "epic-del-btn",
|
|
101
|
+
onClick: (N) => r($, l.type)
|
|
102
|
+
}, [
|
|
103
|
+
C(_(D), { name: "icon--epic--delete-outline-rounded" })
|
|
104
|
+
], 8, ve)
|
|
105
|
+
])
|
|
106
|
+
])
|
|
107
|
+
]),
|
|
108
|
+
_: 2
|
|
109
|
+
}, 1032, ["modelValue", "onUpdate:modelValue"])
|
|
110
|
+
])
|
|
111
|
+
]))), 128));
|
|
112
|
+
}
|
|
113
|
+
}), he = { class: "h-full flex flex-col" }, ge = /* @__PURE__ */ U({
|
|
114
|
+
__name: "EScriptEdit",
|
|
115
|
+
setup(b) {
|
|
116
|
+
const k = w.getComponent("monacoEditor"), m = {
|
|
117
|
+
theme: "vs-light",
|
|
118
|
+
selectOnLineNumbers: !0,
|
|
119
|
+
minimap: {
|
|
120
|
+
enabled: !1
|
|
121
|
+
}
|
|
122
|
+
}, x = E(null), f = L("pageSchema");
|
|
123
|
+
return (V, h) => (p(), g("div", he, [
|
|
124
|
+
h[1] || (h[1] = i("div", { class: "pb-2" }, " 自定义函数编辑 ", -1)),
|
|
125
|
+
C(_(k), {
|
|
126
|
+
ref_key: "monacoEditorRef",
|
|
127
|
+
ref: x,
|
|
128
|
+
autoToggleTheme: "",
|
|
129
|
+
modelValue: _(f).script,
|
|
130
|
+
"onUpdate:modelValue": h[0] || (h[0] = (r) => _(f).script = r),
|
|
131
|
+
class: "epic-editor flex-1",
|
|
132
|
+
config: m,
|
|
133
|
+
language: "javascript"
|
|
134
|
+
}, null, 8, ["modelValue"])
|
|
135
|
+
]));
|
|
136
|
+
}
|
|
137
|
+
}), _e = { class: "epic-attribute-view" }, ye = ["title"], xe = { class: "epic-attr-input" }, Ie = /* @__PURE__ */ U({
|
|
138
|
+
__name: "EArgsEditor",
|
|
139
|
+
props: {
|
|
140
|
+
modelValue: {},
|
|
141
|
+
actionArgsConfigs: {}
|
|
142
|
+
},
|
|
143
|
+
emits: ["update:modelValue"],
|
|
144
|
+
setup(b, { emit: k }) {
|
|
145
|
+
const m = b, x = k, f = S(() => m.modelValue ? JSON.parse(m.modelValue) : []);
|
|
146
|
+
function V(r) {
|
|
147
|
+
var u;
|
|
148
|
+
return typeof r.show == "boolean" ? r.show : typeof r.show == "function" ? (u = r.show) == null ? void 0 : u.call(r, { values: f.value }) : !0;
|
|
149
|
+
}
|
|
150
|
+
function h(r, u) {
|
|
151
|
+
const n = [
|
|
152
|
+
...JSON.parse(m.modelValue ?? "[]")
|
|
153
|
+
];
|
|
154
|
+
n[u] = r, x("update:modelValue", JSON.stringify(n));
|
|
155
|
+
}
|
|
156
|
+
return (r, u) => (p(), g("div", _e, [
|
|
157
|
+
(p(!0), g(A, null, T(m.actionArgsConfigs, (n) => (p(), g("div", {
|
|
158
|
+
key: n.field + n.type
|
|
159
|
+
}, [
|
|
160
|
+
F(i("div", {
|
|
161
|
+
class: j(["epic-attr-item", n.layout])
|
|
162
|
+
}, [
|
|
163
|
+
i("div", {
|
|
164
|
+
class: "epic-attr-label",
|
|
165
|
+
title: n.label
|
|
166
|
+
}, O(n.label), 9, ye),
|
|
167
|
+
i("div", xe, [
|
|
168
|
+
C(_(X), {
|
|
169
|
+
componentSchema: { ...n, componentProps: { ...n.componentProps, input: !1, field: void 0, hidden: !1 }, show: !0, noFormItem: !0 },
|
|
170
|
+
"model-value": f.value[n.field],
|
|
171
|
+
"onUpdate:modelValue": (v) => h(v, n.field)
|
|
172
|
+
}, null, 8, ["componentSchema", "model-value", "onUpdate:modelValue"])
|
|
173
|
+
])
|
|
174
|
+
], 2), [
|
|
175
|
+
[P, V(n)]
|
|
176
|
+
])
|
|
177
|
+
]))), 128))
|
|
178
|
+
]));
|
|
179
|
+
}
|
|
180
|
+
}), Ce = { class: "rounded epic-modal-action-main" }, Ve = { class: "epic-modal-left-panel h-full flex flex-col" }, ke = { class: "flex flex-1 h-0 flex-col" }, be = { class: "flex-1 h-0" }, Ee = { class: "epic-action-select h-30/100 flex flex-col" }, $e = { class: "flex-1 overflow-auto pr-8px" }, Ne = ["onClick"], Se = { class: "text-center pt-42px text-gray-400" }, we = { class: "epic-modal-right-panel" }, Oe = {
|
|
181
|
+
key: 1,
|
|
182
|
+
class: "text-center pt-42px text-gray-400"
|
|
183
|
+
}, Ae = /* @__PURE__ */ U({
|
|
184
|
+
__name: "EActionModal",
|
|
185
|
+
emits: ["add", "edit"],
|
|
186
|
+
setup(b, { expose: k, emit: m }) {
|
|
187
|
+
const x = w.getComponent("modal"), f = E(!0), V = L("pageSchema"), h = L("pageManager", {}), r = E(!1), u = E([]), n = E(null), v = m, c = S(() => {
|
|
188
|
+
var o;
|
|
189
|
+
return e.actionItem.type === "component" ? n.value ? (o = w.getComponentConfings()[n.value.type].config.action) == null ? void 0 : o.map((t) => ({
|
|
190
|
+
label: t.describe,
|
|
191
|
+
value: t.type
|
|
192
|
+
})) : [] : e.actionItem.type === "custom" ? Object.entries(h.funcs.value).filter(([t, I]) => typeof I == "function").map(([t]) => ({ label: t, value: t })) : e.actionItem.type === "public" ? Object.entries(w.publicMethods).map(([t]) => ({
|
|
193
|
+
label: t,
|
|
194
|
+
value: t
|
|
195
|
+
})) : [];
|
|
196
|
+
}), l = S(() => {
|
|
197
|
+
if (e.actionItem.type === "component" && n.value) {
|
|
198
|
+
const o = w.getComponentConfings()[n.value.type].config.action, t = o == null ? void 0 : o.find(
|
|
199
|
+
(I) => I.type === e.actionItem.methodName
|
|
200
|
+
);
|
|
201
|
+
if (t != null && t.argsConfigs) {
|
|
202
|
+
const I = t.argsConfigs.findIndex(
|
|
203
|
+
(y) => y.label === "设置数据"
|
|
204
|
+
);
|
|
205
|
+
I !== -1 && (t.argsConfigs[I] = {
|
|
206
|
+
...n.value,
|
|
207
|
+
label: "设置数据",
|
|
208
|
+
field: "0",
|
|
209
|
+
id: Y()
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
return (t == null ? void 0 : t.argsConfigs) ?? [];
|
|
213
|
+
}
|
|
214
|
+
return [];
|
|
215
|
+
}), e = H({
|
|
216
|
+
actionItem: {
|
|
217
|
+
type: "custom",
|
|
218
|
+
methodName: "test",
|
|
219
|
+
componentId: null
|
|
220
|
+
},
|
|
221
|
+
cacheData: {}
|
|
222
|
+
});
|
|
223
|
+
function $() {
|
|
224
|
+
var o;
|
|
225
|
+
r.value = !0, f.value = !0, e.actionItem.type = "custom", e.actionItem.componentId = null, (o = c.value) != null && o.length && d(c.value[0].value);
|
|
226
|
+
}
|
|
227
|
+
function N(o) {
|
|
228
|
+
if (r.value = !0, f.value = !1, n.value = null, o.componentId) {
|
|
229
|
+
const t = q(V.schemas, o.componentId);
|
|
230
|
+
n.value = t, u.value = [o.componentId];
|
|
231
|
+
}
|
|
232
|
+
Q(() => {
|
|
233
|
+
e.actionItem.componentId = o.componentId, e.actionItem.methodName = o.methodName, e.actionItem.type = o.type, e.actionItem.args = o.args;
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function B() {
|
|
237
|
+
if (!e.actionItem.methodName) {
|
|
238
|
+
alert("请先选择动作方法");
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
v(f.value ? "add" : "edit", Z(z(e.actionItem))), M();
|
|
242
|
+
}
|
|
243
|
+
function M() {
|
|
244
|
+
r.value = !1, u.value = [], e.cacheData = {};
|
|
245
|
+
}
|
|
246
|
+
function s(o) {
|
|
247
|
+
var t;
|
|
248
|
+
e.actionItem.componentId = null, e.actionItem.type = o, n.value = null, e.actionItem.methodName = null, u.value = [], (t = c.value) != null && t.length && d(c.value[0].value);
|
|
249
|
+
}
|
|
250
|
+
function a(o) {
|
|
251
|
+
var t;
|
|
252
|
+
e.actionItem.args && (e.cacheData[e.actionItem.componentId + e.actionItem.methodName] = e.actionItem.args), e.actionItem.componentId = o.id, e.actionItem.type = "component", e.actionItem.methodName = null, n.value = o.componentSchema, (t = c.value) != null && t.length && d(c.value[0].value);
|
|
253
|
+
}
|
|
254
|
+
function d(o) {
|
|
255
|
+
e.actionItem.methodName = o, e.actionItem.args = e.cacheData[e.actionItem.componentId + e.actionItem.methodName];
|
|
256
|
+
}
|
|
257
|
+
return k({
|
|
258
|
+
handleOpen: $,
|
|
259
|
+
handleOpenEdit: N
|
|
260
|
+
}), (o, t) => (p(), K(_(x), {
|
|
261
|
+
modelValue: r.value,
|
|
262
|
+
"onUpdate:modelValue": t[4] || (t[4] = (I) => r.value = I),
|
|
263
|
+
class: "w-1200px",
|
|
264
|
+
width: "1200px",
|
|
265
|
+
onClose: M,
|
|
266
|
+
onOk: B,
|
|
267
|
+
title: "动作配置"
|
|
268
|
+
}, {
|
|
269
|
+
default: R(() => {
|
|
270
|
+
var I;
|
|
271
|
+
return [
|
|
272
|
+
i("div", Ce, [
|
|
273
|
+
i("div", Ve, [
|
|
274
|
+
i("div", ke, [
|
|
275
|
+
i("div", {
|
|
276
|
+
class: j(["fun-btn", { checked: e.actionItem.type === "custom" }]),
|
|
277
|
+
onClick: t[0] || (t[0] = (y) => s("custom"))
|
|
278
|
+
}, " 自定义函数 ", 2),
|
|
279
|
+
i("div", {
|
|
280
|
+
class: j(["fun-btn", { checked: e.actionItem.type === "public" }]),
|
|
281
|
+
onClick: t[1] || (t[1] = (y) => s("public"))
|
|
282
|
+
}, " 公共函数 ", 2),
|
|
283
|
+
t[5] || (t[5] = J(" 组件 ")),
|
|
284
|
+
i("div", be, [
|
|
285
|
+
C(_(te), {
|
|
286
|
+
selectedKeys: u.value,
|
|
287
|
+
"onUpdate:selectedKeys": t[2] || (t[2] = (y) => u.value = y),
|
|
288
|
+
options: _(V).schemas,
|
|
289
|
+
onNodeClick: a
|
|
290
|
+
}, null, 8, ["selectedKeys", "options"])
|
|
291
|
+
])
|
|
292
|
+
]),
|
|
293
|
+
i("div", Ee, [
|
|
294
|
+
t[6] || (t[6] = i("div", { class: "mb-2" }, "动作选择", -1)),
|
|
295
|
+
i("div", $e, [
|
|
296
|
+
(p(!0), g(A, null, T(c.value, (y) => (p(), g("div", {
|
|
297
|
+
class: j([{ checked: y.value === e.actionItem.methodName }, "epic-action-item"]),
|
|
298
|
+
onClick: (Ue) => d(y.value),
|
|
299
|
+
key: y.value
|
|
300
|
+
}, [
|
|
301
|
+
i("span", null, O(y.label), 1)
|
|
302
|
+
], 10, Ne))), 128)),
|
|
303
|
+
F(i("div", Se, " 当前组件暂无动作 ", 512), [
|
|
304
|
+
[P, !((I = c.value) != null && I.length)]
|
|
305
|
+
])
|
|
306
|
+
])
|
|
307
|
+
])
|
|
308
|
+
]),
|
|
309
|
+
i("div", we, [
|
|
310
|
+
e.actionItem.type === "custom" ? (p(), K(ge, { key: 0 })) : l.value.length === 0 ? (p(), g("div", Oe, " 暂无配置 ")) : (p(), K(Ie, {
|
|
311
|
+
key: 2,
|
|
312
|
+
modelValue: e.actionItem.args,
|
|
313
|
+
"onUpdate:modelValue": t[3] || (t[3] = (y) => e.actionItem.args = y),
|
|
314
|
+
actionArgsConfigs: l.value
|
|
315
|
+
}, null, 8, ["modelValue", "actionArgsConfigs"]))
|
|
316
|
+
])
|
|
317
|
+
])
|
|
318
|
+
];
|
|
319
|
+
}),
|
|
320
|
+
_: 1
|
|
321
|
+
}, 8, ["modelValue"]));
|
|
322
|
+
}
|
|
323
|
+
}), Te = /* @__PURE__ */ U({
|
|
324
|
+
__name: "index",
|
|
325
|
+
props: {
|
|
326
|
+
eventList: {
|
|
327
|
+
type: Array,
|
|
328
|
+
default: () => []
|
|
329
|
+
},
|
|
330
|
+
modelValue: {
|
|
331
|
+
type: Object
|
|
332
|
+
}
|
|
333
|
+
},
|
|
334
|
+
emits: ["update:modelValue"],
|
|
335
|
+
setup(b, { emit: k }) {
|
|
336
|
+
const m = w.getComponent("Collapse"), x = w.getComponent("CollapseItem"), f = E(null);
|
|
337
|
+
let V = 0;
|
|
338
|
+
const h = b, r = k, u = S({
|
|
339
|
+
get() {
|
|
340
|
+
return h.modelValue;
|
|
341
|
+
},
|
|
342
|
+
set(s) {
|
|
343
|
+
r("update:modelValue", s);
|
|
344
|
+
}
|
|
345
|
+
}), n = E([]), v = S(() => h.eventList.filter((s) => s.events.length)), c = S(() => h.eventList.map((s) => s.events).flat()), l = E({});
|
|
346
|
+
c.value.forEach((s) => {
|
|
347
|
+
l.value[s.type] = S({
|
|
348
|
+
get() {
|
|
349
|
+
var a;
|
|
350
|
+
return ((a = u.value) == null ? void 0 : a[s.type]) ?? [];
|
|
351
|
+
},
|
|
352
|
+
set(a) {
|
|
353
|
+
a && a.length ? u.value[s.type] = a.map((d) => z(d)) : delete u.value[s.type];
|
|
354
|
+
}
|
|
355
|
+
});
|
|
356
|
+
}), W(() => v.value, (s) => {
|
|
357
|
+
s.length && (n.value = s.filter((a) => {
|
|
358
|
+
for (let d = 0; d < a.events.length; d++) {
|
|
359
|
+
const o = a.events[d].type;
|
|
360
|
+
if (l.value[o].length)
|
|
361
|
+
return !0;
|
|
362
|
+
}
|
|
363
|
+
return !1;
|
|
364
|
+
}).map((a) => a.title));
|
|
365
|
+
}, {
|
|
366
|
+
// 配置选项
|
|
367
|
+
immediate: !0
|
|
368
|
+
// 立即执行一次回调函数
|
|
369
|
+
});
|
|
370
|
+
let e = "";
|
|
371
|
+
function $(s) {
|
|
372
|
+
var a;
|
|
373
|
+
(a = f.value) == null || a.handleOpen(), e = s;
|
|
374
|
+
}
|
|
375
|
+
function N(s, a, d) {
|
|
376
|
+
var o;
|
|
377
|
+
(o = f.value) == null || o.handleOpenEdit(d), V = s, e = a;
|
|
378
|
+
}
|
|
379
|
+
function B(s) {
|
|
380
|
+
l.value[e][V] = s, u.value[e] = [...l.value[e] ?? []];
|
|
381
|
+
}
|
|
382
|
+
function M(s) {
|
|
383
|
+
if (!u.value) {
|
|
384
|
+
u.value = { [e]: [...l.value[e] ?? [], s] };
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
u.value[e] = [...l.value[e] ?? [], s];
|
|
388
|
+
}
|
|
389
|
+
return (s, a) => (p(), g(A, null, [
|
|
390
|
+
C(_(m), {
|
|
391
|
+
modelValue: n.value,
|
|
392
|
+
"onUpdate:modelValue": a[1] || (a[1] = (d) => n.value = d),
|
|
393
|
+
activeKey: n.value,
|
|
394
|
+
"onUpdate:activeKey": a[2] || (a[2] = (d) => n.value = d),
|
|
395
|
+
"expanded-names": n.value,
|
|
396
|
+
"onUpdate:expandedNames": a[3] || (a[3] = (d) => n.value = d)
|
|
397
|
+
}, {
|
|
398
|
+
default: R(() => [
|
|
399
|
+
(p(!0), g(A, null, T(v.value, (d) => (p(), K(_(x), {
|
|
400
|
+
key: d.title,
|
|
401
|
+
title: d.title,
|
|
402
|
+
header: d.title,
|
|
403
|
+
name: d.title
|
|
404
|
+
}, {
|
|
405
|
+
default: R(() => [
|
|
406
|
+
C(fe, {
|
|
407
|
+
modelValue: u.value,
|
|
408
|
+
"onUpdate:modelValue": a[0] || (a[0] = (o) => u.value = o),
|
|
409
|
+
"item-events": d.events,
|
|
410
|
+
"all-events": c.value,
|
|
411
|
+
events: l.value,
|
|
412
|
+
onAdd: $,
|
|
413
|
+
onEdit: N
|
|
414
|
+
}, null, 8, ["modelValue", "item-events", "all-events", "events"])
|
|
415
|
+
]),
|
|
416
|
+
_: 2
|
|
417
|
+
}, 1032, ["title", "header", "name"]))), 128))
|
|
418
|
+
]),
|
|
419
|
+
_: 1
|
|
420
|
+
}, 8, ["modelValue", "activeKey", "expanded-names"]),
|
|
421
|
+
C(Ae, {
|
|
422
|
+
ref_key: "EActionModalRef",
|
|
423
|
+
ref: f,
|
|
424
|
+
onAdd: M,
|
|
425
|
+
onEdit: B
|
|
426
|
+
}, null, 512)
|
|
427
|
+
], 64));
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
export {
|
|
431
|
+
Te as default
|
|
432
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./axios-CYGTE3lR.cjs"),c=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),k=require("./axios-CYGTE3lR.cjs"),c=require("./index-R7VF52gK.cjs"),B=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),_=[{label:"string",value:"string"},{label:"number",value:"number"},{label:"boolean",value:"boolean"},{label:"method",value:"method"},{label:"regexp",value:"regexp"},{label:"integer",value:"integer"},{label:"float",value:"float"},{label:"array",value:"array"},{label:"object",value:"object"},{label:"date",value:"date"},{label:"url",value:"url"},{label:"hex",value:"hex"},{label:"email",value:"email"},{label:"any",value:"any"}],V=[{label:"change",value:"change"},{label:"blur",value:"blur"}],f=["string","number","url","array","email"],w={class:"rule-item-main bg-white m-t-2 p-2 rounded border border-solid border-gray-200 hover:border-primary transition-all relative"},E={key:0,class:"flex m-t-2 first:m-0"},x={class:"epic-attr-label",title:"校验时机"},q={class:"epic-attr-input"},C=e.defineComponent({__name:"ERuleItem",props:{rule:{}},emits:["change","delete","update:rule"],setup(h,{emit:b}){const i=b,d=h,r=e.computed({get(){return d.rule},set(l){i("update:rule",l)}}),u=e.inject("pageManager",{}),a=e.computed(()=>Object.entries(u.funcs.value).filter(([l,p])=>typeof p=="function").map(([l])=>({label:l,value:l}))),g=[{type:"select",label:"校验时机",model:"trigger",componentProps:{options:V,placeholder:"校验时机",multiple:!0,mode:"multiple"}},{type:"switch",label:"自定义规则",model:"isValidator"},{type:"select",label:"校验函数",model:"validator",show(){return!!r.value.isValidator},componentProps:{options:a.value,placeholder:"校验函数"}},{type:"select",label:"类型",model:"type",show(){return!r.value.isValidator},componentProps:{options:_,placeholder:"类型"}},{type:"input",label:"正则校验",model:"pattern",show(){return!r.value.isValidator},componentProps:{placeholder:"正则校验"}},{type:"number",label:"字段长度",model:"len",show(){return f.includes(r.value.type??"")},componentProps:{min:0,placeholder:"字段长度"}},{type:"number",label:"最小长度",model:"min",show(){return f.includes(r.value.type??"")},componentProps:{min:0,placeholder:"最小长度"}},{type:"number",label:"最大长度",model:"max",show(){return f.includes(r.value.type??"")},componentProps:{min:0,placeholder:"最大长度"}},{type:"input",label:"校验信息",model:"message",componentProps:{placeholder:"校验信息"}}];function o(){const l=r.value;l.isValidator?(delete l.type,delete l.pattern,delete l.len,delete l.min,delete l.max):delete l.validator,i("change",l)}function y(){i("delete")}return(l,p)=>(e.openBlock(),e.createElementBlock("div",w,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(g,(t,m)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m},[!t.show||t.show()?(e.openBlock(),e.createElementBlock("div",E,[e.createElementVNode("div",x,e.toDisplayString(t.label),1),e.createElementVNode("div",q,[e.createVNode(e.unref(c._sfc_main),{modelValue:r.value[t.model],"onUpdate:modelValue":n=>r.value[t.model]=n,componentSchema:{...t,noFormItem:!0},onChange:o},null,8,["modelValue","onUpdate:modelValue","componentSchema"])])])):e.createCommentVNode("",!0)],64))),64)),e.createElementVNode("div",{class:"rule-btn-delete absolute top-0 text-md right-0 transition-all w-24px h-24px cursor-pointer rounded-bl-2 flex justify-center items-center color-white",onClick:y},[e.createVNode(e.unref(B._sfc_main),{name:"icon--epic--delete-outline-rounded"})])]))}}),N={class:"rule-item-main m-t-2 p-2 rounded border border-solid transition-all relative"},P={key:0,class:"flex m-t-2 first:m-0"},U={class:"epic-attr-label"},F={class:"flex-1"},j=e.defineComponent({__name:"index",props:{ruleType:{type:String,default:"string"},modelValue:{type:Array,default:void 0}},emits:["update:modelValue"],setup(h,{emit:b}){const i=k.pluginManager.getComponent("button"),d=h,r=b,u=c.useVModel(d,"modelValue",r),a=e.ref({required:!1,message:"必填项",type:d.ruleType,trigger:["change"]}),g=[{type:"switch",label:"必填项",model:"required"},{type:"select",label:"校验时机",model:"trigger",show(){return!!a.value.required},componentProps:{options:V,placeholder:"校验时机",multiple:!0,mode:"multiple"}},{type:"select",label:"类型",model:"type",show(){return!!a.value.required},componentProps:{options:_,placeholder:"类型"}},{type:"input",label:"校验信息",model:"message",show(){return!!a.value.required},componentProps:{placeholder:"校验信息"}}],o=e.ref([]);e.watchEffect(()=>{u.value&&(o.value=[],u.value.forEach(t=>{typeof t.required<"u"?a.value=t:o.value.push(t)}))});function y(){o.value.push({message:"",type:d.ruleType,trigger:["change"]}),l()}function l(){if(a.value.required){u.value=c.deepClone([...o.value,a.value]);return}if(o.value.length){u.value=c.deepClone(o.value);return}u.value=void 0}function p(t){o.value.splice(t,1),l()}return(t,m)=>(e.openBlock(),e.createElementBlock("div",null,[e.createElementVNode("div",N,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(g,(n,s)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:s},[!n.show||n.show()?(e.openBlock(),e.createElementBlock("div",P,[e.createElementVNode("div",U,e.toDisplayString(n.label),1),e.createElementVNode("div",F,[e.createVNode(e.unref(c._sfc_main),{modelValue:a.value[n.model],"onUpdate:modelValue":v=>a.value[n.model]=v,componentSchema:{...n,noFormItem:!0},onChange:l},null,8,["modelValue","onUpdate:modelValue","componentSchema"])])])):e.createCommentVNode("",!0)],64))),64))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(n,s)=>(e.openBlock(),e.createBlock(C,{key:s,rule:o.value[s],"onUpdate:rule":v=>o.value[s]=v,onDelete:v=>p(s),onChange:l},null,8,["rule","onUpdate:rule","onDelete"]))),128)),e.createVNode(e.unref(i),{class:"m-t-2",onClick:y},{default:e.withCtx(()=>m[0]||(m[0]=[e.createTextVNode(" 添加规则 ")])),_:1})]))}});exports.default=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./vuedraggable.umd-BqhSJIAi.cjs"),m=require("./axios-CYGTE3lR.cjs"),y=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),b=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./vuedraggable.umd-BqhSJIAi.cjs"),m=require("./axios-CYGTE3lR.cjs"),y=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),b=require("./index-R7VF52gK.cjs"),B=require("element-plus"),S=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),U={key:0,class:"pl-4"},M=e.defineComponent({name:"EOptionItem",__name:"optionItem",props:{modelValue:{}},emits:["update:modelValue"],setup(h,{emit:g}){const k=h,f=m.pluginManager.getComponent("input"),s=e.inject("tree",!1),p=g,c=b.useVModel(k,"modelValue",p);function _(o){const d={label:"",value:""};o.children?o.children.push(d):o.children=[d]}function u(o){c.value=c.value.filter((d,v)=>v!==o)}return(o,d)=>{const v=e.resolveComponent("EOptionItem");return e.openBlock(),e.createBlock(e.unref(E.draggable),{modelValue:e.unref(c),"onUpdate:modelValue":d[0]||(d[0]=a=>e.isRef(c)?c.value=a:null),"item-key":"id","component-data":{type:"transition-group"},group:"option-list",handle:".handle",animation:200},{item:e.withCtx(({element:a,index:V})=>[e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass([e.unref(s)?"grid-cols-[16px_auto_auto_16px_16px]":"grid-cols-[16px_auto_auto_16px]","option-item text-16px grid text-$epic-text-secondary gap-2 items-center mb-2"])},[e.createVNode(e.unref(y._sfc_main),{class:"mr-2 cursor-move handle",name:"icon--epic--drag"}),e.createVNode(e.unref(f),{modelValue:a.label,"onUpdate:modelValue":r=>a.label=r,value:a.label,"onUpdate:value":r=>a.label=r,placeholder:"label"},null,8,["modelValue","onUpdate:modelValue","value","onUpdate:value"]),e.createVNode(e.unref(f),{modelValue:a.value,"onUpdate:modelValue":r=>a.value=r,value:a.value,"onUpdate:value":r=>a.value=r,placeholder:"value"},null,8,["modelValue","onUpdate:modelValue","value","onUpdate:value"]),e.unref(s)?(e.openBlock(),e.createBlock(e.unref(y._sfc_main),{key:0,class:"cursor-pointer text-lg!",name:"icon--epic--add-rounded",onClick:r=>_(a)},null,8,["onClick"])):e.createCommentVNode("",!0),e.createVNode(e.unref(y._sfc_main),{class:"hover:text-red cursor-pointer",name:"icon--epic--delete-outline-rounded",onClick:r=>u(V)},null,8,["onClick"])],2),a.children?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(v,{modelValue:a.children,"onUpdate:modelValue":r=>a.children=r},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue"])}}}),O={class:""},I={class:"epic-tabs-box"},q=["title","onClick"],w={key:0},$={class:"py-4 my-2 text-center text-gray-400 bg-white"},j={key:1},A=e.defineComponent({__name:"index",props:{tree:{type:Boolean},modelValue:{},dynamicId:{},type:{}},emits:["update:modelValue","update:EOptionsEditor"],setup(h,{emit:g}){const k=m.pluginManager.getComponent("button"),f=m.pluginManager.getComponent("select"),s=e.ref([]),p=e.reactive({title:"静态"}),c=h,_=g;m.EventBus.on("updateSource",t=>{s.value=m.pluginManager.sourceData.map(l=>({...l,label:l.apiName,value:l.id})),V(o.value)}),e.onMounted(()=>{s.value=m.pluginManager.sourceData.map(t=>({...t,label:t.apiName,value:t.id})),V(o.value)});const u=b.useVModel(c,"modelValue",_),o=b.useVModel(c,"dynamicId",_);function d(t,l,i){return t&&Object.prototype.toString.call(t)==="[object Array]"?t.map(n=>n.children&&n.children.length?{label:n[l],value:n[i]+"",children:d(n.children,l,i)}:{label:n[l],value:n[i]+""}):(B.ElMessage.info("请检查数据位置是否配置准确"),[])}e.watch(()=>o.value,async()=>{o.value?p.title="动态":p.title="静态"},{immediate:!0});const v=[{title:"静态"},{title:"动态"}];async function a(t){p.title=t.title,t.title==="静态"&&(o.value="")}async function V(t){const l=s.value.find(i=>i.id===t);if(l&&l.url){let i=await m.axios({method:(l==null?void 0:l.method)||"get",url:l.url,params:l!=null&&l.params?JSON.parse(l==null?void 0:l.params):{},data:l!=null&&l.data?JSON.parse(l==null?void 0:l.data):{},headers:l!=null&&l.header?JSON.parse(l==null?void 0:l.header):{}});if(l&&(l!=null&&l.dataPath)){const x=l.dataPath.split(".").reduce((C,N)=>C[N],i.data);u.value=d(x,l.dataKey,l.dataValue)}else u.value=d(i.data,l.dataKey,l.dataValue)}}c.modelValue,e.provide("tree",c.tree);function r(){const t=e.reactive({label:"",value:""});u.value.length?u.value=[...u.value,t]:u.value=[t]}return(t,l)=>{var i;return e.openBlock(),e.createElementBlock("div",O,[e.createElementVNode("div",null,[e.createElementVNode("div",I,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(v,(n,x)=>e.createElementVNode("div",{class:e.normalizeClass(["epic-tab cursor-pointer truncate",{checked:p.title===n.title}]),key:x,title:n.title,onClick:C=>a(n)},e.toDisplayString(n.title),11,q)),64))]),p.title==="静态"?(e.openBlock(),e.createElementBlock("div",w,[e.withDirectives(e.createElementVNode("div",$,"暂无选项",512),[[e.vShow,!((i=e.unref(u))!=null&&i.length)]]),e.createVNode(M,{modelValue:e.unref(u),"onUpdate:modelValue":l[0]||(l[0]=n=>e.isRef(u)?u.value=n:null)},null,8,["modelValue"]),e.createVNode(e.unref(k),{onClick:r},{default:e.withCtx(()=>l[2]||(l[2]=[e.createTextVNode("添加选项")])),_:1})])):(e.openBlock(),e.createElementBlock("div",j,[l[3]||(l[3]=e.createElementVNode("span",{style:{"font-size":"12px","margin-bottom":"8px",display:"inline-block"}},"数据源",-1)),e.createVNode(e.unref(f),{modelValue:e.unref(o),"onUpdate:modelValue":l[1]||(l[1]=n=>e.isRef(o)?o.value=n:null),placeholder:"请选择数据源",clearable:"",options:s.value,onChange:V},null,8,["modelValue","options"])]))])])}}}),D=S._export_sfc(A,[["__scopeId","data-v-5fa7ffef"]]);exports.default=D;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as V, computed as k, openBlock as a, createElementBlock as l, Fragment as g, renderList as C, createVNode as p, unref as r, createElementVNode as c, createCommentVNode as y } from "vue";
|
|
2
2
|
import { p as U } from "./axios-ITY6Uw7A.js";
|
|
3
|
-
import { k as P } from "./index-
|
|
3
|
+
import { k as P } from "./index-8jV4lvPb.js";
|
|
4
4
|
import { _ as b } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
5
|
const E = {
|
|
6
6
|
key: 0,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),C=require("./index-R7VF52gK.cjs"),x=require("./axios-CYGTE3lR.cjs"),b=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),S=require("./vuedraggable.umd-BqhSJIAi.cjs"),$=require("./tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs"),w={class:"epic-event-info"},M=["title"],O={class:"epic-event-btn text-lg flex items-center text-$epic-text-secondary"},A={class:"epic-action-editor-main"},U={class:"epic-editor-item rounded"},D={class:"w-36px flex items-center text-lg"},j={class:"flex-1"},L={key:0},K={key:1},R={key:2},T={class:"epic-action-box text-lg text-$epic-text-medium"},q=["onClick"],F=["onClick"],z=e.defineComponent({__name:"EActionEditorItem",props:{itemEvents:{type:Array,default:()=>[]},allEvents:{type:Array,default:()=>[]},modelValue:{type:Object,default:()=>[]},events:{type:Object,default:()=>({})}},emits:["add","edit","update:modelValue"],setup(E,{emit:V}){const m=E,h=V,v=e.inject("pageSchema");function y(p){h("add",p)}function f(p){return C.findSchemaById(v.schemas,p).label}function u(p,i){var t;const a=o(i);a[i]=m.events[i].filter((k,N)=>p!==N),(t=a[i])!=null&&t.length||delete a[i],h("update:modelValue",a)}function r(p,i,a){h("edit",p,i,a)}function o(p){const i={};return m.allEvents.forEach(a=>{if(!m.events[a.type].length||a.type===p)return!1;i[a.type]=m.events[a.type]}),i}return(p,i)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.itemEvents,a=>(e.openBlock(),e.createElementBlock("div",{key:a.type,class:"epic-event-item"},[e.createElementVNode("div",w,[e.createElementVNode("div",{class:"epic-event-label",title:a.describe},e.toDisplayString(a.describe),9,M),e.createElementVNode("div",O,[e.createVNode(e.unref(b._sfc_main),{name:"icon--epic--add-rounded",onClick:t=>y(a.type)},null,8,["onClick"])])]),e.createElementVNode("div",A,[e.createVNode(e.unref(S.draggable),{modelValue:m.events[a.type],"onUpdate:modelValue":t=>m.events[a.type]=t,"item-key":"id","component-data":{type:"transition-group"},group:"option-list",handle:".handle",animation:200},{item:e.withCtx(({element:t,index:k})=>[e.createElementVNode("div",U,[e.createElementVNode("div",D,[e.createVNode(e.unref(b._sfc_main),{class:"mr-2 text-lg cursor-move handle text-$epic-text-medium",name:"icon--epic--drag"})]),e.createElementVNode("div",j,[t.type==="component"?(e.openBlock(),e.createElementBlock("div",L,e.toDisplayString(f(t.componentId)),1)):t.type==="custom"?(e.openBlock(),e.createElementBlock("div",K," 自定义函数 ")):t.type==="public"?(e.openBlock(),e.createElementBlock("div",R," 公共函数 ")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.methodName),1)]),e.createElementVNode("div",T,[e.createElementVNode("div",{class:"epic-edit-btn",onClick:N=>r(k,a.type,t)},[e.createVNode(e.unref(b._sfc_main),{name:"icon--epic--page-info-outline-rounded"})],8,q),e.createElementVNode("div",{class:"epic-del-btn",onClick:N=>u(k,a.type)},[e.createVNode(e.unref(b._sfc_main),{name:"icon--epic--delete-outline-rounded"})],8,F)])])]),_:2},1032,["modelValue","onUpdate:modelValue"])])]))),128))}}),J={class:"h-full flex flex-col"},P=e.defineComponent({__name:"EScriptEdit",setup(E){const V=x.pluginManager.getComponent("monacoEditor"),m={theme:"vs-light",selectOnLineNumbers:!0,minimap:{enabled:!1}},h=e.ref(null),v=e.inject("pageSchema");return(y,f)=>(e.openBlock(),e.createElementBlock("div",J,[f[1]||(f[1]=e.createElementVNode("div",{class:"pb-2"}," 自定义函数编辑 ",-1)),e.createVNode(e.unref(V),{ref_key:"monacoEditorRef",ref:h,autoToggleTheme:"",modelValue:e.unref(v).script,"onUpdate:modelValue":f[0]||(f[0]=u=>e.unref(v).script=u),class:"epic-editor flex-1",config:m,language:"javascript"},null,8,["modelValue"])]))}}),G={class:"epic-attribute-view"},H=["title"],Q={class:"epic-attr-input"},W=e.defineComponent({__name:"EArgsEditor",props:{modelValue:{},actionArgsConfigs:{}},emits:["update:modelValue"],setup(E,{emit:V}){const m=E,h=V,v=e.computed(()=>m.modelValue?JSON.parse(m.modelValue):[]);function y(u){var r;return typeof u.show=="boolean"?u.show:typeof u.show=="function"?(r=u.show)==null?void 0:r.call(u,{values:v.value}):!0}function f(u,r){const o=[...JSON.parse(m.modelValue??"[]")];o[r]=u,h("update:modelValue",JSON.stringify(o))}return(u,r)=>(e.openBlock(),e.createElementBlock("div",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.actionArgsConfigs,o=>(e.openBlock(),e.createElementBlock("div",{key:o.field+o.type},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["epic-attr-item",o.layout])},[e.createElementVNode("div",{class:"epic-attr-label",title:o.label},e.toDisplayString(o.label),9,H),e.createElementVNode("div",Q,[e.createVNode(e.unref(C._sfc_main),{componentSchema:{...o,componentProps:{...o.componentProps,input:!1,field:void 0,hidden:!1},show:!0,noFormItem:!0},"model-value":v.value[o.field],"onUpdate:modelValue":p=>f(p,o.field)},null,8,["componentSchema","model-value","onUpdate:modelValue"])])],2),[[e.vShow,y(o)]])]))),128))]))}}),X={class:"rounded epic-modal-action-main"},Y={class:"epic-modal-left-panel h-full flex flex-col"},Z={class:"flex flex-1 h-0 flex-col"},ee={class:"flex-1 h-0"},te={class:"epic-action-select h-30/100 flex flex-col"},ne={class:"flex-1 overflow-auto pr-8px"},oe=["onClick"],le={class:"text-center pt-42px text-gray-400"},ae={class:"epic-modal-right-panel"},ce={key:1,class:"text-center pt-42px text-gray-400"},se=e.defineComponent({__name:"EActionModal",emits:["add","edit"],setup(E,{expose:V,emit:m}){const h=x.pluginManager.getComponent("modal"),v=e.ref(!0),y=e.inject("pageSchema"),f=e.inject("pageManager",{}),u=e.ref(!1),r=e.ref([]),o=e.ref(null),p=m,i=e.computed(()=>{var l;return t.actionItem.type==="component"?o.value?(l=x.pluginManager.getComponentConfings()[o.value.type].config.action)==null?void 0:l.map(n=>({label:n.describe,value:n.type})):[]:t.actionItem.type==="custom"?Object.entries(f.funcs.value).filter(([n,_])=>typeof _=="function").map(([n])=>({label:n,value:n})):t.actionItem.type==="public"?Object.entries(x.pluginManager.publicMethods).map(([n])=>({label:n,value:n})):[]}),a=e.computed(()=>{if(t.actionItem.type==="component"&&o.value){const l=x.pluginManager.getComponentConfings()[o.value.type].config.action,n=l==null?void 0:l.find(_=>_.type===t.actionItem.methodName);if(n!=null&&n.argsConfigs){const _=n.argsConfigs.findIndex(g=>g.label==="设置数据");_!==-1&&(n.argsConfigs[_]={...o.value,label:"设置数据",field:"0",id:C.getUUID()})}return(n==null?void 0:n.argsConfigs)??[]}return[]}),t=e.reactive({actionItem:{type:"custom",methodName:"test",componentId:null},cacheData:{}});function k(){var l;u.value=!0,v.value=!0,t.actionItem.type="custom",t.actionItem.componentId=null,(l=i.value)!=null&&l.length&&d(i.value[0].value)}function N(l){if(u.value=!0,v.value=!1,o.value=null,l.componentId){const n=C.findSchemaById(y.schemas,l.componentId);o.value=n,r.value=[l.componentId]}e.nextTick(()=>{t.actionItem.componentId=l.componentId,t.actionItem.methodName=l.methodName,t.actionItem.type=l.type,t.actionItem.args=l.args})}function B(){if(!t.actionItem.methodName){alert("请先选择动作方法");return}p(v.value?"add":"edit",C.deepClone(e.toRaw(t.actionItem))),I()}function I(){u.value=!1,r.value=[],t.cacheData={}}function s(l){var n;t.actionItem.componentId=null,t.actionItem.type=l,o.value=null,t.actionItem.methodName=null,r.value=[],(n=i.value)!=null&&n.length&&d(i.value[0].value)}function c(l){var n;t.actionItem.args&&(t.cacheData[t.actionItem.componentId+t.actionItem.methodName]=t.actionItem.args),t.actionItem.componentId=l.id,t.actionItem.type="component",t.actionItem.methodName=null,o.value=l.componentSchema,(n=i.value)!=null&&n.length&&d(i.value[0].value)}function d(l){t.actionItem.methodName=l,t.actionItem.args=t.cacheData[t.actionItem.componentId+t.actionItem.methodName]}return V({handleOpen:k,handleOpenEdit:N}),(l,n)=>(e.openBlock(),e.createBlock(e.unref(h),{modelValue:u.value,"onUpdate:modelValue":n[4]||(n[4]=_=>u.value=_),class:"w-1200px",width:"1200px",onClose:I,onOk:B,title:"动作配置"},{default:e.withCtx(()=>{var _;return[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("div",{class:e.normalizeClass(["fun-btn",{checked:t.actionItem.type==="custom"}]),onClick:n[0]||(n[0]=g=>s("custom"))}," 自定义函数 ",2),e.createElementVNode("div",{class:e.normalizeClass(["fun-btn",{checked:t.actionItem.type==="public"}]),onClick:n[1]||(n[1]=g=>s("public"))}," 公共函数 ",2),n[5]||(n[5]=e.createTextVNode(" 组件 ")),e.createElementVNode("div",ee,[e.createVNode(e.unref($._sfc_main),{selectedKeys:r.value,"onUpdate:selectedKeys":n[2]||(n[2]=g=>r.value=g),options:e.unref(y).schemas,onNodeClick:c},null,8,["selectedKeys","options"])])]),e.createElementVNode("div",te,[n[6]||(n[6]=e.createElementVNode("div",{class:"mb-2"},"动作选择",-1)),e.createElementVNode("div",ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,g=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{checked:g.value===t.actionItem.methodName},"epic-action-item"]),onClick:de=>d(g.value),key:g.value},[e.createElementVNode("span",null,e.toDisplayString(g.label),1)],10,oe))),128)),e.withDirectives(e.createElementVNode("div",le," 当前组件暂无动作 ",512),[[e.vShow,!((_=i.value)!=null&&_.length)]])])])]),e.createElementVNode("div",ae,[t.actionItem.type==="custom"?(e.openBlock(),e.createBlock(P,{key:0})):a.value.length===0?(e.openBlock(),e.createElementBlock("div",ce," 暂无配置 ")):(e.openBlock(),e.createBlock(W,{key:2,modelValue:t.actionItem.args,"onUpdate:modelValue":n[3]||(n[3]=g=>t.actionItem.args=g),actionArgsConfigs:a.value},null,8,["modelValue","actionArgsConfigs"]))])])]}),_:1},8,["modelValue"]))}}),ie=e.defineComponent({__name:"index",props:{eventList:{type:Array,default:()=>[]},modelValue:{type:Object}},emits:["update:modelValue"],setup(E,{emit:V}){const m=x.pluginManager.getComponent("Collapse"),h=x.pluginManager.getComponent("CollapseItem"),v=e.ref(null);let y=0;const f=E,u=V,r=e.computed({get(){return f.modelValue},set(s){u("update:modelValue",s)}}),o=e.ref([]),p=e.computed(()=>f.eventList.filter(s=>s.events.length)),i=e.computed(()=>f.eventList.map(s=>s.events).flat()),a=e.ref({});i.value.forEach(s=>{a.value[s.type]=e.computed({get(){var c;return((c=r.value)==null?void 0:c[s.type])??[]},set(c){c&&c.length?r.value[s.type]=c.map(d=>e.toRaw(d)):delete r.value[s.type]}})}),e.watch(()=>p.value,s=>{s.length&&(o.value=s.filter(c=>{for(let d=0;d<c.events.length;d++){const l=c.events[d].type;if(a.value[l].length)return!0}return!1}).map(c=>c.title))},{immediate:!0});let t="";function k(s){var c;(c=v.value)==null||c.handleOpen(),t=s}function N(s,c,d){var l;(l=v.value)==null||l.handleOpenEdit(d),y=s,t=c}function B(s){a.value[t][y]=s,r.value[t]=[...a.value[t]??[]]}function I(s){if(!r.value){r.value={[t]:[...a.value[t]??[],s]};return}r.value[t]=[...a.value[t]??[],s]}return(s,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(m),{modelValue:o.value,"onUpdate:modelValue":c[1]||(c[1]=d=>o.value=d),activeKey:o.value,"onUpdate:activeKey":c[2]||(c[2]=d=>o.value=d),"expanded-names":o.value,"onUpdate:expandedNames":c[3]||(c[3]=d=>o.value=d)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,d=>(e.openBlock(),e.createBlock(e.unref(h),{key:d.title,title:d.title,header:d.title,name:d.title},{default:e.withCtx(()=>[e.createVNode(z,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=l=>r.value=l),"item-events":d.events,"all-events":i.value,events:a.value,onAdd:k,onEdit:N},null,8,["modelValue","item-events","all-events","events"])]),_:2},1032,["title","header","name"]))),128))]),_:1},8,["modelValue","activeKey","expanded-names"]),e.createVNode(se,{ref_key:"EActionModalRef",ref:v,onAdd:I,onEdit:B},null,512)],64))}});exports.default=ie;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),N=require("./vuedraggable.umd-BqhSJIAi.cjs"),i=require("./axios-CYGTE3lR.cjs"),u=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),N=require("./vuedraggable.umd-BqhSJIAi.cjs"),i=require("./axios-CYGTE3lR.cjs"),u=require("./index-R7VF52gK.cjs"),x=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),w={class:"epic-component-view flex flex-col"},E={class:"epic-search-box px-10px py-6px"},B={class:"flex flex-1 overflow-auto"},M={class:"epic-tabs-box"},j=["title","onClick"],q={class:"h-full flex-1 overflow-auto py-2 box-border"},I=["onClick"],L={class:"epic-componet-label flex-1 w-0 truncate"},P={class:"text-center pt-42px text-gray-400"},T=e.defineComponent({__name:"index",setup($){const k=i.pluginManager.getComponent("input"),d=e.inject("pageSchema"),p=e.inject("designer"),y=e.inject("revoke"),C=e.inject("designerProps"),m=i.pluginManager.getComponentSchemaGroups(),a=e.ref(""),g={title:"全部",list:[]},c=e.ref(g),S=e.computed(()=>[g,...m.value]),s=e.computed(()=>{let o=c.value.list;if(c.value.title==="全部"){const n=m.value.map(t=>t.list);o=[].concat(...n)}return o.filter(n=>{var t;return((t=n.label)==null?void 0:t.includes(a.value))&&(!C.value.formMode||n.type!=="form")})});function V(o){c.value=o}function b(o){var v,f,_;const n=u.findSchemaInfoById(d.schemas,((v=p.state.checkedNode)==null?void 0:v.id)??"root");if(!n)return!1;let{list:t,schema:l,index:r}=n;l.children&&!((_=(f=i.pluginManager.getComponentConfingByType(l.type))==null?void 0:f.editConstraints)!=null&&_.childImmovable)&&(t=l.children,r=l.children.length-1);const h=u.generateNewSchema(o);t.splice(r+1,0,h),p.setCheckedNode(h),y.push(d.schemas,"插入组件")}return(o,n)=>(e.openBlock(),e.createElementBlock("div",w,[e.createElementVNode("div",E,[e.createVNode(e.unref(k),{placeholder:"搜索组件",modelValue:a.value,"onUpdate:modelValue":n[0]||(n[0]=t=>a.value=t),clearable:"",allowClear:"",value:a.value,"onUpdate:value":n[1]||(n[1]=t=>a.value=t)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(x._sfc_main),{class:"text-$epic-text-helper",name:"icon--epic--search-rounded"})]),_:1},8,["modelValue","value"])]),e.createElementVNode("div",B,[e.createElementVNode("div",M,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(S.value,(t,l)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["epic-tab cursor-pointer truncate",{checked:c.value.title===t.title}]),key:l,title:t.title,onClick:r=>V(t)},e.toDisplayString(t.title),11,j))),128))]),e.createElementVNode("div",q,[e.createVNode(e.unref(N.draggable),e.mergeProps({modelValue:s.value,"onUpdate:modelValue":n[2]||(n[2]=t=>s.value=t)},{group:{name:"edit-draggable",pull:"clone",put:!1},sort:!1,animation:180,ghostClass:"moving"},{clone:e.unref(u.generateNewSchema),"item-key":"id",class:"grid grid-cols-[auto_auto] px-10px gap-2"}),{item:e.withCtx(({element:t})=>[e.createElementVNode("div",{class:"epic-componet-item flex items-center truncate",onClick:l=>b(t)},[e.createVNode(e.unref(x._sfc_main),{name:e.unref(i.pluginManager).getComponentConfingByType(t.type).icon??""},null,8,["name"]),e.createElementVNode("div",L,e.toDisplayString(t.label),1)],8,I)]),_:1},16,["modelValue","clone"]),e.withDirectives(e.createElementVNode("div",P,"没有查询到的组件",512),[[e.vShow,!s.value.length]])])])]))}});exports.default=T;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as g, ref as p, onMounted as h, watch as v, nextTick as V, openBlock as _, createElementBlock as T } from "vue";
|
|
2
2
|
import * as a from "monaco-editor";
|
|
3
|
-
import { p as b } from "./index-
|
|
3
|
+
import { p as b } from "./index-8jV4lvPb.js";
|
|
4
4
|
import { _ as y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
5
5
|
const x = /* @__PURE__ */ g({
|
|
6
6
|
__name: "index",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as X, inject as L, ref as C, computed as U, watch as G, openBlock as M, createElementBlock as W, Fragment as q, withDirectives as ue, createElementVNode as w, normalizeClass as ee, toDisplayString as be, unref as f, createVNode as z, createCommentVNode as le, vShow as de, createBlock as te, mergeProps as Se, withCtx as oe, useAttrs as we, provide as Ce, onUnmounted as ke, resolveComponent as Ne, createSlots as $e, renderList as ve, shallowRef as Re, watchEffect as Te, nextTick as pe, normalizeStyle as se, renderSlot as Be, onMounted as Oe } from "vue";
|
|
2
2
|
import { p as J } from "./axios-ITY6Uw7A.js";
|
|
3
|
-
import { u as fe, a as Me, f as me, g as Le, b as ae, _ as De, d as ce, c as He, e as Ve, h as We, i as ze, w as Ae, j as Ee } from "./index-
|
|
3
|
+
import { u as fe, a as Me, f as me, g as Le, b as ae, _ as De, d as ce, c as He, e as Ve, h as We, i as ze, w as Ae, j as Ee } from "./index-8jV4lvPb.js";
|
|
4
4
|
import { _ as ie } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
5
|
import { d as Ie } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
6
6
|
const Pe = { class: "epic-widget-action-item whitespace-nowrap" }, je = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as D, inject as i, ref as S, computed as b, openBlock as m, createElementBlock as h, createElementVNode as n, createVNode as r, unref as a, withCtx as w, Fragment as E, renderList as M, normalizeClass as j, toDisplayString as V, mergeProps as z, withDirectives as A, vShow as F } from "vue";
|
|
2
2
|
import { d as G } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
3
3
|
import { p as d } from "./axios-ITY6Uw7A.js";
|
|
4
|
-
import { g as B, f as q } from "./index-
|
|
4
|
+
import { g as B, f as q } from "./index-8jV4lvPb.js";
|
|
5
5
|
import { _ as I } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
6
6
|
const H = { class: "epic-component-view flex flex-col" }, J = { class: "epic-search-box px-10px py-6px" }, K = { class: "flex flex-1 overflow-auto" }, O = { class: "epic-tabs-box" }, Q = ["title", "onClick"], R = { class: "h-full flex-1 overflow-auto py-2 box-border" }, W = ["onClick"], X = { class: "epic-componet-label flex-1 w-0 truncate" }, Y = { class: "text-center pt-42px text-gray-400" }, ae = /* @__PURE__ */ D({
|
|
7
7
|
__name: "index",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineComponent as B, computed as P, inject as O, openBlock as r, createElementBlock as u, Fragment as c, renderList as k, createElementVNode as d, toDisplayString as U, createVNode as g, unref as y, createCommentVNode as $, ref as C, watchEffect as T, createBlock as I, withCtx as M, createTextVNode as N } from "vue";
|
|
2
2
|
import { p as R } from "./axios-ITY6Uw7A.js";
|
|
3
|
-
import { _ as j, n as F, m as q } from "./index-
|
|
3
|
+
import { _ as j, n as F, m as q } from "./index-8jV4lvPb.js";
|
|
4
4
|
import { _ as A } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
5
|
const D = [
|
|
6
6
|
{ label: "string", value: "string" },
|