← Back
Editing: index382.js
import{h as a,b as e,l,L as s,o as t,k as n,a_ as o}from"./utils-lib.js?v=1765440387";import{_ as i}from"./index93.js?v=1765440387";import{_ as d}from"./index135.js?v=1765440387";import{c as r,r as u,az as m,U as p,g as c,w as _,q as v,M as f,A as h,y as b,e as w,x as g,Q as S,v as y,F as V,a$ as D,C as j,P as x,aj as N,ak as k,aa as C,S as L,a8 as R,p as P,_ as U,G as q,H as O}from"./base-lib.js?v=1765440387";import{O as z,P as E,Q as F,y as A}from"./ssl.js?v=1765440387";import{u as H}from"./column.js?v=1765440387";import{g as J}from"./useStore9.js?v=1765440387";import"./__commonjsHelpers__.js?v=1765440387";import"./index94.js?v=1765440387";const Q={class:"py-[16px]"},G=r({__name:"index",props:{title:{type:String,default:"添加NDS验证"}},setup(l){const s=e(),t=u({dns_name:"",ps:""}),n=u(null),o=m("isShowForm",p(!1)),i=m("formParams",p([])),d=m("isRefreshDNSList",p(!1)),r=m("formRow",p({})),P=u([]),U=c(()=>!!r.value.id),q=a=>{var e;P.value=(null==(e=i.value.find(e=>e.id.toLowerCase()===a.toLowerCase()))?void 0:e.params)||[],F()},O=u({dns_name:[{required:!0,message:"请选择验证类型",trigger:"change"}]}),F=()=>{P.value.forEach(a=>{O.value[a]=[{required:!0,message:"请输入".concat(a),trigger:"blur"}]})},A=()=>{t.value={dns_name:"",ps:""},r.value={dns_name:"DNSPodDns"}},H=async()=>{const a=n.value;if(!(await a.validate().catch(()=>!1)))return!1;try{let a,e={...t.value};if(t.value.id){a=await z({dns_id:e.id,ps:e.ps||"",pdata:JSON.stringify(e)})}else{a=await E({dns_name:e.dns_name,ps:e.ps||"",pdata:JSON.stringify(e)})}s.request(a),o.value=!1,d.value=!0,A()}catch(e){return s.error(e),!1}},J=async()=>{A()};return _(i,a=>{a.length&&(t.value.dns_name=a[0].id,q(a[0].id))}),_(r,a=>{t.value={...a},a.dns_name&&q(a.dns_name)},{immediate:!0}),_(o,a=>{a&&r.value.dns_name&&(t.value={...r.value},q(r.value.dns_name))}),(e,s)=>{const d=N,r=k,u=C,m=L,p=R,c=a;return v(),f(c,{title:l.title,modelValue:g(o),"onUpdate:modelValue":s[3]||(s[3]=a=>x(o)?o.value=a:null),area:["50rem"],"show-footer":"",onCancel:J,onConfirm:H},{default:h(()=>[b("div",Q,[w(p,{ref_key:"dnsformRef",ref:n,size:"small",model:g(t),rules:g(O),class:"relative w-full","label-position":"right",onSubmit:s[2]||(s[2]=S(()=>{},["prevent"]))},{default:h(()=>[w(u,{label:"验证类型",prop:"dns_name","label-width":"100"},{default:h(()=>[w(r,{modelValue:g(t).dns_name,"onUpdate:modelValue":s[0]||(s[0]=a=>g(t).dns_name=a),class:"!w-[33rem]",size:"default",filterable:"","default-first-option":"",placeholder:"请选择验证类型",disabled:g(U),onChange:q},{default:h(()=>[(v(!0),y(V,null,D(g(i),a=>(v(),f(d,{key:a.id,label:a.name,value:a.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","disabled"])]),_:1}),g(P).length?(v(!0),y(V,{key:0},D(g(P),(a,e)=>(v(),f(u,{key:e,label:a,prop:a,"label-width":"100"},{default:h(()=>[w(m,{modelValue:g(t)[a],"onUpdate:modelValue":e=>g(t)[a]=e,class:"!w-[33rem]",placeholder:"请输入".concat(a)},null,8,["modelValue","onUpdate:modelValue","placeholder"])]),_:2},1032,["label","prop"]))),128)):j("",!0),w(u,{prop:"ps",label:"备注","label-width":"100"},{default:h(()=>[w(m,{modelValue:g(t).ps,"onUpdate:modelValue":s[1]||(s[1]=a=>g(t).ps=a),placeholder:"请输入备注",clearable:"",class:"!w-[33rem]"},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])])]),_:1},8,["title","modelValue"])}}}),I={class:"p-[16px]"},M=r({__name:"index",setup(a){const r=e(),{refs:{isRefreshDomainList:m}}=J(),c=u([]),f=u({}),b=u(!1),S=u(!1),V=u(!1),D=p("添加DNS接口"),j=p({}),x=[{label:"类型",prop:"dns_name"},{label:"账号备注",prop:"ps"},H([{onClick:a=>{j.value=a,l({title:"DNS域名【".concat(a.dns_name,"】"),area:50,component:()=>s(()=>import("./index459.js?v=1765440387"),__vite__mapDeps([]),import.meta.url),compData:{row:a}})},title:"域名"},{onClick:a=>{j.value=a,D.value="编辑【".concat(a.dns_name,"】"),V.value=!0},title:"编辑"},{onClick:a=>{k(a)},title:"删除"}])],N=[{content:"添加DNS接口",active:!0,event:()=>{D.value="添加DNS接口",V.value=!0}}],k=async a=>{await t({title:"删除【".concat(a.dns_name,"】"),content:"删除该验证接口,是否继续操作?",icon:"warning"});try{const e=await F({dns_id:a.id});r.request(e),S.value=!0,m.value=!0}catch(e){}};return _(S,a=>{a&&((async()=>{b.value=!0;const{data:a}=await A(),e=o(a);if(e("data")){const{data:e}=a;c.value=e}if(e("add_data")){const{add_data:e}=a;f.value=e}b.value=!1})(),S.value=!1)},{immediate:!0}),P(()=>{S.value=!0}),U("isShowForm",V),U("formParams",f),U("isRefreshDNSList",S),U("formRow",j),(a,e)=>{const l=d,s=n,t=i,o=q("bt-loading");return v(),y("div",I,[w(t,null,{"header-left":h(()=>[w(l,{options:N})]),content:h(()=>[O(w(s,{class:"soft-table",column:x,"max-height":"350",data:g(c),description:"列表为空"},null,8,["data"]),[[o,g(b)],[o,"正在加载NDS验证接口列表,请稍后...","title"]])]),popup:h(()=>[w(G,{title:g(D)},null,8,["title"])]),_:1})])}}});export{M as default}; function __vite__mapDeps(indexes) { if (!__vite__mapDeps.viteFileDeps) { __vite__mapDeps.viteFileDeps = [] } return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) }
Save File
Cancel