import{T as U}from"./TEditor.fed75c12.js";import{d as N,r as g,p as C,c as k,e as o,f as i,g as s,F as f,j as h,t as m,h as p,i as c,u as y,n as A,m as r,A as $,y as D,E as O,_ as S}from"./index.0308b213.js";import"./index.esm.3fe50213.js";const j={class:"content"},z={class:"left"},M=["onClick"],q={class:"right"},G=r("\u8868\u5355\u6807\u9898"),H={style:{display:"flex",width:"100%"},class:"item_title"},I={style:{color:"#a6a6a6","padding-left":"20px"}},J=r("\u5220\u9664"),K={style:{width:"100%"},class:"item_content"},P={key:0,style:{width:"90%"}},Q={key:1,style:{width:"100%"}},R=r("\u6807\u9898"),W={key:0,style:{"flex-wrap":"wrap",width:"100%"}},X={style:{width:"300px"}},Y=r("\u5220\u9664"),Z={style:{width:"100%","margin-top":"10px","margin-left":"50px"}},ee=r("\u65B0\u589E\u9009\u9879"),te=N({props:{config:null},emits:["update:config"],setup(E,{emit:L}){const V=E;let u=g({title:"\u6807\u9898",fromList:[]});C(()=>V.config,e=>{console.log(e,"-----------va;000000000000000"),e.fromList.length>0&&D(()=>{u.value=e})},{immediate:!0});const w=e=>{u.value.fromList.splice(e,1)},F=e=>{u.value.fromList.filter(d=>d.type==e.type).length{u.value.fromList[e].itemList.splice(n,1)},B=(e,n,d)=>{d=="radio"?u.value.fromList[e].itemList.push({name:"\u65B0\u589E\u9009\u9879",value:n+1,disabled:!1}):u.value.fromList[e].itemList.push({name:"\u65B0\u589E\u9009\u9879",value:n+1,checked:!1,disabled:!1})};C(()=>u.value,e=>{L("update:config",e)},{immediate:!0,deep:!0}),g([{name:"\u56FE\u7247",value:"image",checked:!1},{name:"\u89C6\u9891",value:"video",checked:!1}]);const T=[{text:"\u6587\u672C\u6846",nums:2,type:"text",value:""},{text:"\u957F\u6587\u672C\u6846",nums:2,type:"textarea",value:""},{text:"\u6570\u503C",nums:2,max:3,min:0,type:"number",value:""},{text:"\u5355\u9009\u6846",nums:2,type:"radio",itemList:[{name:"\u9009\u9879\u4E00",value:1,disabled:!1},{name:"\u9009\u9879\u4E8C",value:2,disabled:!1}],value:""},{text:"\u590D\u9009\u6846",nums:2,type:"checkbox",itemList:[{name:"\u9009\u9879\u4E00",value:1,checked:!1,disabled:!1},{name:"\u9009\u9879\u4E8C",value:2,checked:!1,disabled:!1}],value:[]},{text:"\u6587\u4EF6\u4E0A\u4F20",nums:2,max:3,type:"upload",value:"\u6587\u4EF6\u4E0A\u4F20",fileType:"image",fileList:[]},{text:"\u5BCC\u6587\u672C",nums:"2",type:"richText",value:""}];return(e,n)=>{const d=k("el-input"),_=k("el-button");return o(),i("div",j,[s("div",z,[(o(),i(f,null,h(T,(t,l)=>s("div",{key:l,class:"item",onClick:a=>F(t)},[s("p",null,m(t.text),1)],8,M)),64))]),s("div",q,[s("div",null,[p(d,{style:{width:"350px","margin-bottom":"30px"},modelValue:y(u).title,"onUpdate:modelValue":n[0]||(n[0]=t=>y(u).title=t)},{prepend:c(()=>[G]),_:1},8,["modelValue"])]),(o(!0),i(f,null,h(y(u).fromList,(t,l)=>(o(),i("div",{style:A([{padding:"2px 0px"},{marginTop:l!=0?"20px":"0px"}]),class:"item",key:l},[s("div",H,[r(" \u8868\u5355\u9879"+m(l+1),1),s("span",I,m(t.type=="richText"?"\u5BCC\u6587\u672C\u4EC5\u7528\u4E8E\u586B\u5199\u8868\u5355\u7684\u8BF4\u660E":""),1),p(_,{onClick:a=>w(l),style:{"margin-left":"50px"},type:"danger"},{default:c(()=>[J]),_:2},1032,["onClick"])]),s("div",K,[t.type=="richText"?(o(),i("div",P,[p(U,{height:200,modelValue:t.text,"onUpdate:modelValue":a=>t.text=a},null,8,["modelValue","onUpdate:modelValue"])])):(o(),i("div",Q,[p(d,{style:{width:"350px"},modelValue:t.text,"onUpdate:modelValue":a=>t.text=a},{prepend:c(()=>[R]),_:2},1032,["modelValue","onUpdate:modelValue"])]))]),t.type=="radio"||t.type=="checkbox"?(o(),i("div",W,[(o(!0),i(f,null,h(t.itemList,(a,v)=>(o(),i("div",{style:{"margin-top":"10px","margin-left":"15px",width:"40%"},key:l,class:"option"},[s("div",X,[p(d,{modelValue:a.name,"onUpdate:modelValue":x=>a.name=x},{prepend:c(()=>[r("\u9009\u9879"+m(v+1),1)]),_:2},1032,["modelValue","onUpdate:modelValue"])]),p(_,{onClick:x=>b(l,v),style:{"margin-left":"50px",width:"70px"},type:"danger"},{default:c(()=>[Y]),_:2},1032,["onClick"])]))),128)),s("div",Z,[p(_,{onClick:a=>B(l,t.itemList.length,t.type),type:"primary"},{default:c(()=>[ee]),_:2},1032,["onClick"])])])):$("",!0)],4))),128))])])}}});const ae=S(te,[["__scopeId","data-v-ce316d44"]]);export{ae as default};