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

Merge branch 'master' into gcj

gcj 3 роки тому
батько
коміт
79d42b902f

+ 72 - 3
src/components/Adult/Preview.vue

@@ -127,7 +127,10 @@
         v-for="(item, index) in cur.cur_fn_data"
         :key="index"
         class="title-box-preview"
+        :class="[!previewType || previewType=='previewCheck' || previewType=='previewCheckShow'&&item.previewShow||JSON.parse(previewGroupId).length==0?'NNPE-Book-content-item':'']"
       >
+      <el-checkbox class="NNPE-Book-content-item-checkbox" :label="item.group_id" v-if="previewType&&previewType=='previewCheck'&&item.group_id" v-model="groupCheckList[index]" @change="forupdata(index)"><br/></el-checkbox>
+        <template v-if="!previewType || previewType=='previewCheck' || previewType=='previewCheckShow'&&item.previewShow||JSON.parse(previewGroupId).length==0">
         <div
           v-if="item.number || item.z_title || item.f_title"
           class="title-big"
@@ -533,6 +536,7 @@
             </div>
           </div>
         </div>
+        </template>
       </div>
     </div>
     <div v-if="isShowSave || isShowTitle" class="NNPE-title NNPE-title-gray">
@@ -593,11 +597,11 @@ import VideoControl from "./preview/VideoControl.vue"; // 视频控件
 import TableView from "./preview/TableView.vue"; // 视频控件
 import PdfView from "./preview/PdfView.vue"; // 视频控件
 import SentenceModule from "./preview/SentenceModule.vue"; // 图片模板
