import React, { useEffect, useState } from 'react'; import '../Style/ld_style.less'; import { Input, List } from 'antd'; import { history } from 'umi' import { getBranchList, getMemberAndBranch } from './service'; 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, }, ]; const PartyBranch: React.FC<{}> = () => { //member number and branch number const [memberNumber, setMemberNumber] = useState({}); //branch list const [branchData, setBranchData] = useState([]); //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(); }, []) return (
toHome()}>返回首页
党员名录(当前共270条)
党员数量{memberNumber?.member}
党支部数量{memberNumber?.branch}
(
clickCard(item)}>
{item.branchName}
党员数量
{item.count}
)} />
) } export default PartyBranch;