epic-designer-gold 0.0.22 → 0.0.24

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.
Files changed (47) hide show
  1. package/dist/{attributeView-B8JS7SiW.cjs → attributeView-BSDAcGr-.cjs} +1 -1
  2. package/dist/{attributeView-oIH3-2FN.js → attributeView-Bz43SH5k.js} +8 -8
  3. package/dist/index-79-_PiUp.js +213 -0
  4. package/dist/index-B5dOTX9c.cjs +1 -0
  5. package/dist/{index-nhr7ps1e.js → index-BA8b7URG.js} +1 -1
  6. package/dist/index-BXjAqIhc.js +665 -0
  7. package/dist/{index-Bwmb5sha.cjs → index-BlhSSPRn.cjs} +1 -1
  8. package/dist/{index-rby8nugJ.cjs → index-BqRnThy4.cjs} +1 -1
  9. package/dist/{index-CrGWYheb.js → index-BqVHIRpW.js} +1 -1
  10. package/dist/{index-C5XNe5wE.js → index-BqkkpMMv.js} +1 -1
  11. package/dist/index-C5buJETv.js +4 -0
  12. package/dist/index-C_98Qusp.cjs +10 -0
  13. package/dist/index-Cc2pSWZA.cjs +1 -0
  14. package/dist/{index-Bts_xVeS.cjs → index-Cjz6Uuh1.cjs} +1 -1
  15. package/dist/{index-DiMAGPRY.js → index-D2XUpDv0.js} +1 -1
  16. package/dist/index-D4aHRq8_.cjs +1 -0
  17. package/dist/{index-CwXlSYIH.cjs → index-D8TH-5-y.cjs} +1 -1
  18. package/dist/index-DFc_FT_D.js +675 -0
  19. package/dist/{index-DitKpeDV.cjs → index-Dd63RYpy.cjs} +1 -1
  20. package/dist/{index-C5yhSYKA.js → index-Df-u4kqP.js} +235 -248
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{styleView-BDUqyY8T.cjs → styleView-7qHQlM8R.cjs} +1 -1
  25. package/dist/{styleView-CtfATcTc.js → styleView-Dqnk80Tm.js} +1 -1
  26. package/dist/ui/elementPlus/index.cjs +1 -1
  27. package/dist/ui/elementPlus/index.js +12 -0
  28. package/package.json +1 -1
  29. package/dist/core/components/designer/src/modules/attributeView/eventView.vue.d.ts +0 -2
  30. package/dist/core/components/designer/src/modules/outline/outline.vue.d.ts +0 -2
  31. package/dist/core/components/designer/src/modules/sourceCode/index.vue.d.ts +0 -2
  32. package/dist/eventView-BL4A2PVd.cjs +0 -1
  33. package/dist/eventView-Ed_9JLnx.js +0 -64
  34. package/dist/index-05ByfwQb.js +0 -432
  35. package/dist/index-BUkdmwKe.cjs +0 -10
  36. package/dist/index-Bt6BXCcr.cjs +0 -1
  37. package/dist/index-CjrdkSiN.js +0 -682
  38. package/dist/index-CqdmlJ1d.cjs +0 -1
  39. package/dist/index-DWW8LGvj.js +0 -41
  40. package/dist/index-DZIjd60A.js +0 -4
  41. package/dist/index-D_CH15dJ.cjs +0 -1
  42. package/dist/index-DskzasEn.js +0 -216
  43. package/dist/index-GJSr_nl7.cjs +0 -1
  44. package/dist/outline-CJSEUbgc.cjs +0 -1
  45. package/dist/outline-yy4pIEi3.js +0 -54
  46. package/dist/tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs +0 -1
  47. package/dist/tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js +0 -242
