diff --git a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db index 0a09e6425..d90365421 100644 Binary files a/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db and b/aspnet-core/services/apigateway/LINGYUN.ApiGateway.Host/event-bus-cap.db differ diff --git a/vueJs/src/lang/en.ts b/vueJs/src/lang/en.ts index 731253f2c..490de1eca 100644 --- a/vueJs/src/lang/en.ts +++ b/vueJs/src/lang/en.ts @@ -494,11 +494,17 @@ export default { file: '文件', fileType: '{exten}文件', size: '大小', + progress: '进度', + begin: '开始', + remove: '移除', root: '文件系统', download: '下载文件', + bacthDownload: '批量下载', + downloadTask: '下载任务', upload: '上传文件', deleteFolder: '删除目录', deleteFile: '删除文件', + bacthDelete: '批量删除', addFile: '添加文件', addFolder: '添加目录', uploadError: '上传失败', diff --git a/vueJs/src/lang/zh.ts b/vueJs/src/lang/zh.ts index 65015b454..3abd9905a 100644 --- a/vueJs/src/lang/zh.ts +++ b/vueJs/src/lang/zh.ts @@ -498,11 +498,17 @@ export default { file: '文件', fileType: '{exten}文件', size: '大小', + progress: '进度', + begin: '开始', + remove: '移除', root: '文件系统', download: '下载文件', + bacthDownload: '批量下载', + downloadTask: '下载任务', upload: '上传文件', deleteFolder: '删除目录', deleteFile: '删除文件', + bacthDelete: '批量删除', addFile: '添加文件', addFolder: '添加目录', uploadError: '上传失败', diff --git a/vueJs/src/views/file-management/components/FileDownloadForm.vue b/vueJs/src/views/file-management/components/FileDownloadForm.vue new file mode 100644 index 000000000..d9dc4f037 --- /dev/null +++ b/vueJs/src/views/file-management/components/FileDownloadForm.vue @@ -0,0 +1,165 @@ + + + diff --git a/vueJs/src/views/file-management/index.vue b/vueJs/src/views/file-management/index.vue index d2ec4650d..86d63218e 100644 --- a/vueJs/src/views/file-management/index.vue +++ b/vueJs/src/views/file-management/index.vue @@ -1,28 +1,19 @@ @@ -181,6 +178,7 @@ import { Vue } from 'vue-property-decorator' import DataListMiXin from '@/mixins/DataListMiXin' import Component, { mixins } from 'vue-class-component' import FileUploadForm from './components/FileUploadForm.vue' +import FileDownloadForm, { FileInfo } from './components/FileDownloadForm.vue' import Pagination from '@/components/Pagination/index.vue' import FileSystemService, { FileSystemGetByPaged, FileSystemType } from '@/api/filemanagement' @@ -193,7 +191,8 @@ const $contextmenu = Vue.prototype.$contextmenu name: 'FileManagement', components: { Pagination, - FileUploadForm + FileUploadForm, + FileDownloadForm }, filters: { dateTimeFilter(datetime: string) { @@ -256,6 +255,9 @@ export default class extends mixins(DataListMiXin) { private lastFilePath = '' private fileSystemRoot = new Array() + private showDownloadDialog = false + private downloadFiles = new Array() + public dataFilter = new FileSystemGetByPaged() mounted() { @@ -332,42 +334,20 @@ export default class extends mixins(DataListMiXin) { } private handleDownloadFile(path: string, fileName: string, size: number) { - this.downloading = true - const blobs = new Array() - this.downlodFile(path, fileName, size, 0, blobs, - (downloadSize: number) => { - if (downloadSize >= size) { - this.downloading = false - // 释放空间 - blobs.length = 0 - } - }) + if (!this.downloadFiles.some(x => x.name === fileName && x.path === path)) { + const file = new FileInfo() + file.name = fileName + file.path = path + file.size = size + file.progress = 0 + this.downloadFiles.push(file) + } + this.showDownloadDialog = true } - private downlodFile(path: string, fileName: string, size: number, currentByte: number, blobs: BlobPart[], callback: Function) { - FileSystemService.downlodFle(fileName, path, currentByte).then((res: any) => { - // 获取当前下载字节大小 - const downloadByte = res.data.size - // 当前下载分块入栈 - blobs.push(res.data) - currentByte += downloadByte - if (size > currentByte) { - this.downlodFile(path, fileName, size, currentByte, blobs, callback) - } else { - // 合并下载文件 - const url = window.URL.createObjectURL(new Blob(blobs, { type: res.headers['content-type'] })) - const link = document.createElement('a') - link.style.display = 'none' - link.href = url - link.setAttribute('download', fileName) - document.body.appendChild(link) - link.click() - // 下载完成后的回调 - callback(size) - } - }).catch(() => { - callback(size) - }) + private onFileRemoved(fileInfo: FileInfo) { + const index = this.downloadFiles.findIndex(x => x.path === fileInfo.path && x.name === fileInfo.name) + this.downloadFiles.splice(index, 1) } private onRowClick(row: any) { @@ -449,6 +429,37 @@ export default class extends mixins(DataListMiXin) { } this.lastFilePath = path this.showFileUploadDialog = true + }, + divided: true + }, + { + label: this.$t('fileSystem.bacthDownload'), + disabled: !checkPermission(['AbpFileManagement.FileSystem.FileManager.Download']), + onClick: () => { + const table = this.$refs.fileSystemTable as any + // 过滤未添加到下载列表的文件 + const selectFiles = table.selection.filter((x: any) => x.type === 1 && !this.downloadFiles.some(f => f.name === x.name && f.path === x.path)) + // 格式化文件列表别添加到下载列表 + this.downloadFiles.push(...selectFiles.map((f: any) => { + const file = new FileInfo() + file.name = f.name + file.path = f.parent + file.size = f.size + file.progress = 0 + return file + })) + // 显示下载列表 + this.showDownloadDialog = true + } + }, + { + label: this.$t('fileSystem.bacthDelete'), + disabled: true, // !checkPermission(['AbpFileManagement.FileSystem.FileManager.Delete']), + onClick: () => { + // 未公布批量删除接口 + // const table = this.$refs.fileSystemTable as any + // 过滤类型为文件的选中项 + // const selectFiles = table.selection.filter((x: any) => x.type === 1) } } ],