浏览代码

对话课文编辑单条对话不上屏问题

natasha 1 周之前
父节点
当前提交
d8abb7e5d9
共有 1 个文件被更改,包括 9 次插入6 次删除
  1. 9 6
      src/views/book/courseware/create/components/question/dialogue_article/Article.vue

+ 9 - 6
src/views/book/courseware/create/components/question/dialogue_article/Article.vue

@@ -830,15 +830,18 @@ export default {
         return;
       }
       let textList = this.textInput.trim().split('\n');
-      for (let i = 0; i < textList.length; i++) {
-        if (textList[i].trim()) {
-          if (textList[i].indexOf(':') === -1) {
-            // 如果不包含描述、语境或者角色名
-            this.$message.error('缺少角色或语境,请补全');
-            return false;
+      if (textList.length > 1) {
+        for (let i = 0; i < textList.length; i++) {
+          if (textList[i].trim()) {
+            if (textList[i].indexOf(':') === -1) {
+              // 如果不包含描述、语境或者角色名
+              this.$message.error('缺少角色或语境,请补全');
+              return false;
+            }
           }
         }
       }
+
       textList.forEach((item) => {
         if (item.trim()) {
           let obj = {