var M=(e,l,n)=>new Promise((d,s)=>{var m=t=>{try{a(n.next(t))}catch(i){s(i)}},u=t=>{try{a(n.throw(t))}catch(i){s(i)}},a=t=>t.done?d(t.value):Promise.resolve(t.value).then(m,u);a((n=n.apply(e,l)).next())});import{B as R,u as L}from"./useTable.885579ec.js";import{T as N}from"./BasicForm.948b0243.js";import{aH as k,a as I,d1 as w,aJ as p,o as C,h as f,j as c,p as T,t as O,aL as y,q as D,x as v}from"./index.bde7963b.js";import{T as B}from"./table.0ba2e59f.js";import{b as g}from"./index.4b403226.js";import x from"./Modify.1ca6ca38.js";import h from"./CreateMenu.1a882f32.js";import{g as S,b as $}from"./common.201fe4f0.js";import"./index.dcd3d2b7.js";import"./useForm.b21b423d.js";import"./index.159e9c7d.js";import"./index.e3e2a44d.js";import"./index.eb76ac7f.js";import"./index.3289c967.js";import"./index.18602d99.js";import"./useWindowSizeFn.ada338ad.js";import"./useContentViewHeight.9a4f8bdd.js";import"./ArrowLeftOutlined.284f8ef3.js";import"./transButton.3496299b.js";import"./index.bfd670f8.js";import"./index.13318916.js";import"./_baseIteratee.34b68bfe.js";import"./index.9b1e5ec7.js";import"./sortable.esm.2632adaa.js";import"./RedoOutlined.4aa527e6.js";import"./uniqBy.3333e3da.js";import"./fromPairs.84aabb58.js";import"./scrollTo.7893ea05.js";import"./index.54dd68f7.js";import"./index.498edf7f.js";import"./index.0103b3aa.js";import"./index.ce7c5e55.js";import"./index.b75cc0a1.js";import"./download.dc299cb5.js";import"./index.781dc060.js";import"./index.357d6afd.js";import"./tableData.e0091893.js";const H=[{title:"\u8868\u540D",dataIndex:"TABLE_NAME",sorter:!0},{title:"\u8BB0\u5F55\u6570",dataIndex:"TABLE_ROWS",sorter:!0},{title:"\u5907\u6CE8",dataIndex:"TABLE_COMMENT",sorter:!0},{title:"\u5F15\u64CE",dataIndex:"ENGINE",sorter:!0},{title:"\u5B57\u7B26\u96C6",sorter:!0,dataIndex:"TABLE_COLLATION"},{title:"\u521B\u5EFA\u65F6\u95F4",sorter:!0,dataIndex:"CREATE_TIME"}],W=I({components:{Modal:x,BasicTable:R,TableAction:N,ModalCreateMenu:h},setup(){const[e,{openModal:l}]=g(),[n,{openModal:d}]=g(),{createMessage:s}=v(),{success:m}=s,u=w(),[a,{reload:t}]=L({title:"\u6240\u6709\u8868",api:S(B.SHOW),columns:H,bordered:!0,actionColumn:{width:250,title:"Action",dataIndex:"action",slots:{customRender:"action"}}});function i(){l(!0,{table:""})}function E(){t()}function r(o){l(!0,{table:o.TABLE_NAME})}function b(o){return M(this,null,function*(){yield $(B.DROP,{table:o.TABLE_NAME}),m("\u5220\u9664\u6210\u529F"),t()})}function _(o){return M(this,null,function*(){d(!0,{table:o.TABLE_NAME})})}function A(o){console.log("\u70B9\u51FB\u4E86\u542F\u7528",o)}function F(o){u(`/database/table/view/${o}`)}return{registerTable:a,handleEdit:r,handleDelete:b,handleOpen:A,view:F,openTableModal:i,register:e,createMenuRegister:n,reloadTables:E,handleCreateMenu:_,ModalCreateMenu:h}}}),V={class:"p-4"},G=D(" \u521B\u5EFA\u8868\u683C "),P=["onClick"];function j(e,l,n,d,s,m){const u=p("a-button"),a=p("TableAction"),t=p("BasicTable"),i=p("Modal"),E=p("ModalCreateMenu");return C(),f("div",V,[c(t,{onRegister:e.registerTable,showTableSetting:""},{toolbar:T(()=>[c(u,{type:"primary",onClick:e.openTableModal},{default:T(()=>[G]),_:1},8,["onClick"])]),bodyCell:T(({column:r,record:b,text:_})=>[r.key==="TABLE_ROWS"?(C(),f("a",{key:0,onClick:A=>e.view(b.TABLE_NAME)},O(b.TABLE_ROWS),9,P)):y("",!0)]),action:T(({record:r})=>[c(a,{actions:[{label:"\u7F16\u8F91",onClick:e.handleEdit.bind(null,r)},{label:"\u5220\u9664",icon:"ic:outline-delete-outline",popConfirm:{title:"\u662F\u5426\u5220\u9664\uFF1F",confirm:e.handleDelete.bind(null,r)}}],dropDownActions:[{label:"\u4E00\u952E\u83DC\u5355",onClick:e.handleCreateMenu.bind(null,r)}]},null,8,["actions","dropDownActions"])]),_:1},8,["onRegister"]),c(i,{onRegister:e.register,defaultFullscreen:!0,minHeight:100,onReload:e.reloadTables},null,8,["onRegister","onReload"]),c(E,{onRegister:e.createMenuRegister,minHeight:300},null,8,["onRegister"])])}var ke=k(W,[["render",j]]);export{ke as default};
