Newer
Older
Nanping_sponge_JXKH / spongePerformanceDist / assets / importTable.c2ce8793.js
import{r as c,aa as z,e as m,o as B,l as D,w as l,m as F,f as e,p as f,h as o,k as C,F as I,K as L,ab as P,v as Q}from"./index.82404a61.js";import{l as j,i as E}from"./gen.84b5e608.js";const A={class:"dialog-footer"},M={__name:"importTable",emits:["ok"],setup(G,{expose:h,emit:N}){const b=c(0),u=c(!1),v=c([]),w=c([]),{proxy:p}=Q(),a=z({pageNum:1,pageSize:10,tableName:void 0,tableComment:void 0});function V(){_(),u.value=!0}function k(n){p.$refs.table.toggleRowSelection(n)}function S(n){v.value=n.map(t=>t.tableName)}function _(){j(a).then(n=>{w.value=n.data,b.value=n.total})}function s(){a.pageNum=1,_()}function T(){p.resetForm("queryRef"),s()}function x(){const n=v.value.join(",");if(n==""){p.$modal.msgError("\u8BF7\u9009\u62E9\u8981\u5BFC\u5165\u7684\u8868");return}E({tables:n}).then(t=>{p.$modal.msgSuccess(t.msg),t.code===200&&(u.value=!1,N("ok"))})}return h({show:V}),(n,t)=>{const y=m("el-input"),g=m("el-form-item"),d=m("el-button"),R=m("el-form"),r=m("el-table-column"),K=m("el-table"),U=m("pagination"),$=m("el-row"),q=m("el-dialog");return B(),D(q,{title:"\u5BFC\u5165\u8868",modelValue:o(u),"onUpdate:modelValue":t[5]||(t[5]=i=>P(u)?u.value=i:null),width:"800px",top:"5vh","append-to-body":""},{footer:l(()=>[F("div",A,[e(d,{type:"primary",onClick:x},{default:l(()=>[f("\u786E \u5B9A")]),_:1}),e(d,{onClick:t[4]||(t[4]=i=>u.value=!1)},{default:l(()=>[f("\u53D6 \u6D88")]),_:1})])]),default:l(()=>[e(R,{model:o(a),ref:"queryRef",inline:!0},{default:l(()=>[e(g,{label:"\u8868\u540D\u79F0",prop:"tableName"},{default:l(()=>[e(y,{modelValue:o(a).tableName,"onUpdate:modelValue":t[0]||(t[0]=i=>o(a).tableName=i),placeholder:"\u8BF7\u8F93\u5165\u8868\u540D\u79F0",clearable:"",onKeyup:C(s,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(g,{label:"\u8868\u63CF\u8FF0",prop:"tableComment"},{default:l(()=>[e(y,{modelValue:o(a).tableComment,"onUpdate:modelValue":t[1]||(t[1]=i=>o(a).tableComment=i),placeholder:"\u8BF7\u8F93\u5165\u8868\u63CF\u8FF0",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("\u641C\u7D22")]),_:1}),e(d,{icon:"Refresh",onClick:T},{default:l(()=>[f("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["model"]),e($,null,{default:l(()=>[e(K,{onRowClick:k,ref:"table",data:o(w),onSelectionChange:S,height:"260px"},{default:l(()=>[e(r,{type:"selection",width:"55"}),e(r,{prop:"tableName",label:"\u8868\u540D\u79F0","show-overflow-tooltip":!0}),e(r,{prop:"tableComment",label:"\u8868\u63CF\u8FF0","show-overflow-tooltip":!0}),e(r,{prop:"createTime",label:"\u521B\u5EFA\u65F6\u95F4"}),e(r,{prop:"updateTime",label:"\u66F4\u65B0\u65F6\u95F4"})]),_:1},8,["data"]),I(e(U,{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{M as default};