|
@@ -127,7 +127,10 @@
|
|
v-for="(item, index) in cur.cur_fn_data"
|
|
v-for="(item, index) in cur.cur_fn_data"
|
|
:key="index"
|
|
:key="index"
|
|
class="title-box-preview"
|
|
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
|
|
<div
|
|
v-if="item.number || item.z_title || item.f_title"
|
|
v-if="item.number || item.z_title || item.f_title"
|
|
class="title-big"
|
|
class="title-big"
|
|
@@ -533,6 +536,7 @@
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
+ </template>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div v-if="isShowSave || isShowTitle" class="NNPE-title NNPE-title-gray">
|
|
<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 TableView from "./preview/TableView.vue"; // 视频控件
|
|
import PdfView from "./preview/PdfView.vue"; // 视频控件
|
|
import PdfView from "./preview/PdfView.vue"; // 视频控件
|
|
import SentenceModule from "./preview/SentenceModule.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"; // 选项模板
|
|
import OptionsList from "./preview/OptionsList.vue"; // 选项模板
|
|
|
|
|
|
export default {
|
|
export default {
|
|
- name: "Preview",
|
|
|
|
|
|
+ name: "Booknpc",
|
|
components: {
|
|
components: {
|
|
Picture,
|
|
Picture,
|
|
Record,
|
|
Record,
|
|
@@ -649,6 +653,8 @@ export default {
|
|
"bookAnswerContent",
|
|
"bookAnswerContent",
|
|
"TaskModel",
|
|
"TaskModel",
|
|
"isShowSave",
|
|
"isShowSave",
|
|
|
|
+ "previewType",
|
|
|
|
+ "previewGroupId"
|
|
],
|
|
],
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -692,6 +698,11 @@ export default {
|
|
refresh: true,
|
|
refresh: true,
|
|
preClick: false, // 上一页是否可点
|
|
preClick: false, // 上一页是否可点
|
|
nextClick: false, // 下一页是否可点
|
|
nextClick: false, // 下一页是否可点
|
|
|
|
+ answerTime: 0,
|
|
|
|
+ answerTimeInterval: null, // 计时器
|
|
|
|
+ groupIndexList: [], // 勾选groupid数组
|
|
|
|
+ groupCheckList: [], // checkbox 是否选中
|
|
|
|
+
|
|
};
|
|
};
|
|
},
|
|
},
|
|
computed: {},
|
|
computed: {},
|
|
@@ -805,6 +816,9 @@ export default {
|
|
_this.NNPENewPhraseList = [];
|
|
_this.NNPENewPhraseList = [];
|
|
_this.NNPEAnnotationList = [];
|
|
_this.NNPEAnnotationList = [];
|
|
_this.watchIndex = _this.queIndex + new Date().getTime();
|
|
_this.watchIndex = _this.queIndex + new Date().getTime();
|
|
|
|
+ this.groupCheckList = []
|
|
|
|
+ let selectGropuIdList = this.previewGroupId?JSON.parse(this.previewGroupId):[]
|
|
|
|
+ this.groupCheckList = []
|
|
if (_this.contextData) {
|
|
if (_this.contextData) {
|
|
// const list = _this.contextData;
|
|
// const list = _this.contextData;
|
|
// if (list && list.length > 0) {
|
|
// if (list && list.length > 0) {
|
|
@@ -829,6 +843,14 @@ export default {
|
|
// }
|
|
// }
|
|
_this.cur = _this.contextData;
|
|
_this.cur = _this.contextData;
|
|
_this.cur.cur_fn_data.forEach((item, index) => {
|
|
_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) => {
|
|
item.table_list.forEach((items, indexs) => {
|
|
items.forEach((itemss, indexss) => {
|
|
items.forEach((itemss, indexss) => {
|
|
if (itemss.data && itemss.data.type == "NewWord_chs") {
|
|
if (itemss.data && itemss.data.type == "NewWord_chs") {
|
|
@@ -937,6 +959,7 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
submitUserAnswerNPC() {
|
|
submitUserAnswerNPC() {
|
|
|
|
+ this.handleAnswerTimeEnd();
|
|
let contextData = JSON.parse(JSON.stringify(this.contextData));
|
|
let contextData = JSON.parse(JSON.stringify(this.contextData));
|
|
let result = [];
|
|
let result = [];
|
|
contextData.cur_fn_data.forEach((item, index) => {
|
|
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缓存功能,这个函数会触发
|
|
}, // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|
|
@@ -1131,6 +1192,14 @@ export default {
|
|
}
|
|
}
|
|
.NNPE-Book-content-inner {
|
|
.NNPE-Book-content-inner {
|
|
padding: 0 40px;
|
|
padding: 0 40px;
|
|
|
|
+ .NNPE-Book-content-item{
|
|
|
|
+ position: relative;
|
|
|
|
+ }
|
|
|
|
+ .NNPE-Book-content-item-checkbox{
|
|
|
|
+ position: absolute;
|
|
|
|
+ left: -20px;
|
|
|
|
+ top: 36px;
|
|
|
|
+ }
|
|
> div.title-box-preview {
|
|
> div.title-box-preview {
|
|
padding-top: 32px;
|
|
padding-top: 32px;
|
|
.title-big {
|
|
.title-big {
|