import{u as q}from"./useInstance.233fbdde.js";import{S as U}from"./index.de7bcb5e.js";import{M as v}from"./index.dfdc0704.js";import{az as n,d as T,r as h,b as P,p as O,c as r,e as M,f as N,h as u,i as o,u as a,a2 as R,q as z,F as L,m,E as B}from"./index.0308b213.js";const ee=t=>n.request({url:"addon/creditshop.slide/lists",params:t}),le=t=>n.request({url:"addon/creditshop.slide/delete",method:"POST",data:t}),ue=t=>n.request({url:"addon/creditshop.slide/status",method:"POST",data:t}),te=t=>n.request({url:"addon/creditshop.slide/submit",method:"POST",data:t}),I=t=>n.request({url:"addon/creditshop.slide/detail",params:t}),j=t=>n.request({url:"addon/creditshop.slide/edit",method:"POST",data:t}),G=t=>n.request({url:"addon/creditshop.slide/add",method:"POST",data:t}),H=m("\u9009\u62E9\u7B2C\u4E09\u65B9\u94FE\u63A5"),J=m("\u542F\u7528"),K=m("\u7981\u7528"),Q=m("\u63D0\u4EA4"),W=m("\u53D6\u6D88"),oe=T({props:{modelValue:{type:Boolean,default:!1},id:{default:0}},emits:["update:modelValue","onClose"],setup(t,{emit:b}){const f=t,{global:S}=q(),c=h(!1),E=h(),e=P({id:0,advname:"",wxapp_link:"",thumb:"",displayorder:0,status:0}),k=()=>{I({id:e.id}).then(l=>{e.advname=l.advname,e.thumb=l.thumb,e.wxapp_link=l.wxapp_link,e.displayorder=l.displayorder,e.status=l.status})},w=()=>{e.id>0?j(e).then(l=>{B.success(l.msg),_()}):G(e).then(l=>{B.success(l.msg),_()})};O(()=>f.modelValue,l=>{c.value=l,e.id=f.id,e.id>0&&k()});let p=h(!1);const x=()=>{p.value=!0},C=l=>{l.type==1?e.wxapp_link=l.miniProgram:l.type==2?e.wxapp_link=l.webview:l.type==3&&(e.wxapp_link=l.phone)},y=l=>{e.wxapp_link=l},_=()=>{b("update:modelValue",!1),b("onClose"),S.$resetForm(E.value,e)};return(l,d)=>{const F=r("el-input"),i=r("el-form-item"),V=r("el-button"),g=r("el-radio"),A=r("el-radio-group"),D=r("el-dialog");return M(),N(L,null,[u(D,{modelValue:c.value,"onUpdate:modelValue":d[5]||(d[5]=s=>c.value=s),title:Number(f.id)>0?"\u7F16\u8F91\u5E7B\u706F\u7247":"\u6DFB\u52A0\u5E7B\u706F\u7247",width:"50%","destroy-on-close":"",onClose:_},{default:o(()=>[u(a(R),{ref_key:"formRef",ref:E,model:a(e),"label-width":"150px"},{default:o(()=>[u(i,{label:"\u5E7B\u706F\u7247\u540D\u79F0"},{default:o(()=>[u(F,{modelValue:a(e).advname,"onUpdate:modelValue":d[0]||(d[0]=s=>a(e).advname=s),placeholder:"\u8BF7\u8F93\u5165\u5E7B\u706F\u7247\u540D\u79F0"},null,8,["modelValue"])]),_:1}),u(i,{label:"\u5E7B\u706F\u7247\u56FE\u7247"},{default:o(()=>[u(v,{modelValue:a(e).thumb,"onUpdate:modelValue":d[1]||(d[1]=s=>a(e).thumb=s),limit:1,size:"80px"},null,8,["modelValue"])]),_:1}),u(i,{label:"\u5C0F\u7A0B\u5E8F\u8DF3\u8F6C\u94FE\u63A5",prop:"url"},{default:o(()=>[u(F,{modelValue:a(e).wxapp_link,"onUpdate:modelValue":d[2]||(d[2]=s=>a(e).wxapp_link=s),placeholder:"\u8BF7\u8F93\u5165\u8DF3\u8F6C\u94FE\u63A5"},{append:o(()=>[u(V,{type:"primary",onClick:x},{default:o(()=>[H]),_:1})]),_:1},8,["modelValue"])]),_:1}),u(i,{label:"\u5E7B\u706F\u7247\u6392\u5E8F"},{default:o(()=>[u(F,{modelValue:a(e).displayorder,"onUpdate:modelValue":d[3]||(d[3]=s=>a(e).displayorder=s),placeholder:"\u8BF7\u8F93\u5165\u5E7B\u706F\u7247\u6392\u5E8F"},null,8,["modelValue"])]),_:1}),u(i,{label:"\u5E7B\u706F\u7247\u662F\u5426\u542F\u7528"},{default:o(()=>[u(A,{modelValue:a(e).status,"onUpdate:modelValue":d[4]||(d[4]=s=>a(e).status=s)},{default:o(()=>[u(g,{label:1},{default:o(()=>[J]),_:1}),u(g,{label:0},{default:o(()=>[K]),_:1})]),_:1},8,["modelValue"])]),_:1}),u(i,null,{default:o(()=>[u(V,{type:"primary",onClick:w},{default:o(()=>[Q]),_:1}),u(V,{onClick:_},{default:o(()=>[W]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"]),u(a(U),{modelValue:a(p),"onUpdate:modelValue":d[6]||(d[6]=s=>z(p)?p.value=s:p=s),onConfirmAll:C,onChange:y,url:a(e).wxapp_link},null,8,["modelValue","url"])],64)}}});export{oe as _,ue as c,le as d,ee as g,te as s};
