|
|
|
@ -26,6 +26,8 @@ export class AllFileComponent {
|
|
|
|
|
isNoFileTitle:boolean = false //无文件时提示
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isAdmin:boolean = false //是否是管理员
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectedDataBank:string = '' //当前需要显示的资料库
|
|
|
|
|
fileNum:any = 0 //当前资料库文件数量
|
|
|
|
@ -72,6 +74,10 @@ export class AllFileComponent {
|
|
|
|
|
this.getALLFileList(value) |
|
|
|
|
this.selection.clear(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if(sessionStorage.getItem("roleType") == "0"){ |
|
|
|
|
this.isAdmin = true |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//获得所有资料库,默认显示第一个资料库的文件
|
|
|
|
@ -95,7 +101,7 @@ export class AllFileComponent {
|
|
|
|
|
this.http.get(`/api/Objects/drives`,{ |
|
|
|
|
params:paramsdata |
|
|
|
|
}).subscribe((data:any) => { |
|
|
|
|
console.log(456,data) |
|
|
|
|
// console.log(456,data)
|
|
|
|
|
this.selection.clear() |
|
|
|
|
data.contents.forEach((item)=>{ |
|
|
|
|
let typeArr = item.key.split('.') |
|
|
|
@ -214,17 +220,26 @@ export class AllFileComponent {
|
|
|
|
|
this.searchData = "搜索您的文件" |
|
|
|
|
this.isCancel = false |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
allFiles:any //搜索出来的全部文件
|
|
|
|
|
checkedAllFiles:any = [] |
|
|
|
|
//点击搜索
|
|
|
|
|
search(){ |
|
|
|
|
console.log(13,this.searchData) |
|
|
|
|
if(this.searchData != "搜索您的文件"){ |
|
|
|
|
this.http.get("/api/Objects/drives",{ |
|
|
|
|
params:{ |
|
|
|
|
prefix : this.searchData, |
|
|
|
|
delimiter : "/" |
|
|
|
|
prefix : "allFiles", |
|
|
|
|
delimiter : "" |
|
|
|
|
} |
|
|
|
|
}).subscribe(data=>{ |
|
|
|
|
console.log(data) |
|
|
|
|
}).subscribe((data:any)=>{ |
|
|
|
|
this.allFiles = data.contents |
|
|
|
|
this.allFiles.forEach(item=>{ |
|
|
|
|
if(item.key.indexOf(this.searchData)){ |
|
|
|
|
this.checkedAllFiles.push(item) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
console.log(888888,data.contents) |
|
|
|
|
}, |
|
|
|
|
err=>{ |
|
|
|
|
|
|
|
|
@ -235,7 +250,7 @@ export class AllFileComponent {
|
|
|
|
|
goback:any //记录上一级目录
|
|
|
|
|
//点击列表每一条的名字
|
|
|
|
|
clickName(e,item){ |
|
|
|
|
console.log(e,item) |
|
|
|
|
// console.log(e,item)
|
|
|
|
|
e.stopPropagation() |
|
|
|
|
|
|
|
|
|
if(item.type == "jpg" || item.type == "png" || item.type == "bmp"|| item.type == "gif" || item.type == "jpeg"&& !item.isDir){ |
|
|
|
@ -260,9 +275,14 @@ export class AllFileComponent {
|
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe(); |
|
|
|
|
this.downloadFile.handleData(item.key,"查看") |
|
|
|
|
}else if(item.type == "pdf"){
|
|
|
|
|
}else if(item.type == "pdf" && item.size < 20971520){
|
|
|
|
|
window.open("/api/Objects/drives/" + item.key) |
|
|
|
|
this.downloadFile.handleData(item.key,"查看") |
|
|
|
|
}else if(item.type == "pdf" && item.size > 20971520){ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('暂不支持在线预览大于20M的pdf文件,请下载查看','确定',config) |
|
|
|
|
}else if(item.type == "gaopenche"){
|
|
|
|
|
|
|
|
|
|
window.open("GaoPenChe") |
|
|
|
@ -613,7 +633,7 @@ export class AllFileComponent {
|
|
|
|
|
|
|
|
|
|
this.objectName = data.objectName |
|
|
|
|
this.uploadId = data.uploadId |
|
|
|
|
console.log(1) |
|
|
|
|
// console.log(1)
|
|
|
|
|
this.subsectionUploading() |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
@ -642,7 +662,7 @@ export class AllFileComponent {
|
|
|
|
|
"partNumber":data.partNumber || null, |
|
|
|
|
"eTag": data.eTag || null} |
|
|
|
|
resolve(msg) // 调用 promise 内置方法处理成功
|
|
|
|
|
console.log(2) |
|
|
|
|
// console.log(2)
|
|
|
|
|
}) |
|
|
|
|
}); |
|
|
|
|
this.PartNumberETag.push(result) |
|
|
|
@ -660,7 +680,7 @@ export class AllFileComponent {
|
|
|
|
|
let data = this.PartNumberETag; |
|
|
|
|
let paramsData = {uploadId:this.uploadId}; |
|
|
|
|
this.http.post(`/api/CompleteMultipartUpload/drives/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ |
|
|
|
|
console.log(3) |
|
|
|
|
// console.log(3)
|
|
|
|
|
this.getALLFileList(this.selectedDataBank); |
|
|
|
|
this.uploadProgress = 0; |
|
|
|
|
this.uploadisLoading = false; |
|
|
|
@ -819,7 +839,7 @@ export class AllFileComponent {
|
|
|
|
|
this.snackBar.open('文件夹不支持下载','确定',config) |
|
|
|
|
}else{ |
|
|
|
|
this.http.get('/api/ObjectMetadata/drives/' + this.selectDownloadFile.key).subscribe(data=>{ |
|
|
|
|
console.log(123,data) |
|
|
|
|
// console.log(123,data)
|
|
|
|
|
this.download = data |
|
|
|
|
this.downloadFile.download(this.download) |
|
|
|
|
}) |
|
|
|
|