Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
b0084bbb
Commit
b0084bbb
authored
Jan 13, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型列表表头按钮导入导出合并
parent
78db0dc5
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
61 deletions
+45
-61
ExportOtherModal.jsx
src/view/Manage/Model/Component/ExportOtherModal.jsx
+2
-2
ImportModal.jsx
src/view/Manage/Model/Component/ImportModal.jsx
+7
-11
index.jsx
src/view/Manage/Model/index.jsx
+36
-48
No files found.
src/view/Manage/Model/Component/ExportOtherModal.jsx
View file @
b0084bbb
...
...
@@ -2,6 +2,7 @@ import React, { useState } from 'react';
import
{
Modal
,
Button
,
Form
,
Radio
}
from
'antd'
;
const
exportModes
=
[
{
name
:
'导出DDL'
,
key
:
'ddl'
},
{
name
:
'导出Erwin'
,
key
:
'erwin'
},
{
name
:
'导出Excel'
,
key
:
'excel'
},
{
name
:
'导出Word'
,
key
:
'word'
},
...
...
@@ -20,7 +21,6 @@ const ExportOtherModal = (props) => {
const
onOk
=
async
()
=>
{
try
{
await
form
.
validateFields
();
reset
();
onCancel
&&
onCancel
(
modeKey
);
...
...
@@ -62,7 +62,7 @@ const ExportOtherModal = (props) => {
forceRender
visible=
{
visible
}
title=
'模型导出'
width=
{
5
2
0
}
width=
{
5
4
0
}
onCancel=
{
cancel
}
footer=
{
footer
}
>
...
...
src/view/Manage/Model/Component/ImportModal.jsx
View file @
b0084bbb
...
...
@@ -15,7 +15,7 @@ const importModes = [
]
const
ImportModal
=
(
props
)
=>
{
const
{
view
,
catalogId
,
visible
,
onCancel
}
=
props
;
const
{
view
,
catalogId
,
visible
,
onCancel
,
onCancelByWord
}
=
props
;
const
[
modeKey
,
setModeKey
]
=
useState
(
''
);
const
[
hints
,
setHints
]
=
useState
([]);
...
...
@@ -46,7 +46,7 @@ const ImportModal = (props) => {
callback
:
data
=>
{
setConfirmLoading
(
false
);
reset
();
onCancel
&&
onCancel
(
true
,
[]
,
data
||
{});
onCancel
ByWord
&&
onCancelByWord
(
true
,
data
||
{});
},
error
:
()
=>
{
setConfirmLoading
(
false
);
...
...
@@ -62,7 +62,7 @@ const ImportModal = (props) => {
callback
:
data
=>
{
setConfirmLoading
(
false
);
reset
();
onCancel
&&
onCancel
(
false
,
data
||
[]);
onCancel
&&
onCancel
(
false
,
true
,
data
||
[]);
},
error
:
()
=>
{
setConfirmLoading
(
false
);
...
...
@@ -71,12 +71,8 @@ const ImportModal = (props) => {
}
else
if
(
modeKey
===
'excel-copy'
)
{
if
((
hints
||
[]).
length
===
0
)
{
showMessage
(
'warn'
,
'请先从Excel文件中复制内容'
);
}
else
{
reset
();
onCancel
&&
onCancel
(
false
,
hints
||
[]);
}
onCancel
&&
onCancel
(
false
,
true
,
hints
||
[]);
}
...
...
@@ -123,7 +119,7 @@ const ImportModal = (props) => {
<
Modal
forceRender
visible=
{
visible
}
title=
'
模型导入
'
title=
'
新建模型
'
width=
{
520
}
onCancel=
{
cancel
}
footer=
{
footer
}
...
...
@@ -131,11 +127,11 @@ const ImportModal = (props) => {
<
Form
form=
{
form
}
>
<
Form
.
Item
name=
'mode'
label=
'
导入
方式'
label=
'
新建
方式'
rules=
{
[
{
required
:
true
,
message
:
'请选择
导入
方式'
,
message
:
'请选择
新建
方式'
,
},
]
}
>
...
...
src/view/Manage/Model/index.jsx
View file @
b0084bbb
...
...
@@ -264,17 +264,31 @@ class Model extends React.Component {
this.setState({ importExcelVisible: visible });
}
onImportModalCancel = (refresh = false,
hints = [], wordData = {}
) => {
onImportModalCancel = (refresh = false,
confirm = false, hints = []
) => {
const { catalogId, currentView } = this.state;
this.setState({ importModalVisible: false }, () => {
refresh && this.onTableChange();
if (confirm) {
if ((hints||[]).length > 0) {
setTimeout(() => {
window.open(`
/
data
-
govern
/
data
-
model
-
action
?
$
{
Action
}
=
add
&
$
{
CatalogId
}
=
$
{(
currentView
===
'dir'
)?(
catalogId
||
''
):
''
}
&
$
{
Hints
}
=
$
{
encodeURIComponent
((
hints
||
[]).
join
(
','
))}
`);
}, 1000);
} else {
setTimeout(() => {
window.open(`
/
data
-
govern
/
data
-
model
-
action
?
$
{
Action
}
=
add
&
$
{
CatalogId
}
=
$
{(
currentView
===
'dir'
)?(
catalogId
||
''
):
''
}
`);
}, 1000);
}
}
});
}
onImportModalCancelByWord = (refresh = false, wordData = {}) => {
const { catalogId, currentView } = this.state;
this.setState({ importModalVisible: false }, () => {
refresh && this.onTableChange();
if (wordData && ((wordData.msg||'')!=='')) {
showNotifaction('提示', wordData.msg);
...
...
@@ -313,7 +327,9 @@ class Model extends React.Component {
const { selectModelerIds } = this.state;
this.setState({ exportOtherModalVisible: false }, () => {
if (key === 'erwin') {
if (key === 'ddl') {
this.setState({ exportDDLModalVisible: true });
} else if (key === 'erwin') {
dispatch({
type: 'datamodel.exportERWinString',
payload: {
...
...
@@ -365,19 +381,6 @@ class Model extends React.Component {
this.setState({ importStockWordDrawerVisible: true });
}
onMoreMenuClick = (e) => {
const { key } = e;
if (key === 'export-ddl') {
this.onExportDDLBtnClick();
} else if (key === 'export-other') {
this.onExportOtherBtnClick();
} else if (key === 'catalog-change') {
this.onRecatalogBtnClick();
} else if (key === 'delete') {
this.onBatchDeleteBtnClick();
}
}
treeToggleClick = () => {
this.setState({ expandTree: !this.state.expandTree });
}
...
...
@@ -425,34 +428,6 @@ class Model extends React.Component {
{...this.props} />
);
const moreMenu = () => {
const { selectModelerIds } = this.state;
return <Menu onClick={this.onMoreMenuClick}>
<Menu.Item key='export-ddl' disabled={(selectModelerIds||[]).length===0}>
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}>
导出DDL
</Tooltip>
</Menu.Item>
<Menu.Item key='export-other' disabled={(selectModelerIds||[]).length===0}>
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}>
导出其他
</Tooltip>
</Menu.Item>
<Menu.Item key='catalog-change' disabled={(selectModelerIds||[]).length===0}>
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}>
变更目录
</Tooltip>
</Menu.Item>
<Menu.Item key='delete' disabled={(selectModelerIds||[]).length===0}>
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}>
删除
</Tooltip>
</Menu.Item>
</Menu>
}
const classes = classNames('data-model', {
'data-model-collapse': !expandTree
});
...
...
@@ -487,21 +462,33 @@ class Model extends React.Component {
>
<Space>
<Space>
<Button onClick={
this.onImportUnconditionBtnClick
}>新建</Button>
<Button onClick={
() => { this.setState({ importModalVisible: true }); }
}>新建</Button>
</Space>
<Space>
<Button onClick={() => { this.setState({ importModalVisible: true }); }}>导入</Button>
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}>
<Button onClick={this.onExportOtherBtnClick} disabled={(selectModelerIds||[]).length===0}>导出</Button>
</Tooltip>
</Space>
<Space>
<Tooltip title={startFlowTip}>
<Button onClick={this.startFlow} disabled={disableStartFlow}>送审</Button>
</Tooltip>
</Space>
<Space>
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}>
<Button onClick={this.onRecatalogBtnClick} disabled={(selectModelerIds||[]).length===0}>变更目录</Button>
</Tooltip>
</Space>
<Space>
<
Dropdown overlay={moreMenu} trigger={['click']} placement="bottomLeft"
>
<Button
>更多<DownOutlined />
</Button>
</
Dropdown
>
<
Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}
>
<Button
onClick={this.onBatchDeleteBtnClick} disabled={(selectModelerIds||[]).length===0}>删除
</Button>
</
Tooltip
>
</Space>
</Space>
<Space>
...
...
@@ -550,6 +537,7 @@ class Model extends React.Component {
catalogId={catalogId}
visible={importModalVisible}
onCancel={this.onImportModalCancel}
onCancelByWord={this.onImportModalCancelByWord}
/>
<ImportStockWordDrawer
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment