|
@@ -1,44 +1,79 @@
|
|
|
<template>
|
|
|
<div class="title-editor-tool-wrap">
|
|
|
- <el-collapse v-model="activeNames" class="tool-list">
|
|
|
- <!-- 位置设置 -->
|
|
|
- <el-collapse-item :title="$t('Slides.title_location_settings')" name="position">
|
|
|
- <div>
|
|
|
- <!-- 上下 -->
|
|
|
- <span class="demonstration">{{$t('Slides.title_location_up_down')}}(%)</span>
|
|
|
- <el-slider v-model="detail.top" :max="12"></el-slider>
|
|
|
+ <div class="scroll-box">
|
|
|
+ <el-collapse v-model="activeNames" class="tool-list">
|
|
|
+ <!-- 位置设置 -->
|
|
|
+ <el-collapse-item :title="$t('Slides.title_location_settings')" name="position">
|
|
|
+ <div>
|
|
|
+ <!-- 上下 -->
|
|
|
+ <span class="demonstration">{{$t('Slides.title_location_up_down')}}(%)</span>
|
|
|
+ <el-slider v-model="detail.top" :max="12" :step="0.1"></el-slider>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <!-- 左右 -->
|
|
|
+ <span class="demonstration">{{$t('Slides.title_location_left_right')}}(%)</span>
|
|
|
+ <el-slider v-model="detail.left" :step="0.1"></el-slider>
|
|
|
+ </div>
|
|
|
+ <!-- <el-button type="text" @click="changePosition">应用至整个PPT</el-button> -->
|
|
|
+ </el-collapse-item>
|
|
|
+ <!-- 大小设置 -->
|
|
|
+ <el-collapse-item :title="$t('Slides.title_size_settings')" name="size">
|
|
|
+ <div>
|
|
|
+ <!-- 宽度 -->
|
|
|
+ <span class="demonstration">{{$t('Slides.title_size_width')}}(%)</span>
|
|
|
+ <el-slider v-model="detail.width" :max="100 - detail.left" :step="0.1"></el-slider>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <!-- 高度 -->
|
|
|
+ <span class="demonstration">{{$t('Slides.title_size_height')}}(%)</span>
|
|
|
+ <el-slider v-model="detail.height" :max="14-detail.top" :step="0.1"></el-slider>
|
|
|
+ </div>
|
|
|
+ </el-collapse-item>
|
|
|
+ <!-- <el-collapse-item :title="$t('Slides.title_content_settings')" name="content">
|
|
|
+ <div class="editor-tool"></div>
|
|
|
+ <div class="editor" id="editorDom">
|
|
|
+ <Editor v-model="content"
|
|
|
+ :init="setting"
|
|
|
+ ref="editor"/>
|
|
|
+ </div>
|
|
|
+ </el-collapse-item> -->
|
|
|
+ </el-collapse>
|
|
|
+ <div class="other-setting">
|
|
|
+ <div class="setting-item">
|
|
|
+ <!-- 字体设置 -->
|
|
|
+ <span>{{$t('Slides.title_style_fontfamily')}}</span>
|
|
|
+ <el-select v-model="detail.fontFamily">
|
|
|
+ <el-option v-for="item in fontFamily" :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <!-- 左右 -->
|
|
|
- <span class="demonstration">{{$t('Slides.title_location_left_right')}}(%)</span>
|
|
|
- <el-slider v-model="detail.left"></el-slider>
|
|
|
+ <div class="setting-item">
|
|
|
+ <!-- 字号设置 -->
|
|
|
+ <span>{{$t('Slides.title_style_fontsize')}}</span>
|
|
|
+ <el-select v-model="detail.fontSize">
|
|
|
+ <el-option v-for="item in fontSizeList" :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
</div>
|
|
|
- <!-- <el-button type="text" @click="changePosition">应用至整个PPT</el-button> -->
|
|
|
- </el-collapse-item>
|
|
|
- <!-- 大小设置 -->
|
|
|
- <el-collapse-item :title="$t('Slides.title_size_settings')" name="size">
|
|
|
- <div>
|
|
|
- <!-- 宽度 -->
|
|
|
- <span class="demonstration">{{$t('Slides.title_size_width')}}(%)</span>
|
|
|
- <el-slider v-model="detail.width" :max="100 - detail.left"></el-slider>
|
|
|
+ <div class="setting-item">
|
|
|
+ <!-- 字体颜色 -->
|
|
|
+ <span>{{$t('Slides.title_style_color')}}</span>
|
|
|
+ <el-color-picker
|
|
|
+ v-model="detail.color"
|
|
|
+ size="mini"
|
|
|
+ show-alpha
|
|
|
+ :predefine="['#333']"
|
|
|
+ />
|
|
|
+ </el-tooltip>
|
|
|
</div>
|
|
|
- <div>
|
|
|
- <!-- 高度 -->
|
|
|
- <span class="demonstration">{{$t('Slides.title_size_height')}}(%)</span>
|
|
|
- <el-slider v-model="detail.height" :max="14-detail.top"></el-slider>
|
|
|
- </div>
|
|
|
- <!-- 应用至整个PPT -->
|
|
|
- <el-button type="text" @click="changeSize">{{$t('Slides.apply_to_the_entire')}}</el-button>
|
|
|
- </el-collapse-item>
|
|
|
- <el-collapse-item :title="$t('Slides.title_content_settings')" name="content">
|
|
|
- <div class="editor-tool"></div>
|
|
|
- <div class="editor" id="editorDom">
|
|
|
- <Editor v-model="content"
|
|
|
- :init="setting"
|
|
|
- ref="editor"/>
|
|
|
- </div>
|
|
|
- </el-collapse-item>
|
|
|
- </el-collapse>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 应用至整个PPT -->
|
|
|
+ <el-button type="primary" @click="applyToAll">{{$t('Slides.apply_to_the_entire')}}</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -51,7 +86,7 @@ import "tinymce/plugins/quickbars"; //快速栏插件
|
|
|
import "tinymce/plugins/fullscreen"; //全屏插件
|
|
|
import "tinymce/plugins/paste"; //黏贴插件
|
|
|
import "tinymce/icons/default/icons";
|
|
|
-import {setting} from '../../utils/tinymceSetting'
|
|
|
+import {setting,fontSizeList,fontFamily} from '../../utils/tinymceSetting'
|
|
|
export default {
|
|
|
components:{Editor},
|
|
|
props:{
|
|
@@ -65,6 +100,7 @@ export default {
|
|
|
content:'&*^%', //若设置为空,则init时没有标题就不会触发watch,随便设置几个字符即可
|
|
|
detail:{
|
|
|
left:0,top:0,width:0,height:0,
|
|
|
+ color:'#333',fontSize:22,fontFamily:'helvetica'
|
|
|
},
|
|
|
initFlag:false,
|
|
|
setting:{
|
|
@@ -76,9 +112,13 @@ export default {
|
|
|
toolbar_persist:true,//是否一直显示toolbar
|
|
|
placeholder:this.$t('Slides.click_input_text_content'),
|
|
|
},
|
|
|
+ fontSizeList:fontSizeList,
|
|
|
+ fontFamily:fontFamily,
|
|
|
+
|
|
|
};
|
|
|
},
|
|
|
watch:{
|
|
|
+ //不用富文本用不到
|
|
|
content(con){
|
|
|
if(this.initFlag){
|
|
|
this.initFlag = false
|
|
@@ -92,7 +132,10 @@ export default {
|
|
|
detail:{
|
|
|
handler(newval){
|
|
|
//若init还未执行完成,不派发事件
|
|
|
- if(this.initFlag) return
|
|
|
+ if(this.initFlag){
|
|
|
+ this.initFlag = false
|
|
|
+ return
|
|
|
+ }
|
|
|
this.$emit("styleChange",newval)
|
|
|
},
|
|
|
deep:true
|
|
@@ -100,9 +143,9 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
initTitleEditor(){
|
|
|
- const {left,top,width,height} = this.currentItem.titleDetail
|
|
|
- this.detail = {left,top,width,height}
|
|
|
- this.content = this.currentItem.title
|
|
|
+ const {left,top,width,height,fontFamily='helvetica',fontSize=22,color='#333'} = this.currentItem.titleDetail
|
|
|
+ this.detail = {left,top,width,height,fontFamily,fontSize,color}
|
|
|
+ //this.content = this.currentItem.title
|
|
|
},
|
|
|
changePosition(){
|
|
|
const {left,top} = this.detail
|
|
@@ -112,6 +155,9 @@ export default {
|
|
|
this.changePosition()
|
|
|
const {width,height} = this.detail
|
|
|
this.$emit('changeSizeAll',{width,height})
|
|
|
+ },
|
|
|
+ applyToAll(){
|
|
|
+ this.$emit('applyToAll',this.detail)
|
|
|
}
|
|
|
},
|
|
|
};
|
|
@@ -119,10 +165,55 @@ export default {
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
.title-editor-tool-wrap{
|
|
|
+ flex:1;
|
|
|
+ display:flex;
|
|
|
+ flex-direction: column;
|
|
|
+ overflow-y:hidden;
|
|
|
#editorDom{
|
|
|
min-height: 200px;
|
|
|
border:1px solid #ccc;
|
|
|
border-top: none;
|
|
|
}
|
|
|
+ .scroll-box{
|
|
|
+ flex:1;
|
|
|
+ overflow-y:auto;
|
|
|
+ overflow-x:hidden;
|
|
|
+ margin-bottom:20px;
|
|
|
+ padding-right:5px;
|
|
|
+ .el-collapse{
|
|
|
+ .el-slider{
|
|
|
+ padding:0 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .other-setting{
|
|
|
+ margin-top:15px;
|
|
|
+ .setting-item{
|
|
|
+ display:flex;
|
|
|
+ justify-content:space-between;
|
|
|
+ /* align-items:center; */
|
|
|
+ margin-bottom:10px;
|
|
|
+ font-weight: bold;
|
|
|
+ .el-select{
|
|
|
+ width:100px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+.title-editor-tool-wrap{
|
|
|
+ .el-color-picker {
|
|
|
+ display: block;
|
|
|
+ &.el-color-picker--mini {
|
|
|
+ height: 30px;
|
|
|
+ }
|
|
|
+ .el-color-picker__trigger {
|
|
|
+ width: 60px;
|
|
|
+ height: 30px;
|
|
|
+ padding: 0;
|
|
|
+ border: 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|