import{u as x}from"./useInstance.233fbdde.js";import{M as N}from"./index.dfdc0704.js";import{az as g,aa as c,d as L,a6 as M,s as R,r as E,b as G,p as z,c as m,e as v,k as y,i as o,h as u,u as a,A as I,q as $,a2 as j,m as f,E as F}from"./index.0308b213.js";import{A as H}from"./index.1d26a072.js";import{S as J}from"./index.de7bcb5e.js";const re=t=>g.request({url:"adminapi/blog.circle_nav/list",params:t}),me=t=>g.request({url:"adminapi/blog.circle_nav/delete",method:"POST",data:t}),K=t=>g.request({url:"adminapi/blog.circle_nav/detail",params:t}),Q=t=>g.request({url:"adminapi/blog.circle_nav/edit",method:"POST",data:t}),W=t=>g.request({url:"adminapi/blog.circle_nav/add",method:"POST",data:t}),pe=t=>c.request({url:"agent/plugin.blog.circle_nav/list",params:t}),ge=t=>c.request({url:"agent/plugin.blog.circle_nav/delete",method:"POST",data:t}),X=t=>c.request({url:"agent/plugin.blog.circle_nav/detail",params:t}),Y=t=>c.request({url:"agent/plugin.blog.circle_nav/edit",method:"POST",data:t}),Z=t=>c.request({url:"agent/plugin.blog.circle_nav/add",method:"POST",data:t}),ee=f("\u9009\u62E9\u7B2C\u4E09\u65B9\u94FE\u63A5"),le=f("\u5F00"),te=f("\u5173"),ue=f("\u63D0\u4EA4"),ae=f("\u53D6\u6D88"),ce=L({props:{modelValue:{type:Boolean,default:!1},id:null},emits:["update:modelValue","onClose"],setup(t,{emit:A}){const d=t,{OpPlatform:_}=M(),{global:w}=x();let q=R(()=>Number(d.id)>0);const V=E(!1),B=E(),e=G({id:"",agentid:"",title:"",image:"",url:"",weigh:"",status:1}),D=()=>{e.id>0?_.value=="shangpu"?Q(e).then(l=>{F({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),r()}):Y(e).then(l=>{F({message:"\u7F16\u8F91\u6210\u529F",type:"success"}),r()}):_.value=="shangpu"?W(e).then(l=>{F({message:"\u65B0\u589E\u6210\u529F",type:"success"}),r()}):Z(e).then(l=>{F({message:"\u65B0\u589E\u6210\u529F",type:"success"}),r()})};z(()=>d.modelValue,l=>{V.value=l,l&&d.id&&(e.id=d.id,S())});const S=()=>{_.value=="shangpu"?K({id:d.id}).then(l=>{l=l.data,e.agentid=l.agentid||"",e.title=l.title||"",e.image=l.image||"",e.url=l.url||"",e.weigh=l.weigh||"",e.status=l.status||1}):X({id:d.id}).then(l=>{l=l.data,e.agentid=l.agentid||"",e.title=l.title||"",e.image=l.image||"",e.url=l.url||"",e.weigh=l.weigh||"",e.status=l.status||1})};let p=E(!1);const U=()=>{p.value=!0},k=l=>{l.type==1?e.url=l.miniProgram:l.type==2?e.url=l.webview:l.type==3&&(e.url=l.phone)},P=l=>{e.url=l},r=()=>{A("update:modelValue",!1),A("onClose"),w.$resetForm(B.value,e)};return(l,n)=>{const s=m("el-form-item"),b=m("el-input"),h=m("el-button"),C=m("el-radio"),T=m("el-radio-group"),O=m("el-dialog");return v(),y(O,{modelValue:V.value,"onUpdate:modelValue":n[7]||(n[7]=i=>V.value=i),title:a(q)?"\u67E5\u770B\u5708\u5B50\u5BFC\u822A\u56FE\u6807\u8BBE\u7F6E":"\u65B0\u589E\u5708\u5B50\u5BFC\u822A\u56FE\u6807\u8BBE\u7F6E",width:"70%","destroy-on-close":"",onClose:r},{default:o(()=>[u(a(j),{ref_key:"formRef",ref:B,model:a(e),"inline-message":!0,"label-width":"160px"},{default:o(()=>[a(_)==="shangpu"?(v(),y(s,{key:0,label:"\u6240\u5C5E\u4EE3\u7406"},{default:o(()=>[u(a(H),{modelValue:a(e).agentid,"onUpdate:modelValue":n[0]||(n[0]=i=>a(e).agentid=i)},null,8,["modelValue"])]),_:1})):I("",!0),u(s,{label:"\u6807\u9898"},{default:o(()=>[u(b,{modelValue:a(e).title,"onUpdate:modelValue":n[1]||(n[1]=i=>a(e).title=i),placeholder:"\u8BF7\u8F93\u5165\u6807\u9898"},null,8,["modelValue"])]),_:1}),u(s,{label:"\u5BFC\u822A\u56FE\u6807",prop:"image"},{default:o(()=>[u(N,{modelValue:a(e).image,"onUpdate:modelValue":n[2]||(n[2]=i=>a(e).image=i),limit:1},null,8,["modelValue"])]),_:1}),u(s,{label:"\u8DF3\u8F6C\u94FE\u63A5"},{default:o(()=>[u(b,{modelValue:a(e).url,"onUpdate:modelValue":n[3]||(n[3]=i=>a(e).url=i),placeholder:"\u8BF7\u8F93\u5165\u8DF3\u8F6C\u94FE\u63A5"},{append:o(()=>[u(h,{type:"primary",onClick:U},{default:o(()=>[ee]),_:1})]),_:1},8,["modelValue"])]),_:1}),u(s,{label:"\u6743\u91CD"},{default:o(()=>[u(b,{modelValue:a(e).weigh,"onUpdate:modelValue":n[4]||(n[4]=i=>a(e).weigh=i),placeholder:"\u8BF7\u8F93\u5165\u6743\u91CD"},null,8,["modelValue"])]),_:1}),u(s,{label:"\u72B6\u6001"},{default:o(()=>[u(T,{modelValue:a(e).status,"onUpdate:modelValue":n[5]||(n[5]=i=>a(e).status=i)},{default:o(()=>[u(C,{label:1},{default:o(()=>[le]),_:1}),u(C,{label:0},{default:o(()=>[te]),_:1})]),_:1},8,["modelValue"])]),_:1}),u(s,null,{default:o(()=>[u(h,{type:"primary",onClick:D},{default:o(()=>[ue]),_:1}),u(h,{onClick:r},{default:o(()=>[ae]),_:1})]),_:1}),u(s,null,{default:o(()=>[u(a(J),{modelValue:a(p),"onUpdate:modelValue":n[6]||(n[6]=i=>$(p)?p.value=i:p=i),onConfirmAll:k,onChange:P,url:a(e).url},null,8,["modelValue","url"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue","title"])}}});export{ce as _,pe as a,ge as b,Y as c,me as d,Q as e,re as g};
