import{C as D,w as F}from"./element-plus.fa1aa32c.js";import{_ as A}from"./index.a5935337.js";import{_ as B}from"./picker.a8e8312e.js";import{_ as y}from"./picker.9777ec45.js";import{f as p,b as C}from"./index.0abf9e5c.js";import{D as E}from"./vuedraggable.5917840d.js";import{d as U,e as w,o as c,c as N,a as e,V as t,M as m,L as $,u as r,k as z,T as L}from"./@vue.cab01781.js";const T={class:"bg-fill-light flex items-center w-full p-4 mb-4 cursor-move"},I={class:"upload-btn w-[60px] h-[60px]"},M={class:"ml-3 flex-1"},P={class:"flex"},R=e("span",{class:"text-tx-regular flex-none mr-3"},"\u540D\u79F0",-1),j={class:"flex mt-[18px]"},q=e("span",{class:"text-tx-regular flex-none mr-3"},"\u94FE\u63A5",-1),G=L("\u6DFB\u52A0"),X=U({__name:"add-nav",props:{modelValue:{type:Array,default:()=>[]},max:{type:Number,default:10},min:{type:Number,default:1}},emits:["update:modelValue"],setup(_,{emit:i}){const o=_,s=w({get(){return o.modelValue},set(a){i("update:modelValue",a)}}),f=()=>{var a;((a=o.modelValue)==null?void 0:a.length)<o.max?s.value.push({image:"",name:"\u5BFC\u822A\u540D\u79F0",link:{}}):p.msgError(`\u6700\u591A\u6DFB\u52A0${o.max}\u4E2A`)},V=a=>{var u;if(((u=o.modelValue)==null?void 0:u.length)<=o.min)return p.msgError(`\u6700\u5C11\u4FDD\u7559${o.min}\u4E2A`);s.value.splice(a,1)};return(a,u)=>{const x=C,g=y,h=D,v=B,k=A,b=F;return c(),N("div",null,[e("div",null,[t(r(E),{class:"draggable",modelValue:r(s),"onUpdate:modelValue":u[0]||(u[0]=l=>z(s)?s.value=l:null),animation:"300"},{item:m(({element:l,index:d})=>[(c(),$(k,{class:"max-w-[400px]",key:d,onClose:n=>V(d)},{default:m(()=>[e("div",T,[t(g,{modelValue:l.image,"onUpdate:modelValue":n=>l.image=n,"upload-class":"bg-body",size:"60px","exclude-domain":""},{upload:m(()=>[e("div",I,[t(x,{name:"el-icon-Plus",size:20})])]),_:2},1032,["modelValue","onUpdate:modelValue"]),e("div",M,[e("div",P,[R,t(h,{modelValue:l.name,"onUpdate:modelValue":n=>l.name=n,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),e("div",j,[q,t(v,{modelValue:l.link,"onUpdate:modelValue":n=>l.link=n},null,8,["modelValue","onUpdate:modelValue"])])])])]),_:2},1032,["onClose"]))]),_:1},8,["modelValue"])]),e("div",null,[t(b,{type:"primary",onClick:f},{default:m(()=>[G]),_:1})])])}}});export{X as _};
