niucloud-admin/niucloud/public/admin/assets/pay-alipay-17e2d23e.js
全栈小学生 ba52b6cf09 up
2025-03-14 18:31:07 +08:00

2 lines
4.4 KiB
JavaScript

import{d as F,r as m,l as N,M as R,k as l,h as P,m as w,w as r,a as _,e as i,i as C,t as h,u as p,J as j,Q as B,D as M,G as O,H as S,E as T,V as L,L as $}from"./index-ac08d87d.js";/* empty css *//* empty css *//* empty css *//* empty css *//* empty css */import{_ as A}from"./index.vue_vue_type_style_index_0_lang-47915991.js";import"./el-form-item-4ed993c7.js";/* empty css */import{T as d}from"./test-71dfb9c1.js";/* empty css *//* empty css */const G={class:"form-tip"},H={class:"input-width"},J={class:"input-width"},Q={class:"input-width"},z={class:"dialog-footer"},ne=F({__name:"pay-alipay",emits:["complete"],setup(K,{expose:D,emit:y}){const s=m(!1),c=m(!0),n=m(null),f={type:"alipay",app_id:"",config:{app_secret_cert:"",app_public_cert_path:"",alipay_public_cert_path:"",alipay_root_cert_path:""},channel:"",status:0,is_default:0},e=N({...f}),b=m(),x=R(()=>({"config.app_id":[{required:!0,message:l("appIdPlaceholder"),trigger:"blur"}],"config.app_secret_cert":[{required:!0,message:l("appSecretCertPlaceholder"),trigger:"blur"}],"config.app_public_cert_path":[{required:!0,message:l("appPublicCertPathPlaceholder"),trigger:"blur"}],"config.alipay_public_cert_path":[{required:!0,message:l("alipayPublicCertPathPlaceholder"),trigger:"blur"}],"config.alipay_root_cert_path":[{required:!0,message:l("alipayRootCertPathPlaceholder"),trigger:"blur"}]})),E=async a=>{c.value||!a||await a.validate(async t=>{t&&(y("complete",e),s.value=!1)})},k=()=>{Object.assign(e,f),n.value&&(Object.keys(e).forEach(a=>{n.value[a]!=null&&(e[a]=n.value[a])}),e.channel=n.value.redio_key.split("_")[0],e.status=Number(e.status)),y("complete",e),s.value=!1};return D({showDialog:s,setFormData:async(a=null)=>{n.value=B(a),c.value=!0,Object.assign(e,f),a&&(Object.keys(e).forEach(t=>{a[t]!=null&&(e[t]=a[t])}),e.channel=a.redio_key.split("_")[0],e.status=Number(e.status)),c.value=!1},enableVerify:()=>{let a=!0;return(d.empty(e.config.app_id)||d.empty(e.config.app_secret_cert)||d.empty(e.config.app_public_cert_path)||d.empty(e.config.alipay_public_cert_path)||d.empty(e.config.alipay_root_cert_path))&&(a=!1),a}}),(a,t)=>{const v=M,u=O,g=A,I=S,V=T,U=L,q=$;return P(),w(U,{modelValue:s.value,"onUpdate:modelValue":t[6]||(t[6]=o=>s.value=o),title:p(l)("updateAlipay"),width:"550px","destroy-on-close":!0},{footer:r(()=>[_("span",z,[i(V,{onClick:k},{default:r(()=>[C(h(p(l)("cancel")),1)]),_:1}),i(V,{type:"primary",loading:c.value,onClick:t[5]||(t[5]=o=>E(b.value))},{default:r(()=>[C(h(p(l)("confirm")),1)]),_:1},8,["loading"])])]),default:r(()=>[j((P(),w(I,{model:e,"label-width":"110px",ref_key:"formRef",ref:b,rules:p(x),class:"page-form"},{default:r(()=>[i(u,{label:p(l)("appId"),prop:"config.app_id"},{default:r(()=>[i(v,{modelValue:e.config.app_id,"onUpdate:modelValue":t[0]||(t[0]=o=>e.config.app_id=o),modelModifiers:{trim:!0},placeholder:p(l)("appIdPlaceholder"),class:"input-width",maxlength:"32","show-word-limit":"",clearable:""},null,8,["modelValue","placeholder"]),_("div",G,h(p(l)("appIdTips")),1)]),_:1},8,["label"]),i(u,{label:p(l)("appSecretCert"),prop:"config.app_secret_cert"},{default:r(()=>[i(v,{modelValue:e.config.app_secret_cert,"onUpdate:modelValue":t[1]||(t[1]=o=>e.config.app_secret_cert=o),modelModifiers:{trim:!0},placeholder:p(l)("appSecretCertPlaceholder"),class:"input-width",type:"textarea",rows:"4",clearable:""},null,8,["modelValue","placeholder"])]),_:1},8,["label"]),i(u,{label:p(l)("appPublicCertPath"),prop:"config.app_public_cert_path"},{default:r(()=>[_("div",H,[i(g,{modelValue:e.config.app_public_cert_path,"onUpdate:modelValue":t[2]||(t[2]=o=>e.config.app_public_cert_path=o),modelModifiers:{trim:!0},api:"sys/document/aliyun"},null,8,["modelValue"])])]),_:1},8,["label"]),i(u,{label:p(l)("alipayPublicCertPath"),prop:"config.alipay_public_cert_path"},{default:r(()=>[_("div",J,[i(g,{modelValue:e.config.alipay_public_cert_path,"onUpdate:modelValue":t[3]||(t[3]=o=>e.config.alipay_public_cert_path=o),api:"sys/document/aliyun"},null,8,["modelValue"])])]),_:1},8,["label"]),i(u,{label:p(l)("alipayRootCertPath"),prop:"config.alipay_root_cert_path"},{default:r(()=>[_("div",Q,[i(g,{modelValue:e.config.alipay_root_cert_path,"onUpdate:modelValue":t[4]||(t[4]=o=>e.config.alipay_root_cert_path=o),api:"sys/document/aliyun"},null,8,["modelValue"])])]),_:1},8,["label"])]),_:1},8,["model","rules"])),[[q,c.value]])]),_:1},8,["modelValue","title"])}}});export{ne as default};