← Back
Editing: index392.js
import{j as a,b as e,n as l,L as s,p as t,l as n,a_ as o}from"./utils-lib.js?v=VERSION_NUMBER";import{_ as i}from"./index103.js?v=VERSION_NUMBER";import{_ as d}from"./index145.js?v=VERSION_NUMBER";import{c as r,r as u,ay 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 y,v as S,F as V,a_ as j,C as D,P as x,ai as N,aj as C,a9 as k,S as L,a7 as R,p as P,Z as U,G as q,H as O}from"./base-lib.js?v=VERSION_NUMBER";import{O as E,P as F,Q as z,y as A}from"./ssl.js?v=VERSION_NUMBER";import{u as H}from"./column.js?v=VERSION_NUMBER";import{g as J}from"./useStore10.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";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)||[],z()},O=u({dns_name:[{required:!0,message:"请选择验证类型",trigger:"change"}]}),z=()=>{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 E({dns_id:e.id,ps:e.ps||"",pdata:JSON.stringify(e)})}else{a=await F({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=C,u=k,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]=y((()=>{}),["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),S(V,null,j(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),S(V,{key:0},j(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)):D("",!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),y=u(!1),V=u(!1),j=p("添加DNS接口"),D=p({}),x=[{label:"类型",prop:"dns_name"},{label:"账号备注",prop:"ps"},H([{onClick:a=>{D.value=a,l({title:"DNS域名【".concat(a.dns_name,"】"),area:50,component:()=>s((()=>import("./index481.js?v=VERSION_NUMBER")),__vite__mapDeps([]),import.meta.url),compData:{row:a}})},title:"域名"},{onClick:a=>{D.value=a,j.value="编辑【".concat(a.dns_name,"】"),V.value=!0},title:"编辑"},{onClick:a=>{C(a)},title:"删除"}])],N=[{content:"添加DNS接口",active:!0,event:()=>{j.value="添加DNS接口",V.value=!0}}],C=async a=>{await t({title:"删除【".concat(a.dns_name,"】"),content:"删除该验证接口,是否继续操作?",icon:"warning"});try{const e=await z({dns_id:a.id});r.request(e),y.value=!0,m.value=!0}catch(e){}};return _(y,(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})(),y.value=!1)}),{immediate:!0}),P((()=>{y.value=!0})),U("isShowForm",V),U("formParams",f),U("isRefreshDNSList",y),U("formRow",D),(a,e)=>{const l=d,s=n,t=i,o=q("bt-loading");return v(),S("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(j)},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