import{_ as a}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{gw as e,gx as l,gy as t,c as r,f as s}from"./page_layout.js?v=1753954525509";import{_ as d}from"./index.vue_vue_type_script_setup_true_lang14.js?v=1753954525509";import{k as o,t as u,P as n,r as i,e as m,U as p,V as v,Q as _,a2 as c,W as f,X as k,N as x}from"./vue.js?v=1753954525509";import{aq as w,cA as h}from"./naive.js?v=1753954525509";const g={class:"w-350px"},b={class:"w-350px"},y={class:"w-476px"},j=o({__name:"index",props:{row:{},isEdit:{type:Boolean,default:!1}},setup(o,{expose:j}){const D=o,T=u(D,"row"),$=u(D,"isEdit"),{t:U}=n(),E=i(null),q=m({name:"",remark:"",data:""}),A={name:{trigger:["blur","input"],validator:()=>""!==q.name.trim()||new Error(U("Docker.Template.add.index_2"))}};return(async()=>{if($.value&&T.value){q.name=T.value.name,q.remark=T.value.remark;const{message:a}=await t({template_id:T.value.id});r(a)&&(q.data=s(a.result)?a.result:"")}})(),j({onConfirm:async()=>{var a;await(null==(a=E.value)?void 0:a.validate()),$.value&&T.value?await e({...x(q),id:T.value.id}):await l(x(q))}}),(e,l)=>{const t=w,r=h,s=a;return p(),v("div",null,[_(s,{ref_key:"formRef",ref:E,model:k(q),rules:A},{default:c((()=>[_(r,{label:e.$t("Docker.Template.add.index_1"),path:"name"},{default:c((()=>[f("div",g,[_(t,{value:k(q).name,"onUpdate:value":l[0]||(l[0]=a=>k(q).name=a),placeholder:e.$t("Docker.Template.add.index_2")},null,8,["value","placeholder"])])])),_:1},8,["label"]),_(r,{label:e.$t("Docker.Template.add.index_3"),path:"remark"},{default:c((()=>[f("div",b,[_(t,{value:k(q).remark,"onUpdate:value":l[1]||(l[1]=a=>k(q).remark=a),placeholder:e.$t("Docker.Template.add.index_3")},null,8,["value","placeholder"])])])),_:1},8,["label"]),_(r,{label:e.$t("Docker.Template.add.index_4"),path:"data","show-feedback":!1},{default:c((()=>[f("div",y,[_(d,{value:k(q).data,"onUpdate:value":l[2]||(l[2]=a=>k(q).data=a),lang:"json",theme:"monokai",height:"300","show-tips":!1},null,8,["value"])])])),_:1},8,["label"])])),_:1},8,["model"])])}}});export{j as _};
