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