import{c as e,s,aA as r,g as a,e as t,C as o,I as l,c2 as p,az as i,G as u,c1 as m,q as n,v as c,x as d,y as v}from"./base-lib.js?v=1761009159";import{K as g,k as h}from"./utils-lib.js?v=1761009159";import{b as f,j as y,a as j,h as x}from"./form-item.js?v=1761009159";import{p as b,q as w,r as _,v as C,w as q,x 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 V={class:"p-[2rem] max-h-[60rem] overflow-auto"},F=e({__name:"python-form",setup(e,{expose:F}){const U=b(),{versionOptions:z,extendOptions:M,popoverFocus:O,isEdit:A}=s(U),B=r("popupClose",()=>{}),{BtForm:E,submit:G,param:H}=g({data:w,options:e=>a(()=>[f("名称","name",{attrs:{class:"!w-[320px]",placeholder:"请输入环境名称",disabled:A.value},rules:[{required:!0,message:"请输入环境名称",trigger:"blur"}]}),y("版本","version",z.value,{attrs:{class:"!w-[22rem]",disabled:A.value},rules:[{required:!0,message:"请选择Python版本",trigger:"change"}]}),j("运行目录","path",{attrs:{class:"!w-[320px]",placeholder:"请选择运行目录"},rules:[{required:!0,message:"请选择运行目录",trigger:"change"}],icon:"icon-file_mode",iconClick:()=>{_(e)}}),x("启动命令",()=>t(i,{ref:"pythonpopover",placement:"top-start","popper-class":"green-tips-popover !p-0",title:"",width:"440",visible:O.value,"onUpdate:visible":e=>O.value=e,"trigger-keys":[],trigger:"focus"},{default:()=>t("div",{class:"!p-[12px] bg-primary text-white"},[o("请填写完整启动命令，如：python main.py")]),reference:()=>l(t(h,{modelValue:e.value.command,"onUpdate:modelValue":s=>e.value.command=s,type:"textarea",width:"52rem",rows:7,resize:"none",onFocus:()=>{O.value=!0},placeholder:"请填写完整启动命令，如：python main.py"},null),[[p,"pythonpopover"]])}),"command",{attrs:{class:"!w-[52rem]"},rules:[{required:!0,message:"请填写完整启动命令，如：python main.py",trigger:"change"}]}),...e.value.port&&e.value.port.length>0?[C(e.value.port),x(" ",()=>t(u,{type:"default",onClick:()=>{e.value.port.push({server:"",con:"",output:!1,protocol:["tcp"],id:1})}},{default:()=>[o("添加")]}))]:[x("端口",()=>t(u,{type:"default",onClick:()=>{e.value.port.push({server:"",con:"",output:!1,protocol:["tcp"],id:1e3*Math.random()})}},{default:()=>[o("添加")]}))],x("镜像源",()=>t(m,{modelValue:e.value.repo_url,"onUpdate:modelValue":s=>e.value.repo_url=s,class:"!w-[32rem]",placeholder:"请选择或输入镜像源","fetch-suggestions":(e,s)=>{s(M.value)},"popper-class":"my-extautocomplete"},{default:({item:s})=>t("div",{class:s.value===e.value.repo_url?"bg-light flex items-center justify-between px-[2rem]":"flex items-center justify-between px-[2rem]"},[t("div",{class:s.value===e.value.repo_url?"bt-link w-[38rem] truncate":"w-[38rem] truncate"},[s.label])])}),"repo_url",{attrs:{class:"!w-[22rem]"},rules:[{required:!0,message:"请输入或选择镜像源",trigger:"change"}]})]),submit:async(e,s,r)=>{await s(),q(e.value,B)}});return n(()=>{k(H)}),F({onConfirm:G}),(e,s)=>(c(),d("div",V,[t(v(E))]))}});export{F as default};
