import{aP as e,M as a,P as s,hg as l,hh as t,l as o,_ as i,aC as r}from"./utils-lib.js?v=1761009159";import{c,o as m,r as n,H as d,v as p,x as u,e as f,B as h,z as _,y as v,C as g,I as b,A as x,R as C,at as y,U as j,G as k,a9 as V,Q as L,aC as I}from"./base-lib.js?v=1761009159";import S from"./add-compose-template.js?v=1761009159";import{_ as U}from"./index103.js?v=1761009159";import{f as w}from"./validator.js?v=1761009159";import{l as D}from"./useMethods.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./form-item.js?v=1761009159";import"./index106.js?v=1761009159";import"./index115.js?v=1761009159";import"./ace.js?v=1761009159";import"./column.js?v=1761009159";const P={class:"container-dialog !p-0"},R={class:"flex items-center relative"},q={class:"table w-full mt-[1rem]"},z={class:"pl-[2rem]"},A={class:"help-info-text c7 list-disc text-[#ff0000] mt-[1.5rem]"},H=i(c({__name:"search-local-template",emits:["close","complate"],setup(i,{expose:r,emit:c}){const L=c,{refs:{isRefreshTemplateList:I}}=e(),S=m({path:"",checked:!1}),H=m({loading:!1,list:[],selection:[]}),J=D(),M=n(),N=m({selectList:[]}),O=()=>{w({type:"dir",change:e=>{S.path=e}})},T=async()=>{if(""===S.path)return a.error("请选择路径"),!1;s({request:l({data:JSON.stringify({path:S.path,sub_dir:S.checked?"1":"0"})}),data:[Array,y(H,"list")],loading:y(H,"loading")})},B=e=>{N.selectList=e};return r({confirm:()=>{0!==N.selectList.length?s({request:t({data:JSON.stringify({template_list:N.selectList})}),message:!0,success:e=>{e.status&&(L("complate",e),I.value=!0,L("close"))}}):a.error("请选择模板")}}),(e,a)=>{const s=U,l=j,t=k,i=o,r=V,c=d("bt-loading");return p(),u("div",P,[f(r,{ref_key:"cmdFormRef",ref:M,size:"default",model:v(S),class:"relative w-full","label-position":"right",onSubmit:a[3]||(a[3]=C(()=>{},["prevent"]))},{default:h(()=>[_("div",R,[f(s,{modelValue:v(S).path,"onUpdate:modelValue":a[0]||(a[0]=e=>v(S).path=e),width:"51rem",icon:"icon-file_mode",onIconClick:O,onChangePassive:a[1]||(a[1]=e=>{S.path=S.path.replace(/\s+/g,"")}),placeholder:"请输入镜像路径"},null,8,["modelValue"]),f(l,{class:"!absolute top-[0rem] left-[36rem]",modelValue:v(S).checked,"onUpdate:modelValue":a[2]||(a[2]=e=>v(S).checked=e)},{default:h(()=>a[4]||(a[4]=[g("包含子目录",-1)])),_:1,__:[4]},8,["modelValue"]),f(t,{class:"ml-8px",type:"primary",onClick:T},{default:h(()=>a[5]||(a[5]=[g("搜索",-1)])),_:1,__:[5]})]),_("div",q,[b(f(i,{ref:"ftpTable",column:v(J),height:"33rem",data:v(H).list,description:"模板列表为空",onSelectionChange:B},null,8,["column","data"]),[[c,v(H).loading],[c,"正在加载模板列表，请稍后...","title"]])]),_("div",z,[_("ul",A,[_("li",null,"选中需要添加的Compose 【已选中："+x(v(N).selectList.length)+"个】",1)])])]),_:1},8,["model"])])}}}),[["__scopeId","data-v-533d0cb7"]]),J={class:"flex flex-col p-[1.6rem] lib-box"},M=i(c({__name:"index",props:{compData:{default:()=>({})}},emits:["close"],setup(e,{expose:a,emit:s}){const l=s,t=e,o=n("first"),i=n(),c=n(),m=e=>{var a;(null==(a=t.compData)?void 0:a.callback)&&t.compData.callback(e)},d=()=>{l("close")};return a({onConfirm:async()=>{try{"first"==o.value?i.value.onConfirm():c.value.confirm()}catch(e){}}}),(e,a)=>{const s=I,l=r;return p(),u("div",J,[f(l,{type:"card",modelValue:v(o),"onUpdate:modelValue":a[0]||(a[0]=e=>L(o)?o.value=e:null)},{default:h(()=>[f(s,{label:"添加Compose模板",name:"first"},{default:h(()=>[f(S,{ref_key:"first",ref:i,onClose:d,onComplate:m},null,512)]),_:1}),f(s,{label:"搜索本地模板",name:"second"},{default:h(()=>[f(H,{ref_key:"second",ref:c,onClose:d,onComplate:m},null,512)]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-693d7602"]]);export{M as default};
