Browse Source

Merge branch 'demand-199-copy' into custom

cxmo 9 months ago
parent
commit
69d06f07d3

+ 4 - 2
src/lang/modules/Slides/pptPresent.js

@@ -103,7 +103,8 @@ export const presentEn = {
   apply_to_the_entire:'Apply to the entire PPT',
   title_style_fontfamily:"Font Family",
   title_style_fontsize:'Font Size',
-  title_style_color:'Font Color'
+  title_style_color:'Font Color',
+  title_paste_hint:'The clipboard is empty, please paste the text',
 };
 
 /* 中文 */
@@ -207,7 +208,8 @@ export const presentZh = {
   apply_to_the_entire:'应用至整个PPT',
   title_style_fontfamily:"字体设置",
   title_style_fontsize:'字号设置',
-  title_style_color:'字体颜色'
+  title_style_color:'字体颜色',
+  title_paste_hint:'粘贴板获取为空,请粘贴文本',
 };
 
 /**

+ 12 - 1
src/views/ppt_manage/mixins/pptEditorMixins.js

@@ -88,7 +88,18 @@ export default{
     }
   },
   methods:{
-    testInput(e,item){
+    handlePaste(e,item){
+        //不触发input
+        e.preventDefault()
+        //只获取文字
+        const text = e.clipboardData.getData('text/plain')
+        if(!text.trim().length){
+            this.$message.warning(this.$t('Slides.title_paste_hint'))
+        }
+        e.target.innerHTML += text.trim()
+        item.title += text.trim()
+    },
+    handleInput(e,item){
         const text = e.target.innerHTML
         item.title = text
     },

+ 2 - 1
src/views/ppt_manage/newVersion/pptEditor.vue

@@ -99,7 +99,8 @@
                                 }:{ color:'#333',fontSize:'22px',fontFamily:'helvetica',outline:0}"
                                     v-click-title-outside="exitEditTitle"
                                     @click.stop="handleEditTitle(item)"
-                                    @input="(e)=>testInput(e,item)"></div>
+                                    @paste.stop="(e)=>handlePaste(e,item)"
+                                    @input="(e)=>handleInput(e,item)"></div>
                         </div>
                         <!-- 内容 -->
                         <component  :is="getComponentName(item.modelId)"

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

@@ -85,7 +85,8 @@
                                 }:{ color:'#333',fontSize:'22px',fontFamily:'helvetica',outline:0}"
                                     v-click-title-outside="exitEditTitle"
                                     @click.stop="handleEditTitle(item)"
-                                    @input="(e)=>testInput(e,item)"></div>
+                                    @paste.stop="(e)=>handlePaste(e,item)"
+                                    @input="(e)=>handleInput(e,item)"></div>
                         </div>
                     <!-- 内容 -->
                     <component  :is="getComponentName(item.modelId)"