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.
- package/dist/{attributeView-B8JS7SiW.cjs → attributeView-BSDAcGr-.cjs} +1 -1
- package/dist/{attributeView-oIH3-2FN.js → attributeView-Bz43SH5k.js} +8 -8
- package/dist/index-79-_PiUp.js +213 -0
- package/dist/index-B5dOTX9c.cjs +1 -0
- package/dist/{index-nhr7ps1e.js → index-BA8b7URG.js} +1 -1
- package/dist/index-BXjAqIhc.js +665 -0
- package/dist/{index-Bwmb5sha.cjs → index-BlhSSPRn.cjs} +1 -1
- package/dist/{index-rby8nugJ.cjs → index-BqRnThy4.cjs} +1 -1
- package/dist/{index-CrGWYheb.js → index-BqVHIRpW.js} +1 -1
- package/dist/{index-C5XNe5wE.js → index-BqkkpMMv.js} +1 -1
- package/dist/index-C5buJETv.js +4 -0
- package/dist/index-C_98Qusp.cjs +10 -0
- package/dist/index-Cc2pSWZA.cjs +1 -0
- package/dist/{index-Bts_xVeS.cjs → index-Cjz6Uuh1.cjs} +1 -1
- package/dist/{index-DiMAGPRY.js → index-D2XUpDv0.js} +1 -1
- package/dist/index-D4aHRq8_.cjs +1 -0
- package/dist/{index-CwXlSYIH.cjs → index-D8TH-5-y.cjs} +1 -1
- package/dist/index-DFc_FT_D.js +675 -0
- package/dist/{index-DitKpeDV.cjs → index-Dd63RYpy.cjs} +1 -1
- package/dist/{index-C5yhSYKA.js → index-Df-u4kqP.js} +235 -248
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{styleView-BDUqyY8T.cjs → styleView-7qHQlM8R.cjs} +1 -1
- package/dist/{styleView-CtfATcTc.js → styleView-Dqnk80Tm.js} +1 -1
- package/dist/ui/elementPlus/index.cjs +1 -1
- package/dist/ui/elementPlus/index.js +12 -0
- package/package.json +1 -1
- package/dist/core/components/designer/src/modules/attributeView/eventView.vue.d.ts +0 -2
- package/dist/core/components/designer/src/modules/outline/outline.vue.d.ts +0 -2
- package/dist/core/components/designer/src/modules/sourceCode/index.vue.d.ts +0 -2
- package/dist/eventView-BL4A2PVd.cjs +0 -1
- package/dist/eventView-Ed_9JLnx.js +0 -64
- package/dist/index-05ByfwQb.js +0 -432
- package/dist/index-BUkdmwKe.cjs +0 -10
- package/dist/index-Bt6BXCcr.cjs +0 -1
- package/dist/index-CjrdkSiN.js +0 -682
- package/dist/index-CqdmlJ1d.cjs +0 -1
- package/dist/index-DWW8LGvj.js +0 -41
- package/dist/index-DZIjd60A.js +0 -4
- package/dist/index-D_CH15dJ.cjs +0 -1
- package/dist/index-DskzasEn.js +0 -216
- package/dist/index-GJSr_nl7.cjs +0 -1
- package/dist/outline-CJSEUbgc.cjs +0 -1
- package/dist/outline-yy4pIEi3.js +0 -54
- package/dist/tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs +0 -1
- package/dist/tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js +0 -242
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("./index-C_98Qusp.cjs"),v=require("./axios-CYGTE3lR.cjs"),k=["title"],g=e.defineComponent({__name:"attributeView",setup(b){const s=e.inject("designer"),d=e.inject("pageSchema"),p=e.inject("revoke"),f=v.pluginManager.getComponentConfings(),c=e.computed(()=>s.state.checkedNode);function h(n){var a;return typeof n.show=="boolean"?n.show:typeof n.show=="function"?(a=n.show)==null?void 0:a.call(n,{values:c.value}):!0}const u=e.ref([]);e.watchEffect(()=>{var o,t,r;const n=(o=s.state.checkedNode)==null?void 0:o.type;if(!s.state.checkedNode||!n)return[];const a=((t=f[n])==null?void 0:t.config.attribute)??[];u.value=[{label:"组件ID",type:"input",field:"id",componentProps:{disabled:!0}},...a],s.state.checkedNode.id===((r=d.schemas[0])==null?void 0:r.id)&&u.value.push({label:"画布宽度",type:"EInputSize",field:"canvas.width",editData:d},{label:"画布高度",type:"EInputSize",field:"canvas.height",editData:d})});function y(n,a,o,t=c.value){typeof o.onChange=="function"&&o.onChange({value:n,values:t,componentAttributes:u}),o.changeSync?l.setValueByPath(t,a,n):e.nextTick(()=>{l.setValueByPath(t,a,n)}),p.push(d.schemas,"编辑组件属性")}function m(n,a,o=c.value){e.nextTick(()=>{l.setValueByPath(o,"componentProps.dynamicId",n)})}return(n,a)=>{var o;return e.openBlock(),e.createElementBlock("div",{class:"epic-attribute-view",key:(o=c.value)==null?void 0:o.id},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.value,t=>{var r;return e.openBlock(),e.createElementBlock("div",{key:t.field},[h(t)?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["epic-attr-item",t.layout])},[t.label?(e.openBlock(),e.createElementBlock("div",{key:0,class:"epic-attr-label",title:t.label},e.toDisplayString(t.label),9,k)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(["epic-attr-input",{"block!":t.layout==="vertical"}])},[e.createVNode(e.unref(l._sfc_main),{componentSchema:{...t,componentProps:{...t.componentProps,...t.field==="componentProps.defaultValue"?(r=c.value)==null?void 0:r.componentProps:{},input:!1,field:void 0,hidden:!1},show:!0,noFormItem:!0},dynamicId:e.unref(l.getValueByPath)(t.editData??c.value,"componentProps.dynamicId"),"model-value":e.unref(l.getValueByPath)(t.editData??c.value,t.field),"onUpdate:modelValue":i=>y(i,t.field,t,t.editData),"onUpdate:dynamicId":i=>m(i)},null,8,["componentSchema","dynamicId","model-value","onUpdate:modelValue","onUpdate:dynamicId"])],2)],2)):e.createCommentVNode("",!0)])}),128))])}}});exports.default=g;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as S, inject as i, computed as V, ref as P, watchEffect as C, openBlock as l, createElementBlock as s, Fragment as N, renderList as D, normalizeClass as m, toDisplayString as E, createCommentVNode as y, createElementVNode as U, createVNode as B, unref as f, nextTick as v } from "vue";
|
|
2
|
-
import { _ as x,
|
|
2
|
+
import { _ as x, o as g, s as h } from "./index-Df-u4kqP.js";
|
|
3
3
|
import { p as z } from "./axios-ITY6Uw7A.js";
|
|
4
4
|
const F = ["title"], M = /* @__PURE__ */ S({
|
|
5
5
|
__name: "attributeView",
|
|
@@ -9,14 +9,14 @@ const F = ["title"], M = /* @__PURE__ */ S({
|
|
|
9
9
|
var a;
|
|
10
10
|
return typeof t.show == "boolean" ? t.show : typeof t.show == "function" ? (a = t.show) == null ? void 0 : a.call(t, { values: o.value }) : !0;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
12
|
+
const u = P([]);
|
|
13
13
|
C(() => {
|
|
14
14
|
var n, e, c;
|
|
15
15
|
const t = (n = d.state.checkedNode) == null ? void 0 : n.type;
|
|
16
16
|
if (!d.state.checkedNode || !t)
|
|
17
17
|
return [];
|
|
18
18
|
const a = ((e = k[t]) == null ? void 0 : e.config.attribute) ?? [];
|
|
19
|
-
|
|
19
|
+
u.value = [
|
|
20
20
|
{
|
|
21
21
|
label: "组件ID",
|
|
22
22
|
type: "input",
|
|
@@ -26,7 +26,7 @@ const F = ["title"], M = /* @__PURE__ */ S({
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
...a
|
|
29
|
-
], d.state.checkedNode.id === ((c = r.schemas[0]) == null ? void 0 : c.id) &&
|
|
29
|
+
], d.state.checkedNode.id === ((c = r.schemas[0]) == null ? void 0 : c.id) && u.value.push(
|
|
30
30
|
{
|
|
31
31
|
label: "画布宽度",
|
|
32
32
|
type: "EInputSize",
|
|
@@ -42,7 +42,7 @@ const F = ["title"], M = /* @__PURE__ */ S({
|
|
|
42
42
|
);
|
|
43
43
|
});
|
|
44
44
|
function w(t, a, n, e = o.value) {
|
|
45
|
-
typeof n.onChange == "function" && n.onChange({ value: t, values: e, componentAttributes:
|
|
45
|
+
typeof n.onChange == "function" && n.onChange({ value: t, values: e, componentAttributes: u }), n.changeSync ? h(e, a, t) : v(() => {
|
|
46
46
|
h(e, a, t);
|
|
47
47
|
}), b.push(r.schemas, "编辑组件属性");
|
|
48
48
|
}
|
|
@@ -57,7 +57,7 @@ const F = ["title"], M = /* @__PURE__ */ S({
|
|
|
57
57
|
class: "epic-attribute-view",
|
|
58
58
|
key: (n = o.value) == null ? void 0 : n.id
|
|
59
59
|
}, [
|
|
60
|
-
(l(!0), s(N, null, D(
|
|
60
|
+
(l(!0), s(N, null, D(u.value, (e) => {
|
|
61
61
|
var c;
|
|
62
62
|
return l(), s("div", {
|
|
63
63
|
key: e.field
|
|
@@ -89,8 +89,8 @@ const F = ["title"], M = /* @__PURE__ */ S({
|
|
|
89
89
|
},
|
|
90
90
|
dynamicId: f(g)(e.editData ?? o.value, "componentProps.dynamicId"),
|
|
91
91
|
"model-value": f(g)(e.editData ?? o.value, e.field),
|
|
92
|
-
"onUpdate:modelValue": (
|
|
93
|
-
"onUpdate:dynamicId": (
|
|
92
|
+
"onUpdate:modelValue": (p) => w(p, e.field, e, e.editData),
|
|
93
|
+
"onUpdate:dynamicId": (p) => I(p)
|
|
94
94
|
}, null, 8, ["componentSchema", "dynamicId", "model-value", "onUpdate:modelValue", "onUpdate:dynamicId"])
|
|
95
95
|
], 2)
|
|
96
96
|
], 2)) : y("", !0)
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { defineComponent as B, inject as M, resolveComponent as j, openBlock as v, createBlock as N, unref as o, isRef as E, withCtx as A, createElementVNode as p, normalizeClass as D, createVNode as c, createCommentVNode as $, createElementBlock as _, ref as J, reactive as w, onMounted as z, watch as K, provide as L, Fragment as P, renderList as R, toDisplayString as T, withDirectives as F, vShow as q, createTextVNode as G } from "vue";
|
|
2
|
+
import { d as H } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
3
|
+
import { p as g, E as Q, a as W } from "./axios-ITY6Uw7A.js";
|
|
4
|
+
import { _ as S } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
|
+
import { n as O } from "./index-Df-u4kqP.js";
|
|
6
|
+
import { ElMessage as X } from "element-plus";
|
|
7
|
+
import { _ as Y } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
const Z = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "pl-4"
|
|
11
|
+
}, ee = /* @__PURE__ */ B({
|
|
12
|
+
name: "EOptionItem",
|
|
13
|
+
__name: "optionItem",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {}
|
|
16
|
+
},
|
|
17
|
+
emits: ["update:modelValue"],
|
|
18
|
+
setup(b, { emit: C }) {
|
|
19
|
+
const k = b, x = g.getComponent("input"), m = M("tree", !1), d = O(k, "modelValue", C);
|
|
20
|
+
function y(n) {
|
|
21
|
+
const s = {
|
|
22
|
+
label: "",
|
|
23
|
+
value: ""
|
|
24
|
+
};
|
|
25
|
+
n.children ? n.children.push(s) : n.children = [s];
|
|
26
|
+
}
|
|
27
|
+
function i(n) {
|
|
28
|
+
d.value = d.value.filter((s, f) => f !== n);
|
|
29
|
+
}
|
|
30
|
+
return (n, s) => {
|
|
31
|
+
const f = j("EOptionItem");
|
|
32
|
+
return v(), N(o(H), {
|
|
33
|
+
modelValue: o(d),
|
|
34
|
+
"onUpdate:modelValue": s[0] || (s[0] = (a) => E(d) ? d.value = a : null),
|
|
35
|
+
"item-key": "id",
|
|
36
|
+
"component-data": {
|
|
37
|
+
type: "transition-group"
|
|
38
|
+
},
|
|
39
|
+
group: "option-list",
|
|
40
|
+
handle: ".handle",
|
|
41
|
+
animation: 200
|
|
42
|
+
}, {
|
|
43
|
+
item: A(({ element: a, index: V }) => [
|
|
44
|
+
p("div", null, [
|
|
45
|
+
p("div", {
|
|
46
|
+
class: D([o(m) ? "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"])
|
|
47
|
+
}, [
|
|
48
|
+
c(o(S), {
|
|
49
|
+
class: "mr-2 cursor-move handle",
|
|
50
|
+
name: "icon--epic--drag"
|
|
51
|
+
}),
|
|
52
|
+
c(o(x), {
|
|
53
|
+
modelValue: a.label,
|
|
54
|
+
"onUpdate:modelValue": (r) => a.label = r,
|
|
55
|
+
value: a.label,
|
|
56
|
+
"onUpdate:value": (r) => a.label = r,
|
|
57
|
+
placeholder: "label"
|
|
58
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
59
|
+
c(o(x), {
|
|
60
|
+
modelValue: a.value,
|
|
61
|
+
"onUpdate:modelValue": (r) => a.value = r,
|
|
62
|
+
value: a.value,
|
|
63
|
+
"onUpdate:value": (r) => a.value = r,
|
|
64
|
+
placeholder: "value"
|
|
65
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
66
|
+
o(m) ? (v(), N(o(S), {
|
|
67
|
+
key: 0,
|
|
68
|
+
class: "cursor-pointer text-lg!",
|
|
69
|
+
name: "icon--epic--add-rounded",
|
|
70
|
+
onClick: (r) => y(a)
|
|
71
|
+
}, null, 8, ["onClick"])) : $("", !0),
|
|
72
|
+
c(o(S), {
|
|
73
|
+
class: "hover:text-red cursor-pointer",
|
|
74
|
+
name: "icon--epic--delete-outline-rounded",
|
|
75
|
+
onClick: (r) => i(V)
|
|
76
|
+
}, null, 8, ["onClick"])
|
|
77
|
+
], 2),
|
|
78
|
+
a.children ? (v(), _("div", Z, [
|
|
79
|
+
c(f, {
|
|
80
|
+
modelValue: a.children,
|
|
81
|
+
"onUpdate:modelValue": (r) => a.children = r
|
|
82
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
83
|
+
])) : $("", !0)
|
|
84
|
+
])
|
|
85
|
+
]),
|
|
86
|
+
_: 1
|
|
87
|
+
}, 8, ["modelValue"]);
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
}), le = { class: "" }, te = { class: "epic-tabs-box" }, ae = ["title", "onClick"], ne = { key: 0 }, oe = { class: "py-4 my-2 text-center text-gray-400 bg-white" }, re = { key: 1 }, ie = /* @__PURE__ */ B({
|
|
91
|
+
__name: "index",
|
|
92
|
+
props: {
|
|
93
|
+
tree: { type: Boolean },
|
|
94
|
+
modelValue: {},
|
|
95
|
+
dynamicId: {},
|
|
96
|
+
type: {}
|
|
97
|
+
},
|
|
98
|
+
emits: ["update:modelValue", "update:EOptionsEditor"],
|
|
99
|
+
setup(b, { emit: C }) {
|
|
100
|
+
const k = g.getComponent("button"), x = g.getComponent("select"), m = J([]), h = w({
|
|
101
|
+
title: "静态"
|
|
102
|
+
}), d = b, y = C;
|
|
103
|
+
Q.on("updateSource", (l) => {
|
|
104
|
+
m.value = g.sourceData.map((e) => ({
|
|
105
|
+
...e,
|
|
106
|
+
label: e.apiName,
|
|
107
|
+
value: e.id
|
|
108
|
+
})), V(n.value);
|
|
109
|
+
}), z(() => {
|
|
110
|
+
m.value = g.sourceData.map((l) => ({
|
|
111
|
+
...l,
|
|
112
|
+
label: l.apiName,
|
|
113
|
+
value: l.id
|
|
114
|
+
})), V(n.value);
|
|
115
|
+
});
|
|
116
|
+
const i = O(d, "modelValue", y), n = O(d, "dynamicId", y);
|
|
117
|
+
function s(l, e, u) {
|
|
118
|
+
return l && Object.prototype.toString.call(l) === "[object Array]" ? l.map((t) => t.children && t.children.length ? {
|
|
119
|
+
label: t[e],
|
|
120
|
+
value: t[u],
|
|
121
|
+
children: s(t.children, e, u)
|
|
122
|
+
} : {
|
|
123
|
+
label: t[e],
|
|
124
|
+
value: t[u]
|
|
125
|
+
}) : (X.info("请检查数据位置是否配置准确"), []);
|
|
126
|
+
}
|
|
127
|
+
K(
|
|
128
|
+
() => n.value,
|
|
129
|
+
async () => {
|
|
130
|
+
n.value ? h.title = "动态" : h.title = "静态";
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
immediate: !0
|
|
134
|
+
}
|
|
135
|
+
);
|
|
136
|
+
const f = [
|
|
137
|
+
{
|
|
138
|
+
title: "静态"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
title: "动态"
|
|
142
|
+
}
|
|
143
|
+
];
|
|
144
|
+
async function a(l) {
|
|
145
|
+
h.title = l.title, l.title === "静态" && (n.value = "");
|
|
146
|
+
}
|
|
147
|
+
async function V(l) {
|
|
148
|
+
const e = m.value.find((u) => u.id === l);
|
|
149
|
+
if (e && e.url) {
|
|
150
|
+
let u = await W({
|
|
151
|
+
method: (e == null ? void 0 : e.method) || "get",
|
|
152
|
+
url: e.url,
|
|
153
|
+
// url: "http://localhost:3333/users",
|
|
154
|
+
params: e != null && e.params ? JSON.parse(e == null ? void 0 : e.params) : {},
|
|
155
|
+
data: e != null && e.data ? JSON.parse(e == null ? void 0 : e.data) : {},
|
|
156
|
+
headers: e != null && e.header ? JSON.parse(e == null ? void 0 : e.header) : {}
|
|
157
|
+
});
|
|
158
|
+
e && (e != null && e.dataPath) && e.dataPath.split(".").reduce((U, I) => U[I], u.data), i.value = s(u.data, e.dataKey, e.dataValue);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
d.modelValue, L("tree", d.tree);
|
|
162
|
+
function r() {
|
|
163
|
+
const l = w({
|
|
164
|
+
label: "",
|
|
165
|
+
value: ""
|
|
166
|
+
});
|
|
167
|
+
i.value.length ? i.value = [...i.value, l] : i.value = [l];
|
|
168
|
+
}
|
|
169
|
+
return (l, e) => {
|
|
170
|
+
var u;
|
|
171
|
+
return v(), _("div", le, [
|
|
172
|
+
p("div", null, [
|
|
173
|
+
p("div", te, [
|
|
174
|
+
(v(), _(P, null, R(f, (t, U) => p("div", {
|
|
175
|
+
class: D(["epic-tab cursor-pointer truncate", { checked: h.title === t.title }]),
|
|
176
|
+
key: U,
|
|
177
|
+
title: t.title,
|
|
178
|
+
onClick: (I) => a(t)
|
|
179
|
+
}, T(t.title), 11, ae)), 64))
|
|
180
|
+
]),
|
|
181
|
+
h.title === "静态" ? (v(), _("div", ne, [
|
|
182
|
+
F(p("div", oe, "暂无选项", 512), [
|
|
183
|
+
[q, !((u = o(i)) != null && u.length)]
|
|
184
|
+
]),
|
|
185
|
+
c(ee, {
|
|
186
|
+
modelValue: o(i),
|
|
187
|
+
"onUpdate:modelValue": e[0] || (e[0] = (t) => E(i) ? i.value = t : null)
|
|
188
|
+
}, null, 8, ["modelValue"]),
|
|
189
|
+
c(o(k), { onClick: r }, {
|
|
190
|
+
default: A(() => e[2] || (e[2] = [
|
|
191
|
+
G("添加选项")
|
|
192
|
+
])),
|
|
193
|
+
_: 1
|
|
194
|
+
})
|
|
195
|
+
])) : (v(), _("div", re, [
|
|
196
|
+
e[3] || (e[3] = p("span", { style: { "font-size": "12px", "margin-bottom": "8px", display: "inline-block" } }, "数据源", -1)),
|
|
197
|
+
c(o(x), {
|
|
198
|
+
modelValue: o(n),
|
|
199
|
+
"onUpdate:modelValue": e[1] || (e[1] = (t) => E(n) ? n.value = t : null),
|
|
200
|
+
placeholder: "请选择数据源",
|
|
201
|
+
clearable: "",
|
|
202
|
+
options: m.value,
|
|
203
|
+
onChange: V
|
|
204
|
+
}, null, 8, ["modelValue", "options"])
|
|
205
|
+
]))
|
|
206
|
+
])
|
|
207
|
+
]);
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
}), he = /* @__PURE__ */ Y(ie, [["__scopeId", "data-v-5d63954c"]]);
|
|
211
|
+
export {
|
|
212
|
+
he as default
|
|
213
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),N=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-C_98Qusp.cjs"),E=require("element-plus"),B=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),S={key:0,class:"pl-4"},U=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(N.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",S,[e.createVNode(v,{modelValue:a.children,"onUpdate:modelValue":r=>a.children=r},null,8,["modelValue","onUpdate:modelValue"])])):e.createCommentVNode("",!0)])]),_:1},8,["modelValue"])}}}),M={class:""},O={class:"epic-tabs-box"},I=["title","onClick"],q={key:0},w={class:"py-4 my-2 text-center text-gray-400 bg-white"},$={key:1},j=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]}):(E.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):{}});l&&(l!=null&&l.dataPath)&&l.dataPath.split(".").reduce((x,C)=>x[C],i.data),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",M,[e.createElementVNode("div",null,[e.createElementVNode("div",O,[(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,I)),64))]),p.title==="静态"?(e.openBlock(),e.createElementBlock("div",q,[e.withDirectives(e.createElementVNode("div",w,"暂无选项",512),[[e.vShow,!((i=e.unref(u))!=null&&i.length)]]),e.createVNode(U,{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",$,[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"])]))])])}}}),A=B._export_sfc(j,[["__scopeId","data-v-5d63954c"]]);exports.default=A;
|
|
@@ -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-Df-u4kqP.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",
|