import{B,w as D}from"./element-plus.ae8e286c.js";import{_ as F}from"./index.1b85017a.js";import{_ as A}from"./picker.82b1e776.js";import{_ as y}from"./picker.f5e784c0.js";import{f as p,b as E}from"./index.71fc8348.js";import{D as C}from"./vuedraggable.38d35928.js";import{d as U,b as w,o as c,c as N,a as e,T as t,K as m,J as $,u as r,j as z,R}from"./@vue.108c970a.js";const T={class:"bg-fill-light flex items-center w-full p-4 mb-4 cursor-move"},j={class:"upload-btn w-[60px] h-[60px]"},I={class:"ml-3 flex-1"},J={class:"flex"},K=e("span",{class:"text-tx-regular flex-none mr-3"},"\u540D\u79F0",-1),L={class:"flex mt-[18px]"},P=e("span",{class:"text-tx-regular flex-none mr-3"},"\u94FE\u63A5",-1),q=R("\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=E,g=y,h=B,v=A,b=F,k=D;return c(),N("div",null,[e("div",null,[t(r(C),{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(),$(b,{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",j,[t(x,{name:"el-icon-Plus",size:20})])]),_:2},1032,["modelValue","onUpdate:modelValue"]),e("div",I,[e("div",J,[K,t(h,{modelValue:l.name,"onUpdate:modelValue":n=>l.name=n,placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]),e("div",L,[P,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(k,{type:"primary",onClick:f},{default:m(()=>[q]),_:1})])])}}});export{X as _};
