Unverified Commit b9dc419f authored by aiwenmo's avatar aiwenmo Committed by GitHub

[Fix-387][web] metadata switching error

[Fix-387][web] metadata switching error
parents c0e9de42 85c7dc24
import { import {Button, Empty, Modal, Select, Tabs, Tag, Tree} from "antd";
Tabs, Button,Tree, Empty, Select,Tag,
Tooltip
} from "antd";
import {StateType} from "@/pages/DataStudio/model"; import {StateType} from "@/pages/DataStudio/model";
import {connect} from "umi"; import {connect} from "umi";
import {useState} from "react"; import React, {useState} from "react";
import styles from "./index.less"; import {CodepenOutlined, DatabaseOutlined, DownOutlined, OrderedListOutlined, TableOutlined} from '@ant-design/icons';
import {
TableOutlined,
DatabaseOutlined,
DownOutlined,
OrderedListOutlined, CodepenOutlined
} from '@ant-design/icons';
import React from "react";
import {showMetaDataTable} from "@/components/Studio/StudioEvent/DDL"; import {showMetaDataTable} from "@/components/Studio/StudioEvent/DDL";
import { Scrollbars } from 'react-custom-scrollbars'; import {Scrollbars} from 'react-custom-scrollbars';
import {
ModalForm,
} from '@ant-design/pro-form';
import Columns from "@/pages/DataBase/Columns"; import Columns from "@/pages/DataBase/Columns";
import Tables from "@/pages/DataBase/Tables"; import Tables from "@/pages/DataBase/Tables";
import {TreeDataNode} from "@/components/Studio/StudioTree/Function"; import {TreeDataNode} from "@/components/Studio/StudioTree/Function";
...@@ -82,6 +69,11 @@ const StudioMetaData = (props: any) => { ...@@ -82,6 +69,11 @@ const StudioMetaData = (props: any) => {
} }
} }
const cancelHandle = () => {
setRow(undefined);
setModalVisit(false);
}
return ( return (
<> <>
<Select <Select
...@@ -103,29 +95,20 @@ const StudioMetaData = (props: any) => { ...@@ -103,29 +95,20 @@ const StudioMetaData = (props: any) => {
}} }}
/>):(<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />)} />):(<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />)}
</Scrollbars> </Scrollbars>
<ModalForm <Modal
title={row?.key} title={row?.key}
visible={modalVisit} visible={modalVisit}
width={1000} width={1000}
onFinish={async () => { onCancel={()=>{
// setRow(undefined); cancelHandle();
// setModalVisit(false);
}}
modalProps={{
maskClosable:false,
bodyStyle:{
padding: '5px'
}
}}
onVisibleChange={setModalVisit}
submitter={{
submitButtonProps: {
style: {
display: 'none',
},
},
}} }}
footer={[
<Button key="back" onClick={() => {
cancelHandle();
}}>
关闭
</Button>,
]}
> >
<Tabs defaultActiveKey="tableInfo" size="small"> <Tabs defaultActiveKey="tableInfo" size="small">
<TabPane <TabPane
...@@ -162,7 +145,7 @@ const StudioMetaData = (props: any) => { ...@@ -162,7 +145,7 @@ const StudioMetaData = (props: any) => {
{row? <Generation dbId={databaseId} schema={row.schema} table={row.table}/> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />} {row? <Generation dbId={databaseId} schema={row.schema} table={row.table}/> : <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />}
</TabPane> </TabPane>
</Tabs> </Tabs>
</ModalForm> </Modal>
</> </>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment