|
|
@ -82,16 +82,14 @@ export class AllFileComponent { |
|
|
|
|
|
|
|
|
|
|
|
this.selectedDataBank = name |
|
|
|
this.selectedDataBank = name |
|
|
|
let paramsdata = { |
|
|
|
let paramsdata = { |
|
|
|
prefix : this.selectedDataBank + "/", |
|
|
|
prefix : "allFiles/" + this.selectedDataBank + "/", |
|
|
|
delimiter : "/" |
|
|
|
delimiter : "/" |
|
|
|
} |
|
|
|
} |
|
|
|
this.http.get(`/api/Objects/drives`,{ |
|
|
|
this.http.get(`/api/Objects/drives`,{ |
|
|
|
params:paramsdata |
|
|
|
params:paramsdata |
|
|
|
|
|
|
|
|
|
|
|
}).subscribe((data:any) => { |
|
|
|
}).subscribe((data:any) => { |
|
|
|
// console.log(data)
|
|
|
|
console.log(456,data) |
|
|
|
this.selection.clear() |
|
|
|
this.selection.clear() |
|
|
|
|
|
|
|
|
|
|
|
data.contents.forEach((item)=>{ |
|
|
|
data.contents.forEach((item)=>{ |
|
|
|
let typeArr = item.key.split('.') |
|
|
|
let typeArr = item.key.split('.') |
|
|
|
item.type = typeArr[typeArr.length - 1] |
|
|
|
item.type = typeArr[typeArr.length - 1] |
|
|
@ -112,21 +110,21 @@ export class AllFileComponent { |
|
|
|
isDir: false, |
|
|
|
isDir: false, |
|
|
|
type: "denggao" |
|
|
|
type: "denggao" |
|
|
|
} |
|
|
|
} |
|
|
|
// ,
|
|
|
|
, |
|
|
|
// { key: "装备车辆/灭火侦查机器人",
|
|
|
|
{ key: "装备车辆/机器人", |
|
|
|
// lastModified: null,
|
|
|
|
lastModified: null, |
|
|
|
// eTag: null,
|
|
|
|
eTag: null, |
|
|
|
// size: 0,
|
|
|
|
size: 0, |
|
|
|
// isDir: false,
|
|
|
|
isDir: false, |
|
|
|
// type: "miehuo"
|
|
|
|
type: "jiqiren" |
|
|
|
// },
|
|
|
|
}, |
|
|
|
// { key: "装备车辆/空气呼吸器",
|
|
|
|
{ key: "装备车辆/空气呼吸器", |
|
|
|
// lastModified: null,
|
|
|
|
lastModified: null, |
|
|
|
// eTag: null,
|
|
|
|
eTag: null, |
|
|
|
// size: 0,
|
|
|
|
size: 0, |
|
|
|
// isDir: false,
|
|
|
|
isDir: false, |
|
|
|
// type: "kongqi"
|
|
|
|
type: "konghuqi" |
|
|
|
// }
|
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.selectedDataBank == "设备设施"){ |
|
|
|
if(this.selectedDataBank == "设备设施"){ |
|
|
@ -211,16 +209,18 @@ export class AllFileComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
//点击搜索
|
|
|
|
//点击搜索
|
|
|
|
search(){ |
|
|
|
search(){ |
|
|
|
|
|
|
|
console.log(13,this.searchData) |
|
|
|
if(this.searchData != "搜索您的文件"){ |
|
|
|
if(this.searchData != "搜索您的文件"){ |
|
|
|
this.http.get("/api/Objects/drives",{ |
|
|
|
this.http.get("/api/Objects/drives",{ |
|
|
|
params:{ |
|
|
|
params:{ |
|
|
|
prefix : this.searchData |
|
|
|
prefix : this.searchData, |
|
|
|
|
|
|
|
delimiter : "/" |
|
|
|
} |
|
|
|
} |
|
|
|
}).subscribe(data=>{ |
|
|
|
}).subscribe(data=>{ |
|
|
|
// console.log(data)
|
|
|
|
console.log(data) |
|
|
|
}, |
|
|
|
}, |
|
|
|
err=>{ |
|
|
|
err=>{ |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -238,7 +238,7 @@ export class AllFileComponent { |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
}else if(item.type == "mp4" || item.type == "MP4" && !item.isDir){ |
|
|
|
}else if(item.type == "mp4" || item.type == "MP4" && !item.isDir){ |
|
|
|
|
|
|
|
console.log(666,item.key) |
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
width: '1400px', |
|
|
|
width: '1400px', |
|
|
|
height:'800px', |
|
|
|
height:'800px', |
|
|
@ -258,7 +258,7 @@ export class AllFileComponent { |
|
|
|
|
|
|
|
|
|
|
|
); |
|
|
|
); |
|
|
|
}else if(item.type == "pdf"){
|
|
|
|
}else if(item.type == "pdf"){
|
|
|
|
|
|
|
|
// console.log(item)
|
|
|
|
window.open("/api/Objects/drives/" + item.key) |
|
|
|
window.open("/api/Objects/drives/" + item.key) |
|
|
|
|
|
|
|
|
|
|
|
}else if(item.type == "gaopenche"){
|
|
|
|
}else if(item.type == "gaopenche"){
|
|
|
@ -269,6 +269,14 @@ export class AllFileComponent { |
|
|
|
|
|
|
|
|
|
|
|
window.open("denggaoche") |
|
|
|
window.open("denggaoche") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else if(item.type == "jiqiren"){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.open("jiqiren") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else if(item.type == "konghuqi"){
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
window.open("konghuqi") |
|
|
|
|
|
|
|
|
|
|
|
}else if(item.type == "waifu"){
|
|
|
|
}else if(item.type == "waifu"){
|
|
|
|
|
|
|
|
|
|
|
|
window.open("waifudingguan") |
|
|
|
window.open("waifudingguan") |
|
|
@ -286,9 +294,8 @@ export class AllFileComponent { |
|
|
|
window.open("qiuguan") |
|
|
|
window.open("qiuguan") |
|
|
|
|
|
|
|
|
|
|
|
}else if (item.isDir) { |
|
|
|
}else if (item.isDir) { |
|
|
|
|
|
|
|
//将allFiles后面的内容截取出来
|
|
|
|
this.selectedDataBank = item.key.substring(0, item.key.length - 1) |
|
|
|
this.selectedDataBank = item.key.substring(9, item.key.length - 1) |
|
|
|
// console.log(this.selectedDataBank)
|
|
|
|
|
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
@ -408,7 +415,7 @@ export class AllFileComponent { |
|
|
|
|
|
|
|
|
|
|
|
let formData = new FormData() |
|
|
|
let formData = new FormData() |
|
|
|
formData.append("file",file) |
|
|
|
formData.append("file",file) |
|
|
|
this.http.post(`/api/Objects/drives/${selectedDataBank2}`,formData).subscribe((data:any)=>{ |
|
|
|
this.http.post(`/api/Objects/drives/allFiles/${selectedDataBank2}`,formData).subscribe((data:any)=>{ |
|
|
|
this.objectName2 = data.objectName |
|
|
|
this.objectName2 = data.objectName |
|
|
|
this.filesTag2.push("data") |
|
|
|
this.filesTag2.push("data") |
|
|
|
|
|
|
|
|
|
|
@ -434,10 +441,10 @@ export class AllFileComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
|
|
|
|
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
|
|
|
|
let data = {filename: file.name} |
|
|
|
let data = {fileName: file.name} |
|
|
|
this.uploadisLoading2 = true |
|
|
|
this.uploadisLoading2 = true |
|
|
|
|
|
|
|
|
|
|
|
this.http.post(`/api/NewMultipartUpload/drives/${selectedDataBank}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
|
|
|
|
this.http.post(`/api/NewMultipartUpload/drives/allFiles/${selectedDataBank}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
|
|
|
|
this.objectName2 = data.objectName |
|
|
|
this.objectName2 = data.objectName |
|
|
|
this.uploadId2 = data.uploadId |
|
|
|
this.uploadId2 = data.uploadId |
|
|
|
this.subsectionUploading2(e,result,reject,filesnum,selectedDataBank2) |
|
|
|
this.subsectionUploading2(e,result,reject,filesnum,selectedDataBank2) |
|
|
@ -548,7 +555,7 @@ export class AllFileComponent { |
|
|
|
dialogRef.afterClosed().subscribe((data)=>{ |
|
|
|
dialogRef.afterClosed().subscribe((data)=>{ |
|
|
|
if(data){ |
|
|
|
if(data){ |
|
|
|
//创建空文件夹
|
|
|
|
//创建空文件夹
|
|
|
|
this.http.post(`/api/Objects/drives/${this.selectedDataBank}/${data.name}/`,{}).subscribe(data=>{ |
|
|
|
this.http.post(`/api/Objects/drives/allFiles/${this.selectedDataBank}/${data.name}/`,{}).subscribe(data=>{ |
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
config.verticalPosition = 'top'; |
|
|
|
config.verticalPosition = 'top'; |
|
|
@ -589,7 +596,7 @@ export class AllFileComponent { |
|
|
|
if (file && fileSize<=shardSize) { //上传文件<=5MB时
|
|
|
|
if (file && fileSize<=shardSize) { //上传文件<=5MB时
|
|
|
|
let formData = new FormData() |
|
|
|
let formData = new FormData() |
|
|
|
formData.append("file",file) |
|
|
|
formData.append("file",file) |
|
|
|
this.http.post(`/api/Objects/drives/${this.selectedDataBank}`,formData).subscribe((data:any)=>{ |
|
|
|
this.http.post(`/api/Objects/drives/allFiles/${this.selectedDataBank}`,formData).subscribe((data:any)=>{ |
|
|
|
this.objectName = data.objectName |
|
|
|
this.objectName = data.objectName |
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
const config = new MatSnackBarConfig(); |
|
|
@ -598,11 +605,13 @@ export class AllFileComponent { |
|
|
|
this.snackBar.open('上传成功','确定',config) |
|
|
|
this.snackBar.open('上传成功','确定',config) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
|
|
|
|
} else if (file && fileSize>shardSize) { //上传文件>5MB时,分块上传
|
|
|
|
let data = {filename: file.name} |
|
|
|
let data = {fileName: file.name} |
|
|
|
this.uploadisLoading = true |
|
|
|
this.uploadisLoading = true |
|
|
|
this.http.post(`/api/NewMultipartUpload/drives/${this.selectedDataBank}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
|
|
|
|
this.http.post(`/api/NewMultipartUpload/drives/allFiles/${this.selectedDataBank}`,{},{params:data}).subscribe((data:any)=>{ //初始化分段上传
|
|
|
|
|
|
|
|
|
|
|
|
this.objectName = data.objectName |
|
|
|
this.objectName = data.objectName |
|
|
|
this.uploadId = data.uploadId |
|
|
|
this.uploadId = data.uploadId |
|
|
|
|
|
|
|
console.log(1) |
|
|
|
this.subsectionUploading() |
|
|
|
this.subsectionUploading() |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
@ -631,6 +640,7 @@ export class AllFileComponent { |
|
|
|
"partNumber":data.partNumber || null, |
|
|
|
"partNumber":data.partNumber || null, |
|
|
|
"eTag": data.eTag || null} |
|
|
|
"eTag": data.eTag || null} |
|
|
|
resolve(msg) // 调用 promise 内置方法处理成功
|
|
|
|
resolve(msg) // 调用 promise 内置方法处理成功
|
|
|
|
|
|
|
|
console.log(2) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.PartNumberETag.push(result) |
|
|
|
this.PartNumberETag.push(result) |
|
|
@ -648,6 +658,7 @@ export class AllFileComponent { |
|
|
|
let data = this.PartNumberETag; |
|
|
|
let data = this.PartNumberETag; |
|
|
|
let paramsData = {uploadId:this.uploadId}; |
|
|
|
let paramsData = {uploadId:this.uploadId}; |
|
|
|
this.http.post(`/api/CompleteMultipartUpload/drives/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ |
|
|
|
this.http.post(`/api/CompleteMultipartUpload/drives/${this.objectName}`,data,{params:paramsData}).subscribe(data=>{ |
|
|
|
|
|
|
|
console.log(3) |
|
|
|
this.getALLFileList(this.selectedDataBank); |
|
|
|
this.getALLFileList(this.selectedDataBank); |
|
|
|
this.uploadProgress = 0; |
|
|
|
this.uploadProgress = 0; |
|
|
|
this.uploadisLoading = false; |
|
|
|
this.uploadisLoading = false; |
|
|
@ -688,7 +699,7 @@ export class AllFileComponent { |
|
|
|
prefix : element.key, |
|
|
|
prefix : element.key, |
|
|
|
recursive : true |
|
|
|
recursive : true |
|
|
|
} |
|
|
|
} |
|
|
|
this.http.delete(`/api/Objects/drives`,{ |
|
|
|
this.http.delete(`/api/Objects/drives/allFiles`,{ |
|
|
|
params:paramsdata |
|
|
|
params:paramsdata |
|
|
|
}).subscribe(data=>{ |
|
|
|
}).subscribe(data=>{ |
|
|
|
arr.push("删除成功了") |
|
|
|
arr.push("删除成功了") |
|
|
@ -705,7 +716,7 @@ export class AllFileComponent { |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.http.delete(`/api/Objects/drives/${element.key}`).subscribe(data=>{ |
|
|
|
this.http.delete(`/api/Objects/drives/allFiles/${element.key}`).subscribe(data=>{ |
|
|
|
arr.push("删除成功了") |
|
|
|
arr.push("删除成功了") |
|
|
|
if (arr.length == this.selection.selected.length) { |
|
|
|
if (arr.length == this.selection.selected.length) { |
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
@ -805,8 +816,8 @@ export class AllFileComponent { |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000 |
|
|
|
this.snackBar.open('文件夹不支持下载','确定',config) |
|
|
|
this.snackBar.open('文件夹不支持下载','确定',config) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
this.http.get('/api/ObjectMetadata/drives/' + this.selectDownloadFile.key).subscribe(data=>{ |
|
|
|
this.http.get('/api/ObjectMetadata/drives/allFiles/' + this.selectDownloadFile.key).subscribe(data=>{ |
|
|
|
// console.log(data)
|
|
|
|
console.log(123,data) |
|
|
|
this.download = data |
|
|
|
this.download = data |
|
|
|
this.downloadFile.download(this.download) |
|
|
|
this.downloadFile.download(this.download) |
|
|
|
}) |
|
|
|
}) |
|
|
|