ClientForm-df26dc64.js 9.0 KB

1
  1. import{aA as b,d as Y,P as Q,r as v,x as W,o as s,C as i,A as r,f as o,a as l,D as S,k as Z,c,F as p,R as m,E as K,a2 as X,a9 as $,V as ee,at as le,au as ae,bQ as te,S as oe,U as re,W as se,J as ue,Z as de,_ as ie,__tla as ne}from"./index-286756b9.js";import{_ as ce,__tla as pe}from"./Dialog-4c2de357.js";import{_ as me,__tla as _e}from"./UploadImg-d2713eac.js";import{a as fe,D as q,b as Ve,__tla as ye}from"./dict-82dca549.js";import{C as z}from"./constants-637baed6.js";import{u as ve,__tla as be}from"./useMessage-084b1e70.js";let T,C,O,E,he=Promise.all([(()=>{try{return ne}catch{}})(),(()=>{try{return pe}catch{}})(),(()=>{try{return _e}catch{}})(),(()=>{try{return ye}catch{}})(),(()=>{try{return be}catch{}})()]).then(async()=>{E=h=>b.get({url:"/system/oauth2-client/page",params:h}),O=h=>b.delete({url:"/system/oauth2-client/delete?id="+h}),T=ie(Y({name:"SystemOAuth2ClientForm",__name:"ClientForm",emits:["success"],setup(h,{expose:G,emit:R}){const{t:U}=Q(),k=ve(),_=v(!1),I=v(""),f=v(!1),w=v(""),t=v({id:void 0,clientId:void 0,secret:void 0,name:void 0,logo:void 0,description:void 0,status:z.ENABLE,accessTokenValiditySeconds:1800,refreshTokenValiditySeconds:43200,redirectUris:[],authorizedGrantTypes:[],scopes:[],autoApproveScopes:[],authorities:[],resourceIds:[],additionalInformation:void 0}),F=W({clientId:[{required:!0,message:"\u5BA2\u6237\u7AEF\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],secret:[{required:!0,message:"\u5BA2\u6237\u7AEF\u5BC6\u94A5\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],name:[{required:!0,message:"\u5E94\u7528\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],logo:[{required:!0,message:"\u5E94\u7528\u56FE\u6807\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],accessTokenValiditySeconds:[{required:!0,message:"\u8BBF\u95EE\u4EE4\u724C\u7684\u6709\u6548\u671F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],refreshTokenValiditySeconds:[{required:!0,message:"\u5237\u65B0\u4EE4\u724C\u7684\u6709\u6548\u671F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],redirectUris:[{required:!0,message:"\u53EF\u91CD\u5B9A\u5411\u7684 URI \u5730\u5740\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],authorizedGrantTypes:[{required:!0,message:"\u6388\u6743\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),g=v();G({open:async(d,a)=>{if(_.value=!0,I.value=U("action."+d),w.value=d,M(),a){f.value=!0;try{t.value=await(n=>b.get({url:"/system/oauth2-client/get?id="+n}))(a)}finally{f.value=!1}}}});const N=R,D=async()=>{if(g&&await g.value.validate()){f.value=!0;try{const d=t.value;w.value==="create"?(await(a=>b.post({url:"/system/oauth2-client/create",data:a}))(d),k.success(U("common.createSuccess"))):(await(a=>b.put({url:"/system/oauth2-client/update",data:a}))(d),k.success(U("common.updateSuccess"))),_.value=!1,N("success")}finally{f.value=!1}}},M=()=>{var d;t.value={id:void 0,clientId:void 0,secret:void 0,name:void 0,logo:void 0,description:void 0,status:z.ENABLE,accessTokenValiditySeconds:1800,refreshTokenValiditySeconds:43200,redirectUris:[],authorizedGrantTypes:[],scopes:[],autoApproveScopes:[],authorities:[],resourceIds:[],additionalInformation:void 0},(d=g.value)==null||d.resetFields()};return(d,a)=>{const n=$,u=ee,P=me,j=le,L=ae,x=te,V=oe,y=re,B=se,A=ue,H=ce,J=de;return s(),i(H,{modelValue:l(_),"onUpdate:modelValue":a[16]||(a[16]=e=>X(_)?_.value=e:null),title:l(I),"max-height":"500px",scroll:""},{footer:r(()=>[o(A,{disabled:l(f),type:"primary",onClick:D},{default:r(()=>[S("\u786E \u5B9A")]),_:1},8,["disabled"]),o(A,{onClick:a[15]||(a[15]=e=>_.value=!1)},{default:r(()=>[S("\u53D6 \u6D88")]),_:1})]),default:r(()=>[Z((s(),i(B,{ref_key:"formRef",ref:g,model:l(t),rules:l(F),"label-width":"160px"},{default:r(()=>[o(u,{label:"\u5BA2\u6237\u7AEF\u7F16\u53F7",prop:"secret"},{default:r(()=>[o(n,{modelValue:l(t).clientId,"onUpdate:modelValue":a[0]||(a[0]=e=>l(t).clientId=e),placeholder:"\u8BF7\u8F93\u5165\u5BA2\u6237\u7AEF\u7F16\u53F7"},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5BA2\u6237\u7AEF\u5BC6\u94A5",prop:"secret"},{default:r(()=>[o(n,{modelValue:l(t).secret,"onUpdate:modelValue":a[1]||(a[1]=e=>l(t).secret=e),placeholder:"\u8BF7\u8F93\u5165\u5BA2\u6237\u7AEF\u5BC6\u94A5"},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5E94\u7528\u540D",prop:"name"},{default:r(()=>[o(n,{modelValue:l(t).name,"onUpdate:modelValue":a[2]||(a[2]=e=>l(t).name=e),placeholder:"\u8BF7\u8F93\u5165\u5E94\u7528\u540D"},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5E94\u7528\u56FE\u6807"},{default:r(()=>[o(P,{modelValue:l(t).logo,"onUpdate:modelValue":a[3]||(a[3]=e=>l(t).logo=e),limit:1},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5E94\u7528\u63CF\u8FF0"},{default:r(()=>[o(n,{modelValue:l(t).description,"onUpdate:modelValue":a[4]||(a[4]=e=>l(t).description=e),placeholder:"\u8BF7\u8F93\u5165\u5E94\u7528\u540D",type:"textarea"},null,8,["modelValue"])]),_:1}),o(u,{label:"\u72B6\u6001",prop:"status"},{default:r(()=>[o(L,{modelValue:l(t).status,"onUpdate:modelValue":a[5]||(a[5]=e=>l(t).status=e)},{default:r(()=>[(s(!0),c(p,null,m(l(fe)(l(q).COMMON_STATUS),e=>(s(),i(j,{key:e.value,label:e.value},{default:r(()=>[S(K(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(u,{label:"\u8BBF\u95EE\u4EE4\u724C\u7684\u6709\u6548\u671F",prop:"accessTokenValiditySeconds"},{default:r(()=>[o(x,{modelValue:l(t).accessTokenValiditySeconds,"onUpdate:modelValue":a[6]||(a[6]=e=>l(t).accessTokenValiditySeconds=e),placeholder:"\u5355\u4F4D\uFF1A\u79D2"},null,8,["modelValue"])]),_:1}),o(u,{label:"\u5237\u65B0\u4EE4\u724C\u7684\u6709\u6548\u671F",prop:"refreshTokenValiditySeconds"},{default:r(()=>[o(x,{modelValue:l(t).refreshTokenValiditySeconds,"onUpdate:modelValue":a[7]||(a[7]=e=>l(t).refreshTokenValiditySeconds=e),placeholder:"\u5355\u4F4D\uFF1A\u79D2"},null,8,["modelValue"])]),_:1}),o(u,{label:"\u6388\u6743\u7C7B\u578B",prop:"authorizedGrantTypes"},{default:r(()=>[o(y,{modelValue:l(t).authorizedGrantTypes,"onUpdate:modelValue":a[8]||(a[8]=e=>l(t).authorizedGrantTypes=e),filterable:"",multiple:"",placeholder:"\u8BF7\u8F93\u5165\u6388\u6743\u7C7B\u578B",style:{width:"500px"}},{default:r(()=>[(s(!0),c(p,null,m(l(Ve)(l(q).SYSTEM_OAUTH2_GRANT_TYPE),e=>(s(),i(V,{key:e.value,label:e.label,value:e.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(u,{label:"\u6388\u6743\u8303\u56F4",prop:"scopes"},{default:r(()=>[o(y,{modelValue:l(t).scopes,"onUpdate:modelValue":a[9]||(a[9]=e=>l(t).scopes=e),filterable:"",multiple:"","allow-create":"",placeholder:"\u8BF7\u8F93\u5165\u6388\u6743\u8303\u56F4",style:{width:"500px"}},{default:r(()=>[(s(!0),c(p,null,m(l(t).scopes,e=>(s(),i(V,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(u,{label:"\u81EA\u52A8\u6388\u6743\u8303\u56F4",prop:"autoApproveScopes"},{default:r(()=>[o(y,{modelValue:l(t).autoApproveScopes,"onUpdate:modelValue":a[10]||(a[10]=e=>l(t).autoApproveScopes=e),filterable:"",multiple:"",placeholder:"\u8BF7\u8F93\u5165\u6388\u6743\u8303\u56F4",style:{width:"500px"}},{default:r(()=>[(s(!0),c(p,null,m(l(t).scopes,e=>(s(),i(V,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(u,{label:"\u53EF\u91CD\u5B9A\u5411\u7684 URI \u5730\u5740",prop:"redirectUris"},{default:r(()=>[o(y,{modelValue:l(t).redirectUris,"onUpdate:modelValue":a[11]||(a[11]=e=>l(t).redirectUris=e),"allow-create":"",filterable:"",multiple:"",placeholder:"\u8BF7\u8F93\u5165\u53EF\u91CD\u5B9A\u5411\u7684 URI \u5730\u5740",style:{width:"500px"}},{default:r(()=>[(s(!0),c(p,null,m(l(t).redirectUris,e=>(s(),i(V,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(u,{label:"\u6743\u9650",prop:"authorities"},{default:r(()=>[o(y,{modelValue:l(t).authorities,"onUpdate:modelValue":a[12]||(a[12]=e=>l(t).authorities=e),"allow-create":"",filterable:"",multiple:"",placeholder:"\u8BF7\u8F93\u5165\u6743\u9650",style:{width:"500px"}},{default:r(()=>[(s(!0),c(p,null,m(l(t).authorities,e=>(s(),i(V,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(u,{label:"\u8D44\u6E90",prop:"resourceIds"},{default:r(()=>[o(y,{modelValue:l(t).resourceIds,"onUpdate:modelValue":a[13]||(a[13]=e=>l(t).resourceIds=e),"allow-create":"",filterable:"",multiple:"",placeholder:"\u8BF7\u8F93\u5165\u8D44\u6E90",style:{width:"500px"}},{default:r(()=>[(s(!0),c(p,null,m(l(t).resourceIds,e=>(s(),i(V,{key:e,label:e,value:e},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(u,{label:"\u9644\u52A0\u4FE1\u606F",prop:"additionalInformation"},{default:r(()=>[o(n,{modelValue:l(t).additionalInformation,"onUpdate:modelValue":a[14]||(a[14]=e=>l(t).additionalInformation=e),placeholder:"\u8BF7\u8F93\u5165\u9644\u52A0\u4FE1\u606F\uFF0CJSON \u683C\u5F0F\u6570\u636E",type:"textarea"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[J,l(f)]])]),_:1},8,["modelValue","title"])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/system/oauth2/client/ClientForm.vue"]]),C=Object.freeze(Object.defineProperty({__proto__:null,default:T},Symbol.toStringTag,{value:"Module"}))});export{T as C,he as __tla,C as a,O as d,E as g};