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
88c939b5
Commit
88c939b5
authored
Jan 12, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型列表上鼠标移动到某个模型,浮窗显示该模型的结构
parent
e89086ec
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
72 additions
and
3 deletions
+72
-3
datamodel.js
src/model/datamodel.js
+4
-0
datamodeler.js
src/service/datamodeler.js
+4
-0
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+53
-3
ModelTable.less
src/view/Manage/Model/Component/ModelTable.less
+11
-0
No files found.
src/model/datamodel.js
View file @
88c939b5
...
@@ -262,6 +262,10 @@ export function* getDataModelByVersionId(payload) {
...
@@ -262,6 +262,10 @@ export function* getDataModelByVersionId(payload) {
return
yield
call
(
datamodelerService
.
getDataModelByVersionId
,
payload
);
return
yield
call
(
datamodelerService
.
getDataModelByVersionId
,
payload
);
}
}
export
function
*
getDataModelDigest
(
payload
)
{
return
yield
call
(
datamodelerService
.
getDataModelDigest
,
payload
);
}
export
function
*
isSetRootDomainId
()
{
export
function
*
isSetRootDomainId
()
{
return
yield
call
(
datamodelerService
.
isSetRootDomainId
);
return
yield
call
(
datamodelerService
.
isSetRootDomainId
);
}
}
...
...
src/service/datamodeler.js
View file @
88c939b5
...
@@ -153,6 +153,10 @@ export function getDataModelByVersionId(payload) {
...
@@ -153,6 +153,10 @@ export function getDataModelByVersionId(payload) {
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/getDataModelByVersionId"
,
payload
);
return
PostJSON
(
"/datamodeler/easyDataModelerCURD/getDataModelByVersionId"
,
payload
);
}
}
export
function
getDataModelDigest
(
payload
)
{
return
GetJSON
(
"/datamodeler/easyDataModelerCURD/getDataModelDigest"
,
payload
);
}
export
function
isSetRootDomainId
()
{
export
function
isSetRootDomainId
()
{
return
Get
(
"/datamodeler/easyDataModelerCURD/isSetRootDomainId"
);
return
Get
(
"/datamodeler/easyDataModelerCURD/isSetRootDomainId"
);
}
}
...
...
src/view/Manage/Model/Component/ModelTable.jsx
View file @
88c939b5
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
{
Button
,
Tooltip
,
Modal
,
Pagination
,
Table
,
Dropdown
,
Menu
,
Divider
}
from
'antd'
;
import
{
Button
,
Tooltip
,
Modal
,
Pagination
,
Table
,
Dropdown
,
Menu
,
Divider
,
Descriptions
}
from
'antd'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
SmoothScroll
from
'smooth-scroll'
;
import
SmoothScroll
from
'smooth-scroll'
;
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
...
@@ -84,9 +84,59 @@ const ModelTable = (props) => {
...
@@ -84,9 +84,59 @@ const ModelTable = (props) => {
ellipsis
:
true
,
ellipsis
:
true
,
sorter
:
true
,
sorter
:
true
,
sortDirections
:
[
'ascend'
,
'descend'
],
sortDirections
:
[
'ascend'
,
'descend'
],
render
:
(
text
,
record
,
_
)
=>
{
onCell
:
(
record
,
rowIndex
)
=>
{
if
(
!
record
.
digest
)
{
dispatch
({
type
:
'datamodel.getDataModelDigest'
,
payload
:
{
id
:
record
.
id
},
callback
:
_data
=>
{
record
.
digest
=
_data
;
}
})
}
},
render
:
(
text
,
record
,
index
)
=>
{
let
_textComponent
=
<
span
>
{
text
}
</
span
>;
if
(
record
.
digest
)
{
_textComponent
=
<
Descriptions
className=
'model-table-descritpion'
column=
{
1
}
size=
'small'
>
<
Descriptions
.
Item
label=
'模型名称'
>
{
record
.
digest
.
name
||
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'中文名称'
>
{
record
.
digest
.
cnName
||
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'描述'
>
{
record
.
digest
.
remark
||
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'字段'
>
{
(
record
.
digest
.
attributeDigests
||
[]).
map
((
item
,
index
)
=>
{
if
(
index
>
9
)
return
null
;
return
(
<
React
.
Fragment
key=
{
index
}
>
{
(
index
>
0
)
&&
<
br
/>
}
{
`${item.name||''} ${item.cnName||''}`
}
</
React
.
Fragment
>
)
})
}
{
(
record
.
digest
.
attributeDigests
||
[]).
length
>
10
&&
<
React
.
Fragment
>
<
br
/>
...
</
React
.
Fragment
>
}
</
Descriptions
.
Item
>
</
Descriptions
>
}
return
(
return
(
<
Tooltip
title=
{
text
||
''
}
>
<
Tooltip
title=
{
_textComponent
}
>
<
a
onClick=
{
()
=>
{
detailItem
(
record
);}
}
>
<
a
onClick=
{
()
=>
{
detailItem
(
record
);}
}
>
{
text
||
''
}
{
text
||
''
}
</
a
>
</
a
>
...
...
src/view/Manage/Model/Component/ModelTable.less
View file @
88c939b5
...
@@ -28,4 +28,14 @@
...
@@ -28,4 +28,14 @@
.yy-table-tbody > tr > td {
.yy-table-tbody > tr > td {
padding: 8px 8px !important;
padding: 8px 8px !important;
}
}
}
.model-table-descritpion {
.yy-descriptions-row > td {
padding-bottom: 0px !important;
}
.yy-descriptions-item-label, .yy-descriptions-item-content {
color: #fff !important;
}
}
}
\ No newline at end of file
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