|
|
|
@ -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>
|
|
|
|
|