diff --git a/src/components/visualize/Home.tsx b/src/components/visualize/Home.tsx
index 86cecac..087628a 100644
--- a/src/components/visualize/Home.tsx
+++ b/src/components/visualize/Home.tsx
@@ -1,22 +1,129 @@
/**
* Created by hao.cheng on 2017/4/17.
*/
+
import React from 'react';
-import { Row, Col, Card } from 'antd';
+import { Row, Col, Card, Menu } from 'antd';
+import type { MenuProps } from 'antd/lib/menu';
import TrailwayRoute from './TrailwayRoute';
+import { AppstoreOutlined, MailOutlined, SettingOutlined } from '@ant-design/icons';
+
+const { SubMenu } = Menu;
+
+const rootSubmenuKeys = ['sub1', 'sub2', 'sub4'];
+const Sider = () => {
+ const [openKeys, setOpenKeys] = React.useState(['sub1']);
+ const onOpenChange = (keys: any) => {
+ const latestOpenKey = keys.find((key: any) => openKeys.indexOf(key) === -1);
+ if (rootSubmenuKeys.indexOf(latestOpenKey) === -1) {
+ setOpenKeys(keys);
+ } else {
+ setOpenKeys(latestOpenKey ? [latestOpenKey] : []);
+ }
+ };
+
+ return (
+
+ );
+};
class Echarts extends React.Component {
render() {
return (
);
diff --git a/src/components/visualize/TrailwayRoute.tsx b/src/components/visualize/TrailwayRoute.tsx
index e4ae711..eb42860 100644
--- a/src/components/visualize/TrailwayRoute.tsx
+++ b/src/components/visualize/TrailwayRoute.tsx
@@ -39,6 +39,8 @@ var stations = [
y: -800,
itemStyle: { borderColor: '#EE1822', color: 'white' },
category: '1号线',
+ value1: 400,
+ value2: '出站人数:200',
},
{
name: 'F2',
@@ -167,6 +169,8 @@ var stations = [
y: -800,
itemStyle: { borderColor: '#FDD303', color: 'white' },
category: '2号线',
+ value1: 271,
+ value2: '换乘人数:824',
},
{
name: 'S8',
@@ -465,7 +469,17 @@ const option = {
text: '地铁示意图',
},
color: ['#EE1822', '#FDD303', '#00b2ff'],
- tooltip: {},
+ tooltip: {
+ trigger: 'item',
+ formatter: function (params: any) {
+ var result = '';
+ console.log(params);
+ result += '站点名: ' + params.data.name + '
';
+ result += '进站人数:' + params.data.value1 + '
';
+ result += params.data.value2 + '
';
+ return result;
+ },
+ },
legend: legend,
animationDurationUpdate: 1500,
animationEasingUpdate: 'quinticInOut',