You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
2.3 KiB
JavaScript

import{d as f}from"./vuedraggable.umd-DHVlFYOg.js";import g from"./LayoutItem-BBxzcbPX.js";import{a as h}from"./useFormDesignState-DLztCSBe.js";import{a2 as v,au as _,f as C}from"./antd-BY-1PcYE.js";import{d as y,c as S,aa as r,_ as E,$ as F,m as I,A as D,k as s,a9 as c,a0 as b,ak as k,al as A}from"./vue-aEZWZQSa.js";import{_ as V}from"./entry/index-CwTXVJ2d-1723001953242.js";import"./FormNode-hm-EsU8H.js";import"./FormNodeOperate-BCq-VBZS.js";import"./index-CyxTcJnj.js";import"./index-vqgsnc6D.js";import"./formItemConfig-BP5YjAXQ.js";import"./componentMap-S705cJLS.js";import"./RadioButtonGroup.vue_vue_type_script_setup_true_lang-Cx2YeHC7.js";import"./index-B4wZYO02.js";import"./index-DVEqH4Di.js";import"./useWindowSizeFn-C93ItSr2.js";import"./useSortable-BAwH_r98.js";import"./download-Da_OLLnH.js";import"./useLoading-B4X4QuoY.js";import"./copyTextToClipboard-BBFF3Y3I.js";import"./onMountedOrActivated-BIJ0U1R1.js";import"./style-DTWqfx8n.js";const $=y({name:"FormComponentPanel",components:{LayoutItem:g,draggable:f,Form:v,Empty:_},emits:["handleSetSelectItem"],setup(o,{emit:a}){const{formConfig:e}=h(),i=({newIndex:t})=>{e.value.schemas=e.value.schemas||[];const m=e.value.schemas;m[t]=C(m[t]),a("handleSetSelectItem",m[t])},l=t=>{a("handleSetSelectItem",e.value.schemas[t.oldIndex])},p=S(()=>e.value.layout==="horizontal"?"Col":"div");return{addItem:i,handleDragStart:l,formConfig:e,layoutTag:p}}}),B={class:"form-panel v-form-container"},P={class:"draggable-box"};function L(o,a,e,i,l,p){const t=r("Empty"),m=r("LayoutItem"),d=r("draggable"),u=r("Form");return E(),F("div",B,[I(s(t,{class:"empty-text",description:"从左侧选择控件添加"},null,512),[[D,o.formConfig.schemas.length===0]]),s(u,k(A(o.formConfig)),{default:c(()=>[b("div",P,[s(d,{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]=n=>o.formConfig.schemas=n),"item-key":"key",onAdd:o.addItem,onStart:o.handleDragStart},{item:c(({element:n})=>[s(m,{class:"drag-move",schema:n,data:o.formConfig,"current-item":o.formConfig.currentItem||{}},null,8,["schema","data","current-item"])]),_:1},8,["modelValue","onAdd","onStart"])])]),_:1},16)])}const to=V($,[["render",L],["__scopeId","data-v-e8f4c48e"]]);export{to as default};