forked from Gitlink/forgeplus-react
修改BUG增加审核
This commit is contained in:
parent
4493711521
commit
21a3c54754
|
@ -1,13 +1,18 @@
|
|||
import React, { useEffect, useState ,memo} from 'react';
|
||||
import React, { useEffect, useState, memo } from 'react';
|
||||
import { Icon, } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import './index.scss';
|
||||
|
||||
export default memo((props) => {
|
||||
const { options, changeOptionId, type, defaultValue } = props;
|
||||
const { options, changeOptionId, type } = props;
|
||||
|
||||
const [myOptions, setMyOptions] = useState(options);
|
||||
const [option, setOption] = useState(defaultValue);
|
||||
const [myOptions, setMyOptions] = useState(()=>{
|
||||
return JSON.parse(JSON.stringify(options));
|
||||
});
|
||||
const [option, setOption] = useState({
|
||||
name: '综合',
|
||||
type: 'default',
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
changeOptionId(option, type);
|
||||
|
@ -18,15 +23,16 @@ export default memo((props) => {
|
|||
...activeItem,
|
||||
desc: !activeItem.desc
|
||||
};
|
||||
for(const item of myOptions){
|
||||
if(item.type===activeItem.type){
|
||||
item.desc=newOption.desc;
|
||||
for (const item of myOptions) {
|
||||
if (item.type === activeItem.type) {
|
||||
item.desc = newOption.desc;
|
||||
}
|
||||
}
|
||||
setOption(newOption);
|
||||
setMyOptions(myOptions);
|
||||
}
|
||||
|
||||
console.log('-----options----')
|
||||
return (
|
||||
|
||||
<div className="sort-box">
|
||||
|
|
|
@ -2,28 +2,6 @@ import { notification } from 'antd';
|
|||
import axios from 'axios';
|
||||
import cookie from 'react-cookies';
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
// export const httpUrl='http://117.50.100.12:8001';
|
||||
// export const httpUrl='http://192.168.31.72:8081';
|
||||
// export const httpUrl = 'http://106.75.31.211:58088';
|
||||
// export const httpUrl = 'http://192.168.31.72:8089';
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
<<<<<<< HEAD
|
||||
// export const httpUrl = 'http://192.168.31.104:8081';
|
||||
>>>>>>> 09e81b9... 添加成果内容
|
||||
=======
|
||||
export const httpUrl = 'http://192.168.31.104:8081';
|
||||
>>>>>>> 6b63cd2... 上传成果修改
|
||||
=======
|
||||
// export const httpUrl = 'http://192.168.31.104:8081';
|
||||
=======
|
||||
export const httpUrl = 'http://192.168.31.104:8081';
|
||||
>>>>>>> 2aa8942... 增加成果审核页面
|
||||
|
||||
// export const httpUrl = 'http://192.168.31.168:8081';
|
||||
>>>>>>> 5131dac... 修复成果提交时的bug,联调我是创客
|
||||
|
||||
|
||||
let actionUrl = '';
|
||||
|
@ -91,10 +69,6 @@ service.interceptors.response.use(
|
|||
message: "提示",
|
||||
description: '账户或密码错误!',
|
||||
});
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
// window.location.href="/404";
|
||||
>>>>>>> 09e81b9... 添加成果内容
|
||||
return Promise.reject('error');
|
||||
}
|
||||
if (response.status !== 200 && res.status !== 200) {
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
.color-deep-blue{
|
||||
color:#1B8FFF;
|
||||
}
|
||||
.text-center{
|
||||
text-align: center;
|
||||
}
|
||||
.centerbox {
|
||||
width: 1200px;
|
||||
margin: 40px auto;
|
||||
|
@ -30,25 +27,23 @@
|
|||
}
|
||||
}
|
||||
width: 80vw;
|
||||
max-width: 1200px;
|
||||
max-width: 1280px;
|
||||
margin: 40px auto;
|
||||
position: relative;
|
||||
}
|
||||
.center-content {
|
||||
padding-top:5px;
|
||||
background: #fff;
|
||||
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.05);
|
||||
border-radius: 5px;
|
||||
overflow: auto;
|
||||
border: 1px solid #dedede;
|
||||
box-shadow: #eee 0px 1px 1px 3px;
|
||||
}
|
||||
.centerScreen {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 60px;
|
||||
height: 46px;
|
||||
background-color: #fff;
|
||||
border-bottom: 1px solid #dedede;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 内容标题左侧样式
|
||||
.center-left-but {
|
||||
display: flex;
|
||||
|
@ -76,8 +71,6 @@
|
|||
.center-left-butDACT {
|
||||
background-color: #409eff;
|
||||
color: #fff;
|
||||
=======
|
||||
>>>>>>> 216e984... 上传我的成果静态页面
|
||||
}
|
||||
|
||||
.head-navigation {
|
||||
|
@ -137,7 +130,6 @@
|
|||
max-width: 500px;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
.link{
|
||||
color: #0089ff;
|
||||
cursor: pointer;
|
||||
|
@ -156,9 +148,6 @@
|
|||
}
|
||||
|
||||
.none_panels{
|
||||
=======
|
||||
.none_panels {
|
||||
>>>>>>> 2ed7e0d... 上传创客新增任务及列表代码
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
@ -173,7 +162,6 @@
|
|||
text-align: left;
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
// 富文本样式
|
||||
.w-e-text table td, .w-e-text table th{
|
||||
height: 30px;
|
||||
|
@ -217,69 +205,3 @@
|
|||
width: 98%;
|
||||
}
|
||||
}
|
||||
=======
|
||||
|
||||
.ant-modal-footer{
|
||||
text-align: center;
|
||||
border: 0;
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
>>>>>>> 92f3934... 上传我的需求及
|
||||
=======
|
||||
|
||||
// 富文本样式
|
||||
.w-e-text table td, .w-e-text table th{
|
||||
height: 30px;
|
||||
}
|
||||
// 富文本生成的内容的样式
|
||||
.editor-w-text table td, .editor-w-text table th{
|
||||
border-bottom: 1px solid #ccc;
|
||||
border-right: 1px solid #ccc;
|
||||
padding: 3px 5px;
|
||||
height: 30px;
|
||||
min-height: 30px;
|
||||
}
|
||||
.editor-w-text table th {
|
||||
border-bottom: 2px solid #ccc;
|
||||
text-align: center;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
.editor-w-text table {
|
||||
border-top: 1px solid #ccc;
|
||||
border-left: 1px solid #ccc;
|
||||
}
|
||||
.editor-w-text blockquote {
|
||||
display: block;
|
||||
border-left: 8px solid #d0e5f2;
|
||||
padding: 5px 10px;
|
||||
margin: 10px 0;
|
||||
line-height: 1.4;
|
||||
font-size: 100%;
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
.user-box{
|
||||
cursor: pointer;
|
||||
&:hover{
|
||||
color: #409eff;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@media screen and (max-width: 1200px){
|
||||
.centerbox {
|
||||
width: 100vw;
|
||||
}
|
||||
.newHeaders{
|
||||
min-width: 325px;
|
||||
}
|
||||
.newContainers{
|
||||
min-width: 325px;
|
||||
.newMain{
|
||||
min-width: 325px;
|
||||
}
|
||||
}
|
||||
.newFooter{
|
||||
min-width: 325px;
|
||||
}
|
||||
}
|
||||
>>>>>>> 216e984... 上传我的成果静态页面
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { Component } from "react";
|
||||
import React, { Component, useEffect, useState } from "react";
|
||||
|
||||
import { Route, Switch } from "react-router-dom";
|
||||
import { withRouter } from "react-router";
|
||||
|
@ -7,6 +7,7 @@ import { CNotificationHOC } from "../modules/courses/common/CNotificationHOC";
|
|||
import { TPMIndexHOC } from "../modules/tpm/TPMIndexHOC";
|
||||
import Loadable from "react-loadable";
|
||||
import Loading from "../Loading";
|
||||
import { getUserInfo } from './task/api';
|
||||
import { ImageLayerOfCommentHOC } from "../modules/page/layers/ImageLayerOfCommentHOC";
|
||||
import './index.scss';
|
||||
|
||||
|
@ -40,67 +41,93 @@ const PaperManage = Loadable({
|
|||
loading: Loading,
|
||||
});
|
||||
|
||||
class Index extends Component {
|
||||
render() {
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
<Switch {...this.props}>
|
||||
const PaperComplain = Loadable({
|
||||
loader: () => import("./task/paperComplain"),
|
||||
loading: Loading,
|
||||
});
|
||||
|
||||
<Route
|
||||
path="/task/taskDetail/:taskId"
|
||||
render={(props) => (
|
||||
<TaskDetail {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/taskAdd"
|
||||
render={(props) => (
|
||||
<TaskEdit {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/taskEdit/:taskId"
|
||||
render={(props) => (
|
||||
<TaskEdit {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/myTask"
|
||||
render={(props) => (
|
||||
<MyTask {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/taskManage"
|
||||
render={(props) => (
|
||||
<TaskManage {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/paperManage"
|
||||
render={(props) => (
|
||||
<PaperManage {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task"
|
||||
render={(props) => (
|
||||
<TaskList {...this.props} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
const Index = (propsTransmit) => {
|
||||
// 开发时,从代理的位置获取用户信息
|
||||
const [currentUser, setCurrentUser] = useState(null);
|
||||
const isDev = window.location.href.indexOf('3007') > -1 ? true : false;
|
||||
useEffect(() => {
|
||||
isDev && getUserInfo().then(res => {
|
||||
if (res && res.data) {
|
||||
setCurrentUser(res.data);
|
||||
}
|
||||
})
|
||||
}, [isDev])
|
||||
let propsF = { ...propsTransmit };
|
||||
if (isDev && currentUser) {
|
||||
propsF.current_user = currentUser;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="newMain clearfix">
|
||||
<Switch {...propsF}>
|
||||
|
||||
<Route
|
||||
path="/task/taskDetail/:taskId"
|
||||
render={(props) => (
|
||||
<TaskDetail {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/taskAdd"
|
||||
render={(props) => (
|
||||
<TaskEdit {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/taskEdit/:taskId"
|
||||
render={(props) => (
|
||||
<TaskEdit {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/myTask"
|
||||
render={(props) => (
|
||||
<MyTask {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/taskManage"
|
||||
render={(props) => (
|
||||
<TaskManage {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/paperManage"
|
||||
render={(props) => (
|
||||
<PaperManage {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task/paperComplain"
|
||||
render={(props) => (
|
||||
<PaperComplain {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
<Route
|
||||
path="/task"
|
||||
render={(props) => (
|
||||
<TaskList {...propsF} {...props} />
|
||||
)}
|
||||
></Route>
|
||||
|
||||
|
||||
</Switch>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// }
|
||||
export default withRouter(
|
||||
ImageLayerOfCommentHOC({
|
||||
imgSelector: ".imageLayerParent img, .imageLayerParent .imageTarget",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import fetch from '../fetch';
|
||||
import fetch,{} from '../fetch';
|
||||
import { notification } from 'antd';
|
||||
|
||||
// 获取字典分类列表
|
||||
|
@ -9,6 +9,14 @@ export function getDictionary(id) {
|
|||
});
|
||||
}
|
||||
|
||||
// 获取用户信息
|
||||
export function getUserInfo() {
|
||||
return fetch({
|
||||
url: '/user/getUserInfo',
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
||||
// 获取任务领域
|
||||
export async function getTaskCategory() {
|
||||
let res = await fetch({
|
||||
|
@ -250,6 +258,43 @@ export function checkPaper(data){
|
|||
return fetch({
|
||||
url: `/api/paper/admin/complainPaper/${data.paperId}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
data: data.auditingVo
|
||||
});
|
||||
}
|
||||
|
||||
// 成果申诉
|
||||
export function complainPaper(data){
|
||||
return fetch({
|
||||
url: `/api/paper/complainInfo/${data.paperId}`,
|
||||
method: 'post',
|
||||
data: data.params
|
||||
});
|
||||
}
|
||||
|
||||
// 审核申诉材料列表查询
|
||||
export async function complainPaperList(params) {
|
||||
let res = await fetch({
|
||||
url: '/api/paper/admin/readyComplaintPapers',
|
||||
method: 'get',
|
||||
params,
|
||||
});
|
||||
if (res.data) {
|
||||
return res.data;
|
||||
} else {
|
||||
notification.open({
|
||||
message: "提示",
|
||||
description: res.message || '请求错误',
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// 审核申诉材料
|
||||
export function checkComplain(data){
|
||||
return fetch({
|
||||
url: `/api/paper/admin/complainMaterial/${data.paperId}`,
|
||||
method: 'post',
|
||||
data: data.auditingVo
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { Modal, Pagination } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
import ProofModal from '../proofModal';
|
||||
import { publishModeArr, taskStatusAllArr } from '../../static';
|
||||
import '../../index.scss';
|
||||
import './index.scss';
|
||||
|
||||
const statusArr = [];
|
||||
|
@ -11,11 +13,11 @@ for (const item of taskStatusAllArr) {
|
|||
statusArr[item.dicItemCode] = item.dicItemName;
|
||||
}
|
||||
export default (props) => {
|
||||
const { list, curPage, total, changePage, taskCategoryValueArr, loading, publish } = props;
|
||||
const { list, curPage, total, changePage, taskCategoryValueArr, loading, publish, } = props;
|
||||
|
||||
const [page, setPage] = useState(1);
|
||||
const [visibleProofs, setVisibleProofs] = useState(false);
|
||||
const [activeItem, setActiveItem] = useState({});
|
||||
const [taskId, setTaskId] = useState({});
|
||||
const pageSize = props.pageSize || 10;
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -24,13 +26,13 @@ export default (props) => {
|
|||
|
||||
function uploadProofs(item) {
|
||||
setVisibleProofs(true);
|
||||
setActiveItem(item);
|
||||
setTaskId(item.id);
|
||||
}
|
||||
|
||||
function repairAdvice(repairAdvice){
|
||||
function repairAdvice(repairAdvice) {
|
||||
Modal.info({
|
||||
title: '审核意见',
|
||||
content:repairAdvice
|
||||
content: repairAdvice
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -81,9 +83,11 @@ export default (props) => {
|
|||
}
|
||||
|
||||
{item.status === 4 && <Link className="line_1 color-blue" to={`/task/taskDetail/${item.id}`}>成果评选</Link>}
|
||||
{item.status === 4 && item.papersCount && (!item.isProofBoolean) && <a onClick={() => { uploadProofs(item) }} className="line_1 color-blue">上传佐证材料</a>}
|
||||
{
|
||||
// item.status === 4 && item.papersCount && (!item.isProofBoolean) &&
|
||||
<a onClick={() => { uploadProofs(item) }} className="line_1 color-blue">上传佐证材料</a>}
|
||||
|
||||
{(item.status === 9 || item.status === 2) && <a onClick={() => { repairAdvice(item.repairAdvice) }} className="line_1 color-blue">审核意见</a>}
|
||||
{(item.status === 9) && <a onClick={() => { repairAdvice(item.repairAdvice) }} className="line_1 color-blue">审核意见</a>}
|
||||
|
||||
{/* <a href="javascript:void(0)" className="line_1 color-blue" onClick="paying_register_popup()">支付登记</a> */}
|
||||
{/* <a href="javascript:void(0)" className="color-blue line_1">上传支付凭证</a> */}
|
||||
|
@ -108,31 +112,12 @@ export default (props) => {
|
|||
</React.Fragment>
|
||||
}
|
||||
|
||||
<Modal
|
||||
title="上传评选佐证材料"
|
||||
<ProofModal
|
||||
taskId={taskId}
|
||||
visible={visibleProofs}
|
||||
// onOk={checkItem}
|
||||
onCancel={() => { setVisibleProofs(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
{/* <Form {...formModalLayout}>
|
||||
<Form.Item label={"新手机号码:"} >
|
||||
<Input
|
||||
className="tel-input"
|
||||
placeholder="请输入11位手机号"
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item label={"验证码:"} >
|
||||
<Input
|
||||
className="code-input"
|
||||
placeholder="请输入验证码"
|
||||
/>
|
||||
<Button className="ml10" type="primary" disabled={num !== 0} onClick={getCode}>{num || '获取验证码'}</Button>
|
||||
</Form.Item>
|
||||
</Form> */}
|
||||
</Modal>
|
||||
changeVisible={setVisibleProofs}
|
||||
/>
|
||||
</React.Fragment>
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,11 +1,12 @@
|
|||
import React, { useEffect, useState } from 'react';
|
||||
import { Pagination, Modal, Input, Button } from 'antd';
|
||||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { Pagination, Modal, Form, Input, Button } from 'antd';
|
||||
import ReactWEditor from 'wangeditor-for-react';
|
||||
import { getImageUrl, timeAgo } from 'educoder';
|
||||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
import { editorConfig } from 'military/components/config';
|
||||
import { reportPaper, thumbUpPaper, commentAdd } from '../../api';
|
||||
import Upload from 'military/components/Upload';
|
||||
import { reportPaper, thumbUpPaper, commentAdd, complainPaper } from '../../api';
|
||||
import { httpUrl } from '../../../fetch';
|
||||
import winpng from '../../image/win.png';
|
||||
|
||||
|
@ -13,12 +14,11 @@ import './index.scss';
|
|||
|
||||
const { TextArea } = Input;
|
||||
|
||||
export default (props) => {
|
||||
const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification } = props;
|
||||
export default Form.create()((props) => {
|
||||
const { list, curPage, total, changePage, loading, applyStatusAllNameArr, reloadList, showNotification, current_user, form } = props;
|
||||
const { getFieldDecorator, validateFields, } = form;
|
||||
const [page, setPage] = useState(1);
|
||||
const [pageSize, setPageSize] = useState(() => {
|
||||
return props.pageSize || 10;
|
||||
});
|
||||
const pageSize = props.pageSize || 10;
|
||||
const [checkedItem, setCheckedItem] = useState({});
|
||||
const [reportVisible, setReportVisible] = useState(false);
|
||||
const [reportValue, setReportValue] = useState('');
|
||||
|
@ -26,6 +26,10 @@ export default (props) => {
|
|||
|
||||
const [commentId, setCommentId] = useState(undefined);
|
||||
|
||||
const [complainVisible, setComplainVisible] = useState(false);
|
||||
const [complainValue, setComplainValue] = useState('');
|
||||
const [fileList, setFileList] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
changePage(page);
|
||||
}, [page]);
|
||||
|
@ -36,17 +40,18 @@ export default (props) => {
|
|||
}
|
||||
|
||||
function report() {
|
||||
if (!reportValue) {
|
||||
return;
|
||||
}
|
||||
reportPaper({
|
||||
paperId: checkedItem.id,
|
||||
content: reportValue
|
||||
}).then(res => {
|
||||
if (res.message === 'success') {
|
||||
showNotification('举报成功');
|
||||
setReportVisible(false);
|
||||
setReportValue('');
|
||||
validateFields((error, values) => {
|
||||
if (!error) {
|
||||
reportPaper({
|
||||
paperId: checkedItem.id,
|
||||
content: values.reportValue
|
||||
}).then(res => {
|
||||
if (res.message === 'success') {
|
||||
showNotification('举报成功');
|
||||
setReportVisible(false);
|
||||
setReportValue('');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -92,6 +97,49 @@ export default (props) => {
|
|||
window.location.href = `/users/${login}`;
|
||||
}
|
||||
|
||||
function complain() {
|
||||
if (!fileList || !fileList.length) {
|
||||
showNotification('请提交申诉文件!');
|
||||
return;
|
||||
}
|
||||
validateFields((error, values) => {
|
||||
if (!error) {
|
||||
let files = [];
|
||||
for (const item of fileList) {
|
||||
files.push(item.id || item.response.data.id);
|
||||
}
|
||||
complainPaper({
|
||||
paperId: checkedItem.id,
|
||||
params: {
|
||||
content: values.complainValue,
|
||||
files: files.join()
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.message === 'success') {
|
||||
showNotification('申诉提交成功');
|
||||
setComplainVisible(false);
|
||||
setComplainValue('');
|
||||
setFileList(null);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 上传附件后得到的文件数组
|
||||
function UploadFunc(fileList) {
|
||||
setFileList(fileList);
|
||||
}
|
||||
|
||||
const helper = useCallback(
|
||||
(name, rules, widget) => (
|
||||
<Form.Item>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true })(widget)}
|
||||
</Form.Item>
|
||||
),
|
||||
[]
|
||||
);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{loading ? <Loading /> :
|
||||
|
@ -110,13 +158,16 @@ export default (props) => {
|
|||
{item.user.nickname || item.user.login}
|
||||
</span>
|
||||
<span className="color-grey9">{timeAgo(item.createdAt)}</span>
|
||||
<span className="color-blue ml10">{!item.verifyStatus && "待审核"}</span>
|
||||
<span className="color-blue ml10">{item.verifyStatus ? applyStatusAllNameArr[item.status] : "待审核"}</span>
|
||||
|
||||
</li>
|
||||
<li className="fr">
|
||||
<a className="color-blue fl">
|
||||
{/* <a className="color-blue fl mr10">
|
||||
{applyStatusAllNameArr[item.status]}
|
||||
</a>
|
||||
</a> */}
|
||||
{item.needComplain && (current_user.login === item.user.login) && <a className="base_smallBtn blue_line_btn fl" onClick={() => { setComplainVisible(true); setCheckedItem(item) }}>
|
||||
申诉
|
||||
</a>}
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
@ -203,17 +254,64 @@ export default (props) => {
|
|||
onOk={report}
|
||||
onCancel={() => { setReportVisible(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
<div className="task-popup-content">
|
||||
<p className="edu-txt-center lineh-20 mb10">你的举报信息将发送给平台管理员</p>
|
||||
<p className="edu-txt-center lineh-20">请如实填写有效的举报原由,我们将尽快完成审核</p>
|
||||
{
|
||||
helper('reportValue', [{ required: reportVisible, message: "(必填)请在此输入发起举报的原因,最大限制100个字符" },
|
||||
{ max: 100, message: '长度不能超过100个字符' }],
|
||||
<TextArea
|
||||
// value={reportValue}
|
||||
placeholder="(必填)请在此输入发起举报的原因,最大限制100个字符"
|
||||
autoSize={{ minRows: 6 }}
|
||||
className="applyText"
|
||||
// onChange={(e) => { setReportValue(e.target.value) }}
|
||||
// maxLength={100}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
|
||||
<Modal
|
||||
title="申诉"
|
||||
visible={complainVisible}
|
||||
onOk={complain}
|
||||
onCancel={() => { setComplainVisible(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
<div className="task-popup-content">
|
||||
<p className="edu-txt-center lineh-20 mb10">你的申诉信息将发送给平台管理员</p>
|
||||
<p className="edu-txt-center lineh-20">请如实填写有效的申诉原由,我们将尽快完成审核</p>
|
||||
<TextArea
|
||||
value={reportValue}
|
||||
{/* <TextArea
|
||||
value={complainValue}
|
||||
placeholder="(必填)请在此输入发起申诉的原因,最大限制100个字符"
|
||||
autoSize={{ minRows: 6 }}
|
||||
className="applyText"
|
||||
onChange={(e) => { setReportValue(e.target.value) }}
|
||||
className="applyText mb20"
|
||||
onChange={(e) => { setComplainValue(e.target.value) }}
|
||||
maxLength={100}
|
||||
/> */}
|
||||
{
|
||||
helper('complainValue', [{ required: complainVisible, message: "(必填)请在此输入发起申诉的原因,最大限制100个字符" },
|
||||
{ max: 100, message: '长度不能超过100个字符' }],
|
||||
<TextArea
|
||||
placeholder="(必填)请在此输入发起申诉的原因,最大限制100个字符"
|
||||
autoSize={{ minRows: 6 }}
|
||||
className="applyText"
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
<Upload
|
||||
className="commentStyle"
|
||||
load={UploadFunc}
|
||||
size={50}
|
||||
showNotification={showNotification}
|
||||
actionUrl={httpUrl}
|
||||
fileList={fileList}
|
||||
/>
|
||||
</div>
|
||||
</Modal>
|
||||
|
@ -222,4 +320,5 @@ export default (props) => {
|
|||
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|||
import { Icon, Pagination } from 'antd';
|
||||
import { formatDuring } from 'educoder';
|
||||
import Nodata from 'forge/Nodata';
|
||||
import { taskStatusAllArr} from '../../static';
|
||||
import { taskStatusAllArr } from '../../static';
|
||||
import Loading from "src/Loading";
|
||||
import winpng from '../../image/win.png';
|
||||
import './index.scss';
|
||||
|
@ -27,7 +27,7 @@ export default (props) => {
|
|||
}
|
||||
|
||||
function surplusTime(item) {
|
||||
let surplus = item.collectingDays * 24 * 3600 - (new Date() - new Date(item.publishedAt)) / 1000;
|
||||
let surplus = item.collectingDays * 24 * 3600 * 1000 - (new Date() - new Date(item.publishedAt || item.createdAt));
|
||||
return formatDuring(surplus)
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@ import { Pagination, Modal, Input, Radio } from 'antd';
|
|||
import { Link } from "react-router-dom";
|
||||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
import { timeAgo } from 'educoder';
|
||||
import { timeAgo } from 'educoder';
|
||||
import { checkTask } from '../../api';
|
||||
import './index.scss';
|
||||
import winpng from '../../image/win.png';
|
||||
|
@ -31,7 +31,7 @@ export default (props) => {
|
|||
id,
|
||||
isPassed: 1,
|
||||
}).then(res => {
|
||||
if (res.message === 'success') {
|
||||
if (res && res.message === 'success') {
|
||||
showNotification('操作成功');
|
||||
reloadList();
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ export default (props) => {
|
|||
isRepairDocument,
|
||||
repairAdvice: repairAdvice
|
||||
}).then(res => {
|
||||
if (res.message === 'success') {
|
||||
if (res && res.message === 'success') {
|
||||
showNotification('操作成功');
|
||||
reloadList();
|
||||
setRepairAdvice('');
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
import React, { useEffect, useState, useCallback } from 'react';
|
||||
import { Modal, Table, Radio, Form, Input, Button, Pagination } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import Nodata from 'forge/Nodata';
|
||||
import Loading from "src/Loading";
|
||||
import { getTaskPaper } from "../../api";
|
||||
import '../../index.scss';
|
||||
import './index.scss';
|
||||
|
||||
|
||||
export default Form.create()((props) => {
|
||||
const { changeVisible, taskId, visible, form } = props;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, } = form;
|
||||
|
||||
const pageSize = props.pageSize || 10;
|
||||
const [searchObj, setSearchObj] = useState({});
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [dataList, setDataList] = useState([]);
|
||||
|
||||
// 获取成果列表
|
||||
useEffect(() => {
|
||||
setLoading(true);
|
||||
let params = {
|
||||
taskId,
|
||||
orderBy: '',
|
||||
pageSize: 10,
|
||||
curPage,
|
||||
status: '',
|
||||
}
|
||||
taskId && getTaskPaper(params).then(data => {
|
||||
if (data && Array.isArray(data.rows)) {
|
||||
for (const item of data.rows) {
|
||||
item.detail = item.paperDetail.content;
|
||||
}
|
||||
}
|
||||
setDataList(data.rows || []);
|
||||
setLoading(false);
|
||||
setTotal(data.total);
|
||||
});
|
||||
}, [taskId, curPage,]);
|
||||
|
||||
|
||||
const helper = useCallback(
|
||||
(name, rules, widget) => (
|
||||
<Form.Item>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true, })(widget)}
|
||||
</Form.Item>
|
||||
), []);
|
||||
|
||||
function onSearch() {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
setSearchObj(values);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function clearSearch() {
|
||||
setFieldsValue({
|
||||
numberInput: '',
|
||||
nameInput: '',
|
||||
enterpriseNameInput: ''
|
||||
});
|
||||
setSearchObj({});
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Modal
|
||||
title="上传评选佐证材料"
|
||||
visible={visible}
|
||||
// onOk={checkItem}
|
||||
onCancel={() => { changeVisible(false) }}
|
||||
className="task-manage proof-modal"
|
||||
>
|
||||
<h3 className="margin10">选出胜出者<span className="color-red">*</span></h3>
|
||||
<div className="center-right-but">
|
||||
{helper(
|
||||
"numberInput",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="请输入成果编号进行检索"
|
||||
/>
|
||||
)}
|
||||
|
||||
{helper(
|
||||
"author",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="请输入作者主体名称进行检索"
|
||||
/>
|
||||
)}
|
||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
|
||||
</div>
|
||||
|
||||
</Modal>
|
||||
</React.Fragment>
|
||||
|
||||
)
|
||||
}
|
||||
)
|
|
@ -17,11 +17,15 @@
|
|||
border-radius: 1rem;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.ant-form-item {
|
||||
margin: 0 1rem 0 0;
|
||||
.center-right-but{
|
||||
.ant-form-item {
|
||||
margin: 0 1rem 0 0;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-form-item-control-wrapper {
|
||||
display: inline-block;
|
||||
}
|
||||
|
@ -43,4 +47,34 @@
|
|||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.text-ellipsis {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
// white-space: nowrap;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.text-ellipsis-2 {
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
|
||||
.ant-pagination{
|
||||
margin:2rem auto;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.proof-modal{
|
||||
min-width: 800px;
|
||||
width: 80vw;
|
||||
.ant-form-item-control{
|
||||
width: 200px;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
import React, { useCallback, useEffect, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
||||
import { Tabs, Input, Table, Pagination } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import ChooseNav from '../../components/chooseNav';
|
||||
import ItemListMyTask from '../components/itemListMyTask';
|
||||
import { taskStatusAllArr, applyStatusArr, publishModeArr } from '../static';
|
||||
import { getJoinTaskList } from '../api';
|
||||
import { getJoinTaskList,getTaskPaper } from '../api';
|
||||
import './index.scss';
|
||||
const Search = Input.Search;
|
||||
const { TabPane } = Tabs;
|
||||
|
||||
const publishStatusArr = taskStatusAllArr.slice(3,9);
|
||||
const publishStatusArr = taskStatusAllArr.slice(3, 9);
|
||||
|
||||
const statusArr = [];
|
||||
for (const item of taskStatusAllArr) {
|
||||
|
@ -51,55 +51,55 @@ export default ({ taskCategoryValueArr }) => {
|
|||
}, [paperStatusString, taskStatusString, searchInput, orderBy, curPage]);
|
||||
|
||||
|
||||
// const columns = useCallback(()=>{
|
||||
const columns = [
|
||||
{
|
||||
title: '任务',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'createdAt',
|
||||
render: (text, record) => {
|
||||
return <div className="flex-column">
|
||||
<span className="line_1">{taskCategoryValueArr[record.categoryId]}</span>
|
||||
<span className="line_1">{publishModeArr[record.publishMode]}</span>
|
||||
</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '应征投稿',
|
||||
dataIndex: 'papersCount',
|
||||
render: (text) => {
|
||||
return text || 0
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '金额',
|
||||
dataIndex: 'bounty',
|
||||
render: (text) => {
|
||||
return <span className="color-orange">¥{text}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '任务状态',
|
||||
dataIndex: 'status',
|
||||
render: (text, record) => {
|
||||
return statusArr[text]
|
||||
}
|
||||
},
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
title: '任务',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'createdAt',
|
||||
render: (text, record) => {
|
||||
return <div className="flex-column">
|
||||
<span className="line_1">{taskCategoryValueArr[record.categoryId]}</span>
|
||||
<span className="line_1">{publishModeArr[record.publishMode]}</span>
|
||||
</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '应征投稿',
|
||||
dataIndex: 'papersCount',
|
||||
render: (text) => {
|
||||
return text || 0
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '金额',
|
||||
dataIndex: 'bounty',
|
||||
render: (text) => {
|
||||
return <span className="color-orange">¥{text}</span>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '任务状态',
|
||||
dataIndex: 'status',
|
||||
render: (text, record) => {
|
||||
return statusArr[text]
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.id}`}>查看详情</Link>
|
||||
</span >
|
||||
),
|
||||
},
|
||||
];
|
||||
// },[taskCategoryValueArr,publishModeArr,statusArr]);
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.id}`}>查看详情</Link>
|
||||
</span >
|
||||
),
|
||||
},
|
||||
];
|
||||
}, [taskCategoryValueArr, publishModeArr, statusArr]);
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,214 @@
|
|||
import React, { useCallback, useMemo, useEffect, useState } from 'react';
|
||||
import { Input, Button,Radio, Form,Table,Pagination,Modal } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import ItemTaskManage from '../components/itemTaskManage';
|
||||
import StatusNav from '../../components/statusNav';
|
||||
import { approveArr } from '../static';
|
||||
import { complainPaperList ,checkComplain} from '../api';
|
||||
import '../index.scss';
|
||||
|
||||
const TextArea = Input.TextArea;
|
||||
|
||||
export default Form.create()(({ current_user, form, showNotification, match, history }) => {
|
||||
const { getFieldDecorator, validateFields, setFieldsValue, getFieldsValue } = form;
|
||||
|
||||
const [approve,setApprove]=useState(1);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [searchObj, setSearchObj] = useState({});
|
||||
const [curPage, setCurPage] = useState(1);
|
||||
const [total, setTotal] = useState(0);
|
||||
const [taskList, setTaskList] = useState([]);
|
||||
|
||||
const [reload, setReload] = useState(0);
|
||||
const [visible, setVisible] = useState(false);
|
||||
const [activeId, setActiveId] = useState('');
|
||||
const [message, setMessage] = useState('');
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
const params = {
|
||||
...searchObj,
|
||||
curPage,
|
||||
pageSize: 10,
|
||||
};
|
||||
setLoading(true);
|
||||
complainPaperList(params).then(data => {
|
||||
if (data) {
|
||||
setTaskList(data.rows);
|
||||
setTotal(data.total);
|
||||
}
|
||||
setLoading(false);
|
||||
})
|
||||
}, [reload, curPage, searchObj]);
|
||||
|
||||
|
||||
const helper = useCallback(
|
||||
(name, rules, widget) => (
|
||||
<Form.Item>
|
||||
{getFieldDecorator(name, { rules, validateFirst: true, })(widget)}
|
||||
</Form.Item>
|
||||
), []);
|
||||
|
||||
|
||||
function onSearch() {
|
||||
validateFields((err, values) => {
|
||||
if (!err) {
|
||||
setSearchObj(values);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function clearSearch() {
|
||||
setFieldsValue({
|
||||
numberInput: '',
|
||||
nameInput: '',
|
||||
enterpriseNameInput: ''
|
||||
});
|
||||
setSearchObj({});
|
||||
}
|
||||
|
||||
|
||||
function changeApprove(approve) {
|
||||
setApprove(approve);
|
||||
setCurPage(1);
|
||||
// if (approve === 1) {
|
||||
// setStatusString('1');
|
||||
// } else {
|
||||
// setStatusString('2,3,4,5,6,7,8');
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
const columns = useMemo(() => {
|
||||
return [
|
||||
{
|
||||
title: '来源任务',
|
||||
dataIndex: 'name',
|
||||
width: "20%",
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Link className="line_1 color-grey3 text-ellipsis" to={`/task/taskDetail/${record.taskId}`}>{text}</Link>
|
||||
</span >
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '评论/成果内容',
|
||||
dataIndex: 'content',
|
||||
width: "30%",
|
||||
render: (text, record) => {
|
||||
return record.paperDetail ? <div className="text-ellipsis" dangerouslySetInnerHTML={{ __html: record.paperDetail.content }}></div> : ''
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '评论/提交者',
|
||||
dataIndex: 'user',
|
||||
render: (text, record) => {
|
||||
return record.user.nickname || record.user.login
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '评论/提交时间',
|
||||
dataIndex: 'createdAt',
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
dataIndex: 'verifyStatus',
|
||||
render: (text, record) => {
|
||||
return text ? '通过' : '未通过'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
render: (text, record) => (
|
||||
<React.Fragment>
|
||||
<Button className="mr5 font-12" type="primary" size="small" onClick={() => { checkPaperItem(record.id, 1) }}>通过</Button>
|
||||
<Button className="mr5 font-12" type="info" size="small" onClick={() => { setActiveId(record.id); setVisible(true) }}>不通过</Button>
|
||||
{/* <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.id}`}>查看详情</Link> */}
|
||||
</React.Fragment>
|
||||
),
|
||||
},
|
||||
]
|
||||
}, []);
|
||||
|
||||
function checkPaperItem(paperId, pass) {
|
||||
setLoading(true);
|
||||
checkComplain({
|
||||
paperId,
|
||||
auditingVo: {
|
||||
pass,
|
||||
message,
|
||||
}
|
||||
}).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
setReload(reload + 1);
|
||||
setVisible(false);
|
||||
}
|
||||
setLoading(false);
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="centerbox task-manage">
|
||||
|
||||
<div className="center-screen" >
|
||||
<div className="center-left-but">
|
||||
<Button className="circle-button" type={approve === 1 ? 'primary' : ''} onClick={() => { changeApprove(1) }}>待审批</Button>
|
||||
<Button className="circle-button" type={approve === 2 ? 'primary' : ''} onClick={() => { changeApprove(2) }}>已审批</Button>
|
||||
</div>
|
||||
|
||||
<div className="center-right-but">
|
||||
{helper(
|
||||
"numberInput",
|
||||
[{ max: 20, message: '长度不能超过20个字符' }],
|
||||
<Input
|
||||
placeholder="输入任务编号进行检索"
|
||||
/>
|
||||
)}
|
||||
|
||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||
<Button className="mr10" type="" onClick={clearSearch}>清除</Button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="center-content">
|
||||
<Table
|
||||
loading={loading}
|
||||
rowKey={(row) => row.id}
|
||||
dataSource={taskList}
|
||||
columns={columns}
|
||||
pagination={false}
|
||||
className="mt10"
|
||||
/>
|
||||
{total > 10 &&
|
||||
<Pagination
|
||||
onChange={(page) => { setCurPage(page) }}
|
||||
current={curPage}
|
||||
total={total}
|
||||
/>}
|
||||
</div>
|
||||
|
||||
|
||||
<Modal
|
||||
title="不通过的原因"
|
||||
visible={visible}
|
||||
onOk={() => { checkPaperItem(activeId, 0) }}
|
||||
onCancel={() => { setVisible(false) }}
|
||||
className="form-edit-modal"
|
||||
>
|
||||
<TextArea
|
||||
value={message}
|
||||
placeholder="(必填)我想给点什么意见呢,200字以内"
|
||||
autoSize={{ minRows: 6 }}
|
||||
className="applyText"
|
||||
onChange={(e) => { setMessage(e.target.value) }}
|
||||
maxLength={200}
|
||||
/>
|
||||
</Modal>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
)
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useCallback, forwardRef, useEffect, useState, useMemo } from 'react';
|
||||
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
||||
import { Input, Radio, Select, Button, Form, DatePicker, Table, Pagination, Modal } from 'antd';
|
||||
import { Link } from "react-router-dom";
|
||||
import { paperVerifyStatusArr } from '../static';
|
||||
|
@ -76,17 +76,19 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
{
|
||||
title: '来源任务',
|
||||
dataIndex: 'name',
|
||||
width: "20%",
|
||||
render: (text, record) => (
|
||||
<span>
|
||||
<Link className="line_1 color-grey3" to={`/task/taskDetail/${record.taskId}`}>{text}</Link>
|
||||
<Link className="line_1 color-grey3 text-ellipsis" to={`/task/taskDetail/${record.taskId}`}>{text}</Link>
|
||||
</span >
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '评论/成果内容',
|
||||
dataIndex: 'content',
|
||||
width: "30%",
|
||||
render: (text, record) => {
|
||||
return record.paperDetail ? <div dangerouslySetInnerHTML={{ __html: record.paperDetail.content }}></div> : ''
|
||||
return record.paperDetail ? <div className="text-ellipsis" dangerouslySetInnerHTML={{ __html: record.paperDetail.content }}></div> : ''
|
||||
}
|
||||
},
|
||||
{
|
||||
|
@ -99,7 +101,6 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
{
|
||||
title: '评论/提交时间',
|
||||
dataIndex: 'createdAt',
|
||||
|
||||
},
|
||||
{
|
||||
title: '审核状态',
|
||||
|
@ -123,6 +124,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
}, []);
|
||||
|
||||
function checkPaperItem(paperId, passStatus) {
|
||||
setLoading(true);
|
||||
checkPaper({
|
||||
paperId,
|
||||
auditingVo: {
|
||||
|
@ -130,7 +132,14 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
message,
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res);
|
||||
if (res && res.message === 'success') {
|
||||
setReload(reload + 1);
|
||||
setVisible(false);
|
||||
// if (taskList.length === 1) {
|
||||
// setCurPage(curPage - 1 || 1);
|
||||
// }
|
||||
}
|
||||
setLoading(false);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -199,7 +208,7 @@ export default Form.create()(({ current_user, form, showNotification, match, his
|
|||
pagination={false}
|
||||
className="mt10"
|
||||
/>
|
||||
{taskList.length > 10 &&
|
||||
{total > 10 &&
|
||||
<Pagination
|
||||
onChange={(page) => { setCurPage(page) }}
|
||||
current={curPage}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import React, { forwardRef, useEffect, useState, useCallback } from 'react';
|
||||
import React, { forwardRef, useEffect, useState, useCallback, useMemo } from 'react';
|
||||
import { Form, Input, Button, Modal, Table, Pagination, Checkbox, Tooltip } from 'antd';
|
||||
import classNames from 'classnames';
|
||||
import { Link } from "react-router-dom";
|
||||
|
@ -48,6 +48,7 @@ const columns = [
|
|||
|
||||
export default Form.create()(
|
||||
forwardRef(({ match, current_user, form, history, showNotification }, ref) => {
|
||||
console.log(current_user);
|
||||
const id = match.params.taskId;
|
||||
const { getFieldDecorator, validateFields, setFieldsValue } = form;
|
||||
|
||||
|
@ -108,6 +109,15 @@ export default Form.create()(
|
|||
})
|
||||
}, []);
|
||||
|
||||
const taskLimit = useMemo(() => {
|
||||
if (current_user.admin) {
|
||||
return true;
|
||||
}
|
||||
if (detailData.user) {
|
||||
return current_user.login === detailData.user.login
|
||||
}
|
||||
}, [detailData, current_user])
|
||||
|
||||
// 获取协议内容
|
||||
useEffect(() => {
|
||||
applyModal && getAgreement().then(res => {
|
||||
|
@ -142,13 +152,12 @@ export default Form.create()(
|
|||
});
|
||||
}, [id, status, curPage, reload, relaodChildList]);
|
||||
|
||||
;
|
||||
|
||||
// 流程步骤显示
|
||||
const process = useCallback((title, status, days) => {
|
||||
let surplusTimetext = '';
|
||||
if (detailData.status === status) {
|
||||
let surplus = detailData.collectingDays * 24 * 3600 - (new Date() - new Date(detailData.publishedAt)) / 1000;
|
||||
let surplus = detailData.collectingDays * 24 * 3600 * 1000 - (new Date() - new Date(detailData.publishedAt || detailData.createdAt));
|
||||
if (status === 4) {
|
||||
surplus += detailData.choosingDays * 24 * 3600;
|
||||
}
|
||||
|
@ -166,7 +175,7 @@ export default Form.create()(
|
|||
return (
|
||||
<li key={title} className={classNames({ active: (detailData.status !== 9 && detailData.status >= status) })} >
|
||||
<span>{title}</span>
|
||||
{detailData.status !== status && <p className="color-grey-6 font-12">{days}天</p>}
|
||||
{detailData.status !== status && days && <p className="color-grey-6 font-12">{days}天</p>}
|
||||
|
||||
{detailData.status === status && detailData.delayTime && <p className="color-grey-6 font-12">{detailData.delayTime}</p>}
|
||||
|
||||
|
@ -251,15 +260,21 @@ export default Form.create()(
|
|||
content: '暂无应征者提交',
|
||||
});
|
||||
} else {
|
||||
updateTask({
|
||||
...detailData,
|
||||
id,
|
||||
showUserStatus: 1,
|
||||
}).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
setDetailData(res.data || {});
|
||||
} else {
|
||||
showNotification('操作失败');
|
||||
Modal.confirm({
|
||||
title: '提示',
|
||||
content: '确认公示应征者信息',
|
||||
onOk: () => {
|
||||
updateTask({
|
||||
...detailData,
|
||||
id,
|
||||
showUserStatus: true,
|
||||
}).then(res => {
|
||||
if (res && res.message === 'success') {
|
||||
setDetailData(res.data || {});
|
||||
} else {
|
||||
showNotification('操作失败');
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
@ -281,8 +296,8 @@ export default Form.create()(
|
|||
{helper(
|
||||
"",
|
||||
"content",
|
||||
[{ required: true, message: "请根据具体要求提交有效的稿件,才能打动需求方哟!" },
|
||||
{ max: 1000, message: '长度不能超过1000个字符' }],
|
||||
[{ required: true, message: "请根据具体要求提交有效的稿件,才能打动需求方哟!成果描述不能超过250字哟!" },
|
||||
{ max: 250, message: '长度不能超过250个字符' }],
|
||||
<TextArea
|
||||
placeholder="请根据具体要求提交有效的稿件,才能打动需求方哟!"
|
||||
autoSize={{ minRows: 6 }}
|
||||
|
@ -331,8 +346,10 @@ export default Form.create()(
|
|||
<div className="edu-back-white padding30">
|
||||
<div className="df mb20">
|
||||
<div className="mr30">
|
||||
<a onClick={() => { goUser(detailData.user.login) }} alt="用户头像"><img alt="头像加载失败" className="bor-radius-all" height="60" src={getImageUrl("images/educoder/competition/1.png")} width="60" /></a>
|
||||
<p className="lineh-20 mt10 edu-txt-center">{current_user.username}</p>
|
||||
<a onClick={() => { goUser(detailData.user.login) }} alt="用户头像">
|
||||
<img alt="头像加载失败" className="bor-radius-all" height="60" src={getImageUrl("images/educoder/competition/1.png")} width="60" />
|
||||
</a>
|
||||
<p className="lineh-20 mt10 edu-txt-center">{detailData && detailData.user && (detailData.user.nickname || detailData.user.login)}</p>
|
||||
</div>
|
||||
<div className="flex1">
|
||||
<ul className="clearfix mb20">
|
||||
|
@ -384,7 +401,7 @@ export default Form.create()(
|
|||
{detailData.uploadFileNumbers && <React.Fragment>
|
||||
<div className="font-16 font-bd">任务文件:</div>
|
||||
{
|
||||
detailData.tasksAttachments.map(item => {
|
||||
detailData.tasksAttachments && detailData.tasksAttachments.map(item => {
|
||||
return <div className="file-list-box" key={item.id}>
|
||||
<a onClick={() => { downFile(item) }}><i className="iconfont icon-fujian color-green font-14 mr3"></i>
|
||||
{item.fileName} </a>
|
||||
|
@ -415,8 +432,8 @@ export default Form.create()(
|
|||
</Tooltip>}
|
||||
{/* <a href="javascript:void(0)" onclick="upload_proofs_popup(130)" className="line_1 color-blue fr ml20" id="proof-upload-button">上传佐证材料</a> */}
|
||||
{/* <a href="/tasks/130/export_papers" className="line_1 color-blue fr ml20" data-disable-with="<img alt="Loading" className="download-loading" src="/images/loading.gif?1564989000" ></a>下载中..." target="_blank">一键导出成果物</a> */}
|
||||
{dataList.length > 0 && <a className="line_1 color-blue fr ml20" onClick={exportPaper}>一键导出成果物 >></a>}
|
||||
{!detailData.showUserStatus && <a className="fr color-orange ml20" onClick={showUser}>应征者名单公示 >></a>}
|
||||
{dataList.length > 0 && taskLimit && <a className="line_1 color-blue fr ml20" onClick={exportPaper}>一键导出成果物 >></a>}
|
||||
{(!detailData.showUserStatus) && taskLimit && <a className="fr color-orange ml20" onClick={showUser}>应征者名单公示 >></a>}
|
||||
</div>
|
||||
|
||||
<StatusNav
|
||||
|
@ -445,6 +462,7 @@ export default Form.create()(
|
|||
</React.Fragment>
|
||||
:
|
||||
<ItemListPaper
|
||||
current_user={current_user}
|
||||
list={dataList}
|
||||
itemClick={dataList}
|
||||
curPage={curPage}
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
color: #888;
|
||||
cursor: default;
|
||||
}
|
||||
tbody tr {
|
||||
.ant-table-body tbody tr {
|
||||
height: 90px;
|
||||
}
|
||||
.ant-table-thead
|
||||
|
|
|
@ -89,6 +89,8 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
|||
});
|
||||
} else {
|
||||
let formValue = {
|
||||
contactName: current_user.username || current_user.login,
|
||||
contactPhone: current_user.contactPhone || 18888888888,
|
||||
taskModeId: 1,
|
||||
collectionMode: 1,
|
||||
publishMode: '0',
|
||||
|
@ -174,7 +176,7 @@ export default Form.create()(forwardRef(({ current_user, form, showNotification,
|
|||
|
||||
// 新增或者修改后的处理函数
|
||||
const publishDeal = useCallback((status, publishMode, res) => {
|
||||
if (res && res.message==='success') {
|
||||
if (res && res.message === 'success') {
|
||||
showNotification("任务保存成功!");
|
||||
if (!status) {
|
||||
history.push("/task/myTask?published=false")
|
||||
|
|
|
@ -8,8 +8,7 @@ import { taskTimeArr, taskStatusArr, sortArr, taskModeIdArr } from '../static';
|
|||
import { getTaskList, getTaskCategory } from '../api';
|
||||
const Search = Input.Search;
|
||||
|
||||
export default ({ history, current_user }) => {
|
||||
console.log(current_user);
|
||||
export default ({ history, }) => {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [taskCategoryArr, setTaskCategoryArr] = useState([]);
|
||||
const [categoryId, setCategoryId] = useState('');
|
||||
|
@ -59,7 +58,7 @@ export default ({ history, current_user }) => {
|
|||
|
||||
|
||||
// function changeOptionId(option, type) {
|
||||
const changeOptionId=useCallback((option, type)=>{
|
||||
const changeOptionId = useCallback((option, type) => {
|
||||
if (type === 'taskCategory') {
|
||||
setCategoryId(option.dicItemCode);
|
||||
} else if (type === 'taskModeId') {
|
||||
|
@ -75,11 +74,11 @@ export default ({ history, current_user }) => {
|
|||
setExpiredEndTime('');
|
||||
}
|
||||
} else if (type === 'taskStatus') {
|
||||
setStatusString(option.dicItemCode||'3,4,5,6,7,8');
|
||||
setStatusString(option.dicItemCode || '3,4,5,6,7,8');
|
||||
}
|
||||
},[]);
|
||||
}, []);
|
||||
|
||||
function changeSort(sortType) {
|
||||
const changeSort = useCallback((sortType) => {
|
||||
let sortValue = '';
|
||||
if (sortType.type !== 'default') {
|
||||
if (sortType.desc) {
|
||||
|
@ -90,7 +89,21 @@ export default ({ history, current_user }) => {
|
|||
}
|
||||
setOrderBy(sortValue);
|
||||
setCurPage(1);
|
||||
}
|
||||
}, []);
|
||||
// function changeSort(sortType) {
|
||||
// console.log('-----sort----');
|
||||
// console.log(sortType);
|
||||
// let sortValue = '';
|
||||
// if (sortType.type !== 'default') {
|
||||
// if (sortType.desc) {
|
||||
// sortValue = sortType.type + 'Desc';
|
||||
// } else {
|
||||
// sortValue = sortType.type + 'Asc';
|
||||
// }
|
||||
// }
|
||||
// setOrderBy(sortValue);
|
||||
// setCurPage(1);
|
||||
// }
|
||||
|
||||
function taskClick(id) {
|
||||
history.push(`/task/taskDetail/${id}`);
|
||||
|
@ -101,7 +114,7 @@ export default ({ history, current_user }) => {
|
|||
}
|
||||
|
||||
return (
|
||||
<div className="centerbox" style={{marginTop:'20px'}}>
|
||||
<div className="centerbox" style={{ marginTop: '20px' }}>
|
||||
<div className="nav-content">
|
||||
<ChooseNav
|
||||
key={'taskCategory'}
|
||||
|
@ -146,10 +159,6 @@ export default ({ history, current_user }) => {
|
|||
<SortBox
|
||||
options={sortArr}
|
||||
changeOptionId={changeSort}
|
||||
defaultValue={{
|
||||
name: '综合',
|
||||
type: 'default',
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className="center-right-but">
|
||||
|
@ -157,7 +166,7 @@ export default ({ history, current_user }) => {
|
|||
maxLength={20}
|
||||
style={{ width: "300px" }}
|
||||
placeholder="请输入任务编号/任务名称关键字"
|
||||
onSearch={(value) => setSearchInput(value)}
|
||||
onSearch={(value) => setSearchInput(value)}
|
||||
/>
|
||||
|
||||
<Button className="mr20 font-12" type="primary" onClick={goAdd}><i className="iconfont icon-zaibianji font-12 mr3"></i>发布任务</Button>
|
||||
|
|
Loading…
Reference in New Issue