全站替换成鸿蒙字体,去掉其他字体

master
yujialong 4 months ago
parent f60718eae3
commit 949c57d32c
  1. 20
      public/styles/css/editor.css
  2. BIN
      public/styles/font/HarmonyOS_SansSC_Light.ttf
  3. BIN
      public/styles/font/PingFang-Regular.otf
  4. BIN
      public/styles/font/ProximaNova-Regular.otf
  5. BIN
      public/styles/font/SF-Pro-Display-Regular.otf
  6. BIN
      public/styles/font/SourceHanSansCN-VF-2.otf
  7. 146
      src/components/editor.js
  8. 35
      src/mixins/page/index.js
  9. 180
      src/pages/article/add/editor.js
  10. 74
      src/pages/column/page/devHistory.vue
  11. 4
      src/setting.js
  12. 33
      src/styles/common.scss
  13. BIN
      src/styles/font/HarmonyOS_SansSC_Light.ttf
  14. BIN
      src/styles/font/PingFang-Regular.otf
  15. BIN
      src/styles/font/PingFangSC-Medium.otf
  16. BIN
      src/styles/font/PingFangTC-Semibold.ttf
  17. BIN
      src/styles/font/ProximaNova-Regular.otf
  18. BIN
      src/styles/font/SF-Pro-Display-Bold.otf
  19. BIN
      src/styles/font/SF-Pro-Display-Regular.otf
  20. BIN
      src/styles/font/SourceHanSansCN-VF-2.otf
  21. BIN
      src/styles/font/toppan.otf
  22. 2
      src/styles/layout/index.scss
  23. 2
      src/styles/lib/_style.scss
  24. 3
      src/styles/page/page.scss

