Commit 10ada5b6 by nineyat

fix:选项输入纯空格提示

parent 646085c9
...@@ -224,14 +224,13 @@ class QuestionCategoryManage extends Component { ...@@ -224,14 +224,13 @@ class QuestionCategoryManage extends Component {
let dragNodes = []; let dragNodes = [];
if (dragNode.sonCategoryList && dragNode.sonCategoryList.length > 0) { if (dragNode.sonCategoryList && dragNode.sonCategoryList.length > 0) {
dragNode.sonCategoryList.forEach((item) => { dragNode.sonCategoryList.forEach((item) => {
dragNodes.push(item.id); dragNodes.push(item.categoryLevel);
if (item.sonCategoryList && item.sonCategoryList.length > 0) { if (item.sonCategoryList && item.sonCategoryList.length > 0) {
dragNodes = dragNodes.concat(this.getDragNodesLevel(item)); dragNodes = dragNodes.concat(this.getDragNodesLevel(item));
} }
}); });
} }
return [...new Set(dragNodes)];
return dragNodes;
}; };
onDrop = (info) => { onDrop = (info) => {
......
...@@ -219,10 +219,14 @@ class NewQuestionTab extends Component { ...@@ -219,10 +219,14 @@ class NewQuestionTab extends Component {
optionUnChecked = item.isCorrectAnswer optionUnChecked = item.isCorrectAnswer
? optionUnChecked ? optionUnChecked
: optionUnChecked + 1; : optionUnChecked + 1;
let optionInput = optionContent[0].content.replace(/<[^>]+>/g, "");
optionInput = optionInput.replace(/\&nbsp\;/gi, "");
optionInput = optionInput.replace(/\s+/g, "");
if ( if (
optionContent.length === 1 && optionContent.length === 1 &&
optionContent[0].type === "RICH_TEXT" && optionContent[0].type === "RICH_TEXT" &&
optionContent[0].textLength === 0 optionInput.length === 0
) { ) {
this.setState({ [`optionsValidate_${index}`]: "error" }); this.setState({ [`optionsValidate_${index}`]: "error" });
this.setState({ [`optionsText_${index}`]: "请输入选项" }); this.setState({ [`optionsText_${index}`]: "请输入选项" });
...@@ -670,6 +674,7 @@ class NewQuestionTab extends Component { ...@@ -670,6 +674,7 @@ class NewQuestionTab extends Component {
list.map((tag, index) => { list.map((tag, index) => {
return ( return (
<Tag <Tag
key={index}
className="edit-tag" className="edit-tag"
visible visible
closable closable
...@@ -1262,6 +1267,7 @@ class NewQuestionTab extends Component { ...@@ -1262,6 +1267,7 @@ class NewQuestionTab extends Component {
_.map(blanksList, (item, index) => { _.map(blanksList, (item, index) => {
return ( return (
<Form.Item <Form.Item
name="answer"
validateStatus={this.state[`optionsValidate_${index}`]} validateStatus={this.state[`optionsValidate_${index}`]}
help={this.state[`optionsText_${index}`]} help={this.state[`optionsText_${index}`]}
> >
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment