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
5f23cd13
Commit
5f23cd13
authored
Oct 19, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型按钮不可用提示
parent
fefd1060
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
19 deletions
+44
-19
ExportDDLModal.jsx
src/view/Manage/Model/Component/ExportDDLModal.jsx
+0
-4
ImportModal.jsx
src/view/Manage/Model/Component/ImportModal.jsx
+16
-7
index.jsx
src/view/Manage/Model/index.jsx
+28
-8
No files found.
src/view/Manage/Model/Component/ExportDDLModal.jsx
View file @
5f23cd13
...
...
@@ -284,7 +284,6 @@ class ExportDDLModal extends React.Component {
footer
=
ddlExportSuccess
?
([
<
Button
key=
"0"
type=
"primary"
onClick=
{
()
=>
{
this
.
reset
();
onCancel
&&
onCancel
();
...
...
@@ -306,7 +305,6 @@ class ExportDDLModal extends React.Component {
])
:
([
<
Button
key=
"0"
type=
"primary"
onClick=
{
()
=>
{
this
.
reset
();
onCancel
&&
onCancel
();
...
...
@@ -326,7 +324,6 @@ class ExportDDLModal extends React.Component {
footer
=
ddlExportSuccess
?
([
<
Button
key=
"0"
type=
"primary"
onClick=
{
()
=>
{
this
.
reset
();
onCancel
&&
onCancel
();
...
...
@@ -344,7 +341,6 @@ class ExportDDLModal extends React.Component {
])
:
([
<
Button
key=
"0"
type=
"primary"
onClick=
{
()
=>
{
this
.
reset
();
onCancel
&&
onCancel
();
...
...
src/view/Manage/Model/Component/ImportModal.jsx
View file @
5f23cd13
import
React
,
{
useState
}
from
'react'
;
import
{
Modal
,
Button
,
Form
,
Radio
}
from
'antd'
;
import
{
Modal
,
Button
,
Form
,
Radio
,
Tooltip
}
from
'antd'
;
import
ImportWord
from
'./ImportWord'
;
import
ImportExcel
from
'./ImportExcel'
;
...
...
@@ -144,12 +144,21 @@ const ImportModal = (props) => {
<
Radio
.
Group
onChange=
{
onModeChange
}
value=
{
modeKey
}
>
{
importModes
.
map
((
item
,
index
)
=>
{
return
<
Radio
value=
{
item
.
key
}
key=
{
index
}
disabled=
{
item
.
key
===
'word'
&&
(
view
!==
'dir'
||
(
catalogId
||
''
)
===
''
)
}
>
{
item
.
name
}
</
Radio
>;
let
title
=
''
;
if
(
item
.
key
===
'word'
&&
(
view
!==
'dir'
||
(
catalogId
||
''
)
===
''
))
{
title
=
'请先选择主题'
;
}
return
(
<
Tooltip
key=
{
index
}
title=
{
title
}
>
<
Radio
value=
{
item
.
key
}
disabled=
{
item
.
key
===
'word'
&&
(
view
!==
'dir'
||
(
catalogId
||
''
)
===
''
)
}
>
{
item
.
name
}
</
Radio
>
</
Tooltip
>
);
})
}
</
Radio
.
Group
>
...
...
src/view/Manage/Model/index.jsx
View file @
5f23cd13
import
React
from
'react'
;
import
{
Button
,
Space
,
Spin
,
Dropdown
,
Menu
,
Input
,
Select
}
from
'antd'
;
import
{
Button
,
Space
,
Spin
,
Dropdown
,
Menu
,
Input
,
Select
,
Tooltip
}
from
'antd'
;
import
copy
from
"copy-to-clipboard"
;
import
{
DownOutlined
,
CaretLeftOutlined
,
CaretRightOutlined
}
from
'@ant-design/icons'
;
import
classNames
from
'classnames'
;
...
...
@@ -438,24 +438,42 @@ class Model extends React.Component {
{...this.props} />
);
const moreMenu = (
<Menu onClick={this.onMoreMenuClick}>
<Menu.Item key='export-ddl'>
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'>
<Menu.Item key='export-other' disabled={(selectModelerIds||[]).length===0}>
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}>
导出其他
</Tooltip>
</Menu.Item>
<Menu.Item key='catalog-change'>
<Menu.Item key='catalog-change' disabled={(selectModelerIds||[]).length===0}>
<Tooltip title={(selectModelerIds||[]).length===0?'请先选择模型':''}>
变更目录
</Tooltip>
</Menu.Item>
</Menu>
)
}
const classes = classNames('data-model', {
'data-model-collapse': !expandTree
});
let disableStartFlow = false, startFlowTip = '';
if ((currentView==='dir'&¤tModelState!=='1')||(currentView!=='dir'&&catalogId!=='1')) {
disableStartFlow = true;
startFlowTip = '只有草稿状态下的模型才能送审';
} else if ((selectModelerIds||[]).length===0) {
disableStartFlow = true;
startFlowTip = '请先选择模型';
}
return (
<div className={classes}>
<div className='left'>
...
...
@@ -483,7 +501,9 @@ class Model extends React.Component {
<Button onClick={() => { this.setState({ importModalVisible: true }); }}>导入</Button>
</Space>
<Space>
<Button onClick={this.startFlow} disabled={currentModelState!=='1'}>送审</Button>
<Tooltip title={startFlowTip}>
<Button onClick={this.startFlow} disabled={disableStartFlow}>送审</Button>
</Tooltip>
</Space>
<Space>
<Dropdown overlay={moreMenu} placement="bottomLeft">
...
...
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