-import PlayRecordView from "@/components/Adult/preview/PlayRecordView.vue";
+import PlayRecordView from "./preview/PlayRecordView.vue";
 import OptionsList from "./preview/OptionsList.vue"; // 选项模板
 
 export default {
-  name: "Preview",
+  name: "Booknpc",
   components: {
     Picture,
     Record,
@@ -649,6 +653,8 @@ export default {
     "bookAnswerContent",
     "TaskModel",
     "isShowSave",
+    "previewType",
+    "previewGroupId"
   ],
   data() {
     return {
@@ -692,6 +698,11 @@ export default {
       refresh: true,
       preClick: false, // 上一页是否可点
       nextClick: false, // 下一页是否可点
+      answerTime: 0,
+      answerTimeInterval: null, // 计时器
+      groupIndexList: [], // 勾选groupid数组
+      groupCheckList: [], // checkbox 是否选中
+
     };
   },
   computed: {},
@@ -805,6 +816,9 @@ export default {
       _this.NNPENewPhraseList = [];
       _this.NNPEAnnotationList = [];
       _this.watchIndex = _this.queIndex + new Date().getTime();
+      this.groupCheckList = []
+      let selectGropuIdList = this.previewGroupId?JSON.parse(this.previewGroupId):[]
+      this.groupCheckList = []
       if (_this.contextData) {
         // const list = _this.contextData;
         // if (list && list.length > 0) {
@@ -829,6 +843,14 @@ export default {
         // }
         _this.cur = _this.contextData;
         _this.cur.cur_fn_data.forEach((item, index) => {
+          this.groupCheckList.push(false)
+          selectGropuIdList.forEach((itemId)=>{
+              itemId.forEach(itemIds=>{
+                  if(item.group_id&&itemIds.indexOf(item.group_id[0])>-1){
+                    item.previewShow = true
+                  }
+              })
+          })
           item.table_list.forEach((items, indexs) => {
             items.forEach((itemss, indexss) => {
               if (itemss.data && itemss.data.type == "NewWord_chs") {
@@ -937,6 +959,7 @@ export default {
       }
     },
     submitUserAnswerNPC() {
+      this.handleAnswerTimeEnd();
       let contextData = JSON.parse(JSON.stringify(this.contextData));
       let result = [];
       contextData.cur_fn_data.forEach((item, index) => {
@@ -962,8 +985,46 @@ export default {
           });
         });
       });
-      this.$emit("finishTaskMaterial", JSON.stringify(result));
+      this.$emit("finishTaskMaterial", JSON.stringify(result), this.answerTime);
+    },
+    // 开始计算答题用时
+    handleAnswerTimeStart() {
+      this.answerTime = 0;
+      window.clearInterval(this.answerTimeInterval);
+      this.answerTimeInterval = window.setInterval(() => {
+        this.answerTime++;
+      }, 1000);
+    },
+    // 结束计算答题用时
+    handleAnswerTimeEnd() {
+      window.clearInterval(this.answerTimeInterval);
     },
+    // 提交选中groupid
+    submitPreviewGroupId(){
+        return JSON.stringify(this.groupIndexList)
+    },
+    forupdata(indexI) {
+      if(this.groupIndexList.toString().indexOf((this.cur.cur_fn_data[indexI].group_id).toString())==-1){
+          this.groupIndexList.push(this.cur.cur_fn_data[indexI].group_id)
+      }else{
+          this.groupIndexList.forEach((items,indexs)=>{
+              if(items.toString()==this.cur.cur_fn_data[indexI].group_id.toString()){
+                  this.groupIndexList.splice(indexs,1)
+                  return false;
+              }
+          })
+      }
+      this.groupCheckList.forEach((item,index)=>{
+          this.groupCheckList[index] = false
+      })
+      this.cur.cur_fn_data.forEach((item,index)=>{
+          if(this.groupIndexList.toString().indexOf((item.group_id).toString())>-1){
+              this.groupCheckList[index] = true
+          }
+      })
+      this.$forceUpdate()
+    },
+
   }, // 如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
@@ -1131,6 +1192,14 @@ export default {
   }
   .NNPE-Book-content-inner {
     padding: 0 40px;
+    .NNPE-Book-content-item{
+          position: relative;
+    }
+    .NNPE-Book-content-item-checkbox{
+          position: absolute;
+          left: -20px;
+          top: 36px;
+    }
     > div.title-box-preview {
       padding-top: 32px;
       .title-big {

+ 16 - 2
src/components/Adult/inputModules/UploadControl.vue

@@ -136,9 +136,23 @@ export default {
       this.curQue.upload_list = JSON.parse(JSON.stringify(articleImgRes));
     },
     changeFillId(fileList, item, index) {
-      this.curQue.fileList = JSON.parse(JSON.stringify(fileList));
+      const articleImgList = JSON.parse(JSON.stringify(fileList));
+      const articleImgRes = [];
+      articleImgList.forEach((item) => {
+        if (item.response) {
+          const obj = {
+            file_name: item.response.file_info_list[0].file_name,
+            url: item.response.file_info_list[0].file_url,
+            id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
+            fileID: item.response.file_info_list[0].file_id,
+            file_relative_path: item.response.file_info_list[0].file_relative_path
+          };
+          articleImgRes.push(obj);
+        }
+      });
+      this.curQue.fileList = JSON.parse(JSON.stringify(articleImgRes));
       if (fileList.length > 0) {
-        this.curQue.data = fileList[0]?.response?.file_info_list[0];
+        this.curQue.data = fileList[0]?articleImgRes[0]:fileList[0].file_info_list[0];
         if (this.curQue.data?.file_name.indexOf("pdf") != -1) {
           this.curQue.data.fileRelativePath =
             process.env.VUE_APP_BASE_API + this.curQue.data.file_relative_path;

+ 2 - 0
src/components/Adult/inputModules/VideoControl.vue

@@ -100,6 +100,8 @@ export default {
           this.curQue.definition_list = [];
           this.curQue.definition_list.push(res["480P"]);
           this.curQue.definition_list.push(res["720P"]);
+          this.curQue.definition_list[0].id = "[FID##" + res["480P"].file_id + "##FID]"
+          this.curQue.definition_list[1].id = "[FID##" + res["720P"].file_id + "##FID]"
           // this.loading2.close();
           this.loading2 = false;
         })

+ 0 - 2
src/components/Adult/preview/ArticleViewChs/index.vue

@@ -215,8 +215,6 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     let _this = this;
-    console.log("我是文章预览");
-    console.log(this.curQue);
     if (!this.curQue.Bookanswer) {
       let userAnswer = JSON.parse(JSON.stringify(_this.userAnswer));
       _this.$set(this.curQue, "Bookanswer", userAnswer);

+ 0 - 2
src/components/Adult/preview/DialogueArticleViewChs/AnswerModel.vue

@@ -651,8 +651,6 @@ export default {
         }
       });
       this.resArr = resArr;
-      console.log("Normal");
-      console.log(this.resArr);
 
       // 循环文章图片
       if (curQue.img_list) {

+ 0 - 3
src/components/Adult/preview/DialogueArticleViewChs/index.vue

@@ -239,13 +239,10 @@ export default {
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     let _this = this;
-    console.log(_this.TaskModel);
     if (!_this.curQue.Bookanswer) {
       let userAnswer = JSON.parse(JSON.stringify(_this.userAnswer));
       _this.$set(this.curQue, "Bookanswer", userAnswer);
     }
-    console.log("我是文章预览");
-    console.log(this.curQue);
     if (_this.curQue) {
       _this.$nextTick(() => {
         _this.bodyLeft =

+ 12 - 6
src/components/Adult/preview/SentenceInput.vue

@@ -89,23 +89,23 @@
                 :key="conIndex + 'con'"
               >
                 <template v-if="items.detail.pyPosition == 'top'">
-                  <!-- <div
+                  <div
                     v-if="conent.pinyin == '__'"
                     contenteditable="true"
                     class="input pinyin"
                     v-html="answerList[indexs].pinyin"
                     @change="changeAnswerList($event, indexs, 'pinyin')"
-                  ></div> -->
+                  ></div>
                   <!-- 
                     v-model="answerList[indexs].pinyin"
                    -->
-                  <p class="pinyin" v-if="conent.pinyin&&conent.pinyin.indexOf('__')==-1">
+                  <p class="pinyin" :class="[conent.pinyin.indexOf('__')>-1?'pinyin-opacity':'']" v-if="conent.pinyin">
                     {{ conent.pinyin }}
                   </p>
                 </template>
                 <template v-if="conent.chs.indexOf('__')>-1">
-                    {{items.detail.resArr[conIndex].inputNumber}}
-                  <!-- <EditDiv class="input chs" v-model='curQue.Bookanswer[indexs].answerList[items.detail.resArr[conIndex].inputNumber].chs' :canEdit="TaskModel=='ANSWER'?false:true"></EditDiv> -->
+                    <!-- {{items.detail.resArr[conIndex].inputNumber}} -->
+                  <EditDiv class="input chs" v-model='curQue.Bookanswer[indexs].answerList[items.detail.resArr[conIndex].inputNumber].chs' :canEdit="TaskModel=='ANSWER'?false:true"></EditDiv>
                   <!-- <el-input
                     class="input chs"
                     type="textarea"
@@ -132,7 +132,7 @@
                     v-html="answerList[indexs].pinyin"
                     @change="changeAnswerList($event, indexs, 'pinyin')"
                   ></div> -->
-                  <p class="pinyin" v-if="conent.pinyin.indexOf('__')==-1">
+                  <p class="pinyin" :class="[conent.pinyin.indexOf('__')>-1?'pinyin-opacity':'']" v-if="conent.pinyin">
                     {{ conent.pinyin }}
                   </p>
                 </template>
@@ -175,6 +175,7 @@
               :TaskModel="TaskModel"
               type="normal"
               v-if="items.IsRecord"
+              :style="{marginLeft:'8px'}"
             />
           </template>
           <template v-else>
@@ -186,6 +187,7 @@
               type="mini"
               class="luyin-box"
               v-if="items.IsRecord"
+              :style="{marginLeft:'8px'}"
             />
           </template>
         </template>
@@ -286,6 +288,7 @@ export default {
         });
         this.$set(_this.curQue.option[dIndex].detail, "resArr", paraArr);
       });
+        console.log(_this.curQue.option)
     },
     //词和标点合一起
     mergeWordSymbol(sItem, wItem, curIndex) {
@@ -425,6 +428,9 @@ export default {
             line-height: 130%;
             color: rgba(0, 0, 0, 0.6);
             margin-top: 8px;
+            &-opacity{
+                opacity: 0;
+            }
           }
           .chs {
             font-family: "FZJCGFKTK";

+ 1 - 1
src/components/Adult/preview/Single.vue

@@ -7,7 +7,7 @@
             <p v-if="itemI.topic.con" :class="[/^[\u4e00-\u9fa5]/.test(itemI.topic.con)?'hasCn':'']">{{itemI.topic.con}}</p>
             <Audio
                 :mp3="
-                itemI.topic.mp3_list.length > 0 ? itemI.topic.mp3_list[0].url : ''"
+                itemI.topic.mp3_list.length > 0 ? itemI.topic.mp3_list[0].id : ''"
                 :themeColor="themeColor"
                 class="audio-play"
             />

+ 0 - 1
src/components/Adult/preview/Soundrecord.vue

@@ -195,7 +195,6 @@ export default {
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
     let _this = this;
-    console.log(_this.answerRecordList);
     _this.recordList = _this.answerRecordList
       ? JSON.parse(JSON.stringify(_this.answerRecordList))
       : [];

+ 1 - 1
src/components/Adult/preview/UploadControlView.vue

@@ -45,7 +45,7 @@
               curQue.data.file_name.indexOf('jpeg') != -1
             "
           >
-            <img :src="curQue.data.file_url" alt="" />
+            <img :src="curQue.data.id" alt="" />
           </template>
           <template
             v-else-if="curQue.Bookanswer.file_name.indexOf('pdf') != -1"

+ 3 - 3
src/components/Adult/preview/VideoControl.vue

@@ -99,7 +99,7 @@ export default {
       autoplay: false,
       volume: 0.5, //视频初始音量大小
       loop: false, //是否循环播放
-      url: _this.curQue.definition_list[0].file_url,
+      url: _this.curQue.definition_list[0].id,
       poster:
         _this.curQue.img_list.length > 0 ? _this.curQue.img_list[0].id : "", //视频封面
       height: "100%",
@@ -109,8 +109,8 @@ export default {
     // 设置清晰度
     _this.player.emit("resourceReady", [
       { name: "高清", url: _this.curQue.video_list[0].id },
-      { name: "标清", url: _this.curQue.definition_list[1].file_url },
-      { name: "流畅", url: _this.curQue.definition_list[0].file_url },
+      { name: "标清", url: _this.curQue.definition_list[1].id },
+      { name: "流畅", url: _this.curQue.definition_list[0].id },
     ]);
     setTimeout(() => {
       let name = document.getElementsByClassName("name")[0];

+ 32 - 1
src/views/adultInput.vue

@@ -118,7 +118,7 @@
           v-for="(topic, toindex) in question_list.cur_fn_data"
           :key="'topic' + toindex"
         >
-          <p>第{{ toindex + 1 }}题</p>
+          <div style="display:flex;align-items:center;"><p>第{{ toindex + 1 }}题</p> <el-checkbox v-model="groupIndexList" :label="toindex" style="margin:0 10px;"><br/></el-checkbox><span>{{topic.group_name}}</span></div>
           <div class="adult-book-input-item">
             <span class="adult-book-lable">序号:</span>
             <el-input
@@ -757,6 +757,7 @@
         <!-- </el-tabs> -->
       </div>
       <div v-if="currentTreeID" class="Book-function">
+        <el-button type="success" @click="handleSetGroup" size="medium">设置分组</el-button>
         <ul class="function-list">
           <li
             v-for="(item, index) in fn_data"
@@ -1055,6 +1056,7 @@ export default {
         "⑳",
       ],
       TaskModel: "",
+      groupIndexList:[]
     };
   },
   computed: {
@@ -1233,6 +1235,7 @@ export default {
     },
     createTable() {
       if (this.row && this.line) {
+        let groupid = (new Date().toLocaleString().replace(/\s|:|\/*/g,"")+new Date().getMilliseconds()+Math.random().toString(36).substr(2)+new Date().getMilliseconds()+Math.random().toString(36).substr(2)).substring(0,32)
         let arr = {
           z_title: "",
           f_title: "",
@@ -1242,6 +1245,8 @@ export default {
           is_layout: false, // 是不是按背景图布局
           is_textIndex: false,
           table_list: [],
+          group_name:'', // 设置分组name
+          group_id: [groupid], // 分组id
         };
         for (let i = 0; i < this.row; i++) {
           let rowArr = [];
@@ -1316,6 +1321,13 @@ export default {
             ? JSON.parse(res.content)
             : JSON.parse(JSON.stringify(this.org_question_list));
           let data = JSON.parse(JSON.stringify(this.question_list));
+          data.cur_fn_data.forEach((item) => {
+            if(!item.group_id){
+                let groupid = (new Date().toLocaleString().replace(/\s|:|\/*/g,"")+new Date().getMilliseconds()+Math.random().toString(36).substr(2)+new Date().getMilliseconds()+Math.random().toString(36).substr(2)).substring(0,32)
+                item.group_name = '' // 设置分组name
+                item.group_id = [groupid] // 分组id
+            }
+          })
           data.detailList.forEach((item) => {
             if (!item.detail) {
               let obj = JSON.parse(JSON.stringify(item));
@@ -1701,6 +1713,23 @@ export default {
     emptyQustion() {
       this.currentTreeID = "";
     },
+    // 设置分组
+    handleSetGroup(){
+        let groupname = ''
+        let groupid = (new Date().toLocaleString().replace(/\s|:|\/*/g,"")+new Date().getMilliseconds()+Math.random().toString(36).substr(2)+new Date().getMilliseconds()+Math.random().toString(36).substr(2)).substring(0,32)
+        this.groupIndexList.forEach(item=>{
+            groupname += item+1+'-'
+        })
+        groupname = groupname.substring(0,groupname.length-1)
+        this.question_list.cur_fn_data.forEach((curItem,indexItem) => {
+            if(this.groupIndexList.indexOf(indexItem)>-1){
+                curItem.group_name = '打包组' + groupname
+                curItem.group_id = [groupid]
+            }
+        });
+        this.groupIndexList = []
+        this.$forceUpdate()
+    },
   }, // 如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
@@ -1815,8 +1844,10 @@ export default {
     padding: 30px 16px;
     height: 859px;
     overflow-y: auto;
+    text-align: center;
     .function-list {
       width: 100%;
+      margin-top: 5px;
       > li {
         width: 100%;
         width: 172px;