gcj 3 سال پیش
والد
کامیت
aa5428b8fd
4فایلهای تغییر یافته به همراه74 افزوده شده و 41 حذف شده
  1. 1 1
      package.json
  2. 21 6
      src/views/bookView.vue
  3. 50 32
      src/views/courseView.vue
  4. 2 2
      vue.config.js

+ 1 - 1
package.json

@@ -17,7 +17,7 @@
     "@tinymce/tinymce-vue": "^3.2.8",
     "awe-dnd": "^0.3.4",
     "axios": "0.18.1",
-    "book-ui": "file:../book-ui-0.2.38.tgz",
+    "book-ui": "file:../GCLS-Book-question-ui/book-ui-0.3.0.tgz",
     "cnchar": "^3.0.1",
     "cnchar-all": "^3.0.1",
     "cnchar-order": "^3.0.1",

+ 21 - 6
src/views/bookView.vue

@@ -16,7 +16,11 @@
           />
         </div>
       </div>
-      <div id="data-screen" class="inner" v-if="chapterFree=='true'||bookIsBuy=='true'">
+      <div
+        id="data-screen"
+        class="inner"
+        v-if="chapterFree == 'true' || bookIsBuy == 'true'"
+      >
         <!-- 显示答案按钮 -->
         <!-- <a v-if="chapterId" :class="['answerShow',isAnswerShow?'answerShowTrue':'']" @click="handleAnswerShow">显示答案</a> -->
         <!-- <a class="edit-btn" @click="handleEdit">编辑</a> -->
@@ -79,6 +83,18 @@
             :isShowTitle="true"
           />
         </template>
+        <template v-if="category == 'RLC'">
+          <Bookrlc
+            v-if="chapterId && context"
+            ref="previewAnswer"
+            :context="context"
+            :currentTreeID="chapterId"
+            :FatherTreeData="FatherTreeData"
+            :change-id="changeId"
+            :themeColor="themeColor"
+            :isShowTitle="true"
+          />
+        </template>
       </div>
       <a
         v-if="chapterId && treeFlag"
