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