6.28 党建攻坚第二版
This commit is contained in:
@ -1,60 +1,27 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import '../Style/ld_style.less';
|
||||
import { Input, List, Pagination } from 'antd';
|
||||
import { Input, List, Spin } from 'antd';
|
||||
import { getProjectList } from './service';
|
||||
import { formatTime } from '../utils';
|
||||
import { history } from 'umi';
|
||||
|
||||
const { Search } = Input;
|
||||
|
||||
const data = [
|
||||
{
|
||||
title: '集团党支部',
|
||||
name: '张三',
|
||||
position: '党委书记',
|
||||
},
|
||||
{
|
||||
title: '集团党支部',
|
||||
name: '李四',
|
||||
position: '党委副书记',
|
||||
},
|
||||
{
|
||||
title: '集团党支部',
|
||||
name: '李四',
|
||||
position: '党委副书记',
|
||||
},
|
||||
{
|
||||
title: '集团党支部',
|
||||
name: '李四',
|
||||
position: '党委副书记',
|
||||
},
|
||||
{
|
||||
title: '集团党支部',
|
||||
name: '李四',
|
||||
position: '党委副书记',
|
||||
},
|
||||
{
|
||||
title: '集团党支部',
|
||||
name: '李四',
|
||||
position: '党委副书记',
|
||||
},
|
||||
{
|
||||
title: '集团党支部',
|
||||
name: '李四',
|
||||
position: '党委副书记',
|
||||
}
|
||||
];
|
||||
|
||||
const PersonInfor: React.FC<{}> = () => {
|
||||
//project data
|
||||
const [projectList, setProjectList] = useState<any[]>([]);
|
||||
//loading
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
|
||||
//get project
|
||||
const getProjectData = () => {
|
||||
getProjectList().then(res => {
|
||||
const getProjectData = (value: string) => {
|
||||
setLoading(true);
|
||||
getProjectList({ param: value }).then(res => {
|
||||
if (res?.code == 200) {
|
||||
setProjectList(res?.data);
|
||||
}
|
||||
}).finally(() => {
|
||||
setLoading(false);
|
||||
})
|
||||
}
|
||||
|
||||
@ -73,7 +40,7 @@ const PersonInfor: React.FC<{}> = () => {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
getProjectData();
|
||||
getProjectData('');
|
||||
}, [])
|
||||
|
||||
return (
|
||||
@ -84,36 +51,39 @@ const PersonInfor: React.FC<{}> = () => {
|
||||
<span onClick={() => toGoBack()}>上一页</span>
|
||||
</div>
|
||||
</div>
|
||||
<div className="search">
|
||||
<span className="text"><span>攻坚克难项目</span></span>
|
||||
<div className="search-box">
|
||||
<Search
|
||||
placeholder="输入标题"
|
||||
allowClear
|
||||
enterButton="搜索"
|
||||
style={{ width: 322 }}
|
||||
<Spin spinning={loading}>
|
||||
<div className="search">
|
||||
<span className="text"><span>攻坚克难项目</span></span>
|
||||
<div className="search-box">
|
||||
<Search
|
||||
placeholder="输入标题"
|
||||
allowClear
|
||||
enterButton="搜索"
|
||||
style={{ width: 322 }}
|
||||
onSearch={getProjectData}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="list-content">
|
||||
<List
|
||||
itemLayout="horizontal"
|
||||
pagination={{
|
||||
size: 'small',
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
pageSize: 10,
|
||||
}}
|
||||
dataSource={projectList}
|
||||
renderItem={item => (
|
||||
<List.Item>
|
||||
<div className="list-box">
|
||||
<p onClick={() => clickTitle(item)}>{item.title}</p>
|
||||
<span>{formatTime(item.createTime, 'YYYY-MM-DD')}</span>
|
||||
</div>
|
||||
</List.Item>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div className="list-content">
|
||||
<List
|
||||
itemLayout="horizontal"
|
||||
pagination={{
|
||||
size: 'small',
|
||||
showTotal: (total) => `共 ${total} 条`,
|
||||
pageSize: 10,
|
||||
}}
|
||||
dataSource={projectList}
|
||||
renderItem={item => (
|
||||
<List.Item>
|
||||
<div className="list-box">
|
||||
<p onClick={() => clickTitle(item)}>{item.title}</p>
|
||||
<span>{formatTime(item.createTime, 'YYYY-MM-DD')}</span>
|
||||
</div>
|
||||
</List.Item>
|
||||
)}
|
||||
/>
|
||||
</div>
|
||||
</Spin>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
//攻坚克难项目
|
||||
export async function getProjectList() {
|
||||
return request('/api/biz-service-ebtp-extend/v1/eventpartybranch/eventSubject/list');
|
||||
export async function getProjectList(data: any) {
|
||||
return request('/api/biz-service-ebtp-extend/v1/eventpartybranch/eventSubject/list', {
|
||||
method: 'POST',
|
||||
data: { ...data },
|
||||
});
|
||||
}
|
Reference in New Issue
Block a user