|
@@ -1,25 +1,25 @@
|
|
<template>
|
|
<template>
|
|
<div class="container">
|
|
<div class="container">
|
|
<Header />
|
|
<Header />
|
|
- <!-- <Nav nav-value="书籍预览" /> -->
|
|
|
|
<div class="content">
|
|
<div class="content">
|
|
<div id="content-tree" class="content-tree">
|
|
<div id="content-tree" class="content-tree">
|
|
- <!-- <TreeView ref="treeView" :book-id="bookId" :change-id="changeId" /> -->
|
|
|
|
|
|
+ <TreeView
|
|
|
|
+ ref="treeView"
|
|
|
|
+ :book-id="bookId"
|
|
|
|
+ :change-id="changeId"
|
|
|
|
+ :changeTreeData="changeTreeData"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
<div id="data-screen" class="inner">
|
|
<div id="data-screen" class="inner">
|
|
<!-- 显示答案按钮 -->
|
|
<!-- 显示答案按钮 -->
|
|
- <a
|
|
|
|
- v-if="chapterId"
|
|
|
|
- :class="['answerShow', isAnswerShow ? 'answerShowTrue' : '']"
|
|
|
|
- @click="handleAnswerShow"
|
|
|
|
- >显示答案</a>
|
|
|
|
|
|
+ <!-- <a v-if="chapterId" :class="['answerShow',isAnswerShow?'answerShowTrue':'']" @click="handleAnswerShow">显示答案</a> -->
|
|
<!-- <a class="edit-btn" @click="handleEdit">编辑</a> -->
|
|
<!-- <a class="edit-btn" @click="handleEdit">编辑</a> -->
|
|
<div v-if="chapterId" class="title-box">
|
|
<div v-if="chapterId" class="title-box">
|
|
<img
|
|
<img
|
|
v-if="!treeFlag"
|
|
v-if="!treeFlag"
|
|
src="../assets/common/icon-treelist.png"
|
|
src="../assets/common/icon-treelist.png"
|
|
@click="treeShow"
|
|
@click="treeShow"
|
|
- >
|
|
|
|
|
|
+ />
|
|
<h2 class="title">{{ chapterName }}</h2>
|
|
<h2 class="title">{{ chapterName }}</h2>
|
|
<el-switch
|
|
<el-switch
|
|
v-if="!treeFlag"
|
|
v-if="!treeFlag"
|
|
@@ -29,38 +29,36 @@
|
|
inactive-text="生词模式"
|
|
inactive-text="生词模式"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
- <!-- <Preview
|
|
|
|
- v-if="chapterId && context"
|
|
|
|
- ref="previewAnswer"
|
|
|
|
|
|
+ <Preview
|
|
:context="context"
|
|
:context="context"
|
|
- :bookAnswerContent="bookAnswerContent"
|
|
|
|
- bookclientwidth="900"
|
|
|
|
- :TaskModel="TaskModel"
|
|
|
|
- @handleBookUserAnswer="handleBookUserAnswer"
|
|
|
|
- /> -->
|
|
|
|
|
|
+ :que-index="queIndex"
|
|
|
|
+ :currentTreeID="chapterId"
|
|
|
|
+ :FatherTreeData="FatherTreeData"
|
|
|
|
+ :change-id="changeId"
|
|
|
|
+ :themeColor="themeColor"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
|
|
+ <a
|
|
|
|
+ v-if="chapterId && treeFlag"
|
|
|
|
+ class="screen-full"
|
|
|
|
+ @click="fullScreen()"
|
|
|
|
+ />
|
|
</div>
|
|
</div>
|
|
- <!-- <Preview :context="context" :queIndex="queIndex" /> -->
|
|
|
|
-
|
|
|
|
- <a v-if="chapterId && treeFlag" class="screen-full" @click="fullScreen()" />
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-// import Header from '@/components/inputModules/common/Header'
|
|
|
|
-// import Nav from '@/components/inputModules/common/Nav'
|
|
|
|
-// import TreeView from '@/components/inputModules/common/TreeView'
|
|
|
|
|
|
+import Header from "@/components/Header.vue";
|
|
|
|
+import TreeView from "@/components/TreeView";
|
|
import { getContent } from "@/api/ajax";
|
|
import { getContent } from "@/api/ajax";
|
|
import Cookies from "js-cookie";
|
|
import Cookies from "js-cookie";
|
|
-// import Preview from '@/componentsAnswer/PreviewAnswer.vue'
|
|
|
|
-// import Preview from '@/components/Preview'
|
|
|
|
|
|
+import Preview from "@/components/Adult/Preview.vue";
|
|
export default {
|
|
export default {
|
|
name: "CourseView",
|
|
name: "CourseView",
|
|
components: {
|
|
components: {
|
|
- // Header,
|
|
|
|
- // Nav,
|
|
|
|
- // TreeView,
|
|
|
|
- // Preview
|
|
|
|
|
|
+ Header,
|
|
|
|
+ TreeView,
|
|
|
|
+ Preview,
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
return {
|
|
return {
|
|
@@ -74,10 +72,11 @@ export default {
|
|
treeFlag: true, // tree是否显示
|
|
treeFlag: true, // tree是否显示
|
|
switchvalue: true, // 生词模式
|
|
switchvalue: true, // 生词模式
|
|
isAnswerShow: false, // 是否显示答案
|
|
isAnswerShow: false, // 是否显示答案
|
|
- bookAnswerContent: localStorage.getItem("exam_answer")
|
|
|
|
- ? localStorage.getItem("exam_answer")
|
|
|
|
- : "[]",
|
|
|
|
|
|
+ bookAnswerContent: "[[6],[],[9]]",
|
|
TaskModel: "Task",
|
|
TaskModel: "Task",
|
|
|
|
+ category: "",
|
|
|
|
+ FatherTreeData: null,
|
|
|
|
+ themeColor: "",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
created() {
|
|
created() {
|
|
@@ -85,6 +84,9 @@ export default {
|
|
_this.bookId = this.$route.query.bookId;
|
|
_this.bookId = this.$route.query.bookId;
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
|
|
+ changeTreeData(val) {
|
|
|
|
+ this.FatherTreeData = JSON.parse(JSON.stringify(val));
|
|
|
|
+ },
|
|
changeId(id, name) {
|
|
changeId(id, name) {
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.chapterId = id;
|
|
_this.chapterId = id;
|
|
@@ -108,17 +110,23 @@ export default {
|
|
const data = {
|
|
const data = {
|
|
id: _this.chapterId,
|
|
id: _this.chapterId,
|
|
};
|
|
};
|
|
- getContent(MethodName, data).then(res => {
|
|
|
|
|
|
+ getContent(MethodName, data).then((res) => {
|
|
|
|
+ this.category = res.category;
|
|
|
|
+ this.themeColor = res.book_theme_color;
|
|
if (res.content) {
|
|
if (res.content) {
|
|
const _this = this;
|
|
const _this = this;
|
|
- _this.context = {
|
|
|
|
- id: _this.chapterId,
|
|
|
|
- ui_type: JSON.parse(res.content).question
|
|
|
|
- ? JSON.parse(res.content).question.ui_type
|
|
|
|
- : "",
|
|
|
|
- sort_number: 1,
|
|
|
|
- content: JSON.parse(res.content),
|
|
|
|
- };
|
|
|
|
|
|
+ if (!this.category || this.category == "oc") {
|
|
|
|
+ _this.context = {
|
|
|
|
+ id: _this.chapterId,
|
|
|
|
+ ui_type: JSON.parse(res.content).question
|
|
|
|
+ ? JSON.parse(res.content).question.ui_type
|
|
|
|
+ : "",
|
|
|
|
+ sort_number: 1,
|
|
|
|
+ content: JSON.parse(res.content),
|
|
|
|
+ };
|
|
|
|
+ } else if (this.category == "NPC") {
|
|
|
|
+ _this.context = JSON.parse(res.content);
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.context = null;
|
|
_this.context = null;
|
|
@@ -133,7 +141,7 @@ export default {
|
|
Cookies.set("bookLevel", index[1]);
|
|
Cookies.set("bookLevel", index[1]);
|
|
Cookies.set("bookNodename", index[2]);
|
|
Cookies.set("bookNodename", index[2]);
|
|
}
|
|
}
|
|
- this.$router.push("/adultInput?bookId=" + this.bookId);
|
|
|
|
|
|
+ this.$router.push("/input?bookId=" + this.bookId);
|
|
},
|
|
},
|
|
// 显示或隐藏答案
|
|
// 显示或隐藏答案
|
|
handleAnswerShow() {
|
|
handleAnswerShow() {
|