test_lgq/niucloud/public/admin/assets/pay-wechatpay.vue_vue_type_script_setup_true_lang-2f434b35.js
2024-01-24 17:36:08 +08:00

2 lines
3.5 KiB
JavaScript

import{d as I,r as _,n as E,q,N as t,h as v,I as y,w as r,a as i,e as c,i as w,t as n,u as o,y as F,W as N,X as T,Y as U,E as B,aa as K,a0 as R}from"./index-4dcc0234.js";/* empty css *//* empty css *//* empty css *//* empty css */import{_ as $}from"./index.vue_vue_type_style_index_0_lang-cd8f78e9.js";import"./el-form-item-4ed993c7.js";/* empty css */const j={class:"form-tip"},O={class:"form-tip"},W={class:"input-width"},L={class:"form-tip"},X={class:"input-width"},Y={class:"form-tip"},z={class:"dialog-footer"},oe=I({__name:"pay-wechatpay",emits:["complete"],setup(A,{expose:V,emit:P}){const m=_(!1),d=_(!0),p={type:"wechatpay",config:{mch_id:"",mch_secret_key:"",mch_secret_cert:"",mch_public_cert_path:""},channel:"",status:0,is_default:0},l=E({...p}),h=_(),k=q(()=>({"config.mch_id":[{required:!0,message:t("mchIdPlaceholder"),trigger:"blur"}],"config.mch_secret_key":[{required:!0,message:t("mchSecretKeyPlaceholder"),trigger:"blur"}],"config.mch_secret_cert":[{required:!0,message:t("mchSecretCertPlaceholder"),trigger:"blur"}],"config.mch_public_cert_path":[{required:!0,message:t("mchPublicCertPathPlaceholder"),trigger:"blur"}]})),C=async s=>{d.value||!s||await s.validate(async e=>{e&&(P("complete",l),m.value=!1)})};return V({showDialog:m,setFormData:async(s=null)=>{d.value=!0,Object.assign(l,p),s&&(Object.keys(l).forEach(e=>{s[e]!=null&&(l[e]=s[e])}),l.channel=s.redio_key.split("_")[0],l.status=Number(l.status)),d.value=!1}}),(s,e)=>{const f=N,u=T,g=$,x=U,b=B,D=K,S=R;return v(),y(D,{modelValue:m.value,"onUpdate:modelValue":e[6]||(e[6]=a=>m.value=a),title:o(t)("updateWechat"),width:"500px","destroy-on-close":!0},{footer:r(()=>[i("span",z,[c(b,{onClick:e[4]||(e[4]=a=>m.value=!1)},{default:r(()=>[w(n(o(t)("cancel")),1)]),_:1}),c(b,{type:"primary",loading:d.value,onClick:e[5]||(e[5]=a=>C(h.value))},{default:r(()=>[w(n(o(t)("confirm")),1)]),_:1},8,["loading"])])]),default:r(()=>[F((v(),y(x,{model:l,"label-width":"90px",ref_key:"formRef",ref:h,rules:o(k),class:"page-form"},{default:r(()=>[c(u,{label:o(t)("mchId"),prop:"config.mch_id"},{default:r(()=>[c(f,{modelValue:l.config.mch_id,"onUpdate:modelValue":e[0]||(e[0]=a=>l.config.mch_id=a),placeholder:o(t)("mchIdPlaceholder"),class:"input-width",maxlength:"32","show-word-limit":"",clearable:""},null,8,["modelValue","placeholder"]),i("div",j,n(o(t)("mchIdTips")),1)]),_:1},8,["label"]),c(u,{label:o(t)("mchSecretKey"),prop:"config.mch_secret_key"},{default:r(()=>[c(f,{modelValue:l.config.mch_secret_key,"onUpdate:modelValue":e[1]||(e[1]=a=>l.config.mch_secret_key=a),placeholder:o(t)("mchSecretKeyPlaceholder"),class:"input-width",maxlength:"32","show-word-limit":"",clearable:""},null,8,["modelValue","placeholder"]),i("div",O,n(o(t)("mchSecretKeyTips")),1)]),_:1},8,["label"]),c(u,{label:o(t)("mchSecretCert"),prop:"config.mch_secret_cert"},{default:r(()=>[i("div",W,[c(g,{modelValue:l.config.mch_secret_cert,"onUpdate:modelValue":e[2]||(e[2]=a=>l.config.mch_secret_cert=a),api:"sys/document/wechat"},null,8,["modelValue"])]),i("div",L,n(o(t)("mchSecretCertTips")),1)]),_:1},8,["label"]),c(u,{label:o(t)("mchPublicCertPath"),prop:"config.mch_public_cert_path"},{default:r(()=>[i("div",X,[c(g,{modelValue:l.config.mch_public_cert_path,"onUpdate:modelValue":e[3]||(e[3]=a=>l.config.mch_public_cert_path=a),api:"sys/document/wechat"},null,8,["modelValue"])]),i("div",Y,n(o(t)("mchPublicCertPathTips")),1)]),_:1},8,["label"])]),_:1},8,["model","rules"])),[[S,d.value]])]),_:1},8,["modelValue","title"])}}});export{oe as _};