Просмотр исходного кода

叙述体课文有空段落时段落数计算错误问题

natasha 3 недель назад
Родитель
Сommit
6a38a762ef
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      src/views/book/courseware/create/components/question/article/Article.vue

+ 3 - 1
src/views/book/courseware/create/components/question/article/Article.vue

@@ -672,15 +672,17 @@ export default {
         widthNumber: null,
         widthNumber: null,
       };
       };
       // 分段
       // 分段
+      let paraindex = 0;
       contentArr.forEach((item, index) => {
       contentArr.forEach((item, index) => {
         if (item.trim()) {
         if (item.trim()) {
           detailItem.para = item;
           detailItem.para = item;
-          detailItem.paraIndex = index;
+          detailItem.paraIndex = paraindex;
           this.data.detail.push(JSON.parse(JSON.stringify(detailItem)));
           this.data.detail.push(JSON.parse(JSON.stringify(detailItem)));
 
 
           let str = Base64.encode(item);
           let str = Base64.encode(item);
           textList.push(str);
           textList.push(str);
           contentStr += `${item.trim()}\n`;
           contentStr += `${item.trim()}\n`;
+          paraindex++;
         }
         }
       });
       });
       BatchSegContent({
       BatchSegContent({