UNPKG

epic-designer-cjh

Version:

基于vue3的设计器,可视化开发页面表单

10 lines (8 loc) 4.32 MB
(function(vn,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue"),require("monaco-editor")):typeof define=="function"&&define.amd?define(["exports","vue","monaco-editor"],l):(vn=typeof globalThis<"u"?globalThis:vn||self,l(vn["epic-designer"]={},vn.Vue,vn.monaco))})(this,function(vn,l,jm){"use strict";var Zxn=Object.defineProperty;var Qxn=(vn,l,jm)=>l in vn?Zxn(vn,l,{enumerable:!0,configurable:!0,writable:!0,value:jm}):vn[l]=jm;var Kb=(vn,l,jm)=>(Qxn(vn,typeof l!="symbol"?l+"":l,jm),jm);function Goe(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}function _r(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const a in r)if(a!=="default"&&!(a in e)){const o=Object.getOwnPropertyDescriptor(r,a);o&&Object.defineProperty(e,a,o.get?o:{enumerable:!0,get:()=>r[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const FUe=Goe(l),Yoe=Goe(jm),Jxn="",Bc=(e,t)=>l.defineAsyncComponent({loader:e,loadingComponent:t,delay:80});function Lm(e=10){return Math.random().toString(36).substring(2,2+e)}function Xoe(e){return e.charAt(0).toUpperCase()+e.slice(1)}function Is(e,t=new WeakMap){if(typeof e!="object"||e===null)return e;if(t.has(e))return t.get(e);if(Array.isArray(e)){const r=e.map(a=>Is(a,t));return t.set(e,r),r}const n={};return t.set(e,n),Object.keys(e).forEach(r=>{n[r]=Is(e[r],t)}),n}function GI(e){const[t]=Qoe([Is(e)],n=>{const r={...n,id:`${n.type}_${Lm(8)}`};return(r.field||r.input)&&(r.field=r.id),r});return t}function jc(e,t){for(const[n,r]of Object.entries(t)){const a=e==null?void 0:e[n];a&&r&&typeof a=="object"&&typeof r=="object"?jc(a,r):e[n]=r}Object.keys(e).reverse().forEach(n=>{t.hasOwnProperty(n)||(Array.isArray(t)?e.splice(n,1):delete e[n])})}function cj(e,t,n=new WeakMap){const r=a=>{if(Array.isArray(a))return a.map(r);if(typeof a=="object"&&a!==null){if(n.has(a))return"[Circular]";n.set(a,!0);const o=Object.keys(a).sort(),i={};return o.forEach(u=>{i[u]=r(a[u])}),n.delete(a),i}else return a};return JSON.stringify(r(e))===JSON.stringify(r(t))}function Zoe(e,t){const n=[];let r=!1;function a(o){if(n.push(o),o.id===t&&(r=!0),!r&&o.children!=null&&o.children.length>0)for(let i=0;i<o.children.length&&(a(o.children[i]),!r);i++);if(!r&&o.slots)for(let i in o.slots)for(let u=0;u<o.slots[i].length&&(a(o.slots[i][u]),!r);u++);r||n.pop()}return e.forEach(a),r||console.error(`没有查询到id为${t}的节点`),n}function YI(e,t){const n=e.split(".");let r=t;for(let a=0;a<n.length;a++)if(r=r[n[a]],typeof r>"u")return;return r}function Gb(e,t,n){const r=t.split(".");let a=n;r.forEach((o,i)=>{if(i===r.length-1){a[o]=e;return}a=a[o]??(a[o]={})})}function BUe(e,t="default"){const n=mw(e,a=>a.type==="form"&&a.name===t,!0);return mw((n==null?void 0:n.children)??[],a=>!!a.input,!1,a=>a.type!=="subform").map(a=>a.field)}function mw(e,t,n=!1,r){const a=[],o=[...e];for(;o.length;){const i=o.pop();if(i!=null&&i.children&&(!r||r(i))&&o.push(...i.children),i!=null&&i.slots&&(!r||r(i)))for(let u in i.slots)o.push(...i.slots[u]);if(t(i)&&(a.push(i),n))return i}return n?!1:a}function Qoe(e,t,n){const r=[...e];for(;r.length;){const a=r.pop();if(a!=null&&a.children&&(!n||n(a))&&r.push(...a.children),a!=null&&a.slots&&(!n||n(a)))for(let o in a.slots)r.push(...a.slots[o]);jc(a,t(a))}return e}function dj(e,t){const n=mw(e,r=>r.id===t,!0);if(!n)throw new Error(`没有查询到id为${t}的节点`);return n}function XI(e,t){const n=[{type:"",children:e}];let r=0,a=null;if(mw(n,o=>{if(a=o.children??null,!a){if(o!=null&&o.slots)for(let i in o.slots){a=o.slots[i];for(let u=0;u<a.length;u++)if(a[u].id===t)return r=u,!0}return!1}for(let i=0;i<a.length;i++)if(a[i].id===t)return r=i,!0;return!1},!0),!a)throw new Error(`没有查询到id为${t}的节点`);return{list:a,schema:a[r],index:r}}function Joe(e){const t={schemas:[{type:"page",id:"root",label:"页面",children:[{label:"表单",type:"form",icon:"epic-icon-daibanshixiang",labelWidth:e.config.labelWidth||100,name:"default",componentProps:{layout:e.config.layout||"horizontal",labelWidth:e.config.labelWidth||100,labelLayout:e.config.labelLayout==="flex"?"fixed":"flex",labelCol:e.config.labelCol||{span:5},wrapperCol:e.config.wrapperCol||{span:19},hideRequiredMark:e.config.hideRequiredMark||!1,colon:e.config.colon||!0,labelAlign:e.config.labelAlign||"right",size:e.config.size||"middle"},children:[],id:"form_"+Lm()}],componentProps:{style:{padding:"16px"}}}],script:e.script||""};return t.schemas[0].children[0].children=Yb(e.list),t}function Yb(e,t){return e.map(n=>{var d,s,f;let r=n.type??"";const a=n.options??{},o=(c,p)=>{r===c&&(r=p,a.defaultValue&&(a.defaultValue=JSON.parse(a.defaultValue)))};if(o("uploadImg","upload-image"),o("uploadFile","upload-file"),r==="date"&&a.range&&(a.type="daterange",delete a.range),(r==="date"||r==="time")&&(a.valueFormat=a.format),r==="textarea"){const{minRows:c,maxRows:p}=a;a.autoSize={minRows:c,maxRows:p},delete a.minRows,delete a.maxRows}r==="number"&&!a.precision&&delete a.precision,a.width&&(a.style={width:a.width},delete a.width),r==="grid"&&(r="row",n.childImmovable=!0),t&&t.type==="grid"&&(r="col",a.span=n.span,n.key=Lm());const i={label:n.label,type:r,icon:n.icon||"",field:n.model,componentProps:a,childImmovable:n.childImmovable,id:n.key};return(a.noFormItem||!a.showLabel)&&(i.noFormItem=!0,delete a.noFormItem,delete a.showLabel),a.clearable&&(a.allowClear=!0,delete a.clearable),["input","textarea","number","password","select","cascader","checkbox","radio","date","time","slider","switch","color-picker","upload-file","upload-image"].includes(r)&&(i.input=!0,((s=(d=n.rules)==null?void 0:d[0])==null?void 0:s.required)===!1&&n.rules.shift(),((f=n.rules)==null?void 0:f.length)>0&&(i.rules=n.rules)),n.list&&(i.children=Yb(n.list,n)),n.columns&&(i.children=Yb(n.columns,n)),n.trs&&(i.children=Yb(n.trs,n)),n.tds&&(i.children=Yb(n.tds,n)),i})}function fj(e){return l.getCurrentScope()?(l.onScopeDispose(e),!0):!1}function jUe(e){let t=0,n,r;const a=()=>{t-=1,r&&t<=0&&(r.stop(),n=void 0,r=void 0)};return(...o)=>(t+=1,n||(r=l.effectScope(!0),n=r.run(()=>e(...o))),fj(a),n)}function pj(e){return typeof e=="function"?e():l.unref(e)}const LUe=typeof window<"u",zUe=()=>{};function qUe(e,t,n){const r=l.watch(e,(...a)=>(l.nextTick(()=>r()),t(...a)),n)}function Xb(e){var t;const n=pj(e);return(t=n==null?void 0:n.$el)!=null?t:n}const ZI=LUe?window:void 0;function HUe(...e){let t,n,r,a;if(typeof e[0]=="string"||Array.isArray(e[0])?([n,r,a]=e,t=ZI):[t,n,r,a]=e,!t)return zUe;Array.isArray(n)||(n=[n]),Array.isArray(r)||(r=[r]);const o=[],i=()=>{o.forEach(f=>f()),o.length=0},u=(f,c,p,v)=>(f.addEventListener(c,p,v),()=>f.removeEventListener(c,p,v)),d=l.watch(()=>[Xb(t),pj(a)],([f,c])=>{i(),f&&o.push(...n.flatMap(p=>r.map(v=>u(f,p,v,c))))},{immediate:!0,flush:"post"}),s=()=>{d(),i()};return fj(s),s}var WUe=Object.defineProperty,UUe=Object.defineProperties,KUe=Object.getOwnPropertyDescriptors,eie=Object.getOwnPropertySymbols,GUe=Object.prototype.hasOwnProperty,YUe=Object.prototype.propertyIsEnumerable,tie=(e,t,n)=>t in e?WUe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nie=(e,t)=>{for(var n in t||(t={}))GUe.call(t,n)&&tie(e,n,t[n]);if(eie)for(var n of eie(t))YUe.call(t,n)&&tie(e,n,t[n]);return e},rie=(e,t)=>UUe(e,KUe(t));function XUe(e){return typeof e=="function"?e:typeof e=="string"?t=>t.key===e:Array.isArray(e)?t=>e.includes(t.key):()=>!0}function aie(...e){let t,n,r={};e.length===3?(t=e[0],n=e[1],r=e[2]):e.length===2?typeof e[1]=="object"?(t=!0,n=e[0],r=e[1]):(t=e[0],n=e[1]):(t=!0,n=e[0]);const{target:a=ZI,eventName:o="keydown",passive:i=!1,dedupe:u=!1}=r,d=XUe(t);return HUe(a,o,f=>{f.repeat&&pj(u)||d(f)&&n(f)},i)}function vj(e,t,n={}){return aie(e,t,rie(nie({},n),{eventName:"keydown"}))}function mj(e,t,n={}){return aie(e,t,rie(nie({},n),{eventName:"keyup"}))}function ZUe(){const e=l.ref(!1);return l.getCurrentInstance()&&l.onMounted(()=>{e.value=!0}),e}function QUe(e){const t=ZUe();return l.computed(()=>(t.value,!!e()))}var oie=Object.getOwnPropertySymbols,JUe=Object.prototype.hasOwnProperty,eKe=Object.prototype.propertyIsEnumerable,tKe=(e,t)=>{var n={};for(var r in e)JUe.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&oie)for(var r of oie(e))t.indexOf(r)<0&&eKe.call(e,r)&&(n[r]=e[r]);return n};function QI(e,t,n={}){const r=n,{window:a=ZI}=r,o=tKe(r,["window"]);let i;const u=QUe(()=>a&&"ResizeObserver"in a),d=()=>{i&&(i.disconnect(),i=void 0)},s=l.computed(()=>Array.isArray(e)?e.map(p=>Xb(p)):[Xb(e)]),f=l.watch(s,p=>{if(d(),u.value&&a){i=new ResizeObserver(t);for(const v of p)v&&i.observe(v,o)}},{immediate:!0,flush:"post",deep:!0}),c=()=>{d(),f()};return fj(c),{isSupported:u,stop:c}}function nKe(e,t={width:0,height:0},n={}){const{window:r=ZI,box:a="content-box"}=n,o=l.computed(()=>{var d,s;return(s=(d=Xb(e))==null?void 0:d.namespaceURI)==null?void 0:s.includes("svg")}),i=l.ref(t.width),u=l.ref(t.height);return QI(e,([d])=>{const s=a==="border-box"?d.borderBoxSize:a==="content-box"?d.contentBoxSize:d.devicePixelContentBoxSize;if(r&&o.value){const f=Xb(e);if(f){const c=r.getComputedStyle(f);i.value=Number.parseFloat(c.width),u.value=Number.parseFloat(c.height)}}else if(s){const f=Array.isArray(s)?s:[s];i.value=f.reduce((c,{inlineSize:p})=>c+p,0),u.value=f.reduce((c,{blockSize:p})=>c+p,0)}else i.value=d.contentRect.width,u.value=d.contentRect.height},n),l.watch(()=>Xb(e),d=>{i.value=d?t.width:0,u.value=d?t.height:0}),{width:i,height:u}}function iie(){const e=l.ref(1),t=l.ref(!1),{pressSpace:n,pressShift:r,pressCtrl:a}=lie();return{canvasScale:e,pressSpace:n,pressShift:r,pressCtrl:a,disabledZoom:t}}const zm=jUe(iie);function lie(){const e=l.ref(!1),t=l.ref(!1),n=l.ref(!1);return vj(" ",r=>{var a=r.target;["INPUT","TEXTAREA"].includes(a.tagName)||r.preventDefault(),e.value=!0}),mj(" ",()=>{e.value=!1}),vj("Shift",r=>{r.preventDefault(),t.value=!0}),mj("Shift",()=>{t.value=!1}),vj("Control",r=>{r.preventDefault(),n.value=!0}),mj("Control",()=>{n.value=!1}),{pressSpace:e,pressShift:t,pressCtrl:n}}function uie(e){const{pressSpace:t}=zm();let n=0,r=0;function a(u){var d;n=u.x,r=u.y,(d=u.dataTransfer)==null||d.setDragImage(document.createElement("div"),0,0)}function o(u){if(u.preventDefault(),!u.x||!u.y||!t.value)return;const d=u.x-n,s=u.y-r;n=u.x,r=u.y,e.value&&(e.value.scrollTop-=s,e.value.scrollLeft-=d)}function i(){t.value=!1}return{handleElementDragStart:a,handleElementDrag:o,handleElementDragEnd:i}}function sie(e){const{pressCtrl:t,canvasScale:n,disabledZoom:r}=zm();function a(o){if(!t.value||r.value)return;o.preventDefault();let i=0;o.deltaY<0?i=n.value+.05:i=n.value-.05,!(i>150||i<.5)&&(n.value=i)}return l.watch(()=>n.value,o=>{e.value&&!r.value&&(e.value.style.transform=`scale(${o})`)}),{handleZoom:a,canvasScale:n}}function cie(e,t=16.66){let n;function r(){a(),n=window.setInterval(e,t)}function a(){window.clearInterval(n)}return{startTimedQuery:r,stopTimedQuery:a}}function rKe(e,t){let n=null;return(...r)=>{n&&clearTimeout(n),n=setTimeout(()=>{e.apply(this,r)},t)}}let die=class{constructor(){Kb(this,"components",{});Kb(this,"componentConfigs",{});Kb(this,"schemaGroup",[]);Kb(this,"schemaGroupList",l.ref([]));Kb(this,"viewsContainers",{activitybars:[],rightSidebars:[]});Kb(this,"publicMethods",{})}component(t,n){typeof n=="function"&&(n=Bc(n)),this.components[t]=n}registerComponent(t){this.component(t.defaultSchema.type,t.component),t.defaultSchema.input&&(t.config.action||(t.config.action=[]),t.config.action.unshift({type:"setValue",describe:"设置值",argsConfigs:[{...t.defaultSchema,label:"设置数据",field:"0"}]},{type:"getValue",describe:"获取值"})),this.componentConfigs[t.defaultSchema.type]=t}getComponents(){return this.components}getComponent(t){return this.components[t]}registerActivitybar(t){typeof t.component=="function"&&(t.component=Bc(t.component));const n=this.viewsContainers.activitybars.findIndex(r=>r.id===t.id);n!==-1?this.viewsContainers.activitybars[n]=t:this.viewsContainers.activitybars.push(t)}getActivitybars(){return this.viewsContainers.activitybars}registerRightSidebar(t){typeof t.component=="function"&&(t.component=Bc(t.component));const n=this.viewsContainers.rightSidebars.findIndex(r=>r.id===t.id);n!==-1?this.viewsContainers.rightSidebars[n]=t:this.viewsContainers.rightSidebars.push(t)}getRightSidebars(){return this.viewsContainers.rightSidebars}getComponentConfings(){return this.componentConfigs}getComponentConfingByType(t){return this.componentConfigs[t]}setSchemaGroup(t){this.schemaGroup=t,this.computedSchemaGroupList()}addSchemaGroup(t){this.schemaGroup.push(t),this.computedSchemaGroupList()}computedSchemaGroupList(){const t=this.schemaGroup.map(n=>{const r=n.list.map(a=>{var i;const o=(i=this.componentConfigs[a])==null?void 0:i.defaultSchema;return o??(console.warn(`${a} 组件未注册到pluginManager中`),!1)}).filter(a=>a);return{...n,list:r}});this.schemaGroupList.value=t}getSchemaByGroup(){return this.schemaGroupList}addPublicMethod(t){this.publicMethods[t.methodName]=t}};const Jn=new die;function hj(){const e=l.ref({}),t=l.ref({});function n(d){return e.value[d]}function r(d,s){e.value[d]=s}function a(d){delete e.value[d]}function o(d){const s=Object.entries(Jn.publicMethods).reduce((f,[c,p])=>(f[c]=p.method,f),{});new Function(`const epic = this;${d}`).bind({...s,getComponent:n,find:n,defineExpose:i,publicMethods:s})()}function i(d){d!=null&&(t.value=d)}function u(d,...s){d==null||d.forEach(f=>{var c,p,v;if(f.type==="public"&&((c=Jn.publicMethods[f.methodName])==null||c.method(f.args)),f.type==="custom"&&((v=(p=t.value)[f.methodName])==null||v.call(p,...s)),f.type==="component"){(f.componentId!=null&&n(f.componentId))[f.methodName](...f.args?JSON.parse(f.args):s);return}})}return{componentInstances:e,funcs:t,getComponentInstance:n,addComponentInstance:r,removeComponentInstance:a,setMethods:o,doActions:u}}function fie(){const e=l.ref([]),t=l.ref([]),n=l.ref(null);let r=0;function a(u,d="插入组件"){const s=Date.now();r+150>s||(r=s,n.value!=null&&(e.value.push(n.value),t.value.splice(0,t.value.length)),n.value={type:d,record:JSON.stringify(u)},e.value.length>20&&e.value.unshift())}function o(){if(e.value.length===0)return!1;const u=e.value.pop();return n.value!=null&&t.value.push(n.value),n.value=u,JSON.parse(u.record)}function i(){if(t.value.length===0)return!1;const u=t.value.pop();return n.value!=null&&e.value.push(n.value),n.value=u,JSON.parse(u.record)}return{recordList:e,undoList:t,currentRecord:n,push:a,undo:o,redo:i}}const Zi=fie(),ef=l.defineComponent({name:"ENode",__name:"node",props:{record:{},modelValue:{},ruleField:{},resetFormData:{},name:{}},emits:["update:modelValue","change"],setup(e,{emit:t}){const n=e,r=l.reactive(n.record);let a=l.inject("formData",{});const o=l.inject("slots",{}),i=l.inject("pageManager",{}),u=l.inject("disabled",!1),d=l.inject("ruleFieldPrefix",null),s=l.inject("resetFormData",!1);(n.resetFormData||s)&&(a={});const f=Jn.getComponent("form-item"),c=l.ref(),p=l.ref(),v=l.useAttrs();Object.keys(v).length&&l.provide("nodeAttrs",v);const m=l.shallowRef(null),h=l.shallowRef({}),y=l.reactive({}),b=l.computed(()=>{var O,T;return(O=r.componentProps)!=null&&O.hidden?!1:typeof r.show=="boolean"?r.show:((T=r.show)==null?void 0:T.call(r,{values:a}))??!0}),g=l.computed(()=>{var k;const O=b.value&&((k=r.rules)==null?void 0:k.map(E=>({...E,validator:E.validator&&i.funcs.value[E.validator]})));let T=r.field;n.ruleField?T=n.ruleField:d&&r.field&&(T=Is(d),T.push(r.field));const R={...r,rules:O,rule:O,field:T};return R.children&&delete R.children,R}),C=l.computed(()=>Jn.getComponentConfingByType(r.type)??null),_=()=>a[r.field??""]??n.modelValue;l.watch(()=>c.value,()=>{P()});function P(){var O;r.id&&c.value&&(r.input&&(c.value.setValue=x,c.value.getValue=()=>a[r.field]||n.modelValue),c.value.setAttr=(T,R)=>r.componentProps[T]=R,c.value.getAttr=T=>r.componentProps[T],i.addComponentInstance(r.id,c.value),(O=C.value)!=null&&O.defaultSchema.input&&r.noFormItem!==!0&&p.value&&i.addComponentInstance(r.id+"formItem",p.value))}function w(){var O;r.id&&(i.removeComponentInstance(r.id),(O=C.value)!=null&&O.defaultSchema.input&&r.noFormItem!==!0&&i.removeComponentInstance(r.id+"formItem"))}async function S(){var k,E,D;if(typeof((k=r.componentProps)==null?void 0:k.defaultValue)<"u"){const N=a[r.field]??((E=r.componentProps)==null?void 0:E.defaultValue);x(Is(N))}if(r.type==="slot"){const N=r.slotName;if(!N)return;m.value=l.defineComponent({setup(){return()=>l.renderSlot(o,N,{record:r,model:a})}});return}const O=Jn.getComponent(r.type);if(!O){console.error(`组件${r.type}未注册`);return}const T=((D=C.value)==null?void 0:D.bindModel)??"modelValue";if(typeof O=="function"){const N=await O();m.value=N.default??N}else m.value=O;const R={};r.on&&Object.keys(r.on).forEach(N=>{R[`on${Xoe(N)}`]=(...I)=>i.doActions(r.on[N],...I)}),h.value={...n,disabled:u||r.disabled,bindModel:T,[`onUpdate:${T}`]:x,...R}}function x(O){t("update:modelValue",O),t("change",O),r.field&&(a[r.field]=O)}let M=null;return l.watch(()=>r,O=>{const T=JSON.stringify({...O,children:void 0});if(T===M)return!1;M=T,S()},{immediate:!0,deep:!0}),l.onUnmounted(w),(O,T)=>{var k;const R=l.resolveComponent("ENode");return r.noFormItem!==!0&&((k=C.value)!=null&&k.defaultSchema.input)&&m.value&&b.value?(l.openBlock(),l.createBlock(l.unref(f),l.mergeProps({key:0,ref_key:"formItemRef",ref:p},g.value),{default:l.withCtx(()=>[(l.openBlock(),l.createBlock(l.resolveDynamicComponent(m.value),l.mergeProps({ref_key:"componentInstance",ref:c,onVnodeMounted:P},{...h.value,...r.componentProps,...y,[h.value.bindModel]:_()}),{node:l.withCtx(E=>[l.createVNode(R,l.normalizeProps(l.guardReactiveProps(E)),null,16)]),"edit-node":l.withCtx(()=>[l.renderSlot(O.$slots,"edit-node")]),_:3},16))]),_:3},16)):m.value&&b.value?(l.openBlock(),l.createBlock(l.resolveDynamicComponent(m.value),l.mergeProps({key:1,onVnodeMounted:P,ref_key:"componentInstance",ref:c,model:l.unref(a)},{...h.value,...r.componentProps,...y,[h.value.bindModel]:_()}),{node:l.withCtx(E=>[l.createVNode(R,l.normalizeProps(l.guardReactiveProps(E)),null,16)]),"edit-node":l.withCtx(()=>[l.renderSlot(O.$slots,"edit-node")]),_:3},16,["model"])):l.createCommentVNode("",!0)}}}),aKe=Object.freeze(Object.defineProperty({__proto__:null,default:ef},Symbol.toStringTag,{value:"Module"})),oKe={class:"epic-builder-main"},iKe={class:"loading-box"},pie=l.defineComponent({__name:"builder",props:{pageSchema:{}},emits:["ready"],setup(e,{expose:t,emit:n}){const r=e,a=Bc(()=>Promise.resolve().then(()=>Whe)),o=hj(),i=l.useSlots(),u=l.ref({}),d=l.ref(!1),s=l.reactive({schemas:[]});l.watch(()=>r.pageSchema,h=>{jc(s,h)},{immediate:!0,deep:!0}),l.watch(()=>s.script,h=>{h&&h!==""&&o.setMethods(h)},{immediate:!0}),l.provide("slots",i),l.provide("pageManager",o),l.provide("forms",u),l.provide("pageSchema",s);function f(h="default"){return new Promise(async(y,b)=>{var _;if(!d.value){const P=l.watch(d,()=>{P(),y(f(h))});return}const g=(_=u.value)==null?void 0:_[h];if(!g)return b(`表单 [name=${h}] 不存在`),!1;const C=Is(await g.getData());y(C)})}function c(h="default"){return new Promise(async(y,b)=>{var C;if(!d.value){const _=l.watch(d,()=>{_(),y(f(h))});return}const g=(C=u.value)==null?void 0:C[h];if(!g)return b(`表单 [name=${h}] 不存在`),!1;try{await g.validate();const _=await g.getData();y(_)}catch(_){b(_)}})}function p(h,y="default"){var g;if(!d.value){const C=l.watch(d,()=>{C(),p(h,y)});return}const b=(g=u.value)==null?void 0:g[y];if(!b)return console.error(`表单 [name=${y}] 不存在`),!1;b.setData(h)}const{proxy:v}=l.getCurrentInstance();function m(){l.nextTick(()=>{d.value=!0,n("ready",o),v&&o.addComponentInstance("builder",v)})}return t({ready:d,getData:f,setData:p,validate:c}),(h,y)=>(l.openBlock(),l.createBlock(l.Suspense,{onResolve:m},{default:l.withCtx(()=>[l.createElementVNode("div",oKe,[(l.openBlock(!0),l.createElementBlock(l.Fragment,null,l.renderList(s.schemas,(b,g)=>(l.openBlock(),l.createBlock(l.unref(ef),{key:g,record:b},null,8,["record"]))),128))])]),fallback:l.withCtx(()=>[l.createElementVNode("div",iKe,[l.createVNode(l.unref(a))])]),_:1}))}}),lKe={class:"epic-designer-main"},uKe={class:"epic-header-container"},sKe={class:"loading-box"},gj=`const { defineExpose, find } = epic; function test (){ console.log('test') } // 通过defineExpose暴露的函数或者属性 defineExpose({ test })`,cKe=l.defineComponent({__name:"designer",props:{disabledZoom:{type:Boolean,default:!1},hiddenHeader:{type:Boolean,default:!1}},emits:["ready","save"],setup(e,{expose:t,emit:n}){const r=e,a=Bc(()=>Promise.resolve().then(()=>i$t)),o=Bc(()=>Promise.resolve().then(()=>f$t)),i=Bc(()=>Promise.resolve().then(()=>mFt)),u=Bc(()=>Promise.resolve().then(()=>xFt)),d=Bc(()=>Promise.resolve().then(()=>Whe)),s=hj(),f=l.reactive({checkedNode:null,hoverNode:null,disableHover:!1,matched:[]}),c=l.reactive({schemas:[],script:""}),{disabledZoom:p}=zm();l.watch(()=>r.disabledZoom,S=>{p.value=S},{immediate:!0}),l.watch(()=>c.script,S=>{S&&S!==""&&s.setMethods(S)});const v=[{type:"page",id:"root",label:"页面",children:[],componentProps:{style:{padding:"16px"}}}];c.script=gj,l.provide("pageSchema",c),l.provide("pageManager",s),l.provide("designerProps",r),l.provide("designer",{setCheckedNode:h,setHoverNode:y,setDisableHover:g,reset:P,state:f});function m(){c.schemas=Is(v),h(c.schemas[0]),Zi.push(c.schemas,"初始化撤销功能")}async function h(S=c.schemas[0]){f.checkedNode=S,f.matched=Zoe(c.schemas,S.id)}async function y(S=null){var x;if(!S||f.disableHover)return f.hoverNode=null,!1;if((S==null?void 0:S.id)===((x=f.hoverNode)==null?void 0:x.id))return!1;f.hoverNode=S}function b(){l.nextTick(()=>{n("ready",{pageManager:s})})}async function g(S=!1){f.disableHover=S}function C(S){jc(c,S)}function _(){return l.toRaw(c)}function P(){cj(c.schemas,v)&&c.script===gj||(jc(c.schemas,v),c.script=gj,h(c.schemas[0]),Zi.push(c.schemas,"重置操作"))}function w(){n("save",l.toRaw(c))}return m(),t({setData:C,getData:_,reset:P}),(S,x)=>(l.openBlock(),l.createBlock(l.Suspense,{onResolve:b},{default:l.withCtx(()=>[l.createElementVNode("div",lKe,[l.createElementVNode("div",uKe,[l.renderSlot(S.$slots,"header",{},()=>[r.hiddenHeader?l.createCommentVNode("",!0):(l.openBlock(),l.createBlock(l.unref(a),{key:0,onSave:w},{header:l.withCtx(()=>[l.renderSlot(S.$slots,"header-prefix")]),prefix:l.withCtx(()=>[l.renderSlot(S.$slots,"header-prefix")]),title:l.withCtx(()=>[l.renderSlot(S.$slots,"header-title")]),"right-prefix":l.withCtx(()=>[l.renderSlot(S.$slots,"header-right-prefix")]),"right-action":l.withCtx(()=>[l.renderSlot(S.$slots,"header-right-action")]),"right-suffix":l.withCtx(()=>[l.renderSlot(S.$slots,"header-right-suffix")]),_:3}))])]),l.createElementVNode("div",{class:l.normalizeClass(["epic-split-view-container",{"hidden-header":S.hiddenHeader}])},[l.createVNode(l.unref(o)),l.createVNode(l.unref(i)),l.createVNode(l.unref(u))],2)])]),fallback:l.withCtx(()=>[l.createElementVNode("div",sKe,[l.createVNode(l.unref(d))])]),_:3}))}}),dKe={component:async()=>await Promise.resolve().then(()=>MFt),defaultSchema:{label:"代码编辑器",type:"monacoEditor",field:"monacoEditor",icon:"epic-icon-write",input:!0},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"monacoEditor",field:"componentProps.defaultValue"}]},bindModel:"model-value"},fKe={component:async()=>await Promise.resolve().then(()=>kFt),defaultSchema:{label:"页面",type:"page",componentProps:{},children:[]},config:{attribute:[{label:"页面名称",type:"input",componentProps:{placeholder:"请输入"},field:"name"}]}};function pKe(e){e.component("ETabPaneEditor",async()=>await Promise.resolve().then(()=>EFt)),e.component("EInputSize",async()=>await Promise.resolve().then(()=>DFt)),e.component("EColEditor",async()=>await Promise.resolve().then(()=>VFt)),e.component("EActionEditor",async()=>await Promise.resolve().then(()=>_Bt)),e.component("ERuleEditor",async()=>await Promise.resolve().then(()=>IBt)),e.component("EOptionsEditor",async()=>await Promise.resolve().then(()=>VBt)),e.component("ENode",async()=>await Promise.resolve().then(()=>aKe)),e.registerActivitybar({id:"component_view",title:"组件",icon:"epic-icon-mokuai_1",component:async()=>await Promise.resolve().then(()=>WBt)}),e.registerActivitybar({id:"sound_code_view",title:"源码",icon:"epic-icon-daima1",component:async()=>await Promise.resolve().then(()=>GBt)}),e.registerActivitybar({id:"outline_view",title:"大纲",icon:"epic-icon-juxingkaobei",component:async()=>await Promise.resolve().then(()=>QBt)}),e.registerRightSidebar({id:"attribute_view",title:"属性",component:async()=>await Promise.resolve().then(()=>t5t)}),e.registerRightSidebar({id:"style_view",title:"样式",component:async()=>await Promise.resolve().then(()=>a5t)}),e.registerRightSidebar({id:"event_view",title:"事件",component:async()=>await Promise.resolve().then(()=>l5t)}),[dKe,fKe].forEach(n=>{e.registerComponent(n)})}const e1n="";pKe(Jn);const vKe={component:()=>Promise.resolve().then(()=>h3),defaultSchema:{label:"输入框",type:"input",field:"input",icon:"epic-icon-write",input:!0,componentProps:{bordered:!0,placeholder:"请输入"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"默认值",type:"input",field:"componentProps.defaultValue",componentProps:{placeholder:"请输入"}},{label:"输入类型",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"text",value:"text"},{label:"number",value:"number"},{label:"password",value:"password"}]},field:"componentProps.type"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"可清空",type:"switch",field:"componentProps.allowClear"},{label:"有边框",type:"switch",field:"componentProps.bordered"},{label:"最大输入长度",type:"number",field:"componentProps.maxLength",componentProps:{placeholder:"请输入"}},{label:"统计字数",type:"switch",field:"componentProps.showCount"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"input",describe:"输入值"},{type:"change",describe:"值修改"},{type:"pressEnter",describe:"按下回车的回调"},{type:"focus",describe:"获取焦点"},{type:"blur",describe:"失去焦点"}],action:[{type:"focus",describe:"使 input 获取焦点"},{type:"blur",describe:"使 input 失去焦点"},{type:"select",describe:"选中 input 中的文字"}]},bindModel:"value"},mKe={component:async()=>(await Promise.resolve().then(()=>h3)).Textarea,defaultSchema:{label:"文本域",type:"textarea",field:"textarea",icon:"epic-icon-edit",input:!0,componentProps:{placeholder:"请输入"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"textarea",field:"componentProps.defaultValue",componentProps:{placeholder:"请输入"}},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"最小行数",type:"number",field:"componentProps.autoSize.minRows",componentProps:{placeholder:"请输入"}},{label:"最大行数",type:"number",field:"componentProps.autoSize.maxRows",componentProps:{placeholder:"请输入"}},{label:"有边框",type:"switch",field:"componentProps.bordered"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"最大输入长度",type:"number",field:"componentProps.maxLength",componentProps:{placeholder:"请输入"}},{label:"统计字数",type:"switch",field:"componentProps.showCount"},{label:"可清除",type:"switch",field:"componentProps.allowClear"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"input",describe:"输入值"},{type:"change",describe:"值修改"},{type:"pressEnter",describe:"按下回车的回调"},{type:"focus",describe:"获取焦点"},{type:"blur",describe:"失去焦点"}],action:[{type:"focus",describe:"使 input 获取焦点"},{type:"blur",describe:"使 input 失去焦点"},{type:"select",describe:"选中 input 中的文字"}]},bindModel:"value"},hKe={component:()=>Promise.resolve().then(()=>A6t),defaultSchema:{label:"数字输入框",type:"number",icon:"epic-icon-number",field:"number",input:!0,componentProps:{style:{width:"100%"},placeholder:"请输入"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"文字",type:"input",field:"label"},{label:"默认值",type:"input",field:"componentProps.defaultValue",componentProps:{placeholder:"请输入",size:"middle"}},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"键盘快捷行为",type:"switch",field:"componentProps.keyboard"},{label:"最大值",type:"number",field:"componentProps.max",componentProps:{placeholder:"请输入"}},{label:"最小值",type:"number",field:"componentProps.min",componentProps:{placeholder:"请输入"}},{label:"精度",type:"number",field:"componentProps.precision",componentProps:{placeholder:"请输入"}},{label:"步长",type:"number",field:"componentProps.step",componentProps:{placeholder:"请输入"}},{label:"字符模式",type:"switch",field:"componentProps.stringMode"},{label:"有边框",type:"switch",field:"componentProps.bordered"},{label:"可清空",type:"switch",field:"componentProps.allowClear"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"input",describe:"输入值"},{type:"change",describe:"值修改"},{type:"pressEnter",describe:"按下回车的回调"},{type:"focus",describe:"获取焦点"},{type:"blur",describe:"失去焦点"}],action:[{type:"focus",describe:"使 input 获取焦点"},{type:"blur",describe:"使 input 失去焦点"},{type:"select",describe:"选中 input 中的文字"}]},bindModel:"value"},gKe={component:async()=>(await Promise.resolve().then(()=>h3)).InputPassword,defaultSchema:{label:"密码输入框",type:"password",icon:"epic-icon-mima",field:"password",input:!0,componentProps:{placeholder:"请输入",bordered:!0}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"文字",type:"input",field:"label"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"有边框",type:"switch",field:"componentProps.bordered"},{label:"最大输入长度",type:"number",field:"componentProps.maxLength",componentProps:{placeholder:"请输入"}},{label:"统计字数",type:"switch",field:"componentProps.showCount"},{label:"可清空",type:"switch",field:"componentProps.allowClear"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"input",describe:"输入值"},{type:"change",describe:"值修改"},{type:"pressEnter",describe:"按下回车的回调"},{type:"focus",describe:"获取焦点"},{type:"blur",describe:"失去焦点"}],action:[{type:"focus",describe:"使 input 获取焦点"},{type:"blur",describe:"使 input 失去焦点"},{type:"select",describe:"选中 input 中的文字"}]},bindModel:"value"},bKe={component:()=>Promise.resolve().then(()=>H6t),defaultSchema:{label:"单选框",type:"radio",icon:"epic-icon-danxuan-cuxiantiao",field:"radio",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}],optionType:"default"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"默认值",type:"radio",field:"componentProps.defaultValue"},{label:"文字",type:"input",field:"label"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"option类型",type:"select",componentProps:{options:[{label:"default",value:"default"},{label:"button",value:"button"}]},field:"componentProps.optionType"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}]},bindModel:"value"},yKe={component:()=>Promise.resolve().then(()=>Z6t),defaultSchema:{label:"多选框",type:"checkbox",icon:"epic-icon-duoxuan1",field:"checkbox",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}]}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"默认值",type:"checkbox",field:"componentProps.defaultValue"},{label:"文字",type:"input",field:"label"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}]},bindModel:"value"},CKe={component:()=>Promise.resolve().then(()=>C8t),defaultSchema:{label:"选择框",type:"select",icon:"epic-icon-xiala",field:"select",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}],listHeight:256,placeholder:"请选择",placement:"bottomLeft"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"文字",type:"input",field:"label"},{label:"占位内容",type:"input",field:"componentProps.placeholder",componentProps:{placeholder:"请输入"}},{label:"默认值",type:"select",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"label包装到value中",type:"switch",field:"componentProps.labelInValue"},{label:"设置弹窗高度",type:"number",field:"componentProps.listHeight"},{label:"模式",type:"select",componentProps:{options:[{label:"multiple",value:"multiple"},{label:"tags",value:"tags"}],placeholder:"请选择",allowClear:!0},field:"componentProps.mode"},{label:"可搜索",type:"switch",field:"componentProps.showSearch"},{label:"选中选项后清空搜索框",type:"switch",field:"componentProps.autoClearSearchValue",show:({values:e})=>e.componentProps.mode&&e.componentProps.showSearch},{label:"最大tag文本长度",type:"number",field:"componentProps.maxTagTextLength",show:({values:e})=>e.componentProps.mode},{label:"最大tag显示数",type:"number",field:"componentProps.maxTagCount",show:({values:e})=>e.componentProps.mode},{label:"弹出框位置",type:"select",componentProps:{options:[{label:"bottomLeft",value:"bottomLeft"},{label:"bottomRight",value:"bottomRight"},{label:"topLeft",value:"topLeft"},{label:"topRight",value:"topRight"}]},field:"componentProps.placement"},{label:"可清空",type:"switch",field:"componentProps.allowClear"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值修改"},{type:"focus",describe:"获取焦点"},{type:"blur",describe:"失去焦点"}],action:[{type:"focus",describe:"使 input 获取焦点"},{type:"blur",describe:"使 input 失去焦点"},{type:"select",describe:"选中 input 中的文字"}]},bindModel:"value"},_Ke={component:()=>Promise.resolve().then(()=>G8t),defaultSchema:{label:"滑块",type:"slider",icon:"epic-icon-menu",field:"slider",input:!0},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"文字",type:"input",field:"label"},{label:"默认值",type:"slider",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"倒转轨道",type:"switch",field:"componentProps.reverse"},{label:"步长",type:"number",field:"componentProps.step",componentProps:{placeholder:"请输入"}},{label:"最小值",type:"number",field:"componentProps.min",componentProps:{placeholder:"请输入"}},{label:"最大值",type:"number",field:"componentProps.max",componentProps:{placeholder:"请输入"}},{label:"垂直模式",type:"switch",field:"componentProps.vertical"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"afterChange",describe:"与mouseup触发时机一致"},{type:"change",describe:"拖拽结束改变值时"}]},bindModel:"value"},wKe={component:()=>Promise.resolve().then(()=>$qt),defaultSchema:{label:"时间选择器",type:"time",icon:"epic-icon-time",field:"time",input:!0,componentProps:{valueFormat:"HH:mm:ss",size:"middle",placement:"bottomLeft",placeholder:"请输入"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"文字",type:"input",field:"label"},{label:"默认值",type:"time",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"格式",type:"input",field:"componentProps.valueFormat",onChange:e=>{e.values.componentProps.format=e.value}},{label:"尺寸",type:"select",defaultValue:"default",componentProps:{options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"有边框",type:"switch",field:"componentProps.bordered"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"小时选项间隔",type:"number",field:"componentProps.hourStep",componentProps:{placeholder:"请输入"}},{label:"分钟选项间隔",type:"number",field:"componentProps.minuteStep",componentProps:{placeholder:"请输入"}},{label:"秒选项间隔",type:"number",field:"componentProps.secondStep",componentProps:{placeholder:"请输入"}},{label:"弹出框位置",type:"select",componentProps:{options:[{label:"bottomLeft",value:"bottomLeft"},{label:"bottomRight",value:"bottomRight"},{label:"topLeft",value:"topLeft"},{label:"topRight",value:"topRight"}]},field:"componentProps.placement"},{label:"可清空",type:"switch",field:"componentProps.allowClear"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}]},bindModel:"value"},PKe={component:()=>Promise.resolve().then(()=>Wqt),defaultSchema:{label:"日期选择器",type:"date",icon:"epic-icon-calendar",field:"date",input:!0,componentProps:{valueFormat:"YYYY-MM-DD",type:"date",placeholder:"请选择"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"文字",type:"input",field:"label"},{label:"默认值",type:"date",field:"componentProps.defaultValue"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"弹出框位置",type:"select",componentProps:{options:[{label:"bottomLeft",value:"bottomLeft"},{label:"bottomRight",value:"bottomRight"},{label:"topLeft",value:"topLeft"},{label:"topRight",value:"topRight"}],placeholder:"请选择"},field:"componentProps.placement"},{label:"占位内容",type:"input",field:"componentProps.placeholder",componentProps:{placeholder:"请输入"},show:({values:e})=>e.componentProps.type!=="daterange"},{label:"开始占位符",type:"input",field:"componentProps.placeholder.0",show:({values:e})=>e.componentProps.type==="daterange"},{label:"结束占位符",type:"input",field:"componentProps.placeholder.1",show:({values:e})=>e.componentProps.type==="daterange"},{label:"格式",type:"input",field:"componentProps.valueFormat",onChange:e=>{e.values.componentProps.format=e.value}},{label:"显示类型",type:"select",field:"componentProps.type",componentProps:{options:[{label:"日期",value:"date"},{label:"月份",value:"month"},{label:"日期范围",value:"daterange"}],placeholder:"请选择"},onChange:({value:e,values:t})=>{e==="daterange"?t.componentProps.placeholder=["开始日期","结束日期"]:t.componentProps.placeholder="请输入"}},{label:"边框",type:"radio",componentProps:{options:[{label:"有",value:void 0},{label:"无",value:!1}],placeholder:"请选择"},field:"componentProps.bordered"},{label:"增加时间选择",type:"switch",field:"componentProps.showTime"},{label:"可清空",type:"switch",field:"componentProps.allowClear"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}]},bindModel:"value"},SKe={component:()=>Promise.resolve().then(()=>eWt),defaultSchema:{label:"级联选择器",type:"cascader",field:"cascader",icon:"epic-icon-guanlian",input:!0,componentProps:{options:[{label:"选项1",value:"选项1"},{label:"选项2",value:"选项2"}],placeholder:"请选择",placement:"bottomLeft"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"标题",type:"input",field:"label"},{label:"默认值",type:"input",field:"componentProps.defaultValue"},{label:"占位内容",type:"input",field:"componentProps.placeholder"},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"多选",type:"switch",field:"componentProps.multiple"},{label:"可搜索",type:"switch",field:"componentProps.showSearch"},{label:"最大tag文本长度",type:"number",field:"componentProps.maxTagTextLength",componentProps:{placeholder:"请输入"},show:({values:e})=>e.componentProps.multiple},{label:"最大tag显示数",type:"number",field:"componentProps.maxTagCount",componentProps:{placeholder:"请输入"},show:({values:e})=>e.componentProps.multiple},{label:"弹出框位置",type:"select",componentProps:{options:[{label:"bottomLeft",value:"bottomLeft"},{label:"bottomRight",value:"bottomRight"},{label:"topLeft",value:"topLeft"},{label:"topRight",value:"topRight"}]},field:"componentProps.placement"},{label:"可清空",type:"switch",field:"componentProps.allowClear"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"选项管理",type:"EOptionsEditor",layout:"vertical",field:"componentProps.options",componentProps:{tree:!0}},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}]},bindModel:"value"},xKe={component:()=>Promise.resolve().then(()=>dWt),defaultSchema:{label:"开关",type:"switch",icon:"epic-icon-kaiguan3",field:"switch",input:!0,componentProps:{}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"文字",type:"input",field:"label"},{label:"默认值",type:"switch",field:"componentProps.defaultValue"},{label:"选中时内容",type:"input",field:"componentProps.checkedChildren",componentProps:{placeholder:"请输入"}},{label:"非选中时内容",type:"input",field:"componentProps.unCheckedChildren",componentProps:{placeholder:"请输入"}},{label:"尺寸",type:"select",componentProps:{placeholder:"请选择",allowClear:!0,options:[{label:"default",value:"default"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}],event:[{type:"change",describe:"值变化时"}]},bindModel:"checked"},OKe={component:()=>Promise.resolve().then(()=>V9t),defaultSchema:{label:"上传图片",type:"upload-image",icon:"epic-icon-image",field:"uploadImage",input:!0,componentProps:{action:"https://mock.presstime.cn/mock/6562298755736ae9dfa4646a/epic/upload"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"文字",type:"input",field:"label"},{label:"请求地址",type:"input",field:"componentProps.action"},{label:"多选",type:"switch",field:"componentProps.multiple"},{label:"允许上传最大数量",type:"number",field:"componentProps.maxCount",componentProps:{min:0,placeholder:"请输入"}},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}]},bindModel:"modelValue"},MKe={component:()=>Promise.resolve().then(()=>B9t),defaultSchema:{label:"上传文件",type:"upload-file",icon:"epic-icon-upload",field:"uploadFile",input:!0,componentProps:{action:"https://mock.presstime.cn/mock/6562298755736ae9dfa4646a/epic/upload"}},config:{attribute:[{label:"字段名",type:"input",field:"field"},{label:"文字",type:"input",field:"label"},{label:"请求地址",type:"input",field:"componentProps.action"},{label:"多选",type:"switch",field:"componentProps.multiple"},{label:"允许上传最大数量",type:"number",field:"componentProps.maxCount",componentProps:{min:0,placeholder:"请输入"}},{label:"禁用",type:"switch",field:"componentProps.disabled"},{label:"隐藏",type:"switch",field:"componentProps.hidden"},{label:"表单校验",type:"ERuleEditor",layout:"vertical",field:"rules",describe:"校验规则需要配合表单使用"}]},bindModel:"modelValue"},TKe={component:()=>Promise.resolve().then(()=>DUt),defaultSchema:{label:"卡片布局",type:"card",icon:"epic-icon-qiapian",children:[]},config:{attribute:[{label:"标题",type:"input",field:"label"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}]}},kKe={component:()=>Promise.resolve().then(()=>BUt),defaultSchema:{label:"栅格布局",type:"row",icon:"epic-icon-zhage",childImmovable:!0,children:[{type:"col",children:[],componentProps:{span:12}},{type:"col",children:[],componentProps:{span:12}}]},config:{attribute:[{label:"垂直对齐方式",type:"select",componentProps:{style:{width:"100%"},options:[{label:"top",value:"top"},{label:"middle",value:"middle"},{label:"bottom",value:"bottom"}],placeholder:"请选择"},field:"componentProps.align"},{label:"水平排列方式",type:"select",componentProps:{style:{width:"100%"},options:[{label:"start",value:"start"},{label:"end",value:"end"},{label:"center",value:"center"},{label:"space-around",value:"space-around"},{label:"space-around",value:"space-around"}],placeholder:"请选择"},field:"componentProps.justify"},{label:"栅格间距",type:"input",field:"componentProps.gutter",componentProps:{placeholder:"请输入"}},{label:"列编辑",type:"EColEditor",field:"children"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}]}},RKe={component:()=>Promise.resolve().then(()=>HUt),defaultSchema:{label:"栅格布局-列",type:"col",icon:"epic-icon-xiala",children:[],componentProps:{span:6}},config:{attribute:[{label:"占位格数",type:"number",field:"componentProps.span"}]}},IKe={component:()=>Promise.resolve().then(()=>iQt),defaultSchema:{label:"表单",type:"form",icon:"epic-icon-daibanshixiang",labelWidth:100,name:"default",componentProps:{layout:"horizontal",labelWidth:100,labelLayout:"fixed",labelCol:{span:5},wrapperCol:{span:19},hideRequiredMark:!1,colon:!0,labelAlign:"right",size:"middle"},children:[]},config:{attribute:[{label:"标签布局",type:"radio",field:"componentProps.labelLayout",componentProps:{options:[{label:"固定宽度",value:"fixed"},{label:"自适应宽度",value:"flex"}]}},{label:"labelWidth",type:"input",field:"componentProps.labelWidth",show:({values:e})=>{var t;return((t=e.componentProps)==null?void 0:t.labelLayout)==="fixed"}},{label:"labelCol",type:"input",field:"componentProps.labelCol.span",show:({values:e})=>{var t;return((t=e.componentProps)==null?void 0:t.labelLayout)==="flex"}},{label:"wrapperCol",type:"input",field:"componentProps.wrapperCol.span",show:({values:e})=>{var t;return((t=e.componentProps)==null?void 0:t.labelLayout)==="flex"}},{label:"显示冒号",type:"switch",field:"componentProps.colon"},{label:"对齐方式",type:"select",componentProps:{options:[{label:"left",value:"left"},{label:"right",value:"right"}]},field:"componentProps.labelAlign"},{label:"标签文本换行",type:"switch",field:"componentProps.labelWrap"},{label:"表单布局",type:"select",componentProps:{options:[{label:"horizontal",value:"horizontal"},{label:"vertical",value:"vertical"},{label:"inline",value:"inline"}]},field:"componentProps.layout"},{label:"尺寸",type:"select",defaultValue:"default",componentProps:{options:[{label:"large",value:"large"},{label:"middle",value:"middle"},{label:"small",value:"small"}]},field:"componentProps.size"},{label:"隐藏",type:"switch",field:"componentProps.hidden"}],action:[{type:"getData",describe:"获取表单数据"},{type:"setData",describe:"设置表单数据"},{type:"validate",describe:"校验表单"}]}},EKe={component:()=>Promise.resolve().then(()=>lQt),defaultSchema:{label:"表单项",type:"form-item",icon:"epic-icon-qiapian"},config:{}},DKe={component:()=>Promise.resolve().then(()=>uQt),defaultSchema:{label:"按钮",type:"button",field:"input",icon:"epic-icon-button-remove",input:!1,componentProps:{}},config:{attribute:[{label:"标题",type:"input",field:"label"},{label:"类型",type:"select",componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"primary",value:"primary"},{label:"ghost",value:"ghost"},{label:"dashed",value:"dashed"},{label:"link",value:"link"},{label:"text",value:"text"},{label:"default",value:"default"}]},field:"componentProps.type"},{label:"链接",type:"input",field:"componentProps.href",componentProps:{allowClear:!0,placeholder:"请输入"}},{label:"链接打开方式",type:"select",field:"componentProps.target",show:({values:e})=>e.componentProps.href,componentProps:{placeholder:"请选择",clearable:!0,options:[{label:"blank",value:"_blank"},{label:"parent",value:"_parent"},{label:"self",value:"_self"},{label:"top",v