查看评审结果

This commit is contained in:
unknown 2022-01-08 17:29:01 +08:00
parent 25fcf518fe
commit bdefb4e729
11 changed files with 236 additions and 51 deletions

View File

@ -3,7 +3,7 @@ import { Table, Pagination } from 'antd';
import './index.scss';
export default (props) => {
const { loading, dataSource, columns, handleRow, total, setCurPage, current, rowSelection, expandedRowRender, expandIconColumnIndex, expandIconAsCell, onShowSizeChange, showSizeChanger, pagination } = props;
const { loading, dataSource, columns, handleRow, total, setCurPage, current, rowSelection, expandedRowRender, expandIconColumnIndex, expandIconAsCell, onShowSizeChange, showSizeChanger, pagination, scroll } = props;
return (
<div className='pagination-table'>
@ -19,7 +19,7 @@ export default (props) => {
expandedRowRender={expandedRowRender}
expandIconColumnIndex={expandIconColumnIndex}
expandIconAsCell={expandIconAsCell}
scroll={scroll}
/>
{total > 10 && (!pagination) &&
<Pagination

View File

@ -109,6 +109,15 @@ export function updateScoringDetails(data){
});
}
//评选胜出者和公示者
export function selectWinnersAndPublicists(params){
return fetch({
url: '/api/expertScoringDetails/selectWinnersAndPublicists',
method: 'get',
params,
});
}
//获取创客任务评审规则
export async function getRules(params){
let response = await fetch({

View File

@ -53,6 +53,17 @@
}
}
.font-w{
font-weight: bold;
}
.font-color-18{
color: #181818;
}
.mt10.pb20 .taskLink{
color:#4154F1;
&:hover{opacity: 0.8;}
}
//弹出确认框样式
.expert_modal .ant-modal-content {
width: 550px;

View File

@ -1,23 +1,137 @@
import React from "react";
import React, { useEffect, useState } from "react";
import Link from "react-router-dom/Link";
import PaginationTable from "src/military/components/paginationTable";
import { getScoringDetails, selectWinnersAndPublicists } from "../api";
import { Checkbox, Input, message, Modal } from "antd";
import './index.scss';
import '../index.scss';
import paginationTable from "src/military/components/paginationTable";
function ReviewResult({ location, history }) {
const { taskRecord } = location && location.state;
const [dataList, setDateList] = useState(undefined);
const [openResultVisible, setOpenResultVisible] = useState(false);
const [winIds, setWinIds] = useState(undefined);
const [openRange, setOpenRange] = useState(undefined);
const [errorMessage,setErrorMessage] = useState("若未填写此排名,则公示所有名次");
const columns = [
{
title: '综合排名',
dataIndex: 'id',
// align: 'left',applicantInfo.nickname
},
{
title: '应征者',
dataIndex: 'applicantInfo.nickname',
key: 'expertName',
},
{
title: '平均得分',
dataIndex: 'finalGrades',
key: 'phone',
},
{
title: '评审细节',
ket: 'detali',
render: (text, record) => {
return <a className="lookDetail">查看明细</a>
}
},
{
title: '是否胜出',
ket: 'isWin',
render: (text, record) => {
return <Checkbox onChange={(e)=>{changeIsWin(record.applicantInfo.id, e.target.checked)}}>胜出</Checkbox>
}
}
];
useEffect(()=>{
//
const params = {
containerId: 478,//taskRecord.id
containerType: 1,
// isDistinct: true,
expertId: -1,
orderBy: 'finalGradesDesc'
}
getScoringDetails(params).then(response=>{
if(response && Array.isArray(response.data)){
setDateList(response.data);
}
})
},[])
function changeIsWin(id, checked){
const ids = new Set(winIds);
checked ? ids.add(id) : ids.delete(id);
setWinIds(Array.from(ids));
}
function openResult(){
if(winIds && winIds.length>0){
taskRecord.taskModeId == 1 && winIds.length >1 ? message.error("此任务是单人悬赏模式, 只能设置一个中标者 ! ") : setOpenResultVisible(true);
}
}
function onOk(){
setErrorMessage("若未填写此排名,则公示所有名次");
if(!openRange){
setErrorMessage('请输入公示范围!');
}else if(isNaN(openRange)){
setErrorMessage('请输入数字!');
}else if(openRange.indexOf('.')!==-1 || openRange.indexOf('-')!==-1){
setErrorMessage('请输入正整数!');
}else if(openRange > dataList.length){
setErrorMessage('公示范围超过应征者总数!');
}else{
const ids = [];
ids[ids.length] = dataList.filter(item=>item.id<=openRange).map(i=>i.applicantInfo.id);
let params = {
containerId : 478,//taskRecord.id,
containerType: 1,
id: 0,
publicityUserIds : dataList.filter(item=>item.id<=openRange).map(i=>i.applicantInfo.id).toString(),
winUserIds:winIds.toString()
};
selectWinnersAndPublicists(params).then(response=>{
console.log('response', response);
})
}
}
return (
<div className="expert_review_system centerbox">
<div className="head_title mb20">
<div className="df pb10 pt10">
<span className="font-16 font-w">评审结果</span>
<button className="but41_border goback_but" onClick={()=>{history.goBack()}}>返回创客任务列表</button>
<button className="but41_border goback_but" onClick={()=>{history.goBack()}}>返回上一页</button>
</div>
<p className="mt10"><span className="font-w">任务名称</span><span className="ml10">{taskRecord.name}</span></p>
<p className="mt10 pb20"><span className="font-w">任务链接</span><Link className="taskLink ml10" target="_blank" to={`/task/taskDetail/${taskRecord.id}`} >{`/task/taskDetail/${taskRecord.id}`}</Link></p>
</div>
<p className="font-16 font-w">应征者排名</p>
<paginationTable></paginationTable>
<p className="font-16 font-w mb10">应征者排名</p>
<PaginationTable
dataSource= {dataList}
columns= {columns}
scroll={{ y: 400 }}
/>
<div className="openResult"><button className={winIds && taskRecord.taskModeId == 1 && winIds.length >1 ? 'disableBut': 'but41_fill'} onClick={openResult}>公示结果</button></div>
<Modal
title= "请确认公示范围"
visible= {openResultVisible}
wrapClassName="openResultModal"
width={390}
onCancel= {()=>setOpenResultVisible(false)}
onOk={onOk}>
<div className="df">
公示排名前
<Input placeholder="请输入" onChange={(e)=>{setOpenRange(e.target.value)}}/>
</div>
<p className="mt5">{errorMessage}</p>
</Modal>
</div>)
}
export default ReviewResult;

View File

@ -1,14 +1,51 @@
.expert_review_system.centerbox{
background: white;
font-family: 'PingFangSC-Semibold';
padding: 0 1.5em;
.font-w{
font-weight: bold;
background: white;
font-family: 'PingFangSC-Semibold';
padding: 0 1.5em;
.font-w{
font-weight: bold;
}
.df{
display: flex;
justify-content: space-between;
align-items: center;
}
.mt10.pb20{border-bottom: 1px solid #eeeeee;}
.openResult{
text-align: center;
padding: 35px 0;
}
.lookDetail{
color: #4154F1;
&:hover{
opacity: 0.8;
}
.df{
display: flex;
justify-content: space-between;
align-items: center;
}
.mt10.pb20{border-bottom: 1px solid #eeeeee;}
}
.disableBut{
background: #f8f8f8;
padding: 0 1.3em;
height: 2.55em;
border-radius: 4px;
cursor: pointer
}
.pagination-table .ant-table-thead > tr > th span{
font-weight: bold;
}
}
.openResultModal{
.ant-modal-body{
text-align: center;
}
.df{
justify-content: center;
align-items: center;
input{
width: 65px;
margin: 0 12px;
font-size: 13px;
}
}
.ant-modal-title {
text-align: left;
}
}

View File

@ -14,7 +14,7 @@ function ReviewRules({ location, form, history }) {
const { taskRecord } = location && location.state;
//
const [ initValue, setInitValue] = useState(false);
const disabledDate = (current) =>{
if(taskRecord.status === 1){
return current && current < moment(taskRecord.createdAt).endOf('day');
@ -60,6 +60,7 @@ function ReviewRules({ location, form, history }) {
updateRules({...data, id: initValue.id}).then(response=>{
if(response && response.message === '更新成功'){
message.success('更新成功');
history.go(-1);
}else{
message.error(response.message);
}
@ -68,6 +69,7 @@ function ReviewRules({ location, form, history }) {
editRules(data).then(response=>{
if(response && response.message === '成功'){
message.success('保存成功');
history.go(-1);
setInitValue({id: response.data});
}else{
message.error(response.message);
@ -83,11 +85,11 @@ function ReviewRules({ location, form, history }) {
<div className="centerbox setRules">
<div className="head_title mb20">
<div className="-layout pb10">
<span className="font-16">任务信息</span>
<button className="but41_border goback_but" onClick={()=>{history.goBack()}}>返回创客任务列表</button>
<span className="font-16 font-w color-grey3">任务信息</span>
<button className="but41_border goback_but" onClick={()=>{history.goBack()}}>返回上一页</button>
</div>
<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>
<p className="mt10"><span className="font-w color-grey3">任务名称</span><span className="ml10 color-grey3">{taskRecord.name}</span></p>
<p className="mt10 pb20"><span className="font-w color-grey3">任务链接</span><Link className="taskLink ml10" target="_blank" to={`/task/taskDetail/${taskRecord.id}`} >{`${window.location.host}/task/taskDetail/${taskRecord.id}`}</Link></p>
</div>
<Form className="pt10">
<Form.Item
@ -100,7 +102,7 @@ function ReviewRules({ location, form, history }) {
)}
</Form.Item>
<p className="rules_bar"></p>
<p className="font-16 criteria_title mt25 mb10">评分标准<span className="ml5 be_carful">管理员可设置1-5个评分项及对应评分标准每个评分项固定设置为100分</span></p>
<p className="font-16 criteria_title mt25 mb10"><span className="font-w">评分标准</span><span className="ml5 be_carful">管理员可设置1-5个评分项及对应评分标准每个评分项固定设置为100分</span></p>
<Form.Item
label="评分标准一"
>

View File

@ -23,13 +23,20 @@
padding: 1em 2em 2em;
.ant-form-item{
margin-bottom: 10px;
&:first-child label{
&:first-child label, &:last-child label{
font-size: 16px;
font-weight: bold;
}
.ant-form-item-label{
margin-bottom: 12px;
.ant-form-item-label > label::after{
content: none;
}
}
.ant-input{
background-color: white !important;
}
.has-success .ant-input, .ant-input:hover{
border: 1px solid #5d6eff !important;
}
}
.rules_buttom{
text-align: center;
@ -37,7 +44,6 @@
.but41_fill, .but41_border, .butE3_border{
width: 6.5em;
}
.goback_but{width: 9.5em;}
.but41_border{padding: 0;}
.rules_bar{
margin: 25px -2em;

View File

@ -215,8 +215,8 @@ function SelectExpert(props) {
setRandomErrorMessage('请输入随机抽取的专家数量!');
}else if(isNaN(randomCount)){
setRandomErrorMessage('请输入数字!');
}else if(randomCount.indexOf('.')!==-1){
setRandomErrorMessage('请输入整数!');
}else if(randomCount.indexOf('.')!==-1 || randomCount.indexOf('-')!==-1){
setRandomErrorMessage('请输入整数!');
}else{
let params = {
searchInput,
@ -280,19 +280,19 @@ function SelectExpert(props) {
return (
<div className="centerbox select_expert">
<div className="df">
<p className="title_one font-16">评审专家选取</p>
<button className="but41_border goback_but mr25" onClick={()=>{history.goBack()}}>返回创客任务列表</button>
<p className="title_one font-16 font-w font-color-18">评审专家选取</p>
<button className="but41_border goback_but mr25" onClick={()=>{history.goBack()}}>返回上一页</button>
</div>
<Tabs defaultActiveKey="0" type="card" onChange={(activeKey)=>{setActiveKey(activeKey);setSelectedRowKeys([]);setCurPage(1);}}>
<div>
<div className="box"></div>
<p className="font-16 pt15 font-w color-grey3">任务信息</p>
<p className="mt10"><span className="font-w color-grey3">任务名称</span><span className="ml10 color-grey3">{taskRecord.name}</span></p>
<p className="mt10 pb20"><span className="font-w color-grey3">任务链接</span><Link className="taskLink ml10" target="_blank" to={`/task/taskDetail/${taskRecord.id}`} >{`${window.location.host}/task/taskDetail/${taskRecord.id}`}</Link></p>
</div>
<TabPane tab="已选专家" key="0">
<div>
<div className="box"></div>
<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>
<div className="df mb20">
<p className="font-16">已选取评审专家</p>
<p className="font-16 font-w color-grey3">已选取评审专家</p>
<div>
{/* <button className="but41_fill" onClick={() => {selectedRowKeys && selectedRowKeys.length>0 && setOkConfirmDelete(true)}}>批量删除</button> */}
<Modal
@ -321,14 +321,8 @@ function SelectExpert(props) {
/>
</TabPane>
<TabPane tab="专家选取" key="1">
<div>
<div className="box"></div>
<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>
<div className="df mb20">
<p className="font-16">添加评审专家</p>
<p className="font-16 font-w color-grey3">添加评审专家</p>
<div>
<button className="but41_fill" onClick={() => {selectedRowKeys && selectedRowKeys.length>0 && setOkConfirmExps(true)}}>批量添加</button>
{allSelectedExpertsId && allSelectedExpertsId.size === total ? <button className="invalid_extraction butE3_border ml20">随机抽取</button> : <button className="but41_fill ml20" onClick={() => setOkConfirmExtract(true)}>随机抽取</button>}

View File

@ -35,7 +35,6 @@
margin-left: 120px;
width: 6em;
}
.taskLink{color:#4154F1}
.ant-table-row-expand-icon{
width: 65px;
height: 26px;
@ -65,10 +64,12 @@
.ant-tabs-tab{
background: none;
border: none;
color:#666666;
font-size: 16px;
&:hover{color: #4154F1;}
}
.ant-tabs-tab-active{
font-weight: bold;
color: #4154F1;
border-bottom: 1px solid #4154F1;
}
@ -76,6 +77,12 @@
.invalid_extraction{
background: #F8F8F8;
}
.ant-tabs-nav.ant-tabs-nav-animated>div div:first-child{
display: none;
}
.pagination-table .ant-table-thead > tr > th span, .ant-form label{
font-weight: bold;
}
}
.expert_modal.extract{
.ant-modal-content {

View File

@ -287,11 +287,12 @@ export default Form.create()(({ form, showNotification, match, history, state })
title: '专家姓名',
dataIndex: 'expertName',
key: 'expertName',
width: 120,
},
{
title: '手机号码',
dataIndex: 'phone',
width: 150,
width: 130,
key: 'phone',
},
{
@ -311,6 +312,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
title: '评审领域',
dataIndex: 'reviewAreas',
align: 'center',
width: 260,
},
{
title: '专家评分',
@ -383,6 +385,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
Modal.confirm({
className: 'publishReview',
title: "评审规则",
centered: true,
content:
<React.Fragment>
<div>{rules && rules.rule}</div>
@ -395,7 +398,8 @@ export default Form.create()(({ form, showNotification, match, history, state })
<p>已选取评审专家</p>
<PaginationTable
dataSource={selectedExperts}
columns={columnsExperts}/>
columns={columnsExperts}
scroll={{ y: 230 }}/>
</React.Fragment>
,
okText: '确定',
@ -459,7 +463,8 @@ export default Form.create()(({ form, showNotification, match, history, state })
content:
<PaginationTable
dataSource={selectedExperts}
columns={columnsExperts}/>,
columns={columnsExperts}
scroll={{ y: 400 }}/>,
});
}, 300);
}

View File

@ -118,6 +118,6 @@
}
}
.pagination-table .ant-table-tbody > tr > td{
padding: 1px 16px;
padding: 1px 8px;
}
}