@ -2,9 +2,9 @@ import Oss from '@/components/upload/upload.js'
import { Loading } from 'element-ui'
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 preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autoresize' ,
plugins : 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists wordcount imagetools textpattern help emoticons autosave auto resize' ,
toolbar : ' code undo redo restoredraft | cut copy pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \
toolbar : ' code undo redo restoredraft | cut copy pastetext | forecolor backcolor headings fontsize lineHeight bold italic underline strikethrough link anchor | alignleft aligncenter alignright alignjustify | \
styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
styleselect fontselect fontsizeselect | bullist numlist | blockquote subscript superscript removeformat | \
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em ' ,
table image media charmap emoticons hr pagebreak insertdatetime print preview | fullscreen | indent2em ' ,
@ -20,40 +20,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 : {
title : '1.5' ,
'line-height' : '1.5'
styles : {
} ,
'line-height' : '1.5'
inline : 'span'
} ,
inline : 'span'
} ,
{
title : '2' ,
styles : {
'line-height' : '2'
} ,
} ,
inline : 'span'
{
} ,
title : '2' ,
{
styles : {
title : '2.5 ' ,
'line-height' : '2'
styles : {
} ,
'line-height' : '2.5 '
inline : 'span'
} ,
} ,
inline : 'span'
{
} ,
title : '2.5' ,
{
styles : {
title : '3' ,
'line-height' : '2.5'
styles : {
} ,
'line-height' : '3 '
inline : 'span '
} ,
} ,
inline : 'span'
{
}
title : '3' ,
styles : {
'line-height' : '3'
} ,
inline : 'span'
}
]
]
} ,
} ,
//默认的配置
//默认的配置
@ -186,34 +186,33 @@ export default {
fontsize _formats : '12px 14px 16px 19px 24px 36px 48px 56px 72px' ,
fontsize _formats : '12px 14px 16px 19px 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 : '苹果苹方=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' ,
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 : '个股分析报告' , description : '' , content : `
title : '个股分析报告' , description : '' , content : `
< div class = "tiny-report" >
< div class = "tiny-report" >
< h2 > 个股分析报告 < / h 2 >
< h2 > 个股分析报告 < / h 2 >
< h6 > 1. 引言 < / h 6 >
< h6 > 1. 引言 < / h 6 >
@ -270,10 +269,9 @@ export default {
< / u l >
< / u l >
< / d i v >
< / d i v >
`
`
} ,
} ,
{
{ title : '行业数据分析报告' , description : '' , content : `
title : '行业数据分析报告' , description : '' , content : `
< div class = "tiny-report" >
< div class = "tiny-report" >
< h2 > 行业数据分析报告 < / h 2 >
< h2 > 行业数据分析报告 < / h 2 >
< h6 > 1. 引言 < / h 6 >
< h6 > 1. 引言 < / h 6 >
@ -344,10 +342,9 @@ export default {
< / u l >
< / u l >
< / d i v >
< / d i v >
`
`
} ,
} ,
{
{ title : '宏观数据分析报告' , description : '' , content : `
title : '宏观数据分析报告' , description : '' , content : `
< div class = "tiny-report" >
< div class = "tiny-report" >
< h2 > 宏观数据分析报告 < / h 2 >
< h2 > 宏观数据分析报告 < / h 2 >
< h6 > 1. 引言 < / h 6 >
< h6 > 1. 引言 < / h 6 >
@ -404,10 +401,9 @@ export default {
< / u l >
< / u l >
< / d i v >
< / d i v >
`
`
} ,
} ,
{
{ title : '可视化报告' , description : '' , content : `
title : '可视化报告' , description : '' , content : `
< div class = "tiny-report" >
< div class = "tiny-report" >
< h2 > 可视化报告 < / h 2 >
< h2 > 可视化报告 < / h 2 >
< h6 > 1. 封面 < / h 6 >
< h6 > 1. 封面 < / h 6 >
@ -476,10 +472,9 @@ export default {
< / u l >
< / u l >
< / d i v >
< / d i v >
`
`
} ,
} ,
{
{ title : '数据分析报告' , description : '' , content : `
title : '数据分析报告' , description : '' , content : `
< div class = "tiny-report" >
< div class = "tiny-report" >
< h2 > 数据分析报告 < / h 2 >
< h2 > 数据分析报告 < / h 2 >
< h6 > 1. 引言 < / h 6 >
< h6 > 1. 引言 < / h 6 >
@ -554,7 +549,7 @@ export default {
< / u l >
< / u l >
< / d i v >
< / d i v >
`
`
} ,
} ,
] ,
] ,
// 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]',
@ -562,7 +557,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',
// images_upload_url: 'http://10.10.11.7:10000/iasf/sysFiles/upload',
// images_upload_url: 'http://10.10.11.7:10000/iasf/sysFiles/upload',
@ -572,15 +567,15 @@ export default {
powerpaste _html _import : 'clean' ,
powerpaste _html _import : 'clean' ,
// 自定义上传
// 自定义上传
images _upload _handler : function ( blobInfo , succFun , failFun ) {
images _upload _handler : function ( blobInfo , succFun , failFun ) {
const blob = blobInfo . blob ( )
const blob = blobInfo . blob ( )
// blob转换为file
// blob转换为file
const file = new File ( [ blob ] , blobInfo . filename ( ) , {
const file = new File ( [ blob ] , blobInfo . filename ( ) , {
type : 'application/json' ,
type : 'application/json' ,
lastModified : Date . now ( )
lastModified : Date . now ( )
} ) ;
} ) ;
Oss . upload ( file ) . then ( res => {
Oss . upload ( file ) . then ( res => {
succFun ( res . url )
succFun ( res . url )
} )
} )
} ,
} ,
//自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发
//自定义文件选择器的回调内容 此方法只有在点击上方图片按钮才会触发
file _picker _callback : function ( callback , value , meta ) {
file _picker _callback : function ( callback , value , meta ) {
@ -596,23 +591,23 @@ 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 ] ;
const load = Loading . service ( )
const load = Loading . service ( )
Oss . upload ( file ) . then ( res => {
Oss . upload ( file ) . then ( res => {
load . close ( )
load . close ( )
callback ( res . url )
callback ( res . url )
} ) . catch ( e => {
} ) . catch ( e => {
load . close ( )
load . close ( )
} )
} )
}
}
//触发点击
//触发点击
input . click ( ) ;
input . click ( ) ;
}
}
} ,
} ,
// 初始化事件
// 初始化事件
setup : function ( editor ) {
setup : function ( editor ) {
editor . on ( 'init' , function ( ed ) {
editor . on ( 'init' , function ( ed ) {
// 设置默认字体
// 设置默认字体
ed . target . editorCommands . execCommand ( "fontName" , false , "Microsoft Yahei" )
ed . target . editorCommands . execCommand ( "fontName" , false , "Microsoft Yahei" )
ed . target . editorCommands . execCommand ( "fontSize" , false , "19px" )
ed . target . editorCommands . execCommand ( "fontSize" , false , "19px" )