|
|
|
@ -779,13 +779,13 @@ class PollNew extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (maxtie < 2) {
|
|
|
|
|
if (maxtie < 3) {
|
|
|
|
|
if (object.question.question_type === 1) {
|
|
|
|
|
this.props.showNotification(`选项不能少于2个!`);
|
|
|
|
|
this.props.showNotification(`选项不能少于3个!`);
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
} else if (object.question.question_type === 2) {
|
|
|
|
|
this.props.showNotification(`选项不能少于2个!`);
|
|
|
|
|
this.props.showNotification(`选项不能少于3个!`);
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -1259,12 +1259,12 @@ class PollNew extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (maxtie < 2) {
|
|
|
|
|
if (maxtie < 3) {
|
|
|
|
|
if (object.question.question_type === 1) {
|
|
|
|
|
this.props.showNotification('选项不能少于2个!');
|
|
|
|
|
this.props.showNotification('选项不能少于3个!');
|
|
|
|
|
return
|
|
|
|
|
} else if (object.question.question_type === 2) {
|
|
|
|
|
this.props.showNotification('选项不能少于2个!');
|
|
|
|
|
this.props.showNotification('选项不能少于3个!');
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2061,8 +2061,8 @@ class PollNew extends Component {
|
|
|
|
|
// console.log(this.state.adddom);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//提交题目//没有就创建新的题库,新建问题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知
|
|
|
|
|
submitQuestionnaire = () => {
|
|
|
|
|
//提交题目//没有就创建新的题库,新建问newz题和保存题目不一样不能同时保存 这里只是新建 和编辑 标题和须知
|
|
|
|
|
submitQuestionnaire = (mews) => {
|
|
|
|
|
console.log("调用了submitQuestionnaire")
|
|
|
|
|
if (this.state.Newedit === true) {
|
|
|
|
|
|
|
|
|
@ -2084,6 +2084,12 @@ class PollNew extends Component {
|
|
|
|
|
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`;
|
|
|
|
|
axios.put(url, {
|
|
|
|
@ -2483,7 +2489,7 @@ class PollNew extends Component {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</p>
|
|
|
|
|
<p className="mt20"> <span className="font-16 flex1" style={item.question.question_type === 1?{"white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}:item.question.question_type === 2? {"white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1120px"}: {"white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word"}}>{item.question.question_title}</span></p>
|
|
|
|
|
<p className="mt20"> <span className="font-16 flex1" style={{"white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word"}}>{item.question.question_title}</span></p>
|
|
|
|
|
{/*<pre className="mt20 mb20 font-16 break_word flex1">{item.question.question_title}</pre>*/}
|
|
|
|
|
{item.question.question_type === 1 ?
|
|
|
|
|
(<RadioGroup defaultChecked={false} disabled>
|
|
|
|
@ -2494,7 +2500,7 @@ class PollNew extends Component {
|
|
|
|
|
{/*<pre className={"break_word flex1 fl"}*/}
|
|
|
|
|
{/* style={{"text-align": "left"}}>{items.answer_text}</pre>*/}
|
|
|
|
|
{/*<span className={"break_word flex1"}><pre className={"break_word flex1"}>{items.answer_text}</pre> </span>*/}
|
|
|
|
|
<span className={" flex1 "} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word"}} >{items.answer_text}</span>
|
|
|
|
|
<span className={" flex1 "} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1116px"}} >{items.answer_text}</span>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
@ -2506,7 +2512,7 @@ class PollNew extends Component {
|
|
|
|
|
return (
|
|
|
|
|
<div className="mt10 mt20 mb20 " style={{"clear": "both"}}>
|
|
|
|
|
<Checkbox value={i} className={"fl"} style={{"text-align": "left"}}></Checkbox>
|
|
|
|
|
<span className={" flex1"} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word"}}>{items.answer_text}</span>
|
|
|
|
|
<span className={" flex1"} style={{"text-align": "left","white-space":"pre-wrap","word-break": "break-all","word-wrap": "break-word","float": "left","width":"1120px"}}>{items.answer_text}</span>
|
|
|
|
|
|
|
|
|
|
{/*<span*/}
|
|
|
|
|
{/* className={"break_word flex1 fl"} style={{"text-align": "left"}}><pre*/}
|
|
|
|
@ -2804,9 +2810,9 @@ class PollNew extends Component {
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<li className="clearfix mt30 mb50">
|
|
|
|
|
<a type="primary" className="defalutSubmitbtn fl mr20"
|
|
|
|
|
onClick={() => this.submitQuestionnaire()}>提交</a>
|
|
|
|
|
<a className="defalutCancelbtn fl" onClick={() => this.props.history.goBack()}>取消</ a>
|
|
|
|
|
<a className="defalutCancelbtn fl mr20" onClick={() => this.props.history.goBack()}>取消</a>
|
|
|
|
|
<a type="primary" className="defalutSubmitbtn fl"
|
|
|
|
|
onClick={() => this.submitQuestionnaire(this.props.match.params.news)}>提交</a>
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2823,9 +2829,9 @@ class PollNew extends Component {
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<li className="clearfix mt30 mb50">
|
|
|
|
|
<a className="defalutSubmitbtn fl mr20"onClick={() => this.props.history.goBack()}>取消</a>
|
|
|
|
|
<a type="primary" className="defalutCancelbtn fl"
|
|
|
|
|
onClick={() => this.submitQuestionnaire()}>提交</a>
|
|
|
|
|
<a className="defalutCancelbtn fl mr20"onClick={() => this.props.history.goBack()}>取消</a>
|
|
|
|
|
<a type="primary" className=" defalutSubmitbtn fl"
|
|
|
|
|
onClick={() => this.submitQuestionnaire(this.props.match.params.news)}>提交</a>
|
|
|
|
|
</li>
|
|
|
|
|
</div>
|
|
|
|
|
}
|
|
|
|
|