natasha 8 months ago
parent
commit
3dc22c631f

BIN
src/common/font/Cambria Math.ttf


+ 6 - 0
src/common/font/font.css

@@ -49,4 +49,10 @@
 @font-face {
   font-family: 'NotoSansSC';
   src: url('NotoSansSC-VariableFont_wght.ttf');
+}
+
+/* 方式字体 */
+@font-face {
+  font-family: 'math';
+  src: url('Cambria\ Math.ttf');
 }

+ 4 - 0
src/components/Adult/common/SegwordConfig.vue

@@ -224,6 +224,10 @@ export default {
           value:
             "Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif, alabo",
           name: "系统字体"
+        },
+        {
+          value: "math",
+          name: "公式字体"
         }
       ]
     };

+ 4 - 0
src/components/Adult/common/SentenceSegTemp.vue

@@ -287,6 +287,10 @@ export default {
           value:
             "Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif, alabo",
           name: "系统字体"
+        },
+        {
+          value: "math",
+          name: "公式字体"
         }
       ],
       configVisible: false,

+ 4 - 0
src/components/Adult/inputModules/ArticleTemChs/components/SegbywordChs.vue

@@ -240,6 +240,10 @@ export default {
           value:
             "Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif, alabo",
           name: "系统字体"
+        },
+        {
+          value: "math",
+          name: "公式字体"
         }
       ]
     };

+ 4 - 0
src/components/Adult/inputModules/DialogueArticleChs/components/SegbywordChs.vue

@@ -228,6 +228,10 @@ export default {
           value:
             "Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, sans-serif, alabo",
           name: "系统字体"
+        },
+        {
+          value: "math",
+          name: "公式字体"
         }
       ]
     };

+ 94 - 88
src/components/Adult/inputModules/PurePreview.vue

@@ -351,7 +351,12 @@
 <script>
 import Upload from "../common/Upload";
 import SentenceSegwordChs from "../common/SentenceSegwordChs/index.vue";
-import { getWordTime, getContentFile, prepareTranscribe, compareSenTenceTime } from "@/api/ajax";
+import {
+  getWordTime,
+  getContentFile,
+  prepareTranscribe,
+  compareSenTenceTime
+} from "@/api/ajax";
 import CompareTime from "./ArticleTemChs/components/CompareTime.vue";
 export default {
   name: "PurePreview",
@@ -359,7 +364,7 @@ export default {
   components: {
     SentenceSegwordChs,
     Upload,
-    CompareTime,
+    CompareTime
   },
   data() {
     return {
@@ -367,11 +372,11 @@ export default {
       mp3Number: 1,
       list: [
         {
-          con: "临摹",
+          con: "临摹"
         },
         {
-          con: "描红",
-        },
+          con: "描红"
+        }
       ],
       form: {
         stem: {
@@ -381,8 +386,8 @@ export default {
           highlight: "",
           underline: "",
           img_url: [],
-          mp3_url: [],
-        },
+          mp3_url: []
+        }
       },
       data_structure: {
         type: "text_problem_chs",
@@ -398,13 +403,13 @@ export default {
               sentence: "", //句子
               segList: [], //分词结果
               seg_words: "",
-              wordsList: [],
+              wordsList: []
             },
             en: "", //英文
             answer: [""],
-            judge: true,
-          },
-        ],
+            judge: true
+          }
+        ]
       },
       data_structure2: {
         type: "newWord_preview_chs",
@@ -418,8 +423,8 @@ export default {
             con: "", //生字
             en: "",
             pinyin: "", //拼音
-            type: ["lm"],
-          },
+            type: ["lm"]
+          }
         ],
         numberList: {
           type: "number",
@@ -428,34 +433,34 @@ export default {
           arr: [
             {
               id: 1,
-              value: 1,
+              value: 1
             },
             {
               id: 2,
-              value: 2,
+              value: 2
             },
             {
               id: 3,
-              value: 3,
+              value: 3
             },
             {
               id: 4,
-              value: 4,
+              value: 4
             },
             {
               id: 5,
-              value: 5,
+              value: 5
             },
             {
               id: 6,
-              value: 6,
+              value: 6
             },
             {
               id: 7,
-              value: 7,
-            },
-          ],
-        },
+              value: 7
+            }
+          ]
+        }
       },
       data_structure3: {
         type: "listen_record_single_syllable_chs",
@@ -472,11 +477,11 @@ export default {
               {
                 number: "",
                 pinyin: "", //拼音
-                isAnswer: false,
-              },
-            ],
-          },
-        ],
+                isAnswer: false
+              }
+            ]
+          }
+        ]
       },
       isWordTime: false,
       compareType: "", //校对类型
