From 72d060393dd0fd0f2ade27aba04a6e5e2dc24cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=AB=A5=E5=B4=87?= <1261960504@qq.com> Date: Sat, 18 Dec 2021 17:30:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=93=E5=AE=B6=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/military/components/adminRouter/index.jsx | 11 + .../components/paginationTable/index.jsx | 4 +- src/military/expert.js | 15 +- .../{expertAdminRouter.js => adminRouter.js} | 18 +- src/military/expert/api.js | 12 +- src/military/expert/expertList/index.jsx | 95 +++++---- src/military/expert/register/index.jsx | 3 +- src/military/expert/registerList/index.jsx | 201 ++++++++++++++++++ src/military/expert/registerList/index.scss | 5 + 9 files changed, 314 insertions(+), 50 deletions(-) rename src/military/expert/{expertAdminRouter.js => adminRouter.js} (61%) create mode 100644 src/military/expert/registerList/index.jsx create mode 100644 src/military/expert/registerList/index.scss diff --git a/src/military/components/adminRouter/index.jsx b/src/military/components/adminRouter/index.jsx index d9d1960f..9a4602ca 100644 --- a/src/military/components/adminRouter/index.jsx +++ b/src/military/components/adminRouter/index.jsx @@ -45,6 +45,13 @@ export default props => { }); + const expertMenu = useMemo(() => { + return + 专家注册审核 + 专家库 + + }); + const userMenu = useMemo(() => { return 用户列表 @@ -116,6 +123,10 @@ export default props => {
竞赛
+ +
专家
+
+
用户
diff --git a/src/military/components/paginationTable/index.jsx b/src/military/components/paginationTable/index.jsx index 07977e97..f834a62b 100644 --- a/src/military/components/paginationTable/index.jsx +++ b/src/military/components/paginationTable/index.jsx @@ -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 ( @@ -18,7 +18,7 @@ export default (props) => { /> {total > 10 && } diff --git a/src/military/expert.js b/src/military/expert.js index 41bcff7a..4cf55a7d 100644 --- a/src/military/expert.js +++ b/src/military/expert.js @@ -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) => { )} > - ( - + )} > { )} > + + ); diff --git a/src/military/expert/expertAdminRouter.js b/src/military/expert/adminRouter.js similarity index 61% rename from src/military/expert/expertAdminRouter.js rename to src/military/expert/adminRouter.js index 41ef9d0a..5c7b3011 100644 --- a/src/military/expert/expertAdminRouter.js +++ b/src/military/expert/adminRouter.js @@ -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) => { - {/* 任务管理审核 */} + {/* 专家审核 */} ( + + )} + > + {/* 专家库列表 */} + ( )} diff --git a/src/military/expert/api.js b/src/military/expert/api.js index 7627199c..f9b9935a 100644 --- a/src/military/expert/api.js +++ b/src/military/expert/api.js @@ -34,4 +34,14 @@ export async function expertRegister(data){ data, }); return res; -} \ No newline at end of file +} + +//管理员审核专家信息 +export async function registerCheck(data){ + let res = await fetch({ + url: '/api/experts/adminCheckExpert', + method: 'post', + data, + }); + return res; +} diff --git a/src/military/expert/expertList/index.jsx b/src/military/expert/expertList/index.jsx index 55bdf504..167492d5 100644 --- a/src/military/expert/expertList/index.jsx +++ b/src/military/expert/expertList/index.jsx @@ -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 查看详情 - // return { goToDeatil(e, record.task.id) }}> 查看详情 - // } - // } + // { + // 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 (
+
+
+ { setSearchInput(value); setCurPage(1); }} + /> +
+
) } -export default List; \ No newline at end of file +export default RegisterList; \ No newline at end of file diff --git a/src/military/expert/register/index.jsx b/src/military/expert/register/index.jsx index 81dea6b1..b64f7646 100644 --- a/src/military/expert/register/index.jsx +++ b/src/military/expert/register/index.jsx @@ -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'; diff --git a/src/military/expert/registerList/index.jsx b/src/military/expert/registerList/index.jsx new file mode 100644 index 00000000..86cfeaf9 --- /dev/null +++ b/src/military/expert/registerList/index.jsx @@ -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 + + + + } + } + ]; + }, []); + + // 获取列表 + 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 ( +
+
+
+ { setSearchInput(value); setCurPage(1); }} + /> +
+
+ +
) +} +export default RegisterList; \ No newline at end of file diff --git a/src/military/expert/registerList/index.scss b/src/military/expert/registerList/index.scss new file mode 100644 index 00000000..443ae6dc --- /dev/null +++ b/src/military/expert/registerList/index.scss @@ -0,0 +1,5 @@ +.expert-list{ + .ant-table-thead > tr > th, .ant-table-tbody > tr > td{ + padding:16px 6px; + } +} \ No newline at end of file