import{B as j,C as F,f as I,h as O,H as R,D as S}from"./element-plus-z3MwpXC9.js";import{_ as z}from"./index-BhjDDGVa.js";import{f as g,b as A}from"./index-DXEGVToZ.js";import{_ as H}from"./picker-Cx07Sp9S.js";import{D as L}from"./vuedraggable-OYPBN08G.js";import{l as h}from"./lodash-es-R-kYiKr_.js";import{d as M,b as T,ah as q,o as p,c as v,V as t,M as l,a as s,u as r,L as G,S as J,R as K}from"./@vue-TMcuEboY.js";const P={class:"bg-fill-light flex items-center w-full p-4 mt-4"},Q={class:"ml-3 flex-1"},W={class:"flex-1 flex items-center"},X={class:"drag-move cursor-move ml-auto"},Y={key:0,class:"mt-4"},u=5,se=M({__name:"attr",props:{content:{type:Object,default:()=>({})},styles:{type:Object,default:()=>({})}},emits:["update:content"],setup(_,{emit:b}){const m=b,d=_,f=T({get:()=>d.content,set:a=>{m("update:content",a)}}),k=()=>{var a;if(((a=d.content.data)==null?void 0:a.length)<u){const e=h(d.content);e.data.push({is_show:"1",image:"",name:"",link:{}}),m("update:content",e)}else g.msgError(`最多添加${u}张图片`)},w=a=>{var c;if(((c=d.content.data)==null?void 0:c.length)<=1)return g.msgError("最少保留一张图片");const e=h(d.content);e.data.splice(a,1),m("update:content",e)};return(a,e)=>{const c=H,y=j,i=F,C=q("link-picker"),E=I,U=A,B=z,D=O,N=R,$=S;return p(),v("div",null,[t($,{"label-width":"70px"},{default:l(()=>[t(N,{shadow:"never",class:"!border-none flex mt-2"},{default:l(()=>{var V;return[e[2]||(e[2]=s("div",{class:"flex items-end mb-4"},[s("div",{class:"text-base text-[#101010] font-medium"},"菜单"),s("div",{class:"text-xs text-tx-secondary ml-2"}," 最多添加5张，建议图片尺寸：750px*200px ")],-1)),t(r(L),{class:"draggable",modelValue:r(f).data,"onUpdate:modelValue":e[0]||(e[0]=o=>r(f).data=o),animation:"300",handle:".drag-move","item-key":"index"},{item:l(({element:o,index:x})=>[(p(),G(B,{key:x,onClose:n=>w(x),class:"w-[467px]"},{default:l(()=>[s("div",P,[t(c,{modelValue:o.image,"onUpdate:modelValue":n=>o.image=n,"upload-class":"bg-body","exclude-domain":""},null,8,["modelValue","onUpdate:modelValue"]),s("div",Q,[t(i,{label:"图片名称"},{default:l(()=>[t(y,{modelValue:o.name,"onUpdate:modelValue":n=>o.name=n,placeholder:"请输入名称"},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),t(i,{class:"mt-[18px]",label:"图片链接"},{default:l(()=>[t(C,{modelValue:o.link,"onUpdate:modelValue":n=>o.link=n},null,8,["modelValue","onUpdate:modelValue"])]),_:2},1024),t(i,{label:"是否显示",class:"mt-[18px]"},{default:l(()=>[s("div",W,[t(E,{modelValue:o.is_show,"onUpdate:modelValue":n=>o.is_show=n,"active-value":"1","inactive-value":"0"},null,8,["modelValue","onUpdate:modelValue"]),s("div",X,[t(U,{name:"el-icon-Rank",size:"18"})])])]),_:2},1024)])])]),_:2},1032,["onClose"]))]),_:1},8,["modelValue"]),((V=_.content.data)==null?void 0:V.length)<u?(p(),v("div",Y,[t(D,{class:"w-full",type:"primary",onClick:k},{default:l(()=>e[1]||(e[1]=[J("添加图片")])),_:1})])):K("",!0)]}),_:1})]),_:1})])}}});export{se as _};
