epic-designer-gold 0.0.21 → 0.0.23
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-CP3hg3UK.cjs → attributeView-8NOrqlS1.cjs} +1 -1
- package/dist/{attributeView-Bs2qSxx7.js → attributeView-BHuhrlM5.js} +8 -8
- package/dist/core/components/designer/src/designer.vue.d.ts +0 -1
- package/dist/{index-CTNgPpDR.js → index-8kRf0Tni.js} +1 -1
- package/dist/index-9bx0Eg0-.cjs +1 -0
- package/dist/index-BHkCN6Gc.cjs +1 -0
- package/dist/{index-DFBtzyag.js → index-BcAPkz_3.js} +1 -1
- package/dist/{index-CzAJ8qnW.js → index-BcRau_iO.js} +74 -74
- package/dist/{index-CsimLiTB.cjs → index-BfV0-xlv.cjs} +1 -1
- package/dist/index-BfWxzrQ0.js +675 -0
- package/dist/{index-Ds85DNV7.cjs → index-BqP4q7kG.cjs} +1 -1
- package/dist/index-CI-wApqh.cjs +10 -0
- package/dist/{index-wltb2XZn.js → index-CNRYixnW.js} +493 -511
- package/dist/{index-CzU0fSLN.cjs → index-CtqoFTv7.cjs} +1 -1
- package/dist/{index-IoerwjxE.cjs → index-DAQnePGW.cjs} +1 -1
- package/dist/{index-C0kcltz_.js → index-DLXCQOpE.js} +1 -1
- package/dist/index-DMO6svHk.js +4 -0
- package/dist/{index-BOOu9IOW.cjs → index-DPQrSg6e.cjs} +1 -1
- package/dist/index-DzGESDFj.cjs +1 -0
- package/dist/{index-npC6NXqj.js → index-R1sGzPDh.js} +1 -1
- package/dist/index-zFyk0fsI.js +665 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/{styleView-PLyaM974.cjs → styleView-DevMh4gy.cjs} +1 -1
- package/dist/{styleView-CQ9CoWd1.js → styleView-Dq9MseMf.js} +1 -1
- 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-DqwO0f-q.cjs +0 -1
- package/dist/eventView-rsxe7yze.js +0 -64
- package/dist/index-93_j-O1m.cjs +0 -1
- package/dist/index-BQ_fSZ8_.cjs +0 -1
- package/dist/index-BbHxNc1N.cjs +0 -10
- package/dist/index-C6fguDNu.cjs +0 -1
- package/dist/index-CIgVQyhq.js +0 -432
- package/dist/index-CWzPGA7K.js +0 -41
- package/dist/index-DxLHfmGz.js +0 -4
- package/dist/index-DxUk7mzH.cjs +0 -1
- package/dist/index-Rtzc87-b.js +0 -682
- 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-CI-wApqh.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-CNRYixnW.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)
|
|
@@ -88,7 +88,6 @@ declare const __VLS_component: import('vue').DefineComponent<DesignerProps, {
|
|
|
88
88
|
hiddenHeader: boolean;
|
|
89
89
|
lockDefaultSchemaEdit: boolean;
|
|
90
90
|
formMode: boolean;
|
|
91
|
-
updateSourceId: string;
|
|
92
91
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
93
92
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
94
93
|
export default _default;
|
|
@@ -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-CNRYixnW.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",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),E=require("./vuedraggable.umd-BqhSJIAi.cjs"),p=require("./axios-CYGTE3lR.cjs"),b=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),C=require("./index-CI-wApqh.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:k}){const y=h,_=p.pluginManager.getComponent("input"),d=e.inject("tree",!1),s=k,i=C.useVModel(y,"modelValue",s);function g(a){const c={label:"",value:""};a.children?a.children.push(c):a.children=[c]}function r(a){i.value=i.value.filter((c,v)=>v!==a)}return(a,c)=>{const v=e.resolveComponent("EOptionItem");return e.openBlock(),e.createBlock(e.unref(E.draggable),{modelValue:e.unref(i),"onUpdate:modelValue":c[0]||(c[0]=n=>e.isRef(i)?i.value=n:null),"item-key":"id","component-data":{type:"transition-group"},group:"option-list",handle:".handle",animation:200},{item:e.withCtx(({element:n,index:V})=>[e.createElementVNode("div",null,[e.createElementVNode("div",{class:e.normalizeClass([e.unref(d)?"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(b._sfc_main),{class:"mr-2 cursor-move handle",name:"icon--epic--drag"}),e.createVNode(e.unref(_),{modelValue:n.label,"onUpdate:modelValue":o=>n.label=o,value:n.label,"onUpdate:value":o=>n.label=o,placeholder:"label"},null,8,["modelValue","onUpdate:modelValue","value","onUpdate:value"]),e.createVNode(e.unref(_),{modelValue:n.value,"onUpdate:modelValue":o=>n.value=o,value:n.value,"onUpdate:value":o=>n.value=o,placeholder:"value"},null,8,["modelValue","onUpdate:modelValue","value","onUpdate:value"]),e.unref(d)?(e.openBlock(),e.createBlock(e.unref(b._sfc_main),{key:0,class:"cursor-pointer text-lg!",name:"icon--epic--add-rounded",onClick:o=>g(n)},null,8,["onClick"])):e.createCommentVNode("",!0),e.createVNode(e.unref(b._sfc_main),{class:"hover:text-red cursor-pointer",name:"icon--epic--delete-outline-rounded",onClick:o=>r(V)},null,8,["onClick"])],2),n.children?(e.openBlock(),e.createElementBlock("div",U,[e.createVNode(v,{modelValue:n.children,"onUpdate:modelValue":o=>n.children=o},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:k}){const y=p.pluginManager.getComponent("button"),_=p.pluginManager.getComponent("select"),d=e.ref([]),s=e.reactive({title:"静态"}),i=h,g=k;p.EventBus.on("updateSource",l=>{d.value=p.pluginManager.sourceData.map(t=>({...t,label:t.apiName,value:t.id})),V(a.value)}),e.onMounted(()=>{d.value=p.pluginManager.sourceData.map(l=>({...l,label:l.apiName,value:l.id})),V(a.value)});const r=C.useVModel(i,"modelValue",g),a=C.useVModel(i,"dynamicId",g);function c(l){return l&&Object.prototype.toString.call(l)==="[object Array]"?l:(B.ElMessage.info("请检查数据位置是否配置准确"),[])}e.watch(()=>a.value,async()=>{a.value?s.title="动态":s.title="静态"},{immediate:!0});const v=[{title:"静态"},{title:"动态"}];async function n(l){s.title=l.title,l.title==="静态"&&(a.value="")}async function V(l){const t=d.value.find(m=>m.id===l);if(t&&t.url){let m=await p.axios({method:(t==null?void 0:t.method)||"get",url:t.url,params:t!=null&&t.params?JSON.parse(t==null?void 0:t.params):{},data:t!=null&&t.data?JSON.parse(t==null?void 0:t.data):{},headers:t!=null&&t.header?JSON.parse(t==null?void 0:t.header):{}});if(t&&(t!=null&&t.dataPath)){const x=t.dataPath.split(".").reduce((f,N)=>f[N],m.data);r.value=c(x).map(f=>({label:f[t.dataKey],value:f[t.dataValue]}))}else r.value=c(m.data).map(u=>({label:u[t.dataKey],value:u[t.dataValue]}))}}i.modelValue,e.provide("tree",i.tree);function o(){const l=e.reactive({label:"",value:""});r.value.length?r.value=[...r.value,l]:r.value=[l]}return(l,t)=>{var m;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,(u,x)=>e.createElementVNode("div",{class:e.normalizeClass(["epic-tab cursor-pointer truncate",{checked:s.title===u.title}]),key:x,title:u.title,onClick:f=>n(u)},e.toDisplayString(u.title),11,q)),64))]),s.title==="静态"?(e.openBlock(),e.createElementBlock("div",w,[e.withDirectives(e.createElementVNode("div",$,"暂无选项",512),[[e.vShow,!((m=e.unref(r))!=null&&m.length)]]),e.createVNode(M,{modelValue:e.unref(r),"onUpdate:modelValue":t[0]||(t[0]=u=>e.isRef(r)?r.value=u:null)},null,8,["modelValue"]),e.createVNode(e.unref(y),{onClick:o},{default:e.withCtx(()=>t[2]||(t[2]=[e.createTextVNode("添加选项")])),_:1})])):(e.openBlock(),e.createElementBlock("div",j,[t[3]||(t[3]=e.createElementVNode("span",{style:{"font-size":"12px","margin-bottom":"8px",display:"inline-block"}},"数据源",-1)),e.createVNode(e.unref(_),{modelValue:e.unref(a),"onUpdate:modelValue":t[1]||(t[1]=u=>e.isRef(a)?a.value=u:null),placeholder:"请选择数据源",clearable:"",options:d.value,onChange:V},null,8,["modelValue","options"])]))])])}}}),D=S._export_sfc(A,[["__scopeId","data-v-7e189094"]]);exports.default=D;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),b=require("./index-CI-wApqh.cjs"),B=require("./axios-CYGTE3lR.cjs"),I=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),$=require("./vuedraggable.umd-BqhSJIAi.cjs"),M={class:"epic-event-info"},K=["title"],j={class:"epic-event-btn text-lg flex items-center text-$epic-text-secondary"},A={class:"epic-action-editor-main"},O={class:"epic-editor-item rounded"},U={class:"w-36px flex items-center text-lg"},D={class:"flex-1"},T={key:0},L={key:1},P={key:2},z={class:"epic-action-box text-lg text-$epic-text-medium"},R=["onClick"],F=["onClick"],q=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(x,{emit:c}){const f=x,_=c,u=e.inject("pageSchema");function V(m){_("add",m)}function g(m){return b.findSchemaById(u.schemas,m).label}function d(m,a){var t;const n=o(a);n[a]=f.events[a].filter((h,k)=>m!==k),(t=n[a])!=null&&t.length||delete n[a],_("update:modelValue",n)}function r(m,a,n){_("edit",m,a,n)}function o(m){const a={};return f.allEvents.forEach(n=>{if(!f.events[n.type].length||n.type===m)return!1;a[n.type]=f.events[n.type]}),a}return(m,a)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.itemEvents,n=>(e.openBlock(),e.createElementBlock("div",{key:n.type,class:"epic-event-item"},[e.createElementVNode("div",M,[e.createElementVNode("div",{class:"epic-event-label",title:n.describe},e.toDisplayString(n.describe),9,K),e.createElementVNode("div",j,[e.createVNode(e.unref(I._sfc_main),{name:"icon--epic--add-rounded",onClick:t=>V(n.type)},null,8,["onClick"])])]),e.createElementVNode("div",A,[e.createVNode(e.unref($.draggable),{modelValue:f.events[n.type],"onUpdate:modelValue":t=>f.events[n.type]=t,"item-key":"id","component-data":{type:"transition-group"},group:"option-list",handle:".handle",animation:200},{item:e.withCtx(({element:t,index:h})=>[e.createElementVNode("div",O,[e.createElementVNode("div",U,[e.createVNode(e.unref(I._sfc_main),{class:"mr-2 text-lg cursor-move handle text-$epic-text-medium",name:"icon--epic--drag"})]),e.createElementVNode("div",D,[t.type==="component"?(e.openBlock(),e.createElementBlock("div",T,e.toDisplayString(g(t.componentId)),1)):t.type==="custom"?(e.openBlock(),e.createElementBlock("div",L," 自定义函数 ")):t.type==="public"?(e.openBlock(),e.createElementBlock("div",P," 公共函数 ")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.methodName),1)]),e.createElementVNode("div",z,[e.createElementVNode("div",{class:"epic-edit-btn",onClick:k=>r(h,n.type,t)},[e.createVNode(e.unref(I._sfc_main),{name:"icon--epic--page-info-outline-rounded"})],8,R),e.createElementVNode("div",{class:"epic-del-btn",onClick:k=>d(h,n.type)},[e.createVNode(e.unref(I._sfc_main),{name:"icon--epic--delete-outline-rounded"})],8,F)])])]),_:2},1032,["modelValue","onUpdate:modelValue"])])]))),128))}}),S=e.defineComponent({name:"ETreeNodeItem",__name:"treeNodeItem",props:{schema:{}},setup(x){const c=x,f=e.inject("slots",{}),_=e.inject("pageSchema",{}),u=e.inject("expandedKeys"),V=e.inject("treeProps"),g=e.inject("selectedKeys"),d=e.inject("handleSelect"),r=e.computed(()=>u.value.includes(c.schema.id??"")),o=e.defineComponent({setup(){return()=>{var n;return e.h("span",{class:{text:!0,hover:V.hoverKey===c.schema.id,checked:g.value.includes(c.schema.id)},onClick:()=>d(c.schema.id,c.schema)},((n=f["tree-node"])==null?void 0:n.call(f,c))??e.h("span",{class:"epic-text-padding flex"},{default:()=>{var t;return[e.h("span",{class:"max-w-full truncate"},c.schema.label??((t=B.pluginManager.getComponentConfingByType(c.schema.type))==null?void 0:t.defaultSchema.label)),e.h("span",{class:"epic-node-type-text flex-1 w-0 truncate"},c.schema.id)]}}))}}});function m(){const n=c.schema.id;if(!n)return!1;u.value.includes(n)?u.value=u.value.filter(t=>t!==n):u.value.push(n)}function a(){var t;const n=c.schema.id;if(!n||!((t=c.schema.children)!=null&&t.length))return!1;u.value.push(n)}return a(),(n,t)=>{var h,k,E,y,s;return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["epic-tree-node",{expanded:(h=c.schema.children)==null?void 0:h.length,"level-1":c.schema.id===((k=e.unref(_).schemas[0])==null?void 0:k.id)}])},[e.createElementVNode("a",null,[(E=c.schema.children)!=null&&E.length&&c.schema.id!==((y=e.unref(_).schemas[0])==null?void 0:y.id)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["icon-expanded",{expanded:r.value}]),onClick:m},[e.createVNode(e.unref(I._sfc_main),{name:"icon--epic--caret-right-outlined"})],2)):e.createCommentVNode("",!0),e.createVNode(e.unref(o))]),(s=c.schema.children)!=null&&s.length?(e.openBlock(),e.createBlock(w,{key:0,class:e.normalizeClass(["epic-tree-sublist",{expanded:r.value}]),schemas:c.schema.children,"onUpdate:schemas":t[0]||(t[0]=p=>c.schema.children=p),parentSchema:c.schema},null,8,["class","schemas","parentSchema"])):e.createCommentVNode("",!0)],2)}}}),J={key:1},w=e.defineComponent({name:"ETreeNodes",__name:"treeNodes",props:{schemas:{},parentSchema:{}},emits:["update:schemas"],setup(x,{emit:c}){const f=e.inject("designer"),_=e.inject("pageSchema"),u=e.inject("treeProps"),V=x,g=c,d=e.computed({get(){return V.schemas},set(m){g("update:schemas",m)}});function r(m){f.setDisableHover(!0),f.setCheckedNode(d.value[m])}function o(m){var a,n,t;return m.id===((a=_.schemas[0])==null?void 0:a.id)||(t=(n=B.pluginManager.getComponentConfingByType(m.type))==null?void 0:n.editConstraints)!=null&&t.immovable?"unmover-item":"draggable-item"}return(m,a)=>{var n,t,h,k,E;return(h=(t=e.unref(B.pluginManager).getComponentConfingByType(((n=V.parentSchema)==null?void 0:n.type)||""))==null?void 0:t.editConstraints)!=null&&h.childImmovable?(e.openBlock(),e.createElementBlock("ul",J,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,y=>(e.openBlock(),e.createBlock(S,{key:y.id,schema:y},null,8,["schema"]))),128))])):(e.openBlock(),e.createBlock(e.unref($.draggable),e.mergeProps({key:0,modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=y=>d.value=y),"item-key":"id","component-data":{},class:"epic-draggable-range"},{animation:200,tag:"ul",group:"tree-draggable",ghostClass:"moveing",draggable:".draggable-item",disabled:!e.unref(u).draggable||((k=d.value[0])==null?void 0:k.id)===((E=e.unref(_).schemas[0])==null?void 0:E.id)},{onStart:a[1]||(a[1]=y=>r(y.oldIndex))}),{item:e.withCtx(({element:y,index:s})=>[(e.openBlock(),e.createBlock(S,{class:e.normalizeClass(o(y)),key:y.id,schema:y},null,8,["class","schema"]))]),_:1},16,["modelValue"]))}}}),H={class:"epic-tree h-full flex flex-col"},G={class:"epic-search-box px-10px py-6px"},Q={class:"epic-tree-main flex-1 overflow-auto h-0"},W={class:"text-center pt-42px text-gray-400"},X=e.defineComponent({name:"ETree",__name:"tree",props:{options:{type:Array,default:()=>[]},hoverKey:{type:String,default:""},selectedKeys:{type:Array,default:()=>[]},draggable:{type:Boolean,default:!1}},emits:["update:selectedKeys","nodeClick"],setup(x,{emit:c}){const f=e.useSlots();e.provide("slots",f);const _=B.pluginManager.getComponent("input"),u=e.ref(""),V=e.ref([]),g=x,d=c,r=e.computed({get(){return g.selectedKeys},set(n){d("update:selectedKeys",n)}}),o=e.computed({get(){return m(g.options,u.value)},set(n){console.log(n)}});function m(n,t){const h=[];return n.forEach(k=>{var E;if((E=k.label)!=null&&E.includes(t))h.push(k);else if(k.children){const y=m(k.children,t);if(y.length>0){const s={...k};s.children=y,h.push(s)}}}),h}function a(n,t){r.value=[n],d("nodeClick",{id:n,componentSchema:t})}return e.provide("expandedKeys",V),e.provide("selectedKeys",r),e.provide("treeProps",g),e.provide("handleSelect",a),(n,t)=>(e.openBlock(),e.createElementBlock("div",H,[e.createElementVNode("div",G,[e.createVNode(e.unref(_),{placeholder:"搜索节点",clearable:"",allowClear:"",modelValue:u.value,"onUpdate:modelValue":t[0]||(t[0]=h=>u.value=h),value:u.value,"onUpdate:value":t[1]||(t[1]=h=>u.value=h)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(I._sfc_main),{name:"icon--epic--search-rounded"})]),_:1},8,["modelValue","value"])]),e.createElementVNode("div",Q,[e.createElementVNode("ul",null,[e.createVNode(w,{schemas:o.value,"onUpdate:schemas":t[2]||(t[2]=h=>o.value=h)},null,8,["schemas"])]),e.withDirectives(e.createElementVNode("div",W,"没有查询到的数据",512),[[e.vShow,!o.value.length]])])]))}}),Y={class:"h-full flex flex-col"},Z=e.defineComponent({__name:"EScriptEdit",setup(x){const c=B.pluginManager.getComponent("monacoEditor"),f={theme:"vs-light",selectOnLineNumbers:!0,minimap:{enabled:!1}},_=e.ref(null),u=e.inject("pageSchema");return(V,g)=>(e.openBlock(),e.createElementBlock("div",Y,[g[1]||(g[1]=e.createElementVNode("div",{class:"pb-2"}," 自定义函数编辑 ",-1)),e.createVNode(e.unref(c),{ref_key:"monacoEditorRef",ref:_,autoToggleTheme:"",modelValue:e.unref(u).script,"onUpdate:modelValue":g[0]||(g[0]=d=>e.unref(u).script=d),class:"epic-editor flex-1",config:f,language:"javascript"},null,8,["modelValue"])]))}}),ee={class:"epic-attribute-view"},te=["title"],ne={class:"epic-attr-input"},oe=e.defineComponent({__name:"EArgsEditor",props:{modelValue:{},actionArgsConfigs:{}},emits:["update:modelValue"],setup(x,{emit:c}){const f=x,_=c,u=e.computed(()=>f.modelValue?JSON.parse(f.modelValue):[]);function V(d){var r;return typeof d.show=="boolean"?d.show:typeof d.show=="function"?(r=d.show)==null?void 0:r.call(d,{values:u.value}):!0}function g(d,r){const o=[...JSON.parse(f.modelValue??"[]")];o[r]=d,_("update:modelValue",JSON.stringify(o))}return(d,r)=>(e.openBlock(),e.createElementBlock("div",ee,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.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,te),e.createElementVNode("div",ne,[e.createVNode(e.unref(b._sfc_main),{componentSchema:{...o,componentProps:{...o.componentProps,input:!1,field:void 0,hidden:!1},show:!0,noFormItem:!0},"model-value":u.value[o.field],"onUpdate:modelValue":m=>g(m,o.field)},null,8,["componentSchema","model-value","onUpdate:modelValue"])])],2),[[e.vShow,V(o)]])]))),128))]))}}),le={class:"rounded epic-modal-action-main"},ae={class:"epic-modal-left-panel h-full flex flex-col"},ce={class:"flex flex-1 h-0 flex-col"},se={class:"flex-1 h-0"},de={class:"epic-action-select h-30/100 flex flex-col"},ie={class:"flex-1 overflow-auto pr-8px"},re=["onClick"],ue={class:"text-center pt-42px text-gray-400"},me={class:"epic-modal-right-panel"},pe={key:1,class:"text-center pt-42px text-gray-400"},fe=e.defineComponent({__name:"EActionModal",emits:["add","edit"],setup(x,{expose:c,emit:f}){const _=B.pluginManager.getComponent("modal"),u=e.ref(!0),V=e.inject("pageSchema"),g=e.inject("pageManager",{}),d=e.ref(!1),r=e.ref([]),o=e.ref(null),m=f,a=e.computed(()=>{var i;return t.actionItem.type==="component"?o.value?(i=B.pluginManager.getComponentConfings()[o.value.type].config.action)==null?void 0:i.map(l=>({label:l.describe,value:l.type})):[]:t.actionItem.type==="custom"?Object.entries(g.funcs.value).filter(([l,N])=>typeof N=="function").map(([l])=>({label:l,value:l})):t.actionItem.type==="public"?Object.entries(B.pluginManager.publicMethods).map(([l])=>({label:l,value:l})):[]}),n=e.computed(()=>{if(t.actionItem.type==="component"&&o.value){const i=B.pluginManager.getComponentConfings()[o.value.type].config.action,l=i==null?void 0:i.find(N=>N.type===t.actionItem.methodName);if(l!=null&&l.argsConfigs){const N=l.argsConfigs.findIndex(C=>C.label==="设置数据");N!==-1&&(l.argsConfigs[N]={...o.value,label:"设置数据",field:"0",id:b.getUUID()})}return(l==null?void 0:l.argsConfigs)??[]}return[]}),t=e.reactive({actionItem:{type:"custom",methodName:"test",componentId:null},cacheData:{}});function h(){var i;d.value=!0,u.value=!0,t.actionItem.type="custom",t.actionItem.componentId=null,(i=a.value)!=null&&i.length&&v(a.value[0].value)}function k(i){if(d.value=!0,u.value=!1,o.value=null,i.componentId){const l=b.findSchemaById(V.schemas,i.componentId);o.value=l,r.value=[i.componentId]}e.nextTick(()=>{t.actionItem.componentId=i.componentId,t.actionItem.methodName=i.methodName,t.actionItem.type=i.type,t.actionItem.args=i.args})}function E(){if(!t.actionItem.methodName){alert("请先选择动作方法");return}m(u.value?"add":"edit",b.deepClone(e.toRaw(t.actionItem))),y()}function y(){d.value=!1,r.value=[],t.cacheData={}}function s(i){var l;t.actionItem.componentId=null,t.actionItem.type=i,o.value=null,t.actionItem.methodName=null,r.value=[],(l=a.value)!=null&&l.length&&v(a.value[0].value)}function p(i){var l;t.actionItem.args&&(t.cacheData[t.actionItem.componentId+t.actionItem.methodName]=t.actionItem.args),t.actionItem.componentId=i.id,t.actionItem.type="component",t.actionItem.methodName=null,o.value=i.componentSchema,(l=a.value)!=null&&l.length&&v(a.value[0].value)}function v(i){t.actionItem.methodName=i,t.actionItem.args=t.cacheData[t.actionItem.componentId+t.actionItem.methodName]}return c({handleOpen:h,handleOpenEdit:k}),(i,l)=>(e.openBlock(),e.createBlock(e.unref(_),{modelValue:d.value,"onUpdate:modelValue":l[4]||(l[4]=N=>d.value=N),class:"w-1200px",width:"1200px",onClose:y,onOk:E,title:"动作配置"},{default:e.withCtx(()=>{var N;return[e.createElementVNode("div",le,[e.createElementVNode("div",ae,[e.createElementVNode("div",ce,[e.createElementVNode("div",{class:e.normalizeClass(["fun-btn",{checked:t.actionItem.type==="custom"}]),onClick:l[0]||(l[0]=C=>s("custom"))}," 自定义函数 ",2),e.createElementVNode("div",{class:e.normalizeClass(["fun-btn",{checked:t.actionItem.type==="public"}]),onClick:l[1]||(l[1]=C=>s("public"))}," 公共函数 ",2),l[5]||(l[5]=e.createTextVNode(" 组件 ")),e.createElementVNode("div",se,[e.createVNode(e.unref(X),{selectedKeys:r.value,"onUpdate:selectedKeys":l[2]||(l[2]=C=>r.value=C),options:e.unref(V).schemas,onNodeClick:p},null,8,["selectedKeys","options"])])]),e.createElementVNode("div",de,[l[6]||(l[6]=e.createElementVNode("div",{class:"mb-2"},"动作选择",-1)),e.createElementVNode("div",ie,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.value,C=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{checked:C.value===t.actionItem.methodName},"epic-action-item"]),onClick:he=>v(C.value),key:C.value},[e.createElementVNode("span",null,e.toDisplayString(C.label),1)],10,re))),128)),e.withDirectives(e.createElementVNode("div",ue," 当前组件暂无动作 ",512),[[e.vShow,!((N=a.value)!=null&&N.length)]])])])]),e.createElementVNode("div",me,[t.actionItem.type==="custom"?(e.openBlock(),e.createBlock(Z,{key:0})):n.value.length===0?(e.openBlock(),e.createElementBlock("div",pe," 暂无配置 ")):(e.openBlock(),e.createBlock(oe,{key:2,modelValue:t.actionItem.args,"onUpdate:modelValue":l[3]||(l[3]=C=>t.actionItem.args=C),actionArgsConfigs:n.value},null,8,["modelValue","actionArgsConfigs"]))])])]}),_:1},8,["modelValue"]))}}),ve=e.defineComponent({__name:"index",props:{eventList:{type:Array,default:()=>[]},modelValue:{type:Object}},emits:["update:modelValue"],setup(x,{emit:c}){const f=B.pluginManager.getComponent("Collapse"),_=B.pluginManager.getComponent("CollapseItem"),u=e.ref(null);let V=0;const g=x,d=c,r=e.computed({get(){return g.modelValue},set(s){d("update:modelValue",s)}}),o=e.ref([]),m=e.computed(()=>g.eventList.filter(s=>s.events.length)),a=e.computed(()=>g.eventList.map(s=>s.events).flat()),n=e.ref({});a.value.forEach(s=>{n.value[s.type]=e.computed({get(){var p;return((p=r.value)==null?void 0:p[s.type])??[]},set(p){p&&p.length?r.value[s.type]=p.map(v=>e.toRaw(v)):delete r.value[s.type]}})}),e.watch(()=>m.value,s=>{s.length&&(o.value=s.filter(p=>{for(let v=0;v<p.events.length;v++){const i=p.events[v].type;if(n.value[i].length)return!0}return!1}).map(p=>p.title))},{immediate:!0});let t="";function h(s){var p;(p=u.value)==null||p.handleOpen(),t=s}function k(s,p,v){var i;(i=u.value)==null||i.handleOpenEdit(v),V=s,t=p}function E(s){n.value[t][V]=s,r.value[t]=[...n.value[t]??[]]}function y(s){if(!r.value){r.value={[t]:[...n.value[t]??[],s]};return}r.value[t]=[...n.value[t]??[],s]}return(s,p)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(f),{modelValue:o.value,"onUpdate:modelValue":p[1]||(p[1]=v=>o.value=v),activeKey:o.value,"onUpdate:activeKey":p[2]||(p[2]=v=>o.value=v),"expanded-names":o.value,"onUpdate:expandedNames":p[3]||(p[3]=v=>o.value=v)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,v=>(e.openBlock(),e.createBlock(e.unref(_),{key:v.title,title:v.title,header:v.title,name:v.title},{default:e.withCtx(()=>[e.createVNode(q,{modelValue:r.value,"onUpdate:modelValue":p[0]||(p[0]=i=>r.value=i),"item-events":v.events,"all-events":a.value,events:n.value,onAdd:h,onEdit:k},null,8,["modelValue","item-events","all-events","events"])]),_:2},1032,["title","header","name"]))),128))]),_:1},8,["modelValue","activeKey","expanded-names"]),e.createVNode(fe,{ref_key:"EActionModalRef",ref:u,onAdd:y,onEdit:E},null,512)],64))}});exports.default=ve;
|
|
@@ -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-CNRYixnW.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" },
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as B, inject as j, resolveComponent as J, openBlock as v, createBlock as N, unref as n, isRef as O, withCtx as A, createElementVNode as p, normalizeClass as D, createVNode as d, createCommentVNode as $, createElementBlock as
|
|
1
|
+
import { defineComponent as B, inject as j, resolveComponent as J, openBlock as v, createBlock as N, unref as n, isRef as O, withCtx as A, createElementVNode as p, normalizeClass as D, createVNode as d, createCommentVNode as $, createElementBlock as g, ref as z, reactive as w, onMounted as K, watch as L, provide as P, Fragment as R, renderList as T, toDisplayString as F, withDirectives as q, vShow as G, createTextVNode as H } from "vue";
|
|
2
2
|
import { d as Q } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
3
|
-
import { p as
|
|
3
|
+
import { p as y, E as W, a as X } from "./axios-ITY6Uw7A.js";
|
|
4
4
|
import { _ as E } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
|
-
import { n as I } from "./index-
|
|
5
|
+
import { n as I } from "./index-CNRYixnW.js";
|
|
6
6
|
import { ElMessage as Y } from "element-plus";
|
|
7
7
|
import { _ as Z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
8
|
const ee = {
|
|
9
9
|
key: 0,
|
|
10
10
|
class: "pl-4"
|
|
11
|
-
},
|
|
11
|
+
}, le = /* @__PURE__ */ B({
|
|
12
12
|
name: "EOptionItem",
|
|
13
13
|
__name: "optionItem",
|
|
14
14
|
props: {
|
|
@@ -16,22 +16,22 @@ const ee = {
|
|
|
16
16
|
},
|
|
17
17
|
emits: ["update:modelValue"],
|
|
18
18
|
setup(k, { emit: C }) {
|
|
19
|
-
const U = k,
|
|
20
|
-
function
|
|
19
|
+
const U = k, x = y.getComponent("input"), c = j("tree", !1), i = I(U, "modelValue", C);
|
|
20
|
+
function b(a) {
|
|
21
21
|
const s = {
|
|
22
22
|
label: "",
|
|
23
23
|
value: ""
|
|
24
24
|
};
|
|
25
25
|
a.children ? a.children.push(s) : a.children = [s];
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
i.value = i.value.filter((s,
|
|
27
|
+
function u(a) {
|
|
28
|
+
i.value = i.value.filter((s, V) => V !== a);
|
|
29
29
|
}
|
|
30
30
|
return (a, s) => {
|
|
31
|
-
const
|
|
31
|
+
const V = J("EOptionItem");
|
|
32
32
|
return v(), N(n(Q), {
|
|
33
33
|
modelValue: n(i),
|
|
34
|
-
"onUpdate:modelValue": s[0] || (s[0] = (
|
|
34
|
+
"onUpdate:modelValue": s[0] || (s[0] = (t) => O(i) ? i.value = t : null),
|
|
35
35
|
"item-key": "id",
|
|
36
36
|
"component-data": {
|
|
37
37
|
type: "transition-group"
|
|
@@ -40,7 +40,7 @@ const ee = {
|
|
|
40
40
|
handle: ".handle",
|
|
41
41
|
animation: 200
|
|
42
42
|
}, {
|
|
43
|
-
item: A(({ element:
|
|
43
|
+
item: A(({ element: t, index: f }) => [
|
|
44
44
|
p("div", null, [
|
|
45
45
|
p("div", {
|
|
46
46
|
class: D([n(c) ? "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"])
|
|
@@ -49,36 +49,36 @@ const ee = {
|
|
|
49
49
|
class: "mr-2 cursor-move handle",
|
|
50
50
|
name: "icon--epic--drag"
|
|
51
51
|
}),
|
|
52
|
-
d(n(
|
|
53
|
-
modelValue:
|
|
54
|
-
"onUpdate:modelValue": (o) =>
|
|
55
|
-
value:
|
|
56
|
-
"onUpdate:value": (o) =>
|
|
52
|
+
d(n(x), {
|
|
53
|
+
modelValue: t.label,
|
|
54
|
+
"onUpdate:modelValue": (o) => t.label = o,
|
|
55
|
+
value: t.label,
|
|
56
|
+
"onUpdate:value": (o) => t.label = o,
|
|
57
57
|
placeholder: "label"
|
|
58
58
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
59
|
-
d(n(
|
|
60
|
-
modelValue:
|
|
61
|
-
"onUpdate:modelValue": (o) =>
|
|
62
|
-
value:
|
|
63
|
-
"onUpdate:value": (o) =>
|
|
59
|
+
d(n(x), {
|
|
60
|
+
modelValue: t.value,
|
|
61
|
+
"onUpdate:modelValue": (o) => t.value = o,
|
|
62
|
+
value: t.value,
|
|
63
|
+
"onUpdate:value": (o) => t.value = o,
|
|
64
64
|
placeholder: "value"
|
|
65
65
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
66
66
|
n(c) ? (v(), N(n(E), {
|
|
67
67
|
key: 0,
|
|
68
68
|
class: "cursor-pointer text-lg!",
|
|
69
69
|
name: "icon--epic--add-rounded",
|
|
70
|
-
onClick: (o) =>
|
|
70
|
+
onClick: (o) => b(t)
|
|
71
71
|
}, null, 8, ["onClick"])) : $("", !0),
|
|
72
72
|
d(n(E), {
|
|
73
73
|
class: "hover:text-red cursor-pointer",
|
|
74
74
|
name: "icon--epic--delete-outline-rounded",
|
|
75
|
-
onClick: (o) =>
|
|
75
|
+
onClick: (o) => u(f)
|
|
76
76
|
}, null, 8, ["onClick"])
|
|
77
77
|
], 2),
|
|
78
|
-
|
|
79
|
-
d(
|
|
80
|
-
modelValue:
|
|
81
|
-
"onUpdate:modelValue": (o) =>
|
|
78
|
+
t.children ? (v(), g("div", ee, [
|
|
79
|
+
d(V, {
|
|
80
|
+
modelValue: t.children,
|
|
81
|
+
"onUpdate:modelValue": (o) => t.children = o
|
|
82
82
|
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
83
83
|
])) : $("", !0)
|
|
84
84
|
])
|
|
@@ -87,7 +87,7 @@ const ee = {
|
|
|
87
87
|
}, 8, ["modelValue"]);
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
}),
|
|
90
|
+
}), te = { class: "" }, ae = { class: "epic-tabs-box" }, ne = ["title", "onClick"], oe = { key: 0 }, ue = { class: "py-4 my-2 text-center text-gray-400 bg-white" }, re = { key: 1 }, ie = /* @__PURE__ */ B({
|
|
91
91
|
__name: "index",
|
|
92
92
|
props: {
|
|
93
93
|
tree: { type: Boolean },
|
|
@@ -97,25 +97,25 @@ const ee = {
|
|
|
97
97
|
},
|
|
98
98
|
emits: ["update:modelValue", "update:EOptionsEditor"],
|
|
99
99
|
setup(k, { emit: C }) {
|
|
100
|
-
const U =
|
|
100
|
+
const U = y.getComponent("button"), x = y.getComponent("select"), c = z([]), h = w({
|
|
101
101
|
title: "静态"
|
|
102
|
-
}), i = k,
|
|
103
|
-
W.on("updateSource", (
|
|
104
|
-
c.value =
|
|
102
|
+
}), i = k, b = C;
|
|
103
|
+
W.on("updateSource", (l) => {
|
|
104
|
+
c.value = y.sourceData.map((e) => ({
|
|
105
105
|
...e,
|
|
106
106
|
label: e.apiName,
|
|
107
107
|
value: e.id
|
|
108
|
-
})),
|
|
108
|
+
})), f(a.value);
|
|
109
109
|
}), K(() => {
|
|
110
|
-
c.value =
|
|
111
|
-
...
|
|
112
|
-
label:
|
|
113
|
-
value:
|
|
114
|
-
}));
|
|
110
|
+
c.value = y.sourceData.map((l) => ({
|
|
111
|
+
...l,
|
|
112
|
+
label: l.apiName,
|
|
113
|
+
value: l.id
|
|
114
|
+
})), f(a.value);
|
|
115
115
|
});
|
|
116
|
-
const
|
|
117
|
-
function s(
|
|
118
|
-
return
|
|
116
|
+
const u = I(i, "modelValue", b), a = I(i, "dynamicId", b);
|
|
117
|
+
function s(l) {
|
|
118
|
+
return l && Object.prototype.toString.call(l) === "[object Array]" ? l : (Y.info("请检查数据位置是否配置准确"), []);
|
|
119
119
|
}
|
|
120
120
|
L(
|
|
121
121
|
() => a.value,
|
|
@@ -126,7 +126,7 @@ const ee = {
|
|
|
126
126
|
immediate: !0
|
|
127
127
|
}
|
|
128
128
|
);
|
|
129
|
-
const
|
|
129
|
+
const V = [
|
|
130
130
|
{
|
|
131
131
|
title: "静态"
|
|
132
132
|
},
|
|
@@ -134,11 +134,11 @@ const ee = {
|
|
|
134
134
|
title: "动态"
|
|
135
135
|
}
|
|
136
136
|
];
|
|
137
|
-
async function l
|
|
138
|
-
h.title =
|
|
137
|
+
async function t(l) {
|
|
138
|
+
h.title = l.title, l.title === "静态" && (a.value = "");
|
|
139
139
|
}
|
|
140
|
-
async function
|
|
141
|
-
const e = c.value.find((m) => m.id ===
|
|
140
|
+
async function f(l) {
|
|
141
|
+
const e = c.value.find((m) => m.id === l);
|
|
142
142
|
if (e && e.url) {
|
|
143
143
|
let m = await X({
|
|
144
144
|
method: (e == null ? void 0 : e.method) || "get",
|
|
@@ -149,45 +149,45 @@ const ee = {
|
|
|
149
149
|
headers: e != null && e.header ? JSON.parse(e == null ? void 0 : e.header) : {}
|
|
150
150
|
});
|
|
151
151
|
if (e && (e != null && e.dataPath)) {
|
|
152
|
-
const S = e.dataPath.split(".").reduce((
|
|
153
|
-
|
|
154
|
-
label:
|
|
155
|
-
value:
|
|
152
|
+
const S = e.dataPath.split(".").reduce((_, M) => _[M], m.data);
|
|
153
|
+
u.value = s(S).map((_) => ({
|
|
154
|
+
label: _[e.dataKey],
|
|
155
|
+
value: _[e.dataValue]
|
|
156
156
|
}));
|
|
157
157
|
} else
|
|
158
|
-
|
|
159
|
-
label:
|
|
160
|
-
value:
|
|
158
|
+
u.value = s(m.data).map((r) => ({
|
|
159
|
+
label: r[e.dataKey],
|
|
160
|
+
value: r[e.dataValue]
|
|
161
161
|
}));
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
164
|
i.modelValue, P("tree", i.tree);
|
|
165
165
|
function o() {
|
|
166
|
-
const
|
|
166
|
+
const l = w({
|
|
167
167
|
label: "",
|
|
168
168
|
value: ""
|
|
169
169
|
});
|
|
170
|
-
|
|
170
|
+
u.value.length ? u.value = [...u.value, l] : u.value = [l];
|
|
171
171
|
}
|
|
172
|
-
return (
|
|
172
|
+
return (l, e) => {
|
|
173
173
|
var m;
|
|
174
|
-
return v(),
|
|
174
|
+
return v(), g("div", te, [
|
|
175
175
|
p("div", null, [
|
|
176
176
|
p("div", ae, [
|
|
177
|
-
(v(),
|
|
178
|
-
class: D(["epic-tab cursor-pointer truncate", { checked: h.title ===
|
|
177
|
+
(v(), g(R, null, T(V, (r, S) => p("div", {
|
|
178
|
+
class: D(["epic-tab cursor-pointer truncate", { checked: h.title === r.title }]),
|
|
179
179
|
key: S,
|
|
180
|
-
title:
|
|
181
|
-
onClick: (
|
|
182
|
-
}, F(
|
|
180
|
+
title: r.title,
|
|
181
|
+
onClick: (_) => t(r)
|
|
182
|
+
}, F(r.title), 11, ne)), 64))
|
|
183
183
|
]),
|
|
184
|
-
h.title === "静态" ? (v(),
|
|
185
|
-
q(p("div",
|
|
186
|
-
[G, !((m = n(
|
|
184
|
+
h.title === "静态" ? (v(), g("div", oe, [
|
|
185
|
+
q(p("div", ue, "暂无选项", 512), [
|
|
186
|
+
[G, !((m = n(u)) != null && m.length)]
|
|
187
187
|
]),
|
|
188
|
-
d(
|
|
189
|
-
modelValue: n(
|
|
190
|
-
"onUpdate:modelValue": e[0] || (e[0] = (
|
|
188
|
+
d(le, {
|
|
189
|
+
modelValue: n(u),
|
|
190
|
+
"onUpdate:modelValue": e[0] || (e[0] = (r) => O(u) ? u.value = r : null)
|
|
191
191
|
}, null, 8, ["modelValue"]),
|
|
192
192
|
d(n(U), { onClick: o }, {
|
|
193
193
|
default: A(() => e[2] || (e[2] = [
|
|
@@ -195,22 +195,22 @@ const ee = {
|
|
|
195
195
|
])),
|
|
196
196
|
_: 1
|
|
197
197
|
})
|
|
198
|
-
])) : (v(),
|
|
198
|
+
])) : (v(), g("div", re, [
|
|
199
199
|
e[3] || (e[3] = p("span", { style: { "font-size": "12px", "margin-bottom": "8px", display: "inline-block" } }, "数据源", -1)),
|
|
200
|
-
d(n(
|
|
200
|
+
d(n(x), {
|
|
201
201
|
modelValue: n(a),
|
|
202
|
-
"onUpdate:modelValue": e[1] || (e[1] = (
|
|
202
|
+
"onUpdate:modelValue": e[1] || (e[1] = (r) => O(a) ? a.value = r : null),
|
|
203
203
|
placeholder: "请选择数据源",
|
|
204
204
|
clearable: "",
|
|
205
205
|
options: c.value,
|
|
206
|
-
onChange:
|
|
206
|
+
onChange: f
|
|
207
207
|
}, null, 8, ["modelValue", "options"])
|
|
208
208
|
]))
|
|
209
209
|
])
|
|
210
210
|
]);
|
|
211
211
|
};
|
|
212
212
|
}
|
|
213
|
-
}),
|
|
213
|
+
}), Ve = /* @__PURE__ */ Z(ie, [["__scopeId", "data-v-7e189094"]]);
|
|
214
214
|
export {
|
|
215
|
-
|
|
215
|
+
Ve as default
|
|
216
216
|
};
|
|
@@ -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-CI-wApqh.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;
|