import{A as v}from"./index.1d26a072.js";import{az as d,aa as r,d as C,a6 as P,b as O,r as S,p as T,c,e as F,k as b,i as n,h as a,u,A as k,a2 as x,m as B,E as g}from"./index.0308b213.js";const H=t=>d({url:"adminapi/merchant.business/lists",params:t}),w=t=>d({url:"adminapi/merchant.business/add",method:"POST",data:t}),U=t=>d({url:"adminapi/merchant.business/edit",method:"POST",data:t}),N=t=>d({url:"adminapi/merchant.business/detail",method:"get",params:{id:t}}),I=t=>d({url:"adminapi/merchant.business/delete",method:"POST",data:{id:t}}),J=t=>r({url:"agent/merchant.business/lists",params:t}),q=t=>r({url:"agent/merchant.business/add",method:"POST",data:t}),L=t=>r({url:"agent/merchant.business/edit",method:"POST",data:t}),z=t=>r({url:"agent/merchant.business/detail",method:"get",params:{id:t}}),K=t=>r({url:"agent/merchant.business/delete",method:"POST",data:{id:t}}),M=B("\u63D0\u4EA4"),$=B("\u53D6\u6D88"),Q=C({props:{id:{default:0},modelValue:{type:Boolean,default:!1}},emits:["close"],setup(t,{emit:V}){const f=t,{OpPlatform:m}=P();let e=O({id:0,title:"",agentid:"",displayorder:""});const A=S(!1);T(()=>f.modelValue,s=>{e.id=f.id,e.id>0&&D(),A.value=s});const y=()=>{e.id>0?m.value=="agent"?L(e).then(()=>{g({message:"\u7F16\u8F91\u5546\u4E1A\u533A\u6210\u529F",type:"success"}),i()}):U(e).then(()=>{g({message:"\u7F16\u8F91\u5546\u4E1A\u533A\u6210\u529F",type:"success"}),i()}):m.value=="agent"?q(e).then(()=>{g({message:"\u6DFB\u52A0\u5546\u4E1A\u533A\u6210\u529F",type:"success"}),i()}):w(e).then(()=>{g({message:"\u6DFB\u52A0\u5546\u4E1A\u533A\u6210\u529F",type:"success"}),i()})},D=()=>{m.value=="agent"?z(e.id).then(s=>{e.title=s.title,e.agentid=s.agentid,e.displayorder=s.displayorder}):N(e.id).then(s=>{e.title=s.title,e.agentid=s.agentid,e.displayorder=s.displayorder})},i=()=>{V("close")};return(s,l)=>{const p=c("el-form-item"),h=c("el-input"),_=c("el-button"),E=c("el-dialog");return F(),b(E,{modelValue:A.value,"onUpdate:modelValue":l[3]||(l[3]=o=>A.value=o),title:"\u6DFB\u52A0\u5546\u4E1A\u533A",width:"50%","destroy-on-close":"",onClose:i},{default:n(()=>[a(u(x),{model:u(e),"label-width":"120px"},{default:n(()=>[u(m)=="shangpu"?(F(),b(p,{key:0,label:"\u4EE3\u7406\u533A\u57DF"},{default:n(()=>[a(u(v),{modelValue:u(e).agentid,"onUpdate:modelValue":l[0]||(l[0]=o=>u(e).agentid=o)},null,8,["modelValue"])]),_:1})):k("",!0),a(p,{label:"\u540D\u79F0"},{default:n(()=>[a(h,{modelValue:u(e).title,"onUpdate:modelValue":l[1]||(l[1]=o=>u(e).title=o),placeholder:"\u8BF7\u8F93\u5165\u5546\u4E1A\u533A\u540D\u79F0"},null,8,["modelValue"])]),_:1}),a(p,{label:"\u6392\u5E8F"},{default:n(()=>[a(h,{modelValue:u(e).displayorder,"onUpdate:modelValue":l[2]||(l[2]=o=>u(e).displayorder=o),placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F"},null,8,["modelValue"])]),_:1}),a(p,null,{default:n(()=>[a(_,{type:"primary",onClick:y},{default:n(()=>[M]),_:1}),a(_,{onClick:i},{default:n(()=>[$]),_:1})]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"])}}});export{Q as _,I as a,H as b,K as d,J as g};
