|
|
@ -11,12 +11,15 @@ import { fixedZero } from '../../utils/utils'; |
|
|
|
|
|
|
|
|
import styles from './Monitor.less'; |
|
|
import styles from './Monitor.less'; |
|
|
|
|
|
|
|
|
const activeData = []; |
|
|
function getActiveData() { |
|
|
for (let i = 0; i < 24; i += 1) { |
|
|
const activeData = []; |
|
|
activeData.push({ |
|
|
for (let i = 0; i < 24; i += 1) { |
|
|
x: `${fixedZero(i)}:00`, |
|
|
activeData.push({ |
|
|
y: (i * 50) + (Math.floor(Math.random() * 200)), |
|
|
x: `${fixedZero(i)}:00`, |
|
|
}); |
|
|
y: (i * 50) + (Math.floor(Math.random() * 200)), |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
return activeData; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const MapData = []; |
|
|
const MapData = []; |
|
|
@ -33,13 +36,23 @@ const targetTime = new Date().getTime() + 3900000; |
|
|
monitor: state.monitor, |
|
|
monitor: state.monitor, |
|
|
})) |
|
|
})) |
|
|
export default class Monitor extends PureComponent { |
|
|
export default class Monitor extends PureComponent { |
|
|
|
|
|
state = { |
|
|
|
|
|
activeData: getActiveData(), |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
componentDidMount() { |
|
|
componentDidMount() { |
|
|
this.props.dispatch({ |
|
|
this.props.dispatch({ |
|
|
type: 'monitor/fetchTags', |
|
|
type: 'monitor/fetchTags', |
|
|
}); |
|
|
}); |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setInterval(() => { |
|
|
|
|
|
this.setState({ |
|
|
|
|
|
activeData: getActiveData(), |
|
|
|
|
|
}); |
|
|
|
|
|
}, 1000); |
|
|
|
|
|
} |
|
|
render() { |
|
|
render() { |
|
|
|
|
|
const { activeData = [] } = this.state; |
|
|
const { monitor } = this.props; |
|
|
const { monitor } = this.props; |
|
|
const { tags } = monitor; |
|
|
const { tags } = monitor; |
|
|
|
|
|
|
|
|
@ -90,6 +103,7 @@ export default class Monitor extends PureComponent { |
|
|
/> |
|
|
/> |
|
|
<div style={{ marginTop: 32 }}> |
|
|
<div style={{ marginTop: 32 }}> |
|
|
<MiniArea |
|
|
<MiniArea |
|
|
|
|
|
animate={false} |
|
|
line |
|
|
line |
|
|
color="#5DD1DD" |
|
|
color="#5DD1DD" |
|
|
height={84} |
|
|
height={84} |
|
|
@ -129,7 +143,7 @@ export default class Monitor extends PureComponent { |
|
|
bordered={false} |
|
|
bordered={false} |
|
|
> |
|
|
> |
|
|
<Gauge |
|
|
<Gauge |
|
|
title="跳出率" |
|
|
title="核销率" |
|
|
height={164} |
|
|
height={164} |
|
|
percent={87} |
|
|
percent={87} |
|
|
/> |
|
|
/> |
|
|
@ -143,7 +157,7 @@ export default class Monitor extends PureComponent { |
|
|
style={{ marginBottom: 24 }} |
|
|
style={{ marginBottom: 24 }} |
|
|
bordered={false} |
|
|
bordered={false} |
|
|
> |
|
|
> |
|
|
<Row style={{ padding: '18px 0 19px 0' }}> |
|
|
<Row gutter={4} style={{ padding: '18px 0 19px 0' }}> |
|
|
<Col span={8}> |
|
|
<Col span={8}> |
|
|
<Pie |
|
|
<Pie |
|
|
percent={28} |
|
|
percent={28} |
|
|
@ -174,7 +188,7 @@ export default class Monitor extends PureComponent { |
|
|
</Card> |
|
|
</Card> |
|
|
</Col> |
|
|
</Col> |
|
|
<Col sm={8} xs={24} style={{ marginBottom: 24 }}> |
|
|
<Col sm={8} xs={24} style={{ marginBottom: 24 }}> |
|
|
<Card title="热门搜索" bordered={false}> |
|
|
<Card title="热门搜索" bordered={false} bodyStyle={{ height: 214 }}> |
|
|
<TagCloud |
|
|
<TagCloud |
|
|
data={tags} |
|
|
data={tags} |
|
|
height={161} |
|
|
height={161} |
|
|
|