import{d as w,a6 as D,b7 as I,b as h,r as L,c as T,e as u,f as i,g as a,F as m,j as f,h as g,i as v,u as c,n as S,t as V,q as M,m as k,N as P,E as x,y as F,R as N,S as R,_ as q}from"./index.0308b213.js";import{h as O,o as U}from"./diy.a6ea004c.js";import{t as $}from"./index.257d824a.js";import j from"./index.3c08c062.js";import"./index.13b267c2.js";const z=r=>(N("data-v-9e983e1c"),r=r(),R(),r),Y={class:"data"},G=z(()=>a("div",{style:{"font-weight":"bolder"}},"\u6A21\u7248\u5E02\u573A",-1)),H={class:"box-item"},J=["src"],K={class:"mask"},Q={class:"centen"},W=k("\u9884\u89C8\u8BE5\u6A21\u7248"),X=k("\u4F7F\u7528\u8BE5\u6A21\u7248"),Z=w({setup(r){const{OpPlatform:d}=D(),y=I(),C=sessionStorage.getItem("shangpu_tuniao_agent_id"),n=h({previewId:"",src:""});let o=L(!1),_=null;const E=e=>{P.alert("\u786E\u5B9A\u4F7F\u7528\u8BE5\u6A21\u7248\u5417\uFF1F","\u64CD\u4F5C\u63D0\u793A",{showCancelButton:!0,confirmButtonText:"\u786E\u8BA4",cancelButtonText:"\u53D6\u6D88",closeOnClickModal:!1}).then(()=>{if(d.value==="shangpu"?_="admin":_=d.value,d.value==="agent"){let s={id:0,agentid:C,type:1,name:e.title,uniacid:e.uniacid,data:e.data};O(s).then(()=>{x.success("\u590D\u5236\u6210\u529F"),setTimeout(()=>{y.push({path:`/${_}/plugin/diy/page/list`,query:{}})},1e3)})}else x.error("\u8BF7\u5230\u4EE3\u7406\u533A\u57DF\u4F7F\u7528")}).catch(()=>{})},A=(e,s)=>{console.log(e),n.src=e,n.previewId=s,F(()=>{o.value=!0})},B=()=>{F(()=>{o.value=!1}),n.previewId=""},p=h({list:[]});return(()=>{d.value==="agent"?U().then(e=>{console.log(e),e.forEach((s,l)=>{s.marginLeft=l===0?"70px":"130px"}),p.list=e}):$().then(e=>{console.log(e),e.forEach((s,l)=>{s.marginLeft=l===0?"70px":"130px"}),p.list=e})})(),(e,s)=>{const l=T("el-button");return u(),i(m,null,[a("div",Y,[G,a("div",H,[(u(!0),i(m,null,f(c(p).list,t=>(u(),i("div",{class:"items",key:t.id},[a("img",{style:{width:"100%",height:"auto"},src:t.image,alt:""},null,8,J),a("div",K,[a("div",Q,[g(l,{class:"tn-el-form-item--item tn-button tn-button--blue",onClick:b=>A(t.image,1170065)},{default:v(()=>[W]),_:2},1032,["onClick"]),g(l,{class:"tn-el-form-item--item tn-button tn-button--blue",style:{margin:"30px 0 0 0"},onClick:b=>E(t)},{default:v(()=>[X]),_:2},1032,["onClick"])])])]))),128))]),a("div",null,[(u(!0),i(m,null,f(c(p).list,t=>(u(),i("span",{key:t.id,style:S({marginLeft:t.marginLeft})},V(t.title),5))),128))])]),g(j,{modelValue:c(o),"onUpdate:modelValue":s[0]||(s[0]=t=>M(o)?o.value=t:o=t),id:c(n).previewId,src:c(n).src,onClose:B},null,8,["modelValue","id","src"])],64)}}});const ne=q(Z,[["__scopeId","data-v-9e983e1c"]]);export{ne as default};
