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
0d6fb11e
Commit
0d6fb11e
authored
Jan 24, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型简介样式修改
parent
789ff5fd
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
27 deletions
+51
-27
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+42
-24
ModelTable.less
src/view/Manage/Model/Component/ModelTable.less
+9
-3
No files found.
src/view/Manage/Model/Component/ModelTable.jsx
View file @
0d6fb11e
import
React
,
{
useState
,
useEffect
,
useRef
}
from
"react"
;
import
{
Tooltip
,
Modal
,
Pagination
,
Table
,
Descriptions
}
from
'antd'
;
import
{
Tooltip
,
Modal
,
Pagination
,
Table
,
Descriptions
,
Popover
}
from
'antd'
;
import
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
SmoothScroll
from
'smooth-scroll'
;
import
classnames
from
'classnames'
;
...
...
@@ -19,9 +19,36 @@ const ModelNameColumn = (props) => {
const
{
text
,
record
,
detailItem
}
=
props
;
const
[
data
,
setData
]
=
useState
(
record
);
const
cols
=
[
{
title
:
'序号'
,
dataIndex
:
'key'
,
render
:
(
text
,
record
,
index
)
=>
{
return
(
index
+
1
).
toString
();
},
width
:
60
,
ellipsis
:
true
,
},
{
title
:
'字段中文名称'
,
width
:
160
,
dataIndex
:
'cnName'
,
editable
:
true
,
ellipsis
:
true
,
},
{
title
:
'字段英文名称'
,
width
:
160
,
dataIndex
:
'name'
,
editable
:
true
,
ellipsis
:
true
,
},
];
let
_textComponent
=
<
span
>
{
text
}
</
span
>;
if
(
data
.
digest
)
{
_textComponent
=
<
Descriptions
className=
'model-table-descritpion'
column=
{
1
}
size=
'small'
>
_textComponent
=
<
div
style=
{
{
width
:
400
,
maxHeight
:
600
,
overflow
:
'auto'
}
}
>
<
Descriptions
className=
'model-digest-descritpion'
column=
{
2
}
size=
'small'
>
<
Descriptions
.
Item
label=
'模型名称'
>
{
data
.
digest
.
name
||
''
}
</
Descriptions
.
Item
>
...
...
@@ -31,31 +58,22 @@ const ModelNameColumn = (props) => {
<
Descriptions
.
Item
label=
'描述'
>
{
data
.
digest
.
remark
||
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'字段'
>
{
(
data
.
digest
.
attributeDigests
||
[]).
map
((
item
,
index
)
=>
{
if
(
index
>
9
)
return
null
;
return
(
<
React
.
Fragment
key=
{
index
}
>
{
(
index
>
0
)
&&
<
br
/>
}
{
`${item.name||''} ${item.cnName||''}`
}
</
React
.
Fragment
>
)
})
}
{
(
data
.
digest
.
attributeDigests
||
[]).
length
>
10
&&
<
React
.
Fragment
>
<
br
/>
...
</
React
.
Fragment
>
}
</
Descriptions
.
Item
>
</
Descriptions
>
<
Table
className=
'mt-2'
dataSource=
{
data
.
digest
.
attributeDigests
||
[]
}
columns=
{
cols
}
loading=
{
false
}
pagination=
{
false
}
size=
'small'
/>
</
div
>
}
return
(
<
Tooltip
title=
{
_textComponent
}
<
Popover
content=
{
_textComponent
}
overlayClassName=
'model-digest-popover'
onVisibleChange=
{
(
visible
)
=>
{
if
(
visible
&&
!
record
.
digest
)
{
dispatch
({
...
...
@@ -74,7 +92,7 @@ const ModelNameColumn = (props) => {
<
a
onClick=
{
()
=>
{
detailItem
(
record
);}
}
>
{
text
||
''
}
</
a
>
</
Tooltip
>
</
Popover
>
);
}
...
...
src/view/Manage/Model/Component/ModelTable.less
View file @
0d6fb11e
...
...
@@ -30,13 +30,19 @@
}
}
.model-
table
-descritpion {
.model-
digest
-descritpion {
.yy-descriptions-row > td {
padding-bottom: 0px !important;
}
}
.model-digest-popover {
.yy-popover-inner-content {
padding: 8px !important;
}
.yy-
descriptions-item-label, .yy-descriptions-item-content
{
color: #fff
!important;
.yy-
table-thead > tr > th, .yy-table-tbody > tr > td
{
font-size: 13px
!important;
}
}
...
...
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