diff --git a/public/styles/css/editor.css b/public/styles/css/editor.css index 9d3366a..fdceafb 100644 --- a/public/styles/css/editor.css +++ b/public/styles/css/editor.css @@ -1,18 +1,10 @@ @font-face { - font-family: SFProDisplay; - src: url('./styles/font/SF-Pro-Display-Regular.otf'); + font-family: Harmony; + src: url('./styles/font/HarmonyOS_SansSC_Light.ttf'); } @font-face { - font-family: ProximaNova; - src: url('./styles/font/ProximaNova-Regular.otf'); -} -@font-face { - font-family: PingFang; - src: url('./styles/font/PingFang-Regular.otf'); -} -@font-face { - font-family: PingFang SC; - src: url('./styles/font/PingFang-Regular.otf'); + font-family: siyuan; + src: url('./styles/font/SourceHanSansCN-VF-2.otf'); } .mce-content-body:not([dir='rtl']) blockquote { padding: 8px 15px; @@ -48,7 +40,6 @@ .tiny-wrap .block p { margin: 0 0 10px; font-size: 19px; - font-family: SFProDisplay; font-weight: 400; color: #101010; line-height: 32px; @@ -56,14 +47,12 @@ } .tiny-wrap .en-block p, .tiny-wrap .en-block .img-des { - font-family: ProximaNova; letter-spacing: -0.0135em; line-height: 1.5em; } .tiny-wrap .block .tiny-title { margin: 10px 0; font-size: 24px; - font-family: SFProDisplay; font-weight: 500; color: #101010; line-height: 32px; @@ -106,7 +95,6 @@ } .tiny-wrap .people h6 { font-size: 24px; - font-family: PingFangSC-Medium, PingFang SC; font-weight: 500; color: #333333; } diff --git a/public/styles/font/HarmonyOS_SansSC_Light.ttf b/public/styles/font/HarmonyOS_SansSC_Light.ttf new file mode 100644 index 0000000..cc54275 Binary files /dev/null and b/public/styles/font/HarmonyOS_SansSC_Light.ttf differ diff --git a/public/styles/font/PingFang-Regular.otf b/public/styles/font/PingFang-Regular.otf deleted file mode 100644 index 11032b6..0000000 Binary files a/public/styles/font/PingFang-Regular.otf and /dev/null differ diff --git a/public/styles/font/ProximaNova-Regular.otf b/public/styles/font/ProximaNova-Regular.otf deleted file mode 100644 index 27c8d8f..0000000 Binary files a/public/styles/font/ProximaNova-Regular.otf and /dev/null differ diff --git a/public/styles/font/SF-Pro-Display-Regular.otf b/public/styles/font/SF-Pro-Display-Regular.otf deleted file mode 100644 index 09aaca9..0000000 Binary files a/public/styles/font/SF-Pro-Display-Regular.otf and /dev/null differ diff --git a/public/styles/font/SourceHanSansCN-VF-2.otf b/public/styles/font/SourceHanSansCN-VF-2.otf new file mode 100644 index 0000000..4bf10f4 Binary files /dev/null and b/public/styles/font/SourceHanSansCN-VF-2.otf differ diff --git a/src/components/editor.js b/src/components/editor.js index 7824f3e..8e7cf48 100644 --- a/src/components/editor.js +++ b/src/components/editor.js @@ -4,7 +4,7 @@ import Setting from '@/setting' import Util from '@/libs/util' export default { //skin:'oxide-dark', - language:'zh_CN', + language: 'zh_CN', language_url: './styles/tinymce/langs/zh_CN.js', plugins: 'print powerpaste preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template advcode codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave autoresize formatpainter paragraphspacing', toolbar: 'code undo redo restoredraft | cut copy powerpaste pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \ @@ -22,40 +22,40 @@ export default { { title: '行高', items: [{ - title: '1', - styles: { - 'line-height': '1' - }, - inline: 'span' + title: '1', + styles: { + 'line-height': '1' }, - { - title: '1.5', - styles: { - 'line-height': '1.5' - }, - inline: 'span' + inline: 'span' + }, + { + title: '1.5', + styles: { + 'line-height': '1.5' }, - { - title: '2', - styles: { - 'line-height': '2' - }, - inline: 'span' + inline: 'span' + }, + { + title: '2', + styles: { + 'line-height': '2' }, - { - title: '2.5', - styles: { - 'line-height': '2.5' - }, - inline: 'span' + inline: 'span' + }, + { + title: '2.5', + styles: { + 'line-height': '2.5' }, - { - title: '3', - styles: { - 'line-height': '3' - }, - inline: 'span' - } + inline: 'span' + }, + { + title: '3', + styles: { + 'line-height': '3' + }, + inline: 'span' + } ] }, //默认的配置 @@ -184,35 +184,36 @@ export default { ], // content_style: Style, fontsize_formats: '12px 14px 16px 18px 19px 22px 24px 36px 48px 56px 72px', - font_formats: '苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif', + font_formats: '鸿蒙=Harmony;思源=siyuan;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif', link_list: [ - { title: '预置链接1', value: 'http://www.tinymce.com' }, - { title: '预置链接2', value: 'http://tinymce.ax-z.cn' } + { title: '预置链接1', value: 'http://www.tinymce.com' }, + { title: '预置链接2', value: 'http://tinymce.ax-z.cn' } ], image_list: [ - { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, - { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } + { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, + { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } ], image_class_list: [ - { title: 'None', value: '' }, - { title: 'Some class', value: 'class-name' } + { title: 'None', value: '' }, + { title: 'Some class', value: 'class-name' } ], //importcss_append: true, //自定义文件选择器的回调内容 file_picker_callback: function (callback, value, meta) { - if (meta.filetype === 'file') { - callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); - } - if (meta.filetype === 'image') { - callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); - } - if (meta.filetype === 'media') { - callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); - } + if (meta.filetype === 'file') { + callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); + } + if (meta.filetype === 'image') { + callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); + } + if (meta.filetype === 'media') { + callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); + } }, //为内容模板插件提供预置模板 templates: [ - { title: '中文文章模板1', description: '图片文字流', content: ` + { + title: '中文文章模板1', description: '图片文字流', content: `
@@ -235,9 +236,10 @@ export default {
- ` - }, - { title: '英文文章模板1', description: '图片文字流', content: ` + ` + }, + { + title: '英文文章模板1', description: '图片文字流', content: `
@@ -254,9 +256,10 @@ export default {
- ` - }, - { title: '新闻模板', description: '', content: ` + ` + }, + { + title: '新闻模板', description: '', content: `
@@ -284,9 +287,10 @@ export default {
- ` - }, - { title: '图片描述', description: '', content: ` + ` + }, + { + title: '图片描述', description: '', content: `
@@ -295,8 +299,8 @@ export default {
- ` - } + ` + } ], // content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js", // extended_valid_elements:'script[src]', @@ -304,7 +308,7 @@ export default { // template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]', // template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]', // autosave_ask_before_unload: false, - toolbar_mode : 'wrap', + toolbar_mode: 'wrap', // automatic_uploads: true, // images_upload_base_path: '/demo', paste_data_images: true, @@ -315,17 +319,17 @@ export default { images_upload_handler: function (blobInfo, succFun, failFun) { const form = new FormData() form.append('file', blobInfo.blob()), - Axios({ - method: 'post', - url: Api.upload, - data: form, - headers: { - 'Content-Type': 'multipart/form-data', - token: Util.local.get(Setting.tokenKey) - }, - }).then(({ data }) => { - succFun(data.url) - }).catch(res => {}) + Axios({ + method: 'post', + url: Api.upload, + data: form, + headers: { + 'Content-Type': 'multipart/form-data', + token: Util.local.get(Setting.tokenKey) + }, + }).then(({ data }) => { + succFun(data.url) + }).catch(res => { }) }, //自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发 file_picker_callback: function (callback, value, meta) { @@ -341,7 +345,7 @@ export default { let input = document.createElement('input');//创建一个隐藏的input input.setAttribute('type', 'file'); input.setAttribute("accept", ".mp4"); - input.onchange = function(){ + input.onchange = function () { let file = this.files[0]; let fd = new FormData(); fd.append("file", file); @@ -355,16 +359,16 @@ export default { }, }).then(({ data }) => { callback(data.url) - }).catch(res => {}) + }).catch(res => { }) } //触发点击 input.click(); } }, // 初始化事件 - setup: function(editor) { + setup: function (editor) { const that = this - editor.on('init', function(ed) { + editor.on('init', function (ed) { // 设置默认字体(新增才需要设置) if (editor.iframeElement.contentWindow.document.body.innerText === '\n') { ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei") diff --git a/src/mixins/page/index.js b/src/mixins/page/index.js index ec5f2ed..d5b035e 100644 --- a/src/mixins/page/index.js +++ b/src/mixins/page/index.js @@ -3,7 +3,7 @@ import Setting from '@/setting' import Util from '@/libs/util' import { Loading } from 'element-ui' export default { - data() { + data () { return { userId: +this.$store.state.user.userId, site: this.$store.state.content.site, @@ -23,7 +23,7 @@ export default { Module, }, // 页面离开的时候如果没有保存则提示 - beforeRouteLeave(to, from, next) { + beforeRouteLeave (to, from, next) { // 更改了信息才需要提示 if (!this.pass && this.modules.length && this.originModules !== JSON.stringify(this.modules)) { this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', { @@ -38,12 +38,12 @@ export default { next() } }, - mounted() { + mounted () { this.getInfo() }, methods: { // 获取详情 - getInfo() { + getInfo () { const siteId = this.$store.state.content.site.id this.modules.map(e => { const { type, list, form } = e @@ -71,21 +71,22 @@ export default { this.id = json.id const str = json[json.state ? 'theEditedJson' : 'jsonBeforeEditing'] const list = JSON.parse(str) + console.log("🚀 ~ this.$post ~ list:", list, json.theEditedJson) this.modules.map((e, i) => { - e.form = list[i].form - if (list[i].list) e.list = list[i].list + e.form = list[i].form + if (list[i].list) e.list = list[i].list if (this.withOriginForm.includes(e.type) && !e.originForm) { e.originForm = modules[i].originForm } }) this.originModules = JSON.stringify(this.modules) // 原始json,用以页面离开的时候判断是否需要提示保存 - console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules) + console.log("🚀 ~ file: index.js:85 ~ this.$post ~ list:", this.modules[0]) } - }).catch(err => {}) + }).catch(err => { }) }, // 展开模块设置 - toSet(i, listIndex) { + toSet (i, listIndex) { this.curModule = i this.curData = JSON.parse(JSON.stringify(this.modules[i])) @@ -97,7 +98,7 @@ export default { this.diaVisible = true }, // 模块设置提交 - moduleSubmited() { + moduleSubmited () { this.diaVisible = false const { type } = this.curData if (type === 'columns' || type === 'forms') { @@ -109,7 +110,7 @@ export default { } }, // 模块设置提交验证 - moduleSubmit() { + moduleSubmit () { const formEle = this.$refs.module.$refs.form // 有表单的要验证必填,没有的直接关闭弹框 if (formEle) { @@ -121,11 +122,11 @@ export default { } }, // 处理预览和保存的json - handleJson() { + handleJson () { return JSON.stringify(this.modules) }, // 预览 - preview() { + preview () { const load = Loading.service() this.$post(this.api.saveRedisPage, { columnId: this.columnId, @@ -138,7 +139,7 @@ export default { }) }, // 保存 - save(state, leave) { + save (state, leave) { const json = this.handleJson() const data = { id: this.id, @@ -152,12 +153,12 @@ export default { if (state) data.theEditedJson = json this.$post(this.api[this.id ? 'updatePage' : 'savePage'], data).then(res => { this.originModules = json - Util.successMsg((state ? '发布' : '保存') + '成功') + Util.successMsg((state ? '发布' : '保存') + '成功') leave || this.$router.back() - }).catch(err => {}) + }).catch(err => { }) }, // 返回 - back() { + back () { this.pass = true // 更改了信息才需要提示 if (this.originModules !== JSON.stringify(this.modules)) { diff --git a/src/pages/article/add/editor.js b/src/pages/article/add/editor.js index b84fcce..e08fe39 100644 --- a/src/pages/article/add/editor.js +++ b/src/pages/article/add/editor.js @@ -2,9 +2,11 @@ import Axios from 'axios' import Api from '@/api' import Setting from '@/setting' import Util from '@/libs/util' +import store from '@/store' +import { Loading } from 'element-ui' export default { //skin:'oxide-dark', - language:'zh_CN', + language: 'zh_CN', language_url: './styles/tinymce/langs/zh_CN.js', plugins: 'print powerpaste preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template advcode codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave autoresize formatpainter paragraphspacing', toolbar: 'code undo redo restoredraft | cut copy powerpaste pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \ @@ -22,40 +24,40 @@ export default { { title: '行高', items: [{ - title: '1', - styles: { - 'line-height': '1' - }, - inline: 'span' + title: '1', + styles: { + 'line-height': '1' }, - { - title: '1.5', - styles: { - 'line-height': '1.5' - }, - inline: 'span' + inline: 'span' + }, + { + title: '1.5', + styles: { + 'line-height': '1.5' }, - { - title: '2', - styles: { - 'line-height': '2' - }, - inline: 'span' + inline: 'span' + }, + { + title: '2', + styles: { + 'line-height': '2' }, - { - title: '2.5', - styles: { - 'line-height': '2.5' - }, - inline: 'span' + inline: 'span' + }, + { + title: '2.5', + styles: { + 'line-height': '2.5' }, - { - title: '3', - styles: { - 'line-height': '3' - }, - inline: 'span' - } + inline: 'span' + }, + { + title: '3', + styles: { + 'line-height': '3' + }, + inline: 'span' + } ] }, //默认的配置 @@ -186,35 +188,36 @@ export default { ], // content_style: Style, fontsize_formats: '12px 14px 16px 18px 19px 22px 24px 36px 48px 56px 72px', - font_formats: '苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif', + font_formats: '鸿蒙=Harmony;思源=siyuan;宋体=simsun,serif;微软雅黑=Microsoft YaHei,Helvetica Neue,仿宋体=FangSong,serif;黑体=SimHei,sans-serif;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats;知乎配置=BlinkMacSystemFont, Helvetica Neue, PingFang SC, Microsoft YaHei, Source Han Sans SC, Noto Sans CJK SC, WenQuanYi Micro Hei, sans-serif;小米配置=Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif', link_list: [ - { title: '预置链接1', value: 'http://www.tinymce.com' }, - { title: '预置链接2', value: 'http://tinymce.ax-z.cn' } + { title: '预置链接1', value: 'http://www.tinymce.com' }, + { title: '预置链接2', value: 'http://tinymce.ax-z.cn' } ], image_list: [ - { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, - { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } + { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, + { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } ], image_class_list: [ - { title: 'None', value: '' }, - { title: 'Some class', value: 'class-name' } + { title: 'None', value: '' }, + { title: 'Some class', value: 'class-name' } ], //importcss_append: true, //自定义文件选择器的回调内容 file_picker_callback: function (callback, value, meta) { - if (meta.filetype === 'file') { - callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); - } - if (meta.filetype === 'image') { - callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); - } - if (meta.filetype === 'media') { - callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); - } + if (meta.filetype === 'file') { + callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); + } + if (meta.filetype === 'image') { + callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); + } + if (meta.filetype === 'media') { + callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); + } }, //为内容模板插件提供预置模板 templates: [ - { title: '中文文章模板1', description: '图片文字流', content: ` + { + title: '中文文章模板1', description: '图片文字流', content: `
@@ -237,9 +240,10 @@ export default {
- ` - }, - { title: '英文文章模板1', description: '图片文字流', content: ` + ` + }, + { + title: '英文文章模板1', description: '图片文字流', content: `
@@ -256,9 +260,10 @@ export default {
- ` - }, - { title: '新闻模板', description: '', content: ` + ` + }, + { + title: '新闻模板', description: '', content: `
@@ -286,9 +291,10 @@ export default {
- ` - }, - { title: '图片描述', description: '', content: ` + ` + }, + { + title: '图片描述', description: '', content: `
@@ -297,9 +303,10 @@ export default {
- ` - }, - { title: '人物详情', description: '', content: ` + ` + }, + { + title: '人物详情', description: '', content: `
@@ -374,8 +381,8 @@ export default {
- ` - } + ` + } ], // content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js", // extended_valid_elements:'script[src]', @@ -383,7 +390,7 @@ export default { // template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]', // template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]', // autosave_ask_before_unload: false, - toolbar_mode : 'wrap', + toolbar_mode: 'wrap', // automatic_uploads: true, // images_upload_base_path: '/demo', paste_data_images: true, @@ -394,17 +401,17 @@ export default { images_upload_handler: function (blobInfo, succFun, failFun) { const form = new FormData() form.append('file', blobInfo.blob()), - Axios({ - method: 'post', - url: Api.upload, - data: form, - headers: { - 'Content-Type': 'multipart/form-data', - token: Util.local.get(Setting.tokenKey) - }, - }).then(({ data }) => { - succFun(data.url) - }).catch(res => {}) + Axios({ + method: 'post', + url: Api.upload, + data: form, + headers: { + 'Content-Type': 'multipart/form-data', + token: Util.local.get(Setting.tokenKey) + }, + }).then(({ data }) => { + succFun(data.url) + }).catch(res => { }) }, //自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发 file_picker_callback: function (callback, value, meta) { @@ -420,10 +427,18 @@ export default { let input = document.createElement('input');//创建一个隐藏的input input.setAttribute('type', 'file'); input.setAttribute("accept", ".mp4"); - input.onchange = function(){ + input.onchange = function () { let file = this.files[0]; let fd = new FormData(); fd.append("file", file); + const load = Loading.service({ + lock: true, + text: '正在上传', + spinner: 'el-icon-loading', + background: 'rgba(0, 0, 0, 0.7)', + zIndex: 30000, + customClass: 'tinymce-load' + }) Axios({ method: 'post', url: Api.upload, @@ -433,25 +448,30 @@ export default { token: Util.local.get(Setting.tokenKey) }, }).then(({ data }) => { - callback(data.url) - // if (data.code === 200) { - // callback(data.url) - // } else { - // Util.errorMsg(data.msg) - // } - }).catch(res => {}) + if (data.code === 401) { + Util.errorMsg(data.msg) + setTimeout(() => { + store.dispatch('user/logout') + }, 1000) + return false + } + load.close() + callback(data.url) + }).catch(res => { + load.close() + }) } //触发点击 input.click(); } }, // 初始化事件 - setup: function(editor) { + setup: function (editor) { const that = this - editor.on('init', function(ed) { + editor.on('init', function (ed) { // 设置默认字体(新增才需要设置) if (editor.iframeElement.contentWindow.document.body.innerText === '\n') { - ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei") + ed.target.editorCommands.execCommand("fontName", false, "Harmony") ed.target.editorCommands.execCommand("fontSize", false, "19px") ed.target.editorCommands.execCommand("lineHeight", false, "1") } diff --git a/src/pages/column/page/devHistory.vue b/src/pages/column/page/devHistory.vue index c6088d0..ed22c11 100644 --- a/src/pages/column/page/devHistory.vue +++ b/src/pages/column/page/devHistory.vue @@ -3,11 +3,9 @@

页面设置/关于IASF-发展历程

- 预览 + 预览 保存为草稿 - 发布 + 发布 放弃编辑
@@ -15,15 +13,12 @@
- +
-
点击更换banner与链接
+
点击更换banner与链接
@@ -31,29 +26,21 @@

{{ modules[1].form.subTitle }}

-
-
点击更换标题、小标题与概述
+
+
点击更换标题、小标题与概述
{{ modules[2].form.title }}
-

{{ modules[2].form.subTitle }}

-
-
点击更换标题、小标题与概述
+

{{ modules[2].form.subTitle }}

+
+
点击更换标题、小标题与概述
- + @@ -94,25 +81,28 @@ export default { diff --git a/src/setting.js b/src/setting.js index 8a84f59..317ebcb 100644 --- a/src/setting.js +++ b/src/setting.js @@ -3,7 +3,9 @@ * */ const isDev = process.env.NODE_ENV === 'development' // 开发环境 let host = `${location.origin}/` - +if (isDev) { + host = 'http://192.168.31.51:10000/' +} const Setting = { /** * 基础配置 diff --git a/src/styles/common.scss b/src/styles/common.scss index b972e13..1519c70 100644 --- a/src/styles/common.scss +++ b/src/styles/common.scss @@ -1,32 +1,12 @@ @import "./default/index.scss"; @font-face { - font-family: PingFang; - src: url('font/PingFang-Regular.otf'); + font-family: Harmony; + src: url('font/HarmonyOS_SansSC_Light.ttf'); } @font-face { - font-family: PingFangSC-Medium; - src: url('font/PingFangSC-Medium.otf'); -} -@font-face { - font-family: PingFangSC-Semibold; - src: url('font/PingFangTC-Semibold.ttf'); -} -@font-face { - font-family: SFProDisplay-Bold; - src: url('font/SF-Pro-Display-Bold.otf'); -} -@font-face { - font-family: SFProDisplay; - src: url('font/SF-Pro-Display-Regular.otf'); -} -@font-face { - font-family: toppan; - src: url('font/toppan.otf'); -} -@font-face { - font-family: ProximaNova; - src: url('font/ProximaNova-Regular.otf'); + font-family: siyuan; + src: url('font/SourceHanSansCN-VF-2.otf'); } [v-cloak] { display: none; @@ -208,7 +188,6 @@ .cell { font-size: 12px; color: #333; - font-family: PingFangSC-Regular, PingFang SC; } } th { @@ -218,7 +197,6 @@ color: #323232; font-size: 12px; font-weight: 500; - font-family: PingFangSC-Medium, PingFang SC; } } } @@ -438,4 +416,7 @@ } .tox-tinymce-aux { z-index: 2500 !important; +} +.tinymce-load { + z-index: 3000 !important; } \ No newline at end of file diff --git a/src/styles/font/HarmonyOS_SansSC_Light.ttf b/src/styles/font/HarmonyOS_SansSC_Light.ttf new file mode 100644 index 0000000..cc54275 Binary files /dev/null and b/src/styles/font/HarmonyOS_SansSC_Light.ttf differ diff --git a/src/styles/font/PingFang-Regular.otf b/src/styles/font/PingFang-Regular.otf deleted file mode 100644 index 11032b6..0000000 Binary files a/src/styles/font/PingFang-Regular.otf and /dev/null differ diff --git a/src/styles/font/PingFangSC-Medium.otf b/src/styles/font/PingFangSC-Medium.otf deleted file mode 100644 index f40327f..0000000 Binary files a/src/styles/font/PingFangSC-Medium.otf and /dev/null differ diff --git a/src/styles/font/PingFangTC-Semibold.ttf b/src/styles/font/PingFangTC-Semibold.ttf deleted file mode 100644 index bd5012c..0000000 Binary files a/src/styles/font/PingFangTC-Semibold.ttf and /dev/null differ diff --git a/src/styles/font/ProximaNova-Regular.otf b/src/styles/font/ProximaNova-Regular.otf deleted file mode 100644 index 27c8d8f..0000000 Binary files a/src/styles/font/ProximaNova-Regular.otf and /dev/null differ diff --git a/src/styles/font/SF-Pro-Display-Bold.otf b/src/styles/font/SF-Pro-Display-Bold.otf deleted file mode 100644 index 025b25c..0000000 Binary files a/src/styles/font/SF-Pro-Display-Bold.otf and /dev/null differ diff --git a/src/styles/font/SF-Pro-Display-Regular.otf b/src/styles/font/SF-Pro-Display-Regular.otf deleted file mode 100644 index 09aaca9..0000000 Binary files a/src/styles/font/SF-Pro-Display-Regular.otf and /dev/null differ diff --git a/src/styles/font/SourceHanSansCN-VF-2.otf b/src/styles/font/SourceHanSansCN-VF-2.otf new file mode 100644 index 0000000..4bf10f4 Binary files /dev/null and b/src/styles/font/SourceHanSansCN-VF-2.otf differ diff --git a/src/styles/font/toppan.otf b/src/styles/font/toppan.otf deleted file mode 100644 index d216723..0000000 Binary files a/src/styles/font/toppan.otf and /dev/null differ diff --git a/src/styles/layout/index.scss b/src/styles/layout/index.scss index 551bc53..7ef8f80 100644 --- a/src/styles/layout/index.scss +++ b/src/styles/layout/index.scss @@ -11,7 +11,7 @@ body, body { min-width: 1280px; - font-family: PingFang, PingFang SC, "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; + font-family: Harmony, STHeiTi, sans-serif; font-size: 14px; background: #F0F2F5; } \ No newline at end of file diff --git a/src/styles/lib/_style.scss b/src/styles/lib/_style.scss index 4b81d96..6423966 100644 --- a/src/styles/lib/_style.scss +++ b/src/styles/lib/_style.scss @@ -1,3 +1,3 @@ html { - font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; + font-family: Harmony, STHeiTi, sans-serif; } diff --git a/src/styles/page/page.scss b/src/styles/page/page.scss index 81f86a8..c1b6efa 100644 --- a/src/styles/page/page.scss +++ b/src/styles/page/page.scss @@ -4,7 +4,6 @@ position: relative; margin-bottom: 50px; font-size: 50px; - font-family: SFProDisplay-Bold, SFProDisplay; font-weight: bold; color: #333333; line-height: 60px; @@ -63,11 +62,9 @@ .banner-title { margin-bottom: 19px; font-size: 48px; - font-family: PingFangSC-Medium, PingFang SC; } .banner-des { font-size: 24px; - font-family: PingFangSC-Medium, PingFang SC; } } .gray {