import{c as e,s as a,o as s,r as t,q as r,v as l,x as i,e as o,B as d,y as n,F as m,b0 as c,R as p,al as u,ab as h,a9 as f,N as b,z as _,A as v,ak as y}from"./base-lib.js?v=1761009159";import{C as w,E as x,F as N,G as I}from"./ssl.js?v=1761009159";import{b as j}from"./utils-lib.js?v=1761009159";import{u as O}from"./useStore11.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";const k={class:"p-[16px]"},R={style:{float:"left"}},D=e({__name:"index",props:{compData:{type:Object,default:()=>{}}},setup(e,{expose:D}){const{activeTabs:z,sslIsRefresh:V,testIsRefresh:q,encryptIsRefresh:C,otherIsRefresh:F}=a(O()),S=j(),g=e,A=s({siteName:"",ssl_hash:"",oid:"",partnerOrderId:"",index:""}),B=t([]),E=async e=>{let a;try{switch(e){case"1":a=await I({siteName:A.siteName,oid:A.oid});break;case"2":a=await N({siteName:A.siteName,partnerOrderId:A.partnerOrderId});break;case"3":let e={siteName:A.siteName,ssl_hash:A.ssl_hash,index:A.index};g.compData.row.order_status?delete e.ssl_hash:delete e.index,a=await x(e)}}catch(s){}return a},G=()=>{A.siteName="",A.ssl_hash="",A.oid="",A.partnerOrderId="",A.index=""};return r(()=>{(async()=>{const{data:e}=await w();B.value=e})(),(e=>{switch(e.type){case"1":A.oid=e.oid;break;case"2":A.partnerOrderId=e.partnerOrderId;break;case"3":A.ssl_hash=e.hash,A.index=e.index}})(g.compData.row)}),D({onConfirm:async e=>{var a;if(!A.siteName)return void S.error("请选择部署网站");let s;try{s=S.load("正在部署证书,请稍后...");const t=await E(g.compData.row.type);if(S.request(t),t.status){G();const s={ssl:()=>V.value=!0,test:()=>q.value=!0,encrypt:()=>C.value=!0,other:()=>F.value=!0};null==(a=s[z.value])||a.call(s),e&&e()}}catch(t){}finally{s&&s.close()}}}),(e,a)=>{const s=y,t=u,r=h,w=f;return l(),i("div",k,[o(w,{model:n(A),class:"relative w-full","label-position":"right",size:"small",onSubmit:a[1]||(a[1]=p(()=>{},["prevent"]))},{default:d(()=>[o(r,{label:"部署网站",prop:"dns_name"},{default:d(()=>[o(t,{modelValue:n(A).siteName,"onUpdate:modelValue":a[0]||(a[0]=e=>n(A).siteName=e),class:"!w-[33rem]",filterable:"","default-first-option":"",size:"default",placeholder:"请选择部署网站"},{default:d(()=>[(l(!0),i(m,null,c(n(B),e=>(l(),b(s,{key:e.id,label:e.name,value:e.name},{default:d(()=>[_("span",R,v(e.name),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"])])}}});export{D as default};
