|
@@ -95,7 +95,7 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { ref } from 'vue'
|
|
|
|
|
|
|
+import { ref, watch } from 'vue'
|
|
|
import useImport from '@/hooks/useImport'
|
|
import useImport from '@/hooks/useImport'
|
|
|
import FileInput from '@/components/FileInput.vue'
|
|
import FileInput from '@/components/FileInput.vue'
|
|
|
import message from '@/utils/message'
|
|
import message from '@/utils/message'
|
|
@@ -109,7 +109,7 @@ const emit = defineEmits<{
|
|
|
(e: 'setTitle', title: string, type: number): void
|
|
(e: 'setTitle', title: string, type: number): void
|
|
|
}>()
|
|
}>()
|
|
|
|
|
|
|
|
-const { importPPTXFile, exporting } = useImport()
|
|
|
|
|
|
|
+const { importPPTXFile, exporting, imgExporting } = useImport()
|
|
|
const mainStore = useMainStore()
|
|
const mainStore = useMainStore()
|
|
|
const { setRunningState } = mainStore
|
|
const { setRunningState } = mainStore
|
|
|
const currentFileName = ref('')
|
|
const currentFileName = ref('')
|
|
@@ -157,6 +157,24 @@ const handleFileUpload = async (files: FileList) => {
|
|
|
// console.log('取消删除')
|
|
// console.log('取消删除')
|
|
|
// },
|
|
// },
|
|
|
// })
|
|
// })
|
|
|
|
|
+ // 等图片上传完毕(imgExporting === false)后触发保存
|
|
|
|
|
+ const trySave = () => {
|
|
|
|
|
+ const parentWindow = window.parent as any
|
|
|
|
|
+ parentWindow?.save?.(3)
|
|
|
|
|
+ }
|
|
|
|
|
+ if (imgExporting.value === false) {
|
|
|
|
|
+ // 没有图片需要上传,立即保存
|
|
|
|
|
+ trySave()
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ // 有图片正在上传,等上传完毕再保存
|
|
|
|
|
+ const stopWatch = watch(imgExporting, (val) => {
|
|
|
|
|
+ if (val === false) {
|
|
|
|
|
+ stopWatch()
|
|
|
|
|
+ trySave()
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
} })
|
|
} })
|
|
|
}
|
|
}
|
|
|
catch (error) {
|
|
catch (error) {
|