forked from Gitlink/forgeplus-react
修改专家注册审核
This commit is contained in:
parent
d7b879920a
commit
72d060393d
|
@ -45,6 +45,13 @@ export default props => {
|
|||
</Menu>
|
||||
});
|
||||
|
||||
const expertMenu = useMemo(() => {
|
||||
return <Menu>
|
||||
<Menu.Item><Link to={`/expert/admin/register`}>专家注册审核</Link></Menu.Item>
|
||||
<Menu.Item><Link to={`/expert/admin/list`}>专家库</Link></Menu.Item>
|
||||
</Menu>
|
||||
});
|
||||
|
||||
const userMenu = useMemo(() => {
|
||||
return <Menu>
|
||||
<Menu.Item><a target="_blank" rel="noopener noreferrer" href={`${main_web_site_url}/managements/users`}>用户列表</a></Menu.Item>
|
||||
|
@ -116,6 +123,10 @@ export default props => {
|
|||
<div className="drop-div">竞赛</div>
|
||||
</Dropdown>
|
||||
|
||||
<Dropdown key={'expert'} overlay={expertMenu} placement="bottomLeft">
|
||||
<div className="drop-div">专家</div>
|
||||
</Dropdown>
|
||||
|
||||
<Dropdown key={'userMenu'} overlay={userMenu} placement="bottomLeft">
|
||||
<div className="drop-div">用户</div>
|
||||
</Dropdown>
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Table, Pagination } from 'antd';
|
|||
import './index.scss';
|
||||
|
||||
export default (props) => {
|
||||
const { loading, dataSource, columns, handleRow, total, setCurrentPage, current } =props;
|
||||
const { loading, dataSource, columns, handleRow, total, setCurPage, current } =props;
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
@ -18,7 +18,7 @@ export default (props) => {
|
|||
/>
|
||||
{total > 10 &&
|
||||
<Pagination
|
||||
onChange={setCurrentPage}
|
||||
onChange={setCurPage}
|
||||
current={current}
|
||||
total={total}
|
||||
/>}
|
||||
|
|
|
@ -26,6 +26,12 @@ const Review = Loadable({
|
|||
loading: Loading,
|
||||
});
|
||||
|
||||
const AdminRouter = Loadable({
|
||||
loader: () => import("./expert/adminRouter"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
|
||||
const Expert = (propsTransmit) => {
|
||||
|
||||
// 开发时,从代理的位置获取用户信息
|
||||
|
@ -51,10 +57,11 @@ const Expert = (propsTransmit) => {
|
|||
<Register {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
path="/expert/list"
|
||||
{/* 管理员管理 */}
|
||||
<Route
|
||||
path="/expert/admin/:admin"
|
||||
render={(props) => (
|
||||
<ExpertList {...propsF} {...props} />
|
||||
<AdminRouter {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
<Route
|
||||
|
@ -63,6 +70,8 @@ const Expert = (propsTransmit) => {
|
|||
<Review {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
|
|
|
@ -5,11 +5,16 @@ import Loadable from "react-loadable";
|
|||
import Loading from "../../Loading";
|
||||
import AdminRouter from "../components/adminRouter";
|
||||
|
||||
|
||||
// 专家库
|
||||
const ExpertList = Loadable({
|
||||
loader: () => import("./expertList"),
|
||||
loading: Loading,
|
||||
});
|
||||
// 专家审核
|
||||
const RegisterList = Loadable({
|
||||
loader: () => import("./registerList"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
|
||||
const AdminPage = (propsF) => {
|
||||
|
@ -18,9 +23,16 @@ const AdminPage = (propsF) => {
|
|||
<React.Fragment>
|
||||
<AdminRouter {...propsF} />
|
||||
<Switch {...propsF}>
|
||||
{/* 任务管理审核 */}
|
||||
{/* 专家审核 */}
|
||||
<Route
|
||||
path="/admin/expert/list"
|
||||
path="/expert/admin/register"
|
||||
render={(props) => (
|
||||
<RegisterList {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
{/* 专家库列表 */}
|
||||
<Route
|
||||
path="/expert/admin/list"
|
||||
render={(props) => (
|
||||
<ExpertList {...propsF} {...props} />
|
||||
)}
|
|
@ -34,4 +34,14 @@ export async function expertRegister(data){
|
|||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
//管理员审核专家信息
|
||||
export async function registerCheck(data){
|
||||
let res = await fetch({
|
||||
url: '/api/experts/adminCheckExpert',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -1,20 +1,19 @@
|
|||
import React, { useState, useMemo, useEffect } from "react";
|
||||
import { Input, Select, Button, Form, DatePicker, Table, Pagination, Modal } from 'antd';
|
||||
import Paginationtable from "../../components/paginationTable";
|
||||
import { expertList } from "../api";
|
||||
import { expertList, registerCheck } from "../api";
|
||||
|
||||
import './index.scss';
|
||||
const { Search } = Input;
|
||||
|
||||
|
||||
|
||||
|
||||
function List() {
|
||||
|
||||
function RegisterList({ showNotification }) {
|
||||
const [reload, setReload] = useState();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [curPage, setCurrentPage] = useState(1);
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [dataList, setDataList] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [searchObj, setSearchObj] = useState({});
|
||||
const [pageSize, setCurrentPageSize] = useState(10);
|
||||
const [searchInput, setSearchInput] = useState('');
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [{
|
||||
|
@ -105,27 +104,18 @@ function List() {
|
|||
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 >
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// title: '职称证明',
|
||||
// dataIndex: 'titleCertificate',
|
||||
// },
|
||||
// {
|
||||
// title: '学术成果',
|
||||
// dataIndex: 'academicAchievements',
|
||||
// },
|
||||
// {
|
||||
// title: '荣誉称号',
|
||||
// dataIndex: 'honors',
|
||||
// },
|
||||
];
|
||||
}, []);
|
||||
|
||||
|
@ -133,12 +123,10 @@ function List() {
|
|||
useEffect(() => {
|
||||
setLoading(true);
|
||||
let params = {
|
||||
...searchObj,
|
||||
searchInput,
|
||||
pageSize,
|
||||
curPage,
|
||||
status: '',
|
||||
reviewArea: '',
|
||||
statusString: '-1,1,2',
|
||||
statusString: '1',
|
||||
};
|
||||
expertList(params).then(data => {
|
||||
if (data && Array.isArray(data.rows)) {
|
||||
|
@ -150,21 +138,50 @@ function List() {
|
|||
setLoading(false);
|
||||
setTotal(data.total);
|
||||
});
|
||||
}, [curPage]);
|
||||
}, [curPage, reload, searchInput]);
|
||||
|
||||
function check(record, checkStatus) {
|
||||
Modal.confirm({
|
||||
title: "警告",
|
||||
content: checkStatus == '1' ? "确认通过吗?通过后该用户将成为专家库的一员" : "确认拒绝吗?拒绝后该用户此次不能成为专家",
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
registerCheck({
|
||||
expertId: record.id,
|
||||
isPassed: checkStatus,
|
||||
userId: record.userId,
|
||||
}).then(res => {
|
||||
if (res.message === 'success') {
|
||||
showNotification('操作成功!');
|
||||
setReload(Math.random());
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="expert-list centerbox">
|
||||
<div className="center-screen" >
|
||||
<div className="center-right-but">
|
||||
<Search
|
||||
maxLength={20}
|
||||
style={{ width: "300px" }}
|
||||
placeholder="请输入专家全名或手机号"
|
||||
onSearch={(value) => { setSearchInput(value); setCurPage(1); }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Paginationtable
|
||||
loading={loading}
|
||||
dataSource={dataList}
|
||||
columns={columns}
|
||||
// handleRow
|
||||
total={total}
|
||||
setCurrentPage={setCurrentPage}
|
||||
setCurPage={setCurPage}
|
||||
current={curPage}
|
||||
scroll={{ x: 1500, y: 600 }}
|
||||
scroll={{ x: 1600, y: 600 }}
|
||||
/>
|
||||
</div>)
|
||||
}
|
||||
export default List;
|
||||
export default RegisterList;
|
|
@ -1,6 +1,5 @@
|
|||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { Button, Icon, Form, Modal, Input, Cascader, Select } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import { Button, Icon, Form, Modal, Input, Select } from 'antd';
|
||||
import Upload from '../components/Upload';
|
||||
import { unitType, natureOfWork, highestEducation, positionLevel, professionalType, reviewArea } from '../static';
|
||||
import { expertRegister } from '../api';
|
||||
|
|
|
@ -0,0 +1,201 @@
|
|||
import React, { useState, useMemo, useEffect } from "react";
|
||||
import { Input, Select, Button, Form, DatePicker, Table, Pagination, Modal } from 'antd';
|
||||
import Paginationtable from "../../components/paginationTable";
|
||||
import { expertList, registerCheck } from "../api";
|
||||
|
||||
import './index.scss';
|
||||
const { Search } = Input;
|
||||
|
||||
|
||||
function RegisterList({ showNotification }) {
|
||||
const [reload, setReload] = useState();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [dataList, setDataList] = useState([]);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [searchInput, setSearchInput] = useState('');
|
||||
const [pageSize, setPageSize] = useState(10);
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [{
|
||||
title: '姓名',
|
||||
dataIndex: 'expertName',
|
||||
width: 55,
|
||||
key: 'expertName',
|
||||
fixed: 'left',
|
||||
// render: (text, record) => {
|
||||
// return record.user ? record.user.nickname || record.user.login : ''
|
||||
// }
|
||||
},
|
||||
{
|
||||
title: '最高学历',
|
||||
dataIndex: 'highestDegree',
|
||||
width: 100,
|
||||
key: 'highestDegree',
|
||||
fixed: 'left',
|
||||
},
|
||||
{
|
||||
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',
|
||||
width: 80,
|
||||
fixed: 'right',
|
||||
render: (text, record) => {
|
||||
return <React.Fragment>
|
||||
<Button className="mr5 font-12" type="primary" size="small" onClick={() => { check(record, '1') }}>同意</Button>
|
||||
<Button className="mr5 font-12" type="danger" size="small" onClick={() => { check(record, '2') }}>拒绝</Button>
|
||||
</React.Fragment>
|
||||
}
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
|
||||
// 获取列表
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
let params = {
|
||||
searchInput,
|
||||
pageSize,
|
||||
curPage,
|
||||
statusString: '-1',
|
||||
};
|
||||
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);
|
||||
});
|
||||
}, [curPage, reload, searchInput]);
|
||||
|
||||
function check(record, checkStatus) {
|
||||
Modal.confirm({
|
||||
title: "警告",
|
||||
content: checkStatus == '1' ? "确认通过吗?通过后该用户将成为专家库的一员" : "确认拒绝吗?拒绝后该用户此次不能成为专家",
|
||||
okText: '确定',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
registerCheck({
|
||||
expertId: record.id,
|
||||
isPassed: checkStatus,
|
||||
userId: record.userId,
|
||||
}).then(res => {
|
||||
if (res.message === 'success') {
|
||||
showNotification('操作成功!');
|
||||
setReload(Math.random());
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="expert-list centerbox">
|
||||
<div className="center-screen" >
|
||||
<div className="center-right-but">
|
||||
<Search
|
||||
maxLength={20}
|
||||
style={{ width: "300px" }}
|
||||
placeholder="请输入专家全名或手机号"
|
||||
onSearch={(value) => { setSearchInput(value); setCurPage(1); }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Paginationtable
|
||||
loading={loading}
|
||||
dataSource={dataList}
|
||||
columns={columns}
|
||||
total={total}
|
||||
setCurPage={setCurPage}
|
||||
current={curPage}
|
||||
scroll={{ x: 1600, y: 600 }}
|
||||
/>
|
||||
</div>)
|
||||
}
|
||||
export default RegisterList;
|
|
@ -0,0 +1,5 @@
|
|||
.expert-list{
|
||||
.ant-table-thead > tr > th, .ant-table-tbody > tr > td{
|
||||
padding:16px 6px;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue