import{aa as E,d as B,a6 as F,b as g,c as n,e as i,k as y,i as t,u as o,h as a,A as k,f as S,m as d,E as v}from"./index.0308b213.js";const x=p=>E.request({url:"agent/plugin.thirdDelivery.maiyatian/getAgentConfig",method:"GET",params:p}),w=p=>E.request({url:"agent/plugin.thirdDelivery.maiyatian/setAgentConfig",method:"POST",data:p}),q=d("\u5F00\u542F"),N=d("\u5173\u95ED"),P=d("\u63D0\u4EA4"),T={key:1},O=B({setup(p){const{OpPlatform:r}=F(),e=g({is_open:0,app_key:"",appSecret:""}),V=g({stores:[],areas:[]}),b=()=>{e.stores=V.stores,r.value==="agent"&&w(e).then(s=>{v.success("\u8BBE\u7F6E\u6210\u529F"),c()})},c=()=>{r.value==="agent"&&x().then(s=>{e.is_open=s.data.is_open,e.app_key=s.data.app_key,e.appSecret=s.data.appSecret})};return c(),(s,l)=>{const m=n("el-radio"),C=n("el-radio-group"),_=n("el-form-item"),f=n("el-input"),h=n("el-button"),A=n("el-form"),D=n("el-card");return i(),y(D,{shadow:"always",style:{"margin-top":"20px"}},{default:t(()=>[o(r)=="agent"?(i(),y(A,{key:0,"label-width":"120px"},{default:t(()=>[a(_,{label:"\u9EA6\u82BD\u7530"},{default:t(()=>[a(C,{modelValue:o(e).is_open,"onUpdate:modelValue":l[0]||(l[0]=u=>o(e).is_open=u)},{default:t(()=>[a(m,{label:1},{default:t(()=>[q]),_:1}),a(m,{label:0},{default:t(()=>[N]),_:1})]),_:1},8,["modelValue"])]),_:1}),a(_,{label:"app_key"},{default:t(()=>[a(f,{modelValue:o(e).app_key,"onUpdate:modelValue":l[1]||(l[1]=u=>o(e).app_key=u)},null,8,["modelValue"])]),_:1}),a(_,{label:"appSecret"},{default:t(()=>[a(f,{modelValue:o(e).appSecret,"onUpdate:modelValue":l[2]||(l[2]=u=>o(e).appSecret=u)},null,8,["modelValue"])]),_:1}),a(_,{label:"",class:"continer-item"},{default:t(()=>[a(h,{type:"primary",onClick:b},{default:t(()=>[P]),_:1})]),_:1})]),_:1})):k("",!0),o(r)=="shangpu"?(i(),S("span",T,"\u8BF7\u5728\u4EE3\u7406\u540E\u53F0\u914D\u7F6E")):k("",!0)]),_:1})}}});export{O as default};
