1 |
- import{d as S,P as q,r as p,o as c,c as _,f as o,A as n,a as l,D as m,k as N,C as w,F as O,R as W,E as z,a3 as E,a2 as J,a9 as Y,V as M,at as T,au as j,W as B,J as L,Z,_ as G,__tla as H}from"./index-286756b9.js";import{_ as Q,__tla as X}from"./Dialog-4c2de357.js";import{C as $}from"./constants-637baed6.js";import{b as ee,D as ae,__tla as le}from"./dict-82dca549.js";import{g as te,c as oe,u as ne,__tla as ie}from"./index-c58bce26.js";import{u as re,__tla as se}from"./useMessage-084b1e70.js";let I,ue=Promise.all([(()=>{try{return H}catch{}})(),(()=>{try{return X}catch{}})(),(()=>{try{return le}catch{}})(),(()=>{try{return ie}catch{}})(),(()=>{try{return se}catch{}})()]).then(async()=>{let y;y={key:0},I=G(S({name:"FuYouWeixinChannelForm",__name:"FuYouWeixinChannelForm",emits:["success"],setup(de,{expose:x,emit:k}){const{t:v}=q(),g=re(),u=p(!1),h=p(""),d=p(!1),e=p({appId:"",code:"",status:void 0,feeRate:void 0,remark:"",config:{appId:"",mchId:"",apiVersion:"",mchKey:"",keyContent:"keyContent",privateKeyContent:"privateKeyContent",privateCertContent:"privateCertContent",apiV3Key:"apiV3Key"}}),K={feeRate:[{required:!0,message:"\u8BF7\u8F93\u5165\u6E20\u9053\u8D39\u7387",trigger:"blur"}],status:[{required:!0,message:"\u6E20\u9053\u72B6\u6001\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],"config.mchId":[{required:!0,message:"\u8BF7\u4F20\u5165\u5546\u6237\u53F7",trigger:"blur"}],"config.appId":[{required:!0,message:"\u8BF7\u8F93\u5165\u516C\u4F17\u53F7APPID",trigger:"blur"}],"config.mchKey":[{required:!0,message:"\u8BF7\u8F93\u5165\u5546\u6237\u5BC6\u94A5",trigger:"blur"}]},f=p();x({open:async(r,a)=>{u.value=!0,d.value=!0,U(r,a);try{const i=await te(r,a);i&&i.id&&(e.value=i,e.value.config=JSON.parse(i.config),e.value.config.keyContent="keyContent",e.value.config.privateKeyContent="privateKeyContent",e.value.config.privateCertContent="privateCertContent",e.value.config.apiV3Key="apiV3Key"),h.value=e.value.id?"\u7F16\u8F91\u652F\u4ED8\u6E20\u9053":"\u521B\u5EFA\u652F\u4ED8\u6E20\u9053"}finally{d.value=!1}}});const R=k,P=async()=>{if(f&&await f.value.validate()){d.value=!0;try{const r={...e.value};r.config=JSON.stringify(e.value.config),r.id?(await ne(r),g.success(v("common.updateSuccess"))):(await oe(r),g.success(v("common.createSuccess"))),u.value=!1,R("success")}finally{d.value=!1}}},U=(r,a)=>{var i;e.value={appId:r,code:a,status:$.ENABLE,feeRate:void 0,remark:"",config:{appId:"",mchId:"",apiVersion:"",mchKey:"",keyContent:"",privateKeyContent:"",privateCertContent:"",apiV3Key:""}},(i=f.value)==null||i.resetFields()};return(r,a)=>{const i=Y,s=M,V=T,b=j,A=B,C=L,F=Q,D=Z;return c(),_("div",null,[o(F,{modelValue:l(u),"onUpdate:modelValue":a[8]||(a[8]=t=>J(u)?u.value=t:null),title:l(h),onClose:r.close,width:"800px"},{footer:n(()=>[o(C,{disabled:l(d),type:"primary",onClick:P},{default:n(()=>[m("\u786E \u5B9A")]),_:1},8,["disabled"]),o(C,{onClick:a[7]||(a[7]=t=>u.value=!1)},{default:n(()=>[m("\u53D6 \u6D88")]),_:1})]),default:n(()=>[N((c(),w(A,{ref_key:"formRef",ref:f,model:l(e),rules:K,"label-width":"120px"},{default:n(()=>[o(s,{"label-width":"180px",label:"\u6E20\u9053\u8D39\u7387",prop:"feeRate"},{default:n(()=>[o(i,{modelValue:l(e).feeRate,"onUpdate:modelValue":a[0]||(a[0]=t=>l(e).feeRate=t),placeholder:"\u8BF7\u8F93\u5165\u6E20\u9053\u8D39\u7387",clearable:"",style:{width:"100%"}},{append:n(()=>[m("%")]),_:1},8,["modelValue"])]),_:1}),o(s,{"label-width":"180px",label:"\u516C\u4F17\u53F7 APPID",prop:"config.appId"},{default:n(()=>[o(i,{modelValue:l(e).config.appId,"onUpdate:modelValue":a[1]||(a[1]=t=>l(e).config.appId=t),placeholder:"\u8BF7\u8F93\u5165\u516C\u4F17\u53F7 APPID",clearable:"",style:{width:"100%"}},null,8,["modelValue"])]),_:1}),o(s,{"label-width":"180px",label:"\u5546\u6237\u53F7",prop:"config.mchId"},{default:n(()=>[o(i,{modelValue:l(e).config.mchId,"onUpdate:modelValue":a[2]||(a[2]=t=>l(e).config.mchId=t),style:{width:"100%"}},null,8,["modelValue"])]),_:1}),o(s,{"label-width":"180px",label:"\u6E20\u9053\u72B6\u6001",prop:"status"},{default:n(()=>[o(b,{modelValue:l(e).status,"onUpdate:modelValue":a[3]||(a[3]=t=>l(e).status=t)},{default:n(()=>[(c(!0),_(O,null,W(l(ee)(l(ae).COMMON_STATUS),t=>(c(),w(V,{key:parseInt(t.value),label:parseInt(t.value)},{default:n(()=>[m(z(t.label),1)]),_:2},1032,["label"]))),128))]),_:1},8,["modelValue"])]),_:1}),o(s,{"label-width":"180px",label:"API \u7248\u672C",prop:"config.apiVersion"},{default:n(()=>[o(b,{modelValue:l(e).config.apiVersion,"onUpdate:modelValue":a[4]||(a[4]=t=>l(e).config.apiVersion=t)},{default:n(()=>[o(V,{label:"v2"},{default:n(()=>[m("v2")]),_:1})]),_:1},8,["modelValue"])]),_:1}),l(e).config.apiVersion==="v2"?(c(),_("div",y,[o(s,{"label-width":"180px",label:"\u5546\u6237\u5BC6\u94A5",prop:"config.mchKey"},{default:n(()=>[o(i,{modelValue:l(e).config.mchKey,"onUpdate:modelValue":a[5]||(a[5]=t=>l(e).config.mchKey=t),placeholder:"\u8BF7\u8F93\u5165\u5546\u6237\u5BC6\u94A5",clearable:"",style:{width:"100%"},type:"textarea",autosize:{minRows:8,maxRows:8}},null,8,["modelValue"])]),_:1})])):E("",!0),o(s,{"label-width":"180px",label:"\u5907\u6CE8",prop:"remark"},{default:n(()=>[o(i,{modelValue:l(e).remark,"onUpdate:modelValue":a[6]||(a[6]=t=>l(e).remark=t),style:{width:"100%"}},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])),[[D,l(d)]])]),_:1},8,["modelValue","title","onClose"])])}}}),[["__file","D:/zx/mall-newfeifan-zx-admin/src/views/pay/app/components/channel/FuYouWeixinChannelForm.vue"]])});export{ue as __tla,I as default};
|