natasha 1 anno fa
parent
commit
a42a35e50f

+ 1 - 1
src/components/Adult/Preview.vue

@@ -1191,7 +1191,7 @@ export default {
   },
   // 生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    console.log("2024-01-16 17:22");
+    console.log("2024-04-02 17:22");
   },
   // 生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {

+ 4 - 1
src/components/Adult/preview/ArticleViewChs/index.vue

@@ -431,7 +431,10 @@ export default {
               endIndex: endIndex,
               leg: wItem.chs.length,
               timeList: [],
-              words: words
+              words: words,
+              config: {
+                fontFamily: wItem.fontFamily
+              }
             };
             sentArr.push(obj);
             if (wItem.pinyin) dhaspinyin = true;

+ 4 - 1
src/components/Adult/preview/DialogueArticleViewChs/index.vue

@@ -468,7 +468,10 @@ export default {
               endIndex: endIndex,
               leg: wItem.chs.length,
               timeList: [],
-              words: words
+              words: words,
+              config: {
+                fontFamily: wItem.fontFamily
+              }
             };
             sentArr.push(obj);
             if (wItem.pinyin) dhaspinyin = true;

+ 34 - 6
src/components/Adult/preview/Voicefullscreen.vue

@@ -245,6 +245,9 @@
                           pItem.padding && config.isShowPY ? 'padding' : '',
                           curQue.pyPosition == 'top' ? 'bottom' : ''
                         ]"
+                        :style="{
+                          height: hzSize * 1.17 + 'px'
+                        }"
                       >
                         <template>
                           <span
@@ -275,7 +278,10 @@
                             ]"
                             :style="{
                               fontSize: hzSize + 'px',
-                              fontFamily: pItem.config.fontFamily,
+                              fontFamily:
+                                pItem.config && pItem.config.fontFamily
+                                  ? pItem.config.fontFamily
+                                  : '',
                               height: hzSize * 1.17 + 'px',
                               display: 'inline-block'
                             }"
@@ -324,7 +330,11 @@
                           'NNPE-chs',
                           curQue.pyPosition == 'top' ? 'bottom' : ''
                         ]"
-                        :style="{ fontSize: hzSize + 'px', textAlign: left }"
+                        :style="{
+                          fontSize: hzSize + 'px',
+                          textAlign: left,
+                          height: hzSize * 1.17 + 'px'
+                        }"
                       >
                         <span
                           :class="[
@@ -348,7 +358,11 @@
                           ]"
                           :style="{
                             fontSize: hzSize + 'px',
-                            fontFamily: item[pIndex + 1].config.fontFamily,
+                            fontFamily:
+                              item[pIndex + 1].config &&
+                              item[pIndex + 1].config.fontFamily
+                                ? item[pIndex + 1].config.fontFamily
+                                : '',
                             height: hzSize * 1.17 + 'px',
                             display: 'inline-block'
                           }"
@@ -406,7 +420,11 @@
                           'NNPE-chs',
                           curQue.pyPosition == 'top' ? 'bottom' : ''
                         ]"
-                        :style="{ fontSize: hzSize + 'px', textAlign: left }"
+                        :style="{
+                          fontSize: hzSize + 'px',
+                          textAlign: left,
+                          height: hzSize * 1.17 + 'px'
+                        }"
                       >
                         <span
                           :class="[
@@ -430,7 +448,11 @@
                           ]"
                           :style="{
                             fontSize: hzSize + 'px',
-                            fontFamily: item[pIndex + 2].config.fontFamily,
+                            fontFamily:
+                              item[pIndex + 2].config &&
+                              item[pIndex + 2].config.fontFamily
+                                ? item[pIndex + 2].config.fontFamily
+                                : '',
                             height: hzSize * 1.17 + 'px',
                             display: 'inline-block'
                           }"
@@ -487,6 +509,9 @@
                           : '',
                         curQue.pyPosition == 'top' ? 'bottom' : ''
                       ]"
+                      :style="{
+                        height: hzSize * 1.17 + 'px'
+                      }"
                     >
                       <template>
                         <span
@@ -517,7 +542,10 @@
                           ]"
                           :style="{
                             fontSize: hzSize + 'px',
-                            fontFamily: pItem.config.fontFamily,
+                            fontFamily:
+                              pItem.config && pItem.config.fontFamily
+                                ? pItem.config.fontFamily
+                                : '',
                             height: hzSize * 1.17 + 'px',
                             display: 'inline-block'
                           }"

+ 28 - 25
src/components/Adult/preview/components/Freewrite.vue

