forked from Gitlink/forgeplus-react
Merge pull request '修改任务列表按钮样式及新建组织按钮样式' (#498) from tongChong/forgeplus-react:pre_dev_military into pre_dev_military
This commit is contained in:
commit
2253b64c05
|
@ -59,7 +59,7 @@ function Team(props){
|
||||||
{
|
{
|
||||||
current_user && current_user.login === username &&
|
current_user && current_user.login === username &&
|
||||||
// <CheckProfile {...props} sureFunc={()=>{props.history.push('/organize/new')}}><i className="iconfont icon-xinjian1 mr3 font-14"></i>新建组织</CheckProfile>
|
// <CheckProfile {...props} sureFunc={()=>{props.history.push('/organize/new')}}><i className="iconfont icon-xinjian1 mr3 font-14"></i>新建组织</CheckProfile>
|
||||||
<Link className="ant-btn ant-btn-primary" to={`/organize/new`}><i className="iconfont icon-xinjian1 mr3 font-14"></i>新建组织</Link>
|
<Link to={`/organize/new`}><i className="iconfont icon-xinjian1 mr3 font-14"></i>新建组织</Link>
|
||||||
}
|
}
|
||||||
<Dropdown overlay={menu}>
|
<Dropdown overlay={menu}>
|
||||||
<a>排序<i className="iconfont icon-sanjiaoxing-down ml3 font-14"></i></a>
|
<a>排序<i className="iconfont icon-sanjiaoxing-down ml3 font-14"></i></a>
|
||||||
|
|
|
@ -724,3 +724,12 @@ export function checkVerificationCode(data) {
|
||||||
data: data,
|
data: data,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 更新置顶顺序
|
||||||
|
export function changePinnedTaskSort(data){
|
||||||
|
return fetch({
|
||||||
|
url: `/api/tasks/backend/admin/changePinnedTaskSort`,
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
});
|
||||||
|
}
|
|
@ -66,7 +66,7 @@ export default ({downloading,setDownloading}) => {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '赏金分配方式',
|
title: '赏金分配方式',
|
||||||
dataIndex: 'bounty',
|
dataIndex: 'task_mode_id',
|
||||||
width:130,
|
width:130,
|
||||||
render:(text) => (
|
render:(text) => (
|
||||||
text||'--'
|
text||'--'
|
||||||
|
@ -100,8 +100,8 @@ export default ({downloading,setDownloading}) => {
|
||||||
title: '身份证/信用代码',
|
title: '身份证/信用代码',
|
||||||
dataIndex: 'card',
|
dataIndex: 'card',
|
||||||
width:200,
|
width:200,
|
||||||
render:(text) => (
|
render:(text,record) => (
|
||||||
text||'--'
|
text||record.credit_code||'--'
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
import React, { useCallback, useEffect, useState, useMemo } from 'react';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { Input, Select, Button, Form, DatePicker, Modal, message, Popover } from 'antd';
|
import { Input, Select, Button, Form, DatePicker, Modal, message, Popover, InputNumber } from 'antd';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
|
||||||
import { paperCheckStatusArr, publishModeArr, taskStatusAllArr, showUserModeArr, main_web_site_url } from '../static';
|
import { paperCheckStatusArr, publishModeArr, taskStatusAllArr, showUserModeArr, main_web_site_url } from '../static';
|
||||||
import { getTaskAdminList, changeShowUserMode, deleteTask, recommendTask, addExpertReview, publishExpertsAndRules,delayTask ,resetTask} from '../api';
|
import { getTaskAdminList, changeShowUserMode, deleteTask, recommendTask, addExpertReview, publishExpertsAndRules, delayTask, resetTask, changePinnedTaskSort } from '../api';
|
||||||
import '../index.scss';
|
import '../index.scss';
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
import { getRules, selectExpertList } from 'src/military/expert/api';
|
import { getRules, selectExpertList } from 'src/military/expert/api';
|
||||||
|
@ -37,7 +37,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
const [recommend, setRecommend] = useState('');
|
const [recommend, setRecommend] = useState('');
|
||||||
|
|
||||||
const [sort, setSort] = useState('Desc');
|
const [sort, setSort] = useState('Desc');
|
||||||
const [order, setOrder] = useState('createdAt');
|
const [order, setOrder] = useState('default');
|
||||||
const [searchObj, setSearchObj] = useState({});
|
const [searchObj, setSearchObj] = useState({});
|
||||||
const [curPage, setCurPage] = useState(hashDate(hash) || 1);
|
const [curPage, setCurPage] = useState(hashDate(hash) || 1);
|
||||||
const [total, setTotal] = useState(0);
|
const [total, setTotal] = useState(0);
|
||||||
|
@ -58,6 +58,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
const [reviewTaskId, setReviewTaskId] = useState(undefined);
|
const [reviewTaskId, setReviewTaskId] = useState(undefined);
|
||||||
const [visible, setVisible] = useState(false); //延期任务modal
|
const [visible, setVisible] = useState(false); //延期任务modal
|
||||||
const [checkedItem, setCheckedItem] = useState('');
|
const [checkedItem, setCheckedItem] = useState('');
|
||||||
|
const [orderVisible, setOrderVisible] = useState(false);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCurPage(hashDate(hash) || 1);
|
setCurPage(hashDate(hash) || 1);
|
||||||
|
@ -71,7 +72,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
showUserMode: showUserMode.length > 1 ? '' : showUserMode,
|
showUserMode: showUserMode.length > 1 ? '' : showUserMode,
|
||||||
curPage,
|
curPage,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
orderBy: order + sort,
|
orderBy: order === 'default' ? '' : order + sort,
|
||||||
isDelete,
|
isDelete,
|
||||||
recommend,
|
recommend,
|
||||||
expertReview: expertReview === '-1' ? "" : expertReview,
|
expertReview: expertReview === '-1' ? "" : expertReview,
|
||||||
|
@ -124,7 +125,7 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
expertReviewStatus: '-1',
|
expertReviewStatus: '-1',
|
||||||
showStatus: '0',
|
showStatus: '0',
|
||||||
isRecommend: 'all',
|
isRecommend: 'all',
|
||||||
sortBy: 'createdAt'
|
sortBy: 'default'
|
||||||
});
|
});
|
||||||
setStatusString('0,1,2,3,4,5,6,7,8,9');
|
setStatusString('0,1,2,3,4,5,6,7,8,9');
|
||||||
setShowUserMode('0,1,2');
|
setShowUserMode('0,1,2');
|
||||||
|
@ -132,10 +133,11 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
setExpertReview('-1');
|
setExpertReview('-1');
|
||||||
setIsDelete('0');
|
setIsDelete('0');
|
||||||
setRecommend('');
|
setRecommend('');
|
||||||
setOrder("createdAt");
|
setOrder("default");
|
||||||
setSearchObj({});
|
setSearchObj({});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 延期任务
|
||||||
function delayClick(item, restart) {
|
function delayClick(item, restart) {
|
||||||
setCheckedItem(item);
|
setCheckedItem(item);
|
||||||
if (restart) {
|
if (restart) {
|
||||||
|
@ -145,12 +147,12 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 主列表
|
||||||
const columns = useMemo(() => {
|
const columns = useMemo(() => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
title: '任务编号',
|
title: '任务编号',
|
||||||
dataIndex: 'number',
|
dataIndex: 'number',
|
||||||
width: "26%"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '任务名称',
|
title: '任务名称',
|
||||||
|
@ -215,6 +217,11 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
</Select>
|
</Select>
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '排序',
|
||||||
|
key: 'orderNum',
|
||||||
|
dataIndex: 'orderNum'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
|
@ -226,24 +233,13 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
<React.Fragment>
|
<React.Fragment>
|
||||||
{[3, 4, 6, 7].includes(record.status) && <Button className="mr5 mb5 f89" onClick={() => { delayClick(record, true) }}>延期</Button>}
|
{[3, 4, 6, 7].includes(record.status) && <Button className="mr5 mb5 f89" onClick={() => { delayClick(record, true) }}>延期</Button>}
|
||||||
{record.status == 8 && record.exceptClosedBoolean && <Button className="mr5 mb5 f89" onClick={() => { delayClick(record) }}>重启</Button>}
|
{record.status == 8 && record.exceptClosedBoolean && <Button className="mr5 mb5 f89" onClick={() => { delayClick(record) }}>重启</Button>}
|
||||||
<Button className="mr5 mb5 f20" onClick={() => { deleteItem(record.id,isDelete == '0' ? '1':'0') }}>{isDelete == '0' ? '隐藏任务':'恢复任务'}</Button>
|
<Button className="mr5 mb5 f20" onClick={() => { deleteItem(record.id, isDelete == '0' ? '1' : '0') }}>{isDelete == '0' ? '隐藏' : '恢复'}</Button>
|
||||||
<Button className="mr5 mb5 f89" onClick={() => { recommendItem(record.id, record.recommend ? '0' : '1') }}>{record.recommend ? '撤销推荐' : '首页推荐'}</Button>
|
<Button className="mr5 mb5 f89" onClick={() => { recommendItem(record.id, record.recommend ? '0' : '1') }}>{record.recommend ? '撤销推荐' : '首页推荐'}</Button>
|
||||||
<Button className={`mr5 mb5 c2a3 ${text ? 'bor':'full'} ${disabled && 'disabled'}`} onClick={() => { changeExpertReviewStatus(text ? '-1':'1', record.id) }} disabled={disabled}>{text ? '取消专家评审':'加入专家评审'}</Button>
|
<Button className="mr5 mb5" type='primary' onClick={() => { setCheckedItem(record); setOrderVisible(true); }}>排序</Button>
|
||||||
{/* {
|
<Button className={`mr5 mb5 c2a3 ${text ? 'bor' : 'full'} ${disabled && 'disabled'}`} onClick={() => { changeExpertReviewStatus(text ? '-1' : '1', record.id) }} disabled={disabled}>{text ? '取消评审' : '加入评审'}</Button>
|
||||||
isDelete == '0' ? <Button className="mr5 font-12" type="danger" size="small" onClick={() => { deleteItem(record.id, '1') }}>隐藏任务</Button>
|
|
||||||
: <Button className="mr5 font-12" type="primary" size="small" onClick={() => { deleteItem(record.id, '0') }}>恢复任务</Button>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
!record.recommend && [3, 4, 5, 6, 7, 8].includes(record.status) && <Button className="mr5 font-12" type="primary" size="small" onClick={() => { recommendItem(record.id, '1') }}>首页推荐</Button>
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
record.recommend && <Button className="mr5 font-12" type="danger" size="small" onClick={() => { recommendItem(record.id, '0') }}>撤销推荐</Button>
|
|
||||||
} */}
|
|
||||||
{/* <Link className="line_1 color-grey3" to={`/task/taskDetail/${record.taskId}`}>查看</Link> */}
|
|
||||||
</React.Fragment>
|
</React.Fragment>
|
||||||
)},
|
)
|
||||||
|
},
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}, [isDelete, curPage]);
|
}, [isDelete, curPage]);
|
||||||
|
@ -300,6 +296,11 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
];
|
];
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
|
// 打开排序弹框后执行赋值语句
|
||||||
|
useEffect(()=>{
|
||||||
|
orderVisible&&setFieldsValue({ orderNum: checkedItem.orderNum })
|
||||||
|
},[orderVisible])
|
||||||
|
|
||||||
// function resetTaskModal
|
// function resetTaskModal
|
||||||
|
|
||||||
function recommendItem(id, recommend) {
|
function recommendItem(id, recommend) {
|
||||||
|
@ -521,10 +522,6 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
||||||
function downloadFile() {
|
|
||||||
window.open(main_web_site_url + '/admin/tasks.xlsx');
|
|
||||||
}
|
|
||||||
|
|
||||||
function disabledDate(current) {
|
function disabledDate(current) {
|
||||||
return current && current < moment(checkedItem.eachPhaseEndTime).endOf('day');
|
return current && current < moment(checkedItem.eachPhaseEndTime).endOf('day');
|
||||||
}
|
}
|
||||||
|
@ -569,6 +566,26 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeOrderNum() {
|
||||||
|
validateFields(["orderNum"], (err, values) => {
|
||||||
|
if (!err) {
|
||||||
|
changePinnedTaskSort([{
|
||||||
|
id: checkedItem.id,
|
||||||
|
orderNum: values.orderNum
|
||||||
|
}]
|
||||||
|
).then(res => {
|
||||||
|
if (res && res.data) {
|
||||||
|
showNotification('操作成功');
|
||||||
|
setOrderVisible(false);
|
||||||
|
setReload(Math.random())
|
||||||
|
} else {
|
||||||
|
showNotification(res && res.message || '操作失败')
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="task-manage-all ">
|
<div className="task-manage-all ">
|
||||||
<div className='management-content-head'>
|
<div className='management-content-head'>
|
||||||
|
@ -687,7 +704,6 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
</Select>,
|
</Select>,
|
||||||
'-1'
|
'-1'
|
||||||
)}
|
)}
|
||||||
{/* <div className='center-right-but search'> */}
|
|
||||||
{helper(
|
{helper(
|
||||||
"显示状态",
|
"显示状态",
|
||||||
"showStatus",
|
"showStatus",
|
||||||
|
@ -726,13 +742,13 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
showArrow
|
showArrow
|
||||||
onChange={changeSortName}
|
onChange={changeSortName}
|
||||||
>
|
>
|
||||||
|
<Option key={'default'} >默认</Option>
|
||||||
<Option key={'createdAt'} >创建时间</Option>
|
<Option key={'createdAt'} >创建时间</Option>
|
||||||
<Option key={'publishedAt'} >发布时间</Option>
|
<Option key={'publishedAt'} >发布时间</Option>
|
||||||
</Select>,
|
</Select>,
|
||||||
'createdAt'
|
'default'
|
||||||
)}
|
)}
|
||||||
<div className="button-div">
|
<div className="button-div">
|
||||||
{/* <a href="/admin/tasks.xlsx" class="fr edu-default-btn edu-blueback-btn plr30">导出</a> downloadFile*/}
|
|
||||||
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
<Button className="mr10" type="primary" onClick={onSearch}>搜索</Button>
|
||||||
<Button className="mr10" onClick={clearSearch}>清除</Button>
|
<Button className="mr10" onClick={clearSearch}>清除</Button>
|
||||||
<Button loading={downloading} className="mr10" type="primary" onClick={() => { setDownloading(true) }}>导出</Button>
|
<Button loading={downloading} className="mr10" type="primary" onClick={() => { setDownloading(true) }}>导出</Button>
|
||||||
|
@ -743,7 +759,6 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
<span className={classNames({ "sort-active": sort === 'Asc', 'sort-icon': true, 'mt5': true })} onClick={() => { changeSort('Asc') }}>
|
<span className={classNames({ "sort-active": sort === 'Asc', 'sort-icon': true, 'mt5': true })} onClick={() => { changeSort('Asc') }}>
|
||||||
<i className="fa fa-long-arrow-up font-16 "></i>
|
<i className="fa fa-long-arrow-up font-16 "></i>
|
||||||
</span>
|
</span>
|
||||||
{/* </div> */}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="center-content taskListCont">
|
<div className="center-content taskListCont">
|
||||||
|
@ -805,6 +820,24 @@ export default Form.create()(({ form, showNotification, match, history, state })
|
||||||
)}
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|
||||||
|
<Modal
|
||||||
|
title="请输入排序值,请输入正整数"
|
||||||
|
visible={orderVisible}
|
||||||
|
onOk={changeOrderNum}
|
||||||
|
onCancel={() => { setOrderVisible(false) }}
|
||||||
|
className="time-edit-modal"
|
||||||
|
destroyOnClose
|
||||||
|
>
|
||||||
|
{helper(
|
||||||
|
"",
|
||||||
|
"orderNum",
|
||||||
|
[{ required: true, message: "请输入正整数" }],
|
||||||
|
<InputNumber min={0} max={2100000000} precision={0} />
|
||||||
|
)}
|
||||||
|
|
||||||
|
</Modal>
|
||||||
|
|
||||||
|
{/* 导出创客任务的组件 */}
|
||||||
<ExportTable downloading={downloading} setDownloading={setDownloading} />
|
<ExportTable downloading={downloading} setDownloading={setDownloading} />
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,6 +2,7 @@ import React, { useEffect, useState } from "react";
|
||||||
import { Form, Input, Button, Checkbox } from "antd";
|
import { Form, Input, Button, Checkbox } from "antd";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
import { Base64 } from 'js-base64';
|
||||||
// import educoderLogo from '../login/educoder.png';
|
// import educoderLogo from '../login/educoder.png';
|
||||||
import openKylin from '../login/openKylin.svg';
|
import openKylin from '../login/openKylin.svg';
|
||||||
import gitLink from '../login/gitLink.png';
|
import gitLink from '../login/gitLink.png';
|
||||||
|
@ -32,7 +33,7 @@ function Login(props) {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
axios.post(`/accounts/login.json`, {
|
axios.post(`/accounts/login.json`, {
|
||||||
login: values.username,
|
login: values.username,
|
||||||
password: values.password,
|
password: Base64.encode(values.password),
|
||||||
autologin: values.remember ? 1 : 0,
|
autologin: values.remember ? 1 : 0,
|
||||||
}).then((response) => {
|
}).then((response) => {
|
||||||
if (!response.data.login) {
|
if (!response.data.login) {
|
||||||
|
|
|
@ -149,11 +149,17 @@
|
||||||
color: #808080;
|
color: #808080;
|
||||||
font-size: 0.9em;
|
font-size: 0.9em;
|
||||||
}
|
}
|
||||||
.message, .ant-form-explain{
|
.ant-form-explain{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: -1.45em;
|
bottom: -1.45em;
|
||||||
color: #D40000;
|
color: #D40000;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
}
|
||||||
|
.message{
|
||||||
|
position: absolute;
|
||||||
|
// bottom: -1.45em;
|
||||||
|
color: #D40000;
|
||||||
|
font-size: 13px;
|
||||||
}
|
}
|
||||||
.message.active{
|
.message.active{
|
||||||
margin-bottom: -30px !important;
|
margin-bottom: -30px !important;
|
||||||
|
|
Loading…
Reference in New Issue