diff --git a/config/router.config.ts b/config/router.config.ts index 46b1726..c1f53cd 100644 --- a/config/router.config.ts +++ b/config/router.config.ts @@ -47,6 +47,16 @@ export default [ path: '/401', component: './401', }, + { + path: '/MonitorScreen', + routes: [ + { + name: 'Home', + path: '/MonitorScreen/Home', + component: './MonitorScreen/Home', + }, + ], + }, diff --git a/src/assets/screen/title_bg.png b/src/assets/screen/title_bg.png new file mode 100644 index 0000000..d4f9626 Binary files /dev/null and b/src/assets/screen/title_bg.png differ diff --git a/src/assets/screen/top_bg.png b/src/assets/screen/top_bg.png new file mode 100644 index 0000000..1ee87ed Binary files /dev/null and b/src/assets/screen/top_bg.png differ diff --git a/src/assets/screen/warn_icon_01.png b/src/assets/screen/warn_icon_01.png new file mode 100644 index 0000000..7555e57 Binary files /dev/null and b/src/assets/screen/warn_icon_01.png differ diff --git a/src/assets/screen/warn_icon_02.png b/src/assets/screen/warn_icon_02.png new file mode 100644 index 0000000..57bf375 Binary files /dev/null and b/src/assets/screen/warn_icon_02.png differ diff --git a/src/pages/MonitorScreen/Home/index.tsx b/src/pages/MonitorScreen/Home/index.tsx new file mode 100644 index 0000000..1e3a04d --- /dev/null +++ b/src/pages/MonitorScreen/Home/index.tsx @@ -0,0 +1,396 @@ +import { Col, Descriptions, Radio, Row, Table } from 'antd'; +import React, { useEffect, useRef, useState } from 'react'; +import './style.less'; +import * as echarts from 'echarts'; +import warn_icon_01 from '@/assets/screen/warn_icon_01.png' +import warn_icon_02 from '@/assets/screen/warn_icon_02.png' +import moment from 'moment'; + +const onCell = (_: any, rowIndex: any) => ({ className: rowIndex % 2 == 0 ? "screen-table-odd-content" : "screen-table-even-content", }); +const onHeaderCell = () => ({ className: "screen-table-header", }); + +const evalColumn: any[] = [ + { + title: '项目名称', + dataIndex: 'name', + key: 'name', + ellipsis: true, + onCell, + onHeaderCell, + }, + { + title: '时间', + dataIndex: 'time', + key: 'time', + align: 'center', + onCell, + onHeaderCell, + }, + { + title: '所属单位', + dataIndex: 'unit', + key: 'unit', + align: 'center', + ellipsis: true, + onCell, + onHeaderCell, + }, + { + title: '评标地点', + dataIndex: 'place', + key: 'place', + align: 'center', + ellipsis: true, + onCell, + onHeaderCell, + }, + { + title: '专家人数', + dataIndex: 'number', + key: 'number', + align: 'center', + onCell, + onHeaderCell, + }, +]; +const todayEvalColumn: any[] = [ + { + title: '项目名称', + dataIndex: 'name', + key: 'name', + ellipsis: true, + width: '20%', + onCell, + onHeaderCell, + }, + { + title: '中标供应商名称', + dataIndex: 'supplierName', + key: 'supplierName', + ellipsis: true, + align: 'center', + onCell, + onHeaderCell, + }, + { + title: '拟签约金额', + dataIndex: 'money', + key: 'money', + align: 'center', + ellipsis: true, + width: '25%', + onCell, + onHeaderCell, + }, +]; + +const dataSource = [ + { + id: '1', + name: '中国联通集团股份有限公司', + time: "11:00", + unit: '北京', + place: '评标地点', + number: '5', + supplierName: '通信工程局有限责任公司', + money: '100000', + }, + { + id: '2', + name: '中国联通集团股份有限公司', + time: "11:00", + unit: '北京', + place: '评标地点', + number: '7', + supplierName: '通信工程局有限责任公司', + money: '100000', + }, + { + id: '3', + name: '中国联通集团股份有限公司', + time: "11:00", + unit: '北京', + place: '评标地点', + number: '7', + supplierName: '通信工程局有限责任公司', + money: '100000', + }, + { + id: '4', + name: '中国联通集团股份有限公司', + time: "11:00", + unit: '北京', + place: '评标地点', + number: '7', + supplierName: '通信工程局有限责任公司', + money: '100000', + }, + { + id: '5', + name: '中国联通集团股份有限公司', + time: "11:00", + unit: '北京', + place: '评标地点', + number: '7', + supplierName: '通信工程局有限责任公司', + money: '100000', + }, +]; +const GraphChart = (props: { type: string }) => { + const { type } = props; + const random = Math.random().toString(); + useEffect(() => { + type EChartsOption = echarts.EChartsOption; + const chartDom = document.getElementById(random)!; + const myChart = echarts.init(chartDom); + const categoryOption: any = { + legend: { top: '3%', textStyle: { color: '#fff' } }, + tooltip: {}, + grid: { left: '8%', right: '4%', top: '16%', bottom: 60 }, + dataset: { + dimensions: ['product', '专家人数', '专家签到数量'], + source: [ + { product: '招标项目', '专家人数': 43.3, '专家签到数量': 85.8, }, + { product: '公开比选', '专家人数': 83.1, '专家签到数量': 73.4, }, + { product: '公开询价', '专家人数': 86.4, '专家签到数量': 65.2, }, + { product: '公开招募', '专家人数': 72.4, '专家签到数量': 53.9, }, + { product: '竞争性谈判', '专家人数': 72.4, '专家签到数量': 53.9, }, + { product: '单一来源', '专家人数': 72.4, '专家签到数量': 53.9, }, + ] + }, + xAxis: { type: 'category', axisLabel: { interval: 0, color: '#fff' } }, + yAxis: { axisLabel: { color: '#fff' } }, + // Declare several bar series, each will be mapped + // to a column of dataset.source by default. + series: [{ type: 'bar' }, { type: 'bar' }] + }; + const pieOption: any = { + legend: { + orient: 'vertical', + right: '3%', + top: 'middle', + textStyle: { color: '#fff' } + }, + tooltip: {}, + dataset: { + source: [ + ['product', 'today', 'tomorrow', 'total'], + ['招标项目', 86.5, 92.1, 85.7], + ['公开比选', 41.1, 30.4, 65.1], + ['公开询价', 24.1, 67.2, 79.5], + ['公开招募', 55.2, 67.1, 69.2], + ['竞争性谈判', 86.4, 65.2, 82.5], + ['单一来源', 72.4, 53.9, 39.1], + ] + }, + series: [ + { + type: 'pie', + radius: ['44%', '77%'], + center: ['15%', '45%'], + // No encode specified, by default, it is 'today'. + label: { + show: false, + position: 'center' + }, + emphasis: { + label: { + show: true, + fontSize: 24, + fontWeight: 'bold', + color: '#fff' + } + } + }, + { + type: 'pie', + radius: ['44%', '77%'], + center: ['45%', '45%'], + label: { + show: false, + position: 'center' + }, + emphasis: { + label: { + show: true, + fontSize: 24, + fontWeight: 'bold', + color: '#fff' + } + }, + encode: { + itemName: 'product', + value: 'tomorrow' + } + }, + { + type: 'pie', + radius: ['44%', '77%'], + center: ['75%', '45%'], + label: { + show: false, + position: 'center' + }, + emphasis: { + label: { + show: true, + fontSize: '20px', + fontWeight: 'bold', + color: '#fff' + } + }, + encode: { + itemName: 'product', + value: 'total' + } + } + ] + }; + + const option: EChartsOption = type == "pie" ? pieOption : categoryOption; + myChart.setOption(option); + }, []) + return ( +
+ ) +} + +export default () => { + const [time, setTime] = useState