parent
dcaa7a3caa
commit
4140318af6
5 changed files with 413 additions and 101 deletions
@ -0,0 +1,118 @@ |
||||
import axios from 'axios' |
||||
import Api from '@/api' |
||||
export default { |
||||
//skin:'oxide-dark',
|
||||
language:'zh_CN', |
||||
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', |
||||
toolbar: 'code undo redo restoredraft | cut copy powerpaste pastetext | forecolor backcolor bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify outdent indent | \ |
||||
styleselect formatselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \ |
||||
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em lineheight formatpainter', |
||||
height: 650, //编辑器高度
|
||||
min_height: 400, |
||||
// content_css: [ //可设置编辑区内容展示的css,谨慎使用
|
||||
// '/static/reset.css',
|
||||
// ],
|
||||
content_style: `.mce-content-body:not([dir=rtl]) blockquote {
|
||||
padding: 8px 15px; |
||||
border-left: 0; |
||||
background-color: #ededed; |
||||
}
|
||||
blockquote p { |
||||
margin: 0; |
||||
font-style: italic; |
||||
} |
||||
.block { |
||||
margin-bottom: 20px; |
||||
overflow: hidden; |
||||
} |
||||
.block .fl { |
||||
float: left; |
||||
margin-right: 10px; |
||||
} |
||||
.block .fr { |
||||
float: right; |
||||
margin-left: 10px; |
||||
} |
||||
.block p { |
||||
margin: 0 0 10px; |
||||
} |
||||
`,
|
||||
fontsize_formats: '12px 14px 16px 19px 24px 36px 48px 56px 72px', |
||||
font_formats: '微软雅黑=Microsoft YaHei,Helvetica Neue,PingFang SC,sans-serif;苹果苹方=PingFang SC,Microsoft YaHei,sans-serif;宋体=simsun,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', |
||||
link_list: [ |
||||
{ 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' } |
||||
], |
||||
image_class_list: [ |
||||
{ 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' }); |
||||
} |
||||
}, |
||||
//为内容模板插件提供预置模板
|
||||
templates: [ |
||||
{ title: '文章模板1', description: '图片文字流', content: ` |
||||
<div class="block"> |
||||
<img align="left" hspace="5" vspace="5" src="https://tse1-mm.cn.bing.net/th/id/OIP-C._S-t6T2kt-j6ydemeoB1wAHaEs?w=301&h=190&c=7&r=0&o=5&pid=1.7"/> |
||||
<div class="texts"> |
||||
<p>S³FEL主要由一台超导直线加速器、波荡器、光束线和实验站组成,可产生重复频率达1MHz、电子束能量达2.5 GeV的软X 射线自由电子激光,可在百飞秒内级实现原子、分子及外壳层电子结构的无损、动态监测,是科学家认识和了解物质微观结构及动态变化的“高速摄像机”。S³FEL为科学家和企业用户提供了一种具有超高时间分辨、空间分辨和能量分辨的新方法、新技术。 S³FEL在量子材料、能源催化、生物医药、大气与星际科学、原子分子科学等领域的应用研究,将为促进我国战略性新兴产业创新发展和关键。 |
||||
</p> |
||||
</div> |
||||
</div> |
||||
<div class="block"> |
||||
<img align="right" hspace="5" vspace="5" src="https://tse1-mm.cn.bing.net/th/id/OIP-C._S-t6T2kt-j6ydemeoB1wAHaEs?w=301&h=190&c=7&r=0&o=5&pid=1.7"/> |
||||
<div> |
||||
<p>集聚世界前沿和原创性科学技术及产业研发,将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展,营造粤港澳大湾区人才高地,并助力粤港澳大湾区国际科技创新中心的建设。此外, S³FEL作为重要的科普教育基地,</p> |
||||
<p>S³FEL汇聚并培养信息、生命、材料、能源等学科领域的国际水平科技领军人才,集聚世界前沿和原创性科学技术及产业研发,将推动一批高水平大学和科研机构的科技人才队伍建设及相关学科的高质量发展,营造粤港澳大湾区人才高地,并助力粤港澳大湾区国际科技创新中心的建设。此外, S³FEL作为重要的科普教育基地,是展示我国科技实力、提高全民族科学素质和民族自信的重要宣传窗口。 S³FEL主体建筑将成为深圳市地标式建筑,促进提升深圳市的城市形象和国际化知名度。</p> |
||||
</div> |
||||
</div> |
||||
`
|
||||
} |
||||
], |
||||
// content_security_policy: "https://cdn.tiny.cloud/1/rnk6zw9v267xqz7pf98twt1vmrvltmd436je7a642pckltda/tinymce/6/tinymce.min.js",
|
||||
// extended_valid_elements:'script[src]',
|
||||
//
|
||||
// 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', |
||||
// automatic_uploads: true,
|
||||
// images_upload_base_path: '/demo',
|
||||
// images_upload_url: 'http://192.168.31.136:10000/iasf/sysFiles/upload',
|
||||
paste_data_images: true, |
||||
powerpaste_allow_local_images: true, |
||||
powerpaste_word_import: 'clean', |
||||
powerpaste_html_import: 'clean', |
||||
// 自定义上传
|
||||
images_upload_handler: function (blobInfo, succFun, failFun) { |
||||
console.log("🚀 ~ file: editor.js ~ line 62 ~ blobInfo", blobInfo) |
||||
const form = new FormData() |
||||
form.append('file', blobInfo.blob()), |
||||
axios({ |
||||
method: 'post', |
||||
url: Api.upload, |
||||
data: form, |
||||
headers: { |
||||
'Content-Type': 'multipart/form-data' |
||||
}, |
||||
}).then(({ data }) => { |
||||
succFun(data.url) |
||||
}).catch(res => {}) |
||||
}, |
||||
//icons:'ax-color',
|
||||
} |
Loading…
Reference in new issue