const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index-Ego-NKa9.js?v=1773287522785","js/index-BRQskX9P.js?v=1773287522785","js/vue-core-DJjvd5ZC.js?v=1773287522785","js/prismjs-BZPoR7_J.js?v=1773287522785","css/prismjs-D-3FhBe_.css?v=1773287522785","js/naive-ui--dJnpVcV.js?v=1773287522785","js/index-BTglIPU2.js?v=1773287522785","css/index-DEM1fxGq.css?v=1773287522785","css/index-CCworjcO.css?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-CWBVpTDn.js?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785","js/index-Cy3Gp9Hk.js?v=1773287522785","js/theme-monokai-Bqt0uTuQ.js?v=1773287522785","js/ace-CNnfDSio.js?v=1773287522785","js/useLoading-CZ2gSAW7.js?v=1773287522785","js/file-B5PwfK2h.js?v=1773287522785","css/index-v0taN_O4.css?v=1773287522785","js/index-DIKmrNCq.js?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-BeO8Hyma.js?v=1773287522785","js/data-BVsViUMm.js?v=1773287522785","js/index.vue_vue_type_script_setup_true_lang-CgKUoL60.js?v=1773287522785","js/index-K4YGya6V.js?v=1773287522785","css/index-DKJnQkCC.css?v=1773287522785","js/useTableData-BmkIKQ_R.js?v=1773287522785"])))=>i.map(i=>d[i]);
import{bm as P,_ as R,gX as B,n as L,p as T,P as V,gY as A,gZ as N}from"./index-BTglIPU2.js?v=1773287522785";import{_ as O}from"./index.vue_vue_type_script_setup_true_lang-D8O2mMsP.js?v=1773287522785";import{_ as S}from"./index-CZps0rIN.js?v=1773287522785";import{u as U}from"./useLoading-CZ2gSAW7.js?v=1773287522785";import{k as I,R as Z,r as g,e as H,$ as M,Z as X,a0 as n,a9 as s,_,S as a,j as Y,aa as q,a3 as z}from"./vue-core-DJjvd5ZC.js?v=1773287522785";import{a1 as F,a6 as G,b as J}from"./naive-ui--dJnpVcV.js?v=1773287522785";const K={class:"p-20px"},Q={class:"w-300px"},W={class:"w-300px"},ee={class:"w-300px"},ie=I({__name:"index",props:{row:{default:void 0},isEdit:{type:Boolean,default:!1}},setup(v,{expose:w}){const d=v,{t:i}=Z(),b=P(),c=g(null),o=H({template_id:null,project_name:"",remark:""}),x={template_id:{trigger:["change"],validator:()=>o.template_id==null?new Error(i("Docker.Compose.form.index_5")):!0},project_name:{trigger:["blur","input"],validator:()=>o.project_name.trim()===""?new Error(i("Docker.Compose.form.index_6")):!0}},u=g([]),{loading:C,setLoading:f}=U(),k=async()=>{try{f(!0);const{message:e}=await B();L(e)&&(u.value=e.map(t=>({label:t.name,value:t.id})),o.template_id=e[0].id)}finally{f(!1)}},h=()=>{T({title:i("Docker.Compose.form.index_7"),footer:!0,width:650,minHeight:484,data:{onRefresh:()=>{k()}},component:z(()=>V(()=>import("./index-Ego-NKa9.js?v=1773287522785"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23])))})},j=()=>({template_id:o.template_id||0,project_name:o.project_name,remark:o.remark}),D=async()=>{var l;await((l=c.value)==null?void 0:l.validate());const e=j(),{row:t,isEdit:m}=d;m&&t?await A({...e,project_id:t.id}):await N(e),b.setRefresh(!0)};return(()=>{const{row:e,isEdit:t}=d;t&&e&&(o.template_id=e.template_id,o.project_name=e.name,o.remark=e.remark)})(),k(),w({onConfirm:D}),(e,t)=>{const m=G,l=R,p=F,y=J,$=S,E=O;return M(),X("div",K,[n(E,{ref_key:"formRef",ref:c,model:a(o),rules:x,"label-width":"150"},{default:s(()=>[n(p,{label:e.$t("Docker.Compose.form.index_1"),path:"template_id"},{default:s(()=>[_("div",Q,[n(m,{value:a(o).template_id,"onUpdate:value":t[0]||(t[0]=r=>a(o).template_id=r),loading:a(C),options:a(u)},null,8,["value","loading","options"])]),n(l,{class:"ml-8px",onClick:h},{default:s(()=>[Y(q(e.$t("Docker.Compose.form.index_2")),1)]),_:1})]),_:1},8,["label"]),n(p,{label:e.$t("Docker.Compose.form.index_3"),path:"project_name"},{default:s(()=>[_("div",W,[n(y,{value:a(o).project_name,"onUpdate:value":t[1]||(t[1]=r=>a(o).project_name=r),placeholder:e.$t("Docker.Compose.form.index_3")},null,8,["value","placeholder"])])]),_:1},8,["label"]),n(p,{label:e.$t("Docker.Compose.form.index_4"),path:"remark","show-feedback":!1},{default:s(()=>[_("div",ee,[n($,{value:a(o).remark,"onUpdate:value":t[2]||(t[2]=r=>a(o).remark=r),rows:3,placeholder:e.$t("Docker.Compose.form.index_4")},null,8,["value","placeholder"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}});export{ie as _};
