基础文件上传核心开发

This commit is contained in:
朱浩 2024-07-17 13:42:12 +08:00
parent 2a31a70a49
commit f7ca6079ae
2 changed files with 16 additions and 8 deletions

View File

@ -37,7 +37,7 @@
<div class="prepare-body-main-item-info">
<div class="prepare-item-info-title">{{ item.raw.name }}</div>
<div class="prepare-item-info-message">
<div>{{formatFileSize(item.raw.size)}}</div>
<div>{{ formatFileSize(item.raw.size) }}</div>
<!-- &nbsp;&nbsp;|&nbsp;&nbsp;-->
<!-- <div>古诗词诵读 > 静女</div>-->
</div>
@ -50,7 +50,12 @@
</div>
</template>
<template #reference>
<div class="talk-uploader-wrap" draggable="true" style="margin: auto">
<div
v-show="uploaderStore.uploadList && uploaderStore.uploadList.length > 0"
class="talk-uploader-wrap"
draggable="true"
style="margin: auto"
>
<svg class="icon" aria-hidden="true" font-size="50px">
<use xlink:href="#icon-yunwenjian-"></use>
</svg>
@ -70,8 +75,7 @@ export default {
data() {
return {
timer: null,
uploadDatas: {
},
uploadDatas: {},
uploadUrl: import.meta.env.VITE_APP_BASE_API + '/smarttalk/file/upload',
headers: {
Authorization: 'Bearer ' + getToken()
@ -95,9 +99,9 @@ export default {
}, 1000)
},
mounted() {
ipcRenderer.send('get-root-file-path');
ipcRenderer.once('get-root-file-path-reply',(e, path)=>{
window.rootTalkFilePath = path;
ipcRenderer.send('get-root-file-path')
ipcRenderer.once('get-root-file-path-reply', (e, path) => {
window.rootTalkFilePath = path
})
},
methods: {
@ -120,7 +124,10 @@ export default {
},
onSuccess(res, file, files) {
this.removeUploadFile(file.uid)
ipcRenderer.send('copy-file-default',{ source:file.raw.path, destination:res.resData.fileNewName})
ipcRenderer.send('copy-file-default', {
source: file.raw.path,
destination: res.resData.fileNewName
})
file.callback(res)
},
beforeUpload(file) {

View File

@ -284,6 +284,7 @@ export default {
res.resData.levelSecondId == _this.uploadData.levelSecondId &&
res.resData.levelThirdId == _this.uploadData.levelThirdId
) {
res.resData.async = true;
_this.currentFileList.unshift(res.resData)
ElMessage({
type: 'success',