snowy-designer
Version:
基于Epic-Designer-Pro版本的设计器,可视化开发页面表单
2 lines (1 loc) • 1.9 kB
JavaScript
;const e=require("vue"),n=require("ant-design-vue"),C={class:"epic-modal-main epic-scoped"},v={class:"epic-modal-footer"},S=e.defineComponent({__name:"modal",props:{componentSchema:{default:()=>({type:"modal"})},hideConfirm:{type:Boolean},okText:{default:"确定"}},emits:["ok","close","update:modelValue"],setup(s,{emit:c}){const o=s,l=c,d=n.version.split("."),p=Number.parseInt(d[0]),a=e.useAttrs(),m={bottom:"30px",left:"150px",minHeight:"500px",minWidth:"700px",position:"absolute",right:"150px",top:"56px",width:"auto"},u={height:"calc(100vh - 108px)",padding:0},h=e.computed(()=>{var t;return{...o.componentSchema,...a,bodyStyle:u,dialogStyle:m,footer:null,"onUpdate:open":r,"onUpdate:visible":r,open:a.modelValue,style:"top:20px",title:((t=o.componentSchema)==null?void 0:t.label)??"",visible:p>3?void 0:a.modelValue,wrapClassName:"epic-modal-ant",children:null}}),f=e.computed(()=>{var t;return((t=o.componentSchema)==null?void 0:t.children)??[]});function x(){l("ok")}function r(){l("update:modelValue",!1),l("close")}return(t,i)=>(e.openBlock(),e.createBlock(e.unref(n.Modal),e.normalizeProps(e.guardReactiveProps(h.value)),{default:e.withCtx(()=>[e.createElementVNode("div",C,[e.renderSlot(t.$slots,"default",{},()=>[e.renderSlot(t.$slots,"edit-node",{},()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,k=>e.renderSlot(t.$slots,"node",{componentSchema:k})),256))])])]),e.createElementVNode("div",v,[e.createVNode(e.unref(n.Space),{align:"end"},{default:e.withCtx(()=>[e.createVNode(e.unref(n.Button),{onClick:r},{default:e.withCtx(()=>i[0]||(i[0]=[e.createTextVNode(" 关闭 ")])),_:1}),o.hideConfirm?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(e.unref(n.Button),{key:0,type:"primary",onClick:x},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.okText??"确定"),1)]),_:1}))]),_:1})])]),_:3},16))}});module.exports=S;