import{c as a,o as s,r as e,q as o,aO as l,v as i,x as t,e as d,B as n,y as r,z as m,C as p,F as u,b0 as c,R as _,ak as f,al as v,ab as b,a9 as D,N as w,A as h}from"./base-lib.js?v=1761009159";import{e as y,b as j}from"./utils-lib.js?v=1761009159";import{y as g,N as x}from"./ssl.js?v=1761009159";import{g as L}from"./useStore10.js?v=1761009159";import{d as N}from"./useMethod12.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";import"./useMethod10.js?v=1761009159";const S={class:"p-2rem"},z={class:"el-select-dropdown__empty"},C={style:{float:"left"}},k={class:"ml-[1rem]",style:{float:"right",color:"var(--el-base-tertiary)","font-size":"var(--el-font-size-base)"}},O=a({__name:"index",props:{compData:{type:Object,default:()=>{}}},emits:["close"],setup(a,{expose:O,emit:R}){const V=j(),{refs:{isRefreshDomainList:q,isRefreshDomainConfigList:M}}=L(),A=a,B=R,E=s({dns_id:"",ids:[]}),F=e([]),H=()=>{E.dns_id="",E.ids=[]},J=()=>{B("close"),N()};return o(()=>{var a,s,e,o;(async()=>{const{data:a}=await g(),{data:s}=a;F.value=s})(),A.compData.row.id&&((null==(a=A.compData.row)?void 0:a.dns)&&(E.dns_id=A.compData.row.dns.id),E.ids.push(A.compData.row.id)),A.compData.row.domain_id&&E.ids.push(A.compData.row.domain_id),(null==(s=A.compData)?void 0:s.rowList)&&(null==(o=null==(e=A.compData)?void 0:e.rowList)?void 0:o.length)&&(E.ids=[],A.compData.rowList.forEach(a=>{E.ids.push(a.id),a.domain_id&&E.ids.push(a.domain_id)}))}),O({onConfirm:async()=>{var a,s,e,o;if(E.dns_id)try{const l=await x({dns_id:E.dns_id,ids:JSON.stringify(E.ids)});V.request(l),l.status&&(H(),(A.compData.row.domain_id||(null==(s=null==(a=A.compData)?void 0:a.rowList)?void 0:s.some(a=>a.domain_id)))&&(M.value=!0),(A.compData.row.id||(null==(o=null==(e=A.compData)?void 0:e.rowList)?void 0:o.some(a=>a.id)))&&(q.value=!0),B("close"))}catch(l){}else V.error("请选择验证类型")}}),(a,s)=>{const e=y,o=f,j=v,g=b,x=D,L=l("global-dns-form-popup");return i(),t("div",S,[d(x,{model:r(E),class:"relative w-full","label-position":"right",size:"small",onSubmit:s[1]||(s[1]=_(()=>{},["prevent"]))},{default:n(()=>[d(g,{label:"验证类型",prop:"dns_name",class:"!m-0"},{default:n(()=>[d(j,{modelValue:r(E).dns_id,"onUpdate:modelValue":s[0]||(s[0]=a=>r(E).dns_id=a),class:"!w-[33rem]",filterable:"","default-first-option":"",size:"default",placeholder:"请选择验证类型"},{empty:n(()=>[m("p",z,[s[3]||(s[3]=m("span",null,"暂无数据，请先添加DNS接口",-1)),d(e,{class:"!text-base",onClick:J},{default:n(()=>s[2]||(s[2]=[p(">>添加",-1)])),_:1,__:[2]})])]),default:n(()=>[(i(!0),t(u,null,c(r(F),a=>(i(),w(o,{key:a.id,label:a.dns_name,value:a.id},{default:n(()=>[m("span",C,h(a.dns_name),1),m("span",k,h(a.ps),1)]),_:2},1032,["label","value"]))),128)),d(o,{label:"更多类型",value:"none",disabled:""},{default:n(()=>[m("p",null,[s[5]||(s[5]=m("span",null,"更多类型，请添加DNS接口",-1)),d(e,{class:"!text-base",onClick:J},{default:n(()=>s[4]||(s[4]=[p(">>添加",-1)])),_:1,__:[4]})])]),_:1})]),_:1},8,["modelValue"])]),_:1})]),_:1},8,["model"]),d(L,{title:"添加NDS接口"})])}}});export{O as default};
