新增我的任务,修改issue

This commit is contained in:
何童崇 2021-12-31 09:37:54 +08:00
parent ede5ab8957
commit 6fe3928a6e
15 changed files with 775 additions and 443 deletions

View File

@ -3,11 +3,12 @@ import { Table, Pagination } from 'antd';
import './index.scss'; import './index.scss';
export default (props) => { export default (props) => {
const { loading, dataSource, columns, handleRow, total, setCurPage, current, rowSelection, expandedRowRender, expandIconColumnIndex } =props; const { loading, dataSource, columns, handleRow, total, setCurPage, current, rowSelection, expandedRowRender, expandIconColumnIndex, onShowSizeChange,showSizeChanger } = props;
return ( return (
<div className='pagination-table'> <div className='pagination-table'>
<Table <Table
{...props}
loading={loading} loading={loading}
rowKey={(row) => row.id} rowKey={(row) => row.id}
dataSource={dataSource} dataSource={dataSource}
@ -17,14 +18,15 @@ export default (props) => {
rowSelection={rowSelection} rowSelection={rowSelection}
expandedRowRender={expandedRowRender} expandedRowRender={expandedRowRender}
expandIconColumnIndex={expandIconColumnIndex} expandIconColumnIndex={expandIconColumnIndex}
{...props}
/> />
{total > 10 && {total > 10 &&
<Pagination <Pagination
showQuickJumper showQuickJumper
onShowSizeChange={onShowSizeChange}
onChange={setCurPage} onChange={setCurPage}
current={current} current={current}
total={total} total={total}
showSizeChanger
/>} />}
</div> </div>

View File

@ -11,16 +11,6 @@ import { getUserInfo } from './expert/api';
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC"; import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
import './index.scss'; import './index.scss';
const Register = Loadable({
loader: () => import("./expert/register"),
loading: Loading,
});
const ExpertList = Loadable({
loader: () => import("./expert/expertList"),
loading: Loading,
});
const Review = Loadable({ const Review = Loadable({
loader: () => import("./expert/review/review"), loader: () => import("./expert/review/review"),
loading: Loading, loading: Loading,
@ -31,8 +21,12 @@ const AdminRouter = Loadable({
loading: Loading, loading: Loading,
}); });
const ReviewTasks = Loadable({ // const ReviewTasks = Loadable({
loader: () => import("./expert/reviewTasks"), // loader: () => import("./expert/reviewTasks"),
// loading: Loading,
// })
const ExpertUser = Loadable({
loader: () => import("./expert/expertUser"),
loading: Loading, loading: Loading,
}) })
const Expert = (propsTransmit) => { const Expert = (propsTransmit) => {
@ -54,18 +48,14 @@ const Expert = (propsTransmit) => {
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<Switch {...propsF}> <Switch {...propsF}>
{/* 专家注册、专家评审任务 */}
<Route <Route
path="/expert/register" path="/expert/user/:functional"
render={(props) => ( render={(props) => (
<Register {...propsF} {...props} /> <ExpertUser {...propsF} {...props} />
)}
></Route>
<Route
path="/expert/tasks"
render={(props) => (
<ReviewTasks {...propsF} {...props} />
)} )}
></Route> ></Route>
{/* 管理员管理 */} {/* 管理员管理 */}
<Route <Route
path="/expert/admin/:admin" path="/expert/admin/:admin"

View File

@ -65,10 +65,19 @@ export async function registerCheck(data){
return res; return res;
} }
// 获取用户信息 // 获取文件信息
export function getFile(id) { export function getFile(id) {
return fetch({ return fetch({
url: `/busiAttachments/${id}`, url: `/busiAttachments/${id}`,
method: 'get' method: 'get'
}); });
} }
// 获取评审任务列表
export function getExpertTasks(params) {
return fetch({
url: `/api/taskExpert/getExpertTasksPageList`,
method: 'get',
params,
});
}

View File

@ -16,19 +16,26 @@ const Option = Select.Option;
function RegisterList({ showNotification }) { function RegisterList({ showNotification }) {
const [reload, setReload] = useState(); const [reload, setReload] = useState();
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [downloading, setDownloading] = useState(false);
const [curPage, setCurPage] = useState(1); const [curPage, setCurPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [dataList, setDataList] = useState([]); const [dataList, setDataList] = useState([]);
const [total, setTotal] = useState(0); const [total, setTotal] = useState(0);
const [searchInput, setSearchInput] = useState(''); const [searchInput, setSearchInput] = useState('');
const [searchReviewArea, setSearchReviewArea] = useState(''); const [searchReviewArea, setSearchReviewArea] = useState('');
const [expertType, setExpertType] = useState('') const [expertType, setExpertType] = useState('')
const [pageSize, setPageSize] = useState(10);
const [uploadExpertList, setUploadExpertList] = useState([]); const [uploadExpertList, setUploadExpertList] = useState([]);
const [uploadExpertIds, setUploadExpertIds] = useState([]); const [uploadExpertIds, setUploadExpertIds] = useState([]);
const [dataAll, setDataAll] = useState([]); const [dataAll, setDataAll] = useState([]);
const [download, setDownload] = useState(); const [download, setDownload] = useState();
const [downloading, setDownloading] = useState(false);
function onShowSizeChange(current, pageSize){
setCurPage(current);
setPageSize(pageSize);
}
console.log(pageSize);
const columns = useMemo(() => { const columns = useMemo(() => {
return [{ return [{
title: '姓名', title: '姓名',
@ -164,7 +171,7 @@ function RegisterList({ showNotification }) {
setLoading(false); setLoading(false);
setTotal(data.total); setTotal(data.total);
}); });
}, [curPage, reload, searchInput, searchReviewArea, expertType]); }, [curPage, reload, searchInput, searchReviewArea, expertType, pageSize]);
// //
useEffect(() => { useEffect(() => {
@ -311,6 +318,8 @@ function RegisterList({ showNotification }) {
setCurPage={setCurPage} setCurPage={setCurPage}
current={curPage} current={curPage}
scroll={{ x: 2300 }} scroll={{ x: 2300 }}
onShowSizeChange={onShowSizeChange}
showSizeChanger
/> />
<Table <Table

View File

@ -0,0 +1,58 @@
import React from "react";
import { Route, Switch, Link } from "react-router-dom";
import Loadable from "react-loadable";
import Loading from "src/Loading";
import '../index.scss';
import './index.scss';
const Register = Loadable({
loader: () => import("../register"),
loading: Loading,
});
const ReviewTasks = Loadable({
loader: () => import("../reviewTasks"),
loading: Loading,
})
const ExpertUser = (props) => {
const functional = props.match.params.functional;
return (
<div className="centerbox detail">
<div className="navigation">
<span>专家评审系统</span>&nbsp;&gt;&nbsp;
{functional === 'register' && <Link to="/expert/user/register">登记专家资料</Link>}
{functional === 'tasks' && <Link to="/expert/user/tasks">我的评审任务</Link>}
</div>
<div className='center_flex'>
<div className='register_left'>
<Link to="/expert/user/register" className={`${functional === 'register' && 'active'}`}>登记专家资料</Link>
<Link to="/expert/user/tasks" className={`${functional === 'tasks' && 'active'}`}>我的评审任务</Link>
</div>
<Switch {...props}>
<Route
path="/expert/user/register"
render={(props) => (
<Register {...props} />
)}
></Route>
<Route
path="/expert/user/tasks"
render={(props) => (
<ReviewTasks {...props} />
)}
></Route>
</Switch>
</div>
</div>
);
}
export default ExpertUser;

View File

@ -0,0 +1,46 @@
.centerbox.detail {
font-size: 20px;
.navigation {
font-size: 0.6em;
margin: -35px 0 15px;
}
.center_flex {
display: flex;
justify-content: space-between;
.register_left {
display: flex;
flex-direction: column;
height: 10em;
width: 10em;
font-size: 0.7em;
background-color: white;
padding: 0.4vw;
flex: none;
a{
padding: 0 1.3em;
height: 2.55em;
line-height: 2.55em;
border-radius: 4px;
&:hover{
color: #4154f1;
}
&.active {
color: white;
background-color: #4154f1;
&:hover{
opacity: .8;
}
}
}
}
.register_right {
flex: auto;
background-color: white;
margin-left: 2em;
}
}
}

View File

@ -30,6 +30,10 @@ export default Form.create()(({ match, history, showNotification, form, current_
const [reload, setReload] = useState(); const [reload, setReload] = useState();
const [reviewAreaOne, setReviewAreaOne] = useState();
const [reviewAreaTwo, setReviewAreaTwo] = useState();
const [reviewAreaThree, setReviewAreaThree] = useState();
// //
useEffect(() => { useEffect(() => {
let params = {}; let params = {};
@ -234,19 +238,7 @@ export default Form.create()(({ match, history, showNotification, form, current_
return ( return (
<div className="centerbox detail">
<div className="navigation">
<span>专家评审系统</span>&nbsp;&gt;&nbsp;<span>登记专家资料</span>
</div>
<div className='center_flex'>
<div className='register_left'>
<button className="but41_fill">登记专家资料</button>
</div>
<div className='register_right'> <div className='register_right'>
{/* <p>
{lastRegister && lastRegister.status === -1 ? "您的资料正在审核,请稍候" : lastRegister && lastRegister.status === 2 ? "您提交的资料已被拒绝,请完善资料后重新提交" : "专家资料"}
</p> */}
{ {
lastRegister && lastRegister.status === -1 && <p className='checking'> lastRegister && lastRegister.status === -1 && <p className='checking'>
您的资料正在审核请稍候 您的资料正在审核请稍候
@ -257,6 +249,11 @@ export default Form.create()(({ match, history, showNotification, form, current_
您提交的资料已被拒绝请完善资料后重新提交 您提交的资料已被拒绝请完善资料后重新提交
</p> </p>
} }
{
lastRegister && lastRegister.status === 1 && <p className='succeed'>
您已经是专家了如果修改资料修改后的资料需要管理员重新审核审核过程中不会影响您的专家身份
</p>
}
{ {
(!lastRegister || (lastRegister && lastRegister.status === 3)) && <p>专家资料</p> (!lastRegister || (lastRegister && lastRegister.status === 3)) && <p>专家资料</p>
} }
@ -331,9 +328,16 @@ export default Form.create()(({ match, history, showNotification, form, current_
{ {
helper('评审领域2', helper('评审领域2',
'reviewAreaTwo', [], 'reviewAreaTwo', [],
<Select disabled={forbidden} placeholder="请选择" dropdownClassName="expert_register"> <Select
disabled={forbidden}
placeholder="请选择"
dropdownClassName="expert_register"
onChange={(value) => { setReviewAreaTwo(value) }}
>
{reviewArea.map(item => { {reviewArea.map(item => {
return <Option key={item.value} value={item.value}>{item.label}</Option> return <Option key={item.value} value={item.value}
disabled={item.value === reviewAreaOne || item.value === reviewAreaThree}
>{item.label}</Option>
})} })}
</Select> </Select>
) )
@ -443,9 +447,16 @@ export default Form.create()(({ match, history, showNotification, form, current_
helper('评审领域1', helper('评审领域1',
'reviewAreaOne', 'reviewAreaOne',
[{ required: true, message: "请选择评审领域" }], [{ required: true, message: "请选择评审领域" }],
<Select disabled={forbidden} placeholder="请选择" dropdownClassName="expert_register"> <Select
disabled={forbidden}
placeholder="请选择"
dropdownClassName="expert_register"
onChange={(value) => { setReviewAreaOne(value) }}
>
{reviewArea.map(item => { {reviewArea.map(item => {
return <Option key={item.value} value={item.value}>{item.label}</Option> return <Option key={item.value} value={item.value}
disabled={item.value === reviewAreaTwo || item.value === reviewAreaThree}
>{item.label}</Option>
})} })}
</Select> </Select>
) )
@ -453,9 +464,16 @@ export default Form.create()(({ match, history, showNotification, form, current_
{ {
helper('评审领域3', helper('评审领域3',
'reviewAreaThree', [], 'reviewAreaThree', [],
<Select disabled={forbidden} placeholder="请选择" dropdownClassName="expert_register"> <Select
disabled={forbidden}
placeholder="请选择"
dropdownClassName="expert_register"
onChange={(value) => { setReviewAreaThree(value) }}
>
{reviewArea.map(item => { {reviewArea.map(item => {
return <Option key={item.value} value={item.value}>{item.label}</Option> return <Option key={item.value} value={item.value}
disabled={item.value === reviewAreaTwo || item.value === reviewAreaOne}
>{item.label}</Option>
})} })}
</Select> </Select>
) )
@ -548,7 +566,5 @@ export default Form.create()(({ match, history, showNotification, form, current_
</Modal> </Modal>
</div> </div>
</div> </div>
</div>
</div>
) )
}) })

View File

@ -1,18 +1,3 @@
.iconfont2 {
font-family: "svgtofont" !important;
font-size: 26px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;
}
.centerbox.detail {
font-size: 20px;
.navigation {
font-size: 0.6em;
margin: -35px 0 15px;
}
.center_flex { .center_flex {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@ -35,15 +20,20 @@
} }
.fail { .fail {
background: #FFEFEF; background: #ffefef;
border: 1px solid #FF3838; border: 1px solid #ff3838;
color: #FF3838; color: #ff3838;
} }
.checking { .checking {
background: #EDF2FF; background: #edf2ff;
border: 1px solid #4154F1; border: 1px solid #4154f1;
color: #4154F1; color: #4154f1;
}
.succeed {
background: #edf2ff;
border: 1px solid green;
color: green;
} }
.ant-form { .ant-form {
display: flex; display: flex;
@ -64,27 +54,30 @@
.ant-form-item-required::before { .ant-form-item-required::before {
position: relative; position: relative;
top: -1px; top: -1px;
content: url('./image/required.svg'); content: url("./image/required.svg");
} }
.ant-form-item-control-wrapper { .ant-form-item-control-wrapper {
width: 70%; width: 70%;
display: inline-block; display: inline-block;
} }
.ant-input, .ant-select-selection{ .ant-input,
.ant-select-selection {
// width: 30.1em; // width: 30.1em;
box-shadow: none; box-shadow: none;
&:focus, &:hover{ &:focus,
border: 1px solid #4154F1 !important; &:hover {
border: 1px solid #4154f1 !important;
} }
} }
tr td:first-child .ant-row.ant-form-item { tr td:first-child .ant-row.ant-form-item {
margin-right: 9em; margin-right: 9em;
} }
& .ant-input, .ant-input .ant-input-suffix { & .ant-input,
background-color: #FFFFFF !important; .ant-input .ant-input-suffix {
background-color: #ffffff !important;
} }
& .ant-select-open .ant-select-selection { & .ant-select-open .ant-select-selection {
border: 1px solid #4154F1 !important; border: 1px solid #4154f1 !important;
} }
& .ant-form-item { & .ant-form-item {
margin-bottom: 0.5em; margin-bottom: 0.5em;
@ -99,7 +92,6 @@
& .ant-cascader-menu-item:hover { & .ant-cascader-menu-item:hover {
background: #f2f3ff; background: #f2f3ff;
} }
} }
& .buts { & .buts {
font-size: 0.7em; font-size: 0.7em;
@ -108,7 +100,6 @@
} }
} }
} }
}
.expert_register .ant-select-dropdown-menu-item:hover, .expert_register .ant-select-dropdown-menu-item:hover,
.ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled) { .ant-select-dropdown-menu-item-active:not(.ant-select-dropdown-menu-item-disabled) {
background-color: #f2f3ff; background-color: #f2f3ff;

View File

@ -143,6 +143,11 @@ function RegisterList({ showNotification, form }) {
]; ];
}, []); }, []);
function onShowSizeChange(current, pageSize){
setCurPage(current);
setPageSize(pageSize);
}
// //
useEffect(() => { useEffect(() => {
setLoading(true); setLoading(true);
@ -223,8 +228,7 @@ function RegisterList({ showNotification, form }) {
return ( return (
<div className="expert-list centerbox"> <div className="expert-list centerbox">
<div className="center-screen" > <div className="center-screen mb30" >
<div className="center-right-but">
<Search <Search
maxLength={20} maxLength={20}
style={{ width: "300px" }} style={{ width: "300px" }}
@ -232,7 +236,6 @@ function RegisterList({ showNotification, form }) {
onSearch={(value) => { setSearchInput(value); setCurPage(1); }} onSearch={(value) => { setSearchInput(value); setCurPage(1); }}
/> />
</div> </div>
</div>
<Paginationtable <Paginationtable
loading={loading} loading={loading}
dataSource={dataList} dataSource={dataList}
@ -241,6 +244,8 @@ function RegisterList({ showNotification, form }) {
setCurPage={setCurPage} setCurPage={setCurPage}
current={curPage} current={curPage}
scroll={{ x: 2300 }} scroll={{ x: 2300 }}
onShowSizeChange={onShowSizeChange}
showSizeChanger
/> />
<Modal <Modal

View File

@ -16,7 +16,7 @@ function Review(){
<p className="ne_title">红山开源平台专家评审系统</p> <p className="ne_title">红山开源平台专家评审系统</p>
<p className="ne_tips">您尚未被入选本平台专家团队可提交专家资料进行注册申请加入专家团队</p> <p className="ne_tips">您尚未被入选本平台专家团队可提交专家资料进行注册申请加入专家团队</p>
<p className="ne_bar"></p> <p className="ne_bar"></p>
<Link to='/expert/register'><button className="but41_fill">专家注册</button></Link> <Link to='/expert/user/register'><button className="but41_fill">专家注册</button></Link>
</div> </div>
</div>) </div>)
} }

View File

@ -1,9 +1,161 @@
import React from "react"; import React, { useState, useCallback, useMemo, useEffect } from "react";
import { Link } from "react-router-dom"; import { Input, Select, Button, Form, DatePicker, Table, Pagination, Upload, Modal } from 'antd';
import cookie from 'react-cookies';
import { exportExcel } from '../components/exportExcel.js';
import Paginationtable from "../../components/paginationTable";
import { Info } from '../../components/ModalFun';
import { getExpertTasks } from "../api";
import { taskType } from "../static";
import { httpUrl } from '../fetch';
import './index.scss';
import '../index.scss';
const { Search } = Input;
const Option = Select.Option;
function ReviewTasks({ form, showNotification, match, history }) {
const { getFieldDecorator, setFieldsValue, getFieldsValue } = form;
const [reload, setReload] = useState();
const [loading, setLoading] = useState(false);
const [curPage, setCurPage] = useState(1);
const [pageSize, setPageSize] = useState(10);
const [dataList, setDataList] = useState([]);
const [total, setTotal] = useState(0);
const [searchObj, setSearchObj] = useState({
containerName: '',
containerType: 1
});
const columns = useMemo(() => {
return [
{
title: '序号',
dataIndex: 'index',
render: (text, record, index) => {
return index + 1
}
},
{
title: '任务名称',
dataIndex: 'expertName',
width: 75,
key: 'expertName',
// render: (text, record) => {
// return record.user ? record.user.nickname || record.user.login : ''
// }
},
{
title: '评审截止时间',
dataIndex: 'highestDegree',
key: 'highestDegree',
},
{
title: '剩余评审时间',
dataIndex: 'phone',
key: 'phone',
},
{
title: '评审状态',
dataIndex: 'workplace',
key: 'workplace',
},
];
}, []);
//
useEffect(() => {
setLoading(true);
let params = {
...searchObj,
pageSize,
curPage,
statusString: '1,-1',
};
getExpertTasks(params).then(data => {
setDataList(data.rows || []);
setLoading(false);
setTotal(data.total);
});
}, [curPage, reload, pageSize]);
function onSearch() {
let values = getFieldsValue(['nameInput', 'endTime', 'startTime', 'enterpriseNameInput']);
if (values.checkStatus === '0,1,2') values.checkStatus = '';
setSearchObj(values);
}
function clearSearch() {
setFieldsValue({
containerName: '',
containerType: 1,
});
setSearchObj({
containerName: '',
containerType: 1,
});
}
const helper = useCallback(
(label, name, rules, widget, initialValue) => (
<Form.Item label={label}>
{getFieldDecorator(name, { rules, initialValue, validateFirst: true, })(widget)}
</Form.Item>
), []);
function ReviewTasks() {
return ( return (
<div>aaa</div> <div className='register_right'>
<p>
我的评审任务
</p>
<div className="search-screen" >
{helper(
"任务名称",
"containerName",
[{ max: 20, message: '长度不能超过20个字符' }],
<Input
placeholder="输入任务名称进行检索"
/>
)}
{helper(
"任务类型",
"containerType",
[],
<Select
style={{ width: "200px" }}
placeholder="所有领域"
dropdownClassName="expert_register"
// onChange={(value) => { setSearchReviewArea(value) }}
>
{taskType.map(item => {
return <Option key={item.value} value={item.value}>{item.label}</Option>
})}
</Select>,
1
)}
<div className="button-div">
{/* <a href="/admin/tasks.xlsx" class="fr edu-default-btn edu-blueback-btn plr30">导出</a> */}
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
<Button className="mr10" onClick={clearSearch}>清除</Button>
</div>
</div>
<Paginationtable
loading={loading}
dataSource={dataList}
columns={columns}
total={total}
setCurPage={setCurPage}
current={curPage}
/>
</div>
) )
} }
export default ReviewTasks; export default Form.create()(ReviewTasks);

View File

@ -0,0 +1,16 @@
.register_right {
flex: auto;
.search-screen > .ant-row {
min-width: 36%;
}
p{
border-bottom: 1px solid #eeeeee;
padding: 0.5em 2em;
color: #181818;
font-size: 0.8em;
font-weight: bold;
}
.button-div{
line-height: 1.5;
}
}

View File

@ -52,3 +52,8 @@ export const reviewArea = [
{ value: "文学交流", label: "文学交流" }, { value: "文学交流", label: "文学交流" },
{ value: "体育活动", label: "体育活动" } { value: "体育活动", label: "体育活动" }
]; ];
export const taskType = [
{ value: 1, label: "创客评审任务" },
{ value: 2, label: "竞赛评审任务" },
];

View File

@ -228,6 +228,39 @@
text-align: left; text-align: left;
} }
.search-screen {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
margin: 1.25rem 0;
padding: 1.25rem;
background-color: #fff;
border-bottom: 1px solid #dedede;
> .ant-row {
min-width: 41%;
margin-right: 2rem;
.ant-form-item-label {
float: left;
}
.ant-form-item-control-wrapper {
overflow: hidden;
}
}
.center-right-but {
.ant-form-item {
margin: 0 1rem 0 0;
}
.ant-form-item-control-wrapper {
display: inline-block;
}
}
.button-div {
margin-right: 1.5rem;
}
}
@media screen and (max-width: 1200px) { @media screen and (max-width: 1200px) {
.centerbox { .centerbox {
width: 98%; width: 98%;

View File

@ -770,7 +770,7 @@ class NewHeader extends Component {
<div className="head-right"> <div className="head-right">
{this.props.user && this.props.user.login && {this.props.user && this.props.user.login &&
<div className='mr30'> <div className='mr30'>
<a href={this.state.isExpert ? '/expert/tasks' :'/expert'}> <a href={this.state.isExpert ? '/expert/user/tasks' :'/expert'}>
<i className="iconfont icon-xiaoxilingdang color-grey-6"></i> <i className="iconfont icon-xiaoxilingdang color-grey-6"></i>
</a> </a>
</div> </div>