@@ -120,7 +136,7 @@ export default {
       category: "",
       FatherTreeData: null,
       themeColor: "",
-      chapterFree: 'false', // 课件免费观看
+      chapterFree: "false", // 课件免费观看
     };
   },
   mounted() {
@@ -129,7 +145,8 @@ export default {
   },
   methods: {
     changeTreeData(val) {
-      this.FatherTreeData = val!=undefined?JSON.parse(JSON.stringify(val)):null;
+      this.FatherTreeData =
+        val != undefined ? JSON.parse(JSON.stringify(val)) : null;
     },
     changeId(id, name, free) {
       // if (
@@ -194,9 +211,7 @@ export default {
               sort_number: 1,
               content: JSON.parse(res.content),
             };
-          } else if (this.category == "NPC") {
-            _this.context = JSON.parse(res.content);
-          } else if (this.category == "NNPE") {
+          } else {
             _this.context = JSON.parse(res.content);
           }
         } else {

+ 50 - 32
src/views/courseView.vue

@@ -96,6 +96,18 @@
             :isShowTitle="true"
           />
         </template>
+        <template v-if="category == 'RLC'">
+          <Bookrlc
+            v-if="chapterId && context"
+            ref="previewAnswerNNPE"
+            :context="context"
+            :currentTreeID="chapterId"
+            :FatherTreeData="FatherTreeData"
+            :change-id="changeId"
+            :themeColor="themeColor"
+            :isShowTitle="true"
+          />
+        </template>
       </div>
     </div>
     <!-- <Preview :context="context" :queIndex="queIndex" /> -->
@@ -114,22 +126,23 @@ import Cookies from "js-cookie";
 import Preview from "@/components/Preview";
 export default {
   name: "CourseView",
-  directives:{
-      move(el,bindings){
-          el.onmousedown = function(e){
-              var init = e.clientX;
-              var parent = document.getElementById("content-tree")
-              var initWidth = parent.offsetWidth;
-              document.onmousemove = function(e){
-                  var end = e.clientX;
-                  var newWidth = end - init + initWidth;
-                  if(newWidth>=340&&newWidth<=680)  parent.style.width = newWidth + "px";
-              }
-              document.onmouseup = function(){
-                  document.onmousemove = document.onmouseup = null
-              }
-          }
-      }
+  directives: {
+    move(el, bindings) {
+      el.onmousedown = function (e) {
+        var init = e.clientX;
+        var parent = document.getElementById("content-tree");
+        var initWidth = parent.offsetWidth;
+        document.onmousemove = function (e) {
+          var end = e.clientX;
+          var newWidth = end - init + initWidth;
+          if (newWidth >= 340 && newWidth <= 680)
+            parent.style.width = newWidth + "px";
+        };
+        document.onmouseup = function () {
+          document.onmousemove = document.onmouseup = null;
+        };
+      };
+    },
   },
   components: {
     Header,
@@ -150,7 +163,7 @@ export default {
       treeFlag: true, // tree是否显示
       switchvalue: true, // 生词模式
       isAnswerShow: false, // 是否显示答案
-      bookAnswerContent: '',
+      bookAnswerContent: "",
       TaskModel: "",
       category: "",
       FatherTreeData: null,
@@ -199,6 +212,14 @@ export default {
           name: "新航标职业英语 综合英语(基础级)学生用书2(修订版)",
           id: "002-20220208-09-FDKUJJSLI8",
         },
+        {
+          name: "轻松学中文. 课本 .第1册",
+          id: "002-20220312-11-HK93JKDAGR",
+        },
+        {
+          name: "轻松学中文. 课本. 第2册",
+          id: "001-20220312-11-WU8XCRQMDB",
+        },
       ],
     };
   },
@@ -213,8 +234,7 @@ export default {
       }
     });
   },
-  mounted(){
-  },
+  mounted() {},
   methods: {
     back() {
       this.$router.go(-1);
@@ -268,9 +288,7 @@ export default {
               sort_number: 1,
               content: JSON.parse(res.content),
             };
-          } else if (this.category == "NPC") {
-            _this.context = JSON.parse(res.content);
-          } else if (this.category == "NNPE") {
+          } else {
             _this.context = JSON.parse(res.content);
           }
         } else {
@@ -311,7 +329,7 @@ export default {
     finishTaskMaterial(data, duration) {
       console.log("保存答案:");
       console.log(data);
-      console.log(duration)
+      console.log(duration);
     },
   },
 };
@@ -359,16 +377,16 @@ export default {
       box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.25);
       border-radius: 4px;
     }
-    #content-tree{
-        position: relative;
+    #content-tree {
+      position: relative;
     }
-    .moveBtn-nnpe{
-        position: absolute;
-        height: 100%;
-        width: 10px;
-        right: 0;
-        top: 0;
-        cursor: col-resize;
+    .moveBtn-nnpe {
+      position: absolute;
+      height: 100%;
+      width: 10px;
+      right: 0;
+      top: 0;
+      cursor: col-resize;
     }
     .inner {
       // border-left: 1px solid #d9d9d9;

+ 2 - 2
vue.config.js

@@ -43,8 +43,8 @@ module.exports = {
       // change xxx-api/login => mock/login
       // detail: https://cli.vuejs.org/config/#devserver-proxy
       [process.env.VUE_APP_BASE_API]: {
-        // target: `http://gcls.utschool.cn/`,
-        target: `https://gcls.helxsoft.cn/`,
+        target: `http://gcls.utschool.cn/`,
+        //target: `https://gcls.helxsoft.cn/`,
         changeOrigin: true,
         pathRewrite: {
           ['^' + process.env.VUE_APP_BASE_API]: ''