Commit 8c2be76f by zhaochengxiang

ddl导出到文本

parent 59c0e0df
...@@ -95,7 +95,7 @@ class ExportDDLModal extends React.Component { ...@@ -95,7 +95,7 @@ class ExportDDLModal extends React.Component {
} }
render() { render() {
const { visible, onCancel, names } = this.props; const { visible, onCancel, names, ids } = this.props;
const { ddlGenerators, loadingDDLGenerators, confirmLoading, selectDDLGeneratorName, ddlExportSuccess, ddlExportString, selectModalerNameKey } = this.state; const { ddlGenerators, loadingDDLGenerators, confirmLoading, selectDDLGeneratorName, ddlExportSuccess, ddlExportString, selectModalerNameKey } = this.state;
const title = ddlExportSuccess ? 'DDL导出详情' : 'DDL导出'; const title = ddlExportSuccess ? 'DDL导出详情' : 'DDL导出';
...@@ -110,6 +110,17 @@ class ExportDDLModal extends React.Component { ...@@ -110,6 +110,17 @@ class ExportDDLModal extends React.Component {
}} }}
> >
取消 取消
</Button>,
<Button
key="1"
type="primary"
onClick={() => {
window.open(`/api/datamodeler/easyDataModelerExport/ddlStringAsFile?ids=${ids.join(',')}&ddlGeneratorName=${selectDDLGeneratorName}`);
this.reset();
onCancel && onCancel();
}}
>
导出到文本
</Button> </Button>
]) : ([ ]) : ([
<Button <Button
......
...@@ -21,15 +21,16 @@ const ModelTree = (props) => { ...@@ -21,15 +21,16 @@ const ModelTree = (props) => {
const [modal, contextHolder] = Modal.useModal(); const [modal, contextHolder] = Modal.useModal();
const did = getQueryParam('did', props.location.search);
const itemRef = useRef(); const itemRef = useRef();
itemRef.current = item; itemRef.current = item;
useEffect(() => { useEffect(() => {
const _did = getQueryParam('did', props.location.search); getTreeData(did);
getTreeData(_did);
//eslint-disable-next-line react-hooks/exhaustive-deps //eslint-disable-next-line react-hooks/exhaustive-deps
}, []) }, [did])
const getTreeData = (defaultSelectedId='') => { const getTreeData = (defaultSelectedId='') => {
......
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