6.27 集成
This commit is contained in:
@ -18,9 +18,7 @@ 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 { getHomeActivity, getHomeBanner, getHomeContact, getHomeGraceful, getHomeProject, getHomeRight, submitAdvice } from './service';
|
||||
import { getFilelist } from '@/services/download_';
|
||||
import { pictureDisplayPath } from '@/utils/DownloadUtils';
|
||||
import moment from 'moment';
|
||||
import { formatTime, getImageUrl } from '../utils';
|
||||
|
||||
const LeftCardTop = (props: any) => {
|
||||
return (
|
||||
@ -30,7 +28,7 @@ const LeftCardTop = (props: any) => {
|
||||
<span className='left-card-title'>{props.title}</span>
|
||||
<img src={topic_red_flag} className='left-card-flag' />
|
||||
</div>
|
||||
<div>
|
||||
<div onClick={() => window.open(props.url)}>
|
||||
<span className='left-card-other'>更多</span>
|
||||
<img src={topic_other} className='left-card-otherimg' />
|
||||
</div>
|
||||
@ -158,6 +156,10 @@ const CommentModal = (props: any) => {
|
||||
}
|
||||
|
||||
const onSubmit = async () => {
|
||||
if (textRef.current == '' || textRef.current == null) {
|
||||
message.info("请先输入意见内容");
|
||||
return;
|
||||
}
|
||||
setModalLoading(true);
|
||||
const params = {
|
||||
contactName: props.data?.contactName,
|
||||
@ -211,6 +213,7 @@ const CommentModal = (props: any) => {
|
||||
maxLength={200}
|
||||
defaultValue={''}
|
||||
onChange={onTextChange}
|
||||
placeholder="在这里输入我要提出的意见"
|
||||
/>
|
||||
<div className='bottom-modal-submit'>
|
||||
<span className='submit-text'>提交给{props.data?.contactDepartment}的{props.data?.contactName}</span>
|
||||
@ -244,22 +247,6 @@ const Home: React.FC<{}> = () => {
|
||||
//bottom advice modal data
|
||||
const [adviceItemData, setAdviceItemData] = useState<Object>({});
|
||||
|
||||
const getImageUrl = async (data: any[], paramName: string) => {
|
||||
for (const ite of data) {
|
||||
await getFilelist([ite[paramName]]).then(response => {//获取主图
|
||||
if (response?.success && response?.data?.length > 0) {
|
||||
const returnUrl = window.location.origin + pictureDisplayPath + '?filePath=' + response?.data[0].filePath;
|
||||
ite["imageUrl"] = returnUrl;
|
||||
}
|
||||
})
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
||||
const formatProjectTime = (time: string) => {
|
||||
return moment(time).format('MM-DD HH:mm');
|
||||
}
|
||||
|
||||
const openModal = (item: any) => {
|
||||
setAdviceItemData(item);
|
||||
setAdviceVisible(true);
|
||||
@ -340,6 +327,18 @@ const Home: React.FC<{}> = () => {
|
||||
})
|
||||
}
|
||||
|
||||
//to hard project
|
||||
const hardProjectClick = (data: any) => {
|
||||
sessionStorage.setItem("detailData", JSON.stringify(data));
|
||||
window.open("/partyMemberTopic/hardDetail");
|
||||
}
|
||||
|
||||
//to hard project
|
||||
const newsDetailClick = (data: any) => {
|
||||
sessionStorage.setItem("detailData", JSON.stringify(data));
|
||||
window.open("/partyMemberTopic/newsDetail");
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getBannerList();
|
||||
getGracefulList();
|
||||
@ -364,7 +363,7 @@ const Home: React.FC<{}> = () => {
|
||||
<div className='carousel-textbg'>
|
||||
<div className='carousel-text'>
|
||||
<span className='carousel-text-content'>{item.imageWord}</span>
|
||||
<span className='carousel-text-click'>⋙点击查看详情</span>
|
||||
<span className='carousel-text-click' onClick={() => newsDetailClick(item)}>⋙点击查看详情</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -396,12 +395,12 @@ const Home: React.FC<{}> = () => {
|
||||
</div>
|
||||
<div className='left-card'>
|
||||
<div className='left-graceful'>
|
||||
<LeftCardTop title="活动风采" />
|
||||
<LeftCardTop title="活动风采" url="/partyMemberTopic/activityStyle" />
|
||||
<div>
|
||||
<Row gutter={[20, 31]}>
|
||||
{gracefulList?.length > 0 && gracefulList.map((item, index) => (
|
||||
<Col span={8} key={index}>
|
||||
<div className='left-graceful-bg' style={{ backgroundImage: `url(${item.imageUrl})` }}>
|
||||
<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>
|
||||
</div>
|
||||
@ -412,7 +411,7 @@ const Home: React.FC<{}> = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className='left-project'>
|
||||
<LeftCardTop title="攻坚克难项目" />
|
||||
<LeftCardTop title="攻坚克难项目" url="/partyMemberTopic/overDifficult" />
|
||||
<div className='left-project-content'>
|
||||
<img src={topic_project_picture} />
|
||||
<div className='left-project-content-list'>
|
||||
@ -423,8 +422,8 @@ const Home: React.FC<{}> = () => {
|
||||
renderItem={item => (
|
||||
<List.Item>
|
||||
<div className='left-project-content-item'>
|
||||
<span className='left-project-content-item-title'>{item.title}</span>
|
||||
<span className='left-project-content-item-time'>{formatProjectTime(item.createTime)}</span>
|
||||
<a onClick={() => hardProjectClick(item)} className='left-project-content-item-title'>{item.title}</a>
|
||||
<span className='left-project-content-item-time'>{formatTime(item.createTime, 'MM-DD HH:mm')}</span>
|
||||
</div>
|
||||
</List.Item>
|
||||
)}
|
||||
@ -437,7 +436,7 @@ const Home: React.FC<{}> = () => {
|
||||
</div>
|
||||
<div className='right-global'>
|
||||
<div>
|
||||
<img src={topic_right_material} className='right-material' />
|
||||
<img src={topic_right_material} className='right-material' onClick={() => window.open("/partyMemberTopic/partyBranch")} />
|
||||
</div>
|
||||
<div className='right-display'>
|
||||
<RightDisplayTitle title="党员及支部数量情况" />
|
||||
@ -469,14 +468,14 @@ const Home: React.FC<{}> = () => {
|
||||
</div>
|
||||
</div>
|
||||
<div className='bottom-global'>
|
||||
<LeftCardTop title="活动联系人" />
|
||||
<LeftCardTop title="活动联系人" url="" />
|
||||
{Object.entries(contactData).map(([name, value], index) => (
|
||||
<div key={index}>
|
||||
<div className='bottom-title'>{name}</div>
|
||||
<div className='bottom-content'>
|
||||
<Row gutter={[20, 20]}>
|
||||
{value.map((item: any) => (
|
||||
<BottomCardContent data={item} onClick={() => openModal(item)} />
|
||||
<BottomCardContent data={item} onClick={() => openModal(item)} key={item.id} />
|
||||
))}
|
||||
</Row>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user