import{j as a,r as s,e as t,c as e,s as o,aA as l,g as r,n as p,v as u,x as n,y as d,z as c,B as i,A as m,N as v,C as _,D as x,aw as f,ay as y,aS as w,G as D}from"./base-lib.js?v=1761009159";import{B as b,j7 as h,M as j,l as k,_ as M}from"./utils-lib.js?v=1761009159";import{o as T}from"./index56.js?v=1761009159";import{o as C}from"./validator.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index105.js?v=1761009159";import"./index114.js?v=1761009159";import"./useMethod7.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";import"./useMethod9.js?v=1761009159";import"./header-nav-tools.vue_vue_type_script_setup_true_lang.js?v=1761009159";const X=a("MAIL_DOMAIN_DNS",()=>{const a=s(),e=s({}),o=s([{type:"TXT",host:"@",value:"v=spf1 a mx -all"},{type:"TXT",host:"default._domainkey",value:""},{type:"TXT",host:"_dmarc",value:""}]),l=({status:a})=>t("div",{class:["inline-flex items-center",a?"text-primary":"text-dangerDark"]},[t("span",{class:["glyphicon","glyphicon-".concat(a?"ok":"remove")]},null),t("span",{class:"ml-4px"},[a?"OK":"未设置"])]),r=s([{prop:"domain",label:"域名",width:120,showOverflowTooltip:!0},{prop:"mx_status",label:"MX记录",render:a=>t(l,{status:1===a.mx_status},null)},{prop:"a_status",label:"A记录",render:a=>t(l,{status:1===a.a_status},null)},{prop:"spf_status",label:"SPF记录",render:a=>t(l,{status:1===a.spf_status},null)},{prop:"dkim_status",label:"DKIM记录",render:a=>t(l,{status:1===a.dkim_status},null)},{prop:"dmarc_status",label:"DMARC记录",render:a=>t(l,{status:1===a.dmarc_status},null)}]);return{statusData:a,propsData:e,addTxtRecordData:o,statusColumns:r,onCopy:a=>{b({value:a,success:"复制成功",error:"复制失败"})},onVerify:async a=>{const{data:s}=await h({domain:e.value.row.domain});j.request(s),s.status&&(a(),e.value.onRefresh&&e.value.onRefresh())},init:s=>{e.value=s,a.value=[e.value.row],o.value[1].value=e.value.row.dkim_value,o.value[2].value=e.value.row.dmarc_value},onParseAllEnvent:async a=>{T(e.value.row.domain,e.value.row.mx_record,(s,t)=>{s.status&&(a&&a(),e.value.onRefresh&&e.value.onRefresh(),C(t,{title:"一键解析"}))})}}}),A={class:"p-20px"},R={class:"mr-4px max-w-220px! truncate"},g=["onClick"],I={class:"flex flex-center mt-24px justify-end"},N=M(e({__name:"index",props:{compData:{}},setup(a){const{propsData:s,addTxtRecordData:e,statusData:b}=o(X()),{init:h,statusColumns:j,onCopy:M,onVerify:T,onParseAllEnvent:C}=X(),N=a,O=l("popupClose"),P=r(()=>!(N.compData.row.mx_status&&N.compData.row.a_status&&N.compData.row.spf_status&&N.compData.row.dkim_status&&N.compData.row.dmarc_status)&&N.compData.row.dns_id);return p(()=>{h(N.compData)}),(a,o)=>{var l;const r=k,p=f,h=y,X=w,N=D;return u(),n("div",A,[t(r,{class:"mb-20px",data:d(b),column:d(j)},null,8,["data","column"]),o[4]||(o[4]=c("div",{class:"record-title"},"第一步：添加 MX 记录",-1)),o[5]||(o[5]=c("div",{class:"record-desc"},"登录域名服务商，添加记录类型为MX的记录，用于邮箱服务(解析MX记录之前要先解析A记录)",-1)),t(h,{class:"mb-30px",data:[{type:"MX",host:"@",value:null==(l=d(s).row)?void 0:l.mx_record,priority:"10"}]},{default:i(()=>[t(p,{prop:"type",label:"记录类型"}),t(p,{prop:"host",label:"主机记录"}),t(p,{prop:"value",label:"记录值"}),t(p,{prop:"priority",label:"MX优先级"})]),_:1},8,["data"]),o[6]||(o[6]=c("div",{class:"record-title"},"第二步：添加 TXT 记录",-1)),o[7]||(o[7]=c("div",{class:"record-desc"},"添加记录类型为TXT的记录，用于邮箱反垃圾(请直接复制下列参数)",-1)),t(h,{class:"mb-30px",data:d(e)},{default:i(()=>[t(p,{prop:"type",label:"记录类型"}),t(p,{prop:"host",label:"主机记录"}),t(p,{width:"280",prop:"value",label:"记录值"},{default:i(a=>[t(X,{content:a.row.value,"popper-class":"w-220px",effect:"dark",placement:"top-end"},{default:i(()=>[c("span",R,m(a.row.value),1)]),_:2},1032,["content"]),c("span",{class:"text-primary cursor-pointer hover:text-primaryDark",onClick:s=>d(M)(a.row.value)}," (复制) ",8,g)]),_:1})]),_:1},8,["data"]),c("div",I,[d(P)?(u(),v(N,{key:0,onClick:o[0]||(o[0]=a=>d(C)(d(O)))},{default:i(()=>o[2]||(o[2]=[_("一键解析",-1)])),_:1,__:[2]})):x("",!0),t(N,{type:"primary",onClick:o[1]||(o[1]=a=>d(T)(d(O)))},{default:i(()=>o[3]||(o[3]=[_(" 已设置，验证域名解析 ",-1)])),_:1,__:[3]})])])}}}),[["__scopeId","data-v-7c5c2fce"]]);export{N as default};
