const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index264.js?v=1763625242172","js/index107.js?v=1763625242172","js/vue.js?v=1763625242172","js/__commonjsHelpers__.js?v=1763625242172","js/naive.js?v=1763625242172","js/common.js?v=1763625242172","js/page_layout.js?v=1763625242172","js/public.js?v=1763625242172","css/public.css?v=1763625242172","css/page_layout.css?v=1763625242172","css/index21.css?v=1763625242172","js/index.vue_vue_type_script_setup_true_lang24.js?v=1763625242172","js/index.vue_vue_type_script_setup_true_lang.js?v=1763625242172","js/index100.js?v=1763625242172","js/theme-monokai.js?v=1763625242172","js/file.js?v=1763625242172","css/index16.css?v=1763625242172","js/index.vue_vue_type_script_setup_true_lang10.js?v=1763625242172","js/index98.js?v=1763625242172","css/index13.css?v=1763625242172"])))=>i.map(i=>d[i]);
import{bU as e,gg as a,x as o,a as t,gh as r,gi as l,o as s}from"./page_layout.js?v=1763625242172";import{_ as i}from"./index.vue_vue_type_script_setup_true_lang.js?v=1763625242172";import{_ as m}from"./index99.js?v=1763625242172";import{d as p,u as d}from"./public.js?v=1763625242172";import{k as n,P as _,r as c,e as u,R as f,S as v,X as k,a3 as x,U as j,V as g,j as w,a4 as h,_ as b}from"./vue.js?v=1763625242172";import{dV as C,dP as D,au as y}from"./naive.js?v=1763625242172";const E={class:"p-20px"},$={class:"w-300px"},R={class:"w-300px"},U={class:"w-300px"},P=n({__name:"index",props:{row:{default:void 0},isEdit:{type:Boolean,default:!1}},setup(n,{expose:P}){const V=n,{t:L}=_(),A=e(),B=c(null),H=u({template_id:null,project_name:"",remark:""}),I={template_id:{trigger:["change"],validator:()=>null!=H.template_id||new Error(L("Docker.Compose.form.index_5"))},project_name:{trigger:["blur","input"],validator:()=>""!==H.project_name.trim()||new Error(L("Docker.Compose.form.index_6"))}},O=c([]),{loading:S,setLoading:T}=p(),X=async()=>{try{T(!0);const{message:e}=await a();o(e)&&(O.value=e.map((e=>({label:e.name,value:e.id}))),H.template_id=e[0].id)}finally{T(!1)}},q=()=>{d({title:L("Docker.Compose.form.index_7"),footer:!0,width:650,minHeight:484,data:{onRefresh:()=>{X()}},component:b((()=>t((()=>import("./index264.js?v=1763625242172")),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19]))))})};return(()=>{const{row:e,isEdit:a}=V;a&&e&&(H.template_id=e.template_id,H.project_name=e.name,H.remark=e.remark)})(),X(),P({onConfirm:async()=>{var e;await(null==(e=B.value)?void 0:e.validate());const a={template_id:H.template_id||0,project_name:H.project_name,remark:H.remark},{row:o,isEdit:t}=V;t&&o?await r({...a,project_id:o.id}):await l(a),A.setRefresh(!0)}}),(e,a)=>{const o=C,t=s,r=D,l=y,p=m,d=i;return f(),v("div",E,[k(d,{ref_key:"formRef",ref:B,model:g(H),rules:I,"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:g(H).template_id,"onUpdate:value":a[0]||(a[0]=e=>g(H).template_id=e),loading:g(S),options:g(O)},null,8,["value","loading","options"])]),k(t,{class:"ml-8px",onClick:q},{default:x((()=>[w(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:g(H).project_name,"onUpdate:value":a[1]||(a[1]=e=>g(H).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:g(H).remark,"onUpdate:value":a[2]||(a[2]=e=>g(H).remark=e),rows:3,placeholder:e.$t("Docker.Compose.form.index_4")},null,8,["value","placeholder"])])])),_:1},8,["label"])])),_:1},8,["model"])])}}});export{P as _};
