import{u as y}from"./useInstance.233fbdde.js";import{az as l,aa as i,d as B,a6 as k,s as v,r as q,b as S,p as R,c as _,e as I,k as C,i as s,h as o,u,A as U,a2 as N,m as p,E as f}from"./index.0308b213.js";import{A as M}from"./index.1d26a072.js";import{M as G}from"./index.dfdc0704.js";const se=e=>l.request({url:"addon/storeAdImage.web.store_ad_image/list",params:e}),ue=e=>l.request({url:"addon/storeAdImage.web.store_ad_image/delete",method:"POST",data:e}),L=e=>l.request({url:"addon/storeAdImage.web.store_ad_image/detail",params:e}),$=e=>l.request({url:"addon/storeAdImage.web.store_ad_image/edit",method:"POST",data:e}),z=e=>l.request({url:"addon/storeAdImage.web.store_ad_image/add",method:"POST",data:e}),de=e=>l.request({url:"addon/storeAdImage.web.store_ad_image/changeStatus",method:"POST",data:e}),ne=e=>l.request({url:"addon/storeAdImage.web.store_ad_image/changeRandom",method:"POST",data:e}),le=e=>i.request({url:"agent/plugin.storeAdImage.store_ad_image/list",params:e}),ie=e=>i.request({url:"agent/plugin.storeAdImage.store_ad_image/delete",method:"POST",data:e}),j=e=>i.request({url:"agent/plugin.storeAdImage.store_ad_image/detail",params:e}),H=e=>i.request({url:"agent/plugin.storeAdImage.store_ad_image/edit",method:"POST",data:e}),J=e=>i.request({url:"agent/plugin.storeAdImage.store_ad_image/add",method:"POST",data:e}),re=e=>i.request({url:"agent/plugin.storeAdImage.store_ad_image/changeStatus",method:"POST",data:e}),me=e=>i.request({url:"agent/plugin.storeAdImage.store_ad_image/changeRandom",method:"POST",data:e}),K=p("\u5F00\u542F"),Q=p("\u5173\u95ED"),W=p("\u662F"),X=p("\u5426"),Y=p("\u63D0\u4EA4"),Z=p("\u53D6\u6D88"),ge=B({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(e,{emit:V}){const r=e,{OpPlatform:A}=k(),{global:x}=y();let P=v(()=>Number(r.id)>0);const h=q(!1),b=q(),t=S({id:"",agentid:"",image:"",status:"1",is_random:"0",position_index:""}),w=()=>{A.value=="shangpu"?t.id>0?$(t).then(a=>{f({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),m()}):z(t).then(a=>{f({message:"\u65B0\u589E\u6210\u529F",type:"success"}),m()}):t.id>0?H(t).then(a=>{f({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),m()}):J(t).then(a=>{f({message:"\u65B0\u589E\u6210\u529F",type:"success"}),m()})};R(()=>r.modelValue,a=>{h.value=a,a&&r.id&&(t.id=r.id,D())}),S({list:[]});const D=()=>{A.value=="shangpu"?L({id:r.id}).then(a=>{a=a.data,t.agentid=a.agentid,t.image=a.image,t.status=a.status,t.position_index=a.position_index,t.is_random=a.is_random}):j({id:r.id}).then(a=>{a=a.data,t.agentid=a.agentid,t.image=a.image,t.status=a.status,t.position_index=a.position_index,t.is_random=a.is_random})},m=()=>{V("update:modelValue",!1),V("onClose"),x.$resetForm(b.value,t)};return(a,d)=>{const g=_("el-form-item"),c=_("el-radio"),F=_("el-radio-group"),O=_("el-input"),E=_("el-button"),T=_("el-dialog");return I(),C(T,{modelValue:h.value,"onUpdate:modelValue":d[5]||(d[5]=n=>h.value=n),title:u(P)?"\u67E5\u770B":"\u65B0\u589E",width:"70%","destroy-on-close":"",onClose:m},{default:s(()=>[o(u(N),{ref_key:"formRef",ref:b,model:u(t),"inline-message":!0,"label-width":"160px"},{default:s(()=>[u(A)==="shangpu"?(I(),C(g,{key:0,label:"\u6240\u5C5E\u4EE3\u7406"},{default:s(()=>[o(u(M),{modelValue:u(t).agentid,"onUpdate:modelValue":d[0]||(d[0]=n=>u(t).agentid=n)},null,8,["modelValue"])]),_:1})):U("",!0),o(g,{label:"\u56FE\u7247",prop:"image"},{default:s(()=>[o(G,{modelValue:u(t).image,"onUpdate:modelValue":d[1]||(d[1]=n=>u(t).image=n),limit:1},null,8,["modelValue"])]),_:1}),o(g,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[o(F,{modelValue:u(t).status,"onUpdate:modelValue":d[2]||(d[2]=n=>u(t).status=n)},{default:s(()=>[o(c,{label:1},{default:s(()=>[K]),_:1}),o(c,{label:0},{default:s(()=>[Q]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(g,{label:"\u662F\u5426\u5F00\u542F\u968F\u673A"},{default:s(()=>[o(F,{modelValue:u(t).is_random,"onUpdate:modelValue":d[3]||(d[3]=n=>u(t).is_random=n)},{default:s(()=>[o(c,{label:1},{default:s(()=>[W]),_:1}),o(c,{label:0},{default:s(()=>[X]),_:1})]),_:1},8,["modelValue"])]),_:1}),o(g,{label:"\u4F4D\u7F6E(\u7B2C\u51E0\u4E2A\u5546\u6237\u540E)",prop:"position_index"},{default:s(()=>[o(O,{modelValue:u(t).position_index,"onUpdate:modelValue":d[4]||(d[4]=n=>u(t).position_index=n)},null,8,["modelValue"])]),_:1}),o(g,null,{default:s(()=>[o(E,{type:"primary",onClick:w},{default:s(()=>[Y]),_:1}),o(E,{onClick:m},{default:s(()=>[Z]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{ge as _,le as a,ie as b,de as c,ue as d,re as e,ne as f,se as g,me as h};
