import{M as C}from"./index.dfdc0704.js";import{az as i,aa as g,d as k,a6 as w,b as x,p as v,c as p,e as B,k as h,i as u,h as t,u as o,A as U,a2 as I,m as _,E as S}from"./index.0308b213.js";import{A as q}from"./index.1d26a072.js";const Q=e=>i.request({url:"adminapi/blog.BlogSlide/list",params:e}),R=e=>i.post("adminapi/blog.BlogSlide/deleteSlide",{id:e}),N=e=>i.get(`adminapi/blog.BlogSlide/editSlide?id=${e}`),P=e=>i.post("adminapi/blog.BlogSlide/addSlide",e),W=e=>i.post("adminapi/blog.BlogSlide/statusSlide",e),X=e=>i.post("adminapi/blog.BlogSlide/updateAgent",e),M=e=>i.post("adminapi/blog.BlogSlide/saveSlide",e),Y=e=>i.post("adminapi/blog.BlogSlide/submitSlides",e),Z=e=>g.request({url:"agent/plugin.blog.BlogSlide/list",params:e}),ee=e=>g.post("agent/plugin.blog.BlogSlide/deleteSlide",{id:e}),O=e=>g.get(`agent/plugin.blog.BlogSlide/editSlide?id=${e}`),T=e=>g.post("agent/plugin.blog.BlogSlide/addSlide",e),le=e=>g.post("agent/plugin.blog.BlogSlide/statusSlide",e),$=e=>g.post("agent/plugin.blog.BlogSlide/saveSlide",e),te=e=>g.post("agent/plugin.blog.BlogSlide/submitSlides",e),j=_("\u542F\u7528"),z=_("\u4E0D\u542F\u7528"),G=_("\u63D0\u4EA4"),H=_("\u53D6\u6D88"),oe=k({props:{show:{type:Boolean,default:!1},EditId:{type:Number,default:0}},emits:["hideEdit","refresh"],setup(e,{emit:m}){const c=e,{OpPlatform:b}=w(),l=x({id:"",title:"",thumb:"",wxapp_link:"",displayorder:0,status:0,agentid:""}),E=()=>{l.id>0?b.value==="agent"?$(l).then(d=>{S({message:"\u4FDD\u5B58\u6210\u529F",type:"success"}),r(),m("refresh")}):M(l).then(d=>{S({message:"\u4FDD\u5B58\u6210\u529F",type:"success"}),r(),m("refresh")}):b.value==="agent"?T(l).then(d=>{S({message:"\u6DFB\u52A0\u6210\u529F",type:"success"}),r(),m("refresh")}):P(l).then(d=>{S({message:"\u6DFB\u52A0\u6210\u529F",type:"success"}),r(),m("refresh")})},r=()=>{l.id="",l.thumb="",l.title="",l.wxapp_link="",l.displayorder=0,l.status=0,l.agentid="",m("hideEdit")};return v(()=>c.EditId,()=>{l.id=c.EditId,b.value==="agent"?O(c.EditId).then(d=>{Object.assign(l,d.result[0])}):N(c.EditId).then(d=>{Object.assign(l,d.result[0])})}),(d,a)=>{const f=p("el-input"),n=p("el-form-item"),V=p("el-input-number"),A=p("el-radio"),D=p("el-radio-group"),F=p("el-button"),y=p("el-dialog");return B(),h(y,{modelValue:e.show,title:e.EditId?"\u7F16\u8F91\u5E7B\u706F\u7247":"\u65B0\u589E\u5E7B\u706F\u7247",width:"50%",onClose:r},{default:u(()=>[t(o(I),{model:o(l),"label-width":"120px"},{default:u(()=>[t(n,{label:"\u540D\u79F0",prop:"title"},{default:u(()=>[t(f,{modelValue:o(l).title,"onUpdate:modelValue":a[0]||(a[0]=s=>o(l).title=s),placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0"},null,8,["modelValue"])]),_:1}),t(n,{label:"\u56FE\u7247",prop:"thumb"},{default:u(()=>[t(C,{modelValue:o(l).thumb,"onUpdate:modelValue":a[1]||(a[1]=s=>o(l).thumb=s),limit:1},null,8,["modelValue"])]),_:1}),o(b)==="shangpu"?(B(),h(n,{key:0,label:"\u6240\u5C5E\u4EE3\u7406",prop:"agentid"},{default:u(()=>[t(o(q),{modelValue:o(l).agentid,"onUpdate:modelValue":a[2]||(a[2]=s=>o(l).agentid=s)},null,8,["modelValue"])]),_:1})):U("",!0),t(n,{label:"\u8DF3\u8F6C\u94FE\u63A5",prop:"wxapp_link"},{default:u(()=>[t(f,{modelValue:o(l).wxapp_link,"onUpdate:modelValue":a[3]||(a[3]=s=>o(l).wxapp_link=s),placeholder:"\u8BF7\u8F93\u5165\u8DF3\u8F6C\u94FE\u63A5"},null,8,["modelValue"])]),_:1}),t(n,{label:"\u6392\u5E8F",prop:"displayorder"},{default:u(()=>[t(V,{modelValue:o(l).displayorder,"onUpdate:modelValue":a[4]||(a[4]=s=>o(l).displayorder=s)},null,8,["modelValue"])]),_:1}),t(n,{label:"\u662F\u5426\u542F\u7528",prop:"status"},{default:u(()=>[t(D,{modelValue:o(l).status,"onUpdate:modelValue":a[5]||(a[5]=s=>o(l).status=s)},{default:u(()=>[t(A,{label:1},{default:u(()=>[j]),_:1}),t(A,{label:0},{default:u(()=>[z]),_:1})]),_:1},8,["modelValue"])]),_:1}),t(n,null,{default:u(()=>[t(F,{type:"primary",onClick:E},{default:u(()=>[G]),_:1}),t(F,{onClick:r},{default:u(()=>[H]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{ee as D,X as U,oe as _,Q as a,Y as b,le as c,W as d,R as e,Z as g,te as s};
