6.27 集成
This commit is contained in:
@ -1,6 +1,9 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import '../Style/ld_style.less';
|
||||
import { Input, List, Pagination } from 'antd';
|
||||
import { getProjectList } from './service';
|
||||
import { formatTime } from '../utils';
|
||||
import { history } from 'umi';
|
||||
|
||||
const { Search } = Input;
|
||||
|
||||
@ -43,12 +46,42 @@ const data = [
|
||||
];
|
||||
|
||||
const PersonInfor: React.FC<{}> = () => {
|
||||
//project data
|
||||
const [projectList, setProjectList] = useState<any[]>([]);
|
||||
|
||||
//get project
|
||||
const getProjectData = () => {
|
||||
getProjectList().then(res => {
|
||||
if (res?.code == 200) {
|
||||
setProjectList(res?.data);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//onclick
|
||||
const clickTitle = (data: any) => {
|
||||
sessionStorage.setItem("detailData", JSON.stringify(data));
|
||||
history.push("/partyMemberTopic/hardDetail");
|
||||
}
|
||||
//to home
|
||||
const toHome = () => {
|
||||
history.push("/partyMemberTopic/home");
|
||||
}
|
||||
//goback lastpage
|
||||
const toGoBack = () => {
|
||||
window.history.go(-1);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getProjectData();
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<div className="page-container">
|
||||
<div className="top-banner">
|
||||
<div className="back-home">
|
||||
<span>返回首页</span>
|
||||
<span>上一页</span>
|
||||
<span onClick={() => toHome()}>返回首页</span>
|
||||
<span onClick={() => toGoBack()}>上一页</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="search">
|
||||
@ -65,12 +98,18 @@ const PersonInfor: React.FC<{}> = () => {
|
||||
<div className="list-content">
|
||||
<List
|
||||
itemLayout="horizontal"
|
||||
dataSource={data}
|
||||
pagination={{
|
||||
onChange: page => {
|
||||
console.log(page);
|
||||
},
|
||||
pageSize: 2,
|
||||
}}
|
||||
dataSource={projectList}
|
||||
renderItem={item => (
|
||||
<List.Item>
|
||||
<div className="list-box">
|
||||
<p>党员先锋示范队“攻坚克难”活动项目计划书</p>
|
||||
<span>2022-04-03</span>
|
||||
<p onClick={() => clickTitle(item)}>{item.title}</p>
|
||||
<span>{formatTime(item.createTime, 'YYYY-MM-DD')}</span>
|
||||
</div>
|
||||
</List.Item>
|
||||
)}
|
||||
|
@ -0,0 +1,6 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
//攻坚克难项目
|
||||
export async function getProjectList() {
|
||||
return request('/api/biz-service-ebtp-extend/v1/eventpartybranch/eventSubject/list');
|
||||
}
|
Reference in New Issue
Block a user