forked from Gitlink/forgeplus-react
合并谢思代码
This commit is contained in:
commit
1a30c1023d
|
@ -3,8 +3,9 @@ import { Table, Pagination } from 'antd';
|
|||
import './index.scss';
|
||||
|
||||
export default (props) => {
|
||||
const { loading, dataSource, columns, handleRow, total, setCurPage, current, rowSelection, expandedRowRender, expandIconColumnIndex, onShowSizeChange,showSizeChanger } = props;
|
||||
const { loading, dataSource, columns, handleRow, total, setCurPage, current, rowSelection, expandedRowRender, expandIconColumnIndex,expandIconAsCell, onShowSizeChange,showSizeChanger } = props;
|
||||
|
||||
|
||||
return (
|
||||
<div className='pagination-table'>
|
||||
<Table
|
||||
|
@ -18,6 +19,7 @@ export default (props) => {
|
|||
rowSelection={rowSelection}
|
||||
expandedRowRender={expandedRowRender}
|
||||
expandIconColumnIndex={expandIconColumnIndex}
|
||||
expandIconAsCell={expandIconAsCell}
|
||||
/>
|
||||
{total > 10 &&
|
||||
<Pagination
|
||||
|
@ -26,7 +28,7 @@ export default (props) => {
|
|||
onChange={setCurPage}
|
||||
current={current}
|
||||
total={total}
|
||||
showSizeChanger
|
||||
showSizeChanger={showSizeChanger}
|
||||
/>}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import fetch from './fetch';
|
||||
import { notification } from 'antd';
|
||||
|
||||
// 任务列表查询
|
||||
// 专家列表查询
|
||||
export async function expertList(params) {
|
||||
let res = await fetch({
|
||||
url: '/api/experts/',
|
||||
|
@ -80,4 +80,41 @@ export function getExpertTasks(params) {
|
|||
method: 'get',
|
||||
params,
|
||||
});
|
||||
}
|
||||
//编辑评审规则
|
||||
export async function editRules(data){
|
||||
let res = await fetch({
|
||||
url: '/api/taskRuleCriteria/editRuleAndCriteria',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
//为创客任务添加评审专家
|
||||
export async function assignExperts(data){
|
||||
let res = await fetch({
|
||||
url: '/api/taskExpert/assignExperts',
|
||||
method: 'post',
|
||||
data,
|
||||
});
|
||||
return res;
|
||||
}
|
||||
|
||||
//删除指派专家
|
||||
export function deleteExperts(taskExpertId,isDelete) {
|
||||
console.log('taskExpertId',taskExpertId,'isDelete',isDelete);
|
||||
return fetch({
|
||||
url: `/api/taskExpert/${taskExpertId}?isDelete=${isDelete}`,
|
||||
method: 'delete'
|
||||
});
|
||||
}
|
||||
|
||||
//已选专家列表
|
||||
export function selectExpertList(params) {
|
||||
return fetch({
|
||||
url: `/api/taskExpert/selectedExpertPageList`,
|
||||
method: 'get',
|
||||
params
|
||||
});
|
||||
}
|
|
@ -1,16 +1,16 @@
|
|||
import React, { useState } from "react";
|
||||
import React, { useState, forwardRef } from "react";
|
||||
import { Input } from 'antd';
|
||||
|
||||
const { TextArea } = Input;
|
||||
|
||||
//右下角 实时动态 显示用户输入字数
|
||||
function WordsInput(props){
|
||||
const WordsInput = forwardRef((props, _ref) => {
|
||||
const [wordCount, setWordCount] = useState(0);
|
||||
return(
|
||||
<div style={{position:'relative'}}>
|
||||
<TextArea placeholder={props.placeholder} rows={props.rows} maxLength={props.maxLength} onChange={(e)=>setWordCount(e.target.value.length)}/>
|
||||
<TextArea placeholder={props.placeholder} rows={props.rows} maxLength={props.maxLength} onChange={(e)=>{setWordCount(e.target.value.length);props.onChange(e.target.value)}}/>
|
||||
<span style={{ position: 'absolute', bottom: '-4px', right: '12px', fontSize: '12px' }}>{wordCount}/{props.maxLength}</span>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
})
|
||||
export default WordsInput;
|
|
@ -192,7 +192,7 @@ function RegisterList({ showNotification }) {
|
|||
expertList(params).then(data => {
|
||||
setDataList(data.rows || []);
|
||||
setLoading(false);
|
||||
setTotal(data.total);
|
||||
setTotal(data && data.total);
|
||||
});
|
||||
}, [curPage, reload, searchInput, searchReviewArea, expertType, pageSize]);
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="32px" height="32px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>shanchu_tc_icon</title>
|
||||
<g id="首页/竞赛" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
||||
<g id="7-资料未保存提示语" transform="translate(-804.000000, -400.000000)" fill-rule="nonzero">
|
||||
<g id="弹窗" transform="translate(684.000000, 298.000000)">
|
||||
<g id="编组-3备份" transform="translate(121.000000, 102.000000)">
|
||||
<g id="shanchu_tc_icon" transform="translate(0.000000, 1.000000)">
|
||||
<path d="M15,0 C6.7155,0 0,6.7155 0,15 C0,23.2845 6.7155,30 15,30 C23.2845,30 30,23.2845 30,15 C30,6.7155 23.2845,0 15,0 Z" id="路径" stroke="#CA0002" stroke-width="1.5" fill="#CA0002"></path>
|
||||
<path d="M16,20.844 C16,21.3962847 15.5522847,21.844 15,21.844 C14.4477153,21.844 14,21.3962847 14,20.844 L14,20.344 C14,19.7917152 14.4477153,19.344 15,19.344 C15.5522847,19.344 16,19.7917152 16,20.344 L16,20.844 Z" id="路径" fill="#FFFFFF"></path>
|
||||
<path d="M16,16.656 C16,17.2082847 15.5522847,17.656 15,17.656 C14.4477153,17.656 14,17.2082847 14,16.656 L14,9.15600001 C14,8.60371526 14.4477153,8.15600001 15,8.15600001 C15.5522847,8.15600001 16,8.60371526 16,9.15600001 L16,16.656 Z" id="路径" fill="#FFFFFF"></path>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -1,22 +1,56 @@
|
|||
import React, { Component } from "react";
|
||||
import { Button, DatePicker, Form } from "antd";
|
||||
import { Button, DatePicker, Form, message } from "antd";
|
||||
import WordsInput from "../components/wordsInput";
|
||||
import './index.scss';
|
||||
import '../index.scss';
|
||||
import Link from "react-router-dom/Link";
|
||||
import { editRules } from "../api";
|
||||
|
||||
const {RangePicker} = DatePicker;
|
||||
|
||||
function ReviewRules(props) {
|
||||
const { getFieldDecorator } = props.form;
|
||||
function ReviewRules({ location, form, history,state, navigation }) {
|
||||
const { getFieldDecorator} = form;
|
||||
const { taskRecord } = location && location.state;
|
||||
console.log('taskRecord',taskRecord);
|
||||
|
||||
function rulesSubmit(){
|
||||
form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
let data = {
|
||||
containerId: taskRecord.id,
|
||||
containerName: taskRecord.name,
|
||||
containerType: 1,
|
||||
criteriaOne: values.criteria1,
|
||||
reviewStartOn: values.reviewDate[0].format('YYYY-MM-DD HH:mm:ss'),
|
||||
reviewEndOn: values.reviewDate[1].format('YYYY-MM-DD HH:mm:ss'),
|
||||
rule: values.reviewRule,
|
||||
criteriaTwo: values.criteria2,
|
||||
criteriaThree: values.criteria3,
|
||||
criteriaFour: values.criteria4,
|
||||
criteriaFive: values.criteria5,
|
||||
status: 3
|
||||
}
|
||||
editRules(data).then(response=>{
|
||||
console.log('response',response);
|
||||
if(response && response.message === '成功'){
|
||||
message.success('保存成功');
|
||||
}else{
|
||||
message.error(response.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="centerbox setRules">
|
||||
<div className="head_title mb20">
|
||||
<div className="-layout pb10">
|
||||
<span className="font-16">任务信息</span>
|
||||
<button className="but41_border">返回上一页</button>
|
||||
<button className="but41_border" onClick={()=>{history.goBack()}}>返回上一页</button>
|
||||
</div>
|
||||
<p className="mt10">任务名称</p>
|
||||
<p className="mt10 pb20">任务链接</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>
|
||||
<Form className="pt10">
|
||||
<Form.Item
|
||||
|
@ -85,14 +119,15 @@ function ReviewRules(props) {
|
|||
<RangePicker
|
||||
showTime={{ format: 'HH:mm' }}
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
placeholder={['Start Time', 'End Time']}
|
||||
placeholder={['开始时间', '结束时间']}
|
||||
|
||||
/>,
|
||||
)}
|
||||
</Form.Item>
|
||||
</Form>
|
||||
<div className="rules_buttom mt20">
|
||||
<button className="but41_fill">保存</button>
|
||||
<button className="butE3_border ml30">取消</button>
|
||||
<button className="but41_fill" onClick={rulesSubmit}>保存</button>
|
||||
<button className="butE3_border ml30" onClick={()=>{history.goBack()}}>取消</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import React, { useState, useEffect, useMemo } from "react";
|
||||
import { Tabs, Input, Select, Button, Modal, Form } from 'antd';
|
||||
import { Tabs, Input, Select, Button, Modal, Form, message } from 'antd';
|
||||
import { professionalType, reviewArea } from '../static.js';
|
||||
import { expertList } from "../api.js";
|
||||
import { assignExperts, deleteExperts, expertList, selectExpertList } from "../api.js";
|
||||
import Paginationtable from "../../components/paginationTable";
|
||||
import './index.scss';
|
||||
import '../index.scss';
|
||||
|
@ -12,18 +12,9 @@ const { Option } = Select;
|
|||
const { Search } = Input;
|
||||
|
||||
function SelectExpert(props) {
|
||||
const { history, showNotification, form, location } = props;
|
||||
const { getFieldDecorator, setFieldsValue, getFieldsValue } = form;
|
||||
const { history, form, location, current_user } = props;
|
||||
const { getFieldDecorator, setFieldsValue } = form;
|
||||
const { taskRecord } = location && location.state;
|
||||
console.log('信息', taskRecord);
|
||||
|
||||
// const TaskDetail = (
|
||||
// <div>
|
||||
// <p>任务信息</p>
|
||||
// <p className="mt10">任务名称</p>
|
||||
// <p className="mt10 pb20">任务链接</p>
|
||||
// </div>
|
||||
// )
|
||||
const [reload, setReload] = useState();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
|
@ -33,16 +24,25 @@ function SelectExpert(props) {
|
|||
const [searchInput, setSearchInput] = useState('');
|
||||
const [expertType, setExpertType] = useState('');
|
||||
const [reviewAreaSel, setReviewAreaSel] = useState('');
|
||||
//是否支持多选
|
||||
const [selectExperts, setSelectExperts] = useState(false);
|
||||
//专家多选确认框
|
||||
const [okConfirmExps, setOkConfirmExps] = useState(false);
|
||||
//专家多选-选择个数
|
||||
const [selectExpertCount, setSelectExpertCount] = useState(0);
|
||||
//批量删除专家确认框
|
||||
const [okConfirmDelete, setOkConfirmDelete] = useState(false);
|
||||
//批量添加 选择专家编号
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState(undefined);
|
||||
//随机抽取专家确认框
|
||||
const [okConfirmExtract, setOkConfirmExtract] = useState(false);
|
||||
//批量删除专家
|
||||
const [deleteExperts, setDeleteExperts] = useState(false);
|
||||
//随机抽取 用户输入数
|
||||
const [randomCount, setRandomCount] = useState(undefined);
|
||||
//随机抽取错误提示语句
|
||||
const [randomErrorMessage, setRandomErrorMessage] = useState(undefined);
|
||||
//tab栏
|
||||
const [activeKey, setActiveKey] = useState(0);
|
||||
//已选专家列表
|
||||
const [selectedExperts, setSelectExperts] = useState([]);
|
||||
const [selectedExpertTotal, setSelectedExpertTotal] = useState(0);
|
||||
//全部已选专家
|
||||
const [allSelectedExpertsId, setAllSelectedExpertsId] = useState();
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
|
@ -85,6 +85,9 @@ function SelectExpert(props) {
|
|||
title: '专家评分',
|
||||
dataIndex: 'expertScore',
|
||||
align: 'center',
|
||||
render:(text,record)=>{
|
||||
return record.expertScore || '--';
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
|
@ -93,29 +96,69 @@ function SelectExpert(props) {
|
|||
align: 'center',
|
||||
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>
|
||||
{activeKey == "1" && (record.isExpertTask ? <span className="selected">已添加</span> : <a className="select" onClick={()=>{SelectExperts([record.id])}}>添加</a>)}
|
||||
{activeKey == "0" && <Button className="mr5 font-12" type="danger" size="small" onClick={() => { deleteExpert(record.taskExpertId, record.id) }}>删除</Button>}
|
||||
</React.Fragment>
|
||||
}
|
||||
}
|
||||
];
|
||||
}, []);
|
||||
}, [activeKey, allSelectedExpertsId]);
|
||||
|
||||
const rowSelection = {
|
||||
selectedRowKeys,
|
||||
onChange: (selectedRowKeys, selectedRows) => {
|
||||
setSelectExpertCount(selectedRows.length);
|
||||
console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows, selectedRows.length);
|
||||
setSelectedRowKeys(selectedRowKeys);
|
||||
},
|
||||
getCheckboxProps: record => ({
|
||||
name: record.name,
|
||||
}),
|
||||
getCheckboxProps: record =>{
|
||||
return record.isExpertTask ? {disabled: true} : {};
|
||||
}
|
||||
};
|
||||
|
||||
// const SelectExpertsBus = (
|
||||
// <button className="but41_fill" onClick={() => setSelectExperts(false)}>取消</button>
|
||||
// )
|
||||
const ExpertDetail = (record)=>{
|
||||
return <div className="expert_detail_div df">
|
||||
<div>
|
||||
<p>工作单位:{record.workplace}</p>
|
||||
<p>单位类别:{record.workplaceType}</p>
|
||||
<p>工作性质:{record.workNature}</p>
|
||||
<p>职称职级:{record.titleRank}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>邮箱地址:{record.expertEmail || '--'}</p>
|
||||
<p>毕业院校:{record.graduatedFrom || '--'}</p>
|
||||
<p>院校专业:{record.major || '--'}</p>
|
||||
</div>
|
||||
<div>
|
||||
<p>身份证号:{record.idNumber || '--'}</p>
|
||||
<p>开户银行:{record.bankName || '--'}</p>
|
||||
<p>银行账号:{record.bankAccount || '--'}</p>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
// 获取列表
|
||||
//全部已选专家
|
||||
useEffect(()=>{
|
||||
setLoading(true);
|
||||
const params = {
|
||||
containerId: taskRecord.id,
|
||||
containerType: 1,
|
||||
curPage:curPage,
|
||||
pageSize: 10000,
|
||||
curPage: 1,
|
||||
}
|
||||
selectExpertList(params).then(response=>{
|
||||
if (response && response.data && Array.isArray(response.data.rows)) {
|
||||
const ids = new Set();
|
||||
response.data.rows.map((item)=>{
|
||||
ids.add(item.id);
|
||||
})
|
||||
setAllSelectedExpertsId(ids);
|
||||
}
|
||||
}).finally(()=>{
|
||||
setLoading(false);
|
||||
})
|
||||
},[])
|
||||
|
||||
// 专家列表
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
let params = {
|
||||
|
@ -130,42 +173,114 @@ function SelectExpert(props) {
|
|||
if (data && Array.isArray(data.rows)) {
|
||||
let index = 1;
|
||||
for (const item of data.rows) {
|
||||
item.reviewAreas = `${item.reviewAreaOne} ${item.reviewAreaTwo && `、`} ${item.reviewAreaTwo} ${item.reviewAreaThree && `、`} ${item.reviewAreaThree} `;
|
||||
item.reviewAreas = `${item.reviewAreaOne} ${item.reviewAreaTwo ? `、${item.reviewAreaTwo}`:''} ${item.reviewAreaThree ? `、${item.reviewAreaThree}`:''}`;
|
||||
item.index = (index++) + (curPage > 1 ? (curPage - 1) * 10 : 0);
|
||||
allSelectedExpertsId && allSelectedExpertsId.length!==0 && (item.isExpertTask = allSelectedExpertsId.has(item.id));
|
||||
}
|
||||
}
|
||||
setDataList(data.rows || []);
|
||||
setDataList(data && data.rows);
|
||||
setLoading(false);
|
||||
setTotal(data.total);
|
||||
setTotal(data && data.total);
|
||||
});
|
||||
}, [curPage, reload, searchInput, expertType, reviewAreaSel]);
|
||||
}, [curPage, reload, searchInput, expertType, reviewAreaSel, allSelectedExpertsId]);
|
||||
|
||||
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());
|
||||
// }
|
||||
// });
|
||||
},
|
||||
});
|
||||
//已选专家列表
|
||||
useEffect(()=>{
|
||||
setLoading(true);
|
||||
const params = {
|
||||
containerId: taskRecord.id,
|
||||
containerType: 1,
|
||||
curPage,
|
||||
pageSize,
|
||||
}
|
||||
selectExpertList(params).then(response=>{
|
||||
if (response && response.data && Array.isArray(response.data.rows)) {
|
||||
let index = 1;
|
||||
for (const item of response.data.rows) {
|
||||
item.reviewAreas = `${item.reviewAreaOne} ${item.reviewAreaTwo ? `、${item.reviewAreaTwo}`:''} ${item.reviewAreaThree ? `、${item.reviewAreaThree}`:''}`;
|
||||
item.index = (index++) + (curPage > 1 ? (curPage - 1) * 10 : 0);
|
||||
}
|
||||
setSelectExperts(response && response.data.rows);
|
||||
setSelectedExpertTotal(response && response.data.total);
|
||||
}
|
||||
}).finally(()=>{
|
||||
setLoading(false);
|
||||
})
|
||||
},[curPage, reload])
|
||||
|
||||
//随机抽取专家
|
||||
function random(){
|
||||
setRandomErrorMessage('');
|
||||
if(!randomCount){
|
||||
setRandomErrorMessage('请输入随机抽取的专家数量!');
|
||||
}else if(isNaN(randomCount)){
|
||||
setRandomErrorMessage('请输入数字!');
|
||||
}else{
|
||||
let params = {
|
||||
searchInput,
|
||||
expertType: expertType === 'all' ? '' : expertType,
|
||||
reviewArea: reviewAreaSel === 'all' ? '' : reviewAreaSel,
|
||||
randomCount,
|
||||
curPage:1,
|
||||
pageSize: 10000,
|
||||
selectedExpertIds: Array.from(allSelectedExpertsId).toString(),
|
||||
};
|
||||
expertList(params).then(response=>{
|
||||
if(response && Array.isArray(response.rows)){
|
||||
const randomIds = [];
|
||||
response.rows.map(item=>{
|
||||
randomIds[randomIds.length] = item.id;
|
||||
})
|
||||
SelectExperts([...randomIds]);
|
||||
setOkConfirmExtract(false);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
//为创客任务添加评审专家
|
||||
const SelectExperts = (id) =>{
|
||||
const params = {
|
||||
assignorId: parseInt(current_user.user_id),
|
||||
containerId: taskRecord.id,
|
||||
containerName: taskRecord.name,
|
||||
containerType: 1,
|
||||
expertIds: id.toString(),
|
||||
status: 3
|
||||
}
|
||||
assignExperts(params).then(response=>{
|
||||
if(response && response.message === '专家指派成功'){
|
||||
setOkConfirmExps(false);
|
||||
message.success(response.message);
|
||||
setSelectedRowKeys([]);
|
||||
setReload(Math.random());
|
||||
id.map(i=>setAllSelectedExpertsId(allSelectedExpertsId.add(i)));
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//删除评审专家
|
||||
const deleteExpert=(taskExpertId, expertId)=>{
|
||||
setLoading(true);
|
||||
deleteExperts(taskExpertId,1).then(response=>{
|
||||
if(response && response.message === "删除成功"){
|
||||
message.success("删除成功");
|
||||
allSelectedExpertsId.delete(expertId);
|
||||
setReload(Math.random());
|
||||
}else{
|
||||
message.error("删除失败");
|
||||
}
|
||||
}).finally(()=>{
|
||||
setLoading(false);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="centerbox select_expert">
|
||||
<p className="title_one font-16">评审专家选取</p>
|
||||
<Tabs defaultActiveKey="1" animated={false} type="card">
|
||||
<TabPane tab="已选专家" key='0'>
|
||||
<Tabs defaultActiveKey="0" type="card" onChange={(activeKey)=>{setActiveKey(activeKey);setSelectedRowKeys([]);setCurPage(1);}}>
|
||||
<TabPane tab="已选专家" key="0">
|
||||
<div>
|
||||
<div className="box"></div>
|
||||
<p className="font-16 pt15">任务信息</p>
|
||||
|
@ -175,32 +290,33 @@ function SelectExpert(props) {
|
|||
<div className="df mb20">
|
||||
<p className="font-16">已选取评审专家</p>
|
||||
<div>
|
||||
{!deleteExperts && <button className="but41_fill" onClick={() => setDeleteExperts(true)}>批量删除</button>}
|
||||
{deleteExperts && <button className="butE3_border" onClick={() => setDeleteExperts(false)}>取消</button>}
|
||||
{deleteExperts && <button className="but41_fill ml20" onClick={() => selectExpertCount !== 0 && setOkConfirmExps(true)}>添加</button>}
|
||||
{/* <button className="but41_fill" onClick={() => {selectedRowKeys && selectedRowKeys.length>0 && setOkConfirmDelete(true)}}>批量删除</button> */}
|
||||
<Modal
|
||||
title="批量添加"
|
||||
visible={okConfirmExps}
|
||||
title="批量删除"
|
||||
visible={okConfirmDelete}
|
||||
onOk={() => { history.go(-1) }}
|
||||
onCancel={() => setOkConfirmExps(false)}
|
||||
onCancel={() => setOkConfirmDelete(false)}
|
||||
wrapClassName="expert_modal"
|
||||
>
|
||||
<p className='weight_bold warning'>您确定要添加选中的{selectExpertCount}个专家吗?</p>
|
||||
<p className='ml30'>此操作将添加选中的{selectExpertCount}个专家,请进行确认</p>
|
||||
<p className='weight_bold warning'>您确定要删除选中的{selectedRowKeys && selectedRowKeys.length}个专家吗?</p>
|
||||
<p className='ml_40'>此操作将删除选中的{selectedRowKeys && selectedRowKeys.length}个专家,请进行确认以防数据丢失。</p>
|
||||
</Modal>
|
||||
</div>
|
||||
</div>
|
||||
<Paginationtable
|
||||
loading={loading}
|
||||
dataSource={dataList}
|
||||
dataSource={selectedExperts}
|
||||
columns={columns}
|
||||
total={total}
|
||||
total={selectedExpertTotal}
|
||||
setCurPage={setCurPage}
|
||||
current={curPage}
|
||||
rowSelection={selectExperts ? rowSelection : null}
|
||||
// rowSelection={rowSelection}
|
||||
expandedRowRender={ExpertDetail}
|
||||
expandIconColumnIndex={8}
|
||||
expandIconAsCell={false}
|
||||
/>
|
||||
</TabPane>
|
||||
<TabPane tab="专家选取" key='1'>
|
||||
<TabPane tab="专家选取" key="1">
|
||||
<div>
|
||||
<div className="box"></div>
|
||||
<p className="font-16 pt15">任务信息</p>
|
||||
|
@ -210,29 +326,28 @@ function SelectExpert(props) {
|
|||
<div className="df mb20">
|
||||
<p className="font-16">添加评审专家</p>
|
||||
<div>
|
||||
{!selectExperts && <button className="but41_fill" onClick={() => setSelectExperts(true)}>批量添加</button>}
|
||||
{selectExperts && <button className="butE3_border" onClick={() => setSelectExperts(false)}>取消</button>}
|
||||
{selectExperts && <button className="but41_fill ml20" onClick={() => selectExpertCount !== 0 && setOkConfirmExps(true)}>添加</button>}
|
||||
<button className="but41_fill" onClick={() => {selectedRowKeys && selectedRowKeys.length>0 && setOkConfirmExps(true)}}>批量添加</button>
|
||||
<button className="but41_fill ml20" onClick={() => setOkConfirmExtract(true)}>随机抽取</button>
|
||||
<Modal
|
||||
title="批量添加"
|
||||
visible={okConfirmExps}
|
||||
onOk={() => { history.go(-1) }}
|
||||
onOk={() => SelectExperts(selectedRowKeys)}
|
||||
onCancel={() => setOkConfirmExps(false)}
|
||||
wrapClassName="expert_modal"
|
||||
>
|
||||
<p className='weight_bold warning'>您确定要添加选中的{selectExpertCount}个专家吗?</p>
|
||||
<p className='ml30'>此操作将添加选中的{selectExpertCount}个专家,请进行确认</p>
|
||||
<p className='weight_bold warning'>您确定要添加选中的{selectedRowKeys && selectedRowKeys.length}个专家吗?</p>
|
||||
<p className='ml30'>此操作将添加选中的{selectedRowKeys && selectedRowKeys.length}个专家,请进行确认。</p>
|
||||
</Modal>
|
||||
|
||||
<Modal
|
||||
title="随机抽取"
|
||||
visible={okConfirmExtract}
|
||||
onOk={() => { history.go(-1) }}
|
||||
onOk={random}
|
||||
onCancel={() => setOkConfirmExtract(false)}
|
||||
wrapClassName="expert_modal extract"
|
||||
>
|
||||
<span>请输入数量:</span><Input placeholder="请输入"></Input>
|
||||
<div><span>请输入数量:</span><Input placeholder="请输入" onChange={(e)=>{setRandomCount(e.target.value)}}></Input></div>
|
||||
<p>{randomErrorMessage}</p>
|
||||
</Modal>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -248,7 +363,7 @@ function SelectExpert(props) {
|
|||
</Form.Item>
|
||||
<Form.Item label="专家类别:">
|
||||
{getFieldDecorator('expertType', {})(
|
||||
<Select placeholder="所有类别" style={{ width: 220 }} onChange={(value) => { setExpertType(value) }}>
|
||||
<Select placeholder="所有类别" style={{ width: 220 }} onChange={(value) => { setExpertType(value);setCurPage(1); }}>
|
||||
<Option value='all'>所有类别</Option>
|
||||
{professionalType.map(item => {
|
||||
return <Option key={item.value} value={item.value}>{item.label}</Option>
|
||||
|
@ -257,7 +372,7 @@ function SelectExpert(props) {
|
|||
</Form.Item>
|
||||
<Form.Item label="评审领域:">
|
||||
{getFieldDecorator('reviewAreaSel', {})(
|
||||
<Select placeholder="所有领域" style={{ width: 220 }} onChange={value => setReviewAreaSel(value)}>
|
||||
<Select placeholder="所有领域" style={{ width: 220 }} onChange={value => {setReviewAreaSel(value);setCurPage(1);}}>
|
||||
<Option value='all'>所有领域</Option>
|
||||
{reviewArea.map(item => {
|
||||
return <Option key={item.value} value={item.value}>{item.label}</Option>
|
||||
|
@ -281,12 +396,11 @@ function SelectExpert(props) {
|
|||
dataSource={dataList}
|
||||
columns={columns}
|
||||
total={total}
|
||||
setCurPage={setCurPage}
|
||||
setCurPage={(curPage)=>{setCurPage(curPage++);setSelectedRowKeys([])}}
|
||||
current={curPage}
|
||||
// rowSelection={selectExperts ? rowSelection : null}
|
||||
rowSelection={rowSelection}
|
||||
expandedRowRender={record => <p style={{ margin: 0 }}>{record.graduatedFrom}</p>}
|
||||
expandIconColumnIndex={5}
|
||||
expandedRowRender={ExpertDetail}
|
||||
expandIconColumnIndex={9}
|
||||
expandIconAsCell={false}
|
||||
/>
|
||||
</TabPane>
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
.centerbox.select_expert{
|
||||
margin: -10px auto;
|
||||
margin-bottom: 2vh;
|
||||
padding-top: 16px;
|
||||
background: white;
|
||||
.title_one, .ant-tabs-nav-wrap, .ant-tabs .ant-tabs-top-content{
|
||||
padding: 0 2em;
|
||||
padding: 0 2em 1vw;
|
||||
}
|
||||
.box{
|
||||
height: 20px;
|
||||
|
@ -24,7 +25,7 @@
|
|||
}
|
||||
}
|
||||
.ant-pagination{
|
||||
text-align: right;
|
||||
text-align: center;
|
||||
margin: 20px 0;
|
||||
}
|
||||
.ant-table-thead > tr > th, .ant-table-tbody > tr > td{
|
||||
|
@ -35,18 +36,67 @@
|
|||
width: 6em;
|
||||
}
|
||||
.taskLink{color:#4154F1}
|
||||
.ant-table-row-expand-icon{
|
||||
width: 65px;
|
||||
height: 26px;
|
||||
line-height: 24px;
|
||||
font-size: 12px;
|
||||
color: white;
|
||||
background: #4154F1;
|
||||
}
|
||||
.ant-table-row-collapsed::after, .ant-table-row-expanded::after {
|
||||
content: '专家详情';
|
||||
}
|
||||
.expert_detail_div{
|
||||
justify-content: space-around;
|
||||
align-items: flex-start;
|
||||
div{width: 28%;}
|
||||
}
|
||||
.select{
|
||||
color: #4154F1;
|
||||
padding: 0 8px;
|
||||
}
|
||||
.selected{
|
||||
color: #999999;
|
||||
}
|
||||
.ant-tabs-bar{
|
||||
border: none;
|
||||
margin: 0;
|
||||
.ant-tabs-tab{
|
||||
background: none;
|
||||
border: none;
|
||||
font-size: 16px;
|
||||
&:hover{color: #4154F1;}
|
||||
}
|
||||
.ant-tabs-tab-active{
|
||||
color: #4154F1;
|
||||
border-bottom: 1px solid #4154F1;
|
||||
}
|
||||
}
|
||||
}
|
||||
.expert_modal.extract{
|
||||
.ant-modal-content {
|
||||
width: 387px;
|
||||
height: 230px;
|
||||
.ant-modal-body {
|
||||
padding: 3.5vh 2.1em;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 3.5vh 3.5vw 0;
|
||||
div{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
p{
|
||||
color: red;
|
||||
height: 2.9em;
|
||||
}
|
||||
.ml_40{
|
||||
margin-left: -40px;
|
||||
}
|
||||
}
|
||||
.ant-modal-footer {
|
||||
margin-top: 0;
|
||||
}
|
||||
}
|
||||
.ant-input{
|
||||
width: 12vw;
|
||||
width: 8vw;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import { Input, Select, Button, Form, DatePicker, Table, Pagination, Modal } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import { Link } from 'react-router-dom';
|
||||
|
||||
import { paperCheckStatusArr, publishModeArr, taskStatusAllArr, showUserModeArr, main_web_site_url, expertReviewArr } from '../static';
|
||||
import { getTaskAdminList, changeShowUserMode, deleteTask, recommendTask } from '../api';
|
||||
|
@ -20,9 +20,9 @@ for (const item of paperCheckStatusArr) {
|
|||
}
|
||||
|
||||
|
||||
export default Form.create()(({ form, showNotification, match, history }) => {
|
||||
export default Form.create()(({ form, showNotification, match, history, state }) => {
|
||||
const { getFieldDecorator, setFieldsValue, getFieldsValue } = form;
|
||||
|
||||
const { hash} = history && history.location;
|
||||
const [reload, setReload] = useState();
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [statusString, setStatusString] = useState('');
|
||||
|
@ -34,13 +34,16 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
const [sort, setSort] = useState('Desc');
|
||||
const [order, setOrder] = useState('createdAt');
|
||||
const [searchObj, setSearchObj] = useState({});
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [curPage, setCurPage] = useState(hashDate(hash) || 1);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [taskList, setTaskList] = useState([]);
|
||||
const [expertReview, setExpertReview] = useState('');
|
||||
|
||||
useEffect(()=>{
|
||||
setCurPage(hashDate(hash) || 1);
|
||||
},[hash])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('ues', curPage);
|
||||
const params = {
|
||||
...searchObj,
|
||||
statusString,
|
||||
|
@ -71,13 +74,16 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
</Form.Item>
|
||||
), []);
|
||||
|
||||
|
||||
function hashDate(hash) {
|
||||
return parseInt(hash.split("&")[0].substring(hash.split("&")[0].indexOf("=")+1));
|
||||
}
|
||||
function onSearch() {
|
||||
let values = getFieldsValue(['nameInput', 'endTime', 'startTime', 'enterpriseNameInput']);
|
||||
if (values.startTime) values.startTime = values.startTime.format(format);
|
||||
if (values.endTime) values.endTime = values.endTime.format(format);
|
||||
if (values.checkStatus === '0,1,2') values.checkStatus = '';
|
||||
setSearchObj(values);
|
||||
window.location.href=`/task/taskAdmin`;
|
||||
}
|
||||
|
||||
function clearSearch() {
|
||||
|
@ -92,22 +98,10 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
title: '序号',
|
||||
dataIndex: 'index',
|
||||
render: (text, record, index) => {
|
||||
return <div style={{ textAlign: 'center' }}>{index + 1}</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '任务编号',
|
||||
dataIndex: 'number',
|
||||
width: "6%",
|
||||
},
|
||||
{
|
||||
title: '任务名称',
|
||||
dataIndex: 'name',
|
||||
width: "10%",
|
||||
width: "13%",
|
||||
render: (text, record) => (
|
||||
<Link className="line_1 primary-link" target="_blank" to={`/task/taskDetail/${record.id}`} >{text}</Link>
|
||||
),
|
||||
|
@ -175,24 +169,15 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
return record.exceptClosedBoolean ? '已关闭' : statusArr[text]
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '稿件数',
|
||||
dataIndex: 'papersCount',
|
||||
},
|
||||
{
|
||||
title: '发布主体',
|
||||
dataIndex: 'enterpriseName',
|
||||
width: '9%',
|
||||
},
|
||||
{
|
||||
title: '发布时间',
|
||||
dataIndex: 'publishedAt',
|
||||
render: (text, record) => {
|
||||
return text || '--'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '截稿时间',
|
||||
dataIndex: 'collectingEndTime',
|
||||
width: '7%',
|
||||
render: (text, record) => {
|
||||
return text || '--'
|
||||
}
|
||||
|
@ -206,7 +191,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
defaultValue={'0,1,2'}
|
||||
onChange={setShowUserMode}
|
||||
>
|
||||
<Option key={'0,1,2'}>应征者名单公示</Option>
|
||||
<Option key={'0,1,2'}>应征者公示</Option>
|
||||
{
|
||||
showUserModeArr.map(item => {
|
||||
return <Option key={item.dicItemCode}>{item.dicItemName}</Option>
|
||||
|
@ -235,7 +220,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
title: '评审规则',
|
||||
dataIndex: 'ruleEditedCount',
|
||||
render: (text, record) => {
|
||||
return record.expertReview ? '' : <Link className="line_1 primary-link" to={{ pathname:'/expert/admin/task/review/rules',query:{'page':curPage}}}>编辑</Link>
|
||||
return record.expertReview ? '' : <Link className="line_1 primary-link" to={{ pathname:'/expert/admin/task/review/rules', state: { 'taskRecord': record}}}>编辑</Link>
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -249,7 +234,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
title: '评审任务',
|
||||
dataIndex: 'expertReview1',
|
||||
render: (text, record) => {
|
||||
return <Button>发布</Button>
|
||||
return <Button size='small'>发布</Button>
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -262,6 +247,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
width: '6%',
|
||||
render: (text, record) => (
|
||||
<React.Fragment>
|
||||
|
||||
|
@ -283,7 +269,7 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
),
|
||||
},
|
||||
]
|
||||
}, [isDelete]);
|
||||
}, [isDelete, curPage]);
|
||||
|
||||
function recommendItem(id, recommend) {
|
||||
Modal.confirm({
|
||||
|
@ -334,21 +320,26 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
|
||||
}
|
||||
|
||||
function setCurPage1(page){
|
||||
setCurPage(page);
|
||||
window.location.href=`/task/taskAdmin#page=${page}`;
|
||||
}
|
||||
|
||||
// 改变排序字段
|
||||
const changeSortName = useCallback((sortType) => {
|
||||
setOrder(sortType);
|
||||
setCurPage(1);
|
||||
setCurPage1(1);
|
||||
}, []);
|
||||
|
||||
// 改变排序
|
||||
const changeSort = useCallback((sort) => {
|
||||
setSort(sort);
|
||||
setCurPage(1);
|
||||
setCurPage1(1);
|
||||
}, []);
|
||||
|
||||
const changeShow = useCallback((isDelete) => {
|
||||
setIsDelete(isDelete);
|
||||
setCurPage(1);
|
||||
setCurPage1(1);
|
||||
});
|
||||
|
||||
const changeRecommend = useCallback((recommend) => {
|
||||
|
@ -357,9 +348,17 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
} else {
|
||||
setRecommend(recommend);
|
||||
}
|
||||
setCurPage(1);
|
||||
setCurPage1(1);
|
||||
});
|
||||
|
||||
const ExpertDetail = (record)=>{
|
||||
return <div className="expert_detail_div">
|
||||
<div> 任务编号:{record.number} </div>
|
||||
<div> 截稿时间:{record.collectingEndTime || '--'} </div>
|
||||
<div> 稿件数:{record.papersCount || '--'} </div>
|
||||
</div>
|
||||
}
|
||||
|
||||
function downloadFile() {
|
||||
window.open(main_web_site_url + '/admin/tasks.xlsx');
|
||||
}
|
||||
|
@ -465,10 +464,6 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
</Form.Item>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div className="center-content">
|
||||
|
||||
<Table
|
||||
|
@ -478,11 +473,11 @@ export default Form.create()(({ form, showNotification, match, history }) => {
|
|||
columns={columns}
|
||||
pagination={false}
|
||||
className="mt10"
|
||||
scroll={{ x: 1800 }}
|
||||
expandedRowRender={ExpertDetail}
|
||||
/>
|
||||
{total > 10 &&
|
||||
<Pagination
|
||||
onChange={(page) => { setCurPage(page) }}
|
||||
onChange={(page) => { setCurPage1(page) }}
|
||||
current={curPage}
|
||||
total={total}
|
||||
/>}
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
}
|
||||
.ant-table-thead > tr > th,
|
||||
.ant-table-tbody > tr > td {
|
||||
padding: 1rem 0.2rem;
|
||||
padding: 1rem 0.1rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
@ -53,7 +53,18 @@
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.ant-table-row-expand-icon{
|
||||
width: 35px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.ant-table-row-expanded::after, .ant-table-row-collapsed::after{
|
||||
content: '详情';
|
||||
}
|
||||
.expert_detail_div{
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
}
|
||||
}
|
||||
|
||||
.inline-form {
|
||||
|
|
|
@ -57,7 +57,7 @@ class NewHeader extends Component {
|
|||
}
|
||||
componentDidMount() {
|
||||
getUserInfo().then(response =>{
|
||||
response && this.setState({isExpert: response.data.expert});
|
||||
response && this.setState({isExpert: response.data && response.data.expert});
|
||||
});
|
||||
// this.getAppdata();
|
||||
this.geturlsdata();
|
||||
|
|
|
@ -28,7 +28,7 @@ body>.-task-title {
|
|||
width: 100%;
|
||||
height:70px;
|
||||
min-width: 1200px;
|
||||
z-index: 10000;
|
||||
z-index: 1000;
|
||||
background:rgba(255,255,255,1);
|
||||
position: fixed;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue