import{_ as e}from"./index.vue_vue_type_script_setup_true_lang.js?v=1741416570306";import{d as r,e as a,M as l,r as t,j as s,P as o,_ as p,$ as u,N as d,R as _,S as i,k as c,v as n}from"./vue.js?v=1741416570306";import{h as v,t as m,b as y,c as x,d as f}from"./index65.js?v=1741416570306";import{_ as g,cb as b,ch as h,bS as j,bV as w}from"./naive.js?v=1741416570306";import"./__commonjsHelpers__.js?v=1741416570306";import"./index104.js?v=1741416570306";import"./page_layout.js?v=1741416570306";import"./common.js?v=1741416570306";import"./public.js?v=1741416570306";import"./index.js?v=1741416570306";import"./index.vue_vue_type_script_setup_true_lang4.js?v=1741416570306";import"./index.vue_vue_type_script_setup_true_lang8.js?v=1741416570306";import"./index.vue_vue_type_script_setup_true_lang5.js?v=1741416570306";import"./index.vue_vue_type_script_setup_true_lang6.js?v=1741416570306";const T={class:"w-300px"},U={class:"w-300px"},k=r({__name:"manage-form",props:{row:{},id:{},isEdit:{type:Boolean},onRefresh:{}},setup(r,{expose:k}){const q=r,{isEdit:R,row:E,onRefresh:L}=q,C=a((()=>"CloudFlareDns"===v.value));l();const S=t(null),A=s({record_type:"A",record_value:"",ttl:1,ps:"",proxy:0,record:""}),B={record:{required:!0,trigger:"change",message:"请输入记录"},record_type:{required:!0,trigger:"blur",message:"请输入类型"},record_value:{required:!0,trigger:"blur",message:"请输入记录值"},ttl:{required:!0,trigger:"blur",type:"number",message:"请输入TTL"}},D=()=>({pid:q.id,domain:f.value,record:A.record,record_type:A.record_type,record_value:A.record_value,ttl:A.ttl,proxy:C.value?A.proxy:-1});return(()=>{const{row:e,isEdit:r}=q;r&&e&&(A.record=e.record,A.record_type=e.record_type,A.record_value=e.record_value,A.ttl=e.ttl,A.ps=e.ps,A.proxy=e.proxy)})(),k({onConfirm:async()=>{var e;await(null==(e=S.value)?void 0:e.validate()),R&&E?await y(D()):await x(D()),L()}}),(r,a)=>{const l=g,t=b,s=h,v=j,y=w,x=e;return o(),p(x,{class:"p-20px",ref_key:"formRef",ref:S,model:i(A),rules:B},{default:u((()=>[d(t,{label:"记录",path:"record"},{default:u((()=>[_("div",T,[d(l,{value:i(A).record,"onUpdate:value":a[0]||(a[0]=e=>i(A).record=e),placeholder:"请输入记录"},null,8,["value"])])])),_:1}),d(t,{label:"类型",path:"record_type"},{default:u((()=>[d(s,{class:"w-300px",value:i(A).record_type,"onUpdate:value":a[1]||(a[1]=e=>i(A).record_type=e),options:i(m),disabled:i(R)},null,8,["value","options","disabled"])])),_:1}),d(t,{label:"记录值",path:"record_value"},{default:u((()=>[_("div",U,[d(l,{value:i(A).record_value,"onUpdate:value":a[2]||(a[2]=e=>i(A).record_value=e),placeholder:"请输入记录值"},null,8,["value"])])])),_:1}),d(t,{label:"TTL",path:"ttl"},{default:u((()=>[d(v,{min:1,max:1800,class:"w-300px!",value:i(A).ttl,"onUpdate:value":a[3]||(a[3]=e=>i(A).ttl=e),placeholder:"请输入TTL"},null,8,["value"])])),_:1}),d(t,{label:"备注",path:"ps"},{default:u((()=>[d(l,{class:"w-300px!",value:i(A).ps,"onUpdate:value":a[4]||(a[4]=e=>i(A).ps=e),placeholder:"请输入备注"},null,8,["value"])])),_:1}),c(d(t,{label:"代理",path:"proxy"},{default:u((()=>[d(y,{value:i(A).proxy,"onUpdate:value":a[5]||(a[5]=e=>i(A).proxy=e),"checked-value":1,"unchecked-value":0},null,8,["value"])])),_:1},512),[[n,i(C)]])])),_:1},8,["model"])}}});export{k as default};
