修改列表

This commit is contained in:
何童崇 2021-12-17 14:11:10 +08:00
parent 0e0bf2176f
commit d67a9eaf09
2 changed files with 148 additions and 52 deletions

View File

@ -1,79 +1,170 @@
import React ,{useState,useMemo, useEffect} from "react";
import React, { useState, useMemo, useEffect } from "react";
import Paginationtable from "../../components/paginationTable";
import { expertList } from "../api";
import './index.scss';
function List(){
function List() {
const [loading, setLoading] = useState(false);
const [currentPage, setCurrentPage] = useState(1);
const [curPage, setCurrentPage] = useState(1);
const [dataList, setDataList] = useState([]);
const [total, setTotal] = useState(0);
const [searchObj, setSearchObj] = useState({});
const [pageSize,setCurrentPageSize] =useState(10);
const [pageSize, setCurrentPageSize] = useState(10);
const columns = useMemo(() => {
return [{
title: '姓名',
dataIndex: 'name',
render: (text, record) => {
return record.user ? record.user.nickname || record.user.login : ''
}
},
{
title: '手机号码',
dataIndex: 'number',
dataIndex: 'expertName',
width: 55,
key: 'expertName',
fixed: 'left',
// render: (text, record) => {
// return record.user ? record.user.nickname || record.user.login : ''
// }
},
{
title: '最高学历',
dataIndex: 'updatedAt',
dataIndex: 'highestDegree',
width: 100,
key: 'highestDegree',
fixed: 'left',
},
// {
// title: '',
// dataIndex: 'action',
// render: (text, record) => {
// // return <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.task.id}`}></Link>
// return <a className="line_1 color-grey3" onClick={(e) => { goToDeatil(e, record.task.id) }}> </a >
// }
// }
];
{
title: '手机号码',
dataIndex: 'phone',
width: 100,
key: 'phone',
fixed: 'left',
},
{
title: '工作单位',
dataIndex: 'workplace',
},
{
title: '单位类别',
dataIndex: 'workplaceType',
},
{
title: '工作性质',
dataIndex: 'workNature',
},
{
title: '专业职称',
dataIndex: 'professionalTitle',
},
{
title: '职称职级',
dataIndex: 'professionalYears',
},
{
title: '专业类别',
dataIndex: 'expertType',
},
{
title: '评审领域1',
dataIndex: 'reviewAreaOne',
},
{
title: '评审领域2',
dataIndex: 'reviewAreaTwo',
},
{
title: '评审领域3',
dataIndex: 'reviewAreaThree',
},
{
title: '毕业院校',
dataIndex: 'graduatedFrom',
},
{
title: '院校专业',
dataIndex: 'major',
},
{
title: '身份证号',
dataIndex: 'idNumber',
},
{
title: '邮箱地址',
dataIndex: 'expertEmail',
},
{
title: '开户银行',
dataIndex: 'bankName',
},
{
title: '银行账号',
dataIndex: 'bankAccount',
},
{
title: '个人简介',
dataIndex: 'resume',
},
// {
// title: '',
// dataIndex: 'titleCertificate',
// },
// {
// title: '',
// dataIndex: 'academicAchievements',
// },
// {
// title: '',
// dataIndex: 'honors',
// },
// {
// title: '',
// dataIndex: 'action',
// render: (text, record) => {
// // return <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.task.id}`}></Link>
// return <a className="line_1 color-grey3" onClick={(e) => { goToDeatil(e, record.task.id) }}> </a >
// }
// }
];
}, []);
//
useEffect(() => {
setLoading(true);
let params = {
...searchObj,
pageSize,
currentPage,
status: '',
reviewArea:'',
statusString:''
}
expertList(params).then(data => {
if (data && Array.isArray(data.rows)) {
for (const item of data.rows) {
item.detail = item.paperDetail && item.paperDetail.content;
//
useEffect(() => {
setLoading(true);
let params = {
...searchObj,
pageSize,
curPage,
status: '',
reviewArea: '',
statusString: '',
};
// ?curPage=1&expertType=&orderBy=&pageSize=10&reviewArea=&searchInput=&statusString=
expertList(params).then(data => {
if (data && Array.isArray(data.rows)) {
for (const item of data.rows) {
item.detail = item.paperDetail && item.paperDetail.content;
}
}
}
setDataList(data.rows || []);
setLoading(false);
setTotal(data.total);
});
}, [currentPage]);
setDataList(data.rows || []);
setLoading(false);
setTotal(data.total);
});
}, [curPage]);
return(
return (
<div className="expert-list centerbox">
<Paginationtable
loading={loading}
dataSource={dataList}
columns={columns}
// handleRow
total={total}
setCurrentPage={setCurrentPage}
current={currentPage}
<Paginationtable
loading={loading}
dataSource={dataList}
columns={columns}
// handleRow
total={total}
setCurrentPage={setCurrentPage}
current={curPage}
scroll={{ x: 1500, y: 600 }}
/>
</div>)
}

View File

@ -0,0 +1,5 @@
.expert-list{
.ant-table-thead > tr > th, .ant-table-tbody > tr > td{
padding:16px 6px;
}
}