natasha 4 giorni fa
parent
commit
f96ff450f4
1 ha cambiato i file con 77 aggiunte e 7 eliminazioni
  1. 77 7
      src/views/bookShelf/components/PrintModel.vue

+ 77 - 7
src/views/bookShelf/components/PrintModel.vue

@@ -130,7 +130,7 @@
                 : ""
             }}
           </h6>
-          <template v-if="resArr.length > 0">
+          <template v-if="resArr.length > 0 && articleInfo.en_flag">
             <div class="table-box">
               <div
                 :class="['NNPE-detail']"
@@ -254,6 +254,16 @@
               </div>
             </div>
           </template>
+          <div
+            v-else
+            class="cn-content"
+            v-html="articleInfo.art_content"
+            :style="{
+              color: printForm.color,
+              fontSize: printForm.fontSize + 'px',
+              lineHeight: printForm.lineHeight,
+            }"
+          ></div>
           <template v-if="printForm.range.indexOf('vocab') > -1">
             <h5>词表</h5>
             <ul class="newwordlist">
@@ -314,10 +324,20 @@
                 </div>
               </li>
             </ul>
-            <h5 v-if="articleInfo.art_phrase_data.length > 0">短语</h5>
+            <h5
+              v-if="
+                articleInfo.art_phrase_data &&
+                articleInfo.art_phrase_data.length > 0
+              "
+            >
+              短语
+            </h5>
             <ul
               class="phraselist"
-              v-if="articleInfo.art_phrase_data.length > 0"
+              v-if="
+                articleInfo.art_phrase_data &&
+                articleInfo.art_phrase_data.length > 0
+              "
             >
               <li v-for="(itemW, indexW) in phraseList" :key="indexW">
                 <div class="word-info">
@@ -341,8 +361,21 @@
                 </div>
               </li>
             </ul>
-            <h5 v-if="articleInfo.art_explain_data.length > 0">注释</h5>
-            <ul class="explainlist">
+            <h5
+              v-if="
+                articleInfo.art_explain_data &&
+                articleInfo.art_explain_data.length > 0
+              "
+            >
+              注释
+            </h5>
+            <ul
+              class="explainlist"
+              v-if="
+                articleInfo.art_explain_data &&
+                articleInfo.art_explain_data.length > 0
+              "
+            >
               <li
                 v-for="(itemW, indexW) in articleInfo.art_explain_data"
                 :key="indexW"
@@ -453,7 +486,7 @@
               >
             </el-checkbox-group>
           </div>
-          <div class="item-page">
+          <div class="item-page" v-if="articleInfo.en_flag">
             <label>加粗显示:</label>
             <el-checkbox-group v-model="printForm.bold">
               <el-checkbox
@@ -712,6 +745,43 @@ export default {
       printNumber: 0,
     };
   },
+  created() {
+    if (this.articleInfo.en_flag) {
+      this.rangeList = [
+        {
+          value: "image",
+          name: "图片",
+        },
+        {
+          value: "vocab",
+          name: "词表",
+        },
+        {
+          value: "ciyun",
+          name: "词云",
+        },
+        {
+          value: "notes",
+          name: "笔记",
+        },
+      ];
+    } else {
+      this.rangeList = [
+        {
+          value: "vocab",
+          name: "词表",
+        },
+        {
+          value: "ciyun",
+          name: "词云",
+        },
+        {
+          value: "notes",
+          name: "笔记",
+        },
+      ];
+    }
+  },
   methods: {
     goBack() {
       this.$emit("closePrint");
@@ -967,7 +1037,7 @@ export default {
               this.isPrint = true;
               const element = document.getElementById("showWaterMark");
               const opt = {
-                margin: [2.5, 0, 5.1, 0],
+                margin: [0, 0, 0, 0],
                 useCORS: true,
                 filename: "二十一世纪英语智慧阅读平台.pdf",
                 image: { type: "jpeg", quality: 0.98 },