import{u as L}from"./useInstance.233fbdde.js";import{d as M,r as d,W,s as Y,aq as $,b as v,c as r,e as m,k as R,i as u,u as l,a2 as j,h as e,du as I,f as S,A as E,m as c,E as G}from"./index.0308b213.js";const H=c("\u70B9\u51FB\u4E0A\u4F20"),J={key:0,slot:"tip",class:"el-upload__tip tip"},O=c("\u70B9\u51FB\u4E0A\u4F20"),P={key:0,slot:"tip",class:"el-upload__tip tip"},Q=c("\u63D0\u4EA4"),X=c("\u53D6\u6D88"),le=M({props:{modelValue:{type:Boolean,default:!1},edit_index:null,pay_type_text:null},emits:["update:modelValue","onClose"],setup(x,{emit:C}){const{global:N}=L(),h=d(!1),w=d(1),z=d(""),T=d(""),y=d([]),B=d(),V=d(window.location.protocol+"//"+window.location.host+"/adminapi/upload/image"),{token:q}=W(),A=Y(()=>({token:q,version:$})),k=d(!1),D=d(),o=v({wxapp_app_id:"",wx_app_app_secret:"",wx_app_mch_id:"",wx_app_key:"",wx_app_serial_no:"",wx_app_cert_path:"",wx_app_key_path:""}),b=(s,t,n,p)=>{var i;if(n.every(_=>_.status=="success"),(s==null?void 0:s.code)===1&&((i=s==null?void 0:s.data)==null?void 0:i.url)){console.log(s);let _=s.data.url;p==="cert_path"?z.value=_:p==="key_path"&&(T.value=_),o[p]=_}},g=()=>{G.error("\u8D85\u51FA\u4E0A\u4F20\u4E0A\u9650\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20")},K=()=>{};v({list:[]});const U=()=>{C("update:modelValue",!1),C("onClose"),N.$resetForm(D.value,formData)};return(s,t)=>{const n=r("el-input"),p=r("el-form-item"),i=r("el-button"),_=r("el-dialog");return m(),R(_,{modelValue:k.value,"onUpdate:modelValue":t[5]||(t[5]=a=>k.value=a),title:x.pay_type_text,width:"70%","destroy-on-close":"",onClose:U},{default:u(()=>[x.edit_index==1?(m(),R(l(j),{key:0,ref_key:"formRef",ref:D,model:l(o),"inline-message":!0,"label-width":"160px"},{default:u(()=>[e(p,{label:"appid"},{default:u(()=>[e(n,{modelValue:l(o).wxapp_app_id,"onUpdate:modelValue":t[0]||(t[0]=a=>l(o).wxapp_app_id=a),placeholder:"appid"},null,8,["modelValue"])]),_:1}),e(p,{label:"appSecret"},{default:u(()=>[e(n,{modelValue:l(o).wx_app_app_secret,"onUpdate:modelValue":t[1]||(t[1]=a=>l(o).wx_app_app_secret=a),placeholder:"appSecret"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u5546\u6237\u53F7"},{default:u(()=>[e(n,{modelValue:l(o).wx_app_mch_id,"onUpdate:modelValue":t[2]||(t[2]=a=>l(o).wx_app_mch_id=a),placeholder:"\u5546\u6237\u53F7"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u5546\u6237\u5BC6\u94A5(32\u4F4D\u81EA\u5B9A\u5BC6\u94A5)"},{default:u(()=>[e(n,{modelValue:l(o).wx_app_key,"onUpdate:modelValue":t[3]||(t[3]=a=>l(o).wx_app_key=a),placeholder:"\u5546\u6237\u5BC6\u94A5(32\u4F4D\u81EA\u5B9A\u5BC6\u94A5)"},null,8,["modelValue"])]),_:1}),e(p,{label:"\u5546\u6237\u8BC1\u4E66\u5E8F\u5217\u53F7"},{default:u(()=>[e(n,{modelValue:l(o).wx_app_serial_no,"onUpdate:modelValue":t[4]||(t[4]=a=>l(o).wx_app_serial_no=a),placeholder:"\u5546\u6237\u8BC1\u4E66\u5E8F\u5217\u53F7"},null,8,["modelValue"])]),_:1}),e(p,{label:"CERT\u8BC1\u4E66\u6587\u4EF6"},{default:u(()=>[e(l(I),{ref_key:"tnUploadImageRef",ref:B,action:V.value,multiple:h.value,limit:w.value,headers:l(A),"file-list":y.value,"on-success":(a,f,F)=>b(a,f,F,"cert_path"),"on-exceed":g,"on-error":s.handleError},{default:u(()=>[e(i,{size:"small",type:"primary"},{default:u(()=>[H]),_:1}),l(o).wx_app_cert_path?(m(),S("div",J,"\u5DF2\u7ECF\u4E0A\u4F20\uFF0C\u82E5\u8981\u4FEE\u6539\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20")):E("",!0)]),_:1},8,["action","multiple","limit","headers","file-list","on-success","on-error"])]),_:1}),e(p,{label:"KEY\u8BC1\u4E66\u5BC6\u94A5\u6587\u4EF6"},{default:u(()=>[e(l(I),{ref_key:"tnUploadImageRef",ref:B,action:V.value,multiple:h.value,limit:w.value,headers:l(A),"file-list":y.value,"on-success":(a,f,F)=>b(a,f,F,"key_path"),"on-exceed":g,"on-error":s.handleError},{default:u(()=>[e(i,{size:"small",type:"primary"},{default:u(()=>[O]),_:1}),l(o).wx_app_key_path?(m(),S("div",P,"\u5DF2\u7ECF\u4E0A\u4F20\uFF0C\u82E5\u8981\u4FEE\u6539\uFF0C\u8BF7\u91CD\u65B0\u4E0A\u4F20")):E("",!0)]),_:1},8,["action","multiple","limit","headers","file-list","on-success","on-error"])]),_:1}),e(p,null,{default:u(()=>[e(i,{type:"primary",onClick:K},{default:u(()=>[Q]),_:1}),e(i,{onClick:U},{default:u(()=>[X]),_:1})]),_:1})]),_:1},8,["model"])):E("",!0)]),_:1},8,["modelValue","title"])}}});export{le as _};
