import React, { useEffect, useRef, useState } from 'react'; import './index.less'; import { Button, Carousel, Col, Divider, Input, List, message, Modal, Radio, RadioChangeEvent, Row, Spin, Tooltip } from 'antd'; import * as echarts from 'echarts'; import Marquee from 'react-fast-marquee'; 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_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_header_img from '@/assets/topic/topic_header_img.png' import topic_banner_default from '@/assets/topic/topic_banner_default.jpg' import topic_activity_default from '@/assets/topic/topic_activity_default.jpg' import topic_firstline from '@/assets/topic/topic_firstline.png' import topic_interview from '@/assets/topic/topic_interview.png' import topic_assure from '@/assets/topic/topic_assure.png' import topic_difficult from '@/assets/topic/topic_difficult.png' import { getHomeActivity, getHomeBanner, getHomeContact, getHomeGraceful, getHomeProject, getHomeRight, submitAdvice } from './service'; import { formatTime, getImageUrl, isEmpty, isNotEmpty } from '../utils'; //卡片头 const LeftCardTop = (props: any) => { return ( <>
{props.title}
{props.url &&
window.open(props.url)}> 更多
}
) } //右侧专业线标题 const RightDisplayTitle = (props: any) => { return (
{props.title}
) } //右侧专业线内容 const RightDisplayContent = (props: any) => { const displayContentClick = () => { if (props.index == 0 || props.index == 1) {//党员数量 //党支部数量 window.open("/partyMemberTopic/partyBranch"); } } return ( props.data?.length > 0 ? (
displayContentClick()}>
{props.data[props.index].dataName} {/* {props.data[props.index].dataCompare != null && 同比 {props.data[props.index].dataCompare[0] == '+' ? ( {props.data[props.index].dataCompare} ↑ ) : ( {props.data[props.index].dataCompare} ↓ )} } */}
{props.data[props.index].dataValue} {props.data[props.index].dataType}
) : null ) } //右侧图表内容 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: ['#EE6666', '#FAC858', '#73C0DE', '#91CC75', '#5470C6', '#FC8452', '#9A60B4', '#3BA272'], data: props.data, label: { formatter: props.type != null ? `{b}\n\n{c}${props.type} {d}%` : '{b}', fontSize: '90%', color: '#fff', position: 'inner', }, emphasis: { itemStyle: { shadowBlur: 10, shadowOffsetX: 0, shadowColor: 'rgba(0, 0, 0, 0.5)' } } } ] }; myChart.setOption(option); }, []) return (
) } //活动联系人卡片内容 const BottomCardContent = (props: any) => { return (
{props.data.contactName}
props.onClick()} />
{props.data.remark}
邮箱:{props.data.contactEmail}
电话:{props.data.contactMobiphone}
部门:{props.data.contactDepartment}
) } //活动联系人-我要提意见Modal const CommentModal = (props: any) => { const { TextArea } = Input; const [modalLoading, setModalLoading] = useState(false); const textRef = useRef(null); const radioRef = useRef(null); const onRadioChange = (e: RadioChangeEvent) => { radioRef.current = e.target.value; }; const onTextChange = (e: any) => { textRef.current = e.target.value; }; const onCancel = () => { props.closeModal(); textRef.current = null; radioRef.current = null; } const onSubmit = async () => { if (isEmpty(radioRef.current)) { message.info("请选择意见类型"); return; } if (isEmpty(textRef.current)) { message.info("请先输入意见内容"); return; } setModalLoading(true); const params = { contactName: props.data?.contactName, contactId: props.data?.contactId, suggestionType: radioRef.current, suggestionContent: textRef.current, } await submitAdvice(params).then(res => { if (res?.code == 200) { message.success("提交成功"); onCancel(); } }).finally(() => { setModalLoading(false); }) } return (
我要提意见
} visible={props.visible} onCancel={onCancel} destroyOnClose closable={false} footer={null} centered maskStyle={{ backgroundColor: 'rgba(0, 0, 0, 0.3)' }} width={450} >
网络运营 IT 市场 综合行政 其他