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