1 |
- import{ap as _,d as N,n as J,r as m,f as L,o,l as p,w as s,i as u,a as l,j as y,C as X,c as S,F as T,k as I,t as w,a2 as B,y as G,U as Q,H as W,ag as Z,ah as $,K as ee,J as le,N as ae,_ as te,__tla as se}from"./index-af173888.js";import{_ as ue,__tla as re}from"./Dialog-987c90a1.js";import{a as U,D as h,__tla as oe}from"./dict-093d1dfa.js";import{u as de,__tla as ie}from"./useMessage-170c1b43.js";let k,O,E,F,ce=Promise.all([(()=>{try{return se}catch{}})(),(()=>{try{return re}catch{}})(),(()=>{try{return oe}catch{}})(),(()=>{try{return ie}catch{}})()]).then(async()=>{F=async v=>await _.get({url:"/system/social-client/page",params:v}),E=async v=>await _.delete({url:"/system/social-client/delete?id="+v}),k=te(N({__name:"SocialClientForm",emits:["success"],setup(v,{expose:P,emit:j}){const{t:g}=J(),q=de(),i=m(!1),C=m(""),c=m(!1),x=m(""),t=m({id:void 0,name:void 0,socialType:void 0,userType:void 0,clientId:void 0,clientSecret:void 0,agentId:void 0,status:0}),D=L({name:[{required:!0,message:"\u5E94\u7528\u540D\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],socialType:[{required:!0,message:"\u793E\u4EA4\u5E73\u53F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],userType:[{required:!0,message:"\u7528\u6237\u7C7B\u578B\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],clientId:[{required:!0,message:"\u5BA2\u6237\u7AEF\u7F16\u53F7\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],clientSecret:[{required:!0,message:"\u5BA2\u6237\u7AEF\u5BC6\u94A5\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],status:[{required:!0,message:"\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}]}),f=m();P({open:async(r,a)=>{if(i.value=!0,C.value=g("action."+r),x.value=r,z(),a){c.value=!0;try{t.value=await(async n=>await _.get({url:"/system/social-client/get?id="+n}))(a)}finally{c.value=!1}}}});const R=j,Y=async()=>{if(f&&await f.value.validate()){c.value=!0;try{const r=t.value;x.value==="create"?(await(async a=>await _.post({url:"/system/social-client/create",data:a}))(r),q.success(g("common.createSuccess"))):(await(async a=>await _.put({url:"/system/social-client/update",data:a}))(r),q.success(g("common.updateSuccess"))),i.value=!1,R("success")}finally{c.value=!1}}},z=()=>{var r;t.value={id:void 0,name:void 0,socialType:void 0,userType:void 0,clientId:void 0,clientSecret:void 0,agentId:void 0,status:0},(r=f.value)==null||r.resetFields()};return(r,a)=>{const n=Q,d=W,b=Z,V=$,A=ee,M=le,H=ue,K=ae;return o(),p(H,{modelValue:l(i),"onUpdate:modelValue":a[8]||(a[8]=e=>G(i)?i.value=e:null),title:l(C)},{footer:s(()=>[u(M,{disabled:l(c),type:"primary",onClick:Y},{default:s(()=>[y("\u786E \u5B9A")]),_:1},8,["disabled"]),u(M,{onClick:a[7]||(a[7]=e=>i.value=!1)},{default:s(()=>[y("\u53D6 \u6D88")]),_:1})]),default:s(()=>[X((o(),p(A,{ref_key:"formRef",ref:f,model:l(t),rules:l(D),"label-width":"120px"},{default:s(()=>[u(d,{label:"\u5E94\u7528\u540D",prop:"name"},{default:s(()=>[u(n,{modelValue:l(t).name,"onUpdate:modelValue":a[0]||(a[0]=e=>l(t).name=e),placeholder:"\u8BF7\u8F93\u5165\u5E94\u7528\u540D"},null,8,["modelValue"])]),_:1}),u(d,{label:"\u793E\u4EA4\u5E73\u53F0",prop:"socialType"},{default:s(()=>[u(V,{modelValue:l(t).socialType,"onUpdate:modelValue":a[1]||(a[1]=e=>l(t).socialType=e)},{default:s(()=>[(o(!0),S(T,null,I(l(U)(l(h).SYSTEM_SOCIAL_TYPE),e=>(o(),p(b,{key:e.value,label:e.value},{default:s(()=>[y(w(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(d,{label:"\u7528\u6237\u7C7B\u578B",prop:"userType"},{default:s(()=>[u(V,{modelValue:l(t).userType,"onUpdate:modelValue":a[2]||(a[2]=e=>l(t).userType=e)},{default:s(()=>[(o(!0),S(T,null,I(l(U)(l(h).USER_TYPE),e=>(o(),p(b,{key:e.value,label:e.value},{default:s(()=>[y(w(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),u(d,{label:"\u5BA2\u6237\u7AEF\u7F16\u53F7",prop:"clientId"},{default:s(()=>[u(n,{modelValue:l(t).clientId,"onUpdate:modelValue":a[3]||(a[3]=e=>l(t).clientId=e),placeholder:"\u8BF7\u8F93\u5165\u5BA2\u6237\u7AEF\u7F16\u53F7,\u5BF9\u5E94\u5404\u5E73\u53F0\u7684appKey"},null,8,["modelValue"])]),_:1}),u(d,{label:"\u5BA2\u6237\u7AEF\u5BC6\u94A5",prop:"clientSecret"},{default:s(()=>[u(n,{modelValue:l(t).clientSecret,"onUpdate:modelValue":a[4]||(a[4]=e=>l(t).clientSecret=e),placeholder:"\u8BF7\u8F93\u5165\u5BA2\u6237\u7AEF\u5BC6\u94A5,\u5BF9\u5E94\u5404\u5E73\u53F0\u7684appSecret"},null,8,["modelValue"])]),_:1}),l(t).socialType===30?(o(),p(d,{key:0,label:"agentId",prop:"agentId"},{default:s(()=>[u(n,{modelValue:l(t).agentId,"onUpdate:modelValue":a[5]||(a[5]=e=>l(t).agentId=e),placeholder:"\u6388\u6743\u65B9\u7684\u7F51\u9875\u5E94\u7528 ID\uFF0C\u6709\u5219\u586B"},null,8,["modelValue"])]),_:1})):B("",!0),u(d,{label:"\u72B6\u6001",prop:"status"},{default:s(()=>[u(V,{modelValue:l(t).status,"onUpdate:modelValue":a[6]||(a[6]=e=>l(t).status=e)},{default:s(()=>[(o(!0),S(T,null,I(l(U)(l(h).COMMON_STATUS),e=>(o(),p(b,{key:e.value,label:e.value},{default:s(()=>[y(w(e.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])),[[K,l(c)]])]),_:1},8,["modelValue","title"])}}}),[["__file","/Users/RuHu.Xu/Desktop/mall-newfeifan-zx-admin/src/views/system/social/client/SocialClientForm.vue"]]),O=Object.freeze(Object.defineProperty({__proto__:null,default:k},Symbol.toStringTag,{value:"Module"}))});export{k as S,ce as __tla,O as a,E as d,F as g};
|