Переглянути джерело

Merge branch 'master' into NPC-lhd

natasha 3 роки тому
батько
коміт
445265027e

+ 4 - 14
src/components/Adult/common/data.js

@@ -429,20 +429,6 @@ let fnData = [{
                 name: "录音控件-promax",
             },
         ],
-        data_structure: {
-            type: 'record_control',
-            name: "录音控件",
-            option: [{
-                hanzi: '',
-                pinyin: '',
-                mp3_list: [],
-                img_list: [],
-                isAnswer: '',
-                isChecked: '',
-                isJudge: '',
-                correctInput: '',
-            }],
-        },
     },
     {
         type: "pure_input",
@@ -793,6 +779,10 @@ let fnData = [{
         type: "sort_chs",
         name: "排序"
     },
+    {
+        type: "CourseStart_chs",
+        name: "封面",
+    },
 ]
 
 

+ 206 - 0
src/components/Adult/inputModules/CourseStart.vue

@@ -0,0 +1,206 @@
+<!--  -->
+<template>
+  <div class="Big-Book-sentence" v-if="curQue">
+    <div
+      class="Big-Book-Single-content"
+      style="margin-left: 20px; margin-top: 20px"
+    >
+      <div class="adult-book-input-item">
+        <span class="adult-book-lable">标题字体:</span>
+        <el-radio-group v-model="curQue.titleType">
+          <el-radio label="cn">中文</el-radio>
+          <el-radio label="en">英文</el-radio>
+        </el-radio-group>
+      </div>
+      <div class="adult-book-input-item" v-if="curQue.titleType">
+        <span class="adult-book-lable">标题:</span>
+        <el-input
+          class="adult-book-input"
+          type="textarea"
+          :autosize="{ minRows: 2 }"
+          placeholder="请输入标题"
+          v-model="curQue.title"
+          @blur="onBlur(curQue, 'title')"
+        ></el-input>
+      </div>
+      <div>
+        <SentenceSegwordChs :curQue="curQue.detail" />
+      </div>
+      <div class="adult-book-input-item">
+        <span class="adult-book-lable">英文:</span>
+        <el-input
+          class="adult-book-input"
+          type="textarea"
+          :autosize="{ minRows: 2 }"
+          placeholder="请输入英文"
+          v-model="curQue.en"
+          @blur="onBlur(curQue, 'en')"
+        ></el-input>
+      </div>
+      <div class="adult-book-input-item">
+        <span class="adult-book-lable">内容:</span>
+        <el-input
+          class="adult-book-input"
+          type="textarea"
+          :autosize="{ minRows: 2 }"
+          placeholder="请输入内容"
+          v-model="curQue.con"
+          @blur="onBlur(curQue, 'con')"
+        ></el-input>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+import Upload from "../common/Upload";
+import SentenceSegwordChs from "../common/SentenceSegwordChs/index.vue";
+export default {
+  name: "Single",
+  props: ["curQue", "fn_data", "changeCurQue", "type"],
+  components: {
+    Upload,
+    SentenceSegwordChs,
+  },
+  data() {
+    return {
+      data_structure: {
+        type: "CourseStart_chs",
+        name: "封面",
+        title: "",
+        titleType: "",
+        en: "",
+        con: "",
+        detail: {
+          type: "detail",
+          pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
+          sentence: "", //句子
+          segList: [], //分词结果
+          seg_words: "",
+          wordsList: [],
+        },
+      },
+    };
+  },
+  computed: {},
+  watch: {},
+  //方法集合
+  methods: {},
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    if (!this.curQue) {
+      this.changeCurQue(this.data_structure);
+    }
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='scss' scope>
+//@import url(); 引入公共css类
+.Big-Book-sentence {
+  &-content {
+    &.m {
+      display: flex;
+      justify-content: flex-start;
+      align-items: flex-start;
+    }
+
+    .Big-Book-title {
+      font-size: 16px;
+      line-height: 40px;
+      color: #000;
+      margin-right: 15px;
+    }
+    .Big-Book-main {
+      > div {
+        margin-bottom: 10px;
+        &.Big-Book-pinyin {
+          display: flex;
+          justify-content: flex-start;
+          align-items: center;
+        }
+      }
+    }
+  }
+
+  .Big-Book-addrole {
+    > div {
+      width: 300px;
+      height: 40px;
+      background: #f3f3f3;
+      border: 1px dashed rgba(0, 0, 0, 0.15);
+      box-sizing: border-box;
+      border-radius: 4px;
+      text-align: center;
+      line-height: 40px;
+      cursor: pointer;
+    }
+  }
+  .Big-Book-more {
+    .Big-Book-more-text {
+      position: relative;
+      text-align: center;
+    }
+    .Big-Book-more-text:before,
+    .Big-Book-more-text:after {
+      position: absolute;
+      background: #ccc;
+      content: "";
+      height: 1px;
+      top: 50%;
+      width: 45%;
+    }
+    .Big-Book-more-text:before {
+      left: 10px;
+    }
+    .Big-Book-more-text:after {
+      right: 10px;
+    }
+    .Big-Book-more-main {
+      display: flex;
+      > :not(:nth-child(1)) {
+        margin-left: 30px;
+      }
+    }
+  }
+  .Big-Book-con {
+    display: flex;
+    align-items: center;
+  }
+}
+.lrc-box {
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  > span {
+    font-size: 14px;
+    margin-right: 16px;
+  }
+}
+.close {
+  width: 24px;
+  cursor: pointer;
+}
+.addoption {
+  width: 200px;
+  height: 40px;
+  margin-bottom: 15px;
+  background: #f3f3f3;
+  border: 1px dashed rgba(0, 0, 0, 0.15);
+  box-sizing: border-box;
+  border-radius: 4px;
+  text-align: center;
+  line-height: 40px;
+  cursor: pointer;
+}
+</style>
+<style lang="scss">
+</style>

+ 27 - 5
src/components/Adult/inputModules/DialogueTem/index.vue

@@ -5,7 +5,7 @@
     v-if="curQue"
     v-loading="loading"
   >
-    <div class="Big-Book-img">
+    <!-- <div class="Big-Book-img">
       <UploadArt
         :change-fill-id="changeImage"
         :datafile-list="fileCon.img_list"
@@ -40,6 +40,14 @@
           />
         </li>
       </ul>
+    </div> -->
+    <div class="Big-Book-mp3">
+      <Upload
+        :changeFillId="changeImage"
+        :datafileList="fileCon.img_list"
+        :filleNumber="imgNumber"
+        :uploadType="'image'"
+      />
     </div>
     <div class="Big-Book-mp3">
       <Upload
@@ -238,7 +246,7 @@ export default {
   },
   data() {
     return {
-      imageNumber: 1000,
+      imgNumber: 1,
       mp3Number: 1,
       fileCon: {
         img_list: [],
@@ -300,15 +308,29 @@ export default {
       });
       this.curQue.mp3_list = JSON.parse(JSON.stringify(articleImgRes));
     },
-
-    changeImage(file) {
+    changeImage(fileList) {
+      console.log(fileList);
+      const articleImgList = JSON.parse(JSON.stringify(fileList));
+      const articleImgRes = [];
+      articleImgList.forEach((item) => {
+        if (item.response) {
+          const obj = {
+            name: item.name,
+            url: item.response.file_info_list[0].file_url,
+            id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
+          };
+          articleImgRes.push(obj);
+        }
+      });
+      this.curQue.img_list = JSON.parse(JSON.stringify(articleImgRes));
+    },
+    changeImage2(file) {
       console.log(file);
       if (file.response) {
         const obj = {
           name: file.name,
           url: file.response.file_info_list[0].file_url,
           id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
-          imgNumber: 0,
         };
         this.curQue.img_list.push(obj);
         this.$forceUpdate();

+ 12 - 12
src/components/Adult/inputModules/InputRecord.vue

@@ -5,16 +5,8 @@
       src="../../../assets/adult/maikefeng-red.png"
       class="Big-Book-Record-icon"
     /> -->
-    <div class="adult-book-input-item">
-      <span class="adult-book-lable">标题:</span>           
-      <el-input
-        class="adult-book-input"
-        :autosize="{ minRows: 2 }"
-        type="textarea"
-        placeholder="请输入标题"
-        v-model="curQue.title"
-        @blur="curQue.title = curQue.title.trim()"
-      ></el-input>
+    <div>
+      <SentenceSegwordChs :curQue="curQue.detail" />
     </div>
     <div
       class="Big-Book-hanzi-option"
@@ -35,16 +27,24 @@
 
 <script>
 import InputRecordModule from "../common/InputRecordModule.vue";
+import SentenceSegwordChs from "../common/SentenceSegwordChs/index.vue";
 
 export default {
-  components: { InputRecordModule },
+  components: { InputRecordModule, SentenceSegwordChs },
   props: ["curQue", "fn_data", "changeCurQue"],
   data() {
     return {
       data_structure: {
         type: "input_record_chs",
         name: "输入+录音",
-        title: "",
+        detail: {
+          type: "detail",
+          pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
+          sentence: "", //句子
+          segList: [], //分词结果
+          seg_words: "",
+          wordsList: [],
+        },
         option: [
           {
             con: "", //标题

+ 114 - 0
src/components/Adult/inputModules/RecordControl.vue

@@ -0,0 +1,114 @@
+<!--  -->
+<template>
+  <div class="Big-Book-Record">
+    <div class="adult-book-input-item">
+      <span class="adult-book-lable">音频控件:</span>
+      <img
+        v-if="type == 'record_control_mini'"
+        src="../../../assets/adult/mini.png"
+        alt=""
+      />
+      <img
+        v-if="type == 'record_control_normal'"
+        src="../../../assets/adult/normal.png"
+        alt=""
+      />
+      <img
+        v-if="type == 'record_control_pro'"
+        src="../../../assets/adult/pro.png"
+        alt=""
+      />
+      <img
+        v-if="type == 'record_control_promax'"
+        src="../../../assets/adult/pro-max.png"
+        alt=""
+      />
+    </div>
+  </div>
+</template>
+
+<script>
+export default {
+  components: {},
+  props: ["curQue", "fn_data", "type", "changeCurQue"],
+  data() {
+    return {
+      data_structure: {
+        type: "record_control_mini",
+        name: "录音控件-mini",
+      },
+      data_structure2: {
+        type: "record_control_normal",
+        name: "录音控件-normal",
+      },
+      data_structure3: {
+        type: "record_control_pro",
+        name: "录音控件-pro",
+      },
+      data_structure4: {
+        type: "record_control_promax",
+        name: "录音控件-promax",
+      },
+    };
+  },
+  computed: {},
+  watch: {},
+  //方法集合
+  methods: {},
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    if (!this.curQue) {
+      if (this.type == "record_control_mini") {
+        this.changeCurQue(this.data_structure);
+      } else if (this.type == "record_control_normal") {
+        this.changeCurQue(this.data_structure2);
+      } else if (this.type == "record_control_pro") {
+        this.changeCurQue(this.data_structure3);
+      } else if (this.type == "record_control_promax") {
+        this.changeCurQue(this.data_structure4);
+      }
+    }
+  },
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  beforeMount() {}, //生命周期 - 挂载之前
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='scss' scoped>
+//@import url(); 引入公共css类
+.Big-Book-Record {
+  &-icon {
+    width: 48px;
+    height: 48px;
+  }
+  .Big-Book-hanzi-option {
+    margin-top: 20px;
+  }
+  .addoption {
+    width: 148px;
+    height: 40px;
+    background: #f3f3f3;
+    border: 1px dashed rgba(0, 0, 0, 0.15);
+    box-sizing: border-box;
+    border-radius: 4px;
+    text-align: center;
+    line-height: 40px;
+    cursor: pointer;
+    font-size: 14px;
+    color: #000000;
+  }
+  .Big-Book-con {
+    display: flex;
+    align-items: center;
+    span {
+      width: 60px;
+    }
+  }
+}
+</style>

+ 5 - 0
src/components/Adult/inputModules/SentenceSegwordChs/components/ClauseresultChs.vue

@@ -72,6 +72,11 @@ export default {
 </script>
 <style lang='scss' scoped>
 //@import url(); 引入公共css类
+.Big-Book-Maxwidth{
+  display: flex;
+  justify-content: flex-start;
+  align-items: flex-start;
+}
 .NPC-sentence-list {
   display: flex;
   justify-content: flex-start;

+ 536 - 5
src/components/Adult/preview/DialogueArticleViewChs/AnswerModel.vue

@@ -1,27 +1,365 @@
 <!--  -->
 <template>
-  <div class="">
-    <RoleChs />
+  <div class="NNPE-ArticleView" v-if="curQue">
+    <div
+      class="aduioLine-box"
+      v-if="
+        curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].url
+      "
+    >
+      <AudioLine
+        :mp3="curQue.mp3_list[0].url"
+        :getCurTime="getCurTime"
+        ref="audioLine"
+      />
+    </div>
+    <template v-if="resArr.length > 0">
+      <div class="NPC-sentences-list">
+        <div class="NPC-article-empty">
+          <div :class="['empty-left', isHasRemark ? 'hasRemark' : '']"></div>
+          <div class="empty-right"></div>
+        </div>
+        <p class="notice" v-if="curQue.notice">{{ curQue.notice }}</p>
+        <div
+          :class="[
+            'NNPE-detail',
+            item.isTitle ? 'NNPE-detail-title' : '',
+            item.timeList.length > 0 &&
+            curTime >= item.timeList[0].bg &&
+            curTime <= item.timeList[item.timeList.length - 1].ed
+              ? 'active'
+              : '',
+          ]"
+          v-for="(item, index) in resArr"
+          :key="'detail' + index"
+        >
+          <div :class="['article-content', isHasRemark ? 'hasRemark' : '']">
+            <RoleChs :curRole="item.roleDetail" />
+            <div class="wordsList-box">
+              <img
+                :src="articleImg[index]"
+                v-if="articleImg[0] && index == 0"
+              />
+              <div :style="{ background: item.roleDetail.color.bg }">
+                <div
+                  class="NNPE-words"
+                  v-for="(pItem, pIndex) in item.wordsList"
+                  :key="'wordsList' + pIndex"
+                  :class="[pItem.wordIndex == 0 ? 'textLeft' : 'textCenter']"
+                  @click="
+                    handleChangeTime(
+                      item.timeList.length > 0 &&
+                        item.timeList[pItem.sentIndex].bg
+                    )
+                  "
+                >
+                  <template v-if="!pItem.width">
+                    <template v-if="pItem.isShow">
+                      <template
+                        v-if="
+                          item.wordsList[pIndex + 1].chs &&
+                          chsFhList.indexOf(item.wordsList[pIndex + 1].chs) > -1
+                        "
+                      >
+                        <span class="NNPE-words-box">
+                          <span
+                            v-if="curQue.pyPosition == 'top'"
+                            class="NNPE-pinyin"
+                            :class="[pItem.className ? pItem.className : '']"
+                            >{{ pItem.pinyin }}</span
+                          >
+                          <span
+                            class="NNPE-chs"
+                            :class="[
+                              item.timeList.length > 0 &&
+                              curTime >=
+                                item.timeList[pItem.sentIndex].wordsResultList[
+                                  pItem.wordIndex
+                                ].wordBg &&
+                              curTime <= item.timeList[pItem.sentIndex].ed
+                                ? 'wordActive'
+                                : '',
+                            ]"
+                            >{{ pItem.chs }}</span
+                          >
+                          <span
+                            v-if="curQue.pyPosition == 'bottom'"
+                            class="NNPE-pinyin"
+                            :class="[pItem.className ? pItem.className : '']"
+                            >{{ pItem.pinyin }}</span
+                          >
+                        </span>
+                        <span class="NNPE-words-box">
+                          <span
+                            v-if="curQue.pyPosition == 'top'"
+                            class="NNPE-pinyin"
+                            style="text-align: left"
+                            >{{ item.wordsList[pIndex + 1].pinyin }}</span
+                          >
+                          <span
+                            class="NNPE-chs"
+                            style="text-align: left"
+                            :class="[
+                              item.timeList.length > 0 &&
+                              curTime >=
+                                item.timeList[pItem.sentIndex].wordsResultList[
+                                  pItem.wordIndex
+                                ].wordBg &&
+                              curTime <= item.timeList[pItem.sentIndex].ed
+                                ? 'wordActive'
+                                : '',
+                            ]"
+                            >{{ item.wordsList[pIndex + 1].chs }}</span
+                          >
+                          <span
+                            v-if="curQue.pyPosition == 'bottom'"
+                            class="NNPE-pinyin"
+                            style="text-align: left"
+                            >{{ item.wordsList[pIndex + 1].pinyin }}</span
+                          >
+                        </span>
+                      </template>
+                      <template v-else>
+                        <span
+                          v-if="curQue.pyPosition == 'top'"
+                          class="NNPE-pinyin"
+                          :class="[
+                            pItem.padding ? 'padding' : '',
+                            pItem.className ? pItem.className : '',
+                          ]"
+                          >{{ pItem.pinyin }}</span
+                        >
+                        <span
+                          class="NNPE-chs"
+                          :class="[
+                            item.timeList.length > 0 &&
+                            curTime >=
+                              item.timeList[pItem.sentIndex].wordsResultList[
+                                pItem.wordIndex
+                              ].wordBg &&
+                            curTime <= item.timeList[pItem.sentIndex].ed
+                              ? 'wordActive'
+                              : '',
+                            pItem.padding ? 'padding' : '',
+                          ]"
+                          >{{ pItem.chs }}</span
+                        >
+                        <span
+                          v-if="curQue.pyPosition == 'bottom'"
+                          class="NNPE-pinyin"
+                          :class="[
+                            pItem.padding ? 'padding' : '',
+                            pItem.className ? pItem.className : '',
+                          ]"
+                          >{{ pItem.pinyin }}</span
+                        >
+                      </template>
+                    </template>
+                  </template>
+                  <template v-else>
+                    <span
+                      :style="{
+                        height: pItem.height + 'px',
+                        width: pItem.width + 'px',
+                      }"
+                    ></span>
+                  </template>
+                </div>
+                <div v-if="item.enwords" class="enwords">
+                  {{ item.enwords }}
+                </div>
+              </div>
+              <img :src="articleImg[index + 1]" v-if="articleImg[index + 1]" />
+            </div>
+          </div>
+          <div class="remarkBox remark-top" v-if="item.remarkDetail">
+            <RemarkChs :remarkDetail="item.remarkDetail" />
+          </div>
+        </div>
+        <div class="NPC-article-empty NPC-article-empty-bottom">
+          <div :class="['empty-left', isHasRemark ? 'hasRemark' : '']"></div>
+          <div class="empty-right"></div>
+        </div>
+        <div class="dia-article-record">
+          <Soundrecord @handleWav="handleWav" type="promax" class="luyin-box" />
+        </div>
+      </div>
+    </template>
   </div>
 </template>
 
 <script>
+import { timeStrToSen } from "@/utils/index";
+import AudioLine from "../AudioLine.vue";
 import RoleChs from "./RoleChs.vue";
+import RemarkChs from "./RemarkChs.vue";
+import Soundrecord from "../Soundrecord.vue";
 export default {
+  name: "DialogueNormalModelChs",
+  props: ["curQue", "colorBox"],
   components: {
+    AudioLine,
     RoleChs,
+    RemarkChs,
+    Soundrecord,
   },
   data() {
-    return {};
+    return {
+      resArr: [],
+      curTime: 0, //单位s
+      chsFhList: [",", "。", "“", ":", "》", "《", "?", "!", ";"],
+      enFhList: [",", ".", ";", "?", "!", ":", ">", "<"],
+      newWords: ["鱼", "辩礼义"],
+      oldHz: "",
+      hz: "",
+      top: 0,
+      left: 0,
+      articleImg: {}, // 文章图片
+      isHasRemark: false,
+    };
   },
   computed: {},
   watch: {},
   //方法集合
-  methods: {},
+  methods: {
+    handleWav() {},
+    getCurTime(curTime) {
+      this.curTime = curTime * 1000;
+    },
+    handleData() {
+      let resArr = [];
+      let reg = /_{2,}/g;
+      let leg = this.curQue.detail.length;
+      let curQue = JSON.parse(JSON.stringify(this.curQue));
+      curQue.detail.forEach((dItem, dIndex) => {
+        let roleDetail = this.getRole(dItem);
+        let remarkDetail = dItem.remark;
+        if (remarkDetail && (remarkDetail.chs || remarkDetail.en)) {
+          this.isHasRemark = true;
+        }
+        let paraArr = [];
+        dItem.wordsList.forEach((sItem, sIndex) => {
+          sItem.forEach((wItem, wIndex) => {
+            //this.judgePad(sItem, wItem, wIndex);
+            this.mergeWordSymbol(sItem, wItem, wIndex);
+            let obj = {
+              paraIndex: dIndex, //段落索引
+              sentIndex: sIndex, //在段落中句子索引
+              answer: "",
+              wordIndex: wIndex, //单词的索引
+              pinyin: wItem.pinyin,
+              chs: wItem.chs,
+              isHeng: reg.test(wItem.chs),
+              padding: true, //wItem.padding,
+              className: wItem.className,
+              isShow: wItem.isShow,
+              isNewWord: this.newWords.indexOf(wItem.chs) > -1 ? true : false,
+            };
+            paraArr.push(obj);
+          });
+        });
+        let curSentencesLeg = dItem.sentences.length;
+        let startLeg = dIndex == 0 ? 0 : curQue.detail[dIndex - 1].endLeg;
+        let endLeg = startLeg + curSentencesLeg;
+        dItem.endLeg = endLeg;
+        let timeList = [];
+        if (curQue.wordTime && curQue.wordTime.length > 0) {
+          timeList = curQue.wordTime.slice(startLeg, endLeg);
+        }
+        let enwords =
+          dItem.sentencesEn && dItem.sentencesEn.length > 0
+            ? dItem.sentencesEn.join(" ")
+            : "";
+        let paraObj = {
+          wordsList: paraArr,
+          enwords: enwords,
+          timeList: timeList,
+          roleDetail: roleDetail,
+          remarkDetail: remarkDetail,
+        };
+        resArr.push(paraObj);
+      });
+      this.resArr = resArr;
+      console.log("Normal");
+      console.log(this.resArr);
+
+      // 循环文章图片
+      if (curQue.img_list) {
+        curQue.img_list.forEach((item) => {
+          this.articleImg[item.imgNumber] = item.url;
+        });
+      }
+    },
+    //词和标点合一起
+    mergeWordSymbol(sItem, wItem, curIndex) {
+      let leg = sItem.length;
+      if (curIndex < leg - 1) {
+        if (this.chsFhList.indexOf(wItem.chs) > -1) {
+          wItem.isShow = false;
+        } else {
+          wItem.isShow = true;
+        }
+      }
+    },
+    //获取角色
+    getRole(dItem) {
+      let roleIndex = dItem.roleIndex;
+      let resObj = null;
+      let roleList = JSON.parse(JSON.stringify(this.curQue.roleList));
+      for (let i = 0; i < roleList.length; i++) {
+        let item = roleList[i];
+        if (item.id == roleIndex) {
+          resObj = item;
+          resObj.color = this.colorBox[i];
+          break;
+        }
+      }
+
+      return resObj;
+    },
+    //判断是否有padding
+    judgePad(sItem, wItem, curIndex) {
+      let leg = sItem.length;
+      if (curIndex < leg - 1) {
+        let nextIndex = curIndex + 1;
+        let chs = sItem[nextIndex].chs;
+        if (
+          this.chsFhList.indexOf(chs) > -1 ||
+          this.chsFhList.indexOf(wItem.chs) > -1
+        ) {
+          wItem.padding = false;
+        } else {
+          wItem.padding = true;
+        }
+        if (this.enFhList.indexOf(wItem.pinyin) > -1) {
+          wItem.className = "textLeft";
+        }
+      }
+    },
+    //转化时间
+    handleTimeList(list) {
+      let listRes = [];
+      list.forEach((item) => {
+        let res = timeStrToSen(item);
+        listRes.push(res);
+      });
+      return listRes;
+    },
+    //点击播放某个句子
+    handleChangeTime(time) {
+      this.curTime = time;
+      this.$refs.audioLine.onTimeupdateTime(time / 1000);
+    },
+  },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
   //生命周期 - 挂载完成(可以访问DOM元素)
-  mounted() {},
+  mounted() {
+    console.log(this.curQue);
+    if (this.curQue) {
+      this.handleData();
+    }
+  },
   beforeCreate() {}, //生命周期 - 创建之前
   beforeMount() {}, //生命周期 - 挂载之前
   beforeUpdate() {}, //生命周期 - 更新之前
@@ -33,4 +371,197 @@ export default {
 </script>
 <style lang='scss' scoped>
 //@import url(); 引入公共css类
+.NNPE-ArticleView {
+  width: 100%;
+
+  .NPC-sentences-list {
+    .NPC-article-empty {
+      display: flex;
+      justify-content: flex-start;
+      align-items: flex-start;
+      > div {
+        height: 24px;
+        &.empty-left {
+          width: 100%;
+          box-sizing: border-box;
+
+          &.hasRemark {
+            width: 553px;
+            box-sizing: border-box;
+            border-right: 1px rgba(0, 0, 0, 0.1) solid;
+          }
+        }
+        &.empty-right {
+          flex: 1;
+        }
+      }
+      &-bottom {
+        > div {
+          height: 40px;
+        }
+      }
+    }
+    .dia-article-record {
+      width: 100%;
+      border-top: 1px solid rgba(0, 0, 0, 0.1);
+      .luyin-box {
+        justify-content: start;
+        padding: 8px 12px;
+        height: 40px;
+        width: 280px;
+        justify-content: flex-start;
+      }
+    }
+  }
+  .NNPE-detail {
+    clear: both;
+    overflow: hidden;
+    display: flex;
+    justify-content: flex-start;
+    align-items: flex-start;
+    &.active {
+      background: rgba(0, 0, 0, 0.06);
+    }
+    .article-content {
+      width: 100%;
+      box-sizing: border-box;
+      padding: 8px 24px 8px 24px;
+      &.hasRemark {
+        width: 553px;
+        border-right: 1px rgba(0, 0, 0, 0.1) solid;
+        padding: 8px 0px 8px 23px;
+      }
+      &.paraLast {
+        padding-bottom: 24px;
+      }
+    }
+    .NNPE-words {
+      float: left;
+      &-box {
+        float: left;
+        > span {
+          display: block;
+          &.NNPE-pinyin {
+            font-family: "GB-PINYINOK-B";
+            font-weight: normal;
+            font-size: 14px;
+            line-height: 22px;
+            color: #000000;
+            height: 21px;
+            &.textLeft {
+              text-align: left;
+            }
+          }
+          &.NNPE-chs {
+            font-family: "FZJCGFKTK";
+            font-size: 20px;
+            line-height: 28px;
+            color: #000000;
+            &.active {
+              background: rgba(60, 200, 99, 0.2);
+            }
+            &.wordActive {
+              color: #de4444;
+            }
+          }
+          &.padding {
+            padding: 0 3px;
+          }
+        }
+      }
+      &.textLeft {
+        text-align: left;
+      }
+      &.textCenter {
+        text-align: center;
+      }
+      > span {
+        display: block;
+        &.NNPE-pinyin {
+          font-family: "GB-PINYINOK-B";
+          font-weight: normal;
+          font-size: 14px;
+          line-height: 22px;
+          color: #000000;
+          height: 21px;
+          &.textLeft {
+            text-align: left;
+          }
+        }
+        &.NNPE-chs {
+          font-family: "FZJCGFKTK";
+          font-size: 20px;
+          line-height: 28px;
+          color: #000000;
+          &.active {
+            background: rgba(60, 200, 99, 0.2);
+          }
+          &.wordActive {
+            color: #de4444;
+          }
+        }
+        &.padding {
+          padding: 0 3px;
+        }
+      }
+    }
+    .enwords {
+      font-family: "robot";
+      font-weight: normal;
+      font-size: 14px;
+      line-height: 22px;
+      color: rgba(0, 0, 0, 0.85);
+    }
+    &.NNPE-detail-title {
+      .wordsList-box {
+        > div {
+          display: flex;
+          justify-content: center;
+        }
+      }
+    }
+    .index {
+      width: 48px;
+      box-sizing: border-box;
+      padding: 8px;
+      text-align: right;
+      border-right: 1px solid rgba(0, 0, 0, 0.1);
+      b {
+        font-weight: 400;
+        color: #000000;
+        line-height: 1.5;
+      }
+    }
+
+    .wordsList-box {
+      width: 100%;
+      padding: 0px 24px 0px 40px;
+      clear: both;
+      overflow: hidden;
+      > div {
+        float: left;
+        border: 1px solid rgba(0, 0, 0, 0.1);
+        box-sizing: border-box;
+        padding: 8px 12px 8px 12px;
+        border-radius: 8px;
+      }
+      > img {
+        width: 100%;
+        display: block;
+      }
+    }
+  }
+  .remarkBox {
+    flex: 1;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    &.remark72 {
+      padding-top: 72px;
+    }
+    &.remark-top {
+      padding-top: 44px;
+    }
+  }
+}
 </style>

+ 11 - 4
src/components/Adult/preview/DialogueArticleViewChs/DialogueAnswerViewChs.vue

@@ -14,10 +14,17 @@
           <img src="" alt="" srcset="" />
         </template>
         <template>
-          <AnswerModel />
+          <AnswerModel :curQue="item" :colorBox="colorBox" />
         </template>
-        <template>
-          <OptionModel />
+        <template
+          v-if="
+            curQue.option &&
+            curQue.option.length > 0 &&
+            curQue.option.wordsList &&
+            curQue.option.wordsList.length > 0
+          "
+        >
+          <OptionModel :option="curQue.option[index].wordsList" />
         </template>
       </div>
     </div>
@@ -42,7 +49,7 @@ export default {
     AnswerModel,
     OptionModel,
   },
-  props: ["curQue"],
+  props: ["curQue", "colorBox"],
   data() {
     return {};
   },

+ 5 - 4
src/components/Adult/preview/VoiceMatrix.vue

@@ -341,7 +341,7 @@ export default {
       if (type.length > 0 && index >= 0 && type === "row") {
         this.curQue.voiceMatrix.matrix[index].forEach(item => {
           if (
-            item.type !== "connection" ||
+            item.type === "SentenceSegwordChs" ||
             (item.type === "text" && item.text.length > 0)
           ) {
             this.lrcArray.push(item.lrc_data);
@@ -353,11 +353,12 @@ export default {
 
       if (type.length > 0 && index >= 0 && type === "column") {
         this.curQue.voiceMatrix.matrix.forEach(item => {
+          let data = item[index];
           if (
-            item.type !== "connection" ||
-            (item.type === "text" && item.text.length > 0)
+            data.type === "SentenceSegwordChs" ||
+            (data.type === "text" && data.text.length > 0)
           ) {
-            this.lrcArray.push(item[index].lrc_data);
+            this.lrcArray.push(data.lrc_data);
           }
         });
         if (this.lrcArray.length > 0) this.lrcPlay(this.lrcArray[0], 0);

+ 154 - 9
src/views/adultInput.vue

@@ -29,6 +29,32 @@
             :label="item.title"
             :name="item.name"
           >
+            <div
+              style="position: relative"
+              v-for="(fc, fcIndex) in item.detailList"
+              :key="'fc' + fcIndex"
+            >
+              <SentenceSegwordChs :curQue="fc" />
+              <img
+                style="position: absolute; right: 699px; top: 2px"
+                @click="deleteDetail(index, fcIndex)"
+                class="close"
+                src="../assets/adult/del-close.png"
+                alt=""
+              />
+            </div>
+            <div class="addoption" @click="addDetail(index)">添加</div>
+            <div class="Big-Book-top" style="margin: 10px 0">
+              <span>课题</span>
+              <el-input
+                v-model="item.classTopic"
+                style="width: 80%"
+                type="textarea"
+                autosize
+                placeholder="请输入课题"
+                @blur="onBlur(item, 'classTopic')"
+              />
+            </div>
             <div class="createTable">
               <el-input
                 v-model="row"
@@ -55,28 +81,36 @@
               :key="'topic' + toindex + index"
             >
               <p>第{{ toindex + 1 }}题</p>
-              <div class="Big-Book-top">
-                <span>正标题</span>
+              <div class="adult-book-input-item">
+                <span class="adult-book-lable">正标题</span>
                 <el-input
                   v-model="topic.z_title"
-                  style="width: 80%"
                   type="textarea"
-                  autosize
+                  :autosize="{ minRows: 2 }"
                   placeholder="请输入正标题"
                   @blur="onBlur(topic, 'z_title')"
                 />
               </div>
-              <div class="Big-Book-top">
-                <span>副标题</span>
+              <div class="adult-book-input-item">
+                <span class="adult-book-lable">副标题</span>
                 <el-input
                   v-model="topic.f_title"
-                  style="width: 80%"
+                  :autosize="{ minRows: 2 }"
                   type="textarea"
-                  autosize
                   placeholder="请输入副标题"
                   @blur="onBlur(topic, 'f_title')"
                 />
               </div>
+              <div class="adult-book-input-item">
+                <span class="adult-book-lable">序号:</span>
+                <el-input
+                  v-model="topic.number"
+                  type="textarea"
+                  :autosize="{ minRows: 2 }"
+                  placeholder="请输入序号"
+                  @blur="onBlur(topic, 'number')"
+                />
+              </div>
               <div class="Big-Book-top">
                 <span>是否有背景色</span>
                 <el-radio v-model="topic.is_bg" :label="true">有</el-radio>
@@ -256,7 +290,7 @@
                         />
                       </template>
                     </template>
-                                        <template v-if="topicIitem.type == 'ligature_chs'">
+                    <template v-if="topicIitem.type == 'ligature_chs'">
                       <template v-if="topicIitem.is_edit">
                         <Ligature
                           :curQue="topicIitem.data"
@@ -407,6 +441,46 @@
                       </template>
                       <template v-else> </template>
                     </template>
+                    <template v-if="topicIitem.type == 'sort_chs'">
+                      <template v-if="topicIitem.is_edit">
+                        <Sort
+                          :curQue="topicIitem.data"
+                          :type="topicIitem.type"
+                          :fn_data="fn_data"
+                          :changeCurQue="changeCurQue"
+                        />
+                      </template>
+                      <template v-else> </template>
+                    </template>
+                    <template v-if="topicIitem.type == 'CourseStart_chs'">
+                      <template v-if="topicIitem.is_edit">
+                        <CourseStart
+                          :curQue="topicIitem.data"
+                          :type="topicIitem.type"
+                          :fn_data="fn_data"
+                          :changeCurQue="changeCurQue"
+                        />
+                      </template>
+                      <template v-else> </template>
+                    </template>
+                    <template
+                      v-if="
+                        topicIitem.type == 'record_control_mini' ||
+                        topicIitem.type == 'record_control_normal'||
+                        topicIitem.type == 'record_control_pro'||
+                        topicIitem.type == 'record_control_promax'
+                      "
+                    >
+                      <template v-if="topicIitem.is_edit">
+                        <RecordControl
+                          :curQue="topicIitem.data"
+                          :type="topicIitem.type"
+                          :fn_data="fn_data"
+                          :changeCurQue="changeCurQue"
+                        />
+                      </template>
+                      <template v-else> </template>
+                    </template>
                   </div>
                   <div
                     v-if="topicIitem.data && topicIitem.is_edit"
@@ -538,6 +612,8 @@ import PlayInputReacord from "@/components/Adult/inputModules/PlayInputReacord.v
 import Drag from "@/components/Adult/inputModules/Drag.vue";
 import SelfAssessment from "@/components/Adult/inputModules/SelfAssessment.vue";
 import Sort from "@/components/Adult/inputModules/Sort.vue";
+import CourseStart from "@/components/Adult/inputModules/CourseStart.vue";
+import RecordControl from "@/components/Adult/inputModules/RecordControl.vue";
 
 import Textdes from "@/components/Adult/inputModules/Textdes.vue";
 import Record from "@/components/Adult/inputModules/Record.vue";
@@ -558,6 +634,7 @@ import NewordPhraseview from "@/components/Adult/preview/WordPhrase.vue";
 import UploadControlView from "@/components/Adult/preview/UploadControlView.vue";
 
 import DialogueAnswerViewChs from "@/components/Adult/preview/DialogueArticleViewChs/DialogueAnswerViewChs.vue";
+import Clauseresult from "@/components/Adult/inputModules/SentenceSegwordChs/components/ClauseresultChs.vue";
 import Preview from "@/components/Adult/Preview.vue";
 import fn from "@/components/Adult/common/data.js";
 import { getContent, getStaticContent } from "@/api/ajax";
@@ -615,6 +692,8 @@ export default {
     Drag,
     SelfAssessment,
     Sort,
+    CourseStart,
+    RecordControl,
   },
   data() {
     return {
@@ -629,6 +708,17 @@ export default {
         {
           name: "tab1",
           title: "第1页",
+          detailList: [
+            {
+              type: "detail",
+              pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
+              sentence: "", //句子
+              segList: [], //分词结果
+              seg_words: "",
+              wordsList: [],
+            },
+          ], //目录分词
+          classTopic: "", //课题
           cur_fn_data: [],
         },
       ], // 总的数据列表
@@ -636,6 +726,17 @@ export default {
         {
           name: "tab1",
           title: "第1页",
+          detailList: [
+            {
+              type: "detail",
+              pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
+              sentence: "", //句子
+              segList: [], //分词结果
+              seg_words: "",
+              wordsList: [],
+            },
+          ], //目录分词
+          classTopic: "", //课题
           cur_fn_data: [],
         },
       ], // 总的数据列表
@@ -697,6 +798,26 @@ export default {
   activated() {},
   // 方法集合
   methods: {
+    // 增加当前页的分词
+    addDetail(index) {
+      let obj = {
+        type: "detail",
+        pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
+        sentence: "", //句子
+        segList: [], //分词结果
+        seg_words: "",
+        wordsList: [],
+      };
+      this.question_list[index].detailList.push(obj);
+    },
+    // 删除当前页的分词
+    deleteDetail(index, fcindex) {
+      if (this.question_list[index].detailList.length <= 1) {
+        this.$message.warning("至少要保留一一个");
+        return;
+      }
+      this.question_list[index].detailList.splice(fcindex, 1);
+    },
     // 随意插入模板获取位置
     changeSite(x, y) {
       this.bgControlX = x;
@@ -718,6 +839,7 @@ export default {
         let arr = {
           z_title: "",
           f_title: "",
+          number: "",
           is_bg: false, // 是否有背景色
           is_layout: false, // 是不是按背景图布局
           table_list: [],
@@ -815,6 +937,17 @@ export default {
           name: `tab${leg + 1}`,
           title: `第${leg + 1}页`,
           cur_fn_data: [],
+          detailList: [
+            {
+              type: "detail",
+              pyPosition: "top", //top 拼音在上面;bottom 拼音在下面
+              sentence: "", //句子
+              segList: [], //分词结果
+              seg_words: "",
+              wordsList: [],
+            },
+          ], //目录分词
+          classTopic: "", //课题
         };
         this.question_list.push(obj);
       }
@@ -1205,5 +1338,17 @@ export default {
       margin-right: 10px;
     }
   }
+  .addoption {
+    width: 200px;
+    height: 40px;
+    margin-bottom: 15px;
+    background: #f3f3f3;
+    border: 1px dashed rgba(0, 0, 0, 0.15);
+    box-sizing: border-box;
+    border-radius: 4px;
+    text-align: center;
+    line-height: 40px;
+    cursor: pointer;
+  }
 }
 </style>