import{aG as V,K as T,q as E,aA as w}from"./index.17037962789732.js";import"./index.1703796278973303.js";import"./index.170379627897329.js";import"./index.170379627897315.js";import"./index.170379627897330.js";import"./index.170379627897314.js";import{T as m,L as A,o as _}from"./comm.1703796278973.js";import{N as L}from"./certificate.1703796278973.js";import{d as f,k as d,m as N,r as j,o as k,c as B,a as r,b as l,u as a,M as I,t as K}from"./vue.1703796278973.js";const O=f({name:"CertificateFile"}),J=f({...O,props:{name:{type:String,default:()=>""},modelValue:{type:String,default:()=>""},placeholder:{type:String,default:()=>""}},emits:["update:modelValue","change"],setup(u,{emit:s}){const c=u,e=d(c.modelValue),p=d(!1),g=t=>{var o;if(p.value=!0,t.file.status==="done"){const n=(o=t.file.response)==null?void 0:o.result;new RegExp(/\.pem$/i).test(t.file.name)?(e.value=n,s("change",n),s("update:modelValue",n),_("上传成功！","success")):_("请上传.pem格式的文件","error"),p.value=!1}},h=t=>{s("change",e.value),s("update:modelValue",e.value)};return N(()=>c.modelValue,t=>{e.value=t},{deep:!0,immediate:!0}),(t,o)=>{const n=V,i=j("AIcon"),v=T,C=E,x=w;return k(),B(x,{spinning:a(p)},{default:r(()=>[l(n,{rows:4,onChange:h,value:a(e),"onUpdate:value":o[0]||(o[0]=y=>I(e)?e.value=y:null),placeholder:u.placeholder},null,8,["value","placeholder"]),l(C,{accept:".pem",listType:"text",action:a(L),headers:{[a(m)]:a(A).get(a(m))},showUploadList:!1,onChange:g},{default:r(()=>[l(v,{style:{"margin-top":"10px"}},{default:r(()=>[l(i,{type:"UploadOutlined"}),K(" 上传文件")]),_:1})]),_:1},8,["action","headers"])]),_:1},8,["spinning"])}}});export{J as _};
