import{K as e}from"./utils-lib.js?v=1761009159";import{c as s,s as a,aA as t,r,g as l,e as o,c1 as u,ak as i,al as m,q as p,v as n,x as c,y as d,i as v}from"./base-lib.js?v=1761009159";import{b as g,j as f,h as j}from"./form-item.js?v=1761009159";import{D as b,f as x,s as h,e as w,c as _,g as P}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 y={class:"p-[2rem]"};const C=s({__name:"php-form",setup(s,{expose:C}){const q=b(),{versionOptions:H,extendOptions:O,templateOptions:k,extendsupOptions:V,isEdit:S}=a(q),U=t("popupClose",()=>{}),A=r(),{BtForm:B,submit:D,param:E}=e({data:x,options:e=>l(()=>[g("名称","name",{attrs:{class:"!w-[320px]",placeholder:"请输入环境名称",disabled:S.value},rules:[{required:!0,message:"请输入环境名称",trigger:"blur"}]}),f("版本","version",H.value,{attrs:{class:"!w-[22rem]",disabled:S.value,onChange:e=>{h(e)}},rules:[{required:!0,message:"请选择PHP版本",trigger:"change"}]}),j("PHP扩展源",()=>o(u,{modelValue:e.value.repo_url,"onUpdate:modelValue":s=>e.value.repo_url=s,class:"!w-[32rem]",placeholder:"请选择或输入PHP扩展源","fetch-suggestions":(e,s)=>{s(O.value)},"popper-class":"my-extautocomplete"},{default:({item:s})=>o("div",{class:s.value===e.value.repo_url?"bg-light flex items-center justify-between px-[2rem]":"flex items-center justify-between px-[2rem]"},[o("div",{class:s.value===e.value.repo_url?"bt-link w-[38rem] truncate":"w-[38rem] truncate"},[s.value+"(".concat(s.label,")")])])}),"repo_url",{attrs:{class:"!w-[22rem]"},rules:[{required:!0,message:"请输入或选择PHP扩展源",trigger:"change"}]}),...S.value?[]:[f("扩展模板","template",k.value,{attrs:{class:"!w-[22rem]",onChange:s=>{const a=k.value.find(e=>e.value===s);a&&(e.value.exts=a.ext.split(","))}},rules:[{required:!1,message:"请选择PHP扩展模板",trigger:"change"}]})],j("扩展",()=>{let s;return o(m,{ref:e=>A.value=e,class:"!w-[32rem]",modelValue:e.value.exts,"onUpdate:modelValue":s=>e.value.exts=s,filterable:!0,multiple:!0,"collapse-tags":!0,"collapse-tags-tooltip":!0,"reserve-keyword":!1,placeholder:"请选择扩展，可多选(可粘贴识别多个扩展，用,分隔)","filter-method":s=>w(s,V,e.value.version,E,A)},"function"==typeof(a=s=V.value.map(e=>o(i,{key:e.value,label:e.label,value:e.value},null)))||"[object Object]"===Object.prototype.toString.call(a)&&!v(a)?s:{default:()=>[s]});var a},"exts",{rules:[{required:!0,message:"请选择扩展，可多选(可粘贴识别多个扩展，用,分隔)",trigger:"change"}]})]),submit:async(e,s,a)=>{await s(),_(e.value,U)}});return p(()=>{P(E)}),C({onConfirm:D}),(e,s)=>(n(),c("div",y,[o(d(B))]))}});export{C as default};
