import{_ as $}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{_ as M}from"./index-CZps0rIN.js?v=1773287522785";import{Z as g,at as B}from"./mail-COTHIXbY.js?v=1773287522785";import{k as E,r as y,e as C,$ as m,Z as N,a0 as r,a9 as l,S as o,_ as d,a8 as U,ak as R,N as V}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as S,a8 as Z,b as P}from"./naive-ui--dJnpVcV.js?v=1773287522785";import"./index-BTglIPU2.js?v=1773287522785";import"./prismjs-BZPoR7_J.js?v=1773287522785";const T={class:"p-20px pb-32px"},j={class:"w-300px"},q={class:"w-300px"},z={class:"w-300px"},O=E({__name:"index",props:{row:{},isEdit:{type:Boolean}},emits:["refresh"],setup(c,{expose:f,emit:v}){const u=c,w=v,{isEdit:i}=u,_=y(null),e=C({user:"",domain:"",forward_user:"",active:1}),b={},h=async()=>{var a;await((a=_.value)==null?void 0:a.validate()),i?await g({user:e.user,forward_user:e.forward_user,active:e.active}):await B(V(e)),w("refresh")};return(()=>{const{row:a,isEdit:t}=u;t&&a&&(e.active=a.active,e.user=a.address,e.domain=a.domain,e.forward_user=a.goto)})(),f({onConfirm:h}),(a,t)=>{const k=Z,n=S,p=P,x=M,F=$;return m(),N("div",T,[r(F,{ref_key:"formRef",ref:_,model:o(e),rules:b},{default:l(()=>[r(n,{label:a.$t("Public.Table.Status")},{default:l(()=>[r(k,{value:o(e).active,"onUpdate:value":t[0]||(t[0]=s=>o(e).active=s),"checked-value":1,"unchecked-value":0},null,8,["value"])]),_:1},8,["label"]),r(n,{label:a.$t("Mail.Forward.index_10"),path:"user"},{default:l(()=>[d("div",j,[r(p,{value:o(e).user,"onUpdate:value":t[1]||(t[1]=s=>o(e).user=s),disabled:o(i),placeholder:a.$t("Mail.Forward.index_11")},null,8,["value","disabled","placeholder"])])]),_:1},8,["label"]),o(i)?R("",!0):(m(),U(n,{key:0,label:a.$t("Mail.Forward.index_4"),path:"domain"},{default:l(()=>[d("div",q,[r(p,{value:o(e).domain,"onUpdate:value":t[2]||(t[2]=s=>o(e).domain=s),placeholder:a.$t("Mail.Forward.index_12")},null,8,["value","placeholder"])])]),_:1},8,["label"])),r(n,{label:a.$t("Mail.Forward.index_13"),path:"forward_user","show-feedback":!1},{default:l(()=>[d("div",z,[r(x,{value:o(e).forward_user,"onUpdate:value":t[3]||(t[3]=s=>o(e).forward_user=s),rows:3,placeholder:a.$t("Mail.Forward.index_14")},null,8,["value","placeholder"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}});export{O as default};
