Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
Nightingale
提交
7003e3a0
N
Nightingale
项目概览
jobily
/
Nightingale
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
Nightingale
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7003e3a0
编写于
6月 17, 2020
作者:
J
jsers
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix: graph legend is not available
上级
fc023fd8
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
18 deletion
+18
-18
web/src/components/Graph/Graph/Legend.tsx
web/src/components/Graph/Graph/Legend.tsx
+11
-10
web/src/components/Graph/Graph/index.tsx
web/src/components/Graph/Graph/index.tsx
+3
-5
web/src/components/Graph/util/normalizeSeries.tsx
web/src/components/Graph/util/normalizeSeries.tsx
+4
-3
未找到文件。
web/src/components/Graph/Graph/Legend.tsx
浏览文件 @
7003e3a0
...
...
@@ -3,7 +3,7 @@ import { Table, Input, Button, Modal } from 'antd';
import
{
ColumnProps
,
TableRowSelection
}
from
'
antd/es/table
'
;
import
Color
from
'
color
'
;
import
_
from
'
lodash
'
;
import
{
injectIntl
}
from
'
react-intl
'
;
import
{
injectIntl
,
WrappedComponentProps
}
from
'
react-intl
'
;
import
clipboard
from
'
@common/clipboard
'
;
import
ContextMenu
from
'
@cpts/ContextMenu
'
;
import
{
SerieInterface
,
PointInterface
}
from
'
../interface
'
;
...
...
@@ -13,7 +13,8 @@ type SelectedKeys = 'normal' | string[];
interface
Props
{
style
:
any
,
series
:
SerieInterface
[],
onSelectedChange
:
(
selectedKeys
:
string
|
string
[],
highlightedKeysClone
:
string
[])
=>
void
,
comparisonOptions
:
any
[],
onSelectedChange
:
(
selectedKeys
:
string
[],
highlightedKeysClone
:
string
[])
=>
void
,
}
interface
State
{
...
...
@@ -36,7 +37,7 @@ interface LegendDataItem extends SerieInterface {
last
:
number
|
null
,
}
class
Legend
extends
Component
<
Props
,
State
>
{
class
Legend
extends
Component
<
Props
&
WrappedComponentProps
,
State
>
{
static
defaultProps
=
{
style
:
{},
series
:
[],
...
...
@@ -111,7 +112,7 @@ class Legend extends Component<Props, State> {
}
this
.
setState
({
highlightedKeys
:
highlightedKeysClone
},
()
=>
{
this
.
props
.
onSelectedChange
(
selectedKeys
,
highlightedKeysClone
);
this
.
props
.
onSelectedChange
(
selectedKeys
as
string
[]
,
highlightedKeysClone
);
});
}
...
...
@@ -129,7 +130,7 @@ class Legend extends Component<Props, State> {
const
{
comparisonOptions
,
onSelectedChange
}
=
this
.
props
;
const
{
searchText
,
selectedKeys
,
highlightedKeys
}
=
this
.
state
;
const
counterSelectedKeys
=
highlightedKeys
;
const
data
=
this
.
filterData
();
const
data
=
this
.
filterData
()
as
any
;
const
firstData
=
data
[
0
];
const
columns
:
ColumnProps
<
LegendDataItem
>
[]
=
[
{
...
...
@@ -216,9 +217,9 @@ class Legend extends Component<Props, State> {
const
newRowSelection
:
TableRowSelection
<
LegendDataItem
>
=
{
selectedRowKeys
:
selectedKeys
===
'
normal
'
?
_
.
map
(
data
,
o
=>
o
.
id
)
:
selectedKeys
,
onChange
:
(
selectedRowKeys
:
string
[])
=>
{
this
.
setState
({
selectedKeys
:
selectedRowKeys
},
()
=>
{
onSelectedChange
(
selectedRowKeys
,
highlightedKeys
);
onChange
:
(
selectedRowKeys
:
(
string
|
number
)
[])
=>
{
this
.
setState
({
selectedKeys
:
selectedRowKeys
as
string
[]
},
()
=>
{
onSelectedChange
(
selectedRowKeys
as
string
[]
,
highlightedKeys
);
});
},
};
...
...
@@ -238,11 +239,11 @@ class Legend extends Component<Props, State> {
margin
:
'
0 5px 5px 5px
'
,
}
}
>
<
Table
rowKey
=
{
record
=>
`
${
record
.
id
}
-
${
record
.
comparison
}
`
}
rowKey
=
{
record
=>
record
.
id
}
size
=
"middle"
rowSelection
=
{
newRowSelection
}
columns
=
{
columns
}
dataSource
=
{
data
}
dataSource
=
{
data
as
any
}
pagination
=
{
false
}
scroll
=
{
{
y
:
220
}
}
/>
...
...
web/src/components/Graph/Graph/index.tsx
浏览文件 @
7003e3a0
...
...
@@ -305,9 +305,9 @@ export default class Graph extends Component<Props, State> {
}
handleLegendRowSelectedChange
=
(
selectedKeys
:
string
[],
highlightedKeys
:
string
[])
=>
{
const
{
series
}
=
this
.
state
;
const
series
=
this
.
getZoomedSeries
()
const
newS
eries
=
_
.
map
(
series
,
(
serie
,
i
)
=>
{
this
.
s
eries
=
_
.
map
(
series
,
(
serie
,
i
)
=>
{
const
oldColor
=
_
.
get
(
serie
,
'
oldColor
'
,
serie
.
color
);
return
{
...
serie
,
...
...
@@ -318,9 +318,7 @@ export default class Graph extends Component<Props, State> {
};
});
this
.
setState
({
series
:
newSeries
},
()
=>
{
this
.
updateHighcharts
();
});
this
.
updateHighcharts
();
}
render
()
{
...
...
web/src/components/Graph/util/normalizeSeries.tsx
浏览文件 @
7003e3a0
...
...
@@ -16,11 +16,12 @@ export default function normalizeSeries(data: any[], graphConfig: GraphDataInter
counter
=
`,
${
o
.
counter
.
substring
(
o
.
counter
.
indexOf
(
'
/
'
)
+
1
)}
`
;
}
const
id
=
`
${
endpoint
}${
counter
}
`
;
const
id
=
`
${
endpoint
}${
counter
}
-
${
comparison
}
`
;
const
name
=
`
${
endpoint
}${
counter
}
`
;
const
serie
=
{
id
,
name
:
id
,
tags
:
id
,
name
:
name
,
tags
:
name
,
data
:
o
.
values
,
lineWidth
:
2
,
color
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录