import{c as a,o as e,r as s,V as l,q as r,v as o,x as t,e as m,B as n,y as u,R as i,ab as c,a9 as d}from"./base-lib.js?v=1761009159";import{P as p,cq as f,k2 as v,ax as _,_ as b}from"./utils-lib.js?v=1761009159";import{p as x}from"./useMethods.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./column.js?v=1761009159";import"./index106.js?v=1761009159";const y={class:"flex flex-col p-[1.6rem] lib-box"},j=b(a({__name:"pull-mirror-select-dialog",props:{compData:{default:()=>({})}},setup(a,{expose:b}){const j=a,g=e({name:"",id:""}),q=s(),h={name:[{required:!0,message:"请选择仓库",trigger:"blur"}]},V=l([]);return r(async()=>{g.id=j.compData.id,p({request:f(),data:Array,success:a=>{var e;a.forEach(a=>{V.value.push({value:a.url,label:"".concat(a.name).concat("docker.io"===a.url?"":"(".concat(a.url,")")),url:a.url,name:a.name})}),g.name=null==(e=V.value[0])?void 0:e.value}})}),b({onConfirm:async a=>{try{await q.value.validate(async e=>{if(e){let e={template_id:j.compData.id,name:V.value.find(a=>a.url==g.name).name,url:V.value.find(a=>a.url==g.name).url};p({request:v({data:JSON.stringify(e)})}),x(),a()}})}catch(e){}}}),(a,e)=>{const s=_,l=c,r=d;return o(),t("div",y,[m(r,{ref_key:"cmdFormRef",ref:q,model:u(g),rules:h,onSubmit:e[1]||(e[1]=i(()=>{},["prevent"]))},{default:n(()=>[m(l,{prop:"name",label:"仓库名"},{default:n(()=>[m(s,{modelValue:u(g).name,"onUpdate:modelValue":e[0]||(e[0]=a=>u(g).name=a),options:u(V),class:"w-[44rem]"},null,8,["modelValue","options"])]),_:1})]),_:1},8,["model"])])}}}),[["__scopeId","data-v-b63e8269"]]);export{j as default};
