const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["js/index265.js?v=1764830988434","js/index107.js?v=1764830988434","js/vue.js?v=1764830988434","js/__commonjsHelpers__.js?v=1764830988434","js/naive.js?v=1764830988434","js/common.js?v=1764830988434","js/page_layout.js?v=1764830988434","js/public.js?v=1764830988434","css/public.css?v=1764830988434","css/page_layout.css?v=1764830988434","css/index22.css?v=1764830988434","js/index.vue_vue_type_script_setup_true_lang23.js?v=1764830988434","js/index.vue_vue_type_script_setup_true_lang.js?v=1764830988434","js/index98.js?v=1764830988434","js/theme-monokai.js?v=1764830988434","js/file.js?v=1764830988434","css/index17.css?v=1764830988434","js/index.vue_vue_type_script_setup_true_lang10.js?v=1764830988434","js/index96.js?v=1764830988434","css/index14.css?v=1764830988434"])))=>i.map(i=>d[i]);
import{bq as e,o as a,g9 as o,x as t,a as r,ga as l,gb as s}from"./page_layout.js?v=1764830988434";import{_ as i}from"./index.vue_vue_type_script_setup_true_lang.js?v=1764830988434";import{_ as m}from"./index97.js?v=1764830988434";import{d as p,u as d}from"./public.js?v=1764830988434";import{k as n,P as _,r as c,e as u,R as f,V as v,W as k,a3 as x,S as j,U as g,j as w,a4 as h,_ as b}from"./vue.js?v=1764830988434";import{dR as C,dV as D,au as y}from"./naive.js?v=1764830988434";const E={class:"p-20px"},R={class:"w-300px"},$={class:"w-300px"},U={class:"w-300px"},V=n({__name:"index",props:{row:{default:void 0},isEdit:{type:Boolean,default:!1}},setup(n,{expose:V}){const L=n,{t:P}=_(),q=e(),A=c(null),B=u({template_id:null,project_name:"",remark:""}),H={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"))}},I=c([]),{loading:O,setLoading:S}=p(),T=async()=>{try{S(!0);const{message:e}=await o();t(e)&&(I.value=e.map(e=>({label:e.name,value:e.id})),B.template_id=e[0].id)}finally{S(!1)}},W=()=>{d({title:P("Docker.Compose.form.index_7"),footer:!0,width:650,minHeight:484,data:{onRefresh:()=>{T()}},component:b(()=>r(()=>import("./index265.js?v=1764830988434"),__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}=L;a&&e&&(B.template_id=e.template_id,B.project_name=e.name,B.remark=e.remark)})(),T(),V({onConfirm:async()=>{var e;await(null==(e=A.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 l({...a,project_id:o.id}):await s(a),q.setRefresh(!0)}}),(e,o)=>{const t=D,r=a,l=C,s=y,p=m,d=i;return v(),f("div",E,[k(d,{ref_key:"formRef",ref:A,model:g(B),rules:H,"label-width":"150"},{default:x(()=>[k(l,{label:e.$t("Docker.Compose.form.index_1"),path:"template_id"},{default:x(()=>[j("div",R,[k(t,{value:g(B).template_id,"onUpdate:value":o[0]||(o[0]=e=>g(B).template_id=e),loading:g(O),options:g(I)},null,8,["value","loading","options"])]),k(r,{class:"ml-8px",onClick:W},{default:x(()=>[w(h(e.$t("Docker.Compose.form.index_2")),1)]),_:1})]),_:1},8,["label"]),k(l,{label:e.$t("Docker.Compose.form.index_3"),path:"project_name"},{default:x(()=>[j("div",$,[k(s,{value:g(B).project_name,"onUpdate:value":o[1]||(o[1]=e=>g(B).project_name=e),placeholder:e.$t("Docker.Compose.form.index_3")},null,8,["value","placeholder"])])]),_:1},8,["label"]),k(l,{label:e.$t("Docker.Compose.form.index_4"),path:"remark","show-feedback":!1},{default:x(()=>[j("div",U,[k(p,{value:g(B).remark,"onUpdate:value":o[2]||(o[2]=e=>g(B).remark=e),rows:3,placeholder:e.$t("Docker.Compose.form.index_4")},null,8,["value","placeholder"])])]),_:1},8,["label"])]),_:1},8,["model"])])}}});export{V as _};
