import{r as c,B as z,d as m,o as D,l as F,f as l,p as f,e,m as I,h as o,k as C,G as L,F as P,H as Q,v as j}from"./index-TnLvmlMR.js";import{l as E,i as G}from"./gen-p5FXvA9T.js";const H={class:"dialog-footer"},O={__name:"importTable",emits:["ok"],setup(A,{expose:h,emit:N}){const b=c(0),r=c(!1),v=c([]),w=c([]),{proxy:p}=j(),a=z({pageNum:1,pageSize:10,tableName:void 0,tableComment:void 0}),V=N;function k(){_(),r.value=!0}function S(n){p.$refs.table.toggleRowSelection(n)}function x(n){v.value=n.map(t=>t.tableName)}function _(){E(a).then(n=>{w.value=n.rows,b.value=n.total})}function s(){a.pageNum=1,_()}function T(){p.resetForm("queryRef"),s()}function R(){const n=v.value.join(",");if(n==""){p.$modal.msgError("请选择要导入的表");return}G({tables:n}).then(t=>{p.$modal.msgSuccess(t.msg),t.code===200&&(r.value=!1,V("ok"))})}return h({show:k}),(n,t)=>{const y=m("el-input"),g=m("el-form-item"),d=m("el-button"),K=m("el-form"),u=m("el-table-column"),U=m("el-table"),B=m("pagination"),$=m("el-row"),q=m("el-dialog");return D(),F(q,{title:"导入表",modelValue:o(r),"onUpdate:modelValue":t[5]||(t[5]=i=>Q(r)?r.value=i:null),width:"800px",top:"5vh","append-to-body":""},{footer:l(()=>[I("div",H,[e(d,{type:"primary",onClick:R},{default:l(()=>[f("确 定")]),_:1}),e(d,{onClick:t[4]||(t[4]=i=>r.value=!1)},{default:l(()=>[f("取 消")]),_:1})])]),default:l(()=>[e(K,{model:o(a),ref:"queryRef",inline:!0},{default:l(()=>[e(g,{label:"表名称",prop:"tableName"},{default:l(()=>[e(y,{modelValue:o(a).tableName,"onUpdate:modelValue":t[0]||(t[0]=i=>o(a).tableName=i),placeholder:"请输入表名称",clearable:"",onKeyup:C(s,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(g,{label:"表描述",prop:"tableComment"},{default:l(()=>[e(y,{modelValue:o(a).tableComment,"onUpdate:modelValue":t[1]||(t[1]=i=>o(a).tableComment=i),placeholder:"请输入表描述",clearable:"",onKeyup:C(s,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(g,null,{default:l(()=>[e(d,{type:"primary",icon:"Search",onClick:s},{default:l(()=>[f("搜索")]),_:1}),e(d,{icon:"Refresh",onClick:T},{default:l(()=>[f("重置")]),_:1})]),_:1})]),_:1},8,["model"]),e($,null,{default:l(()=>[e(U,{onRowClick:S,ref:"table",data:o(w),onSelectionChange:x,height:"260px"},{default:l(()=>[e(u,{type:"selection",width:"55"}),e(u,{prop:"tableName",label:"表名称","show-overflow-tooltip":!0}),e(u,{prop:"tableComment",label:"表描述","show-overflow-tooltip":!0}),e(u,{prop:"createTime",label:"创建时间"}),e(u,{prop:"updateTime",label:"更新时间"})]),_:1},8,["data"]),P(e(B,{total:o(b),page:o(a).pageNum,"onUpdate:page":t[2]||(t[2]=i=>o(a).pageNum=i),limit:o(a).pageSize,"onUpdate:limit":t[3]||(t[3]=i=>o(a).pageSize=i),onPagination:_},null,8,["total","page","limit"]),[[L,o(b)>0]])]),_:1})]),_:1},8,["modelValue"])}}};export{O as default};
