index-e8jDSkVw.js 2.6 KB

1
  1. import{d as $,a2 as M,a as R,r as j,o as A,K as r,aq as g,e as t,f as c,am as v,y as m,L as i,ac as y,F as h,u as s,C as x,B as V,t as z,m as E,j as C}from"./vue-A59npLRR.js";import{c as T,_ as G}from"./index-EwE51S_X.js";import{F as H}from"./index-r6iTpmP6.js";import{b as f}from"./validate-_EUdkMt3.js";import"./echarts-cxb9vJr1.js";import"./index-K8IR974I.js";import"./baTable-MdxYOkAk.js";import"./index-XALue448.js";const w="/admin/oauth.Config/";function J(){return T({url:w+"index",method:"get"})}function O(_,a){return T({url:w+"saveConfig",method:"post",params:{name:_},data:a},{showSuccessMessage:!0})}const P={class:"default-main"},Q=$({__name:"index",setup(_){const{t:a,te:L}=M(),p=R(),e=j({loading:!1,form:{},rules:{app_id:[f({name:"required",title:a("oauth.config.app_id")})],app_secret:[f({name:"required",title:a("oauth.config.app_secret")})],callback_url:[f({name:"required",title:a("oauth.config.callback_url")})]},platform:{},activeTab:"wechat_scan",submitLoading:!1}),b=u=>{u&&u.validate(o=>{o&&(e.submitLoading=!0,O(e.activeTab,e.platform[e.activeTab]).finally(()=>{e.submitLoading=!1}))})};return A(()=>{e.loading=!0,J().then(u=>{e.platform=u.data.config}).finally(()=>{e.loading=!1})}),(u,o)=>{const S=r("el-tab-pane"),q=r("el-button"),B=r("el-tabs"),D=r("el-form"),F=r("el-col"),I=r("el-row"),U=g("blur"),k=g("loading");return t(),c("div",P,[v((t(),m(I,null,{default:i(()=>[C(F,{class:"xs-mb-20",xs:24,sm:16},{default:i(()=>[e.loading?x("",!0):(t(),m(D,{key:0,ref_key:"formRef",ref:p,onKeyup:o[2]||(o[2]=y(d=>b(p.value),["enter"])),model:e.platform[e.activeTab],rules:e.rules,"label-position":"top"},{default:i(()=>[C(B,{modelValue:e.activeTab,"onUpdate:modelValue":o[1]||(o[1]=d=>e.activeTab=d),type:"border-card"},{default:i(()=>[(t(!0),c(h,null,V(e.platform,(d,l)=>(t(),m(S,{class:"config-tab-pane",key:l,name:l,label:s(a)("oauth.config."+l)},{default:i(()=>[(t(!0),c(h,null,V(d,(W,n)=>(t(),c("div",{key:n},[e.activeTab==l?(t(),m(H,{key:0,type:"string",label:s(a)("oauth.config."+n),modelValue:e.platform[l][n],"onUpdate:modelValue":N=>e.platform[l][n]=N,prop:n.toString(),placeholder:s(L)("oauth.index."+l+"/placeholder/"+n)?s(a)("oauth.config."+l+"/placeholder/"+n):s(a)("oauth.config.default/placeholder/"+n)},null,8,["label","modelValue","onUpdate:modelValue","prop","placeholder"])):x("",!0)]))),128))]),_:2},1032,["name","label"]))),128)),v((t(),m(q,{loading:e.submitLoading,onClick:o[0]||(o[0]=d=>b(p.value)),type:"primary"},{default:i(()=>[E(z(s(a)("Save")),1)]),_:1},8,["loading"])),[[U]])]),_:1},8,["modelValue"])]),_:1},8,["model","rules"]))]),_:1})]),_:1})),[[k,e.loading]])])}}}),le=G(Q,[["__scopeId","data-v-0828e5e3"]]);export{le as default};