Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
914cc1fe
"vscode:/vscode.git/clone" did not exist on "34e0883db09c4a66827126aeac5cf0dd66b5f1ef"
Unverified
Commit
914cc1fe
authored
Feb 18, 2020
by
Lijiao
Committed by
GitHub
Feb 18, 2020
Browse files
fix bug of dict column list (#2076)
parent
ebcd6024
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
+6
-12
src/webui/src/components/trial-detail/TableList.tsx
src/webui/src/components/trial-detail/TableList.tsx
+6
-12
No files found.
src/webui/src/components/trial-detail/TableList.tsx
View file @
914cc1fe
...
@@ -527,20 +527,10 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -527,20 +527,10 @@ class TableList extends React.Component<TableListProps, TableListState> {
minWidth
:
100
,
minWidth
:
100
,
onRender
:
(
record
:
TableRecord
)
=>
{
onRender
:
(
record
:
TableRecord
)
=>
{
const
accDictionary
=
record
.
accDictionary
;
const
accDictionary
=
record
.
accDictionary
;
let
decimals
=
0
;
let
other
=
''
;
let
other
=
''
;
if
(
accDictionary
!==
undefined
)
{
if
(
accDictionary
!==
undefined
)
{
if
(
accDictionary
[
item
].
toString
().
indexOf
(
'
.
'
)
!==
-
1
)
{
decimals
=
accDictionary
[
item
].
toString
().
length
-
accDictionary
[
item
].
toString
().
indexOf
(
'
.
'
)
-
1
;
if
(
decimals
>
6
)
{
other
=
`
${
accDictionary
[
item
].
toFixed
(
6
)}
`
;
}
else
{
other
=
accDictionary
[
item
].
toString
();
other
=
accDictionary
[
item
].
toString
();
}
}
}
}
else
{
other
=
'
--
'
;
}
return
(
return
(
<
div
>
{
other
}
</
div
>
<
div
>
{
other
}
</
div
>
);
);
...
@@ -557,7 +547,11 @@ class TableList extends React.Component<TableListProps, TableListState> {
...
@@ -557,7 +547,11 @@ class TableList extends React.Component<TableListProps, TableListState> {
UNSAFE_componentWillReceiveProps
(
nextProps
:
TableListProps
):
void
{
UNSAFE_componentWillReceiveProps
(
nextProps
:
TableListProps
):
void
{
const
{
columnList
,
tableSource
}
=
nextProps
;
const
{
columnList
,
tableSource
}
=
nextProps
;
this
.
setState
({
tableSourceForSort
:
tableSource
,
tableColumns
:
this
.
initTableColumnList
(
columnList
)
});
this
.
setState
({
tableSourceForSort
:
tableSource
,
tableColumns
:
this
.
initTableColumnList
(
columnList
),
allColumnList
:
this
.
getAllColumnKeys
()
});
}
}
render
():
React
.
ReactNode
{
render
():
React
.
ReactNode
{
...
...
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