import React, { useEffect } from 'react';
import './index.less';
import { Carousel, Col, Divider, List, Row } from 'antd';
import * as echarts from 'echarts';
import topic_header from '@/assets/topic/topic_header.jpg'
import topic_activity_logo from '@/assets/topic/topic_activity_logo.png'
import topic_red_flag from '@/assets/topic/topic_red_flag.png'
import topic_other from '@/assets/topic/topic_other.png'
import topic_example1 from '@/assets/topic/topic_example1.jpg'
import topic_example2 from '@/assets/topic/topic_example2.jpg'
import topic_example3 from '@/assets/topic/topic_example3.jpg'
import topic_example4 from '@/assets/topic/topic_example4.jpg'
import topic_example5 from '@/assets/topic/topic_example5.jpg'
import topic_example6 from '@/assets/topic/topic_example6.jpg'
import topic_project_picture from '@/assets/topic/topic_project_picture.jpg'
import topic_bottom_button from '@/assets/topic/topic_bottom_button.png'
import topic_right_material from '@/assets/topic/topic_right_material.png'
import topic_partymember from '@/assets/topic/topic_partymember.png'
import topic_partybranch from '@/assets/topic/topic_partybranch.png'
import topic_totalamount from '@/assets/topic/topic_totalamount.png'
import topic_totalnumber from '@/assets/topic/topic_totalnumber.png'
import topic_commodity from '@/assets/topic/topic_commodity.png'
import topic_protocol from '@/assets/topic/topic_protocol.png'
import topic_banner1 from '@/assets/topic/topic_banner1.jpg'
const LeftCardTop = (props: any) => {
return (
<>
{props.title}
更多
>
)
}
const RightDisplayTitle = (props: any) => {
return (
{props.title}
)
}
const RightDisplayContent = (props: any) => {
return (
{right_data[props.type].name}
{right_data[props.type].type != null &&
同比
{right_data[props.type].type == 1 ? (
{right_data[props.type].percentage}% ↑
) : (
{right_data[props.type].percentage}% ↓
)}
}
{right_data[props.type].number}
{right_data[props.type].unit}
)
}
const RightGraphContent = (props: any) => {
const random = Math.random().toString();
useEffect(() => {
type EChartsOption = echarts.EChartsOption;
const chartDom = document.getElementById(random)!;
const myChart = echarts.init(chartDom);
const option: EChartsOption = {
tooltip: {
trigger: 'item'
},
series: [
{
name: props.name,
type: 'pie',
radius: '90%',
color: ['#5470C6', '#91CC75', '#FAC858', '#EE6666', '#73C0DE', '#3BA272', '#FC8452', '#9A60B4'],
data: props.data,
label: {
formatter: props.type == 1 ? '{b}\n\n{c}件 {d}%' : '{b}',
fontSize: 12,
color: '#fff',
position: 'inner',
},
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)'
}
}
}
]
};
myChart.setOption(option);
}, [])
return (
)
}
const example_list = [
{
img: topic_example1,
text: '支队领导带领党员民警参观5G创新中心'
},
{
img: topic_example2,
text: '支队领导带领党员民警参观5G创新中心'
},
{
img: topic_example3,
text: '支队领导带领党员民警参观5G创新中心'
},
{
img: topic_example4,
text: '支队领导带领党员民警参观5G创新中心'
},
{
img: topic_example5,
text: '支队领导带领党员民警参观5G创新中心'
},
{
img: topic_example6,
text: '支队领导带领党员民警参观5G创新中心'
},
]
const listData = [
{
title: '中国联通召开 2022年党建暨党风廉政建设工作会议',
time: '05-25 16:19',
},
{
title: '喜报|联通智慧党建产品,荣获国家级创新大赛一等奖',
time: '05-25 16:19',
},
{
title: '中国联通召开 2022年党建暨党风廉政建设工作会议',
time: '05-25 16:19',
},
{
title: '喜报|联通智慧党建产品,荣获国家级创新大赛一等奖',
time: '05-25 16:19',
},
{
title: '中国联通召开 2022年党建暨党风廉政建设工作会议',
time: '05-25 16:19',
},
{
title: '喜报|联通智慧党建产品,荣获国家级创新大赛一等奖',
time: '05-25 16:19',
},
{
title: '中国联通召开 2022年党建暨党风廉政建设工作会议',
time: '05-25 16:19',
},
{
title: '喜报|联通智慧党建产品,荣获国家级创新大赛一等奖',
time: '05-25 16:19',
},
{
title: '中国联通召开 2022年党建暨党风廉政建设工作会议',
time: '05-25 16:19',
},
{
title: '喜报|联通智慧党建产品,荣获国家级创新大赛一等奖',
time: '05-25 16:19',
},
{
title: '中国联通召开 2022年党建暨党风廉政建设工作会议',
time: '05-25 16:19',
},
{
title: '喜报|联通智慧党建产品,荣获国家级创新大赛一等奖',
time: '05-25 16:19',
},
];
const length = ['集团', '北京分公司', '山东分公司'];
const card_length = [1, 2, 3, 4];
const right_data = {
partymember: {
name: '党员数量',
img: topic_partymember,
number: 1275,
unit: '个',
type: null,
percentage: null,
},
partybranch: {
name: '党支部数量',
img: topic_partybranch,
number: 75,
unit: '个',
type: null,
percentage: null,
},
totalamount: {
name: '订单交易总额',
img: topic_totalamount,
number: 274.5,
unit: '亿元',
type: 1,
percentage: 0.9,
},
totalnumber: {
name: '订单总数量',
img: topic_totalnumber,
number: 1297,
unit: '个',
type: 1,
percentage: 0.9,
},
commodity: {
name: '商品数量',
img: topic_commodity,
number: 76321,
unit: '件',
type: 1,
percentage: 1.9,
},
protocol: {
name: '协议数量',
img: topic_protocol,
number: 257,
unit: '个',
type: 0,
percentage: 0.7,
},
}
const right_graph_data = [
{
name: '物资采购计划',
sub: '总采购数量',
type: 1,
number: 22324,
unit: '件',
data: [
{ value: 1421, name: '已完成数量' },
{ value: 2369, name: '进行中数量' },
],
},
{
name: '攻坚克难项目',
sub: '总课题数量',
type: 1,
number: 223,
unit: '个',
data: [
{ value: 165, name: '已完成数量' },
{ value: 265, name: '进行中数量' },
],
},
{
name: '建议类型',
sub: null,
type: 0,
number: null,
unit: null,
data: [
{ value: 40, name: '系统优化' },
{ value: 30, name: '组织优化' },
{ value: 20, name: '制度优化' },
],
},
]
const Home: React.FC<{}> = () => {
return (
2
3
4
{example_list.map((item, index) => (
))}
(
{item.title}
{item.time}
)}
>
{right_graph_data.map(item => (
{item.name}
{item.type == 1 && `${item.sub}:${item.number}${item.unit}`}
))}
{length.map(item => (
{item}
{card_length.map(item => (
张三
(IP物资类)
邮箱:1214567@chinaunicom.cn
电话:12111112222
部门:xxxx部
))}
))}
更多
);
};
export default Home;