const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index257.js?v=1753954525509","js/index102.js?v=1753954525509","js/vue.js?v=1753954525509","js/__commonjsHelpers__.js?v=1753954525509","js/naive.js?v=1753954525509","js/common.js?v=1753954525509","js/page_layout.js?v=1753954525509","js/public.js?v=1753954525509","css/public.css?v=1753954525509","css/page_layout.css?v=1753954525509","css/index19.css?v=1753954525509","js/index.vue_vue_type_script_setup_true_lang25.js?v=1753954525509","js/index.vue_vue_type_script_setup_true_lang.js?v=1753954525509","js/index.vue_vue_type_script_setup_true_lang14.js?v=1753954525509","js/theme-chrome.js?v=1753954525509","js/file2.js?v=1753954525509","js/index.vue_vue_type_script_setup_true_lang9.js?v=1753954525509","js/index96.js?v=1753954525509","css/index13.css?v=1753954525509"])))=>i.map(i=>d[i]);
import{bg as e,fl as a,w as o,a as t,fm as r,fn as l,o as s}from"./page_layout.js?v=1753954525509";import{_ as i}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{_ as m}from"./index100.js?v=1753954525509";import{c as p,u as n}from"./public.js?v=1753954525509";import{k as d,P as _,r as c,e as u,U as f,V as v,Q as k,a2 as x,W as j,X as w,j as g,a3 as h,_ as b}from"./vue.js?v=1753954525509";import{cG as C,cA as D,aq as y}from"./naive.js?v=1753954525509";const E={class:"p-20px"},$={class:"w-300px"},R={class:"w-300px"},U={class:"w-300px"},A=d({__name:"index",props:{row:{default:void 0},isEdit:{type:Boolean,default:!1}},setup(d,{expose:A}){const L=d,{t:P}=_(),V=e(),q=c(null),B=u({template_id:null,project_name:"",remark:""}),G={template_id:{trigger:["change"],validator:()=>null!=B.template_id||new Error(P("Docker.Compose.form.index_5"))},project_name:{trigger:["blur","input"],validator:()=>""!==B.project_name.trim()||new Error(P("Docker.Compose.form.index_6"))}},H=c([]),{loading:I,setLoading:O}=p(),Q=async()=>{try{O(!0);const{message:e}=await a();o(e)&&(H.value=e.map((e=>({label:e.name,value:e.id}))),B.template_id=e[0].id)}finally{O(!1)}},T=()=>{n({title:P("Docker.Compose.form.index_7"),footer:!0,width:650,minHeight:484,data:{onRefresh:()=>{Q()}},component:b((()=>t((()=>import("./index257.js?v=1753954525509")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]))))})};return(()=>{const{row:e,isEdit:a}=L;a&&e&&(B.template_id=e.template_id,B.project_name=e.name,B.remark=e.remark)})(),Q(),A({onConfirm:async()=>{var e;await(null==(e=q.value)?void 0:e.validate());const a={template_id:B.template_id||0,project_name:B.project_name,remark:B.remark},{row:o,isEdit:t}=L;t&&o?await r({...a,project_id:o.id}):await l(a),V.setRefresh(!0)}}),(e,a)=>{const o=C,t=s,r=D,l=y,p=m,n=i;return f(),v("div",E,[k(n,{ref_key:"formRef",ref:q,model:w(B),rules:G,"label-width":"150"},{default:x((()=>[k(r,{label:e.$t("Docker.Compose.form.index_1"),path:"template_id"},{default:x((()=>[j("div",$,[k(o,{value:w(B).template_id,"onUpdate:value":a[0]||(a[0]=e=>w(B).template_id=e),loading:w(I),options:w(H)},null,8,["value","loading","options"])]),k(t,{class:"ml-8px",onClick:T},{default:x((()=>[g(h(e.$t("Docker.Compose.form.index_2")),1)])),_:1})])),_:1},8,["label"]),k(r,{label:e.$t("Docker.Compose.form.index_3"),path:"project_name"},{default:x((()=>[j("div",R,[k(l,{value:w(B).project_name,"onUpdate:value":a[1]||(a[1]=e=>w(B).project_name=e),placeholder:e.$t("Docker.Compose.form.index_3")},null,8,["value","placeholder"])])])),_:1},8,["label"]),k(r,{label:e.$t("Docker.Compose.form.index_4"),path:"remark","show-feedback":!1},{default:x((()=>[j("div",U,[k(p,{value:w(B).remark,"onUpdate:value":a[2]||(a[2]=e=>w(B).remark=e),rows:3,placeholder:e.$t("Docker.Compose.form.index_4")},null,8,["value","placeholder"])])])),_:1},8,["label"])])),_:1},8,["model"])])}}});export{A as _};
