import{l as e,fE as s,t as l,x as a,M as r}from"./utils-lib.js?v=20260328163632";import{u as o,k as t,l as u,m as i}from"./index.vue_vue_type_script_setup_true_lang9.js?v=20260328163632";import{_ as n}from"./index.vue_vue_type_script_setup_true_lang23.js?v=20260328163632";import{u as d}from"./store4.js?v=20260328163632";import{c2 as m,aC as p}from"./site.js?v=20260328163632";import{r as g,O as c,c as v,k as y,i as h,o as x,V as _,W as b,a3 as C,X as w,Z as j,Y as f}from"./base-lib.js?v=20260328163632";import{D as V}from"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index84.js?v=20260328163632";import"./useMethod4.js?v=20260328163632";import"./index.vue_vue_type_script_setup_true_lang10.js?v=20260328163632";import"./index158.js?v=20260328163632";import"./ace.js?v=20260328163632";import"./index91.js?v=20260328163632";import"./index88.js?v=20260328163632";import"./index118.js?v=20260328163632";import"./logs.js?v=20260328163632";const{siteInfo:k}=d(),{isRefreshSSL:T}=o(),A=g(),P=g({label:e("证书信息"),children:[{type:"custom",key:"title",render:()=>c("span",{class:"text-primary"},[e("TrustAsia TLS RSA CA(免费版)")])}]}),E=v((()=>({label:e("域名"),ruleKey:"domain",rules:[{required:!0,message:e("请选择域名"),trigger:["blur","change"]}],children:[{type:"select",key:"domain",attrs:{class:"w-[150px]",options:t.value,placeholder:e("请选择域名")}}]}))),S=g({label:e("个人/公司名称"),ruleKey:"orgName",rules:[{required:!0,message:e("请输入个人/公司名称"),trigger:["blur","input"]}],children:[{type:"custom",key:"orgName",render:()=>c(n,{customClass:"!w-[360px]",modelValue:H.value.orgName,"onUpdate:modelValue":e=>H.value.orgName=e,placeholderTips:e("请输入个人/公司名称，必填项")},null)}]}),K=g({label:e("所在地区"),ruleKey:"orgRegion",rules:[{validator:(s,l)=>""!==l&&""!==H.value.orgCity||new Error(e("所在省份、市/县不能为空")),trigger:["blur","input"]}],children:[{type:"custom",key:"orgRegion",render:()=>c("div",{class:"flex items-center gap-16px"},[c(n,{customClass:"!w-[170px]",modelValue:H.value.orgRegion,"onUpdate:modelValue":e=>H.value.orgRegion=e,placeholderTips:e("请输入所在省份，必填项")},null),c(n,{customClass:"!w-[174px]",modelValue:H.value.orgCity,"onUpdate:modelValue":e=>H.value.orgCity=e,placeholderTips:e("请输入所在市/县，必填项")},null)])}]}),R=g({label:e("地址"),ruleKey:"orgAddress",rules:[{required:!0,message:e("请输入地址"),trigger:["blur","input"]}],children:[{type:"custom",key:"orgAddress",render:()=>c(n,{customClass:"!w-[360px]",modelValue:H.value.orgAddress,"onUpdate:modelValue":e=>H.value.orgAddress=e,placeholderTips:e("请输入地址，必填项")},null)}]}),U=g({label:e("手机"),ruleKey:"orgPhone",rules:[{validator:(l,a)=>""===a?new Error(e("请输入手机号码")):!!s(a)||new Error(e("请输入正确的手机号码")),trigger:["blur","input"]}],children:[{type:"custom",key:"orgPhone",render:()=>c(n,{customClass:"!w-[360px]",modelValue:H.value.orgPhone,"onUpdate:modelValue":e=>H.value.orgPhone=e,placeholderTips:e("请输入手机，必填项")},null)}]}),q=g({label:e("邮政编码"),ruleKey:"orgPostalCode",rules:[{validator:(s,l)=>""===l?new Error(e("请输入邮政编码")):!!/^[0-9]\d{5}(?!\d)$/.test(l)||new Error(e("请输入正确的邮政编码")),trigger:["blur","input"]}],children:[{type:"custom",key:"orgPostalCode",render:()=>c(n,{customClass:"!w-[360px]",modelValue:H.value.orgPostalCode,"onUpdate:modelValue":e=>H.value.orgPostalCode=e,placeholderTips:e("请输入邮政编码，必填项")},null)}]}),N=g({label:" ",children:[{type:"button",key:"save",attrs:{buttonText:e("申请证书"),type:"primary",onClick:async s=>{await M.value.validate();const l={...H.value,orgDivision:"总务",siteid:k.value.id},{data:o,msg:t,status:u}=await a({loading:e("正在提交证书申请资料，请稍后..."),request:m(l)});if(u){A.value&&A.value(),r.success(o.msg||t||e("申请成功"));const{data:s,status:l,msg:u}=await a({loading:e("正在验证证书申请状态，请稍后..."),request:p({oid:o.partnerOrderId,siteid:k.value.id})});l?"COMPLETED"==s.stateCode?(r.success(e("验证成功！即将开始证书部署！")),i(o)):r.success(e("等待CA验证中，若长时间未能成功验证，请登录官网使用DNS方式重新申请...")):r.msg({customClass:"bt-message-error-html",isHtml:!0,message:u,type:"error",duration:0,showClose:!0})}else r.msg({customClass:"bt-message-error-html",isHtml:!0,message:o.msg||t,type:"error",duration:0,showClose:!0});return T.value=!0,u}}}]}),D=g({formAttrs:{labelWidth:"120px"},formItems:[]}),I=v((()=>(D.value.formItems=[P.value,E.value,S.value,K.value,R.value,U.value,q.value,N.value],D.value))),[L,H,M]=l(I),O=async()=>{var e;await u(),t.value.some((e=>e.value===k.value.name))?H.value.domain=k.value.name:H.value.domain=(null==(e=t.value[0])?void 0:e.value)||""},W={class:"p-20px"},X={class:"text-[12px]"},Y=y({__name:"index",setup:s=>(A.value=h("popupClose",(()=>{})),x(O),(s,l)=>{const a=V;return _(),b("div",W,[c(a,{type:"error","show-icon":!1,closable:!1},{header:C((()=>[w("span",X,[l[0]||(l[0]=w("i",{calss:"svgtofont-el-warning-outline text-[12px]"},null,-1)),w("span",null,j(f(e)("禁止含有诈骗、赌博、色情、木马、病毒等违法违规业务信息的站点申请SSL证书，如有违反，撤销申请，停用账号。")),1)])])),_:1}),c(f(L),{class:"mt-16px"})])})});export{Y as default};
