epic-designer-gold 1.0.3 → 1.0.5
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-B2dWB_U2.cjs +1 -0
- package/dist/attributeView-Cu_tjo9A.js +106 -0
- package/dist/axios-B8aFvCWj.cjs +6 -0
- package/dist/{js.cookie-oHpRFPCO.js → axios-Bb3STC1u.js} +942 -737
- package/dist/col-BNNn9Yx8.cjs +1 -0
- package/dist/{col-Dy6oYMf5.js → col-u5YiB-UK.js} +8 -8
- package/dist/index-21c4Pe3i.cjs +1 -0
- package/dist/{index-XUQ1VGQg.js → index-B553TaXm.js} +1 -1
- package/dist/index-BLJT8e0Q.js +195 -0
- package/dist/index-BULuVnVl.js +1359 -0
- package/dist/index-BV9SE7wG.cjs +1 -0
- package/dist/index-BhcwWM1G.cjs +1 -0
- package/dist/index-Bn8pwpgq.cjs +1 -0
- package/dist/index-Bxi3JLms.cjs +1 -0
- package/dist/{index-DLMH0OSJ.js → index-Bybwt7-u.js} +1 -1
- package/dist/index-CEDIwmNK.js +72 -0
- package/dist/index-CEvDmc0a.js +104 -0
- package/dist/{index-DJxuHxdI.js → index-CHCOxt3B.js} +24 -24
- package/dist/index-CI3dhGXT.cjs +1 -0
- package/dist/index-CMbBKMQU.js +71 -0
- package/dist/index-CYAKMqdR.cjs +1 -0
- package/dist/{index-BKDRMrcc.js → index-CgwN4ucQ.js} +28 -47
- package/dist/index-CjIIhZdV.js +271 -0
- package/dist/index-Cq6eLpKZ.cjs +1 -0
- package/dist/{index-CYDtBJTI.cjs → index-CqeRfqUw.cjs} +1 -1
- package/dist/index-CrV5FaWU.cjs +10 -0
- package/dist/{index-DNeYX6HK.js → index-D0kQz_zt.js} +1 -1
- package/dist/index-DR80h8IU.js +4 -0
- package/dist/index-DUMEtCCN.cjs +1 -0
- package/dist/index-DddTXMY9.cjs +1 -0
- package/dist/{index-Dyo12Kua.cjs → index-DeFAvWuV.cjs} +1 -1
- package/dist/index-DeZ09CHf.cjs +1 -0
- package/dist/index-Dg7MK40D.js +581 -0
- package/dist/index-DxNdcsD-.js +602 -0
- package/dist/index-DzxQG0o7.cjs +1 -0
- package/dist/{index-DkyxbMHi.js → index-VblxMq6V.js} +24 -24
- package/dist/index.cjs +1 -1
- package/dist/index.js +35 -35
- package/dist/locale/index.d.ts +4 -0
- package/dist/locale/lang/en-US.d.ts +246 -0
- package/dist/locale/lang/zh-cn.d.ts +246 -0
- package/dist/modal-BLOgN3us.cjs +1 -0
- package/dist/modal-UFu4bD6x.js +57 -0
- package/dist/outline-CK-jNomF.cjs +1 -0
- package/dist/{outline-CNayBNNC.js → outline-DxCKINRN.js} +2 -2
- package/dist/row-BWnbt6dh.cjs +1 -0
- package/dist/{row-qOviQw5w.js → row-DAy14ve9.js} +4 -4
- package/dist/sign-B-FCN_7O.js +219 -0
- package/dist/sign-Dho4kHTC.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/styleView-CRUqDcCl.cjs +1 -0
- package/dist/{styleView-BLVqzqPV.js → styleView-ClMjCfMk.js} +34 -33
- package/dist/{tree.vue_vue_type_script_setup_true_lang-BntCm43E.js → tree.vue_vue_type_script_setup_true_lang-B9rWLveX.js} +1 -1
- package/dist/tree.vue_vue_type_script_setup_true_lang-DDDqMedP.cjs +1 -0
- package/dist/ui/antd/date-picker/datePicker.d.ts +2 -2
- package/dist/ui/elementPlus/index.cjs +1 -1
- package/dist/ui/elementPlus/index.js +553 -542
- package/dist/ui/naiveUi/index.cjs +1 -1
- package/dist/ui/naiveUi/index.js +1 -1
- package/dist/uploadFile-Bc5Rxk0b.js +77 -0
- package/dist/uploadFile-oB2-NP-v.cjs +1 -0
- package/dist/uploadImage-4tgp3t7X.cjs +1 -0
- package/dist/uploadImage-CF7fobUP.cjs +1 -0
- package/dist/{uploadImage-742IA7ei.js → uploadImage-CGXm3zNQ.js} +34 -33
- package/dist/{uploadImage-CnNnAISs.js → uploadImage-COCC3pxH.js} +17 -20
- package/package.json +1 -1
- package/dist/attributeView-B-IswSw7.js +0 -105
- package/dist/attributeView-CQBVIMGW.cjs +0 -1
- package/dist/col-RWuL5Zuz.cjs +0 -1
- package/dist/index-0GtpyUBx.js +0 -64
- package/dist/index-B4ido7VJ.cjs +0 -1
- package/dist/index-BGvqo4s7.js +0 -104
- package/dist/index-BMtRXkSh.cjs +0 -1
- package/dist/index-BSLudrcT.cjs +0 -1
- package/dist/index-BXO8Zj1H.cjs +0 -1
- package/dist/index-B_9x_cPH.js +0 -1633
- package/dist/index-B_TFfRwe.js +0 -194
- package/dist/index-C3_E7xcD.js +0 -270
- package/dist/index-C3a1hfUC.cjs +0 -10
- package/dist/index-CucdgcqX.cjs +0 -1
- package/dist/index-CvEzOhT_.cjs +0 -1
- package/dist/index-DEPx91yu.cjs +0 -1
- package/dist/index-DKVv0PbJ.js +0 -56
- package/dist/index-DSzJgAzW.cjs +0 -1
- package/dist/index-Dz1OM1dD.cjs +0 -1
- package/dist/index-HNPgHrkl.cjs +0 -1
- package/dist/index-JhxJizMR.js +0 -601
- package/dist/index-aBofZ4Mk.js +0 -4
- package/dist/index-sKJ91s0r.cjs +0 -1
- package/dist/js.cookie-BH1G_HRi.cjs +0 -6
- package/dist/modal-BPJM1Muh.js +0 -59
- package/dist/modal-_fid8E1T.cjs +0 -1
- package/dist/outline-6Qt3qlWm.cjs +0 -1
- package/dist/row-Bm8OjIsU.cjs +0 -1
- package/dist/sign--js815Se.cjs +0 -1
- package/dist/sign-CO47QOTw.js +0 -218
- package/dist/styleView-C1zTBeyd.cjs +0 -1
- package/dist/tree.vue_vue_type_script_setup_true_lang-BjjL_VlR.cjs +0 -1
- package/dist/uploadFile-CYDDVa_x.js +0 -76
- package/dist/uploadFile-eWBMdZ9d.cjs +0 -1
- package/dist/uploadImage-BQhv5ymq.cjs +0 -1
- package/dist/uploadImage-BXcN2FA_.cjs +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),l=require("element-plus"),a=e.defineComponent({props:{componentSchema:{type:Object,required:!0,default:()=>({})}},setup(n,{attrs:u,slots:o}){return()=>{var c;const t={...n.componentSchema,title:(c=n.componentSchema)==null?void 0:c.label},r=t.children??[];return delete t.children,e.h(l.ElCol,{...t,style:{border:"1px dashed #ccc",padding:"8px"}},{default:()=>e.renderSlot(o,"edit-node",{},()=>r.map(d=>e.renderSlot(o,"node",{componentSchema:d})))})}}});exports.default=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ElCol as
|
|
3
|
-
const u =
|
|
1
|
+
import { defineComponent as m, h as p, renderSlot as c } from "vue";
|
|
2
|
+
import { ElCol as a } from "element-plus";
|
|
3
|
+
const u = m({
|
|
4
4
|
props: {
|
|
5
5
|
componentSchema: {
|
|
6
6
|
type: Object,
|
|
@@ -8,19 +8,19 @@ const u = d({
|
|
|
8
8
|
default: () => ({})
|
|
9
9
|
}
|
|
10
10
|
},
|
|
11
|
-
setup(t, { attrs:
|
|
11
|
+
setup(t, { attrs: l, slots: n }) {
|
|
12
12
|
return () => {
|
|
13
13
|
var o;
|
|
14
14
|
const e = {
|
|
15
15
|
...t.componentSchema,
|
|
16
16
|
title: (o = t.componentSchema) == null ? void 0 : o.label
|
|
17
17
|
}, r = e.children ?? [];
|
|
18
|
-
return delete e.children,
|
|
19
|
-
|
|
18
|
+
return delete e.children, p(
|
|
19
|
+
a,
|
|
20
20
|
{
|
|
21
21
|
...e,
|
|
22
22
|
style: {
|
|
23
|
-
|
|
23
|
+
border: "1px dashed #ccc",
|
|
24
24
|
padding: "8px"
|
|
25
25
|
}
|
|
26
26
|
},
|
|
@@ -29,7 +29,7 @@ const u = d({
|
|
|
29
29
|
n,
|
|
30
30
|
"edit-node",
|
|
31
31
|
{},
|
|
32
|
-
() => r.map((
|
|
32
|
+
() => r.map((d) => c(n, "node", { componentSchema: d }))
|
|
33
33
|
)
|
|
34
34
|
}
|
|
35
35
|
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("./axios-B8aFvCWj.cjs"),O=require("./index-CrV5FaWU.cjs"),U=require("./icon.vue_vue_type_script_setup_true_lang-DJbUD5AQ.cjs"),oe=require("./vuedraggable.umd-BqhSJIAi.cjs"),le={class:"epic-widget-action-item whitespace-nowrap"},ae={key:0,class:"flex items-center"},re=e.defineComponent({__name:"previewWidgets",setup(F,{expose:R}){const p=e.inject("pageManager",{}),g=e.inject("pageSchema"),l=e.inject("designer"),b=e.inject("designerProps"),c=e.inject("revoke"),h=e.ref(null),B=e.ref(null),C=e.ref(null),$=e.ref(!1),a=e.ref(!1),r=e.ref(!0),i=e.ref("top"),{canvasScale:s,disabledZoom:N}=O.useStore();let o=null;const j=e.computed(()=>{const t=l.state.checkedNode;return!(!(t!=null&&t.id)||b.value.lockDefaultSchemaEdit&&p.defaultComponentIds.value.includes(t==null?void 0:t.id)||t.type==="table-col")}),z=e.computed(()=>{const t=l.state.checkedNode;return(t==null?void 0:t.type)==="table-col"}),V=e.computed(()=>{const t=l.state.checkedNode;return(t==null?void 0:t.type)==="table"}),m=e.computed(()=>{var v,_,x,u,M,L;const t=p.componentInstances.value,d=(v=l.state.checkedNode)==null?void 0:v.id;if((x=(_=l.state.checkedNode)==null?void 0:_.componentProps)!=null&&x.hidden)return null;const f=w.pluginManager.getComponentConfingByType((u=l.state.checkedNode)==null?void 0:u.type)??null;if(!d||!(t!=null&&t[d]))return null;if(f!=null&&f.defaultSchema.input&&((M=l.state.checkedNode)==null?void 0:M.noFormItem)!==!0)return(L=t[d+"formItem"])==null?void 0:L.$el;const n=t[d];return!(n!=null&&n.$el)||(n==null?void 0:n.$el.nodeName)==="#text"||!(n!=null&&n.$el.getBoundingClientRect)?null:n==null?void 0:n.$el}),y=e.computed(()=>{var v,_,x,u;const t=p.componentInstances.value,d=(v=l.state.hoverNode)==null?void 0:v.id,f=w.pluginManager.getComponentConfingByType((_=l.state.hoverNode)==null?void 0:_.type)??null;if(!d||!(t!=null&&t[d]))return null;if(f!=null&&f.defaultSchema.input&&((x=l.state.hoverNode)==null?void 0:x.noFormItem)!==!0)return(u=t[d+"formItem"])==null?void 0:u.$el;const n=t[d];return(n==null?void 0:n.$el.nodeName)==="#text"?null:n==null?void 0:n.$el}),{mutationObserver:k,observerConfig:D}=Q(J),{startTimedQuery:W,stopTimedQuery:E}=O.useTimedQuery(J);e.watch(()=>m.value,t=>{if(t){$.value=!0,k.observe(t,D);const d=t.parentNode;d&&(d.ondragstart=()=>{r.value=!1,W()},d.ondragend=()=>{r.value=!0,E()}),J()}else $.value=!1});const{mutationObserver:S,observerConfig:T}=Q(Z);e.watch(()=>y.value,t=>{t&&(S.observe(t,T),Z())});let H=0;e.watch(()=>{var t;return(t=l.state.hoverNode)==null?void 0:t.id},t=>{if(t){a.value=!0,clearTimeout(H);return}H=setTimeout(()=>{a.value=!1},300)});let A=0,I=0;function J(){const t=m.value;if(!t||!o)return;const{top:d,left:f}=o==null?void 0:o.getBoundingClientRect(),{top:n,left:v,width:_,height:x}=t.getBoundingClientRect(),u=N.value?1:s.value,M=n-d+((o==null?void 0:o.scrollTop)??0)*u,L=v-f+((o==null?void 0:o.scrollLeft)??0)*u,P=x/u;h.value&&(h.value.style.width=`${_/u}px`,h.value.style.height=`${P}px`,h.value.style.top=`${M/u}px`,h.value.style.left=`${L/u}px`,X(M,L)),C.value&&(M<45&&P<100?(C.value.style.top="",C.value.style.bottom="-30px",C.value.style["border-radius"]="0px 0px 4px 4px",i.value="bottom"):M<45?(C.value.style.top="0px",C.value.style["border-radius"]="0px 0px 4px 0",i.value="center"):(C.value.style.top="-30px",C.value.style["border-radius"]="4px 4px 0px 0px",i.value="top"))}function X(t,d){const f=m.value;if(!o||!f)return;const n=o.getBoundingClientRect(),{width:v}=f.getBoundingClientRect(),_=N.value?1:s.value,x=t/_-n.top;let u=d/_-n.left+v/_;u<n.width&&(u=0);const M=o.scrollTop-n.height/3+60,L=o.scrollTop+n.height/3*2,P=o.scrollLeft-n.width+200,q=o.scrollLeft+n.width-200;Math.abs(x-A)<10&&Math.abs(u-I)<10||(A=x,I=u,!(x>M&&x<L&&u>P&&u<q)&&(o.scrollTop=x,o.scrollLeft=u))}function Z(){var P,q;const t=y.value;if(!t)return;const{top:d,left:f}=(o==null?void 0:o.getBoundingClientRect())??{top:0,left:0},{top:n,left:v,width:_,height:x}=((P=t.getBoundingClientRect)==null?void 0:P.call(t))??((q=t.nextElementSibling)==null?void 0:q.getBoundingClientRect()),u=N.value?1:s.value,M=n-d+((o==null?void 0:o.scrollTop)??0)*u,L=v-f+((o==null?void 0:o.scrollLeft)??0)*u;B.value&&(B.value.style.width=`${_/u}px`,B.value.style.height=`${x/u}px`,B.value.style.top=`${M/u}px`,B.value.style.left=`${L/u}px`)}function Q(t){const d=window.MutationObserver,f={childList:!0,attributes:!0,subtree:!0};return{mutationObserver:new d(t),observerConfig:f}}function Y(){var n,v;const t=w.findSchemaInfoById(g.schemas,((n=l.state.checkedNode)==null?void 0:n.id)??"root");if(!t||!t.list||!t.list.length||!t.list[0].children||!t.list[0].children.length)return!1;let d=JSON.parse(JSON.stringify((v=t.list[0])==null?void 0:v.children[0]));d.children.forEach((_,x)=>{d.children[x].children=[]});const f=w.generateNewSchema(d);t.list[0].children.push(f),l.setCheckedNode(f),c.push(g.schemas,"表格增加一行")}function G(){var f,n,v,_;const t=w.findSchemaInfoById(g.schemas,((f=l.state.checkedNode)==null?void 0:f.id)??"root");if(!((n=t==null?void 0:t.list)!=null&&n.length)||!((_=(v=t.list[0])==null?void 0:v.children)!=null&&_.length))return!1;t.list[0].children.forEach(x=>{const u=x.children.length+1,M=Math.floor(24/u);x.children.forEach(L=>{L.componentProps.span=M}),x.children.push(w.generateNewSchema({type:"table-col",children:[],componentProps:{span:M}}))}),c.push(g.schemas,"表格增加一列")}function ee(){var _;const t=w.findSchemaInfoById(g.schemas,((_=l.state.checkedNode)==null?void 0:_.id)??"root");if(!t)return!1;const{list:d,schema:f,index:n}=t,v=w.generateNewSchema(f);d.splice(n+1,0,v),l.setCheckedNode(v),c.push(g.schemas,"复制组件")}function te(){var v;const t=w.findSchemaInfoById(g.schemas,((v=l.state.checkedNode)==null?void 0:v.id)??"root");if(!t)return!1;let{list:d,schema:f,index:n}=t;d.splice(n,1),n===d.length&&n--,l.setCheckedNode(d[n]),c.push(g.schemas,"删除组件")}function ne(t){o=t,o==null||o.addEventListener("scroll",()=>{J()}),O.useResizeObserver(m,J),O.useResizeObserver(y,Z)}return R({handleInit:ne}),(t,d)=>{var f,n,v,_,x;return e.openBlock(),e.createElementBlock(e.Fragment,null,[e.withDirectives(e.createElementVNode("div",{ref_key:"selectorRef",ref:h,class:e.normalizeClass(["epic-checked-widget absolute pointer-events-none z-20",i.value+" "+(r.value?"transition-all":"")])},[e.createElementVNode("div",{class:"epic-widget-action-box",ref_key:"actionBoxRef",ref:C},[e.createElementVNode("div",le,e.toDisplayString((n=e.unref(w.pluginManager).getComponentConfingByType(((f=e.unref(l).state.checkedNode)==null?void 0:f.type)??""))==null?void 0:n.defaultSchema.label),1),j.value||V.value||z.value?(e.openBlock(),e.createElementBlock("div",ae,[j.value?(e.openBlock(),e.createElementBlock("div",{key:0,title:"复制",class:"epic-widget-action-item pointer-events-auto",onClick:ee},[e.createVNode(e.unref(U._sfc_main),{name:"icon--epic--copy-all-outline-rounded"})])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("div",{key:1,title:"插入新行",class:"epic-widget-action-item pointer-events-auto",onClick:Y},[e.createVNode(e.unref(U._sfc_main),{name:"icon--epic--account-tree-outline-rounded"})])):e.createCommentVNode("",!0),V.value?(e.openBlock(),e.createElementBlock("div",{key:2,title:"插入新列",class:"epic-widget-action-item pointer-events-auto",onClick:G,style:{transform:"rotate(270deg)"}},[e.createVNode(e.unref(U._sfc_main),{name:"icon--epic--account-tree-outline-rounded"})])):e.createCommentVNode("",!0),j.value?(e.openBlock(),e.createElementBlock("div",{key:3,title:"删除",class:"epic-widget-action-item pointer-events-auto",onClick:te},[e.createVNode(e.unref(U._sfc_main),{name:"icon--epic--delete-outline-rounded"})])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0)],512)],2),[[e.vShow,$.value&&((v=e.unref(l).state.checkedNode)==null?void 0:v.id)!=="root"]]),e.withDirectives(e.createElementVNode("div",{ref_key:"hoverWidgetRef",ref:B,class:"epic-hover-widget absolute transition-all pointer-events-none z-998"},null,512),[[e.vShow,a.value&&((_=e.unref(l).state.checkedNode)==null?void 0:_.id)!==((x=e.unref(l).state.hoverNode)==null?void 0:x.id)]])],64)}}}),se=e.defineComponent({name:"EditNodeItem",__name:"editNodeItem",props:{schemas:{}},emits:["update:schemas"],setup(F,{emit:R}){const p=e.inject("designer"),g=e.inject("pageSchema"),l=e.inject("revoke"),b=F,c=R,h=e.computed({get(){return b.schemas},set(r){c("update:schemas",r)}});function B(r){p.setCheckedNode(h.value[r]),p.setDisableHover(!0)}function C(){p.setDisableHover(),l.push(g.schemas,"拖拽组件")}function $(){l.push(g.schemas,"插入组件")}function a(r){var i,s,N;return r.id===((i=g.schemas[0])==null?void 0:i.id)||(N=(s=w.pluginManager.getComponentConfingByType(r.type))==null?void 0:s.editConstraints)!=null&&N.immovable?"unmover-item":"draggable-item"}return(r,i)=>(e.openBlock(),e.createBlock(e.unref(oe.draggable),e.mergeProps({modelValue:h.value,"onUpdate:modelValue":i[0]||(i[0]=s=>h.value=s),"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]=s=>B(s.oldIndex)),onEnd:i[2]||(i[2]=s=>C()),onAdd:i[3]||(i[3]=s=>{B(s.newIndex),$()})}),{item:e.withCtx(({element:s,index:N})=>[(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["widget-box",a(s)]),key:N},[e.createVNode(K,{schema:s},null,8,["schema"])],2))]),_:1},16,["modelValue"]))}}),K=e.defineComponent({name:"ENodeItem",__name:"nodeItem",props:{schema:{},name:{}},setup(F){const R=e.useAttrs(),p=e.inject("designer"),g=e.inject("pageManager",{}),l=e.inject("pageSchema",{}),b=e.ref(null);e.provide("nodeAttrs",R);const c=F,h=e.computed(()=>{var N,o,j,z,V;const a=g.componentInstances.value,r=(N=c.schema)==null?void 0:N.id,i=w.pluginManager.getComponentConfingByType((o=c.schema)==null?void 0:o.type)??null;if(!r||!(a!=null&&a[r]))return null;if(i!=null&&i.defaultSchema.input&&((j=c.schema)==null?void 0:j.noFormItem)!==!0)return(z=a[r+"formItem"])==null?void 0:z.$el;const s=a[r];return((V=s==null?void 0:s.$el)==null?void 0:V.nodeName)==="#text"?null:s==null?void 0:s.$el});e.watch(()=>h.value,a=>{a==null||a.addEventListener("click",B,!1),a==null||a.addEventListener("mouseover",C,!1),a==null||a.addEventListener("mouseout",$,!1)}),e.onUnmounted(()=>{var a,r,i;(a=h.value)==null||a.removeEventListener("click",B,!1),(r=h.value)==null||r.removeEventListener("mouseover",C,!1),(i=h.value)==null||i.removeEventListener("mouseout",$,!1)});function B(a){a.stopPropagation(),p.setCheckedNode(c.schema)}function C(a){var r;c.schema.id!==((r=l.schemas[0])==null?void 0:r.id)&&(a.stopPropagation(),p.setHoverNode(c.schema))}function $(a){a.stopPropagation(),p.setHoverNode(null)}return(a,r)=>{var s,N;const i=e.resolveComponent("ENodeItem");return e.openBlock(),e.createBlock(e.unref(O._sfc_main),{ref_key:"nodeRef",ref:b,componentSchema:c.schema},e.createSlots({_:2},[(N=(s=e.unref(w.pluginManager).getComponentConfingByType(c.schema.type))==null?void 0:s.editConstraints)!=null&&N.childImmovable?{name:"edit-node",fn:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.schema.children,o=>(e.openBlock(),e.createBlock(i,{key:o.id,schema:o},null,8,["schema"]))),128))]),key:"0"}:{name:"edit-node",fn:e.withCtx(()=>[c.schema.children?(e.openBlock(),e.createBlock(se,{key:0,schemas:c.schema.children,"onUpdate:schemas":r[0]||(r[0]=o=>c.schema.children=o)},null,8,["schemas"])):e.createCommentVNode("",!0)]),key:"1"}]),1032,["componentSchema"])}}}),ce={class:"min-w-750px rounded h-full"},ie=e.defineComponent({__name:"previewJson",setup(F,{expose:R}){const p=w.pluginManager.getComponent("modal"),g=w.pluginManager.getComponent("monacoEditor"),l={theme:"vs-light",selectOnLineNumbers:!0,minimap:{enabled:!1},readOnly:!0},b=e.ref(null),c=e.ref(!1),h=e.inject("pageSchema");function B(){c.value=!1}function C(){c.value=!0,b.value?b.value.setValue(JSON.stringify(h,null,2)):setTimeout(()=>{C()},300)}function $(a="epic-data.json"){const r=JSON.stringify(h,null,2);var i=`data:text/json;charset=utf-8,${encodeURIComponent(r)}`,s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("download",a),s.click()}return R({handleOpen:C}),(a,r)=>(e.openBlock(),e.createBlock(e.unref(p),{modelValue:c.value,"onUpdate:modelValue":r[0]||(r[0]=i=>c.value=i),title:"查看数据",class:"w-900px",width:"900px",onClose:B,onOk:$,okText:"导出数据"},{default:e.withCtx(()=>[e.createElementVNode("div",ce,[e.createVNode(e.unref(g),{ref_key:"monacoEditorRef",ref:b,class:"editor h-full",autoToggleTheme:"",readOnly:"",config:l,language:"json"},null,512)])]),_:1},8,["modelValue"]))}}),de={class:"epic-edit-toolbar flex items-center justify-between px-2"},ue={class:"flex-1 h-full flex items-center"},fe={key:0,class:"epic-divider"},pe=["title","onClick"],he={class:"flex-1 h-full flex items-center justify-end"},me={key:0,class:"flex items-center ml-12px"},ve={class:"pr-8px w-82px cursor-pointer"},ge={class:"epic-device h-28px items-center gap-1 rounded-md border p-2px flex"},ye=["title","onClick"],ke=e.defineComponent({__name:"toolbar",setup(F){const R=w.pluginManager.getComponent("select"),{canvasScale:p,disabledZoom:g}=O.useStore(),l=e.ref("pc"),b=e.inject("pageSchema"),c=e.inject("designer"),h=e.inject("revoke"),B=e.ref(null),C=[{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"}],$=e.computed(()=>[{icon:"icon--epic--trash",title:"清空",on:o},{icon:"icon--epic--undo",title:"撤销",on:s,disabled:!h.recordList.value.length,divider:!0},{icon:"icon--epic--redo",title:"重做",on:N,disabled:!h.undoList.value.length}]),a=e.ref(null),r=e.computed({get(){return`${(p.value*100).toFixed(0)}%`},set(m){const y=parseFloat(m);p.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 s(){const m=h.undo();m&&(w.deepCompareAndModify(b.schemas,m),c.setCheckedNode(b.schemas[0]))}function N(){const m=h.redo();m&&(w.deepCompareAndModify(b.schemas,m),c.setCheckedNode(b.schemas[0]))}function o(){c.reset()}function j(m){var D;const y=(D=m.target.files)==null?void 0:D[0];if(!y)return;m.target.value=null;const k=new FileReader;k.readAsText(y),k.onload=W=>{var E;z((E=W.target)==null?void 0:E.result)}}function z(m){try{let y=JSON.parse(m??"");y.schemas||(y=w.convertKFormData(y)),w.deepCompareAndModify(b,y)}catch(y){console.error(y)}}function V(m){c.handleToggleDeviceMode(m),l.value=m;const y={pc:{},pad:{width:"780px",mode:m},mobile:{width:"390px",height:"844px",mode:m}};b.canvas=y[m],console.log("%c [ pageSchema ]-248","font-size:13px; background:pink; color:#bf2c9f;",b)}return(m,y)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",de,[e.createElementVNode("div",ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList($.value,(k,D)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:D},[k.divider?(e.openBlock(),e.createElementBlock("div",fe)):e.createCommentVNode("",!0),e.createElementVNode("div",{title:k.title,class:e.normalizeClass(["epic-action-item text-base h-90% px-10px flex items-center cursor-pointer",{disabled:k.disabled}]),onClick:k.on},[e.createVNode(e.unref(U._sfc_main),{name:k.icon},null,8,["name"])],10,pe)],64))),128))]),e.withDirectives(e.createElementVNode("input",{type:"file",ref_key:"fileRef",ref:a,accept:".json,.txt",onChange:j},null,544),[[e.vShow,!1]]),e.createElementVNode("div",he,[e.unref(g)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",me,[e.createElementVNode("div",ve,[e.createVNode(e.unref(R),{value:r.value,"onUpdate:value":y[0]||(y[0]=k=>r.value=k),modelValue:r.value,"onUpdate:modelValue":y[1]||(y[1]=k=>r.value=k),options:i,size:"small"},null,8,["value","modelValue"])])])),e.createElementVNode("div",ge,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(C,k=>e.createElementVNode("div",{key:k.key,title:k.title,class:e.normalizeClass(["epic-device-item h-full px-1 flex items-center cursor-pointer text-base transition-colors rounded-sm",{checked:k.key===l.value}]),onClick:D=>V(k.key)},[e.createVNode(e.unref(U._sfc_main),{name:k.icon},null,8,["name"])],10,ye)),64))])])]),e.createVNode(ie,{ref_key:"previewJson",ref:B},null,512)],64))}}),xe={class:"h-full flex flex-col relative"},be=["draggable"],_e=e.defineComponent({__name:"editScreenContainer",setup(F){const R=e.inject("pageSchema"),p=e.ref(null),g=e.ref(null),l=e.ref(null),{pressSpace:b,disabledZoom:c}=O.useStore(),{handleElementDragStart:h,handleElementDrag:B,handleElementDragEnd:C}=O.useElementDrag(p),{width:$,height:a}=O.useElementSize(p),{canvasScale:r,handleZoom:i}=O.useElementZoom(g);let s=0,N=0;const o=e.ref({}),j=e.ref({}),z=e.ref({}),V=e.shallowRef({width:0,height:0});e.watchEffect(y),e.watch(z,()=>{e.nextTick(m)});function m(){l.value&&(V.value={width:l.value.clientWidth,height:l.value.clientHeight})}function y(){var E,S;z.value={width:((E=R.canvas)==null?void 0:E.width)??"0",height:((S=R.canvas)==null?void 0:S.height)??"0"}}O.watchOnce($,k),e.watch(V,k);function k(){let E=V.value.width||s,S=V.value.height||N;o.value={width:$.value+E+"px",height:a.value+S+"px"},j.value={width:E+"px",height:S+"px"},D()}function D(){e.nextTick(()=>{var A;let E=V.value.width||s;const T=(V.value.height||N)/2,H=E/2;(A=p.value)==null||A.scrollTo(H,T)})}O.useResizeObserver(p,W),O.useResizeObserver(g,W);function W(){var S;if(!p.value)return;const E=p.value.getBoundingClientRect();if(s=E.width-60,N=E.height-80,!c.value)if(V.value.width===0)r.value=1;else{const T=(s-20)/V.value.width,H=N/(V.value.height||((S=g.value)==null?void 0:S.clientHeight)||1),A=Math.abs(T-1)<Math.abs(H-1);let I=1;A?I=T:I=H,(T<1||H<1)&&(I=Math.min(T,H)),I<1.4&&I>.5&&(r.value=I)}O.debounce(k,50)()}return(E,S)=>(e.openBlock(),e.createElementBlock("div",xe,[e.createVNode(ke),e.createElementVNode("div",{ref_key:"editScreenContainerRef",ref:p,class:e.normalizeClass(["flex-1 overflow-auto overflow-y-hidden epic-edit-screen-container",{"cursor-grab":e.unref(b)}]),draggable:e.unref(b),onWheel:S[0]||(S[0]=(...T)=>e.unref(i)&&e.unref(i)(...T)),onDragstart:S[1]||(S[1]=(...T)=>e.unref(h)&&e.unref(h)(...T)),onDragend:S[2]||(S[2]=(...T)=>e.unref(C)&&e.unref(C)(...T)),onDrag:S[3]||(S[3]=(...T)=>e.unref(B)&&e.unref(B)(...T))},[e.createElementVNode("div",{id:"canvasContainer",class:"flex items-center justify-center",style:e.normalizeStyle(o.value)},[e.createElementVNode("div",{ref_key:"draggableElRef",ref:g,class:"transition-all"},[e.createElementVNode("div",{class:e.normalizeClass({"pointer-events-none":e.unref(b)}),style:e.normalizeStyle(j.value)},[e.renderSlot(E.$slots,"default")],6)],512)],4)],42,be),e.createElementVNode("div",{ref_key:"sizeBoxRef",ref:l,class:"absolute top-0 pointer-events-none",style:e.normalizeStyle(z.value)},null,4)]))}}),Ce={class:"epic-edit-canvas"},Ne=e.defineComponent({__name:"index",setup(F){const R=e.ref(null),p=e.ref(null),g=e.inject("pageSchema"),l=e.computed(()=>g.schemas[0]),b=e.computed(()=>({width:"100%",height:"100%"}));return e.onMounted(()=>{var c;(c=p.value)==null||c.handleInit(R.value)}),(c,h)=>(e.openBlock(),e.createElementBlock("section",Ce,[e.createVNode(_e,null,{default:e.withCtx(()=>[e.createElementVNode("div",{ref_key:"epicEditRangeRef",ref:R,class:"epic-edit-range rounded-md overflow-auto relative",style:e.normalizeStyle(b.value)},[e.createVNode(K,{schema:l.value},null,8,["schema"]),e.createVNode(re,{ref_key:"ePreviewWidgetsRef",ref:p},null,512)],4)]),_:1})]))}});exports.default=Ne;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as d, computed as p, ref as _, shallowRef as m, openBlock as i, createElementBlock as s, createElementVNode as t, Fragment as f, renderList as h, normalizeClass as u, createVNode as k, unref as C, toDisplayString as b, createBlock as y, resolveDynamicComponent as B } from "vue";
|
|
2
|
-
import { p as g } from "./
|
|
2
|
+
import { p as g } from "./axios-Bb3STC1u.js";
|
|
3
3
|
import { _ as x } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
4
4
|
const E = { class: "flex relative" }, w = { class: "epic-action-bar" }, D = { class: "epic-actions-container" }, N = ["title", "onClick"], V = { class: "text-14px" }, $ = { class: "epic-sidebar-container" }, M = /* @__PURE__ */ d({
|
|
5
5
|
name: "EActivityBar",
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { defineComponent as $, inject as M, resolveComponent as z, openBlock as r, createBlock as I, unref as t, isRef as U, withCtx as B, createElementVNode as c, normalizeClass as w, createVNode as s, createCommentVNode as O, createElementBlock as V, ref as A, reactive as D, onMounted as R, watch as T, provide as j, Fragment as F, renderList as q, toDisplayString as x, withDirectives as G, vShow as H, createTextVNode as J } from "vue";
|
|
2
|
+
import { d as K } from "./vuedraggable.umd-D2S7Eo7p.js";
|
|
3
|
+
import { p, E as N } from "./axios-Bb3STC1u.js";
|
|
4
|
+
import { _ as C } from "./icon.vue_vue_type_script_setup_true_lang-D3QdcReY.js";
|
|
5
|
+
import { g as S } from "./index-BULuVnVl.js";
|
|
6
|
+
import "element-plus";
|
|
7
|
+
import { u as P } from "./index-Dg7MK40D.js";
|
|
8
|
+
import { _ as Q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
9
|
+
const W = {
|
|
10
|
+
key: 0,
|
|
11
|
+
class: "pl-4"
|
|
12
|
+
}, X = /* @__PURE__ */ $({
|
|
13
|
+
name: "EOptionItem",
|
|
14
|
+
__name: "optionItem",
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: {}
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:modelValue"],
|
|
19
|
+
setup(y, { emit: b }) {
|
|
20
|
+
const n = y, h = p.getComponent("input"), f = M("tree", !1), u = S(n, "modelValue", b);
|
|
21
|
+
function m(l) {
|
|
22
|
+
const o = {
|
|
23
|
+
label: "",
|
|
24
|
+
value: ""
|
|
25
|
+
};
|
|
26
|
+
l.children ? l.children.push(o) : l.children = [o];
|
|
27
|
+
}
|
|
28
|
+
function g(l) {
|
|
29
|
+
u.value = u.value.filter((o, _) => _ !== l);
|
|
30
|
+
}
|
|
31
|
+
return (l, o) => {
|
|
32
|
+
const _ = z("EOptionItem");
|
|
33
|
+
return r(), I(t(K), {
|
|
34
|
+
modelValue: t(u),
|
|
35
|
+
"onUpdate:modelValue": o[0] || (o[0] = (a) => U(u) ? u.value = a : null),
|
|
36
|
+
"item-key": "id",
|
|
37
|
+
"component-data": {
|
|
38
|
+
type: "transition-group"
|
|
39
|
+
},
|
|
40
|
+
group: "option-list",
|
|
41
|
+
handle: ".handle",
|
|
42
|
+
animation: 200
|
|
43
|
+
}, {
|
|
44
|
+
item: B(({ element: a, index: k }) => [
|
|
45
|
+
c("div", null, [
|
|
46
|
+
c("div", {
|
|
47
|
+
class: w([t(f) ? "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"])
|
|
48
|
+
}, [
|
|
49
|
+
s(t(C), {
|
|
50
|
+
class: "mr-2 cursor-move handle",
|
|
51
|
+
name: "icon--epic--drag"
|
|
52
|
+
}),
|
|
53
|
+
s(t(h), {
|
|
54
|
+
modelValue: a.label,
|
|
55
|
+
"onUpdate:modelValue": (e) => a.label = e,
|
|
56
|
+
value: a.label,
|
|
57
|
+
"onUpdate:value": (e) => a.label = e,
|
|
58
|
+
placeholder: "label"
|
|
59
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
60
|
+
s(t(h), {
|
|
61
|
+
modelValue: a.value,
|
|
62
|
+
"onUpdate:modelValue": (e) => a.value = e,
|
|
63
|
+
value: a.value,
|
|
64
|
+
"onUpdate:value": (e) => a.value = e,
|
|
65
|
+
placeholder: "value"
|
|
66
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "value", "onUpdate:value"]),
|
|
67
|
+
t(f) ? (r(), I(t(C), {
|
|
68
|
+
key: 0,
|
|
69
|
+
class: "cursor-pointer text-lg!",
|
|
70
|
+
name: "icon--epic--add-rounded",
|
|
71
|
+
onClick: (e) => m(a)
|
|
72
|
+
}, null, 8, ["onClick"])) : O("", !0),
|
|
73
|
+
s(t(C), {
|
|
74
|
+
class: "hover:text-red cursor-pointer",
|
|
75
|
+
name: "icon--epic--delete-outline-rounded",
|
|
76
|
+
onClick: (e) => g(k)
|
|
77
|
+
}, null, 8, ["onClick"])
|
|
78
|
+
], 2),
|
|
79
|
+
a.children ? (r(), V("div", W, [
|
|
80
|
+
s(_, {
|
|
81
|
+
modelValue: a.children,
|
|
82
|
+
"onUpdate:modelValue": (e) => a.children = e
|
|
83
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue"])
|
|
84
|
+
])) : O("", !0)
|
|
85
|
+
])
|
|
86
|
+
]),
|
|
87
|
+
_: 1
|
|
88
|
+
}, 8, ["modelValue"]);
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
}), Y = { class: "" }, Z = { class: "epic-tabs-box" }, ee = ["title", "onClick"], te = { key: 0 }, le = { key: 1 }, ae = { style: { "font-size": "12px", "margin-bottom": "8px", display: "inline-block" } }, oe = /* @__PURE__ */ $({
|
|
92
|
+
__name: "index",
|
|
93
|
+
props: {
|
|
94
|
+
tree: { type: Boolean },
|
|
95
|
+
modelValue: {},
|
|
96
|
+
dynamicId: {},
|
|
97
|
+
type: {}
|
|
98
|
+
},
|
|
99
|
+
emits: ["update:modelValue", "update:EOptionsEditor"],
|
|
100
|
+
setup(y, { emit: b }) {
|
|
101
|
+
const { t: n } = P(), h = p.getComponent("button"), f = p.getComponent("select"), v = A([]), u = D({
|
|
102
|
+
title: n("static")
|
|
103
|
+
}), m = y, g = b;
|
|
104
|
+
N.on("deleteSourceData", (e) => {
|
|
105
|
+
o.value === e && (o.value = "", l.value = []);
|
|
106
|
+
}), N.on("updateSource", (e) => {
|
|
107
|
+
v.value = p.sourceData.map((i) => ({
|
|
108
|
+
...i,
|
|
109
|
+
label: i.apiName,
|
|
110
|
+
value: i.id
|
|
111
|
+
}));
|
|
112
|
+
}), R(() => {
|
|
113
|
+
v.value = p.sourceData.map((e) => ({
|
|
114
|
+
...e,
|
|
115
|
+
label: e.apiName,
|
|
116
|
+
value: e.id
|
|
117
|
+
}));
|
|
118
|
+
});
|
|
119
|
+
const l = S(m, "modelValue", g), o = S(m, "dynamicId", g);
|
|
120
|
+
T(
|
|
121
|
+
() => o.value,
|
|
122
|
+
async () => {
|
|
123
|
+
o.value ? u.title = n("dynamic") : u.title = n("static");
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
immediate: !0
|
|
127
|
+
}
|
|
128
|
+
);
|
|
129
|
+
const _ = [
|
|
130
|
+
{
|
|
131
|
+
title: n("static")
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
title: n("dynamic")
|
|
135
|
+
}
|
|
136
|
+
];
|
|
137
|
+
async function a(e) {
|
|
138
|
+
u.title = e.title, e.title === n("static") ? (l.value = [], o.value = "") : (l.value = [], v.value = p.sourceData.map((i) => ({
|
|
139
|
+
...i,
|
|
140
|
+
label: i.apiName,
|
|
141
|
+
value: i.id
|
|
142
|
+
})));
|
|
143
|
+
}
|
|
144
|
+
m.modelValue, j("tree", m.tree);
|
|
145
|
+
function k() {
|
|
146
|
+
const e = D({
|
|
147
|
+
label: "",
|
|
148
|
+
value: ""
|
|
149
|
+
});
|
|
150
|
+
l.value.length ? l.value = [...l.value, e] : l.value = [e];
|
|
151
|
+
}
|
|
152
|
+
return (e, i) => {
|
|
153
|
+
var E;
|
|
154
|
+
return r(), V("div", Y, [
|
|
155
|
+
c("div", null, [
|
|
156
|
+
c("div", Z, [
|
|
157
|
+
(r(), V(F, null, q(_, (d, L) => c("div", {
|
|
158
|
+
class: w(["epic-tab cursor-pointer truncate", { checked: u.title === d.title }]),
|
|
159
|
+
key: L,
|
|
160
|
+
title: d.title,
|
|
161
|
+
onClick: (ne) => a(d)
|
|
162
|
+
}, x(d.title), 11, ee)), 64))
|
|
163
|
+
]),
|
|
164
|
+
u.title === t(n)("static") ? (r(), V("div", te, [
|
|
165
|
+
G(c("div", { class: "py-4 my-2 text-center text-gray-400 bg-white" }, x(t(n)("noOptions")), 513), [
|
|
166
|
+
[H, !((E = t(l)) != null && E.length)]
|
|
167
|
+
]),
|
|
168
|
+
s(X, {
|
|
169
|
+
modelValue: t(l),
|
|
170
|
+
"onUpdate:modelValue": i[0] || (i[0] = (d) => U(l) ? l.value = d : null)
|
|
171
|
+
}, null, 8, ["modelValue"]),
|
|
172
|
+
s(t(h), { onClick: k }, {
|
|
173
|
+
default: B(() => [
|
|
174
|
+
J(x(t(n)("addOption")), 1)
|
|
175
|
+
]),
|
|
176
|
+
_: 1
|
|
177
|
+
})
|
|
178
|
+
])) : (r(), V("div", le, [
|
|
179
|
+
c("span", ae, x(t(n)("dataSources")), 1),
|
|
180
|
+
s(t(f), {
|
|
181
|
+
modelValue: t(o),
|
|
182
|
+
"onUpdate:modelValue": i[1] || (i[1] = (d) => U(o) ? o.value = d : null),
|
|
183
|
+
placeholder: t(n)("pleaseSelectDataSource"),
|
|
184
|
+
clearable: "",
|
|
185
|
+
options: v.value
|
|
186
|
+
}, null, 8, ["modelValue", "placeholder", "options"])
|
|
187
|
+
]))
|
|
188
|
+
])
|
|
189
|
+
]);
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
}), ve = /* @__PURE__ */ Q(oe, [["__scopeId", "data-v-040f106d"]]);
|
|
193
|
+
export {
|
|
194
|
+
ve as default
|
|
195
|
+
};
|