2022-06-27 09:12:56 +08:00
|
|
|
import React, { useEffect, useState } from 'react';
|
2022-06-24 13:33:16 +08:00
|
|
|
import '../Style/ld_style.less';
|
|
|
|
import { Input, List } from 'antd';
|
2022-06-27 09:12:56 +08:00
|
|
|
import { history } from 'umi'
|
|
|
|
import { getBranchList, getMemberAndBranch } from './service';
|
2022-06-24 13:33:16 +08:00
|
|
|
|
|
|
|
const { Search } = Input;
|
|
|
|
|
|
|
|
const data = [
|
|
|
|
{
|
|
|
|
title: '集团党支部',
|
|
|
|
num: 987,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '北京分公司党支部',
|
|
|
|
num: 127,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '山东分公司党支部',
|
|
|
|
num: 110,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '吉林分公司党支部',
|
|
|
|
num: 121,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '辽宁分公司党支部',
|
|
|
|
num: 130,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '陕西分公司党支部',
|
|
|
|
num: 105,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '山西分公司党支部',
|
|
|
|
num: 104,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '湖北分公司党支部',
|
|
|
|
num: 113,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '湖南分公司党支部',
|
|
|
|
num: 111,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '江苏分公司党支部',
|
|
|
|
num: 987,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '河南分公司党支部',
|
|
|
|
num: 121,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '河北分公司党支部',
|
|
|
|
num: 100,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '天津分公司党支部',
|
|
|
|
num: 86,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '上海分公司党支部',
|
|
|
|
num: 98,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '安徽分公司党支部',
|
|
|
|
num: 105,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: '江西分公司党支部',
|
|
|
|
num: 121,
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|
2022-06-27 09:12:56 +08:00
|
|
|
|
|
|
|
|
2022-06-24 13:33:16 +08:00
|
|
|
const PartyBranch: React.FC<{}> = () => {
|
2022-06-27 09:12:56 +08:00
|
|
|
//member number and branch number
|
|
|
|
const [memberNumber, setMemberNumber] = useState<any>({});
|
|
|
|
//branch list
|
|
|
|
const [branchData, setBranchData] = useState<any[]>([]);
|
|
|
|
//get member and branch
|
|
|
|
const getMemberNumber = () => {
|
|
|
|
getMemberAndBranch().then(res => {
|
|
|
|
if (res?.code == 200) {
|
|
|
|
setMemberNumber(res?.data);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
//get member and branch
|
|
|
|
const getBranchData = () => {
|
|
|
|
getBranchList().then(res => {
|
|
|
|
if (res?.code == 200) {
|
|
|
|
setBranchData(res?.data);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
//onclick
|
|
|
|
const clickCard = (data: any) => {
|
|
|
|
sessionStorage.setItem("detailData", JSON.stringify(data));
|
|
|
|
history.push("/partyMemberTopic/personInfor");
|
|
|
|
}
|
|
|
|
|
|
|
|
//to home
|
|
|
|
const toHome = () => {
|
|
|
|
history.push("/partyMemberTopic/home");
|
|
|
|
}
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
getMemberNumber();
|
|
|
|
getBranchData();
|
|
|
|
}, [])
|
2022-06-24 13:33:16 +08:00
|
|
|
return (
|
|
|
|
<div className="page-container">
|
|
|
|
<div className="top-banner">
|
|
|
|
<div className="back-home">
|
2022-06-27 09:12:56 +08:00
|
|
|
<span onClick={() => toHome()}>返回首页</span>
|
2022-06-24 13:33:16 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="search">
|
|
|
|
<span className="text"><span>党员名录</span>(当前共270条)</span>
|
|
|
|
<div className="search-box">
|
|
|
|
<Search
|
|
|
|
placeholder="输入姓名/邮箱/电话"
|
|
|
|
allowClear
|
|
|
|
enterButton="搜索"
|
|
|
|
style={{ width: 322 }}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div className="static-box">
|
2022-06-27 09:12:56 +08:00
|
|
|
<div className="person-num">党员数量<span>{memberNumber?.member}</span>人</div>
|
|
|
|
<div className="party-num">党支部数量<span>{memberNumber?.branch}</span>个</div>
|
2022-06-24 13:33:16 +08:00
|
|
|
</div>
|
|
|
|
<div className="mess-box">
|
|
|
|
<List
|
|
|
|
grid={{ gutter: 16, column: 4 }}
|
2022-06-27 09:12:56 +08:00
|
|
|
dataSource={branchData}
|
|
|
|
renderItem={(item: any) => (
|
2022-06-24 13:33:16 +08:00
|
|
|
<List.Item>
|
2022-06-27 09:12:56 +08:00
|
|
|
<div className="wrapper" onClick={() => clickCard(item)}>
|
|
|
|
<div className="pic-bg">{item.branchName}</div>
|
2022-06-24 13:33:16 +08:00
|
|
|
<div className="mess">
|
|
|
|
<div className="mess-left">党员数量</div>
|
|
|
|
<div className="mess-right">
|
2022-06-27 09:12:56 +08:00
|
|
|
<span>{item.count}</span>人
|
2022-06-24 13:33:16 +08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</List.Item>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default PartyBranch;
|