dev_forum
杨树林 6 years ago
parent 4d4cf9183b
commit fc01504e1d

@ -67,7 +67,7 @@
<!-- <link rel="stylesheet" type="text/css" href="https://www.educoder.net/stylesheets/css/font-awesome.css?1510652321"> --> <!-- <link rel="stylesheet" type="text/css" href="https://www.educoder.net/stylesheets/css/font-awesome.css?1510652321"> -->
<link rel="stylesheet" type="text/css" href="/stylesheets/educoder/iconfont/iconfont.css"> <link rel="stylesheet" type="text/css" href="http://47.96.87.25:48080/stylesheets/educoder/iconfont/iconfont.css">
<link rel="stylesheet" type="text/css" href="/css/iconfont.css"> <link rel="stylesheet" type="text/css" href="/css/iconfont.css">
<style> <style>
/*<!--去除浏览器点击操作后有蓝色的底块-->*/ /*<!--去除浏览器点击操作后有蓝色的底块-->*/

@ -2061,8 +2061,8 @@ class PollNew extends Component {
// console.log(this.state.adddom); // console.log(this.state.adddom);
} }
//提交题目//没有就创建新的题库,新建问题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知 //提交题目//没有就创建新的题库,新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知
submitQuestionnaire = () => { submitQuestionnaire = (mews) => {
console.log("调用了submitQuestionnaire") console.log("调用了submitQuestionnaire")
if (this.state.Newedit === true) { if (this.state.Newedit === true) {
@ -2084,6 +2084,12 @@ class PollNew extends Component {
pollid = this.state.pollid; pollid = this.state.pollid;
} }
if(mews ==="new"){
if(this.state.poll_questions&&this.state.poll_questions.length===0){
this.props.showNotification("至少创建1个题目");
return;
}
}
var url = `/polls/${pollid}.json`; var url = `/polls/${pollid}.json`;
axios.put(url, { axios.put(url, {
@ -2804,9 +2810,9 @@ class PollNew extends Component {
}} }}
> >
<li className="clearfix mt30 mb50"> <li className="clearfix mt30 mb50">
<a type="primary" className="defalutSubmitbtn fl mr20" <a className="defalutCancelbtn fl mr20" onClick={() => this.props.history.goBack()}>取消</a>
onClick={() => this.submitQuestionnaire()}>提交</a> <a type="primary" className="defalutSubmitbtn fl"
<a className="defalutCancelbtn fl" onClick={() => this.props.history.goBack()}>取消</ a> onClick={() => this.submitQuestionnaire(this.props.match.params.news)}>提交</a>
</li> </li>
@ -2823,9 +2829,9 @@ class PollNew extends Component {
}} }}
> >
<li className="clearfix mt30 mb50"> <li className="clearfix mt30 mb50">
<a className="defalutSubmitbtn fl mr20"onClick={() => this.props.history.goBack()}>取消</a> <a className="defalutCancelbtn fl mr20"onClick={() => this.props.history.goBack()}>取消</a>
<a type="primary" className="defalutCancelbtn fl" <a type="primary" className=" defalutSubmitbtn fl"
onClick={() => this.submitQuestionnaire()}>提交</a> onClick={() => this.submitQuestionnaire(this.props.match.params.news)}>提交</a>
</li> </li>
</div> </div>
} }

Loading…
Cancel
Save