@@ -0,0 +1,665 @@
1
+ import { defineComponent as O, inject as S, openBlock as v, createElementBlock as b, Fragment as B, renderList as R, createElementVNode as u, toDisplayString as j, createVNode as V, unref as g, withCtx as L, createCommentVNode as z, createTextVNode as G, computed as K, h as J, normalizeClass as T, createBlock as M, mergeProps as Z, useSlots as ee, provide as P, ref as U, withDirectives as F, vShow as H, reactive as te, nextTick as ne, toRaw as Q, watch as ae } from "vue";
2
+ import { l as W, _ as le, k as oe, m as se } from "./index-Df-u4kqP.js";
3
+ import { p as A } from "./axios-ITY6Uw7A.js";
4
+ import { _ as D } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
5
+ import { d as X } from "./vuedraggable.umd-D2S7Eo7p.js";
6
+ const ce = { class: "epic-event-info" }, ie = ["title"], de = { class: "epic-event-btn text-lg flex items-center text-$epic-text-secondary" }, ue = { class: "epic-action-editor-main" }, re = { class: "epic-editor-item rounded" }, pe = { class: "w-36px flex items-center text-lg" }, me = { class: "flex-1" }, ve = { key: 0 }, fe = { key: 1 }, he = { key: 2 }, ge = { class: "epic-action-box text-lg text-$epic-text-medium" }, ye = ["onClick"], _e = ["onClick"], xe = /* @__PURE__ */ O({
7
+ __name: "EActionEditorItem",
8
+ props: {
9
+ itemEvents: {
10
+ type: Array,
11
+ default: () => []
12
+ },
13
+ allEvents: {
14
+ type: Array,
15
+ default: () => []
16
+ },
17
+ modelValue: {
18
+ type: Object,
19
+ default: () => []
20
+ },
21
+ events: {
22
+ type: Object,
23
+ default: () => ({})
24
+ }
25
+ },
26
+ emits: ["add", "edit", "update:modelValue"],
27
+ setup(E, { emit: o }) {
28
+ const f = E, C = o, r = S("pageSchema");
29
+ function k(p) {
30
+ C("add", p);
31
+ }
32
+ function _(p) {
33
+ return W(r.schemas, p).label;
34
+ }
35
+ function c(p, l) {
36
+ var e;
37
+ const t = n(l);
38
+ t[l] = f.events[l].filter((y, I) => p !== I), (e = t[l]) != null && e.length || delete t[l], C("update:modelValue", t);
39
+ }
40
+ function d(p, l, t) {
41
+ C("edit", p, l, t);
42
+ }
43
+ function n(p) {
44
+ const l = {};
45
+ return f.allEvents.forEach((t) => {
46
+ if (!f.events[t.type].length || t.type === p)
47
+ return !1;
48
+ l[t.type] = f.events[t.type];
49
+ }), l;
50
+ }
51
+ return (p, l) => (v(!0), b(B, null, R(E.itemEvents, (t) => (v(), b("div", {
52
+ key: t.type,
53
+ class: "epic-event-item"
54
+ }, [
55
+ u("div", ce, [
56
+ u("div", {
57
+ class: "epic-event-label",
58
+ title: t.describe
59
+ }, j(t.describe), 9, ie),
60
+ u("div", de, [
61
+ V(g(D), {
62
+ name: "icon--epic--add-rounded",
63
+ onClick: (e) => k(t.type)
64
+ }, null, 8, ["onClick"])
65
+ ])
66
+ ]),
67
+ u("div", ue, [
68
+ V(g(X), {
69
+ modelValue: f.events[t.type],
70
+ "onUpdate:modelValue": (e) => f.events[t.type] = e,
71
+ "item-key": "id",
72
+ "component-data": {
73
+ type: "transition-group"
74
+ },
75
+ group: "option-list",
76
+ handle: ".handle",
77
+ animation: 200
78
+ }, {
79
+ item: L(({ element: e, index: y }) => [
80
+ u("div", re, [
81
+ u("div", pe, [
82
+ V(g(D), {
83
+ class: "mr-2 text-lg cursor-move handle text-$epic-text-medium",
84
+ name: "icon--epic--drag"
85
+ })
86
+ ]),
87
+ u("div", me, [
88
+ e.type === "component" ? (v(), b("div", ve, j(_(e.componentId)), 1)) : e.type === "custom" ? (v(), b("div", fe, " 自定义函数 ")) : e.type === "public" ? (v(), b("div", he, " 公共函数 ")) : z("", !0),
89
+ G(" " + j(e.methodName), 1)
90
+ ]),
91
+ u("div", ge, [
92
+ u("div", {
93
+ class: "epic-edit-btn",
94
+ onClick: (I) => d(y, t.type, e)
95
+ }, [
96
+ V(g(D), { name: "icon--epic--page-info-outline-rounded" })
97
+ ], 8, ye),
98
+ u("div", {
99
+ class: "epic-del-btn",
100
+ onClick: (I) => c(y, t.type)
101
+ }, [
102
+ V(g(D), { name: "icon--epic--delete-outline-rounded" })
103
+ ], 8, _e)
104
+ ])
105
+ ])
106
+ ]),
107
+ _: 2
108
+ }, 1032, ["modelValue", "onUpdate:modelValue"])
109
+ ])
110
+ ]))), 128));
111
+ }
112
+ }), q = /* @__PURE__ */ O({
113
+ name: "ETreeNodeItem",
114
+ __name: "treeNodeItem",
115
+ props: {
116
+ schema: {}
117
+ },
118
+ setup(E) {
119
+ const o = E, f = S("slots", {}), C = S("pageSchema", {}), r = S("expandedKeys"), k = S("treeProps"), _ = S("selectedKeys"), c = S("handleSelect"), d = K(() => r.value.includes(o.schema.id ?? "")), n = O({
120
+ setup() {
121
+ return () => {
122
+ var t;
123
+ return J(
124
+ "span",
125
+ {
126
+ class: {
127
+ text: !0,
128
+ hover: k.hoverKey === o.schema.id,
129
+ checked: _.value.includes(o.schema.id)
130
+ },
131
+ onClick: () => c(o.schema.id, o.schema)
132
+ },
133
+ ((t = f["tree-node"]) == null ? void 0 : t.call(f, o)) ?? J(
134
+ "span",
135
+ { class: "epic-text-padding flex" },
136
+ {
137
+ default: () => {
138
+ var e;
139
+ return [
140
+ J(
141
+ "span",
142
+ { class: "max-w-full truncate" },
143
+ o.schema.label ?? ((e = A.getComponentConfingByType(o.schema.type)) == null ? void 0 : e.defaultSchema.label)
144
+ ),
145
+ J(
146
+ "span",
147
+ { class: "epic-node-type-text flex-1 w-0 truncate" },
148
+ o.schema.id
149
+ )
150
+ ];
151
+ }
152
+ }
153
+ )
154
+ );
155
+ };
156
+ }
157
+ });
158
+ function p() {
159
+ const t = o.schema.id;
160
+ if (!t)
161
+ return !1;
162
+ r.value.includes(t) ? r.value = r.value.filter((e) => e !== t) : r.value.push(t);
163
+ }
164
+ function l() {
165
+ var e;
166
+ const t = o.schema.id;
167
+ if (!t || !((e = o.schema.children) != null && e.length))
168
+ return !1;
169
+ r.value.push(t);
170
+ }
171
+ return l(), (t, e) => {
172
+ var y, I, $, x, s;
173
+ return v(), b("li", {
174
+ class: T(["epic-tree-node", {
175
+ expanded: (y = o.schema.children) == null ? void 0 : y.length,
176
+ "level-1": o.schema.id === ((I = g(C).schemas[0]) == null ? void 0 : I.id)
177
+ }])
178
+ }, [
179
+ u("a", null, [
180
+ ($ = o.schema.children) != null && $.length && o.schema.id !== ((x = g(C).schemas[0]) == null ? void 0 : x.id) ? (v(), b("span", {
181
+ key: 0,
182
+ class: T(["icon-expanded", { expanded: d.value }]),
183
+ onClick: p
184
+ }, [
185
+ V(g(D), { name: "icon--epic--caret-right-outlined" })
186
+ ], 2)) : z("", !0),
187
+ V(g(n))
188
+ ]),
189
+ (s = o.schema.children) != null && s.length ? (v(), M(Y, {
190
+ key: 0,
191
+ class: T(["epic-tree-sublist", { expanded: d.value }]),
192
+ schemas: o.schema.children,
193
+ "onUpdate:schemas": e[0] || (e[0] = (m) => o.schema.children = m),
194
+ parentSchema: o.schema
195
+ }, null, 8, ["class", "schemas", "parentSchema"])) : z("", !0)
196
+ ], 2);
197
+ };
198
+ }
199
+ }), Ce = { key: 1 }, Y = /* @__PURE__ */ O({
200
+ name: "ETreeNodes",
201
+ __name: "treeNodes",
202
+ props: {
203
+ schemas: {},
204
+ parentSchema: {}
205
+ },
206
+ emits: ["update:schemas"],
207
+ setup(E, { emit: o }) {
208
+ const f = S("designer"), C = S("pageSchema"), r = S("treeProps"), k = E, _ = o, c = K({
209
+ get() {
210
+ return k.schemas;
211
+ },
212
+ set(p) {
213
+ _("update:schemas", p);
214
+ }
215
+ });
216
+ function d(p) {
217
+ f.setDisableHover(!0), f.setCheckedNode(c.value[p]);
218
+ }
219
+ function n(p) {
220
+ var l, t, e;
221
+ return p.id === ((l = C.schemas[0]) == null ? void 0 : l.id) || (e = (t = A.getComponentConfingByType(p.type)) == null ? void 0 : t.editConstraints) != null && e.immovable ? "unmover-item" : "draggable-item";
222
+ }
223
+ return (p, l) => {
224
+ var t, e, y, I, $;
225
+ return (y = (e = g(A).getComponentConfingByType(((t = k.parentSchema) == null ? void 0 : t.type) || "")) == null ? void 0 : e.editConstraints) != null && y.childImmovable ? (v(), b("ul", Ce, [
226
+ (v(!0), b(B, null, R(c.value, (x) => (v(), M(q, {
227
+ key: x.id,
228
+ schema: x
229
+ }, null, 8, ["schema"]))), 128))
230
+ ])) : (v(), M(g(X), Z({
231
+ key: 0,
232
+ modelValue: c.value,
233
+ "onUpdate:modelValue": l[0] || (l[0] = (x) => c.value = x),
234
+ "item-key": "id",
235
+ "component-data": {},
236
+ class: "epic-draggable-range"
237
+ }, {
238
+ animation: 200,
239
+ tag: "ul",
240
+ group: "tree-draggable",
241
+ ghostClass: "moveing",
242
+ draggable: ".draggable-item",
243
+ disabled: !g(r).draggable || ((I = c.value[0]) == null ? void 0 : I.id) === (($ = g(C).schemas[0]) == null ? void 0 : $.id)
244
+ }, {
245
+ onStart: l[1] || (l[1] = (x) => d(x.oldIndex))
246
+ }), {
247
+ item: L(({ element: x, index: s }) => [
248
+ (v(), M(q, {
249
+ class: T(n(x)),
250
+ key: x.id,
251
+ schema: x
252
+ }, null, 8, ["class", "schema"]))
253
+ ]),
254
+ _: 1
255
+ }, 16, ["modelValue"]));
256
+ };
257
+ }
258
+ }), Ie = { class: "epic-tree h-full flex flex-col" }, be = { class: "epic-search-box px-10px py-6px" }, ke = { class: "epic-tree-main flex-1 overflow-auto h-0" }, Ve = { class: "text-center pt-42px text-gray-400" }, Ee = /* @__PURE__ */ O({
259
+ name: "ETree",
260
+ __name: "tree",
261
+ props: {
262
+ options: {
263
+ type: Array,
264
+ default: () => []
265
+ },
266
+ hoverKey: {
267
+ type: String,
268
+ default: ""
269
+ },
270
+ selectedKeys: {
271
+ type: Array,
272
+ default: () => []
273
+ },
274
+ draggable: {
275
+ type: Boolean,
276
+ default: !1
277
+ }
278
+ },
279
+ emits: ["update:selectedKeys", "nodeClick"],
280
+ setup(E, { emit: o }) {
281
+ const f = ee();
282
+ P("slots", f);
283
+ const C = A.getComponent("input"), r = U(""), k = U([]), _ = E, c = o, d = K({
284
+ get() {
285
+ return _.selectedKeys;
286
+ },
287
+ set(t) {
288
+ c("update:selectedKeys", t);
289
+ }
290
+ }), n = K({
291
+ get() {
292
+ return p(_.options, r.value);
293
+ },
294
+ set(t) {
295
+ console.log(t);
296
+ }
297
+ });
298
+ function p(t, e) {
299
+ const y = [];
300
+ return t.forEach((I) => {
301
+ var $;
302
+ if (($ = I.label) != null && $.includes(e))
303
+ y.push(I);
304
+ else if (I.children) {
305
+ const x = p(I.children, e);
306
+ if (x.length > 0) {
307
+ const s = { ...I };
308
+ s.children = x, y.push(s);
309
+ }
310
+ }
311
+ }), y;
312
+ }
313
+ function l(t, e) {
314
+ d.value = [t], c("nodeClick", { id: t, componentSchema: e });
315
+ }
316
+ return P("expandedKeys", k), P("selectedKeys", d), P("treeProps", _), P("handleSelect", l), (t, e) => (v(), b("div", Ie, [
317
+ u("div", be, [
318
+ V(g(C), {
319
+ placeholder: "搜索节点",
320
+ clearable: "",
321
+ allowClear: "",
322
+ modelValue: r.value,
323
+ "onUpdate:modelValue": e[0] || (e[0] = (y) => r.value = y),
324
+ value: r.value,
325
+ "onUpdate:value": e[1] || (e[1] = (y) => r.value = y)
326
+ }, {
327
+ prefix: L(() => [
328
+ V(g(D), { name: "icon--epic--search-rounded" })
329
+ ]),
330
+ _: 1
331
+ }, 8, ["modelValue", "value"])
332
+ ]),
333
+ u("div", ke, [
334
+ u("ul", null, [
335
+ V(Y, {
336
+ schemas: n.value,
337
+ "onUpdate:schemas": e[2] || (e[2] = (y) => n.value = y)
338
+ }, null, 8, ["schemas"])
339
+ ]),
340
+ F(u("div", Ve, "没有查询到的数据", 512), [
341
+ [H, !n.value.length]
342
+ ])
343
+ ])
344
+ ]));
345
+ }
346
+ }), Se = { class: "h-full flex flex-col" }, $e = /* @__PURE__ */ O({
347
+ __name: "EScriptEdit",
348
+ setup(E) {
349
+ const o = A.getComponent("monacoEditor"), f = {
350
+ theme: "vs-light",
351
+ selectOnLineNumbers: !0,
352
+ minimap: {
353
+ enabled: !1
354
+ }
355
+ }, C = U(null), r = S("pageSchema");
356
+ return (k, _) => (v(), b("div", Se, [
357
+ _[1] || (_[1] = u("div", { class: "pb-2" }, " 自定义函数编辑 ", -1)),
358
+ V(g(o), {
359
+ ref_key: "monacoEditorRef",
360
+ ref: C,
361
+ autoToggleTheme: "",
362
+ modelValue: g(r).script,
363
+ "onUpdate:modelValue": _[0] || (_[0] = (c) => g(r).script = c),
364
+ class: "epic-editor flex-1",
365
+ config: f,
366
+ language: "javascript"
367
+ }, null, 8, ["modelValue"])
368
+ ]));
369
+ }
370
+ }), Ne = { class: "epic-attribute-view" }, we = ["title"], Ke = { class: "epic-attr-input" }, Ae = /* @__PURE__ */ O({
371
+ __name: "EArgsEditor",
372
+ props: {
373
+ modelValue: {},
374
+ actionArgsConfigs: {}
375
+ },
376
+ emits: ["update:modelValue"],
377
+ setup(E, { emit: o }) {
378
+ const f = E, C = o, r = K(() => f.modelValue ? JSON.parse(f.modelValue) : []);
379
+ function k(c) {
380
+ var d;
381
+ return typeof c.show == "boolean" ? c.show : typeof c.show == "function" ? (d = c.show) == null ? void 0 : d.call(c, { values: r.value }) : !0;
382
+ }
383
+ function _(c, d) {
384
+ const n = [
385
+ ...JSON.parse(f.modelValue ?? "[]")
386
+ ];
387
+ n[d] = c, C("update:modelValue", JSON.stringify(n));
388
+ }
389
+ return (c, d) => (v(), b("div", Ne, [
390
+ (v(!0), b(B, null, R(f.actionArgsConfigs, (n) => (v(), b("div", {
391
+ key: n.field + n.type
392
+ }, [
393
+ F(u("div", {
394
+ class: T(["epic-attr-item", n.layout])
395
+ }, [
396
+ u("div", {
397
+ class: "epic-attr-label",
398
+ title: n.label
399
+ }, j(n.label), 9, we),
400
+ u("div", Ke, [
401
+ V(g(le), {
402
+ componentSchema: { ...n, componentProps: { ...n.componentProps, input: !1, field: void 0, hidden: !1 }, show: !0, noFormItem: !0 },
403
+ "model-value": r.value[n.field],
404
+ "onUpdate:modelValue": (p) => _(p, n.field)
405
+ }, null, 8, ["componentSchema", "model-value", "onUpdate:modelValue"])
406
+ ])
407
+ ], 2), [
408
+ [H, k(n)]
409
+ ])
410
+ ]))), 128))
411
+ ]));
412
+ }
413
+ }), Ue = { class: "rounded epic-modal-action-main" }, Oe = { class: "epic-modal-left-panel h-full flex flex-col" }, Te = { class: "flex flex-1 h-0 flex-col" }, Me = { class: "flex-1 h-0" }, De = { class: "epic-action-select h-30/100 flex flex-col" }, Be = { class: "flex-1 overflow-auto pr-8px" }, Le = ["onClick"], Pe = { class: "text-center pt-42px text-gray-400" }, je = { class: "epic-modal-right-panel" }, Re = {
414
+ key: 1,
415
+ class: "text-center pt-42px text-gray-400"
416
+ }, Je = /* @__PURE__ */ O({
417
+ __name: "EActionModal",
418
+ emits: ["add", "edit"],
419
+ setup(E, { expose: o, emit: f }) {
420
+ const C = A.getComponent("modal"), r = U(!0), k = S("pageSchema"), _ = S("pageManager", {}), c = U(!1), d = U([]), n = U(null), p = f, l = K(() => {
421
+ var i;
422
+ return e.actionItem.type === "component" ? n.value ? (i = A.getComponentConfings()[n.value.type].config.action) == null ? void 0 : i.map((a) => ({
423
+ label: a.describe,
424
+ value: a.type
425
+ })) : [] : e.actionItem.type === "custom" ? Object.entries(_.funcs.value).filter(([a, w]) => typeof w == "function").map(([a]) => ({ label: a, value: a })) : e.actionItem.type === "public" ? Object.entries(A.publicMethods).map(([a]) => ({
426
+ label: a,
427
+ value: a
428
+ })) : [];
429
+ }), t = K(() => {
430
+ if (e.actionItem.type === "component" && n.value) {
431
+ const i = A.getComponentConfings()[n.value.type].config.action, a = i == null ? void 0 : i.find(
432
+ (w) => w.type === e.actionItem.methodName
433
+ );
434
+ if (a != null && a.argsConfigs) {
435
+ const w = a.argsConfigs.findIndex(
436
+ (N) => N.label === "设置数据"
437
+ );
438
+ w !== -1 && (a.argsConfigs[w] = {
439
+ ...n.value,
440
+ label: "设置数据",
441
+ field: "0",
442
+ id: oe()
443
+ });
444
+ }
445
+ return (a == null ? void 0 : a.argsConfigs) ?? [];
446
+ }
447
+ return [];
448
+ }), e = te({
449
+ actionItem: {
450
+ type: "custom",
451
+ methodName: "test",
452
+ componentId: null
453
+ },
454
+ cacheData: {}
455
+ });
456
+ function y() {
457
+ var i;
458
+ c.value = !0, r.value = !0, e.actionItem.type = "custom", e.actionItem.componentId = null, (i = l.value) != null && i.length && h(l.value[0].value);
459
+ }
460
+ function I(i) {
461
+ if (c.value = !0, r.value = !1, n.value = null, i.componentId) {
462
+ const a = W(k.schemas, i.componentId);
463
+ n.value = a, d.value = [i.componentId];
464
+ }
465
+ ne(() => {
466
+ e.actionItem.componentId = i.componentId, e.actionItem.methodName = i.methodName, e.actionItem.type = i.type, e.actionItem.args = i.args;
467
+ });
468
+ }
469
+ function $() {
470
+ if (!e.actionItem.methodName) {
471
+ alert("请先选择动作方法");
472
+ return;
473
+ }
474
+ p(r.value ? "add" : "edit", se(Q(e.actionItem))), x();
475
+ }
476
+ function x() {
477
+ c.value = !1, d.value = [], e.cacheData = {};
478
+ }
479
+ function s(i) {
480
+ var a;
481
+ e.actionItem.componentId = null, e.actionItem.type = i, n.value = null, e.actionItem.methodName = null, d.value = [], (a = l.value) != null && a.length && h(l.value[0].value);
482
+ }
483
+ function m(i) {
484
+ var a;
485
+ e.actionItem.args && (e.cacheData[e.actionItem.componentId + e.actionItem.methodName] = e.actionItem.args), e.actionItem.componentId = i.id, e.actionItem.type = "component", e.actionItem.methodName = null, n.value = i.componentSchema, (a = l.value) != null && a.length && h(l.value[0].value);
486
+ }
487
+ function h(i) {
488
+ e.actionItem.methodName = i, e.actionItem.args = e.cacheData[e.actionItem.componentId + e.actionItem.methodName];
489
+ }
490
+ return o({
491
+ handleOpen: y,
492
+ handleOpenEdit: I
493
+ }), (i, a) => (v(), M(g(C), {
494
+ modelValue: c.value,
495
+ "onUpdate:modelValue": a[4] || (a[4] = (w) => c.value = w),
496
+ class: "w-1200px",
497
+ width: "1200px",
498
+ onClose: x,
499
+ onOk: $,
500
+ title: "动作配置"
501
+ }, {
502
+ default: L(() => {
503
+ var w;
504
+ return [
505
+ u("div", Ue, [
506
+ u("div", Oe, [
507
+ u("div", Te, [
508
+ u("div", {
509
+ class: T(["fun-btn", { checked: e.actionItem.type === "custom" }]),
510
+ onClick: a[0] || (a[0] = (N) => s("custom"))
511
+ }, " 自定义函数 ", 2),
512
+ u("div", {
513
+ class: T(["fun-btn", { checked: e.actionItem.type === "public" }]),
514
+ onClick: a[1] || (a[1] = (N) => s("public"))
515
+ }, " 公共函数 ", 2),
516
+ a[5] || (a[5] = G(" 组件 ")),
517
+ u("div", Me, [
518
+ V(g(Ee), {
519
+ selectedKeys: d.value,
520
+ "onUpdate:selectedKeys": a[2] || (a[2] = (N) => d.value = N),
521
+ options: g(k).schemas,
522
+ onNodeClick: m
523
+ }, null, 8, ["selectedKeys", "options"])
524
+ ])
525
+ ]),
526
+ u("div", De, [
527
+ a[6] || (a[6] = u("div", { class: "mb-2" }, "动作选择", -1)),
528
+ u("div", Be, [
529
+ (v(!0), b(B, null, R(l.value, (N) => (v(), b("div", {
530
+ class: T([{ checked: N.value === e.actionItem.methodName }, "epic-action-item"]),
531
+ onClick: (ze) => h(N.value),
532
+ key: N.value
533
+ }, [
534
+ u("span", null, j(N.label), 1)
535
+ ], 10, Le))), 128)),
536
+ F(u("div", Pe, " 当前组件暂无动作 ", 512), [
537
+ [H, !((w = l.value) != null && w.length)]
538
+ ])
539
+ ])
540
+ ])
541
+ ]),
542
+ u("div", je, [
543
+ e.actionItem.type === "custom" ? (v(), M($e, { key: 0 })) : t.value.length === 0 ? (v(), b("div", Re, " 暂无配置 ")) : (v(), M(Ae, {
544
+ key: 2,
545
+ modelValue: e.actionItem.args,
546
+ "onUpdate:modelValue": a[3] || (a[3] = (N) => e.actionItem.args = N),
547
+ actionArgsConfigs: t.value
548
+ }, null, 8, ["modelValue", "actionArgsConfigs"]))
549
+ ])
550
+ ])
551
+ ];
552
+ }),
553
+ _: 1
554
+ }, 8, ["modelValue"]));
555
+ }
556
+ }), We = /* @__PURE__ */ O({
557
+ __name: "index",
558
+ props: {
559
+ eventList: {
560
+ type: Array,
561
+ default: () => []
562
+ },
563
+ modelValue: {
564
+ type: Object
565
+ }
566
+ },
567
+ emits: ["update:modelValue"],
568
+ setup(E, { emit: o }) {
569
+ const f = A.getComponent("Collapse"), C = A.getComponent("CollapseItem"), r = U(null);
570
+ let k = 0;
571
+ const _ = E, c = o, d = K({
572
+ get() {
573
+ return _.modelValue;
574
+ },
575
+ set(s) {
576
+ c("update:modelValue", s);
577
+ }
578
+ }), n = U([]), p = K(() => _.eventList.filter((s) => s.events.length)), l = K(() => _.eventList.map((s) => s.events).flat()), t = U({});
579
+ l.value.forEach((s) => {
580
+ t.value[s.type] = K({
581
+ get() {
582
+ var m;
583
+ return ((m = d.value) == null ? void 0 : m[s.type]) ?? [];
584
+ },
585
+ set(m) {
586
+ m && m.length ? d.value[s.type] = m.map((h) => Q(h)) : delete d.value[s.type];
587
+ }
588
+ });
589
+ }), ae(() => p.value, (s) => {
590
+ s.length && (n.value = s.filter((m) => {
591
+ for (let h = 0; h < m.events.length; h++) {
592
+ const i = m.events[h].type;
593
+ if (t.value[i].length)
594
+ return !0;
595
+ }
596
+ return !1;
597
+ }).map((m) => m.title));
598
+ }, {
599
+ // 配置选项
600
+ immediate: !0
601
+ // 立即执行一次回调函数
602
+ });
603
+ let e = "";
604
+ function y(s) {
605
+ var m;
606
+ (m = r.value) == null || m.handleOpen(), e = s;
607
+ }
608
+ function I(s, m, h) {
609
+ var i;
610
+ (i = r.value) == null || i.handleOpenEdit(h), k = s, e = m;
611
+ }
612
+ function $(s) {
613
+ t.value[e][k] = s, d.value[e] = [...t.value[e] ?? []];
614
+ }
615
+ function x(s) {
616
+ if (!d.value) {
617
+ d.value = { [e]: [...t.value[e] ?? [], s] };
618
+ return;
619
+ }
620
+ d.value[e] = [...t.value[e] ?? [], s];
621
+ }
622
+ return (s, m) => (v(), b(B, null, [
623
+ V(g(f), {
624
+ modelValue: n.value,
625
+ "onUpdate:modelValue": m[1] || (m[1] = (h) => n.value = h),
626
+ activeKey: n.value,
627
+ "onUpdate:activeKey": m[2] || (m[2] = (h) => n.value = h),
628
+ "expanded-names": n.value,
629
+ "onUpdate:expandedNames": m[3] || (m[3] = (h) => n.value = h)
630
+ }, {
631
+ default: L(() => [
632
+ (v(!0), b(B, null, R(p.value, (h) => (v(), M(g(C), {
633
+ key: h.title,
634
+ title: h.title,
635
+ header: h.title,
636
+ name: h.title
637
+ }, {
638
+ default: L(() => [
639
+ V(xe, {
640
+ modelValue: d.value,
641
+ "onUpdate:modelValue": m[0] || (m[0] = (i) => d.value = i),
642
+ "item-events": h.events,
643
+ "all-events": l.value,
644
+ events: t.value,
645
+ onAdd: y,
646
+ onEdit: I
647
+ }, null, 8, ["modelValue", "item-events", "all-events", "events"])
648
+ ]),
649
+ _: 2
650
+ }, 1032, ["title", "header", "name"]))), 128))
651
+ ]),
652
+ _: 1
653
+ }, 8, ["modelValue", "activeKey", "expanded-names"]),
654
+ V(Je, {
655
+ ref_key: "EActionModalRef",
656
+ ref: r,
657
+ onAdd: x,
658
+ onEdit: $
659
+ }, null, 512)
660
+ ], 64));
661
+ }
662
+ });
663
+ export {
664
+ We as default
665
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BUkdmwKe.cjs");exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-C_98Qusp.cjs");exports.default=e._sfc_main;