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
ecc353d7
Commit
ecc353d7
authored
Jun 29, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
规范详情调整
parent
52eb2a4e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
148 additions
and
97 deletions
+148
-97
ConstraintDetail.jsx
src/view/Manage/Model/Component/ConstraintDetail.jsx
+0
-88
ConstraintDetailModal.jsx
src/view/Manage/Model/Component/ConstraintDetailModal.jsx
+123
-0
ConstraintDetailModal.less
src/view/Manage/Model/Component/ConstraintDetailModal.less
+7
-0
TemplateCURDModal.jsx
src/view/Manage/Model/Component/TemplateCURDModal.jsx
+1
-0
index.jsx
src/view/Manage/Model/index.jsx
+17
-9
No files found.
src/view/Manage/Model/Component/ConstraintDetail.jsx
deleted
100644 → 0
View file @
52eb2a4e
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Table
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
const
ConstraintDetail
=
()
=>
{
const
[
constraints
,
setConstraints
]
=
useState
([]);
const
[
expandedRowKeys
,
setExpandedRowKeys
]
=
useState
([]);
useEffect
(()
=>
{
dispatch
({
type
:
'datamodel.getAllConstraints'
,
callback
:
data
=>
{
setConstraints
(
data
||
[]);
if
((
data
||
[]).
length
>
0
)
{
setExpandedRowKeys
([
data
[
0
].
id
||
''
]);
}
}
})
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[])
const
columns
=
[
{
title
:
'中文名称'
,
dataIndex
:
'cnName'
,
ellipsis
:
true
,
width
:
150
,
},
{
title
:
'英文名称'
,
dataIndex
:
'name'
,
ellipsis
:
true
,
width
:
150
,
},
{
title
:
'描述'
,
dataIndex
:
'description'
,
ellipsis
:
true
,
}
];
return
(
<
div
style=
{
{
width
:
600
,
maxHeight
:
600
,
wordWrap
:
'break-word'
,
overflow
:
'auto'
}
}
>
<
Table
columns=
{
columns
}
dataSource=
{
constraints
||
[]
}
rowKey=
'id'
size=
'small'
expandable=
{
{
expandedRowRender
:
record
=>
{
return
(
<>
{
record
.
allRules
&&
record
.
allRules
.
map
((
rule
,
index
)
=>
{
return
(
<
div
key=
{
index
}
>
{
`中文名称: ${rule.name||''} 描述: ${rule.desc||''}`
}
</
div
>
)
})
}
</>
)
},
rowExpandable
:
record
=>
((
record
.
allRules
||
[]).
length
>
0
),
expandedRowKeys
,
onExpand
:
(
expanded
,
record
)
=>
{
const
newExpandedKeys
=
[...
expandedRowKeys
];
if
(
expanded
)
{
newExpandedKeys
.
push
(
record
.
id
||
''
);
}
else
{
const
index
=
newExpandedKeys
.
indexOf
(
record
.
id
||
''
);
newExpandedKeys
.
splice
(
index
,
1
);
}
setExpandedRowKeys
([...
newExpandedKeys
]);
}
}
}
pagination=
{
false
}
/>
</
div
>
)
}
export
default
ConstraintDetail
;
\ No newline at end of file
src/view/Manage/Model/Component/ConstraintDetailModal.jsx
0 → 100644
View file @
ecc353d7
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Modal
,
Button
,
Table
,
Input
}
from
'antd'
;
import
{
dispatch
}
from
'../../../../model'
;
import
'./ConstraintDetailModal.less'
;
const
ConstraintDetailModal
=
(
props
)
=>
{
const
{
onCancel
,
visible
}
=
props
;
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
rules
,
setRules
]
=
useState
([]);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
useEffect
(()
=>
{
if
(
visible
)
{
setLoading
(
true
);
dispatch
({
type
:
'datamodel.getAllConstraints'
,
callback
:
data
=>
{
setLoading
(
false
);
const
_rules
=
[];
(
data
||
[]).
forEach
(
constraint
=>
{
(
constraint
.
allRules
||
[]).
forEach
(
rule
=>
{
_rules
.
push
({...
constraint
,
...{
ruleName
:
rule
.
name
||
''
,
ruleDesc
:
rule
.
desc
||
''
}});
});
});
setRules
(
_rules
);
},
error
:
()
=>
{
setLoading
(
false
);
}
})
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
])
const
columns
=
[
{
title
:
'序号'
,
dataIndex
:
'key'
,
editable
:
false
,
render
:
(
_
,
__
,
index
)
=>
{
return
(
index
+
1
).
toString
();
},
width
:
60
,
},
{
title
:
'规范名称'
,
dataIndex
:
'name'
,
width
:
180
,
ellipsis
:
true
,
},
{
title
:
'规范中文名称'
,
dataIndex
:
'cnName'
,
width
:
180
,
ellipsis
:
true
,
},
{
title
:
'前置依赖'
,
dataIndex
:
'ruleName'
,
width
:
180
,
ellipsis
:
true
,
},
{
title
:
'描述'
,
dataIndex
:
'ruleDesc'
,
ellipsis
:
true
,
}
]
const
onSearchInputChange
=
(
e
)
=>
{
setKeyword
(
e
.
target
.
value
||
''
);
}
return
(
<
Modal
className=
'constraint-detail-modal'
forceRender
visible=
{
visible
}
title=
'规范详情'
width=
{
1000
}
onCancel=
{
()
=>
{
onCancel
&&
onCancel
();
}
}
footer=
{
[
<
Button
key=
"1"
type=
"primary"
onClick=
{
()
=>
{
onCancel
&&
onCancel
();
}
}
>
取消
</
Button
>
]
}
>
<
div
className=
'd-flex mb-3'
style=
{
{
alignItems
:
'center'
}
}
>
<
span
className=
'mr-3'
>
前置依赖搜索:
</
span
>
<
Input
placeholder=
"请输入前置依赖名称"
allowClear
value=
{
keyword
}
onChange=
{
onSearchInputChange
}
style=
{
{
width
:
230
}
}
/>
</
div
>
<
Table
loading=
{
loading
}
columns=
{
columns
}
rowKey=
{
'ruleName'
}
dataSource=
{
(
rules
||
[]).
filter
(
item
=>
(
item
.
ruleName
||
''
).
indexOf
(
keyword
)
!==-
1
)
}
pagination=
{
false
}
sticky
/>
</
Modal
>
);
}
export
default
ConstraintDetailModal
;
\ No newline at end of file
src/view/Manage/Model/Component/ConstraintDetailModal.less
0 → 100644
View file @
ecc353d7
.constraint-detail-modal {
.yy-table {
max-height: 600px !important;
overflow: auto !important;
}
}
\ No newline at end of file
src/view/Manage/Model/Component/TemplateCURDModal.jsx
View file @
ecc353d7
...
@@ -261,6 +261,7 @@ const TemplateCURDModal = (props) => {
...
@@ -261,6 +261,7 @@ const TemplateCURDModal = (props) => {
rowKey=
{
'id'
}
rowKey=
{
'id'
}
dataSource=
{
templates
||
[]
}
dataSource=
{
templates
||
[]
}
pagination=
{
false
}
pagination=
{
false
}
sticky
/>
/>
</>
</>
}
}
...
...
src/view/Manage/Model/index.jsx
View file @
ecc353d7
...
@@ -6,7 +6,7 @@ import ModelTree from './Component/ModelTree';
...
@@ -6,7 +6,7 @@ import ModelTree from './Component/ModelTree';
import
ModelTable
from
'./Component/ModelTable'
;
import
ModelTable
from
'./Component/ModelTable'
;
import
WordTemplateModal
from
'./Component/WordTemplateModal'
;
import
WordTemplateModal
from
'./Component/WordTemplateModal'
;
import
TemplateCURDModal
from
'./Component/TemplateCURDModal'
;
import
TemplateCURDModal
from
'./Component/TemplateCURDModal'
;
import
ConstraintDetail
from
'./Component/ConstraintDetai
l'
;
import
ConstraintDetail
Modal
from
'./Component/ConstraintDetailModa
l'
;
import
ImportModal
from
'./Component/ImportModal'
;
import
ImportModal
from
'./Component/ImportModal'
;
import
ExportDDLModal
from
'./Component/ExportDDLModal'
;
import
ExportDDLModal
from
'./Component/ExportDDLModal'
;
import
{
showMessage
,
showNotifaction
}
from
'../../../util'
;
import
{
showMessage
,
showNotifaction
}
from
'../../../util'
;
...
@@ -19,6 +19,7 @@ class Model extends React.Component {
...
@@ -19,6 +19,7 @@ class Model extends React.Component {
this
.
state
=
{
this
.
state
=
{
wordTemplateModalVisible
:
false
,
wordTemplateModalVisible
:
false
,
templateCURDModalVisible
:
false
,
templateCURDModalVisible
:
false
,
constraintDetailModalVisible
:
false
,
importModalVisible
:
false
,
importModalVisible
:
false
,
exportDDLModalVisible
:
false
,
exportDDLModalVisible
:
false
,
catalogId
:
''
,
catalogId
:
''
,
...
@@ -87,6 +88,10 @@ class Model extends React.Component {
...
@@ -87,6 +88,10 @@ class Model extends React.Component {
this
.
setState
({
templateCURDModalVisible
:
true
});
this
.
setState
({
templateCURDModalVisible
:
true
});
}
}
onConstraintDetailClick
=
()
=>
{
this
.
setState
({
constraintDetailModalVisible
:
true
});
}
setFilterData
=
()
=>
{
setFilterData
=
()
=>
{
const
{
keyword
,
tableData
}
=
this
.
state
;
const
{
keyword
,
tableData
}
=
this
.
state
;
...
@@ -198,6 +203,10 @@ class Model extends React.Component {
...
@@ -198,6 +203,10 @@ class Model extends React.Component {
refresh
&&
this
.
onTableChange
();
refresh
&&
this
.
onTableChange
();
}
}
onConstraintDetailModalCancel
=
()
=>
{
this
.
setState
({
constraintDetailModalVisible
:
false
});
}
onImportModalCancel
=
(
refresh
=
false
)
=>
{
onImportModalCancel
=
(
refresh
=
false
)
=>
{
this
.
setState
({
importModalVisible
:
false
});
this
.
setState
({
importModalVisible
:
false
});
refresh
&&
this
.
onTableChange
();
refresh
&&
this
.
onTableChange
();
...
@@ -208,7 +217,7 @@ class Model extends React.Component {
...
@@ -208,7 +217,7 @@ class Model extends React.Component {
}
}
render
()
{
render
()
{
const
{
importModalVisible
,
catalogId
,
importModalAction
,
loadingTableData
,
modelerId
,
selectModelerIds
,
keyword
,
filterTableData
,
selectModelerNames
,
importModalAddMode
,
exportErwinLoading
,
exportDDLModalVisible
,
templateCURDModalVisible
,
wordTemplateModalVisible
}
=
this
.
state
;
const
{
importModalVisible
,
catalogId
,
importModalAction
,
loadingTableData
,
modelerId
,
selectModelerIds
,
keyword
,
filterTableData
,
selectModelerNames
,
importModalAddMode
,
exportErwinLoading
,
exportDDLModalVisible
,
templateCURDModalVisible
,
wordTemplateModalVisible
,
constraintDetailModalVisible
}
=
this
.
state
;
return
(
return
(
<
div
style=
{
{
backgroundColor
:
'#ECEEF3'
}
}
>
<
div
style=
{
{
backgroundColor
:
'#ECEEF3'
}
}
>
...
@@ -240,13 +249,7 @@ class Model extends React.Component {
...
@@ -240,13 +249,7 @@ class Model extends React.Component {
<
Space
>
<
Space
>
<
Button
type=
"primary"
onClick=
{
this
.
onWordTemplateCURDClick
}
>
Word模版配置
</
Button
>
<
Button
type=
"primary"
onClick=
{
this
.
onWordTemplateCURDClick
}
>
Word模版配置
</
Button
>
<
Button
type=
"primary"
onClick=
{
this
.
onTemplateCURDClick
}
>
字段追加配置
</
Button
>
<
Button
type=
"primary"
onClick=
{
this
.
onTemplateCURDClick
}
>
字段追加配置
</
Button
>
<
Popover
<
Button
type=
"primary"
onClick=
{
this
.
onConstraintDetailClick
}
>
规范详情
</
Button
>
placement=
"bottomRight"
content=
{
<
ConstraintDetail
/>
}
title=
'规范详情'
trigger=
"hover"
>
<
Button
type=
"primary"
>
规范详情
</
Button
>
</
Popover
>
</
Space
>
</
Space
>
</
div
>
</
div
>
<
div
<
div
...
@@ -286,6 +289,11 @@ class Model extends React.Component {
...
@@ -286,6 +289,11 @@ class Model extends React.Component {
onCancel=
{
this
.
onTemplateCURDModalCancel
}
onCancel=
{
this
.
onTemplateCURDModalCancel
}
/>
/>
<
ConstraintDetailModal
visible=
{
constraintDetailModalVisible
}
onCancel=
{
this
.
onConstraintDetailModalCancel
}
/>
<
ImportModal
<
ImportModal
visible=
{
importModalVisible
}
visible=
{
importModalVisible
}
action=
{
importModalAction
}
action=
{
importModalAction
}
...
...
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