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