@@ -484,7 +489,7 @@ export default {
       compareData: null,
       compareloading: false,
       CreadMp3loading: false,
-      loading: false,
+      loading: false
     };
   },
   computed: {},
@@ -495,7 +500,7 @@ export default {
       console.log(this.curQue.option[index].option[itIndex].isAnswer);
       let value = this.curQue.option[index].option[itIndex].isAnswer;
       if (value) {
-        this.curQue.option[index].option.forEach((item) => {
+        this.curQue.option[index].option.forEach(item => {
           item.isAnswer = false;
         });
         this.curQue.option[index].option[itIndex].isAnswer = true;
@@ -516,7 +521,7 @@ export default {
       }
       this.compareloading = true;
       compareSenTenceTime({ matchList: JSON.stringify(this.compareData) })
-        .then((res) => {
+        .then(res => {
           console.log(res);
           this.compareloading = false;
           this.curQue.wordTime = res.data.result;
@@ -563,23 +568,22 @@ export default {
       this.$confirm("确定要删除此项吗?", "提示", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning",
-      })
-        .then(() => {
-            if (this.type == "listen_record_single_syllable_chs") {
-                if (this.curQue.option.length <= 1) {
-                this.$message.warning("至少要保留1个选项");
-                return;
-                }
-                this.curQue.option.splice(index, 1);
-                return;
-            }
-            if (this.curQue.option.length <= 1) {
-                this.$message.warning("至少要保留1个选项");
-                return;
-            }
-            this.curQue.option.splice(index, 1);
-        })
+        type: "warning"
+      }).then(() => {
+        if (this.type == "listen_record_single_syllable_chs") {
+          if (this.curQue.option.length <= 1) {
+            this.$message.warning("至少要保留1个选项");
+            return;
+          }
+          this.curQue.option.splice(index, 1);
+          return;
+        }
+        if (this.curQue.option.length <= 1) {
+          this.$message.warning("至少要保留1个选项");
+          return;
+        }
+        this.curQue.option.splice(index, 1);
+      });
     },
     // 新增选项
     addOption() {
@@ -610,13 +614,13 @@ export default {
     changeImage(fileList, duration, index) {
       const articleImgList = JSON.parse(JSON.stringify(fileList));
       const articleImgRes = [];
-      articleImgList.forEach((item) => {
+      articleImgList.forEach(item => {
         if (item.response) {
           const obj = {
             name: item.name,
             url: item.response.file_info_list[0].file_url,
             id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
-            media_duration: item.response.file_info_list[0].media_duration, //音频时长
+            media_duration: item.response.file_info_list[0].media_duration //音频时长
           };
           articleImgRes.push(obj);
         }
@@ -629,13 +633,13 @@ export default {
     changeMp3(fileList, items, index) {
       const articleImgList = JSON.parse(JSON.stringify(fileList));
       const articleImgRes = [];
-      articleImgList.forEach((item) => {
+      articleImgList.forEach(item => {
         if (item.response) {
           const obj = {
             name: item.name,
             url: item.response.file_info_list[0].file_url,
             id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
-            media_duration: item.response.file_info_list[0].media_duration, //音频时长
+            media_duration: item.response.file_info_list[0].media_duration //音频时长
           };
           articleImgRes.push(obj);
         }
@@ -648,13 +652,13 @@ export default {
     listenchangeMp3(fileList, items, index) {
       const articleImgList = JSON.parse(JSON.stringify(fileList));
       const articleImgRes = [];
-      articleImgList.forEach((item) => {
+      articleImgList.forEach(item => {
         if (item.response) {
           const obj = {
             name: item.name,
             url: item.response.file_info_list[0].file_url,
             id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
-            media_duration: item.response.file_info_list[0].media_duration, //音频时长
+            media_duration: item.response.file_info_list[0].media_duration //音频时长
           };
           articleImgRes.push(obj);
         }
@@ -665,13 +669,13 @@ export default {
     timuchangeMp3(fileList) {
       const articleImgList = JSON.parse(JSON.stringify(fileList));
       const articleImgRes = [];
-      articleImgList.forEach((item) => {
+      articleImgList.forEach(item => {
         if (item.response) {
           const obj = {
             name: item.name,
             url: item.response.file_info_list[0].file_url,
             id: "[FID##" + item.response.file_info_list[0].file_id + "##FID]",
-            media_duration: item.response.file_info_list[0].media_duration, //音频时长
+            media_duration: item.response.file_info_list[0].media_duration //音频时长
           };
           articleImgRes.push(obj);
         }
@@ -681,30 +685,30 @@ export default {
     // 上传音频文件
     handleChange(file, fileList) {
       let _this = this;
-      _this.getBase64(file.raw).then((res) => {
+      _this.getBase64(file.raw).then(res => {
         let base_res = res.split("base64,");
         let data = {
           fileName: file.raw.name,
           speechBase64: base_res[1],
-          language: "ch",
+          language: "ch"
         };
-        prepareTranscribe(data).then((reses) => {
+        prepareTranscribe(data).then(reses => {
           _this.$set(_this.curQue, "taskId", reses.data.taskId);
         });
       });
     },
     getBase64(file) {
-      return new Promise(function (resolve, reject) {
+      return new Promise(function(resolve, reject) {
         let reader = new FileReader();
         let imgResult = "";
         reader.readAsDataURL(file);
-        reader.onload = function () {
+        reader.onload = function() {
           imgResult = reader.result;
         };
-        reader.onerror = function (error) {
+        reader.onerror = function(error) {
           reject(error);
         };
-        reader.onloadend = function () {
+        reader.onloadend = function() {
           resolve(imgResult);
         };
       });
@@ -723,9 +727,9 @@ export default {
             taskId: this.curQue.taskId,
             verseList: JSON.stringify(verseList),
             matchType: "chinese",
-            language: "ch",
+            language: "ch"
           };
-          getWordTime(data).then((res) => {
+          getWordTime(data).then(res => {
             this.curQue.wordTime = res.data.result;
             this.isWordTime = false;
           });
@@ -743,17 +747,17 @@ export default {
         lock: true,
         text: "Loading",
         spinner: "el-icon-loading",
-        background: "rgba(0, 0, 0, 0.7)",
+        background: "rgba(0, 0, 0, 0.7)"
       });
       getContentFile("tool-ParseLRCFile", {
         content_type: "FILE",
-        file_id: this.curQue.lrc_list[0].file_id,
+        file_id: this.curQue.lrc_list[0].file_id
       }).then(({ lrc_list }) => {
         let lrc_list_res = [];
-        lrc_list.forEach((item) => {
+        lrc_list.forEach(item => {
           let obj = {
             bg: item.begin_time,
-            ed: item.end_time,
+            ed: item.end_time
           };
           lrc_list_res.push(obj);
         });
@@ -776,12 +780,12 @@ export default {
             duration: fileList.media_duration,
             url: fileList.file_url,
             id: "[FID##" + fileList.file_id + "##FID]",
-            file_id: fileList.file_id,
+            file_id: fileList.file_id
           });
         }
       });
       this.curQue.lrc_list = lrc_list;
-    },
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
@@ -796,36 +800,39 @@ export default {
           arr: [
             {
               id: 1,
-              value: 1,
+              value: 1
             },
             {
               id: 2,
-              value: 2,
+              value: 2
             },
             {
               id: 3,
-              value: 3,
+              value: 3
             },
             {
               id: 4,
-              value: 4,
+              value: 4
             },
             {
               id: 5,
-              value: 5,
+              value: 5
             },
             {
               id: 6,
-              value: 6,
+              value: 6
             },
             {
               id: 7,
-              value: 7,
-            },
-          ],
+              value: 7
+            }
+          ]
         };
-        this.$set(this.curQue, "numberList", obj);
-        this.curQue.option.forEach((item) => {
+        if (!this.curQue.hasOwnProperty("numberList")) {
+          this.$set(this.curQue, "numberList", obj);
+        }
+
+        this.curQue.option.forEach(item => {
           if (!item.type) {
             item.type = ["lm"];
           }
@@ -835,8 +842,8 @@ export default {
         if (!this.curQue.wordTime) {
           this.curQue.wordTime = [];
         }
-        this.curQue.option.forEach((item) => {
-          item.option.forEach((it) => {
+        this.curQue.option.forEach(item => {
+          item.option.forEach(it => {
             if (!it.isAnswer) {
               it.isAnswer = false;
             }
@@ -853,10 +860,10 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
-<style lang='scss' scope>
+<style lang="scss" scope>
 //@import url(); 引入公共css类
 .Big-Book-PurePreview {
   &-content {
@@ -946,5 +953,4 @@ export default {
   }
 }
 </style>
-<style lang="scss">
-</style>
+<style lang="scss"></style>