import{$ as t,l as a,a4 as s,x as e}from"./utils-lib.js?v=20260328163632";import{u as i,f as o,g as p}from"./index.vue_vue_type_script_setup_true_lang9.js?v=20260328163632";import{bY as m}from"./site.js?v=20260328163632";import{B as n}from"./naive-ui.js?v=20260328163632";import{k as r,r as l,w as c,o as u,V as d,W as _,O as j,a3 as f,j as v,Z as y,Y as x}from"./base-lib.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index84.js?v=20260328163632";import"./store4.js?v=20260328163632";import"./useMethod4.js?v=20260328163632";import"./index.vue_vue_type_script_setup_true_lang10.js?v=20260328163632";import"./index158.js?v=20260328163632";import"./ace.js?v=20260328163632";import"./index91.js?v=20260328163632";import"./index88.js?v=20260328163632";import"./index118.js?v=20260328163632";import"./logs.js?v=20260328163632";const D={class:"p-20px"},b=r({__name:"dns-table",props:{compData:{default:{data_template:{},list:[],data:[],type:"",help:"",name:"",ps:""}}},setup(r){const b=r,{sslDnsApiInfo:h}=i(),g=l({columns:[],data:[]}),[k,w]=t(g),C=async t=>{await e({loading:a("正在删除DNS接口，请稍候..."),request:m({dnsName:b.compData.type,dnsUuid:t.uuid}),message:!0,success:async()=>{b.compData.refresh?await b.compData.refresh():await p()}})};c(h,(t=>{if(null==t?void 0:t.length){const a=t.find((t=>t.value===b.compData.type));a&&(g.value.data=a.info.list)}}),{deep:!0,immediate:!0});const N=t=>{o({title:"".concat(a(t?"编辑":"添加"),"[").concat(b.compData.title,"]").concat(a("接口")),row:{...b.compData,...t?{data_template:t}:{}}})};return u((()=>{const{data_template:t,list:e}=b.compData;g.value.columns=Object.keys(t).map((t=>({title:t,key:t,render:a=>a[t]||"--"}))),g.value.columns.push({title:a("备注"),key:"ps",minWidth:60,render:t=>t.ps||"--"}),g.value.columns.push(s([{title:a("编辑"),onClick:N},{title:a("删除"),onClick:C}])),g.value.data=e})),(t,s)=>{const e=n;return d(),_("div",D,[j(e,{type:"primary",class:"mb-10px",onClick:s[0]||(s[0]=t=>N())},{default:f((()=>[v(y(x(a)("添加接口")),1)])),_:1}),j(x(k))])}}});export{b as default};
