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
package/dist/index-CqdmlJ1d.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),C=require("./index-BUkdmwKe.cjs"),x=require("./axios-CYGTE3lR.cjs"),b=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),S=require("./vuedraggable.umd-BqhSJIAi.cjs"),$=require("./tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs"),w={class:"epic-event-info"},M=["title"],O={class:"epic-event-btn text-lg flex items-center text-$epic-text-secondary"},A={class:"epic-action-editor-main"},U={class:"epic-editor-item rounded"},D={class:"w-36px flex items-center text-lg"},j={class:"flex-1"},L={key:0},K={key:1},R={key:2},T={class:"epic-action-box text-lg text-$epic-text-medium"},q=["onClick"],F=["onClick"],z=e.defineComponent({__name:"EActionEditorItem",props:{itemEvents:{type:Array,default:()=>[]},allEvents:{type:Array,default:()=>[]},modelValue:{type:Object,default:()=>[]},events:{type:Object,default:()=>({})}},emits:["add","edit","update:modelValue"],setup(E,{emit:V}){const m=E,h=V,v=e.inject("pageSchema");function y(p){h("add",p)}function f(p){return C.findSchemaById(v.schemas,p).label}function u(p,i){var t;const a=o(i);a[i]=m.events[i].filter((k,N)=>p!==N),(t=a[i])!=null&&t.length||delete a[i],h("update:modelValue",a)}function r(p,i,a){h("edit",p,i,a)}function o(p){const i={};return m.allEvents.forEach(a=>{if(!m.events[a.type].length||a.type===p)return!1;i[a.type]=m.events[a.type]}),i}return(p,i)=>(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.itemEvents,a=>(e.openBlock(),e.createElementBlock("div",{key:a.type,class:"epic-event-item"},[e.createElementVNode("div",w,[e.createElementVNode("div",{class:"epic-event-label",title:a.describe},e.toDisplayString(a.describe),9,M),e.createElementVNode("div",O,[e.createVNode(e.unref(b._sfc_main),{name:"icon--epic--add-rounded",onClick:t=>y(a.type)},null,8,["onClick"])])]),e.createElementVNode("div",A,[e.createVNode(e.unref(S.draggable),{modelValue:m.events[a.type],"onUpdate:modelValue":t=>m.events[a.type]=t,"item-key":"id","component-data":{type:"transition-group"},group:"option-list",handle:".handle",animation:200},{item:e.withCtx(({element:t,index:k})=>[e.createElementVNode("div",U,[e.createElementVNode("div",D,[e.createVNode(e.unref(b._sfc_main),{class:"mr-2 text-lg cursor-move handle text-$epic-text-medium",name:"icon--epic--drag"})]),e.createElementVNode("div",j,[t.type==="component"?(e.openBlock(),e.createElementBlock("div",L,e.toDisplayString(f(t.componentId)),1)):t.type==="custom"?(e.openBlock(),e.createElementBlock("div",K," 自定义函数 ")):t.type==="public"?(e.openBlock(),e.createElementBlock("div",R," 公共函数 ")):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.methodName),1)]),e.createElementVNode("div",T,[e.createElementVNode("div",{class:"epic-edit-btn",onClick:N=>r(k,a.type,t)},[e.createVNode(e.unref(b._sfc_main),{name:"icon--epic--page-info-outline-rounded"})],8,q),e.createElementVNode("div",{class:"epic-del-btn",onClick:N=>u(k,a.type)},[e.createVNode(e.unref(b._sfc_main),{name:"icon--epic--delete-outline-rounded"})],8,F)])])]),_:2},1032,["modelValue","onUpdate:modelValue"])])]))),128))}}),J={class:"h-full flex flex-col"},P=e.defineComponent({__name:"EScriptEdit",setup(E){const V=x.pluginManager.getComponent("monacoEditor"),m={theme:"vs-light",selectOnLineNumbers:!0,minimap:{enabled:!1}},h=e.ref(null),v=e.inject("pageSchema");return(y,f)=>(e.openBlock(),e.createElementBlock("div",J,[f[1]||(f[1]=e.createElementVNode("div",{class:"pb-2"}," 自定义函数编辑 ",-1)),e.createVNode(e.unref(V),{ref_key:"monacoEditorRef",ref:h,autoToggleTheme:"",modelValue:e.unref(v).script,"onUpdate:modelValue":f[0]||(f[0]=u=>e.unref(v).script=u),class:"epic-editor flex-1",config:m,language:"javascript"},null,8,["modelValue"])]))}}),G={class:"epic-attribute-view"},H=["title"],Q={class:"epic-attr-input"},W=e.defineComponent({__name:"EArgsEditor",props:{modelValue:{},actionArgsConfigs:{}},emits:["update:modelValue"],setup(E,{emit:V}){const m=E,h=V,v=e.computed(()=>m.modelValue?JSON.parse(m.modelValue):[]);function y(u){var r;return typeof u.show=="boolean"?u.show:typeof u.show=="function"?(r=u.show)==null?void 0:r.call(u,{values:v.value}):!0}function f(u,r){const o=[...JSON.parse(m.modelValue??"[]")];o[r]=u,h("update:modelValue",JSON.stringify(o))}return(u,r)=>(e.openBlock(),e.createElementBlock("div",G,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.actionArgsConfigs,o=>(e.openBlock(),e.createElementBlock("div",{key:o.field+o.type},[e.withDirectives(e.createElementVNode("div",{class:e.normalizeClass(["epic-attr-item",o.layout])},[e.createElementVNode("div",{class:"epic-attr-label",title:o.label},e.toDisplayString(o.label),9,H),e.createElementVNode("div",Q,[e.createVNode(e.unref(C._sfc_main),{componentSchema:{...o,componentProps:{...o.componentProps,input:!1,field:void 0,hidden:!1},show:!0,noFormItem:!0},"model-value":v.value[o.field],"onUpdate:modelValue":p=>f(p,o.field)},null,8,["componentSchema","model-value","onUpdate:modelValue"])])],2),[[e.vShow,y(o)]])]))),128))]))}}),X={class:"rounded epic-modal-action-main"},Y={class:"epic-modal-left-panel h-full flex flex-col"},Z={class:"flex flex-1 h-0 flex-col"},ee={class:"flex-1 h-0"},te={class:"epic-action-select h-30/100 flex flex-col"},ne={class:"flex-1 overflow-auto pr-8px"},oe=["onClick"],le={class:"text-center pt-42px text-gray-400"},ae={class:"epic-modal-right-panel"},ce={key:1,class:"text-center pt-42px text-gray-400"},se=e.defineComponent({__name:"EActionModal",emits:["add","edit"],setup(E,{expose:V,emit:m}){const h=x.pluginManager.getComponent("modal"),v=e.ref(!0),y=e.inject("pageSchema"),f=e.inject("pageManager",{}),u=e.ref(!1),r=e.ref([]),o=e.ref(null),p=m,i=e.computed(()=>{var l;return t.actionItem.type==="component"?o.value?(l=x.pluginManager.getComponentConfings()[o.value.type].config.action)==null?void 0:l.map(n=>({label:n.describe,value:n.type})):[]:t.actionItem.type==="custom"?Object.entries(f.funcs.value).filter(([n,_])=>typeof _=="function").map(([n])=>({label:n,value:n})):t.actionItem.type==="public"?Object.entries(x.pluginManager.publicMethods).map(([n])=>({label:n,value:n})):[]}),a=e.computed(()=>{if(t.actionItem.type==="component"&&o.value){const l=x.pluginManager.getComponentConfings()[o.value.type].config.action,n=l==null?void 0:l.find(_=>_.type===t.actionItem.methodName);if(n!=null&&n.argsConfigs){const _=n.argsConfigs.findIndex(g=>g.label==="设置数据");_!==-1&&(n.argsConfigs[_]={...o.value,label:"设置数据",field:"0",id:C.getUUID()})}return(n==null?void 0:n.argsConfigs)??[]}return[]}),t=e.reactive({actionItem:{type:"custom",methodName:"test",componentId:null},cacheData:{}});function k(){var l;u.value=!0,v.value=!0,t.actionItem.type="custom",t.actionItem.componentId=null,(l=i.value)!=null&&l.length&&d(i.value[0].value)}function N(l){if(u.value=!0,v.value=!1,o.value=null,l.componentId){const n=C.findSchemaById(y.schemas,l.componentId);o.value=n,r.value=[l.componentId]}e.nextTick(()=>{t.actionItem.componentId=l.componentId,t.actionItem.methodName=l.methodName,t.actionItem.type=l.type,t.actionItem.args=l.args})}function B(){if(!t.actionItem.methodName){alert("请先选择动作方法");return}p(v.value?"add":"edit",C.deepClone(e.toRaw(t.actionItem))),I()}function I(){u.value=!1,r.value=[],t.cacheData={}}function s(l){var n;t.actionItem.componentId=null,t.actionItem.type=l,o.value=null,t.actionItem.methodName=null,r.value=[],(n=i.value)!=null&&n.length&&d(i.value[0].value)}function c(l){var n;t.actionItem.args&&(t.cacheData[t.actionItem.componentId+t.actionItem.methodName]=t.actionItem.args),t.actionItem.componentId=l.id,t.actionItem.type="component",t.actionItem.methodName=null,o.value=l.componentSchema,(n=i.value)!=null&&n.length&&d(i.value[0].value)}function d(l){t.actionItem.methodName=l,t.actionItem.args=t.cacheData[t.actionItem.componentId+t.actionItem.methodName]}return V({handleOpen:k,handleOpenEdit:N}),(l,n)=>(e.openBlock(),e.createBlock(e.unref(h),{modelValue:u.value,"onUpdate:modelValue":n[4]||(n[4]=_=>u.value=_),class:"w-1200px",width:"1200px",onClose:I,onOk:B,title:"动作配置"},{default:e.withCtx(()=>{var _;return[e.createElementVNode("div",X,[e.createElementVNode("div",Y,[e.createElementVNode("div",Z,[e.createElementVNode("div",{class:e.normalizeClass(["fun-btn",{checked:t.actionItem.type==="custom"}]),onClick:n[0]||(n[0]=g=>s("custom"))}," 自定义函数 ",2),e.createElementVNode("div",{class:e.normalizeClass(["fun-btn",{checked:t.actionItem.type==="public"}]),onClick:n[1]||(n[1]=g=>s("public"))}," 公共函数 ",2),n[5]||(n[5]=e.createTextVNode(" 组件 ")),e.createElementVNode("div",ee,[e.createVNode(e.unref($._sfc_main),{selectedKeys:r.value,"onUpdate:selectedKeys":n[2]||(n[2]=g=>r.value=g),options:e.unref(y).schemas,onNodeClick:c},null,8,["selectedKeys","options"])])]),e.createElementVNode("div",te,[n[6]||(n[6]=e.createElementVNode("div",{class:"mb-2"},"动作选择",-1)),e.createElementVNode("div",ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,g=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass([{checked:g.value===t.actionItem.methodName},"epic-action-item"]),onClick:de=>d(g.value),key:g.value},[e.createElementVNode("span",null,e.toDisplayString(g.label),1)],10,oe))),128)),e.withDirectives(e.createElementVNode("div",le," 当前组件暂无动作 ",512),[[e.vShow,!((_=i.value)!=null&&_.length)]])])])]),e.createElementVNode("div",ae,[t.actionItem.type==="custom"?(e.openBlock(),e.createBlock(P,{key:0})):a.value.length===0?(e.openBlock(),e.createElementBlock("div",ce," 暂无配置 ")):(e.openBlock(),e.createBlock(W,{key:2,modelValue:t.actionItem.args,"onUpdate:modelValue":n[3]||(n[3]=g=>t.actionItem.args=g),actionArgsConfigs:a.value},null,8,["modelValue","actionArgsConfigs"]))])])]}),_:1},8,["modelValue"]))}}),ie=e.defineComponent({__name:"index",props:{eventList:{type:Array,default:()=>[]},modelValue:{type:Object}},emits:["update:modelValue"],setup(E,{emit:V}){const m=x.pluginManager.getComponent("Collapse"),h=x.pluginManager.getComponent("CollapseItem"),v=e.ref(null);let y=0;const f=E,u=V,r=e.computed({get(){return f.modelValue},set(s){u("update:modelValue",s)}}),o=e.ref([]),p=e.computed(()=>f.eventList.filter(s=>s.events.length)),i=e.computed(()=>f.eventList.map(s=>s.events).flat()),a=e.ref({});i.value.forEach(s=>{a.value[s.type]=e.computed({get(){var c;return((c=r.value)==null?void 0:c[s.type])??[]},set(c){c&&c.length?r.value[s.type]=c.map(d=>e.toRaw(d)):delete r.value[s.type]}})}),e.watch(()=>p.value,s=>{s.length&&(o.value=s.filter(c=>{for(let d=0;d<c.events.length;d++){const l=c.events[d].type;if(a.value[l].length)return!0}return!1}).map(c=>c.title))},{immediate:!0});let t="";function k(s){var c;(c=v.value)==null||c.handleOpen(),t=s}function N(s,c,d){var l;(l=v.value)==null||l.handleOpenEdit(d),y=s,t=c}function B(s){a.value[t][y]=s,r.value[t]=[...a.value[t]??[]]}function I(s){if(!r.value){r.value={[t]:[...a.value[t]??[],s]};return}r.value[t]=[...a.value[t]??[],s]}return(s,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createVNode(e.unref(m),{modelValue:o.value,"onUpdate:modelValue":c[1]||(c[1]=d=>o.value=d),activeKey:o.value,"onUpdate:activeKey":c[2]||(c[2]=d=>o.value=d),"expanded-names":o.value,"onUpdate:expandedNames":c[3]||(c[3]=d=>o.value=d)},{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(p.value,d=>(e.openBlock(),e.createBlock(e.unref(h),{key:d.title,title:d.title,header:d.title,name:d.title},{default:e.withCtx(()=>[e.createVNode(z,{modelValue:r.value,"onUpdate:modelValue":c[0]||(c[0]=l=>r.value=l),"item-events":d.events,"all-events":i.value,events:a.value,onAdd:k,onEdit:N},null,8,["modelValue","item-events","all-events","events"])]),_:2},1032,["title","header","name"]))),128))]),_:1},8,["modelValue","activeKey","expanded-names"]),e.createVNode(se,{ref_key:"EActionModalRef",ref:v,onAdd:I,onEdit:B},null,512)],64))}});exports.default=ie;
|
package/dist/index-DWW8LGvj.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { defineComponent as u, ref as p, inject as d, watch as f, toRaw as m, openBlock as g, createElementBlock as _, createVNode as h, unref as r } from "vue";
|
|
2
|
-
import { p as N } from "./axios-ITY6Uw7A.js";
|
|
3
|
-
import { o as y, d as k } from "./index-C5yhSYKA.js";
|
|
4
|
-
const E = { class: "epic-sound-code" }, R = /* @__PURE__ */ u({
|
|
5
|
-
__name: "index",
|
|
6
|
-
setup(O) {
|
|
7
|
-
const c = N.getComponent("monacoEditor"), a = p(null), t = d("designer"), s = d("designerProps");
|
|
8
|
-
let n = {};
|
|
9
|
-
f(() => t.state.checkedNode, (e) => {
|
|
10
|
-
var o;
|
|
11
|
-
y(n, m(e)) || (o = a.value) == null || o.setValue(JSON.stringify(e, null, 2));
|
|
12
|
-
}, {
|
|
13
|
-
deep: !0
|
|
14
|
-
});
|
|
15
|
-
const l = JSON.stringify(t.state.checkedNode, null, 2);
|
|
16
|
-
function i(e) {
|
|
17
|
-
try {
|
|
18
|
-
if (!t.state.checkedNode)
|
|
19
|
-
return !1;
|
|
20
|
-
n = JSON.parse(e), k(t.state.checkedNode, n);
|
|
21
|
-
} catch (o) {
|
|
22
|
-
console.warn("[epic-desinger:源码]异常:", o);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
return (e, o) => (g(), _("div", E, [
|
|
26
|
-
h(r(c), {
|
|
27
|
-
ref_key: "monacoEditorRef",
|
|
28
|
-
ref: a,
|
|
29
|
-
autoToggleTheme: "",
|
|
30
|
-
class: "epic-editor",
|
|
31
|
-
readOnly: r(s).sourceCodeReadOnly,
|
|
32
|
-
"model-value": r(l),
|
|
33
|
-
lineNumbers: "off",
|
|
34
|
-
"onUpdate:modelValue": i
|
|
35
|
-
}, null, 8, ["readOnly", "model-value"])
|
|
36
|
-
]));
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
export {
|
|
40
|
-
R as default
|
|
41
|
-
};
|
package/dist/index-DZIjd60A.js
DELETED
package/dist/index-D_CH15dJ.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),H=require("./axios-CYGTE3lR.cjs"),C=require("./index-BUkdmwKe.cjs"),J=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),G=require("./vuedraggable.umd-BqhSJIAi.cjs"),ee={class:"epic-widget-action-item whitespace-nowrap"},te={key:0,class:"flex items-center"},ne=e.defineComponent({__name:"previewWidgets",setup(F,{expose:R}){const f=e.inject("pageManager",{}),k=e.inject("pageSchema"),s=e.inject("designer"),g=e.inject("designerProps"),c=e.inject("revoke"),p=e.ref(null),S=e.ref(null),x=e.ref(null),M=e.ref(!1),l=e.ref(!1),a=e.ref(!0),i=e.ref("top"),{canvasScale:r,disabledZoom:b}=C.useStore();let n=null;const L=e.computed(()=>{const t=s.state.checkedNode;return!(!(t!=null&&t.id)||g.value.lockDefaultSchemaEdit&&f.defaultComponentIds.value.includes(t==null?void 0:t.id))}),T=e.computed(()=>{var B,V,$,m,O,D;const t=f.componentInstances.value,u=(B=s.state.checkedNode)==null?void 0:B.id;if(($=(V=s.state.checkedNode)==null?void 0:V.componentProps)!=null&&$.hidden)return null;const _=H.pluginManager.getComponentConfingByType((m=s.state.checkedNode)==null?void 0:m.type)??null;if(!u||!(t!=null&&t[u]))return null;if(_!=null&&_.defaultSchema.input&&((O=s.state.checkedNode)==null?void 0:O.noFormItem)!==!0)return(D=t[u+"formItem"])==null?void 0:D.$el;const o=t[u];return!(o!=null&&o.$el)||(o==null?void 0:o.$el.nodeName)==="#text"||!(o!=null&&o.$el.getBoundingClientRect)?null:o==null?void 0:o.$el}),E=e.computed(()=>{var B,V,$,m;const t=f.componentInstances.value,u=(B=s.state.hoverNode)==null?void 0:B.id,_=H.pluginManager.getComponentConfingByType((V=s.state.hoverNode)==null?void 0:V.type)??null;if(!u||!(t!=null&&t[u]))return null;if(_!=null&&_.defaultSchema.input&&(($=s.state.hoverNode)==null?void 0:$.noFormItem)!==!0)return(m=t[u+"formItem"])==null?void 0:m.$el;const o=t[u];return(o==null?void 0:o.$el.nodeName)==="#text"?null:o==null?void 0:o.$el}),{mutationObserver:P,observerConfig:W}=Z(j),{startTimedQuery:d,stopTimedQuery:y}=C.useTimedQuery(j);e.watch(()=>T.value,t=>{if(t){M.value=!0,P.observe(t,W);const u=t.parentNode;u&&(u.ondragstart=()=>{a.value=!1,d()},u.ondragend=()=>{a.value=!0,y()}),j()}else M.value=!1});const{mutationObserver:v,observerConfig:w}=Z(q);e.watch(()=>E.value,t=>{t&&(v.observe(t,w),q())});let h=0;e.watch(()=>{var t;return(t=s.state.hoverNode)==null?void 0:t.id},t=>{if(t){l.value=!0,clearTimeout(h);return}h=setTimeout(()=>{l.value=!1},300)});let N=0,z=0;function j(){const t=T.value;if(!t||!n)return;const{top:u,left:_}=n==null?void 0:n.getBoundingClientRect(),{top:o,left:B,width:V,height:$}=t.getBoundingClientRect(),m=b.value?1:r.value,O=o-u+((n==null?void 0:n.scrollTop)??0)*m,D=B-_+((n==null?void 0:n.scrollLeft)??0)*m,I=$/m;p.value&&(p.value.style.width=`${V/m}px`,p.value.style.height=`${I}px`,p.value.style.top=`${O/m}px`,p.value.style.left=`${D/m}px`,A(O,D)),x.value&&(O<45&&I<100?(x.value.style.top="",x.value.style.bottom="-30px",x.value.style["border-radius"]="0px 0px 4px 4px",i.value="bottom"):O<45?(x.value.style.top="0px",x.value.style["border-radius"]="0px 0px 4px 0",i.value="center"):(x.value.style.top="-30px",x.value.style["border-radius"]="4px 4px 0px 0px",i.value="top"))}function A(t,u){const _=T.value;if(!n||!_)return;const o=n.getBoundingClientRect(),{width:B}=_.getBoundingClientRect(),V=b.value?1:r.value,$=t/V-o.top;let m=u/V-o.left+B/V;m<o.width&&(m=0);const O=n.scrollTop-o.height/3+60,D=n.scrollTop+o.height/3*2,I=n.scrollLeft-o.width+200,U=n.scrollLeft+o.width-200;Math.abs($-N)<10&&Math.abs(m-z)<10||(N=$,z=m,!($>O&&$<D&&m>I&&m<U)&&(n.scrollTop=$,n.scrollLeft=m))}function q(){var I,U;const t=E.value;if(!t)return;const{top:u,left:_}=(n==null?void 0:n.getBoundingClientRect())??{top:0,left:0},{top:o,left:B,width:V,height:$}=((I=t.getBoundingClientRect)==null?void 0:I.call(t))??((U=t.nextElementSibling)==null?void 0:U.getBoundingClientRect()),m=b.value?1:r.value,O=o-u+((n==null?void 0:n.scrollTop)??0)*m,D=B-_+((n==null?void 0:n.scrollLeft)??0)*m;S.value&&(S.value.style.width=`${V/m}px`,S.value.style.height=`${$/m}px`,S.value.style.top=`${O/m}px`,S.value.style.left=`${D/m}px`)}function Z(t){const u=window.MutationObserver,_={childList:!0,attributes:!0,subtree:!0};return{mutationObserver:new u(t),observerConfig:_}}function K(){var V;const t=C.findSchemaInfoById(k.schemas,((V=s.state.checkedNode)==null?void 0:V.id)??"root");if(!t)return!1;const{list:u,schema:_,index:o}=t,B=C.generateNewSchema(_);u.splice(o+1,0,B),s.setCheckedNode(B),c.push(k.schemas,"复制组件")}function X(){var B;const t=C.findSchemaInfoById(k.schemas,((B=s.state.checkedNode)==null?void 0:B.id)??"root");if(!t)return!1;let{list:u,schema:_,index:o}=t;u.splice(o,1),o===u.length&&o--,s.setCheckedNode(u[o]),c.push(k.schemas,"删除组件")}function Y(t){n=t,n==null||n.addEventListener("scroll",()=>{j()}),C.useResizeObserver(T,j),C.useResizeObserver(E,q)}return R({handleInit:Y}),(t,u)=>{var _,o,B,V,$;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives(e.createElementVNode("div",{ref_key:"selectorRef",ref:p,class:e.normalizeClass(["epic-checked-widget absolute pointer-events-none z-20",i.value+" "+(a.value?"transition-all":"")])},[e.createElementVNode("div",{class:"epic-widget-action-box",ref_key:"actionBoxRef",ref:x},[e.createElementVNode("div",ee,e.toDisplayString((o=e.unref(H.pluginManager).getComponentConfingByType(((_=e.unref(s).state.checkedNode)==null?void 0:_.type)??""))==null?void 0:o.defaultSchema.label),1),L.value?(e.openBlock(),e.createElementBlock("div",te,[e.createElementVNode("div",{title:"复制",class:"epic-widget-action-item pointer-events-auto",onClick:K},[e.createVNode(e.unref(J._sfc_main),{name:"icon--epic--copy-all-outline-rounded"})]),e.createElementVNode("div",{title:"删除",class:"epic-widget-action-item pointer-events-auto",onClick:X},[e.createVNode(e.unref(J._sfc_main),{name:"icon--epic--delete-outline-rounded"})])])):e.createCommentVNode("",!0)],512)],2),[[e.vShow,M.value&&((B=e.unref(s).state.checkedNode)==null?void 0:B.id)!=="root"]]),e.withDirectives(e.createElementVNode("div",{ref_key:"hoverWidgetRef",ref:S,class:"epic-hover-widget absolute transition-all pointer-events-none z-998"},null,512),[[e.vShow,l.value&&((V=e.unref(s).state.checkedNode)==null?void 0:V.id)!==(($=e.unref(s).state.hoverNode)==null?void 0:$.id)]])],64)}}}),oe=e.defineComponent({name:"EditNodeItem",__name:"editNodeItem",props:{schemas:{}},emits:["update:schemas"],setup(F,{emit:R}){const f=e.inject("designer"),k=e.inject("pageSchema"),s=e.inject("revoke"),g=F,c=R,p=e.computed({get(){return g.schemas},set(a){c("update:schemas",a)}});function S(a){f.setCheckedNode(p.value[a]),f.setDisableHover(!0)}function x(){f.setDisableHover(),s.push(k.schemas,"拖拽组件")}function M(){s.push(k.schemas,"插入组件")}function l(a){var i,r,b;return a.id===((i=k.schemas[0])==null?void 0:i.id)||(b=(r=H.pluginManager.getComponentConfingByType(a.type))==null?void 0:r.editConstraints)!=null&&b.immovable?"unmover-item":"draggable-item"}return(a,i)=>(e.openBlock(),e.createBlock(e.unref(G.draggable),e.mergeProps({modelValue:p.value,"onUpdate:modelValue":i[0]||(i[0]=r=>p.value=r),"item-key":"id","component-data":{type:"transition-group"},class:"epic-draggable-range"},{animation:200,group:"edit-draggable",handle:".draggable-item",ghostClass:"moveing"},{onStart:i[1]||(i[1]=r=>S(r.oldIndex)),onEnd:i[2]||(i[2]=r=>x()),onAdd:i[3]||(i[3]=r=>{S(r.newIndex),M()})}),{item:e.withCtx(({element:r,index:b})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["widget-box",l(r)]),key:b},[e.createVNode(Q,{schema:r},null,8,["schema"])],2))]),_:1},16,["modelValue"]))}}),Q=e.defineComponent({name:"ENodeItem",__name:"nodeItem",props:{schema:{},name:{}},setup(F){const R=e.useAttrs(),f=e.inject("designer"),k=e.inject("pageManager",{}),s=e.inject("pageSchema",{}),g=e.ref(null);e.provide("nodeAttrs",R);const c=F,p=e.computed(()=>{var b,n,L,T,E;const l=k.componentInstances.value,a=(b=c.schema)==null?void 0:b.id,i=H.pluginManager.getComponentConfingByType((n=c.schema)==null?void 0:n.type)??null;if(!a||!(l!=null&&l[a]))return null;if(i!=null&&i.defaultSchema.input&&((L=c.schema)==null?void 0:L.noFormItem)!==!0)return(T=l[a+"formItem"])==null?void 0:T.$el;const r=l[a];return((E=r==null?void 0:r.$el)==null?void 0:E.nodeName)==="#text"?null:r==null?void 0:r.$el});e.watch(()=>p.value,l=>{l==null||l.addEventListener("click",S,!1),l==null||l.addEventListener("mouseover",x,!1),l==null||l.addEventListener("mouseout",M,!1)}),e.onUnmounted(()=>{var l,a,i;(l=p.value)==null||l.removeEventListener("click",S,!1),(a=p.value)==null||a.removeEventListener("mouseover",x,!1),(i=p.value)==null||i.removeEventListener("mouseout",M,!1)});function S(l){l.stopPropagation(),f.setCheckedNode(c.schema)}function x(l){var a;c.schema.id!==((a=s.schemas[0])==null?void 0:a.id)&&(l.stopPropagation(),f.setHoverNode(c.schema))}function M(l){l.stopPropagation(),f.setHoverNode(null)}return(l,a)=>{var r,b;const i=e.resolveComponent("ENodeItem");return e.openBlock(),e.createBlock(e.unref(C._sfc_main),{ref_key:"nodeRef",ref:g,componentSchema:c.schema},e.createSlots({_:2},[(b=(r=e.unref(H.pluginManager).getComponentConfingByType(c.schema.type))==null?void 0:r.editConstraints)!=null&&b.childImmovable?{name:"edit-node",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.schema.children,n=>(e.openBlock(),e.createBlock(i,{key:n.id,schema:n},null,8,["schema"]))),128))]),key:"0"}:{name:"edit-node",fn:e.withCtx(()=>[c.schema.children?(e.openBlock(),e.createBlock(oe,{key:0,schemas:c.schema.children,"onUpdate:schemas":a[0]||(a[0]=n=>c.schema.children=n)},null,8,["schemas"])):e.createCommentVNode("",!0)]),key:"1"}]),1032,["componentSchema"])}}}),le={class:"min-w-750px rounded h-full"},ae=e.defineComponent({__name:"previewJson",setup(F,{expose:R}){const f=H.pluginManager.getComponent("modal"),k=H.pluginManager.getComponent("monacoEditor"),s={theme:"vs-light",selectOnLineNumbers:!0,minimap:{enabled:!1},readOnly:!0},g=e.ref(null),c=e.ref(!1),p=e.inject("pageSchema");function S(){c.value=!1}function x(){c.value=!0,g.value?g.value.setValue(JSON.stringify(p,null,2)):setTimeout(()=>{x()},300)}function M(l="epic-data.json"){const a=JSON.stringify(p,null,2);var i=`data:text/json;charset=utf-8,${encodeURIComponent(a)}`,r=document.createElement("a");r.setAttribute("href",i),r.setAttribute("download",l),r.click()}return R({handleOpen:x}),(l,a)=>(e.openBlock(),e.createBlock(e.unref(f),{modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=i=>c.value=i),title:"查看数据",class:"w-900px",width:"900px",onClose:S,onOk:M,okText:"导出数据"},{default:e.withCtx(()=>[e.createElementVNode("div",le,[e.createVNode(e.unref(k),{ref_key:"monacoEditorRef",ref:g,class:"editor h-full",autoToggleTheme:"",readOnly:"",config:s,language:"json"},null,512)])]),_:1},8,["modelValue"]))}}),re={class:"epic-edit-toolbar flex items-center justify-between px-2"},se={class:"flex-1 h-full flex items-center"},ie={key:0,class:"epic-divider"},ce=["title","onClick"],de={class:"flex-1 h-full flex items-center justify-end"},ue={key:0,class:"flex items-center ml-12px"},fe={class:"pr-8px w-82px cursor-pointer"},pe={class:"epic-device h-28px items-center gap-1 rounded-md border p-2px flex"},me=["title","onClick"],ve=e.defineComponent({__name:"toolbar",setup(F){const R=H.pluginManager.getComponent("select"),{canvasScale:f,disabledZoom:k}=C.useStore(),s=e.ref("pc"),g=e.inject("pageSchema"),c=e.inject("designer"),p=e.inject("revoke"),S=e.ref(null),x=[{icon:"icon--epic--computer-outline-rounded",title:"pc",key:"pc"},{icon:"icon--epic--tablet-android-outline-rounded",title:"平板",key:"pad"},{icon:"icon--epic--phone-iphone-outline-sharp",title:"手机",key:"mobile"}],M=e.computed(()=>[{icon:"icon--epic--code",title:"查看数据",on:()=>L()},{icon:"icon--epic--exit-to-app-rounded",title:"导入数据",on:T},{icon:"icon--epic--trash",title:"清空",on:n},{icon:"icon--epic--undo",title:"撤销",on:r,disabled:!p.recordList.value.length,divider:!0},{icon:"icon--epic--redo",title:"重做",on:b,disabled:!p.undoList.value.length}]),l=e.ref(null),a=e.computed({get(){return`${(f.value*100).toFixed(0)}%`},set(d){const y=parseFloat(d);f.value=y/100}}),i=[{label:"60%",value:"60%"},{label:"80%",value:"80%"},{label:"100%",value:"100%"},{label:"120%",value:"120%"},{label:"140%",value:"140%"}];function r(){const d=p.undo();d&&(C.deepCompareAndModify(g.schemas,d),c.setCheckedNode(g.schemas[0]))}function b(){const d=p.redo();d&&(C.deepCompareAndModify(g.schemas,d),c.setCheckedNode(g.schemas[0]))}function n(){c.reset()}function L(){S.value.handleOpen()}function T(){var d;(d=l.value)==null||d.click()}function E(d){var w;const y=(w=d.target.files)==null?void 0:w[0];if(!y)return;d.target.value=null;const v=new FileReader;v.readAsText(y),v.onload=h=>{var N;P((N=h.target)==null?void 0:N.result)}}function P(d){try{let y=JSON.parse(d??"");y.schemas||(y=C.convertKFormData(y)),C.deepCompareAndModify(g,y)}catch(y){console.error(y)}}function W(d){c.handleToggleDeviceMode(d),s.value=d;const y={pc:{},pad:{width:"780px",mode:d},mobile:{width:"390px",mode:d}};g.canvas=y[d]}return(d,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",re,[e.createElementVNode("div",se,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(M.value,(v,w)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:w},[v.divider?(e.openBlock(),e.createElementBlock("div",ie)):e.createCommentVNode("",!0),e.createElementVNode("div",{title:v.title,class:e.normalizeClass(["epic-action-item text-base h-90% px-10px flex items-center cursor-pointer",{disabled:v.disabled}]),onClick:v.on},[e.createVNode(e.unref(J._sfc_main),{name:v.icon},null,8,["name"])],10,ce)],64))),128))]),e.withDirectives(e.createElementVNode("input",{type:"file",ref_key:"fileRef",ref:l,accept:".json,.txt",onChange:E},null,544),[[e.vShow,!1]]),e.createElementVNode("div",de,[e.unref(k)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",ue,[e.createElementVNode("div",fe,[e.createVNode(e.unref(R),{value:a.value,"onUpdate:value":y[0]||(y[0]=v=>a.value=v),modelValue:a.value,"onUpdate:modelValue":y[1]||(y[1]=v=>a.value=v),options:i,size:"small"},null,8,["value","modelValue"])])])),e.createElementVNode("div",pe,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(x,v=>e.createElementVNode("div",{key:v.key,title:v.title,class:e.normalizeClass(["epic-device-item h-full px-1 flex items-center cursor-pointer text-base transition-colors rounded-sm",{checked:v.key===s.value}]),onClick:w=>W(v.key)},[e.createVNode(e.unref(J._sfc_main),{name:v.icon},null,8,["name"])],10,me)),64))])])]),e.createVNode(ae,{ref_key:"previewJson",ref:S},null,512)],64))}}),he={class:"h-full flex flex-col relative"},ge=["draggable"],xe=e.defineComponent({__name:"editScreenContainer",setup(F){const R=e.inject("pageSchema"),f=e.ref(null),k=e.ref(null),s=e.ref(null),{pressSpace:g,disabledZoom:c}=C.useStore(),{handleElementDragStart:p,handleElementDrag:S,handleElementDragEnd:x}=C.useElementDrag(f),{width:M,height:l}=C.useElementSize(f),{canvasScale:a,handleZoom:i}=C.useElementZoom(k);let r=0,b=0;const n=e.ref({}),L=e.ref({}),T=e.ref({}),E=e.shallowRef({width:0,height:0});e.watchEffect(W),e.watch(T,()=>{e.nextTick(P)});function P(){s.value&&(E.value={width:s.value.clientWidth,height:s.value.clientHeight})}function W(){var w,h;T.value={width:((w=R.canvas)==null?void 0:w.width)??"0",height:((h=R.canvas)==null?void 0:h.height)??"0"}}C.watchOnce(M,d),e.watch(E,d);function d(){let w=E.value.width||r,h=E.value.height||b;n.value={width:M.value+w+"px",height:l.value+h+"px"},L.value={width:w+"px",height:h+"px"},y()}function y(){e.nextTick(()=>{var j;let w=E.value.width||r;const N=(E.value.height||b)/2,z=w/2;(j=f.value)==null||j.scrollTo(z,N)})}C.useResizeObserver(f,v),C.useResizeObserver(k,v);function v(){var h;if(!f.value)return;const w=f.value.getBoundingClientRect();if(r=w.width-60,b=w.height-80,!c.value)if(E.value.width===0)a.value=1;else{const N=(r-20)/E.value.width,z=b/(E.value.height||((h=k.value)==null?void 0:h.clientHeight)||1),j=Math.abs(N-1)<Math.abs(z-1);let A=1;j?A=N:A=z,(N<1||z<1)&&(A=Math.min(N,z)),A<1.4&&A>.5&&(a.value=A)}C.debounce(d,50)()}return(w,h)=>(e.openBlock(),e.createElementBlock("div",he,[e.createVNode(ve),e.createElementVNode("div",{ref_key:"editScreenContainerRef",ref:f,class:e.normalizeClass(["flex-1 overflow-auto overflow-y-hidden epic-edit-screen-container",{"cursor-grab":e.unref(g)}]),draggable:e.unref(g),onWheel:h[0]||(h[0]=(...N)=>e.unref(i)&&e.unref(i)(...N)),onDragstart:h[1]||(h[1]=(...N)=>e.unref(p)&&e.unref(p)(...N)),onDragend:h[2]||(h[2]=(...N)=>e.unref(x)&&e.unref(x)(...N)),onDrag:h[3]||(h[3]=(...N)=>e.unref(S)&&e.unref(S)(...N))},[e.createElementVNode("div",{id:"canvasContainer",class:"flex items-center justify-center",style:e.normalizeStyle(n.value)},[e.createElementVNode("div",{ref_key:"draggableElRef",ref:k,class:"transition-all"},[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none":e.unref(g)}),style:e.normalizeStyle(L.value)},[e.renderSlot(w.$slots,"default")],6)],512)],4)],42,ge),e.createElementVNode("div",{ref_key:"sizeBoxRef",ref:s,class:"absolute top-0 pointer-events-none",style:e.normalizeStyle(T.value)},null,4)]))}}),ye={class:"epic-edit-canvas"},_e=e.defineComponent({__name:"index",setup(F){const R=e.ref(null),f=e.ref(null),k=e.inject("pageSchema"),s=e.computed(()=>k.schemas[0]),g=e.computed(()=>({width:"100%",height:"100%"}));return e.onMounted(()=>{var c;(c=f.value)==null||c.handleInit(R.value)}),(c,p)=>(e.openBlock(),e.createElementBlock("section",ye,[e.createVNode(xe,null,{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"epicEditRangeRef",ref:R,class:"epic-edit-range rounded-md overflow-auto relative",style:e.normalizeStyle(g.value)},[e.createVNode(Q,{schema:s.value},null,8,["schema"]),e.createVNode(ne,{ref_key:"ePreviewWidgetsRef",ref:f},null,512)],4)]),_:1})]))}});exports.default=_e;
|
package/dist/index-DskzasEn.js
DELETED
|
@@ -1,216 +0,0 @@
|
|
|
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 _, 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
|
-
import { d as Q } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
3
|
-
import { p as g, E as W, a as X } from "./axios-ITY6Uw7A.js";
|
|
4
|
-
import { _ as E } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
|
-
import { n as I } from "./index-C5yhSYKA.js";
|
|
6
|
-
import { ElMessage as Y } from "element-plus";
|
|
7
|
-
import { _ as Z } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
-
const ee = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "pl-4"
|
|
11
|
-
}, te = /* @__PURE__ */ B({
|
|
12
|
-
name: "EOptionItem",
|
|
13
|
-
__name: "optionItem",
|
|
14
|
-
props: {
|
|
15
|
-
modelValue: {}
|
|
16
|
-
},
|
|
17
|
-
emits: ["update:modelValue"],
|
|
18
|
-
setup(k, { emit: C }) {
|
|
19
|
-
const U = k, y = g.getComponent("input"), c = j("tree", !1), i = I(U, "modelValue", C);
|
|
20
|
-
function x(a) {
|
|
21
|
-
const s = {
|
|
22
|
-
label: "",
|
|
23
|
-
value: ""
|
|
24
|
-
};
|
|
25
|
-
a.children ? a.children.push(s) : a.children = [s];
|
|
26
|
-
}
|
|
27
|
-
function r(a) {
|
|
28
|
-
i.value = i.value.filter((s, f) => f !== a);
|
|
29
|
-
}
|
|
30
|
-
return (a, s) => {
|
|
31
|
-
const f = J("EOptionItem");
|
|
32
|
-
return v(), N(n(Q), {
|
|
33
|
-
modelValue: n(i),
|
|
34
|
-
"onUpdate:modelValue": s[0] || (s[0] = (l) => O(i) ? i.value = l : 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: l, index: b }) => [
|
|
44
|
-
p("div", null, [
|
|
45
|
-
p("div", {
|
|
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"])
|
|
47
|
-
}, [
|
|
48
|
-
d(n(E), {
|
|
49
|
-
class: "mr-2 cursor-move handle",
|
|
50
|
-
name: "icon--epic--drag"
|
|
51
|
-
}),
|
|
52
|
-
d(n(y), {
|
|
53
|
-
modelValue: l.label,
|
|
54
|
-
"onUpdate:modelValue": (o) => l.label = o,
|
|
55
|
-
value: l.label,
|
|
56
|
-
"onUpdate:value": (o) => l.label = o,
|
|
57
|
-
placeholder: "label"
|
|
58
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
59
|
-
d(n(y), {
|
|
60
|
-
modelValue: l.value,
|
|
61
|
-
"onUpdate:modelValue": (o) => l.value = o,
|
|
62
|
-
value: l.value,
|
|
63
|
-
"onUpdate:value": (o) => l.value = o,
|
|
64
|
-
placeholder: "value"
|
|
65
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
66
|
-
n(c) ? (v(), N(n(E), {
|
|
67
|
-
key: 0,
|
|
68
|
-
class: "cursor-pointer text-lg!",
|
|
69
|
-
name: "icon--epic--add-rounded",
|
|
70
|
-
onClick: (o) => x(l)
|
|
71
|
-
}, null, 8, ["onClick"])) : $("", !0),
|
|
72
|
-
d(n(E), {
|
|
73
|
-
class: "hover:text-red cursor-pointer",
|
|
74
|
-
name: "icon--epic--delete-outline-rounded",
|
|
75
|
-
onClick: (o) => r(b)
|
|
76
|
-
}, null, 8, ["onClick"])
|
|
77
|
-
], 2),
|
|
78
|
-
l.children ? (v(), _("div", ee, [
|
|
79
|
-
d(f, {
|
|
80
|
-
modelValue: l.children,
|
|
81
|
-
"onUpdate:modelValue": (o) => l.children = o
|
|
82
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
83
|
-
])) : $("", !0)
|
|
84
|
-
])
|
|
85
|
-
]),
|
|
86
|
-
_: 1
|
|
87
|
-
}, 8, ["modelValue"]);
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
}), le = { class: "" }, ae = { class: "epic-tabs-box" }, ne = ["title", "onClick"], oe = { key: 0 }, re = { class: "py-4 my-2 text-center text-gray-400 bg-white" }, ue = { 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(k, { emit: C }) {
|
|
100
|
-
const U = g.getComponent("button"), y = g.getComponent("select"), c = z([]), h = w({
|
|
101
|
-
title: "静态"
|
|
102
|
-
}), i = k, x = C;
|
|
103
|
-
W.on("updateSource", (t) => {
|
|
104
|
-
c.value = g.sourceData.map((e) => ({
|
|
105
|
-
...e,
|
|
106
|
-
label: e.apiName,
|
|
107
|
-
value: e.id
|
|
108
|
-
})), b(a.value);
|
|
109
|
-
}), K(() => {
|
|
110
|
-
c.value = g.sourceData.map((t) => ({
|
|
111
|
-
...t,
|
|
112
|
-
label: t.apiName,
|
|
113
|
-
value: t.id
|
|
114
|
-
}));
|
|
115
|
-
});
|
|
116
|
-
const r = I(i, "modelValue", x), a = I(i, "dynamicId", x);
|
|
117
|
-
function s(t) {
|
|
118
|
-
return t && Object.prototype.toString.call(t) === "[object Array]" ? t : (Y.info("请检查数据位置是否配置准确"), []);
|
|
119
|
-
}
|
|
120
|
-
L(
|
|
121
|
-
() => a.value,
|
|
122
|
-
async () => {
|
|
123
|
-
a.value ? h.title = "动态" : h.title = "静态";
|
|
124
|
-
},
|
|
125
|
-
{
|
|
126
|
-
immediate: !0
|
|
127
|
-
}
|
|
128
|
-
);
|
|
129
|
-
const f = [
|
|
130
|
-
{
|
|
131
|
-
title: "静态"
|
|
132
|
-
},
|
|
133
|
-
{
|
|
134
|
-
title: "动态"
|
|
135
|
-
}
|
|
136
|
-
];
|
|
137
|
-
async function l(t) {
|
|
138
|
-
h.title = t.title, t.title === "静态" && (a.value = "");
|
|
139
|
-
}
|
|
140
|
-
async function b(t) {
|
|
141
|
-
const e = c.value.find((m) => m.id === t);
|
|
142
|
-
if (e && e.url) {
|
|
143
|
-
let m = await X({
|
|
144
|
-
method: (e == null ? void 0 : e.method) || "get",
|
|
145
|
-
url: e.url,
|
|
146
|
-
// url: "http://localhost:3333/users",
|
|
147
|
-
params: e != null && e.params ? JSON.parse(e == null ? void 0 : e.params) : {},
|
|
148
|
-
data: e != null && e.data ? JSON.parse(e == null ? void 0 : e.data) : {},
|
|
149
|
-
headers: e != null && e.header ? JSON.parse(e == null ? void 0 : e.header) : {}
|
|
150
|
-
});
|
|
151
|
-
if (e && (e != null && e.dataPath)) {
|
|
152
|
-
const S = e.dataPath.split(".").reduce((V, M) => V[M], m.data);
|
|
153
|
-
r.value = s(S).map((V) => ({
|
|
154
|
-
label: V[e.dataKey],
|
|
155
|
-
value: V[e.dataValue]
|
|
156
|
-
}));
|
|
157
|
-
} else
|
|
158
|
-
r.value = s(m.data).map((u) => ({
|
|
159
|
-
label: u[e.dataKey],
|
|
160
|
-
value: u[e.dataValue]
|
|
161
|
-
}));
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
i.modelValue, P("tree", i.tree);
|
|
165
|
-
function o() {
|
|
166
|
-
const t = w({
|
|
167
|
-
label: "",
|
|
168
|
-
value: ""
|
|
169
|
-
});
|
|
170
|
-
r.value.length ? r.value = [...r.value, t] : r.value = [t];
|
|
171
|
-
}
|
|
172
|
-
return (t, e) => {
|
|
173
|
-
var m;
|
|
174
|
-
return v(), _("div", le, [
|
|
175
|
-
p("div", null, [
|
|
176
|
-
p("div", ae, [
|
|
177
|
-
(v(), _(R, null, T(f, (u, S) => p("div", {
|
|
178
|
-
class: D(["epic-tab cursor-pointer truncate", { checked: h.title === u.title }]),
|
|
179
|
-
key: S,
|
|
180
|
-
title: u.title,
|
|
181
|
-
onClick: (V) => l(u)
|
|
182
|
-
}, F(u.title), 11, ne)), 64))
|
|
183
|
-
]),
|
|
184
|
-
h.title === "静态" ? (v(), _("div", oe, [
|
|
185
|
-
q(p("div", re, "暂无选项", 512), [
|
|
186
|
-
[G, !((m = n(r)) != null && m.length)]
|
|
187
|
-
]),
|
|
188
|
-
d(te, {
|
|
189
|
-
modelValue: n(r),
|
|
190
|
-
"onUpdate:modelValue": e[0] || (e[0] = (u) => O(r) ? r.value = u : null)
|
|
191
|
-
}, null, 8, ["modelValue"]),
|
|
192
|
-
d(n(U), { onClick: o }, {
|
|
193
|
-
default: A(() => e[2] || (e[2] = [
|
|
194
|
-
H("添加选项")
|
|
195
|
-
])),
|
|
196
|
-
_: 1
|
|
197
|
-
})
|
|
198
|
-
])) : (v(), _("div", ue, [
|
|
199
|
-
e[3] || (e[3] = p("span", { style: { "font-size": "12px", "margin-bottom": "8px", display: "inline-block" } }, "数据源", -1)),
|
|
200
|
-
d(n(y), {
|
|
201
|
-
modelValue: n(a),
|
|
202
|
-
"onUpdate:modelValue": e[1] || (e[1] = (u) => O(a) ? a.value = u : null),
|
|
203
|
-
placeholder: "请选择数据源",
|
|
204
|
-
clearable: "",
|
|
205
|
-
options: c.value,
|
|
206
|
-
onChange: b
|
|
207
|
-
}, null, 8, ["modelValue", "options"])
|
|
208
|
-
]))
|
|
209
|
-
])
|
|
210
|
-
]);
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
}), fe = /* @__PURE__ */ Z(ie, [["__scopeId", "data-v-786f8c8a"]]);
|
|
214
|
-
export {
|
|
215
|
-
fe as default
|
|
216
|
-
};
|
package/dist/index-GJSr_nl7.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
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-BUkdmwKe.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,f=p.pluginManager.getComponent("input"),d=e.inject("tree",!1),s=k,i=C.useVModel(y,"modelValue",s);function _(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:g})=>[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(f),{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(f),{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=>_(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(g)},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"),f=p.pluginManager.getComponent("select"),d=e.ref([]),s=e.reactive({title:"静态"}),i=h,_=k;p.EventBus.on("updateSource",l=>{d.value=p.pluginManager.sourceData.map(t=>({...t,label:t.apiName,value:t.id})),g(a.value)}),e.onMounted(()=>{d.value=p.pluginManager.sourceData.map(l=>({...l,label:l.apiName,value:l.id}))});const r=C.useVModel(i,"modelValue",_),a=C.useVModel(i,"dynamicId",_);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 g(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((V,N)=>V[N],m.data);r.value=c(x).map(V=>({label:V[t.dataKey],value:V[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:V=>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(f),{modelValue:e.unref(a),"onUpdate:modelValue":t[1]||(t[1]=u=>e.isRef(a)?a.value=u:null),placeholder:"请选择数据源",clearable:"",options:d.value,onChange:g},null,8,["modelValue","options"])]))])])}}}),D=S._export_sfc(A,[["__scopeId","data-v-786f8c8a"]]);exports.default=D;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),_=require("./tree.vue_vue_type_script_setup_true_lang-RWTXU6lO.cjs"),f=require("./axios-CYGTE3lR.cjs"),m=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),v={class:"epic-outline"},y=["onMouseenter"],g={class:"max-w-full truncate"},h={class:"epic-node-type-text flex-1 w-0 truncate"},k=e.defineComponent({__name:"outline",setup(N){const n=e.inject("designer"),a=e.inject("pageSchema"),l=e.computed(()=>{var s;const o=(s=n.state.checkedNode)==null?void 0:s.id;return o?[o]:[]});function u(o){n.setCheckedNode(o.componentSchema)}return(o,s)=>{var i;return e.openBlock(),e.createElementBlock("div",v,[e.createVNode(e.unref(_._sfc_main),{options:e.unref(a).schemas,draggable:"","selected-keys":l.value,"hover-key":(i=e.unref(n).state.hoverNode)==null?void 0:i.id,onNodeClick:u},{"tree-node":e.withCtx(({schema:t})=>{var r,c,d;return[e.createElementVNode("div",{class:e.normalizeClass(["epic-text-padding flex",{hidden:(r=t.componentProps)==null?void 0:r.hidden}]),onMouseenter:e.withModifiers(p=>e.unref(n).setHoverNode(t),["stop"]),onMouseleave:s[0]||(s[0]=e.withModifiers(p=>e.unref(n).setHoverNode(null),["stop"]))},[e.createElementVNode("span",g,[(c=t.componentProps)!=null&&c.hidden?(e.openBlock(),e.createBlock(e.unref(m._sfc_main),{key:0,name:"icon--epic--visibility-off-outline-rounded",class:"translate-y-2px"})):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(t.label??((d=e.unref(f.pluginManager).getComponentConfingByType(t.type))==null?void 0:d.defaultSchema.label)),1)]),e.createElementVNode("span",h,e.toDisplayString(t.id),1)],42,y)]}),_:1},8,["options","selected-keys","hover-key"])])}}});exports.default=k;
|
package/dist/outline-yy4pIEi3.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { defineComponent as g, inject as l, computed as k, openBlock as p, createElementBlock as v, createVNode as N, unref as e, withCtx as x, createElementVNode as i, normalizeClass as C, withModifiers as m, createBlock as M, createCommentVNode as S, createTextVNode as b, toDisplayString as u } from "vue";
|
|
2
|
-
import { _ as w } from "./tree.vue_vue_type_script_setup_true_lang-uR4G8wa_.js";
|
|
3
|
-
import { p as B } from "./axios-ITY6Uw7A.js";
|
|
4
|
-
import { _ as V } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
|
-
const $ = { class: "epic-outline" }, E = ["onMouseenter"], H = { class: "max-w-full truncate" }, P = { class: "epic-node-type-text flex-1 w-0 truncate" }, q = /* @__PURE__ */ g({
|
|
6
|
-
__name: "outline",
|
|
7
|
-
setup(T) {
|
|
8
|
-
const o = l("designer"), _ = l("pageSchema"), f = k(() => {
|
|
9
|
-
var s;
|
|
10
|
-
const n = (s = o.state.checkedNode) == null ? void 0 : s.id;
|
|
11
|
-
return n ? [n] : [];
|
|
12
|
-
});
|
|
13
|
-
function h(n) {
|
|
14
|
-
o.setCheckedNode(n.componentSchema);
|
|
15
|
-
}
|
|
16
|
-
return (n, s) => {
|
|
17
|
-
var d;
|
|
18
|
-
return p(), v("div", $, [
|
|
19
|
-
N(e(w), {
|
|
20
|
-
options: e(_).schemas,
|
|
21
|
-
draggable: "",
|
|
22
|
-
"selected-keys": f.value,
|
|
23
|
-
"hover-key": (d = e(o).state.hoverNode) == null ? void 0 : d.id,
|
|
24
|
-
onNodeClick: h
|
|
25
|
-
}, {
|
|
26
|
-
"tree-node": x(({ schema: t }) => {
|
|
27
|
-
var c, a, r;
|
|
28
|
-
return [
|
|
29
|
-
i("div", {
|
|
30
|
-
class: C(["epic-text-padding flex", { hidden: (c = t.componentProps) == null ? void 0 : c.hidden }]),
|
|
31
|
-
onMouseenter: m((y) => e(o).setHoverNode(t), ["stop"]),
|
|
32
|
-
onMouseleave: s[0] || (s[0] = m((y) => e(o).setHoverNode(null), ["stop"]))
|
|
33
|
-
}, [
|
|
34
|
-
i("span", H, [
|
|
35
|
-
(a = t.componentProps) != null && a.hidden ? (p(), M(e(V), {
|
|
36
|
-
key: 0,
|
|
37
|
-
name: "icon--epic--visibility-off-outline-rounded",
|
|
38
|
-
class: "translate-y-2px"
|
|
39
|
-
})) : S("", !0),
|
|
40
|
-
b(" " + u(t.label ?? ((r = e(B).getComponentConfingByType(t.type)) == null ? void 0 : r.defaultSchema.label)), 1)
|
|
41
|
-
]),
|
|
42
|
-
i("span", P, u(t.id), 1)
|
|
43
|
-
], 42, E)
|
|
44
|
-
];
|
|
45
|
-
}),
|
|
46
|
-
_: 1
|
|
47
|
-
}, 8, ["options", "selected-keys", "hover-key"])
|
|
48
|
-
]);
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
export {
|
|
53
|
-
q as default
|
|
54
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),C=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),k=require("./axios-CYGTE3lR.cjs"),S=require("./vuedraggable.umd-BqhSJIAi.cjs"),_=e.defineComponent({name:"ETreeNodeItem",__name:"treeNodeItem",props:{schema:{}},setup(x){const a=x,u=e.inject("slots",{}),m=e.inject("pageSchema",{}),c=e.inject("expandedKeys"),v=e.inject("treeProps"),h=e.inject("selectedKeys"),i=e.inject("handleSelect"),g=e.computed(()=>c.value.includes(a.schema.id??"")),f=e.defineComponent({setup(){return()=>{var n;return e.h("span",{class:{text:!0,hover:v.hoverKey===a.schema.id,checked:h.value.includes(a.schema.id)},onClick:()=>i(a.schema.id,a.schema)},((n=u["tree-node"])==null?void 0:n.call(u,a))??e.h("span",{class:"epic-text-padding flex"},{default:()=>{var t;return[e.h("span",{class:"max-w-full truncate"},a.schema.label??((t=k.pluginManager.getComponentConfingByType(a.schema.type))==null?void 0:t.defaultSchema.label)),e.h("span",{class:"epic-node-type-text flex-1 w-0 truncate"},a.schema.id)]}}))}}});function o(){const n=a.schema.id;if(!n)return!1;c.value.includes(n)?c.value=c.value.filter(t=>t!==n):c.value.push(n)}function r(){var t;const n=a.schema.id;if(!n||!((t=a.schema.children)!=null&&t.length))return!1;c.value.push(n)}return r(),(n,t)=>{var l,d,p,s,y;return e.openBlock(),e.createElementBlock("li",{class:e.normalizeClass(["epic-tree-node",{expanded:(l=a.schema.children)==null?void 0:l.length,"level-1":a.schema.id===((d=e.unref(m).schemas[0])==null?void 0:d.id)}])},[e.createElementVNode("a",null,[(p=a.schema.children)!=null&&p.length&&a.schema.id!==((s=e.unref(m).schemas[0])==null?void 0:s.id)?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(["icon-expanded",{expanded:g.value}]),onClick:o},[e.createVNode(e.unref(C._sfc_main),{name:"icon--epic--caret-right-outlined"})],2)):e.createCommentVNode("",!0),e.createVNode(e.unref(f))]),(y=a.schema.children)!=null&&y.length?(e.openBlock(),e.createBlock(B,{key:0,class:e.normalizeClass(["epic-tree-sublist",{expanded:g.value}]),schemas:a.schema.children,"onUpdate:schemas":t[0]||(t[0]=b=>a.schema.children=b),parentSchema:a.schema},null,8,["class","schemas","parentSchema"])):e.createCommentVNode("",!0)],2)}}}),N={key:1},B=e.defineComponent({name:"ETreeNodes",__name:"treeNodes",props:{schemas:{},parentSchema:{}},emits:["update:schemas"],setup(x,{emit:a}){const u=e.inject("designer"),m=e.inject("pageSchema"),c=e.inject("treeProps"),v=x,h=a,i=e.computed({get(){return v.schemas},set(o){h("update:schemas",o)}});function g(o){u.setDisableHover(!0),u.setCheckedNode(i.value[o])}function f(o){var r,n,t;return o.id===((r=m.schemas[0])==null?void 0:r.id)||(t=(n=k.pluginManager.getComponentConfingByType(o.type))==null?void 0:n.editConstraints)!=null&&t.immovable?"unmover-item":"draggable-item"}return(o,r)=>{var n,t,l,d,p;return(l=(t=e.unref(k.pluginManager).getComponentConfingByType(((n=v.parentSchema)==null?void 0:n.type)||""))==null?void 0:t.editConstraints)!=null&&l.childImmovable?(e.openBlock(),e.createElementBlock("ul",N,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.value,s=>(e.openBlock(),e.createBlock(_,{key:s.id,schema:s},null,8,["schema"]))),128))])):(e.openBlock(),e.createBlock(e.unref(S.draggable),e.mergeProps({key:0,modelValue:i.value,"onUpdate:modelValue":r[0]||(r[0]=s=>i.value=s),"item-key":"id","component-data":{},class:"epic-draggable-range"},{animation:200,tag:"ul",group:"tree-draggable",ghostClass:"moveing",draggable:".draggable-item",disabled:!e.unref(c).draggable||((d=i.value[0])==null?void 0:d.id)===((p=e.unref(m).schemas[0])==null?void 0:p.id)},{onStart:r[1]||(r[1]=s=>g(s.oldIndex))}),{item:e.withCtx(({element:s,index:y})=>[(e.openBlock(),e.createBlock(_,{class:e.normalizeClass(f(s)),key:s.id,schema:s},null,8,["class","schema"]))]),_:1},16,["modelValue"]))}}}),V={class:"epic-tree h-full flex flex-col"},E={class:"epic-search-box px-10px py-6px"},K={class:"epic-tree-main flex-1 overflow-auto h-0"},T={class:"text-center pt-42px text-gray-400"},j=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:a}){const u=e.useSlots();e.provide("slots",u);const m=k.pluginManager.getComponent("input"),c=e.ref(""),v=e.ref([]),h=x,i=a,g=e.computed({get(){return h.selectedKeys},set(n){i("update:selectedKeys",n)}}),f=e.computed({get(){return o(h.options,c.value)},set(n){console.log(n)}});function o(n,t){const l=[];return n.forEach(d=>{var p;if((p=d.label)!=null&&p.includes(t))l.push(d);else if(d.children){const s=o(d.children,t);if(s.length>0){const y={...d};y.children=s,l.push(y)}}}),l}function r(n,t){g.value=[n],i("nodeClick",{id:n,componentSchema:t})}return e.provide("expandedKeys",v),e.provide("selectedKeys",g),e.provide("treeProps",h),e.provide("handleSelect",r),(n,t)=>(e.openBlock(),e.createElementBlock("div",V,[e.createElementVNode("div",E,[e.createVNode(e.unref(m),{placeholder:"搜索节点",clearable:"",allowClear:"",modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=l=>c.value=l),value:c.value,"onUpdate:value":t[1]||(t[1]=l=>c.value=l)},{prefix:e.withCtx(()=>[e.createVNode(e.unref(C._sfc_main),{name:"icon--epic--search-rounded"})]),_:1},8,["modelValue","value"])]),e.createElementVNode("div",K,[e.createElementVNode("ul",null,[e.createVNode(B,{schemas:f.value,"onUpdate:schemas":t[2]||(t[2]=l=>f.value=l)},null,8,["schemas"])]),e.withDirectives(e.createElementVNode("div",T,"没有查询到的数据",512),[[e.vShow,!f.value.length]])])]))}});exports._sfc_main=j;
|