Bläddra i källkod

中文研报增加字体

cxmo 1 år sedan
förälder
incheckning
26674b589d

BIN
src/assets/css/fonts/SourceHanSansSC-Regular.ttf


BIN
src/assets/css/fonts/SourceHanSerifCN-Regular.ttf


+ 10 - 0
src/styles/global.scss

@@ -74,4 +74,14 @@ button:-moz-focusring,[type="button"]:-moz-focusring,[type="reset"]:-moz-focusri
   border-radius: 5px;
   color: #3994fb;
   background-color: #dcecfc;
+}
+
+//字蛛压缩字体
+@font-face {
+    font-family: '思源黑体';
+    src: url(../src/assets/css/fonts/SourceHanSansSC-Regular.ttf);
+}
+@font-face {
+    font-family: '思源宋体';
+    src: url(../src/assets/css/fonts/SourceHanSerifCN-Regular.ttf);
 }

+ 1 - 1
src/views/report_manage/addreportNew.vue

@@ -11,7 +11,7 @@
 				id="froala-editor"
 				ref="froalaEditor"
 				:tag="'textarea'"
-				:config="froalaConfig"
+				:config="CNEditorConfig"
 				v-model="aeForm.content"
 			></froala>
 		</div>

+ 1 - 1
src/views/report_manage/editChapterReport.vue

@@ -11,7 +11,7 @@
         id="froala-editor"
         ref="froalaEditor"
         :tag="'textarea'"
-        :config="froalaConfig"
+        :config="CNEditorConfig"
         v-model="aeForm.content"
       ></froala>
     </div>

+ 1 - 1
src/views/report_manage/editreportNew.vue

@@ -11,7 +11,7 @@
 				id="froala-editor"
 				ref="froalaEditor"
 				:tag="'textarea'"
-				:config="froalaConfig"
+				:config="CNEditorConfig"
 				v-model="aeForm.content"
 			></froala>
 		</div>

+ 13 - 9
src/views/report_manage/mixins/reportMixin.js

@@ -24,6 +24,19 @@ export default {
 	        }
 		},
   },
+  computed:{
+      CNEditorConfig(){
+          return {...this.froalaConfig,...{fontFamily:{'Arial,Helvetica,sans-serif': 'Arial',
+          'Georgia,serif': 'Georgia',
+          'Impact,Charcoal,sans-serif': 'Impact',
+          'Tahoma,Geneva,sans-serif': 'Tahoma',
+          "'Times New Roman',Times,serif": 'Times New Roman',
+          'Verdana,Geneva,sans-serif': 'Verdana',
+          '思源宋体':'思源宋体',
+          '思源黑体':'思源黑体',}}
+        }
+      }
+  },
   data() {
     let that = this;
     return {
@@ -77,15 +90,6 @@ export default {
         videoUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url
         fileUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url 更多上传介绍 请访问https://www.froala.com/wysiwyg-editor/docs/options
         imageDefaultWidth: false,
-        fontFamily:{'Arial,Helvetica,sans-serif': 'Arial',
-            'Georgia,serif': 'Georgia',
-            'Impact,Charcoal,sans-serif': 'Impact',
-            'Tahoma,Geneva,sans-serif': 'Tahoma',
-            "'Times New Roman',Times,serif": 'Times New Roman',
-            'Verdana,Geneva,sans-serif': 'Verdana',
-            'SimHei':'黑体',
-            'SimSun':'宋体'
-        },
         quickInsertButtons: ["image", "table", "ul", "ol", "hr"], //快速插入项
         toolbarVisibleWithoutSelection: true, //是否开启 不选中模式
         // disableRightClick:true,//是否屏蔽右击