|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
/*
|
|
|
|
|
* @Description: 新建或编辑任务
|
|
|
|
|
* @Author: tangjiang
|
|
|
|
|
* @Date: 2019-11-15 16:38:34
|
|
|
|
|
* @Author: tangjiang
|
|
|
|
|
* @Date: 2019-11-15 16:38:34
|
|
|
|
|
* @Last Modified by: tangjiang
|
|
|
|
|
* @Last Modified time: 2019-11-19 23:23:41
|
|
|
|
|
*/
|
|
|
|
@ -121,7 +121,7 @@ const NewOrEditTask = (props) => {
|
|
|
|
|
// 清空描述信息
|
|
|
|
|
toStore('oj_description', '');
|
|
|
|
|
// props.history.push('/problems');
|
|
|
|
|
props.history.push(`/question?${props.searchParams}`);
|
|
|
|
|
props.history.push(`/problemset?${props.searchParams}`);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 发布
|
|
|
|
@ -174,33 +174,33 @@ const NewOrEditTask = (props) => {
|
|
|
|
|
// 发布/模拟挑战
|
|
|
|
|
const renderPubOrFight = () => {
|
|
|
|
|
const pubButton = isPublish
|
|
|
|
|
? (<Button
|
|
|
|
|
style={{ background: 'rgba(102,102,102,1)', border: 'none' }}
|
|
|
|
|
type="primary"
|
|
|
|
|
loading={publishLoading}
|
|
|
|
|
onClick={handleClickCancelPublish}
|
|
|
|
|
>撤销发布</Button>)
|
|
|
|
|
: (<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
loading={publishLoading}
|
|
|
|
|
onClick={handleClickPublish}
|
|
|
|
|
>立即发布</Button>);
|
|
|
|
|
? (<Button
|
|
|
|
|
style={{ background: 'rgba(102,102,102,1)', border: 'none' }}
|
|
|
|
|
type="primary"
|
|
|
|
|
loading={publishLoading}
|
|
|
|
|
onClick={handleClickCancelPublish}
|
|
|
|
|
>撤销发布</Button>)
|
|
|
|
|
: (<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
loading={publishLoading}
|
|
|
|
|
onClick={handleClickPublish}
|
|
|
|
|
>立即发布</Button>);
|
|
|
|
|
// 未发布: 模拟挑战 已发布: 开始挑战
|
|
|
|
|
const challengeBtn = isPublish ? (
|
|
|
|
|
<Button type="primary" onClick={startChallenge}>开始挑战</Button>
|
|
|
|
|
) : (
|
|
|
|
|
<Button type="primary" onClick={imitationChallenge}>模拟挑战</Button>
|
|
|
|
|
);
|
|
|
|
|
<Button type="primary" onClick={imitationChallenge}>模拟挑战</Button>
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
if (isPublish) {
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
{pubButton}
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
loading={submitLoading}
|
|
|
|
|
onClick={handleSubmitForm}
|
|
|
|
|
>保存</Button>
|
|
|
|
|
type="primary"
|
|
|
|
|
loading={submitLoading}
|
|
|
|
|
onClick={handleSubmitForm}
|
|
|
|
|
>保存</Button>
|
|
|
|
|
{challengeBtn}
|
|
|
|
|
</React.Fragment>
|
|
|
|
|
);
|
|
|
|
@ -208,10 +208,10 @@ const NewOrEditTask = (props) => {
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<Button
|
|
|
|
|
type="primary"
|
|
|
|
|
loading={submitLoading}
|
|
|
|
|
onClick={handleSubmitForm}
|
|
|
|
|
>保存</Button>
|
|
|
|
|
type="primary"
|
|
|
|
|
loading={submitLoading}
|
|
|
|
|
onClick={handleSubmitForm}
|
|
|
|
|
>保存</Button>
|
|
|
|
|
{pubButton}
|
|
|
|
|
{challengeBtn}
|
|
|
|
|
</React.Fragment>
|
|
|
|
@ -296,7 +296,7 @@ const mapDispatchToProps = (dispatch) => ({
|
|
|
|
|
clearOJFormStore: () => dispatch(actions.clearOJFormStore()),
|
|
|
|
|
// 按钮状态
|
|
|
|
|
changeSubmitLoadingStatus: (flag) => dispatch(actions.changeSubmitLoadingStatus(flag)),
|
|
|
|
|
// 发布按钮状态
|
|
|
|
|
// 发布按钮状态
|
|
|
|
|
changePublishLoadingStatus: (flag) => dispatch(actions.changePublishLoadingStatus(flag)),
|
|
|
|
|
// 测试用例及验证
|
|
|
|
|
updateTestAndValidate: (obj) => dispatch(actions.updateTestAndValidate(obj)),
|
|
|
|
|