← Back
Editing: add-sqlite.js
import{c as e,r as a,G as s,q as l,v as t,e as o,A as r,H as m,x as i,Q as d,a9 as p,a7 as n}from"./base-lib.js?v=VERSION_NUMBER";import{K as u,k as f,e as c}from"./utils-lib.js?v=VERSION_NUMBER";import{_ as h}from"./index101.js?v=VERSION_NUMBER";import{addModulesDatabase as _}from"./database.js?v=VERSION_NUMBER";import{f as j}from"./validator.js?v=VERSION_NUMBER";import{g as b}from"./useStore2.js?v=VERSION_NUMBER";import"./__commonjsHelpers__.js?v=VERSION_NUMBER";import"./index104.js?v=VERSION_NUMBER";import"./column.js?v=VERSION_NUMBER";const v={class:"p-24px"},g=c(e({__name:"add-sqlite",setup(e,{expose:c}){const{refreshTableList:g}=b(),x=a(),V=a({name:"",path:""}),q={path:[{required:!0,message:"请选择数据库文件",trigger:["blur","change"]}]},w=()=>{j({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,j=n,b=s("trim");return l(),t("div",v,[o(j,{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"]),[[b]])])),_: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};
Save File
Cancel