新增专家评分页面

This commit is contained in:
何童崇 2022-01-05 10:25:55 +08:00
parent a630cbc9f4
commit 57dc08e59c
5 changed files with 257 additions and 9 deletions

View File

@ -17,6 +17,11 @@ const ReviewTasks = Loadable({
loading: Loading,
})
const TaskDetail = Loadable({
loader: () => import("./taskDetail"),
loading: Loading,
})
const ExpertUser = (propsF) => {
const functional = propsF.match.params.functional;
@ -35,16 +40,31 @@ const ExpertUser = (propsF) => {
<Switch {...propsF}>
<Route
path="/expert/user/register"
path="/expert/user/tasks/:id"
render={(props) => (
<Register {...props} {...propsF}/>
<TaskDetail {...props} {...propsF} />
)}
></Route>
<Route
path="/expert/user/tasks"
render={(props) => (
<ReviewTasks {...props} {...propsF}/>
<ReviewTasks {...props} {...propsF} />
)}
></Route>
<Route
path="/expert/user/register"
render={(props) => (
<Register {...props} {...propsF} />
)}
></Route>
<Route
path="/expert/user"
render={(props) => (
<Register {...props} {...propsF} />
)}
></Route>

View File

@ -1,8 +1,8 @@
import React, { useState, useCallback, useMemo, useEffect } from "react";
import { Input, Select, Button, Form, DatePicker, Table, Pagination, Upload, Modal } from 'antd';
import Paginationtable from "../../../components/paginationTable";
import { getExpertTasks } from "../api";
import { taskType } from "../static";
import { getExpertTasks } from "../../api";
import { taskType } from "../../static";
import { httpUrl } from '../../fetch';
import './index.scss';
@ -76,12 +76,11 @@ function ReviewTasks({ form, showNotification, match, history }) {
setLoading(false);
setTotal(data.total);
});
}, [curPage, reload, pageSize]);
}, [searchObj,curPage, reload, pageSize]);
function onSearch() {
let values = getFieldsValue(['nameInput', 'endTime', 'startTime', 'enterpriseNameInput']);
if (values.checkStatus === '0,1,2') values.checkStatus = '';
let values = getFieldsValue(['containerName', 'containerType']);
setSearchObj(values);
}
@ -94,6 +93,7 @@ function ReviewTasks({ form, showNotification, match, history }) {
containerName: '',
containerType: 1,
});
setCurPage(1);
}
@ -137,7 +137,6 @@ function ReviewTasks({ form, showNotification, match, history }) {
)}
<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>

View File

@ -1,5 +1,6 @@
.register_right.task_right {
background: #fff;
padding-bottom: 1rem;
.search-list {
display: flex;
margin: 0;

View File

@ -0,0 +1,183 @@
import React, { useState, useCallback, useMemo, useEffect } from "react";
import { Tabs, Input, Select, Button, Form, DatePicker, Table, Pagination, Upload, Modal } from 'antd';
import { Link } from "react-router-dom";
import Paginationtable from "../../../components/paginationTable";
import { getExpertTasks } from "../../api";
import { taskType } from "../../static";
import { httpUrl } from '../../fetch';
import './index.scss';
import '../../index.scss';
const Option = Select.Option;
const { TabPane } = Tabs;
function ReviewTasks({ form, showNotification, match, history }) {
const id = match.params.id;
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);
//tab
const [activeKey, setActiveKey] = 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: 'opsContent',
key: 'opsContent',
},
{
title: '附件下载',
dataIndex: 'highestDegree',
key: 'highestDegree',
},
{
title: '评分一',
dataIndex: 'gradesOne',
key: 'gradesOne',
},
{
title: '评分二',
dataIndex: 'gradesTwo',
key: 'gradesTwo',
},
{
title: '评分三',
dataIndex: 'gradesThree',
key: 'gradesThree',
},
{
title: '评分四',
dataIndex: 'gradesFour',
key: 'gradesFour',
},
{
title: '评分五',
dataIndex: 'gradesFive',
key: 'gradesFive',
},
{
title: '平均分',
dataIndex: 'gradesAverage',
key: 'gradesAverage',
},
{
title: '评审意见',
dataIndex: 'comments',
key: 'comments',
},
];
}, []);
//
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 cancel() {
history.go(-1);
}
return (
<div className='register_right task_detail'>
<p className="task-head">
创客成果评审
</p>
<Tabs defaultActiveKey="1" animated={false} onChange={(activeKey) => { setActiveKey(activeKey) }}>
<TabPane tab="评选信息" key="0">
<div>
<div className="box"></div>
<p className="font-16 pt15">任务信息</p>
{/* <p className="font-16 pt15">任务信息</p> */}
{/* <p className="mt10">任务名称<span className="ml10">{taskRecord.name}</span></p> */}
{/* <p className="mt10 pb20">任务链接<Link className="taskLink ml10" target="_blank" to={`/task/taskDetail/${taskRecord.id}`} >{`/task/taskDetail/${taskRecord.id}`}</Link></p> */}
</div>
</TabPane>
<TabPane tab="专家评分" key="1">
<div>
<div className="box"></div>
<Paginationtable
loading={loading}
dataSource={dataList}
columns={columns}
total={total}
setCurPage={setCurPage}
current={curPage}
/>
<div className="button-div">
<Button className="mr10" type="primary" onClick={onSearch}>提交评审结果</Button>
<Button className="mr10" onClick={clearSearch}>保存评审结果</Button>
<Button className="butE3_border" onClick={cancel}>取消</Button>
</div>
</div>
</TabPane>
</Tabs>
</div>
)
}
export default Form.create()(ReviewTasks);

View File

@ -0,0 +1,45 @@
.register_right.task_detail {
background: #fff;
padding-bottom: 1rem;
.ant-tabs{
background: #f5f5f5;
.ant-tabs-content{
background: #fff;
}
.ant-tabs-bar{
background: #fff;
}
.ant-tabs-tab{
&:hover{
color: #4154f1;
}
}
.ant-tabs-ink-bar{
background-color: #4154f1;
}
}
.ant-tabs-nav .ant-tabs-tab-active{
color: #4154f1;
}
.task-head {
border-bottom: 1px solid #eeeeee;
padding: 0.5em 2em;
color: #181818;
background: #fff;
font-size: 0.8em;
font-weight: bold;
}
.button-div {
line-height: 1.5;
}
.pagination-table{
margin:1.25rem 1.75rem;
}
}