6.28 党建攻坚第二版
This commit is contained in:
@ -20,8 +20,9 @@ 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 { getHomeActivity, getHomeBanner, getHomeContact, getHomeGraceful, getHomeProject, getHomeRight, submitAdvice } from './service';
|
||||
import { formatTime, getImageUrl } from '../utils';
|
||||
import { formatTime, getImageUrl, isEmpty, isNotEmpty } from '../utils';
|
||||
|
||||
//卡片头
|
||||
const LeftCardTop = (props: any) => {
|
||||
return (
|
||||
<>
|
||||
@ -39,7 +40,7 @@ const LeftCardTop = (props: any) => {
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
//右侧专业线标题
|
||||
const RightDisplayTitle = (props: any) => {
|
||||
return (
|
||||
<div className='right-display-title'>
|
||||
@ -47,11 +48,18 @@ const RightDisplayTitle = (props: any) => {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
//右侧专业线内容
|
||||
const RightDisplayContent = (props: any) => {
|
||||
const displayContentClick = () => {
|
||||
if (props.index == 0) {//党员数量
|
||||
window.open("/partyMemberTopic/personInfor");
|
||||
} else if (props.index == 1) {//党支部数量
|
||||
window.open("/partyMemberTopic/partyBranch");
|
||||
}
|
||||
}
|
||||
return (
|
||||
props.data?.length > 0 ? (
|
||||
<div className='right-display-content'>
|
||||
<div className={props.index == 0 || props.index == 1 ? 'right-display-content right-display-content-pointer' : 'right-display-content'} onClick={() => displayContentClick()}>
|
||||
<img src={props.img} className='right-display-content-img' />
|
||||
<div className='right-display-content-right'>
|
||||
<div className='right-display-content-title'>
|
||||
@ -74,7 +82,7 @@ const RightDisplayContent = (props: any) => {
|
||||
) : null
|
||||
)
|
||||
}
|
||||
|
||||
//右侧图表内容
|
||||
const RightGraphContent = (props: any) => {
|
||||
const random = Math.random().toString();
|
||||
useEffect(() => {
|
||||
@ -94,7 +102,7 @@ const RightGraphContent = (props: any) => {
|
||||
data: props.data,
|
||||
label: {
|
||||
formatter: props.type != null ? `{b}\n\n{c}${props.type} {d}%` : '{b}',
|
||||
fontSize: 14,
|
||||
fontSize: '90%',
|
||||
color: '#fff',
|
||||
position: 'inner',
|
||||
},
|
||||
@ -114,7 +122,7 @@ const RightGraphContent = (props: any) => {
|
||||
<div id={random} style={{ width: '100%', height: '100%' }}></div>
|
||||
)
|
||||
}
|
||||
|
||||
//活动联系人卡片内容
|
||||
const BottomCardContent = (props: any) => {
|
||||
|
||||
return (
|
||||
@ -124,7 +132,7 @@ const BottomCardContent = (props: any) => {
|
||||
<div className='bottom-card-title'>
|
||||
<Tooltip placement="topLeft" title={`${props.data.remark} ${props.data.contactName}`}>
|
||||
<span>{props.data.contactName}</span>
|
||||
<span className='bottom-card-title-type'>({props.data.remark})</span>
|
||||
{isNotEmpty(props.data.remark) && <span className='bottom-card-title-type'>({props.data.remark})</span>}
|
||||
</Tooltip>
|
||||
|
||||
</div>
|
||||
@ -139,7 +147,7 @@ const BottomCardContent = (props: any) => {
|
||||
</Col>
|
||||
)
|
||||
}
|
||||
|
||||
//活动联系人-我要提意见Modal
|
||||
const CommentModal = (props: any) => {
|
||||
const { TextArea } = Input;
|
||||
const [modalLoading, setModalLoading] = useState<boolean>(false);
|
||||
@ -161,7 +169,7 @@ const CommentModal = (props: any) => {
|
||||
}
|
||||
|
||||
const onSubmit = async () => {
|
||||
if (textRef.current == '' || textRef.current == null) {
|
||||
if (isEmpty(textRef.current)) {
|
||||
message.info("请先输入意见内容");
|
||||
return;
|
||||
}
|
||||
@ -200,7 +208,7 @@ const CommentModal = (props: any) => {
|
||||
footer={null}
|
||||
centered
|
||||
maskStyle={{ backgroundColor: 'rgba(0, 0, 0, 0.3)' }}
|
||||
width={350}
|
||||
width={450}
|
||||
>
|
||||
<Spin spinning={modalLoading}>
|
||||
<div className='bottom-modal-body'>
|
||||
@ -213,20 +221,23 @@ const CommentModal = (props: any) => {
|
||||
</Radio.Group>
|
||||
</div>
|
||||
<TextArea
|
||||
rows={6}
|
||||
rows={11}
|
||||
className='bottom-modal-textarea'
|
||||
maxLength={50}
|
||||
allowClear
|
||||
showCount
|
||||
defaultValue={''}
|
||||
onChange={onTextChange}
|
||||
placeholder="在这里输入我要提出的意见"
|
||||
placeholder="在这里输入我要提出的意见(最多输入50字)"
|
||||
/>
|
||||
<div className='bottom-modal-submit'>
|
||||
<span className='submit-text'>提交给{props.data?.contactDepartment}的{props.data?.contactName}</span>
|
||||
<Button type='primary' className='submit-button' onClick={onSubmit}>
|
||||
提交
|
||||
</Button>
|
||||
<div>
|
||||
<Button className='submit-cancelbutton' onClick={onCancel}>
|
||||
取消
|
||||
</Button>
|
||||
<Button type='primary' className='submit-button' onClick={onSubmit}>
|
||||
提交
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</Spin>
|
||||
@ -333,7 +344,7 @@ const Home: React.FC<{}> = () => {
|
||||
if (res?.code == 200) {
|
||||
const data = Object.entries(res?.data);
|
||||
if (data.length > 3) {
|
||||
setContactData(data.slice(0, 6));
|
||||
setContactData(data.slice(0, 3));
|
||||
totalContactData.current = data;
|
||||
} else {
|
||||
setContactData(data);
|
||||
@ -354,6 +365,15 @@ const Home: React.FC<{}> = () => {
|
||||
window.open("/partyMemberTopic/newsDetail");
|
||||
}
|
||||
|
||||
//other buttom onclick
|
||||
const bottomOtherClick = (param: string) => {
|
||||
if (param == '0') {
|
||||
setContactData([...totalContactData.current]);
|
||||
} else {
|
||||
setContactData([...totalContactData.current.slice(0, 3)]);
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getBannerList();
|
||||
getGracefulList();
|
||||
@ -374,11 +394,11 @@ const Home: React.FC<{}> = () => {
|
||||
<Carousel className='left-carousel' autoplay>
|
||||
{bannerList?.length > 0 && bannerList.map(item => (
|
||||
<div key={item.id}>
|
||||
<div className='carousel-content' style={{ backgroundImage: `url(${item.imageUrl})` }}>
|
||||
<div className='carousel-content' style={{ backgroundImage: `url(${item.imageUrl})` }} onClick={() => newsDetailClick(item)}>
|
||||
<div className='carousel-textbg'>
|
||||
<div className='carousel-text'>
|
||||
<span className='carousel-text-content'>{item.imageWord}</span>
|
||||
<span className='carousel-text-click' onClick={() => newsDetailClick(item)}>⋙点击查看详情</span>
|
||||
<span className='carousel-text-click'>⋙点击查看详情</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -417,7 +437,7 @@ const Home: React.FC<{}> = () => {
|
||||
<Col span={8} key={index}>
|
||||
<div className='left-graceful-bg' style={{ backgroundImage: `url(${item.imageUrl})` }} onClick={() => newsDetailClick(item)}>
|
||||
<div className='left-graceful-textbg'>
|
||||
<span className='left-graceful-text'>{item.imageWord}</span>
|
||||
<span className='left-graceful-text'>{item.title}</span>
|
||||
</div>
|
||||
</div>
|
||||
</Col>
|
||||
@ -473,7 +493,7 @@ const Home: React.FC<{}> = () => {
|
||||
{item.dataClass}
|
||||
</div>
|
||||
<div className='right-graph-subtitle'>
|
||||
{item.dataName != null && `${item.dataName}:${item.dataValue}${item.dataType}`}
|
||||
{isNotEmpty(item.dataName) && `${item.dataName}:${item.dataValue}${item.dataType}`}
|
||||
</div>
|
||||
<div className='right-graph-content'>
|
||||
<RightGraphContent name={item.dataClass} type={item.dataType} data={item.data} />
|
||||
@ -496,11 +516,11 @@ const Home: React.FC<{}> = () => {
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
{totalContactData.current != null && (
|
||||
{contactData.length != 0 && contactData.length > 2 && (
|
||||
<div className='bottom-other'>
|
||||
<div>
|
||||
<span className='bottom-other-text'>更多</span>
|
||||
<img src={topic_other} className='bottom-other-icon' />
|
||||
<span className='bottom-other-text' onClick={() => bottomOtherClick(contactData.length > 3 ? '1' : '0')}>{contactData.length > 3 ? '收起' : '更多'}</span>
|
||||
<img src={topic_other} className={contactData.length > 3 ? 'bottom-close-icon' : 'bottom-other-icon'} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user