import{c as e,s,aA as o,g as r,e as a,C as t,I as l,c2 as i,az as p,G as u,q as m,v as n,x as c,y as d}from"./base-lib.js?v=1761009159";import{K as g,k as v}from"./utils-lib.js?v=1761009159";import{b as f,j as h,a as j,h as b}from"./form-item.js?v=1761009159";import{y as x,z as w,A as C,B as y,C as _,E as k}from"./index198.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./index105.js?v=1761009159";import"./column.js?v=1761009159";import"./useController4.js?v=1761009159";import"./validator.js?v=1761009159";import"./useController5.js?v=1761009159";import"./site.js?v=1761009159";import"./useStore4.js?v=1761009159";import"./useController6.js?v=1761009159";import"./useMethod5.js?v=1761009159";const q={class:"p-[2rem] max-h-[60rem] overflow-auto"},z=e({__name:"go-form",setup(e,{expose:z}){const F=x(),{versionOptions:A,popoverFocus:B,isEdit:E}=s(F),G=o("popupClose",()=>{}),{BtForm:M,submit:U,param:V}=g({data:w,options:e=>r(()=>[f("名称","name",{attrs:{class:"!w-[320px]",placeholder:"请输入环境名称",disabled:E.value},rules:[{required:!0,message:"请输入环境名称",trigger:"blur"}]}),h("版本","version",A.value,{attrs:{class:"!w-[22rem]",disabled:E.value},rules:[{required:!0,message:"请选择Go版本",trigger:"change"}]}),j("运行目录","path",{attrs:{class:"!w-[320px]",placeholder:"请选择运行目录"},rules:[{required:!0,message:"请选择运行目录",trigger:["blur","change"]}],icon:"icon-file_mode",iconClick:()=>{C(e)}}),b("启动命令",()=>a(p,{ref:"gopopover",placement:"top-start","popper-class":"green-tips-popover !p-0",title:"",width:"440",visible:B.value,"onUpdate:visible":e=>B.value=e,"trigger-keys":[],trigger:"focus"},{default:()=>a("div",{class:"!p-[12px] bg-primary text-white"},[t("请填写完整启动命令，如：go run main.go")]),reference:()=>l(a(v,{modelValue:e.value.command,"onUpdate:modelValue":s=>e.value.command=s,type:"textarea",width:"52rem",rows:7,resize:"none",onFocus:()=>{B.value=!0},placeholder:"请填写完整启动命令，如：go run main.go"},null),[[i,"gopopover"]])}),"command",{attrs:{class:"!w-[52rem]"},rules:[{required:!0,message:"请填写完整启动命令，如：go run main.go",trigger:"change"}]}),...e.value.port&&e.value.port.length>0?[y(e.value.port),b(" ",()=>a(u,{type:"default",onClick:()=>{e.value.port.push({server:"",con:"",output:!1,protocol:["tcp"],id:1})}},{default:()=>[t("添加")]}))]:[b("端口",()=>a(u,{type:"default",onClick:()=>{e.value.port.push({server:"",con:"",output:!1,protocol:["tcp"],id:1e3*Math.random()})}},{default:()=>[t("添加")]}))]]),submit:async(e,s,o)=>{await s(),_(e.value,G)}});return m(()=>{k(V)}),z({onConfirm:U}),(e,s)=>(n(),c("div",q,[a(d(M))]))}});export{z as default};
