Browse Source

feat(EditorHeader): 添加 PPTX 文件上传功能

在编辑器头部菜单中添加 PPTX 文件上传按钮,支持导入外部 PPTX 文件
lsc 1 day ago
parent
commit
546a3a2dea
1 changed files with 11 additions and 1 deletions
  1. 11 1
      src/views/Editor/EditorHeader/index.vue

+ 11 - 1
src/views/Editor/EditorHeader/index.vue

@@ -29,8 +29,13 @@
           <!-- <PopoverMenuItem @click="goLink('https://github.com/pipipi-pikachu/PPTist/blob/master/doc/Q&A.md')">常见问题</PopoverMenuItem> -->
           <PopoverMenuItem @click="mainMenuVisible = false; hotkeyDrawerVisible = true">快捷操作</PopoverMenuItem>
         </template>
-        <div class="menu-item"><IconHamburgerButton class="icon" /></div>
+        <div class="menu-item"  v-show="false"><IconHamburgerButton class="icon" /></div>
       </Popover>
+      <FileInput accept="application/vnd.openxmlformats-officedocument.presentationml.presentation" @change="files => {
+        importPPTXFile(files)
+      }">
+        <div class="menu-item"><svg class="icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>上传 PPTX 文件</div>
+      </FileInput>
 
       <div class="title" v-show="false">
         <Input 
@@ -204,6 +209,11 @@ const setTitle = (newTitle: string) => {
   &:hover {
     background-color: #f1f1f1;
   }
+
+  svg {
+    width: 18px;
+    margin-right: 5px;
+  }
 }
 .group-menu-item {
   height: 30px;