wa1k3r 4 лет назад
Родитель
Сommit
2c82d8a171
2 измененных файлов: 11 добавлений и 4 удалений
  1. +3
    -4
      src/services/system.js
  2. +8
    -0
      src/views/main_web/workspace/workspace.new.vue

+ 3
- 4
src/services/system.js Просмотреть файл

@@ -175,12 +175,12 @@ const system = {
console.log('receive download file message:', e);
if(e.data === '-1') {
notify.error('文件上传失败');
onErrorHandler(e);
onErrorHandler(e, uploadFile);
return;
}
if(e.data === '-2') {
notify.error('请先关闭本地文件后再上传');
onErrorHandler(e);
onErrorHandler(e, uploadFile);
return;
}
try {
@@ -202,10 +202,9 @@ const system = {
if(res.Code !== 0) return;
notify.success(maybeFile ? '上传成功, 已覆盖同名文件' : '上传成功');
onSuccessHandler(uploadFile);
} catch (e) {
console.error('socket-upload-file parse data have error:', e);
// todo 上传失败
onErrorHandler(e, uploadFile);
}
});
socket.on('error', e => {


+ 8
- 0
src/views/main_web/workspace/workspace.new.vue Просмотреть файл

@@ -689,6 +689,10 @@ export default {
this.uploadFileList.push(uploadFile);
}
},
(e, upperFile) => {
this.removeFileLoadingState(upperFile.Id);
this.uploadFileList = this.uploadFileList.filter(iFile => iFile.id !== upperFile.Id);
}
);
},
/**
@@ -742,6 +746,9 @@ export default {
const { folderName, levelId, id: folderId } = this.currentNodeFolder;
const { archName, extension, id: fileId } = file;
this.updateFileLoadState(fileId, UPLOADING, 0);
const errorHandler = () => {
this.removeFileLoadingState(file.id);
}
// const fileList = this.currentPageType === 0 ? this.folderFileList.listMyFiles : this.folderFileList.listOtherFiles;
const fileKey = `${folderName}\\${archName}${extension ? `.${extension}`:''}`;
system.updateFile(
@@ -762,6 +769,7 @@ export default {
const { process, hash, size, currentSize, unit } = progressData;
this.updateFileLoadState(fileId, UPLOADING, process, currentSize, size, unit);
},
errorHandler,
);
},
/**


Загрузка…
Отмена
Сохранить