@@ -80,7 +80,7 @@ export default {
     "wordNum",
     "currentTreeID",
     "TaskModel",
-    "writeList",
+    "writeList"
   ],
   data() {
     return {
@@ -94,14 +94,14 @@ export default {
       saveShow: false,
       tabIndex: 0,
       hasPlay: false,
-      isNotice: false,
+      isNotice: false
     };
   },
   computed: {},
   watch: {
     lineColor(newVal, oldVal) {
       this.updateColor(newVal);
-    },
+    }
   },
   //方法集合
   methods: {
@@ -115,11 +115,11 @@ export default {
         courseware_id: this.currentTreeID,
         hz: hz,
         search_scope: 1,
-        count_limit: 5,
+        count_limit: 5
       };
-      LearnWebSI(MethodName, data).then((res) => {
+      LearnWebSI(MethodName, data).then(res => {
         let imgarr = res.hz_handwritten_record_list;
-        this.imgarr = imgarr.map((item) => {
+        this.imgarr = imgarr.map(item => {
           item.history = JSON.parse(item.strokes_content);
           return item;
         });
@@ -131,7 +131,7 @@ export default {
       let hz =
         this.tabIndex == 0 ? this.cur.stem[0].con : this.cur.stem[0].TChinese;
       let imgarr = JSON.parse(JSON.stringify(this.writeList));
-      this.imgarr = imgarr[hz].map((item) => {
+      this.imgarr = imgarr[hz].map(item => {
         item.history = JSON.parse(item.strokes_content);
         return item;
       });
@@ -141,12 +141,13 @@ export default {
         this.$message.warning("正在播放,不能删除");
         return;
       }
+      if (this.imgIndex === null) return;
       let MethodName = "teaching-practice_manager-DeleteMyHZHandwrittenRecord";
       let data = {
-        hz_handwritten_record_id:
-          this.imgarr[this.imgIndex].hz_handwritten_record_id,
+        hz_handwritten_record_id: this.imgarr[this.imgIndex]
+          .hz_handwritten_record_id
       };
-      LearnWebSI(MethodName, data).then((res) => {
+      LearnWebSI(MethodName, data).then(res => {
         this.$message.success("删除成功");
         this.imgarr.splice(this.imgIndex, 1);
         this.handelReset();
@@ -197,32 +198,34 @@ export default {
         this.tabIndex == 0 ? this.cur.stem[0].con : this.cur.stem[0].TChinese;
       this.$refs.esign
         .generate()
-        .then((res) => {
+        .then(res => {
           let Book_img = res.replace("data:image/png;base64,", "");
           let write_img = "data:image/png;base64," + Book_img;
           let answer = {};
           answer = {
             hz: hz,
             strokes_content: JSON.stringify(this.$refs.esign.history),
-            strokes_image_url: write_img,
+            strokes_image_url: write_img
           };
           this.$emit("saveWriteAnswer", answer);
+          let obj = {
+            hz_handwritten_record_id: "",
+            history: this.$refs.esign.history,
+            strokes_image_url: write_img
+          };
           let data = {
             courseware_id: this.currentTreeID,
             hz: hz,
             strokes_content: JSON.stringify(this.$refs.esign.history),
-            strokes_image_base64: Book_img,
+            strokes_image_base64: Book_img
           };
           let MethodName =
             "teaching-practice_manager-SaveMyHZHandwrittenRecord";
-          LearnWebSI(MethodName, data).then((res) => {
-            this.$message.success("保存成功!");
-            // this.getImgList(this.tabIndex);
-            let obj = {
-              hz_handwritten_record_id: res.hz_handwritten_record_id,
-              history: this.$refs.esign.history,
-              strokes_image_url: write_img,
-            };
+          LearnWebSI(MethodName, data).then(res => {
+            if (res.status === 1) {
+              this.$message.success("保存成功!");
+              obj.hz_handwritten_record_id = res.hz_handwritten_record_id;
+            }
             this.imgarr.push(obj);
             this.saveShow = false;
             this.handelReset();
@@ -230,13 +233,13 @@ export default {
           //console.log(Book_img);
           // this.textOcr(res.replace("data:image/png;base64,", ""));
         })
-        .catch((err) => {
+        .catch(err => {
           this.saveShow = false;
 
           console.log(err);
           this.$message.warning("请先书写在保存");
         });
-    },
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
@@ -250,10 +253,10 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
-<style lang='scss' scoped>
+<style lang="scss" scoped>
 //@import url(); 引入公共css类
 .freewrite {
   position: relative;

+ 11 - 8
src/components/Adult/preview/components/FreewriteLettle.vue

@@ -241,7 +241,11 @@ export default {
             strokes_image_url: write_img
           };
           this.$emit("changeCurQue", answer, this.colIndex);
-
+          let obj = {
+            hz_handwritten_record_id: "",
+            history: this.$refs.esign.history,
+            strokes_image_url: write_img
+          };
           let data = {
             courseware_id: this.currentTreeID,
             hz: this.currentHz,
@@ -251,13 +255,12 @@ export default {
           let MethodName =
             "teaching-practice_manager-SaveMyHZHandwrittenRecord";
           LearnWebSI(MethodName, data).then(res => {
-            this.$message.success("保存成功!");
-            let obj = {
-              hz_handwritten_record_id: res.hz_handwritten_record_id,
-              history: this.$refs.esign.history,
-              strokes_image_url: write_img
-            };
-            // this.imgarr.push(obj);
+            if (res.status === 1) {
+              this.$message.success("保存成功!");
+              obj.hz_handwritten_record_id = res.hz_handwritten_record_id;
+
+              // this.imgarr.push(obj);
+            }
             this.closeifFreeShow(obj, this.rowIndex, this.colIndex);
           });
           //console.log(Book_img);