|
@@ -46,7 +46,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="ppt-editor-wrap ppt-page-wrap" v-loading="isChartLoading" :element-loading-text="chartLoadingText">
|
|
|
- <div class="ppt-editor" ref="pptEditor" @paste="handlePasteOutSide">
|
|
|
+ <div class="ppt-editor" id="pptEditor" ref="pptEditor" @paste="handlePasteOutSide">
|
|
|
<!-- 显示全部ppt -->
|
|
|
<template v-if="pageList.length">
|
|
|
<!-- <transition-group name="flip-list"> -->
|
|
@@ -54,10 +54,52 @@
|
|
|
<AddFormat @addPage="addPage($event,index)" :chooseModalId="chooseModalId"/>
|
|
|
<div class="ppt-item" :class="{'choose':currentItem.id===item.id}"
|
|
|
v-loading="item.isUpdating" :element-loading-text="$t('Slides.updating_chart_loading')"
|
|
|
- @click="changeCurrentItem(item)">
|
|
|
+ @click.stop="changeCurrentItem(item)">
|
|
|
<!-- 标题 -->
|
|
|
- <div class="title-wrap">
|
|
|
- <input type="text" :placeholder="$t('Slides.click_to_input_title')" v-model="item.title"/>
|
|
|
+ <!-- <div class="title-wrap" style="background-color: #999999;">
|
|
|
+ <input type="text" placeholder="单击输入标题" v-model="item.title"/>
|
|
|
+ </div> -->
|
|
|
+ <!-- 自定义标题 -->
|
|
|
+ <div @click.stop
|
|
|
+ :class="[
|
|
|
+ 'ppt-editor-title',
|
|
|
+ 'custom-title-wrap',
|
|
|
+ currentItem.id===item.id&&isEditTitle?'editor-model':''
|
|
|
+ ]"
|
|
|
+ :style="item.titleDetail?{
|
|
|
+ left:item.titleDetail.left+'%',
|
|
|
+ top:item.titleDetail.top+'%',
|
|
|
+ width:item.titleDetail.width+'%',
|
|
|
+ height:item.titleDetail.height+'%',
|
|
|
+ }:{
|
|
|
+ left:'10%',top:'6.6%',width:'68%',height:'5%',
|
|
|
+ }">
|
|
|
+ <!-- <div class="title" v-html="item.title"></div> -->
|
|
|
+ <!-- <el-input type="textarea" placeholder="单击输入标题" v-model="item.title"
|
|
|
+ autosize resize="none"
|
|
|
+ spellcheck="false"
|
|
|
+ :style="item.titleDetail?{
|
|
|
+ color:item.titleDetail.color,
|
|
|
+ fontSize:item.titleDetail.fontSize+'px',
|
|
|
+ fontFamily:item.titleDetail.fontFamily,
|
|
|
+ '--titleColor':item.titleDetail.color,
|
|
|
+ '--fontSize':item.titleDetail.fontSize,
|
|
|
+ '--fontFamily':item.titleDetail.fontFamily,
|
|
|
+ }:{ color:'#333',fontSize:'22px',fontFamily:'helvetica' }"
|
|
|
+ @focus="handleEditTitle(item)"
|
|
|
+ v-click-title-outside="exitEditTitle"></el-input> -->
|
|
|
+ <div contenteditable="true" spellcheck="false"
|
|
|
+ :id="`page_title__${index}`"
|
|
|
+ class="title-editor"
|
|
|
+ :style="item.titleDetail?{
|
|
|
+ color:item.titleDetail.color||'#333',
|
|
|
+ fontSize:(item.titleDetail.fontSize||22)+'px',
|
|
|
+ fontFamily:(item.titleDetail.fontFamily||'helvetica'),
|
|
|
+ outline:0,
|
|
|
+ }:{ color:'#333',fontSize:'22px',fontFamily:'helvetica',outline:0}"
|
|
|
+ v-click-title-outside="exitEditTitle"
|
|
|
+ @click.stop="handleEditTitle(item)"
|
|
|
+ @input="(e)=>testInput(e,item)"></div>
|
|
|
</div>
|
|
|
<!-- 内容 -->
|
|
|
<component :is="getComponentName(item.modelId)"
|
|
@@ -68,6 +110,7 @@
|
|
|
:isCopy="true"
|
|
|
:isAdd="true"
|
|
|
:isEditLayer="isEditLayer"
|
|
|
+ :isEditTitle="isEditTitle"
|
|
|
:choosedId="currentItem.id"
|
|
|
:activeLayerEl="activeLayerEl"
|
|
|
:amendatoryPositionInfo="item.positionInfo"
|
|
@@ -121,7 +164,7 @@
|
|
|
</div>
|
|
|
<div class="richtext-tool"></div>
|
|
|
<!-- 防止el-tabs未渲染时触发scrollToActiveTab 报错,v-if改为v-show-->
|
|
|
- <div class="addppt-right-box" v-show="!isEditLayer">
|
|
|
+ <div class="addppt-right-box" v-show="!isEditLayer&&!isEditTitle">
|
|
|
<el-tabs v-model="tabsactive">
|
|
|
<el-tab-pane :label="tab.label" :name="tab.val" v-for="tab in panelTabs" :key="tab.val"></el-tab-pane>
|
|
|
</el-tabs>
|
|
@@ -187,7 +230,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<!-- 图层编辑 -->
|
|
|
- <div class="layer-edit-box" v-show="isEditLayer">
|
|
|
+ <div class="layer-edit-box" v-if="isEditLayer">
|
|
|
<el-collapse v-model="activeNames" class="tool-list">
|
|
|
<el-collapse-item :title="$t('Slides.layer_element')" name="el">
|
|
|
<div class="el-wrap">
|
|
@@ -226,6 +269,20 @@
|
|
|
</el-collapse-item>
|
|
|
</el-collapse>
|
|
|
</div>
|
|
|
+ <!-- 标题编辑 -->
|
|
|
+ <div class="title-edit-box" v-if="isEditTitle">
|
|
|
+ <p>
|
|
|
+ {{$t('Slides.page_title_style_setting')}}
|
|
|
+ </p>
|
|
|
+ <TitleEditorTool
|
|
|
+ ref="titleEditor"
|
|
|
+ :currentItem="currentItem"
|
|
|
+ @changeSizeAll="changeSizeAll"
|
|
|
+ @changePositionAll="changePositionAll"
|
|
|
+ @styleChange="handleTitelStyleChange"
|
|
|
+ @textChange="handleTextChange"
|
|
|
+ @applyToAll="changeSettingAll"/>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -280,7 +337,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {countComponentName,checkClipboardItems,createRandomCode,checkPPTpageElemant,getChartInfo} from './utils/untils';
|
|
|
+import {countComponentName,checkClipboardItems,createRandomCode,checkPPTpageElemant,getChartInfo,getPlainText} from './utils/untils';
|
|
|
import {modelInfo,defaultPosition} from './utils/config'
|
|
|
import http from '@/api/http.js';
|
|
|
import { dataBaseInterface ,sandInterface } from "@/api/api.js";
|
|
@@ -310,6 +367,7 @@ import InsertCharts from './components/editor/InsertCharts.vue';
|
|
|
import ContextMenu from './components/ContextMenu.vue';
|
|
|
import InsertSemantics from './components/editor/InsertSemantics.vue';
|
|
|
import ChooseCoverNew from './components/editor/ChooseCoverNew.vue';
|
|
|
+import TitleEditorTool from './components/editor/TitleEditorTool';
|
|
|
export default {
|
|
|
mixins:[pptmixin,//ppt页面共同逻辑
|
|
|
mixins,//图表加载逻辑
|
|
@@ -319,7 +377,7 @@ export default {
|
|
|
components: {
|
|
|
IndexItem, ChooseCover, AddFormat, ShapePreview,
|
|
|
LayerEditTool, DeletePageDialog, ChangeFormatDialog, InsertPageDialog, addMyClassifyDia, InsertCharts, ContextMenu, InsertSemantics,
|
|
|
- ChooseCoverNew
|
|
|
+ ChooseCoverNew,TitleEditorTool
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -464,7 +522,7 @@ export default {
|
|
|
//防止自动保存时,有某一页处于更新图表的状态,其isUpdating为true
|
|
|
this.pageList.forEach(i=>{
|
|
|
i.isUpdating = false
|
|
|
- })
|
|
|
+ })
|
|
|
this.dataLoading.close();
|
|
|
$('.ppt-item').css('background-image',`url(${this.pptBgImage})`);
|
|
|
//开启自动保存
|
|
@@ -476,13 +534,14 @@ export default {
|
|
|
await this.getpptDataById(id)
|
|
|
const {status} = this.result
|
|
|
if(status===200){
|
|
|
- const {content,FirstPage,ReportId} = this.result
|
|
|
+ const {content,FirstPage,ReportId,TitleSetting} = this.result
|
|
|
this.pageList = content
|
|
|
this.firstPage = FirstPage
|
|
|
this.firstPage.BackIndex = FirstPage.TemplateType-1
|
|
|
this.currentItem = this.pageList[0]
|
|
|
this.ReportId=ReportId
|
|
|
this.CoverContent = this.result.CoverContent
|
|
|
+ this.titleSetting = TitleSetting||null
|
|
|
/* //开启自动保存
|
|
|
this.autoSave() */
|
|
|
}else{
|
|
@@ -519,6 +578,7 @@ export default {
|
|
|
modelId: modelId,
|
|
|
title:'',
|
|
|
elements: [],
|
|
|
+ titleDetail:this.titleSetting?this.titleSetting:null
|
|
|
}
|
|
|
//限制取消
|
|
|
/* if(this.pageList.length>=this.maxPageNum){
|
|
@@ -742,6 +802,13 @@ export default {
|
|
|
if(this.currentItem&&this.currentItem.id!==id){
|
|
|
this.isEditLayer = false
|
|
|
this.activeLayerEl = {}
|
|
|
+
|
|
|
+ this.isEditTitle = false
|
|
|
+ }
|
|
|
+ //点击当前页时,退出标题编辑模式
|
|
|
+ if(this.currentItem&&this.currentItem.id===id){
|
|
|
+ this.isEditTitle = false
|
|
|
+ return
|
|
|
}
|
|
|
this.pageList.map((item,index)=>{
|
|
|
if(item.id===id){
|
|
@@ -751,9 +818,16 @@ export default {
|
|
|
})
|
|
|
this.$nextTick(()=>{
|
|
|
let height = $('.ppt-editor-item')[0].offsetHeight
|
|
|
+ const index = this.currentIndex
|
|
|
//pptEditor的滚动条动画
|
|
|
- this.$refs.pptEditor.scrollTo({
|
|
|
- top:height*this.currentIndex,
|
|
|
+ /* this.$refs.pptEditor.scrollTo({
|
|
|
+ top:height*index,
|
|
|
+ left:0,
|
|
|
+ behavior: 'smooth'
|
|
|
+ }) */
|
|
|
+ const pptEditorDom = document.getElementById('pptEditor')
|
|
|
+ pptEditorDom.scrollTo({
|
|
|
+ top:height*index,
|
|
|
left:0,
|
|
|
behavior: 'smooth'
|
|
|
})
|
|
@@ -1049,7 +1123,8 @@ export default {
|
|
|
FirstPage:FirstPage,
|
|
|
Content:Content,
|
|
|
GroupId:this.catalogId,
|
|
|
- CoverContent:this.CoverContent
|
|
|
+ CoverContent:this.CoverContent,
|
|
|
+ TitleSetting:JSON.stringify(this.titleSetting)
|
|
|
}).then(res=>{
|
|
|
this.isSaved = false
|
|
|
if(res.Ret===200){
|
|
@@ -1070,7 +1145,8 @@ export default {
|
|
|
PptId:parseInt(ppt_id),
|
|
|
FirstPage:FirstPage,
|
|
|
Content:Content,
|
|
|
- CoverContent:this.CoverContent
|
|
|
+ CoverContent:this.CoverContent,
|
|
|
+ TitleSetting:JSON.stringify(this.titleSetting)
|
|
|
}).then(res=>{
|
|
|
this.isSaved = false
|
|
|
if(res.Ret===200){
|
|
@@ -1108,11 +1184,13 @@ export default {
|
|
|
return i
|
|
|
})
|
|
|
let Content = JSON.stringify(pageList)
|
|
|
+ let TitleSetting = JSON.stringify(this.titleSetting)
|
|
|
pptInterface.saveLog({
|
|
|
PptId:parseInt(ppt_id),
|
|
|
FirstPage:FirstPage,
|
|
|
Content:Content,
|
|
|
- CoverContent:this.CoverContent
|
|
|
+ CoverContent:this.CoverContent,
|
|
|
+ TitleSetting,
|
|
|
}).then((res)=>{
|
|
|
if(res.Ret!==200) return
|
|
|
this.showLastSaveTime = true
|
|
@@ -1323,23 +1401,6 @@ export default {
|
|
|
<style lang="scss">
|
|
|
@import './css/common.scss';
|
|
|
@import './css/format.scss';
|
|
|
-.page-wrap{
|
|
|
- .ppt-editor-wrap{
|
|
|
- .ppt-tool{
|
|
|
- .layer-edit-box{
|
|
|
- .tool-list{
|
|
|
- .el-collapse-item__header{
|
|
|
- margin-bottom: 0;
|
|
|
- }
|
|
|
- .el-collapse-item__wrap{
|
|
|
- overflow: visible;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
</style>
|
|
|
<style scoped lang="scss">
|
|
|
$titleColor:#333333;
|
|
@@ -1493,17 +1554,19 @@ $titleColor:#333333;
|
|
|
min-width:320px;
|
|
|
width: 320px;
|
|
|
height:100%;
|
|
|
- .tool-btn{
|
|
|
- margin-bottom: 12px;
|
|
|
+ overflow-y: hidden;
|
|
|
+ .richtext-tool{
|
|
|
+ margin:10px 0;
|
|
|
}
|
|
|
.addppt-right-box{
|
|
|
flex: 1;
|
|
|
- height: calc(100% - 182px);
|
|
|
+ /* height: calc(100% - 182px); */
|
|
|
padding: 0 10px;
|
|
|
- margin-top: 12px;
|
|
|
box-sizing: border-box;
|
|
|
- border:1px solid #B2B9C3;
|
|
|
+ border: 2px solid #EBEBEB;
|
|
|
+ border-radius: 4px;
|
|
|
min-width: 320px;
|
|
|
+ overflow-y: auto;
|
|
|
#tabs {
|
|
|
padding: 0px 40px;
|
|
|
box-sizing: border-box;
|
|
@@ -1579,20 +1642,20 @@ $titleColor:#333333;
|
|
|
}
|
|
|
|
|
|
}
|
|
|
- .layer-edit-box{
|
|
|
+ .layer-edit-box,.title-edit-box{
|
|
|
flex: 1;
|
|
|
- height: calc(100% - 182px);
|
|
|
+ /* height: calc(100% - 182px); */
|
|
|
padding: 0 20px;
|
|
|
- margin-top: 12px;
|
|
|
box-sizing: border-box;
|
|
|
border: 2px solid #EBEBEB;
|
|
|
border-radius: 4px;
|
|
|
min-width: 320px;
|
|
|
- overflow-y: scroll;
|
|
|
+ overflow-y: auto;
|
|
|
.tool-list{
|
|
|
.el-wrap{
|
|
|
display: flex;
|
|
|
- justify-content: space-between;
|
|
|
+ /* justify-content: space-between; */
|
|
|
+ gap: 0 15px;
|
|
|
flex-wrap: wrap;
|
|
|
.el-item{
|
|
|
border: 1px solid #DCDFE6;
|
|
@@ -1614,24 +1677,16 @@ $titleColor:#333333;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ .title-edit-box{
|
|
|
+ display:flex;
|
|
|
+ flex-direction: column;
|
|
|
+ padding:20px;
|
|
|
+ p{
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
-<style lang="scss">
|
|
|
-.page-wrap {
|
|
|
- .el-tabs__nav-wrap::after {
|
|
|
- height: 0;
|
|
|
- }
|
|
|
- .el-tabs__item { font-size: 16px; }
|
|
|
- .layer-edit-box{
|
|
|
- .tool-list{
|
|
|
- .el-collapse-item:first-child{
|
|
|
- .el-collapse-item__content{
|
|
|
- padding-bottom: 5px;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|