import{_ as a,bx as t,Z as e,r as s,a2 as d,d as i,e as l,h as r,am as n,an as c,F as o,l as p,a7 as m,al as u,f as y,g,t as v,v as _}from"./index.286e9b79.js";import{E as f}from"./image-viewer.b538fe01.js";import{g as h}from"./http.f588794f.js";import"./debounce.caafe00b.js";import"./index.ed3ed02e.js";import"./position.1bd00850.js";import"./scroll.a50153b5.js";const b={key:0,class:"lucency-title"},x={class:"content-item-photo"},w={class:"content-item-image"},j={class:"content-item-cover"},k={key:0,class:"content-item-detail"},L={key:0,class:"content-item-title"},R=(a=>(v("data-v-7b6421a3"),a=a(),_(),a))((()=>r("div",{class:"clear"},null,-1))),A=a({__name:"widget",props:{data:{type:[Object,Array],default:{}}},setup(a){const v=t.base_url.replace("/adminapi",""),_=a,A=e((()=>3===_.data.list_style||!!_.data.is_title));let C=s([]),E=[];for(let t=0;t<10;t++)E.push({name:"标题名称"});C.value=E,d([()=>_.data.type,()=>_.data.group.id,()=>_.data.list],(async a=>{if(C.value=[],1==_.data.type&&_.data.list&&_.data.list.length>0)C.value=_.data.list;else if(2==_.data.type){let a=await(async()=>{if(_.data.group.id<=0)return[];let a=await h("diy.common/category",{id:_.data.group.id,limit:_.data.group.limit});return a.code?a.data:[]})();C.value=a}else C.value=_.data.list;let t=[];if(C.value.length<=0){for(let a=0;a<10;a++)t.push({name:"标题名称"});C.value=t}}),{deep:!0});return(a,t)=>{const e=f;return i(),l("div",{class:m(["content",{"lucency-content":4==_.data.list_style&&5==_.data.card_style}]),style:u({width:"100%",backgroundColor:_.data.background_color,padding:_.data.margin+"px 0","border-radius":5==_.data.card_style?_.data.layout_radius+"px":0})},[5==_.data.card_style?(i(),l("div",b,[r("div",null,n(_.data.title||"标题"),1),r("div",null,n(_.data.ctitle||"更多 >"),1)])):c("",!0),r("div",{class:m(["content-layout",{larger:1==_.data.list_style,small:2==_.data.list_style,list:3==_.data.list_style,swipe:4==_.data.list_style}]),style:u({paddingLeft:_.data.padding+"px",paddingRight:_.data.padding+"px",marginLeft:-_.data.spacing/2+"px",marginRight:-_.data.spacing/2+"px"})},[(i(!0),l(o,null,p(g(C),((a,t)=>{return i(),l("div",{class:m(["content-wrapper",{white:1==_.data.card_style,card:2==_.data.card_style,stroke:3==_.data.card_style,lucency:4==_.data.card_style,chamfer:_.data.chamfer_style}]),key:t},[r("div",{class:"content-item",style:u({margin:_.data.spacing/2+"px"})},[r("div",x,[r("div",w,[r("div",j,[y(e,{style:{width:"100%",height:"100%"},src:(s=a,null!=s.image?s.image:v+"/static/images/menu/empty.png"),fit:"cover"},null,8,["src"])])])]),g(A)?(i(),l("div",k,[_.data.is_title?(i(),l("div",L,n(a.name),1)):c("",!0)])):c("",!0)],4)],2);var s})),128)),R],6)],6)}}},[["__scopeId","data-v-7b6421a3"]]);export{A as default};
