import{C as B,B as D,f as z,h as N}from"./element-plus-z3MwpXC9.js";import{_ as $}from"./index-BhjDDGVa.js";import{_ as R}from"./picker-Cx07Sp9S.js";import{f as V,b as F}from"./index-DXEGVToZ.js";import{D as I}from"./vuedraggable-OYPBN08G.js";import{l as P}from"./lodash-es-R-kYiKr_.js";import{d as S,b as A,ah as L,o as d,c as M,a as u,V as a,M as o,L as m,R as p,u as _,i as T,S as j,U as q}from"./@vue-TMcuEboY.js";const G={class:"mb-[18px] max-w-[400px]"},H={class:"bg-fill-light w-full p-4 mt-4"},J={class:"upload-btn w-[60px] h-[60px]"},K={class:"upload-btn w-[60px] h-[60px]"},O={class:"flex-1 flex items-center"},Q={class:"drag-move cursor-move ml-auto"},ae=S({__name:"menu-set",props:{modelValue:{},max:{default:9999},min:{default:-1},itemData:{default:()=>({name:"",selected:"",unselected:"",is_show:"1",link:{}})}},emits:["update:modelValue"],setup(v,{emit:x}){const i=v,k=x,t=A({get(){return i.modelValue},set(s){k("update:modelValue",s)}}),g=()=>{var s;((s=t.value)==null?void 0:s.length)<i.max?t.value.push(P(i.itemData)):V.msgError(`最多添加${i.max}个`)},h=s=>{if(t.value.length<=i.min&&i.min>-1)return V.msgError(`最少保留${i.min}个`);t.value.splice(s,1)};return(s,n)=>{const r=F,f=R,c=B,b=D,w=L("link-picker"),y=z,U=$,C=N;return d(),M(q,null,[u("div",G,[a(_(I),{class:"draggable",modelValue:_(t),"onUpdate:modelValue":n[0]||(n[0]=e=>T(t)?t.value=e:null),animation:"300",handle:".drag-move","item-key":"index"},{item:o(({element:e,index:E})=>[a(U,{onClose:l=>h(E),class:"max-w-[400px]"},{default:o(()=>[u("div",H,[e.unselected!==void 0||e.selected!==void 0?(d(),m(c,{key:0,label:"导航图标"},{default:o(()=>[e.unselected!==void 0?(d(),m(f,{key:0,modelValue:e.unselected,"onUpdate:modelValue":l=>e.unselected=l,"upload-class":"bg-body","exclude-domain":"",size:"60px"},{upload:o(()=>[u("div",J,[a(r,{name:"el-icon-Plus",size:16}),n[1]||(n[1]=u("span",{class:"text-xs leading-5"}," 未选中 ",-1))])]),_:2},1032,["modelValue","onUpdate:modelValue"])):p("",!0),e.selected!==void 0?(d(),m(f,{key:1,modelValue:e.selected,"onUpdate:modelValue":l=>e.selected=l,"upload-class":"bg-body","exclude-domain":"",size:"60px"},{upload:o(()=>[u("div",K,[a(r,{name:"el-icon-Plus",size:16}),n[2]||(n[2]=u("span",{class:"text-xs leading-5"}," 选中 ",-1))])]),_:2},1032,["modelValue","onUpdate:modelValue"])):p("",!0)]),_:2},1024)):p("",!0),e.name!==void 0?(d(),m(c,{key:1,label:"导航名称"},{default:o(()=>[a(b,{modelValue:e.name,"onUpdate:modelValue":l=>e.name=l,placeholder:"请输入名称"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):p("",!0),e.link!==void 0?(d(),m(c,{key:2,label:"链接地址"},{default:o(()=>[a(w,{modelValue:e.link,"onUpdate:modelValue":l=>e.link=l,type:"pc"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024)):p("",!0),e.is_show!==void 0?(d(),m(c,{key:3,label:"是否显示"},{default:o(()=>[u("div",O,[a(y,{modelValue:e.is_show,"onUpdate:modelValue":l=>e.is_show=l,"active-value":"1","inactive-value":"0"},null,8,["modelValue","onUpdate:modelValue"]),u("div",Q,[a(r,{name:"el-icon-Rank",size:"18"})])])]),_:2},1024)):p("",!0)])]),_:2},1032,["onClose"])]),_:1},8,["modelValue"])]),_(t).length<s.max?(d(),m(c,{key:0,"label-width":"0"},{default:o(()=>[a(C,{type:"primary",onClick:g},{default:o(()=>n[3]||(n[3]=[j(" 添加导航 ")])),_:1})]),_:1})):p("",!0)],64)}}});export{ae as _};
