From fe6e1933a07f07607cb0095cb18a7971d0df7c67 Mon Sep 17 00:00:00 2001 From: Your Nmae Date: Wed, 17 Jan 2024 12:19:04 +0800 Subject: [PATCH] temp --- src/components/visualize/Home.tsx | 111 ++++++++++++++++++++- src/components/visualize/TrailwayRoute.tsx | 16 ++- 2 files changed, 124 insertions(+), 3 deletions(-) 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 ( + + + + F1    进站人数:74   出站人数:53 + + + F2    进站人数:34   出站人数:62 + + + F3    进站人数:72   出站人数:33 + + + F4    进站人数:45   出站人数:64 + + + F5    进站人数:46   出站人数:81 + + + F6    进站人数:70   出站人数:34 + + + F7    进站人数:74   出站人数:12 + + + FS8    进站人数:271    换乘人数:824 + + + F9    进站人数:126    出站人数:89 + + + FT10   进站人数:358    换乘人数:1054 + + + F11   进站人数:56   出站人数:86 + + + F12   进站人数:76   出站人数:23 + + + F13   进站人数:34   出站人数:35 + + + F14   进站人数:12   出站人数:39 + + + F15   进站人数:59   出站人数:32 + + + F16   进站人数:46   出站人数:87 + + + F17   进站人数:34   出站人数:54 + + + F18   进站人数:76   出站人数:59 + + + + Option 5 + Option 6 + + Option 7 + Option 8 + + + + Option 9 + Option 10 + Option 11 + Option 12 + + + ); +}; 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',