System.register(["./index-legacy-DQdImDha.js?v=1773287522785","./index.vue_vue_type_script_setup_true_lang-legacy-LjZ-8uGn.js?v=1773287522785","./index-legacy-DEYz4m3y.js?v=1773287522785","./useLoading-legacy-IiShPpjk.js?v=1773287522785","./vue-core-legacy-Cn1vuJ3s.js?v=1773287522785","./naive-ui-legacy-BW82sq8q.js?v=1773287522785"],(function(e,a){"use strict";var t,o,l,r,i,n,d,m,p,s,c,_,u,f,v,g,k,x,j,w,y,h,b,C,D,$,E;return{setters:[e=>{t=e.bm,o=e._,l=e.gX,r=e.n,i=e.p,n=e.P,d=e.gY,m=e.gZ},e=>{p=e._},e=>{s=e._},e=>{c=e.u},e=>{_=e.k,u=e.R,f=e.r,v=e.e,g=e.$,k=e.Z,x=e.a0,j=e.a9,w=e._,y=e.S,h=e.j,b=e.aa,C=e.a3},e=>{D=e.a1,$=e.a6,E=e.b}],execute:function(){const R={class:"p-20px"},U={class:"w-300px"},Z={class:"w-300px"},L={class:"w-300px"};e("_",_({__name:"index",props:{row:{default:void 0},isEdit:{type:Boolean,default:!1}},setup(e,{expose:_}){const P=e,{t:S}=u(),B=t(),H=f(null),X=v({template_id:null,project_name:"",remark:""}),Y={template_id:{trigger:["change"],validator:()=>null!=X.template_id||new Error(S("Docker.Compose.form.index_5"))},project_name:{trigger:["blur","input"],validator:()=>""!==X.project_name.trim()||new Error(S("Docker.Compose.form.index_6"))}},q=f([]),{loading:z,setLoading:A}=c(),F=async()=>{try{A(!0);const{message:e}=await l();r(e)&&(q.value=e.map((e=>({label:e.name,value:e.id}))),X.template_id=e[0].id)}finally{A(!1)}},G=()=>{i({title:S("Docker.Compose.form.index_7"),footer:!0,width:650,minHeight:484,data:{onRefresh:()=>{F()}},component:C((()=>n((()=>a.import("./index-legacy-BmPjsSKu.js?v=1773287522785")),void 0)))})};return(()=>{const{row:e,isEdit:a}=P;a&&e&&(X.template_id=e.template_id,X.project_name=e.name,X.remark=e.remark)})(),F(),_({onConfirm:async()=>{await(H.value?.validate());const e={template_id:X.template_id||0,project_name:X.project_name,remark:X.remark},{row:a,isEdit:t}=P;t&&a?await d({...e,project_id:a.id}):await m(e),B.setRefresh(!0)}}),(e,a)=>{const t=$,l=o,r=D,i=E,n=s,d=p;return g(),k("div",R,[x(d,{ref_key:"formRef",ref:H,model:y(X),rules:Y,"label-width":"150"},{default:j((()=>[x(r,{label:e.$t("Docker.Compose.form.index_1"),path:"template_id"},{default:j((()=>[w("div",U,[x(t,{value:y(X).template_id,"onUpdate:value":a[0]||(a[0]=e=>y(X).template_id=e),loading:y(z),options:y(q)},null,8,["value","loading","options"])]),x(l,{class:"ml-8px",onClick:G},{default:j((()=>[h(b(e.$t("Docker.Compose.form.index_2")),1)])),_:1})])),_:1},8,["label"]),x(r,{label:e.$t("Docker.Compose.form.index_3"),path:"project_name"},{default:j((()=>[w("div",Z,[x(i,{value:y(X).project_name,"onUpdate:value":a[1]||(a[1]=e=>y(X).project_name=e),placeholder:e.$t("Docker.Compose.form.index_3")},null,8,["value","placeholder"])])])),_:1},8,["label"]),x(r,{label:e.$t("Docker.Compose.form.index_4"),path:"remark","show-feedback":!1},{default:j((()=>[w("div",L,[x(n,{value:y(X).remark,"onUpdate:value":a[2]||(a[2]=e=>y(X).remark=e),rows:3,placeholder:e.$t("Docker.Compose.form.index_4")},null,8,["value","placeholder"])])])),_:1},8,["label"])])),_:1},8,["model"])])}}}))}}}));
