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
1c2271d8
Commit
1c2271d8
authored
Jan 12, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模型显示摘要
parent
a7ffe555
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
64 additions
and
57 deletions
+64
-57
ModelTable.jsx
src/view/Manage/Model/Component/ModelTable.jsx
+64
-57
No files found.
src/view/Manage/Model/Component/ModelTable.jsx
View file @
1c2271d8
...
@@ -12,6 +12,69 @@ import { AnchorId, AnchorTimestamp, Action, CatalogId, ModelerId } from '../../.
...
@@ -12,6 +12,69 @@ import { AnchorId, AnchorTimestamp, Action, CatalogId, ModelerId } from '../../.
import
'./ModelTable.less'
;
import
'./ModelTable.less'
;
const
ModelNameColumn
=
(
props
)
=>
{
const
{
text
,
record
,
detailItem
}
=
props
;
const
[
data
,
setData
]
=
useState
(
record
);
let
_textComponent
=
<
span
>
{
text
}
</
span
>;
if
(
data
.
digest
)
{
_textComponent
=
<
Descriptions
className=
'model-table-descritpion'
column=
{
1
}
size=
'small'
>
<
Descriptions
.
Item
label=
'模型名称'
>
{
data
.
digest
.
name
||
''
}
</
Descriptions
.
Item
>
<
Descriptions
.
Item
label=
'中文名称'
>
{
data
.
digest
.
cnName
||
''
}
</
Descriptions
.
Item
>
<
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
>
}
return
(
<
Tooltip
title=
{
_textComponent
}
onVisibleChange=
{
(
visible
)
=>
{
if
(
visible
&&
!
record
.
digest
)
{
dispatch
({
type
:
'datamodel.getDataModelDigest'
,
payload
:
{
id
:
record
.
id
},
callback
:
_data
=>
{
record
.
digest
=
_data
;
setData
({...
record
});
}
})
}
}
}
>
<
a
onClick=
{
()
=>
{
detailItem
(
record
);}
}
>
{
text
||
''
}
</
a
>
</
Tooltip
>
);
}
const
ResizeableHeaderCell
=
props
=>
{
const
ResizeableHeaderCell
=
props
=>
{
const
{
onResize
,
width
,
onClick
,
...
restProps
}
=
props
;
const
{
onResize
,
width
,
onClick
,
...
restProps
}
=
props
;
...
@@ -99,64 +162,8 @@ const ModelTable = (props) => {
...
@@ -99,64 +162,8 @@ const ModelTable = (props) => {
ellipsis
:
true
,
ellipsis
:
true
,
sorter
:
true
,
sorter
:
true
,
sortDirections
:
[
'ascend'
,
'descend'
],
sortDirections
:
[
'ascend'
,
'descend'
],
onCell
:
(
record
,
rowIndex
)
=>
{
// if (!record.digest) {
// dispatch({
// type: 'datamodel.getDataModelDigest',
// payload: {
// id: record.id
// },
// callback: _data => {
// record.digest = _data;
// }
// })
// }
},
render
:
(
text
,
record
,
index
)
=>
{
render
:
(
text
,
record
,
index
)
=>
{
return
(<
ModelNameColumn
text=
{
text
}
record=
{
record
}
detailItem=
{
detailItem
}
/>);
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
(
<
Tooltip
title=
{
_textComponent
}
>
<
a
onClick=
{
()
=>
{
detailItem
(
record
);}
}
>
{
text
||
''
}
</
a
>
</
Tooltip
>
);
}
}
},
},
{
{
...
...
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