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
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
62 additions
and
38 deletions
+62
-38
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+53
-35
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
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
{
DownOutlined
,
UpOutlined
}
from
'@ant-design/icons'
;
import
SmoothScroll
from
'smooth-scroll'
;
import
SmoothScroll
from
'smooth-scroll'
;
import
classnames
from
'classnames'
;
import
classnames
from
'classnames'
;
...
@@ -19,43 +19,61 @@ const ModelNameColumn = (props) => {
...
@@ -19,43 +19,61 @@ const ModelNameColumn = (props) => {
const
{
text
,
record
,
detailItem
}
=
props
;
const
{
text
,
record
,
detailItem
}
=
props
;
const
[
data
,
setData
]
=
useState
(
record
);
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
>;
let
_textComponent
=
<
span
>
{
text
}
</
span
>;
if
(
data
.
digest
)
{
if
(
data
.
digest
)
{
_textComponent
=
<
Descriptions
className=
'model-table-descritpion'
column=
{
1
}
size=
'small'
>
_textComponent
=
<
div
style=
{
{
width
:
400
,
maxHeight
:
600
,
overflow
:
'auto'
}
}
>
<
Descriptions
.
Item
label=
'模型名称'
>
<
Descriptions
className=
'model-digest-descritpion'
column=
{
2
}
size=
'small'
>
{
data
.
digest
.
name
||
''
}
<
Descriptions
.
Item
label=
'模型名称'
>
</
Descriptions
.
Item
>
{
data
.
digest
.
name
||
''
}
<
Descriptions
.
Item
label=
'中文名称'
>
</
Descriptions
.
Item
>
{
data
.
digest
.
cnName
||
''
}
<
Descriptions
.
Item
label=
'中文名称'
>
</
Descriptions
.
Item
>
{
data
.
digest
.
cnName
||
''
}
<
Descriptions
.
Item
label=
'描述'
>
</
Descriptions
.
Item
>
{
data
.
digest
.
remark
||
''
}
<
Descriptions
.
Item
label=
'描述'
>
</
Descriptions
.
Item
>
{
data
.
digest
.
remark
||
''
}
<
Descriptions
.
Item
label=
'字段'
>
</
Descriptions
.
Item
>
{
</
Descriptions
>
(
data
.
digest
.
attributeDigests
||
[]).
map
((
item
,
index
)
=>
{
<
Table
if
(
index
>
9
)
return
null
;
className=
'mt-2'
return
(
dataSource=
{
data
.
digest
.
attributeDigests
||
[]
}
<
React
.
Fragment
key=
{
index
}
>
columns=
{
cols
}
{
(
index
>
0
)
&&
<
br
/>
}
loading=
{
false
}
{
`${item.name||''} ${item.cnName||''}`
}
pagination=
{
false
}
</
React
.
Fragment
>
size=
'small'
)
/>
})
</
div
>
}
{
(
data
.
digest
.
attributeDigests
||
[]).
length
>
10
&&
<
React
.
Fragment
>
<
br
/>
...
</
React
.
Fragment
>
}
</
Descriptions
.
Item
>
</
Descriptions
>
}
}
return
(
return
(
<
Tooltip
<
Popover
title=
{
_textComponent
}
content=
{
_textComponent
}
overlayClassName=
'model-digest-popover'
onVisibleChange=
{
(
visible
)
=>
{
onVisibleChange=
{
(
visible
)
=>
{
if
(
visible
&&
!
record
.
digest
)
{
if
(
visible
&&
!
record
.
digest
)
{
dispatch
({
dispatch
({
...
@@ -74,7 +92,7 @@ const ModelNameColumn = (props) => {
...
@@ -74,7 +92,7 @@ const ModelNameColumn = (props) => {
<
a
onClick=
{
()
=>
{
detailItem
(
record
);}
}
>
<
a
onClick=
{
()
=>
{
detailItem
(
record
);}
}
>
{
text
||
''
}
{
text
||
''
}
</
a
>
</
a
>
</
Tooltip
>
</
Popover
>
);
);
}
}
...
@@ -623,7 +641,7 @@ const ModelTable = (props) => {
...
@@ -623,7 +641,7 @@ const ModelTable = (props) => {
onResize=
{
({
width
})
=>
{
onResize=
{
({
width
})
=>
{
if
(
tableWidth
!==
width
)
{
if
(
tableWidth
!==
width
)
{
setTableWidth
(
width
);
setTableWidth
(
width
);
let
newColumns
=
[...
cols
];
let
newColumns
=
[...
cols
];
if
((
modelId
||
''
)
!==
''
)
{
if
((
modelId
||
''
)
!==
''
)
{
...
...
src/view/Manage/Model/Component/ModelTable.less
View file @
0d6fb11e
...
@@ -30,14 +30,20 @@
...
@@ -30,14 +30,20 @@
}
}
}
}
.model-
table
-descritpion {
.model-
digest
-descritpion {
.yy-descriptions-row > td {
.yy-descriptions-row > td {
padding-bottom: 0px !important;
padding-bottom: 0px !important;
}
}
}
.yy-descriptions-item-label, .yy-descriptions-item-content {
.model-digest-popover {
color: #fff !important;
.yy-popover-inner-content {
padding: 8px !important;
}
}
.yy-table-thead > tr > th, .yy-table-tbody > tr > td {
font-size: 13px !important;
}
}
}
.excel-copy-descritpion {
.excel-copy-descritpion {
...
...
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