Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

issues25489
杨树明 5 years ago
commit 97a15a40bb

@ -43,7 +43,7 @@ class CompetitionCommon extends Component{
// }) // })
// } // }
// }).catch((error) => { // }).catch((error) => {
// console.log(error) // //console.log(error)
// }) // })
} }
} }
@ -51,8 +51,8 @@ class CompetitionCommon extends Component{
componentDidUpdate = (prevProps) => { componentDidUpdate = (prevProps) => {
if (prevProps.user != this.props.user) { if (prevProps.user != this.props.user) {
console.log("componentDidUpdatess"); //console.log("componentDidUpdatess");
console.log(this.props.user); //console.log(this.props.user);
if (this.props.user && this.props.user.login != "") { if (this.props.user && this.props.user.login != "") {
const zul = `/competitions/${this.props.match.params.identifier}/competition_staff.json`; const zul = `/competitions/${this.props.match.params.identifier}/competition_staff.json`;
axios.get((zul)).then((result) => { axios.get((zul)).then((result) => {
@ -64,7 +64,7 @@ class CompetitionCommon extends Component{
} }
} }
}).catch((error) => { }).catch((error) => {
//console.log(error); ////console.log(error);
}) })
} }
} }
@ -103,7 +103,7 @@ class CompetitionCommon extends Component{
} }
} }
}).catch((error) => { }).catch((error) => {
console.log(error) //console.log(error)
}) })
//this.props.user 有可能为空 //this.props.user 有可能为空
@ -119,7 +119,7 @@ class CompetitionCommon extends Component{
} }
} }
}).catch((error) => { }).catch((error) => {
//console.log(error); ////console.log(error);
}) })
} }
@ -161,7 +161,7 @@ class CompetitionCommon extends Component{
} }
}).catch((error) => { }).catch((error) => {
console.log(error) //console.log(error)
}) })
} }
} }
@ -192,7 +192,7 @@ class CompetitionCommon extends Component{
} }
}).catch((error) => { }).catch((error) => {
console.log(error) //console.log(error)
}) })
}else{ }else{
if (module_url.substring(0, 7) == 'http://' || module_url.substring(0, 8) == 'https://') { if (module_url.substring(0, 7) == 'http://' || module_url.substring(0, 8) == 'https://') {
@ -309,7 +309,7 @@ class CompetitionCommon extends Component{
}) })
} }
}).catch((error) => { }).catch((error) => {
console.log(error) //console.log(error)
}) })
} }

@ -294,14 +294,15 @@ class SingleEditor extends Component{
<div className="mb20"> <div className="mb20">
{/* {!exerciseIsPublish && <ActionBtn style="grey" className="middle mr20" onClick={this.addOption}>新增选项</ActionBtn>} */} {/* {!exerciseIsPublish && <ActionBtn style="grey" className="middle mr20" onClick={this.addOption}>新增选项</ActionBtn>} */}
<span style={{color: '#FF6800'}}>{!exerciseIsPublish ? '温馨提示:点击选项标题,可以直接设置答案;选择多个答案即为多选题' : ' '}</span> <span
style={{color: '#FF6800'}}>{!exerciseIsPublish ? '温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题' : ' '}</span>
{ answerTagArray && !!answerTagArray.length ? { answerTagArray && !!answerTagArray.length ?
<React.Fragment> <React.Fragment>
<span className="fr color-orange">{answerTagArray.join(' ')}</span> <span className="fr color-orange">{answerTagArray.join(' ')}</span>
<span className="fr">标准答案</span> <span className="fr">标准答案</span>
</React.Fragment> </React.Fragment>
: :
<span className="fr color-orange">请点击正确选项</span> <span className="fl color-orange">温馨提示点击选项输入框可设置答案选中的选项即为正确答案选择多个答案即为多选题</span>
} }
</div> </div>

@ -226,6 +226,7 @@ class TPIMonaco extends Component {
// https://github.com/Microsoft/monaco-editor/issues/539 // https://github.com/Microsoft/monaco-editor/issues/539
window.monaco.editor.setModelLanguage(editor_monaco.getModel(), lang) window.monaco.editor.setModelLanguage(editor_monaco.getModel(), lang)
} else if (prevProps.isEditablePath != this.props.isEditablePath) { } else if (prevProps.isEditablePath != this.props.isEditablePath) {
// 当前文件是否可编辑
if (this.props.isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission == true) { if (this.props.isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission == true) {
editor_monaco.updateOptions({readOnly: false}) editor_monaco.updateOptions({readOnly: false})
} else { } else {
@ -250,6 +251,7 @@ class TPIMonaco extends Component {
} }
} }
componentWillUnmount() { componentWillUnmount() {
// 注意销毁不然会出现不能编辑的bug
this.editor_monaco && this.editor_monaco.dispose() this.editor_monaco && this.editor_monaco.dispose()
} }

Loading…
Cancel
Save