@ -1,18 +1,10 @@
@font-face { @font-face {
font-family: SFProDisplay; font-family: Harmony;
src: url('./styles/font/SF-Pro-Display-Regular.otf'); src: url('./styles/font/HarmonyOS_SansSC_Light.ttf');
} }
@font-face { @font-face {
font-family: ProximaNova; font-family: siyuan;
src: url('./styles/font/ProximaNova-Regular.otf'); src: url('./styles/font/SourceHanSansCN-VF-2.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');
} }
.mce-content-body:not([dir='rtl']) blockquote { .mce-content-body:not([dir='rtl']) blockquote {
padding: 8px 15px; padding: 8px 15px;
@ -48,7 +40,6 @@
.tiny-wrap .block p { .tiny-wrap .block p {
margin: 0 0 10px; margin: 0 0 10px;
font-size: 19px; font-size: 19px;
font-family: SFProDisplay;
font-weight: 400; font-weight: 400;
color: #101010; color: #101010;
line-height: 32px; line-height: 32px;
@ -56,14 +47,12 @@
} }
.tiny-wrap .en-block p, .tiny-wrap .en-block p,
.tiny-wrap .en-block .img-des { .tiny-wrap .en-block .img-des {
font-family: ProximaNova;
letter-spacing: -0.0135em; letter-spacing: -0.0135em;
line-height: 1.5em; line-height: 1.5em;
} }
.tiny-wrap .block .tiny-title { .tiny-wrap .block .tiny-title {
margin: 10px 0; margin: 10px 0;
font-size: 24px; font-size: 24px;
font-family: SFProDisplay;
font-weight: 500; font-weight: 500;
color: #101010; color: #101010;
line-height: 32px; line-height: 32px;
@ -106,7 +95,6 @@
} }
.tiny-wrap .people h6 { .tiny-wrap .people h6 {
font-size: 24px; font-size: 24px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
} }

@ -4,7 +4,7 @@ import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
export default { export default {
//skin:'oxide-dark', //skin:'oxide-dark',
language:'zh_CN', language: 'zh_CN',
language_url: './styles/tinymce/langs/zh_CN.js', 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', 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 | \ 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: '行高', title: '行高',
items: [{ items: [{
title: '1', title: '1',
styles: { styles: {
'line-height': '1' 'line-height': '1'
},
inline: 'span'
}, },
{ inline: 'span'
title: '1.5', },
styles: { {
'line-height': '1.5' title: '1.5',
}, styles: {
inline: 'span' 'line-height': '1.5'
}, },
{ inline: 'span'
title: '2', },
styles: { {
'line-height': '2' title: '2',
}, styles: {
inline: 'span' 'line-height': '2'
}, },
{ inline: 'span'
title: '2.5', },
styles: { {
'line-height': '2.5' title: '2.5',
}, styles: {
inline: 'span' 'line-height': '2.5'
}, },
{ inline: 'span'
title: '3', },
styles: { {
'line-height': '3' title: '3',
}, styles: {
inline: 'span' 'line-height': '3'
} },
inline: 'span'
}
] ]
}, },
//默认的配置 //默认的配置
@ -184,35 +184,36 @@ export default {
], ],
// content_style: Style, // content_style: Style,
fontsize_formats: '12px 14px 16px 18px 19px 22px 24px 36px 48px 56px 72px', 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: [ link_list: [
{ title: '预置链接1', value: 'http://www.tinymce.com' }, { title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' } { title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
], ],
image_list: [ image_list: [
{ title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' },
{ title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' }
], ],
image_class_list: [ image_class_list: [
{ title: 'None', value: '' }, { title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' } { title: 'Some class', value: 'class-name' }
], ],
//importcss_append: true, //importcss_append: true,
//自定义文件选择器的回调内容 //自定义文件选择器的回调内容
file_picker_callback: function (callback, value, meta) { file_picker_callback: function (callback, value, meta) {
if (meta.filetype === 'file') { if (meta.filetype === 'file') {
callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' });
} }
if (meta.filetype === 'image') { if (meta.filetype === 'image') {
callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' });
} }
if (meta.filetype === 'media') { if (meta.filetype === 'media') {
callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' });
} }
}, },
//为内容模板插件提供预置模板 //为内容模板插件提供预置模板
templates: [ templates: [
{ title: '中文文章模板1', description: '图片文字流', content: ` {
title: '中文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block"> <div class="block">
<div class="fl"> <div class="fl">
@ -236,8 +237,9 @@ export default {
</div> </div>
</div> </div>
` `
}, },
{ title: '英文文章模板1', description: '图片文字流', content: ` {
title: '英文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block en-block"> <div class="block en-block">
<div class="fr"> <div class="fr">
@ -255,8 +257,9 @@ export default {
</div> </div>
</div> </div>
` `
}, },
{ title: '新闻模板', description: '', content: ` {
title: '新闻模板', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block" style="margin-bottom: 70px;"> <div class="block" style="margin-bottom: 70px;">
<div class="fr"> <div class="fr">
@ -285,8 +288,9 @@ export default {
</div> </div>
</div> </div>
` `
}, },
{ title: '图片描述', description: '', content: ` {
title: '图片描述', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block"> <div class="block">
<div class="img-wrap"> <div class="img-wrap">
@ -296,7 +300,7 @@ export default {
</div> </div>
</div> </div>
` `
} }
], ],
// content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js", // content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js",
// extended_valid_elements:'script[src]', // extended_valid_elements:'script[src]',
@ -304,7 +308,7 @@ export default {
// template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]', // template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]',
// template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]', // template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]',
// autosave_ask_before_unload: false, // autosave_ask_before_unload: false,
toolbar_mode : 'wrap', toolbar_mode: 'wrap',
// automatic_uploads: true, // automatic_uploads: true,
// images_upload_base_path: '/demo', // images_upload_base_path: '/demo',
paste_data_images: true, paste_data_images: true,
@ -315,17 +319,17 @@ export default {
images_upload_handler: function (blobInfo, succFun, failFun) { images_upload_handler: function (blobInfo, succFun, failFun) {
const form = new FormData() const form = new FormData()
form.append('file', blobInfo.blob()), form.append('file', blobInfo.blob()),
Axios({ Axios({
method: 'post', method: 'post',
url: Api.upload, url: Api.upload,
data: form, data: form,
headers: { headers: {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
token: Util.local.get(Setting.tokenKey) token: Util.local.get(Setting.tokenKey)
}, },
}).then(({ data }) => { }).then(({ data }) => {
succFun(data.url) succFun(data.url)
}).catch(res => {}) }).catch(res => { })
}, },
//自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发 //自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发
file_picker_callback: function (callback, value, meta) { file_picker_callback: function (callback, value, meta) {
@ -341,7 +345,7 @@ export default {
let input = document.createElement('input');//创建一个隐藏的input let input = document.createElement('input');//创建一个隐藏的input
input.setAttribute('type', 'file'); input.setAttribute('type', 'file');
input.setAttribute("accept", ".mp4"); input.setAttribute("accept", ".mp4");
input.onchange = function(){ input.onchange = function () {
let file = this.files[0]; let file = this.files[0];
let fd = new FormData(); let fd = new FormData();
fd.append("file", file); fd.append("file", file);
@ -355,16 +359,16 @@ export default {
}, },
}).then(({ data }) => { }).then(({ data }) => {
callback(data.url) callback(data.url)
}).catch(res => {}) }).catch(res => { })
} }
//触发点击 //触发点击
input.click(); input.click();
} }
}, },
// 初始化事件 // 初始化事件
setup: function(editor) { setup: function (editor) {
const that = this const that = this
editor.on('init', function(ed) { editor.on('init', function (ed) {
// 设置默认字体(新增才需要设置) // 设置默认字体(新增才需要设置)
if (editor.iframeElement.contentWindow.document.body.innerText === '\n') { if (editor.iframeElement.contentWindow.document.body.innerText === '\n') {
ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei") ed.target.editorCommands.execCommand("fontName", false, "Microsoft Yahei")

@ -3,7 +3,7 @@ import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
import { Loading } from 'element-ui' import { Loading } from 'element-ui'
export default { export default {
data() { data () {
return { return {
userId: +this.$store.state.user.userId, userId: +this.$store.state.user.userId,
site: this.$store.state.content.site, site: this.$store.state.content.site,
@ -23,7 +23,7 @@ export default {
Module, Module,
}, },
// 页面离开的时候如果没有保存则提示 // 页面离开的时候如果没有保存则提示
beforeRouteLeave(to, from, next) { beforeRouteLeave (to, from, next) {
// 更改了信息才需要提示 // 更改了信息才需要提示
if (!this.pass && this.modules.length && this.originModules !== JSON.stringify(this.modules)) { if (!this.pass && this.modules.length && this.originModules !== JSON.stringify(this.modules)) {
this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', { this.$confirm(`所填写内容暂未保存,是否保存?`, '提示', {
@ -38,12 +38,12 @@ export default {
next() next()
} }
}, },
mounted() { mounted () {
this.getInfo() this.getInfo()
}, },
methods: { methods: {
// 获取详情 // 获取详情
getInfo() { getInfo () {
const siteId = this.$store.state.content.site.id const siteId = this.$store.state.content.site.id
this.modules.map(e => { this.modules.map(e => {
const { type, list, form } = e const { type, list, form } = e
@ -71,21 +71,22 @@ export default {
this.id = json.id this.id = json.id
const str = json[json.state ? 'theEditedJson' : 'jsonBeforeEditing'] const str = json[json.state ? 'theEditedJson' : 'jsonBeforeEditing']
const list = JSON.parse(str) const list = JSON.parse(str)
console.log("🚀 ~ this.$post ~ list:", list, json.theEditedJson)
this.modules.map((e, i) => { this.modules.map((e, i) => {
e.form = list[i].form e.form = list[i].form
if (list[i].list) e.list = list[i].list if (list[i].list) e.list = list[i].list
if (this.withOriginForm.includes(e.type) && !e.originForm) { if (this.withOriginForm.includes(e.type) && !e.originForm) {
e.originForm = modules[i].originForm e.originForm = modules[i].originForm
} }
}) })
this.originModules = JSON.stringify(this.modules) // 原始json,用以页面离开的时候判断是否需要提示保存 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.curModule = i
this.curData = JSON.parse(JSON.stringify(this.modules[i])) this.curData = JSON.parse(JSON.stringify(this.modules[i]))
@ -97,7 +98,7 @@ export default {
this.diaVisible = true this.diaVisible = true
}, },
// 模块设置提交 // 模块设置提交
moduleSubmited() { moduleSubmited () {
this.diaVisible = false this.diaVisible = false
const { type } = this.curData const { type } = this.curData
if (type === 'columns' || type === 'forms') { if (type === 'columns' || type === 'forms') {
@ -109,7 +110,7 @@ export default {
} }
}, },
// 模块设置提交验证 // 模块设置提交验证
moduleSubmit() { moduleSubmit () {
const formEle = this.$refs.module.$refs.form const formEle = this.$refs.module.$refs.form
// 有表单的要验证必填,没有的直接关闭弹框 // 有表单的要验证必填,没有的直接关闭弹框
if (formEle) { if (formEle) {
@ -121,11 +122,11 @@ export default {
} }
}, },
// 处理预览和保存的json // 处理预览和保存的json
handleJson() { handleJson () {
return JSON.stringify(this.modules) return JSON.stringify(this.modules)
}, },
// 预览 // 预览
preview() { preview () {
const load = Loading.service() const load = Loading.service()
this.$post(this.api.saveRedisPage, { this.$post(this.api.saveRedisPage, {
columnId: this.columnId, columnId: this.columnId,
@ -138,7 +139,7 @@ export default {
}) })
}, },
// 保存 // 保存
save(state, leave) { save (state, leave) {
const json = this.handleJson() const json = this.handleJson()
const data = { const data = {
id: this.id, id: this.id,
@ -152,12 +153,12 @@ export default {
if (state) data.theEditedJson = json if (state) data.theEditedJson = json
this.$post(this.api[this.id ? 'updatePage' : 'savePage'], data).then(res => { this.$post(this.api[this.id ? 'updatePage' : 'savePage'], data).then(res => {
this.originModules = json this.originModules = json
Util.successMsg((state ? '发布' : '保存') + '成功') Util.successMsg((state ? '发布' : '保存') + '成功')
leave || this.$router.back() leave || this.$router.back()
}).catch(err => {}) }).catch(err => { })
}, },
// 返回 // 返回
back() { back () {
this.pass = true this.pass = true
// 更改了信息才需要提示 // 更改了信息才需要提示
if (this.originModules !== JSON.stringify(this.modules)) { if (this.originModules !== JSON.stringify(this.modules)) {

@ -2,9 +2,11 @@ import Axios from 'axios'
import Api from '@/api' import Api from '@/api'
import Setting from '@/setting' import Setting from '@/setting'
import Util from '@/libs/util' import Util from '@/libs/util'
import store from '@/store'
import { Loading } from 'element-ui'
export default { export default {
//skin:'oxide-dark', //skin:'oxide-dark',
language:'zh_CN', language: 'zh_CN',
language_url: './styles/tinymce/langs/zh_CN.js', 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', 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 | \ 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: '行高', title: '行高',
items: [{ items: [{
title: '1', title: '1',
styles: { styles: {
'line-height': '1' 'line-height': '1'
},
inline: 'span'
}, },
{ inline: 'span'
title: '1.5', },
styles: { {
'line-height': '1.5' title: '1.5',
}, styles: {
inline: 'span' 'line-height': '1.5'
}, },
{ inline: 'span'
title: '2', },
styles: { {
'line-height': '2' title: '2',
}, styles: {
inline: 'span' 'line-height': '2'
}, },
{ inline: 'span'
title: '2.5', },
styles: { {
'line-height': '2.5' title: '2.5',
}, styles: {
inline: 'span' 'line-height': '2.5'
}, },
{ inline: 'span'
title: '3', },
styles: { {
'line-height': '3' title: '3',
}, styles: {
inline: 'span' 'line-height': '3'
} },
inline: 'span'
}
] ]
}, },
//默认的配置 //默认的配置
@ -186,35 +188,36 @@ export default {
], ],
// content_style: Style, // content_style: Style,
fontsize_formats: '12px 14px 16px 18px 19px 22px 24px 36px 48px 56px 72px', 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: [ link_list: [
{ title: '预置链接1', value: 'http://www.tinymce.com' }, { title: '预置链接1', value: 'http://www.tinymce.com' },
{ title: '预置链接2', value: 'http://tinymce.ax-z.cn' } { title: '预置链接2', value: 'http://tinymce.ax-z.cn' }
], ],
image_list: [ image_list: [
{ title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' }, { title: '预置图片1', value: 'https://www.tiny.cloud/images/glyph-tinymce@2x.png' },
{ title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' } { title: '预置图片2', value: 'https://www.baidu.com/img/bd_logo1.png' }
], ],
image_class_list: [ image_class_list: [
{ title: 'None', value: '' }, { title: 'None', value: '' },
{ title: 'Some class', value: 'class-name' } { title: 'Some class', value: 'class-name' }
], ],
//importcss_append: true, //importcss_append: true,
//自定义文件选择器的回调内容 //自定义文件选择器的回调内容
file_picker_callback: function (callback, value, meta) { file_picker_callback: function (callback, value, meta) {
if (meta.filetype === 'file') { if (meta.filetype === 'file') {
callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' }); callback('https://www.baidu.com/img/bd_logo1.png', { text: 'My text' });
} }
if (meta.filetype === 'image') { if (meta.filetype === 'image') {
callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' }); callback('https://www.baidu.com/img/bd_logo1.png', { alt: 'My alt text' });
} }
if (meta.filetype === 'media') { if (meta.filetype === 'media') {
callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' }); callback('movie.mp4', { source2: 'alt.ogg', poster: 'https://www.baidu.com/img/bd_logo1.png' });
} }
}, },
//为内容模板插件提供预置模板 //为内容模板插件提供预置模板
templates: [ templates: [
{ title: '中文文章模板1', description: '图片文字流', content: ` {
title: '中文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block"> <div class="block">
<div class="fl"> <div class="fl">
@ -238,8 +241,9 @@ export default {
</div> </div>
</div> </div>
` `
}, },
{ title: '英文文章模板1', description: '图片文字流', content: ` {
title: '英文文章模板1', description: '图片文字流', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block en-block"> <div class="block en-block">
<div class="fr"> <div class="fr">
@ -257,8 +261,9 @@ export default {
</div> </div>
</div> </div>
` `
}, },
{ title: '新闻模板', description: '', content: ` {
title: '新闻模板', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block" style="margin-bottom: 70px;"> <div class="block" style="margin-bottom: 70px;">
<div class="fr"> <div class="fr">
@ -287,8 +292,9 @@ export default {
</div> </div>
</div> </div>
` `
}, },
{ title: '图片描述', description: '', content: ` {
title: '图片描述', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="block"> <div class="block">
<div class="img-wrap"> <div class="img-wrap">
@ -298,8 +304,9 @@ export default {
</div> </div>
</div> </div>
` `
}, },
{ title: '人物详情', description: '', content: ` {
title: '人物详情', description: '', content: `
<div class="tiny-wrap"> <div class="tiny-wrap">
<div class="people"> <div class="people">
<img class="pic" src="https://new.iasf.ac.cn/images/team/5.png"/> <img class="pic" src="https://new.iasf.ac.cn/images/team/5.png"/>
@ -375,7 +382,7 @@ export default {
</div> </div>
</div> </div>
` `
} }
], ],
// content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js", // content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js",
// extended_valid_elements:'script[src]', // extended_valid_elements:'script[src]',
@ -383,7 +390,7 @@ export default {
// template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]', // template_cdate_format: '[CDATE: %m/%d/%Y : %H:%M:%S]',
// template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]', // template_mdate_format: '[MDATE: %m/%d/%Y : %H:%M:%S]',
// autosave_ask_before_unload: false, // autosave_ask_before_unload: false,
toolbar_mode : 'wrap', toolbar_mode: 'wrap',
// automatic_uploads: true, // automatic_uploads: true,
// images_upload_base_path: '/demo', // images_upload_base_path: '/demo',
paste_data_images: true, paste_data_images: true,
@ -394,17 +401,17 @@ export default {
images_upload_handler: function (blobInfo, succFun, failFun) { images_upload_handler: function (blobInfo, succFun, failFun) {
const form = new FormData() const form = new FormData()
form.append('file', blobInfo.blob()), form.append('file', blobInfo.blob()),
Axios({ Axios({
method: 'post', method: 'post',
url: Api.upload, url: Api.upload,
data: form, data: form,
headers: { headers: {
'Content-Type': 'multipart/form-data', 'Content-Type': 'multipart/form-data',
token: Util.local.get(Setting.tokenKey) token: Util.local.get(Setting.tokenKey)
}, },
}).then(({ data }) => { }).then(({ data }) => {
succFun(data.url) succFun(data.url)
}).catch(res => {}) }).catch(res => { })
}, },
//自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发 //自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发
file_picker_callback: function (callback, value, meta) { file_picker_callback: function (callback, value, meta) {
@ -420,10 +427,18 @@ export default {
let input = document.createElement('input');//创建一个隐藏的input let input = document.createElement('input');//创建一个隐藏的input
input.setAttribute('type', 'file'); input.setAttribute('type', 'file');
input.setAttribute("accept", ".mp4"); input.setAttribute("accept", ".mp4");
input.onchange = function(){ input.onchange = function () {
let file = this.files[0]; let file = this.files[0];
let fd = new FormData(); let fd = new FormData();
fd.append("file", file); 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({ Axios({
method: 'post', method: 'post',
url: Api.upload, url: Api.upload,
@ -433,25 +448,30 @@ export default {
token: Util.local.get(Setting.tokenKey) token: Util.local.get(Setting.tokenKey)
}, },
}).then(({ data }) => { }).then(({ data }) => {
callback(data.url) if (data.code === 401) {
// if (data.code === 200) { Util.errorMsg(data.msg)
// callback(data.url) setTimeout(() => {
// } else { store.dispatch('user/logout')
// Util.errorMsg(data.msg) }, 1000)
// } return false
}).catch(res => {}) }
load.close()
callback(data.url)
}).catch(res => {
load.close()
})
} }
//触发点击 //触发点击
input.click(); input.click();
} }
}, },
// 初始化事件 // 初始化事件
setup: function(editor) { setup: function (editor) {
const that = this const that = this
editor.on('init', function(ed) { editor.on('init', function (ed) {
// 设置默认字体(新增才需要设置) // 设置默认字体(新增才需要设置)
if (editor.iframeElement.contentWindow.document.body.innerText === '\n') { 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("fontSize", false, "19px")
ed.target.editorCommands.execCommand("lineHeight", false, "1") ed.target.editorCommands.execCommand("lineHeight", false, "1")
} }

@ -3,11 +3,9 @@
<div class="actions"> <div class="actions">
<p class="page-name">页面设置/关于IASF-发展历程</p> <p class="page-name">页面设置/关于IASF-发展历程</p>
<div> <div>
<el-button type="primary" <el-button type="primary" @click="preview">预览</el-button>
@click="preview">预览</el-button>
<el-button @click="save(0)">保存为草稿</el-button> <el-button @click="save(0)">保存为草稿</el-button>
<el-button type="primary" <el-button type="primary" @click="save(1)">发布</el-button>
@click="save(1)">发布</el-button>
<el-button @click="back">放弃编辑</el-button> <el-button @click="back">放弃编辑</el-button>
</div> </div>
</div> </div>
@ -15,15 +13,12 @@
<div class="modules"> <div class="modules">
<div class="relative"> <div class="relative">
<div class="single-banner"> <div class="single-banner">
<img class="banner-img" <img class="banner-img" :src="modules[0].form.pic" alt="" />
:src="modules[0].form.pic"
alt="" />
<div class="texts"> <div class="texts">
<h6 class="banner-title">{{ modules[0].form.title }}</h6> <h6 class="banner-title">{{ modules[0].form.title }}</h6>
</div> </div>
</div> </div>
<div class="cover" <div class="cover" @click="toSet(0)">点击更换banner与链接</div>
@click="toSet(0)">点击更换banner与链接</div>
</div> </div>
<div class="block history"> <div class="block history">
@ -31,29 +26,21 @@
<div class="c-wrap"> <div class="c-wrap">
<h6 v-html="modules[1].form.title"></h6> <h6 v-html="modules[1].form.title"></h6>
<p class="en">{{ modules[1].form.subTitle }}</p> <p class="en">{{ modules[1].form.subTitle }}</p>
<div class="text" <div class="text" v-html="modules[1].form.des"></div>
v-html="modules[1].form.des"></div> <div class="cover" @click="toSet(1)">点击更换标题小标题与概述</div>
<div class="cover"
@click="toSet(1)">点击更换标题小标题与概述</div>
</div> </div>
<div class="c-wrap"> <div class="c-wrap">
<h6 style="font-size: 1.6rem">{{ modules[2].form.title }}</h6> <h6 style="font-size: 1.6rem">{{ modules[2].form.title }}</h6>
<p class="en" <p class="en" style="margin-top: -15px;font-size: 1.6rem">{{ modules[2].form.subTitle }}</p>
style="margin-top: -15px;font-size: 1.6rem">{{ modules[2].form.subTitle }}</p> <div class="text" v-html="modules[2].form.des"></div>
<div class="text" <div class="cover" @click="toSet(2)">点击更换标题小标题与概述</div>
v-html="modules[2].form.des"></div>
<div class="cover"
@click="toSet(2)">点击更换标题小标题与概述</div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<Module ref="module" <Module ref="module" :data.sync="curData" :visible.sync="diaVisible" @moduleSubmit="moduleSubmit" />
:data.sync="curData"
:visible.sync="diaVisible"
@moduleSubmit="moduleSubmit" />
</div> </div>
</template> </template>
@ -94,25 +81,28 @@ export default {
<style lang="scss" scoped> <style lang="scss" scoped>
@import '../../../styles/page/page.scss'; @import '../../../styles/page/page.scss';
.history { .history {
h6 { h6 {
position: relative; position: relative;
font-size: 2.4rem; font-size: 2.4rem;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500; font-weight: 500;
color: #333333; color: #333333;
} }
.en {
margin-top: -25px; .en {
font-size: 2.4rem; margin-top: -25px;
font-family: PingFangSC-Light, PingFang SC; font-size: 2.4rem;
font-weight: 300; font-family: PingFangSC-Light, PingFang SC;
color: #e3e3e3; font-weight: 300;
} color: #e3e3e3;
.text { }
max-width: 1200px;
margin: 30px 0; .text {
overflow: auto; max-width: 1200px;
} margin: 30px 0;
overflow: auto;
}
} }
</style> </style>

@ -3,7 +3,9 @@
* */ * */
const isDev = process.env.NODE_ENV === 'development' // 开发环境 const isDev = process.env.NODE_ENV === 'development' // 开发环境
let host = `${location.origin}/` let host = `${location.origin}/`
if (isDev) {
host = 'http://192.168.31.51:10000/'
}
const Setting = { const Setting = {
/** /**
* 基础配置 * 基础配置

@ -1,32 +1,12 @@
@import "./default/index.scss"; @import "./default/index.scss";
@font-face { @font-face {
font-family: PingFang; font-family: Harmony;
src: url('font/PingFang-Regular.otf'); src: url('font/HarmonyOS_SansSC_Light.ttf');
} }
@font-face { @font-face {
font-family: PingFangSC-Medium; font-family: siyuan;
src: url('font/PingFangSC-Medium.otf'); src: url('font/SourceHanSansCN-VF-2.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');
} }
[v-cloak] { [v-cloak] {
display: none; display: none;
@ -208,7 +188,6 @@
.cell { .cell {
font-size: 12px; font-size: 12px;
color: #333; color: #333;
font-family: PingFangSC-Regular, PingFang SC;
} }
} }
th { th {
@ -218,7 +197,6 @@
color: #323232; color: #323232;
font-size: 12px; font-size: 12px;
font-weight: 500; font-weight: 500;
font-family: PingFangSC-Medium, PingFang SC;
} }
} }
} }
@ -439,3 +417,6 @@
.tox-tinymce-aux { .tox-tinymce-aux {
z-index: 2500 !important; z-index: 2500 !important;
} }
.tinymce-load {
z-index: 3000 !important;
}

Binary file not shown.

@ -11,7 +11,7 @@ body,
body { body {
min-width: 1280px; 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; font-size: 14px;
background: #F0F2F5; background: #F0F2F5;
} }

@ -1,3 +1,3 @@
html { html {
font-family: 'PingFang SC', "Helvetica Neue", Helvetica, "microsoft yahei", arial, STHeiTi, sans-serif; font-family: Harmony, STHeiTi, sans-serif;
} }

@ -4,7 +4,6 @@
position: relative; position: relative;
margin-bottom: 50px; margin-bottom: 50px;
font-size: 50px; font-size: 50px;
font-family: SFProDisplay-Bold, SFProDisplay;
font-weight: bold; font-weight: bold;
color: #333333; color: #333333;
line-height: 60px; line-height: 60px;
@ -63,11 +62,9 @@
.banner-title { .banner-title {
margin-bottom: 19px; margin-bottom: 19px;
font-size: 48px; font-size: 48px;
font-family: PingFangSC-Medium, PingFang SC;
} }
.banner-des { .banner-des {
font-size: 24px; font-size: 24px;
font-family: PingFangSC-Medium, PingFang SC;
} }
} }
.gray { .gray {

Loading…
Cancel
Save