FormComponentPanel-b5e58352.js
2.38 KB
import{d as f}from"./vuedraggable.umd-7ff3c7c5.js";import g from"./LayoutItem-e6faaf19.js";import{d as _,e as h,a8 as r,_ as v,$ as C,v as y,A as F,f as n,aa as d,a0 as S,aj as E,ak as I}from"./vue-5a35c3f5.js";import{a as D}from"./useFormDesignState-032955db.js";import{ay as b,a4 as A,T as P}from"./antd-6b087f69.js";import{_ as V}from"./index.js";import"./FormNode-f6a6523f.js";import"./FormNodeOperate-62e3bb93.js";import"./index-15077a33.js";import"./index-e75bbbfe.js";import"./formItemConfig-88eb9e72.js";import"./componentMap-4d1c941b.js";import"./useFormItem-9ea791b8.js";import"./RadioButtonGroup-72b65d2e.js";import"./index-c1c2669a.js";import"./useWindowSizeFn-cc2fb57c.js";import"./uuid-31b8b5a4.js";import"./download-3d468407.js";import"./base64Conver-39fc0d26.js";import"./index-1ca3bd8a.js";import"./IconPicker-6bbd557c.js";import"./index-9a895eb5.js";const k=_({name:"FormComponentPanel",components:{LayoutItem:g,draggable:f,Form:b,Empty:A},emits:["handleSetSelectItem"],setup(o,{emit:a}){const{formConfig:e}=D(),i=({newIndex:t})=>{e.value.schemas=e.value.schemas||[];const m=e.value.schemas;m[t]=P(m[t]),a("handleSetSelectItem",m[t])},l=t=>{a("handleSetSelectItem",e.value.schemas[t.oldIndex])},p=h(()=>e.value.layout==="horizontal"?"Col":"div");return{addItem:i,handleDragStart:l,formConfig:e,layoutTag:p}}});const $={class:"form-panel v-form-container"},B={class:"draggable-box"};function w(o,a,e,i,l,p){const t=r("Empty"),m=r("LayoutItem"),c=r("draggable"),u=r("Form");return v(),C("div",$,[y(n(t,{class:"empty-text",description:"从左侧选择控件添加"},null,512),[[F,o.formConfig.schemas.length===0]]),n(u,E(I(o.formConfig)),{default:d(()=>[S("div",B,[n(c,{class:"list-main ant-row",group:"form-draggable","component-data":{name:"list",tag:"div",type:"transition-group"},ghostClass:"moving",animation:180,handle:".drag-move",modelValue:o.formConfig.schemas,"onUpdate:modelValue":a[0]||(a[0]=s=>o.formConfig.schemas=s),"item-key":"key",onAdd:o.addItem,onStart:o.handleDragStart},{item:d(({element:s})=>[n(m,{class:"drag-move",schema:s,data:o.formConfig,"current-item":o.formConfig.currentItem||{}},null,8,["schema","data","current-item"])]),_:1},8,["modelValue","onAdd","onStart"])])]),_:1},16)])}const to=V(k,[["render",w],["__scopeId","data-v-7c3ae3a9"],["__file","E:/allcode/erp/test7901/order-erp-front/src/views/form-design/components/VFormDesign/modules/FormComponentPanel.vue"]]);export{to as default};