Bläddra i källkod

Merge branch 'master' into NPC-lhd

natasha 3 år sedan
förälder
incheckning
62eae5a07f
2 ändrade filer med 44 tillägg och 39 borttagningar
  1. 1 1
      src/components/Adult/inputModules/Tinydemo.vue
  2. 43 38
      src/views/adultInput.vue

+ 1 - 1
src/components/Adult/inputModules/Tinydemo.vue

@@ -1,6 +1,6 @@
 <!--  -->
 <template>
-  <div class="Big-Book-Record">
+  <div class="Big-Book-Record" v-if="curQue">
     <!-- <img
       src="../../../assets/adult/maikefeng-red.png"
       class="Big-Book-Record-icon"

+ 43 - 38
src/views/adultInput.vue

@@ -38,13 +38,13 @@
           <SentenceSegwordChs :curQue="fc" />
           <img
             style="position: absolute; right: 699px; top: 2px"
-            @click="deleteDetail(index, fcIndex)"
+            @click="deleteDetail(fcIndex)"
             class="close"
             src="../assets/adult/del-close.png"
             alt=""
           />
         </div>
-        <div class="addoption" @click="addDetail(index)">添加分句</div>
+        <div class="addoption" @click="addDetail">添加分句</div>
         <div
           v-for="(kt, ktIndex) in question_list.classTopic"
           :key="'kt' + ktIndex"
@@ -60,7 +60,7 @@
               @blur="onBlur(kt, 'con')"
             />
             <img
-              @click="deleteClassTopic(index, ktIndex)"
+              @click="deleteClassTopic(ktIndex)"
               class="close"
               src="../assets/adult/del-close.png"
               alt=""
@@ -75,7 +75,7 @@
             </el-radio-group>
           </div>
         </div>
-        <div class="addoption" @click="addClassTopic(index)">添加课题</div>
+        <div class="addoption" @click="addClassTopic">添加课题</div>
         <div class="createTable">
           <el-input
             v-model="row"
@@ -99,7 +99,7 @@
         </div>
         <div
           v-for="(topic, toindex) in question_list.cur_fn_data"
-          :key="'topic' + toindex + index"
+          :key="'topic' + toindex"
         >
           <p>第{{ toindex + 1 }}题</p>
           <div class="adult-book-input-item">
@@ -144,7 +144,7 @@
           </div>
           <div
             v-for="(rowItem, rowIndex) in topic.table_list"
-            :key="'row' + rowIndex + index"
+            :key="'row' + rowIndex"
           >
             <div v-for="(topicIitem, lineIndex) in rowItem" :key="lineIndex">
               <p>{{ topicIitem.text }}</p>
