import{c as e,r as a,H as s,v as l,x as t,e as o,B as r,I as m,y as i,R as d,ab as p,a9 as n}from"./base-lib.js?v=1761009159";import{P as u,k as f,_ as c}from"./utils-lib.js?v=1761009159";import{_ as h}from"./index103.js?v=1761009159";import{addModulesDatabase as _}from"./database.js?v=1761009159";import{f as b}from"./validator.js?v=1761009159";import{g as j}from"./useStore2.js?v=1761009159";import"./__commonjsHelpers__.js?v=1761009159";import"./index106.js?v=1761009159";import"./column.js?v=1761009159";const v={class:"p-24px"},g=c(e({__name:"add-sqlite",setup(e,{expose:c}){const{refreshTableList:g}=j(),x=a(),V=a({name:"",path:""}),q={path:[{required:!0,message:"请选择数据库文件",trigger:["blur","change"]}]},w=()=>{b({type:"file",path:"",change:e=>V.value.path=e})};return c({onConfirm:async e=>{await x.value.validate(),await u({loading:"正在添加数据库，请稍后...",request:_(V.value,"sqlite"),message:!0}),g(),e()}}),(e,a)=>{const u=h,c=p,_=f,b=n,j=s("trim");return l(),t("div",v,[o(b,{model:i(V),ref_key:"addDataBaseForm",ref:x,rules:q,onSubmit:a[2]||(a[2]=d(()=>{},["prevent"]))},{default:r(()=>[o(c,{label:"路径",prop:"path"},{default:r(()=>[m(o(u,{modelValue:i(V).path,"onUpdate:modelValue":a[0]||(a[0]=e=>i(V).path=e),icon:"icon-file_mode",name:"path",onIconClick:w,placeholder:"请选择数据库文件",width:"28rem"},null,8,["modelValue"]),[[j]])]),_:1}),o(c,{label:"名称"},{default:r(()=>[o(_,{width:"28rem",modelValue:i(V).name,"onUpdate:modelValue":a[1]||(a[1]=e=>i(V).name=e),placeholder:"可以不填写，默认为数据库文件名"},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])])}}}),[["__scopeId","data-v-9fe42e36"]]);export{g as default};
