import{a8 as e}from"./wsl.js?v=20260328163632";import{u as a,l as s,K as t,dj as l,t as i,x as o}from"./utils-lib.js?v=20260328163632";import{u as r}from"./index50.js?v=20260328163632";import{g as p}from"./index229.js?v=20260328163632";import{B as m}from"./index85.js?v=20260328163632";import{k as u,a9 as n,r as d,c as f,O as c,V as h,_ as v,Y as j}from"./base-lib.js?v=20260328163632";import"./naive-ui.js?v=20260328163632";import"./__commonjsHelpers__.js?v=20260328163632";import"./env-lib.js?v=20260328163632";import"./index97.js?v=20260328163632";import"./index91.js?v=20260328163632";import"./useMethod9.js?v=20260328163632";const _=u({__name:"import-image",setup(u,{expose:_}){const{panel:x}=a(),{sitePath:b}=n(x.value),{sid:g}=r(),y={labelStyle:"min-width: 100px"},w=d({formAttrs:{labelWidth:"auto"},formItems:[]}),k=f((()=>({label:s("路径"),attrs:y,ruleKey:"file_path",rules:[t({message:s("请选择镜像文件路径"),trigger:["blur","input"]})],children:[{type:"custom",key:"file_path",render:()=>c(m,{modelValue:C.value.file_path,"onUpdate:modelValue":e=>C.value.file_path=e,onIconClick:()=>l({type:"file",path:b.value,callback:e=>C.value.file_path=e}),placeholder:s("请选择镜像文件路径"),width:"200px",icon:"el-folder-opened"},null)}]}))),I=f((()=>(w.value.formItems=[k.value],w.value))),[V,C,K]=i(I);return _({onConfirm:async()=>{var a;try{await(null==(a=K.value)?void 0:a.validate());const{file_path:t}=C.value;return(await o({loading:s("正在导入镜像，请稍后..."),request:e({file_path:t,sid:g.value}),message:!0,success:e=>{p()}})).status}catch(t){}}}),(e,a)=>(h(),v(j(V),{class:"p-20px"}))}});export{_ as default};