@@ -810,6 +810,7 @@ export default {
       fatherName: "",
       module_type: "",
       tmInde: "",
+      FatherTreeData: null,
     };
   },
   computed: {
@@ -856,7 +857,7 @@ export default {
       this.FatherTreeData = JSON.parse(JSON.stringify(val));
     },
     // 增加当前页的分词
-    addDetail(index) {
+    addDetail() {
       let obj = {
         type: "detail",
         pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
@@ -868,7 +869,7 @@ export default {
       this.question_list.detailList.push(obj);
     },
     // 删除当前页的分词
-    deleteDetail(index, fcindex) {
+    deleteDetail(fcindex) {
       if (this.question_list.detailList.length <= 1) {
         this.$message.warning("至少要保留一一个");
         return;
@@ -876,7 +877,7 @@ export default {
       this.question_list.detailList.splice(fcindex, 1);
     },
     // 增加课题
-    addClassTopic(index) {
+    addClassTopic() {
       let obj = {
         con: "",
         font: "",
@@ -884,7 +885,7 @@ export default {
       this.question_list.classTopic.push(obj);
     },
     // 删除课题
-    deleteClassTopic(index, ktindex) {
+    deleteClassTopic(ktindex) {
       if (this.question_list.classTopic.length <= 1) {
         this.$message.warning("至少要保留一一个");
         return;
@@ -1070,21 +1071,24 @@ export default {
         return;
       }
       if (
-        this.question_list.cur_fn_data[this.TopicIndex]
-          .table_list[this.RowIndex][this.LineIndex].data
+        this.question_list.cur_fn_data[this.TopicIndex].table_list[
+          this.RowIndex
+        ][this.LineIndex].data
       ) {
         this.$message.warning("每列只能添加一个模板");
       } else {
         console.log("不存在");
         this.$set(
-          this.question_list.cur_fn_data[this.TopicIndex]
-            .table_list[this.RowIndex][this.LineIndex],
+          this.question_list.cur_fn_data[this.TopicIndex].table_list[
+            this.RowIndex
+          ][this.LineIndex],
           "type",
           item.type
         );
         this.$set(
-          this.question_list.cur_fn_data[this.TopicIndex]
-            .table_list[this.RowIndex][this.LineIndex],
+          this.question_list.cur_fn_data[this.TopicIndex].table_list[
+            this.RowIndex
+          ][this.LineIndex],
           "data",
           null
         );
@@ -1094,8 +1098,9 @@ export default {
     changeCurQue(data_stru) {
       console.log(this.RowIndex, this.LineIndex);
       this.$set(
-        this.question_list.cur_fn_data[this.TopicIndex]
-          .table_list[this.RowIndex][this.LineIndex],
+        this.question_list.cur_fn_data[this.TopicIndex].table_list[
+          this.RowIndex
+        ][this.LineIndex],
         "data",
         JSON.parse(JSON.stringify(data_stru))
       );
@@ -1114,20 +1119,23 @@ export default {
       }
 
       if (
-        this.question_list.cur_fn_data[this.TopicIndex]
-          .table_list[this.RowIndex][this.LineIndex].data
+        this.question_list.cur_fn_data[this.TopicIndex].table_list[
+          this.RowIndex
+        ][this.LineIndex].data
       ) {
         this.$message.warning("每列只能添加一个模板");
       } else {
         this.$set(
-          this.question_list.cur_fn_data[this.TopicIndex]
-            .table_list[this.RowIndex][this.LineIndex],
+          this.question_list.cur_fn_data[this.TopicIndex].table_list[
+            this.RowIndex
+          ][this.LineIndex],
           "type",
           child.type
         );
         this.$set(
-          this.question_list.cur_fn_data[this.TopicIndex]
-            .table_list[this.RowIndex][this.LineIndex],
+          this.question_list.cur_fn_data[this.TopicIndex].table_list[
+            this.RowIndex
+          ][this.LineIndex],
           "data",
           null
         );
@@ -1141,18 +1149,16 @@ export default {
       let question_list = this.question_list;
       let sentence_list = [];
       let new_word_list = [];
-      question_list.forEach((item) => {
-        item.cur_fn_data.forEach((curItem) => {
-          curItem.table_list.forEach((tabItem) => {
-            tabItem.forEach((topicIitem) => {
-              if (topicIitem.type == "article_chs") {
-                topicIitem.data.detail.forEach((item) => {
-                  sentence_list = sentence_list.concat(item.sentences);
-                });
-              } else if (topicIitem.type == "NewWord_chs") {
-                new_word_list = topicIitem.data.option;
-              }
-            });
+      question_list.cur_fn_data.forEach((curItem) => {
+        curItem.table_list.forEach((tabItem) => {
+          tabItem.forEach((topicIitem) => {
+            if (topicIitem.type == "article_chs") {
+              topicIitem.data.detail.forEach((item) => {
+                sentence_list = sentence_list.concat(item.sentences);
+              });
+            } else if (topicIitem.type == "NewWord_chs") {
+              new_word_list = topicIitem.data.option;
+            }
           });
         });
       });
@@ -1239,8 +1245,7 @@ export default {
     onDel(item, curIndex) {
       item.cur_fn_data.splice(curIndex, 1);
       if (this.question_list.cur_fn_data.length > 0) {
-        this.cur_page_que_index =
-          this.question_list.cur_fn_data.length - 1;
+        this.cur_page_que_index = this.question_list.cur_fn_data.length - 1;
       } else {
         this.cur_page_que_index = 0;
       }