Commit 10ada5b6 by nineyat

fix:选项输入纯空格提示

parent 646085c9
......@@ -224,14 +224,13 @@ class QuestionCategoryManage extends Component {
let dragNodes = [];
if (dragNode.sonCategoryList && dragNode.sonCategoryList.length > 0) {
dragNode.sonCategoryList.forEach((item) => {
dragNodes.push(item.id);
dragNodes.push(item.categoryLevel);
if (item.sonCategoryList && item.sonCategoryList.length > 0) {
dragNodes = dragNodes.concat(this.getDragNodesLevel(item));
}
});
}
return dragNodes;
return [...new Set(dragNodes)];
};
onDrop = (info) => {
......
......@@ -219,10 +219,14 @@ class NewQuestionTab extends Component {
optionUnChecked = item.isCorrectAnswer
? optionUnChecked
: optionUnChecked + 1;
let optionInput = optionContent[0].content.replace(/<[^>]+>/g, "");
optionInput = optionInput.replace(/\&nbsp\;/gi, "");
optionInput = optionInput.replace(/\s+/g, "");
if (
optionContent.length === 1 &&
optionContent[0].type === "RICH_TEXT" &&
optionContent[0].textLength === 0
optionInput.length === 0
) {
this.setState({ [`optionsValidate_${index}`]: "error" });
this.setState({ [`optionsText_${index}`]: "请输入选项" });
......@@ -670,6 +674,7 @@ class NewQuestionTab extends Component {
list.map((tag, index) => {
return (
<Tag
key={index}
className="edit-tag"
visible
closable
......@@ -1262,6 +1267,7 @@ class NewQuestionTab extends Component {
_.map(blanksList, (item, index) => {
return (
<Form.Item
name="answer"
validateStatus={this.state[`optionsValidate_${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