var P=Object.defineProperty,V=Object.defineProperties;var w=Object.getOwnPropertyDescriptors;var v=Object.getOwnPropertySymbols;var B=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var h=(o,e,n)=>e in o?P(o,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):o[e]=n,j=(o,e)=>{for(var n in e||(e={}))B.call(e,n)&&h(o,n,e[n]);if(v)for(var n of v(e))$.call(e,n)&&h(o,n,e[n]);return o},_=(o,e)=>V(o,w(e));import{p as g}from"./api.16658261995934.js";import{A as S,r as F,o as A,t as N,_ as q,b as p,d as r,e as u,g as s,w as a,F as b,j as y,k as E,h as I,i as k,a6 as U}from"./index.1665826199593.js";const z=S({name:"ProjectEnvSelect",props:{visible:{type:Boolean},data:{type:Object},title:{type:String},machineId:{type:Number},isCommon:{type:Boolean}},setup(o,{emit:e}){const n=F({projects:[],envs:[],projectId:null,envId:null});A(async()=>{n.projects=await g.accountProjects.request(null)});const c=async l=>{e("update:projectId",l),e("changeProjectEnv",n.projectId,null),n.envId=null,n.envs=await g.projectEnvs.request({projectId:l})},d=l=>{e("update:envId",l),e("changeProjectEnv",n.projectId,l)};return _(j({},N(n)),{changeProject:c,changeEnv:d})}}),D={style:{float:"left"}},L={style:{float:"right",color:"#8492a6","font-size":"13px"}};function M(o,e,n,c,d,l){const i=p("el-option"),f=p("el-select"),m=p("el-form-item"),C=p("el-form");return r(),u("div",null,[s(C,{class:"search-form","label-position":"right",inline:!0},{default:a(()=>[s(m,{prop:"project",label:"\u9879\u76EE","label-width":"40px"},{default:a(()=>[s(f,{modelValue:o.projectId,"onUpdate:modelValue":e[0]||(e[0]=t=>o.projectId=t),placeholder:"\u8BF7\u9009\u62E9\u9879\u76EE",onChange:o.changeProject,filterable:""},{default:a(()=>[(r(!0),u(b,null,y(o.projects,t=>(r(),E(i,{key:t.id,label:`${t.name} [${t.remark}]`,value:t.id},null,8,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),s(m,{prop:"env",label:"env","label-width":"33px"},{default:a(()=>[s(f,{style:{width:"85px"},modelValue:o.envId,"onUpdate:modelValue":e[1]||(e[1]=t=>o.envId=t),placeholder:"\u73AF\u5883",onChange:o.changeEnv,filterable:""},{default:a(()=>[(r(!0),u(b,null,y(o.envs,t=>(r(),E(i,{key:t.id,label:t.name,value:t.id},{default:a(()=>[I("span",D,k(t.name),1),I("span",L,k(t.remark),1)]),_:2},1032,["label","value"]))),128))]),_:1},8,["modelValue","onChange"])]),_:1}),U(o.$slots,"default")]),_:3})])}var H=q(z,[["render",M]]);export{H as P};
