import{_ as x}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{il as T,im as D,io as $,i as E,ao as R}from"./index-BTglIPU2.js?v=1773287522785";import y from"./index-Cy3Gp9Hk.js?v=1773287522785";import{k as B,t as c,R as C,r as N,e as U,$ as j,Z as S,a0 as t,a9 as r,_ as d,S as o,N as f}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as V,b as A}from"./naive-ui--dJnpVcV.js?v=1773287522785";const I={class:"w-350px"},O={class:"w-350px"},Z={class:"w-476px"},K=B({__name:"index",props:{row:{},isEdit:{type:Boolean,default:!1}},setup(v,{expose:k}){const m=v,l=c(m,"row"),p=c(m,"isEdit"),{t:w}=C(),u=N(null),e=U({name:"",remark:"",data:""}),b={name:{trigger:["blur","input"],validator:()=>e.name.trim()===""?new Error(w("Docker.Template.add.index_2")):!0}},h=async()=>{var a;await((a=u.value)==null?void 0:a.validate()),p.value&&l.value?await T({...f(e),id:l.value.id}):await D(f(e))};return(async()=>{if(p.value&&l.value){e.name=l.value.name,e.remark=l.value.remark;const{message:a}=await $({template_id:l.value.id});E(a)&&(e.data=R(a.result)?a.result:"")}})(),k({onConfirm:h}),(a,n)=>{const _=A,i=V,g=x;return j(),S("div",null,[t(g,{ref_key:"formRef",ref:u,model:o(e),rules:b},{default:r(()=>[t(i,{label:a.$t("Docker.Template.add.index_1"),path:"name"},{default:r(()=>[d("div",I,[t(_,{value:o(e).name,"onUpdate:value":n[0]||(n[0]=s=>o(e).name=s),placeholder:a.$t("Docker.Template.add.index_2")},null,8,["value","placeholder"])])]),_:1},8,["label"]),t(i,{label:a.$t("Docker.Template.add.index_3"),path:"remark"},{default:r(()=>[d("div",O,[t(_,{value:o(e).remark,"onUpdate:value":n[1]||(n[1]=s=>o(e).remark=s),placeholder:a.$t("Docker.Template.add.index_3")},null,8,["value","placeholder"])])]),_:1},8,["label"]),t(i,{label:a.$t("Docker.Template.add.index_4"),path:"data","show-feedback":!1},{default:r(()=>[d("div",Z,[t(y,{value:o(e).data,"onUpdate:value":n[2]||(n[2]=s=>o(e).data=s),lang:"json",theme:"monokai",height:"300","show-tips":!1},null,8,["value"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}});export{K as _};
