Browse Source

Merge branch 'demand-199-copy'

cxmo 5 months ago
parent
commit
d61de9e55b

+ 17 - 2
src/views/ppt_manage/mixins/pptEditorMixins.js

@@ -69,8 +69,9 @@ export default{
     'click-title-outside':{
         bind(el,binding){
             const clickHandle = (e)=>{
+                e.preventDefault()
                 //点击标题区域和标题设置之外的地方,退出标题编辑模式
-                if(el.contains(e.target)||NodeCheck(e.target,'title-edit-box')||NodeCheck(e.target,'title-editor')){
+                if(NodeCheck(e.target,'title-edit-box')||NodeCheck(e.target,'title-editor')){
                   return false
                 }
                 if(binding.value && typeof binding.value === 'function'){
@@ -102,7 +103,21 @@ export default{
         }
         //如果点击的页不是当前页,将点击页切换至当前页
         if(this.currentItem.id!==item.id){
-            this.changeCurrentItem(item)
+            //this.changeCurrentItem(item,'change')
+            const {id} = item
+            //切换到其他活跃页的时候,需退出图层编辑模式
+            if(this.currentItem&&this.currentItem.id!==id){
+            this.isEditLayer = false
+            this.activeLayerEl = {}
+            
+            this.isEditTitle = false
+            }
+            this.pageList.map((item,index)=>{
+            if(item.id===id){
+                this.currentItem = item
+                this.currentIndex = index
+            }
+            })
         }
         //this.isEditTitle = !this.isEditTitle
         this.isEditTitle = true

+ 13 - 5
src/views/ppt_manage/newVersion/pptEditor.vue

@@ -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,13 +54,13 @@
                     <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.stop="changeCurrentItem(item)">
+                        @click="changeCurrentItem(item)">
                         <!-- 标题 -->
                         <!-- <div class="title-wrap" style="background-color: #999999;">
                             <input type="text" placeholder="单击输入标题" v-model="item.title"/> 
                         </div> -->
                         <!-- 自定义标题 -->
-                        <div
+                        <div @click.stop
                             :class="[
                                 'ppt-editor-title',
                                 'custom-title-wrap',
@@ -812,9 +812,17 @@ 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')
+          console.log('开始滑动')
+          pptEditorDom.scrollTo({
+            top:height*index,
               left:0,
               behavior: 'smooth'
           })

+ 1 - 1
src/views/ppt_manage/newVersion/pptEnEditor.vue

@@ -52,7 +52,7 @@
                 <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.stop="changeCurrentItem(item)">
+                  @click="changeCurrentItem(item)">
                     <!-- 标题 -->
                     <!-- <div class="title-wrap" style="left:8%;width:62%;">
                         <input type="text" :placeholder="$t('Slides.click_to_input_title')" v-model="item.title"/>