|
|
@ -67,7 +67,6 @@ export class AllFileComponent { |
|
|
|
|
|
|
|
|
|
|
|
ngOnInit(): void { |
|
|
|
ngOnInit(): void { |
|
|
|
this.dataSource.sort = this.sort; |
|
|
|
this.dataSource.sort = this.sort; |
|
|
|
// this.getAllDataBank()
|
|
|
|
|
|
|
|
this.getALLFileList("支队级-主官") |
|
|
|
this.getALLFileList("支队级-主官") |
|
|
|
|
|
|
|
|
|
|
|
// 接收发射过来的数据
|
|
|
|
// 接收发射过来的数据
|
|
|
@ -81,19 +80,8 @@ export class AllFileComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//获得所有资料库,默认显示第一个资料库的文件
|
|
|
|
|
|
|
|
getAllDataBank(){ |
|
|
|
|
|
|
|
this.http.get('/api/DataBanks').subscribe((data:any) => { |
|
|
|
|
|
|
|
if(data.length != 0){ |
|
|
|
|
|
|
|
this.selectedDataBank = data[0].name |
|
|
|
|
|
|
|
this.getALLFileList(data[0].name) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获得当前资料库的文件列表
|
|
|
|
//获得当前资料库的文件列表
|
|
|
|
getALLFileList(name){ |
|
|
|
getALLFileList(name){ |
|
|
|
|
|
|
|
|
|
|
|
this.selectedDataBank = name |
|
|
|
this.selectedDataBank = name |
|
|
|
let paramsdata = { |
|
|
|
let paramsdata = { |
|
|
|
prefix : "allFiles/" + this.selectedDataBank + "/", |
|
|
|
prefix : "allFiles/" + this.selectedDataBank + "/", |
|
|
@ -102,13 +90,12 @@ export class AllFileComponent { |
|
|
|
this.http.get(`/api/Objects/drives`,{ |
|
|
|
this.http.get(`/api/Objects/drives`,{ |
|
|
|
params:paramsdata |
|
|
|
params:paramsdata |
|
|
|
}).subscribe((data:any) => { |
|
|
|
}).subscribe((data:any) => { |
|
|
|
// 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] |
|
|
|
}) |
|
|
|
}) |
|
|
|
if(this.selectedDataBank == "装备车辆"){ |
|
|
|
if(name.split('/')[1] == "装备"){ |
|
|
|
data.contents.unshift( |
|
|
|
data.contents.unshift( |
|
|
|
{ key: "装备车辆/高喷车", |
|
|
|
{ key: "装备车辆/高喷车", |
|
|
|
lastModified: null, |
|
|
|
lastModified: null, |
|
|
@ -141,7 +128,7 @@ export class AllFileComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
if(this.selectedDataBank == "设备设施"){ |
|
|
|
if(name.split('/')[1] == "消防设施"){ |
|
|
|
data.contents.unshift( |
|
|
|
data.contents.unshift( |
|
|
|
{ key: "设备设施/外浮顶罐", |
|
|
|
{ key: "设备设施/外浮顶罐", |
|
|
|
lastModified: null, |
|
|
|
lastModified: null, |
|
|
@ -251,13 +238,12 @@ export class AllFileComponent { |
|
|
|
goback:any //记录上一级目录
|
|
|
|
goback:any //记录上一级目录
|
|
|
|
//点击列表每一条的名字
|
|
|
|
//点击列表每一条的名字
|
|
|
|
clickName(e,item){ |
|
|
|
clickName(e,item){ |
|
|
|
// console.log(e,item)
|
|
|
|
|
|
|
|
e.stopPropagation() |
|
|
|
e.stopPropagation() |
|
|
|
|
|
|
|
|
|
|
|
if(item.type == "jpg" || item.type == "png" || item.type == "bmp"|| item.type == "gif" || item.type == "jpeg"&& !item.isDir){ |
|
|
|
if(item.type == "jpg" || item.type == "png" || item.type == "bmp"|| item.type == "gif" || item.type == "jpeg"&& !item.isDir){ |
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
data: {url:item.key,type:"img"} |
|
|
|
data: {url:item.key,type:"img"} |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
this.downloadFile.handleData(item.key,"查看") |
|
|
|
this.downloadFile.handleData(item.key,"查看") |
|
|
|
}else if(item.type == "mp4" || item.type == "MP4" && !item.isDir){ |
|
|
|
}else if(item.type == "mp4" || item.type == "MP4" && !item.isDir){ |
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
@ -268,7 +254,6 @@ export class AllFileComponent { |
|
|
|
dialogRef.afterClosed().subscribe(); |
|
|
|
dialogRef.afterClosed().subscribe(); |
|
|
|
this.downloadFile.handleData(item.key,"查看") |
|
|
|
this.downloadFile.handleData(item.key,"查看") |
|
|
|
}else if(item.type == "mp3" || item.type == "MP3"&& !item.isDir){ |
|
|
|
}else if(item.type == "mp3" || item.type == "MP3"&& !item.isDir){ |
|
|
|
|
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
width: '400px', |
|
|
|
width: '400px', |
|
|
|
height:'108px', |
|
|
|
height:'108px', |
|
|
@ -326,9 +311,17 @@ export class AllFileComponent { |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000 |
|
|
|
this.snackBar.open('该文件类型暂不支持在线查看,请下载查看','确定',config) |
|
|
|
this.snackBar.open('该文件类型暂不支持在线查看,请下载查看','确定',config) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//记录战术授课
|
|
|
|
|
|
|
|
openteacher(){ |
|
|
|
|
|
|
|
let key = `allFiles/${this.selectedDataBank}/战术授课/` |
|
|
|
|
|
|
|
this.downloadFile.handleData(key,"进入") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
//记录战术学习
|
|
|
|
|
|
|
|
openlearn(){ |
|
|
|
|
|
|
|
let key = `allFiles/${this.selectedDataBank}/战术学习/` |
|
|
|
|
|
|
|
this.downloadFile.handleData(key,"进入") |
|
|
|
} |
|
|
|
} |
|
|
|
//返回上一级目录
|
|
|
|
//返回上一级目录
|
|
|
|
backTominTop(){ |
|
|
|
backTominTop(){ |
|
|
@ -353,10 +346,12 @@ export class AllFileComponent { |
|
|
|
uploadBtnEnter(){ |
|
|
|
uploadBtnEnter(){ |
|
|
|
this.isOpenUpload = true |
|
|
|
this.isOpenUpload = true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//上传按钮鼠标移出
|
|
|
|
//上传按钮鼠标移出
|
|
|
|
uploadBtnLeave(){ |
|
|
|
uploadBtnLeave(){ |
|
|
|
this.isOpenUpload = false |
|
|
|
this.isOpenUpload = false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//点击每条的checkbox
|
|
|
|
//点击每条的checkbox
|
|
|
|
clickCheckBox(e){ |
|
|
|
clickCheckBox(e){ |
|
|
|
e.stopPropagation(); |
|
|
|
e.stopPropagation(); |
|
|
@ -368,6 +363,7 @@ export class AllFileComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
}, 0); |
|
|
|
}, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//点击每条的li
|
|
|
|
//点击每条的li
|
|
|
|
clickCheckBoxLi(e,row){ |
|
|
|
clickCheckBoxLi(e,row){ |
|
|
|
this.selection.toggle(row) |
|
|
|
this.selection.toggle(row) |
|
|
@ -379,8 +375,8 @@ export class AllFileComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
}, 0); |
|
|
|
}, 0); |
|
|
|
} |
|
|
|
} |
|
|
|
file:any //需要上传的文件
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
file:any //需要上传的文件
|
|
|
|
//input file 选择文件
|
|
|
|
//input file 选择文件
|
|
|
|
selectFile (e) { |
|
|
|
selectFile (e) { |
|
|
|
this.file = e.target.files[0] || null //上传的文件
|
|
|
|
this.file = e.target.files[0] || null //上传的文件
|
|
|
@ -393,18 +389,16 @@ export class AllFileComponent { |
|
|
|
}, |
|
|
|
}, |
|
|
|
err => { |
|
|
|
err => { |
|
|
|
this.startUploading() |
|
|
|
this.startUploading() |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fileArr:any |
|
|
|
fileArr:any |
|
|
|
//上传文件夹
|
|
|
|
//上传文件夹
|
|
|
|
async selectFiles (e) { |
|
|
|
async selectFiles (e) { |
|
|
|
|
|
|
|
|
|
|
|
this.fileArr = e.target.files || null //上传的文件
|
|
|
|
this.fileArr = e.target.files || null //上传的文件
|
|
|
|
this.uploadisLoading2 = true |
|
|
|
this.uploadisLoading2 = true |
|
|
|
this.child.handleData() //子组件处理数据格式
|
|
|
|
this.child.handleData() //子组件处理数据格式
|
|
|
|
|
|
|
|
|
|
|
|
let _this = this |
|
|
|
let _this = this |
|
|
|
for (var i = 0;i < this.fileArr.length; i++) { |
|
|
|
for (var i = 0;i < this.fileArr.length; i++) { |
|
|
|
let f = this.fileArr[i]; |
|
|
|
let f = this.fileArr[i]; |
|
|
@ -416,7 +410,6 @@ export class AllFileComponent { |
|
|
|
let result = await new Promise ((result,reject)=>{ |
|
|
|
let result = await new Promise ((result,reject)=>{ |
|
|
|
this.startUploading2(f,adddress,result,reject,filesnum,this.selectedDataBank) |
|
|
|
this.startUploading2(f,adddress,result,reject,filesnum,this.selectedDataBank) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -476,7 +469,6 @@ export class AllFileComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
PartNumberETag2:any=[]; //每次返回需要保存的信息
|
|
|
|
PartNumberETag2:any=[]; //每次返回需要保存的信息
|
|
|
|
//开始分段上传
|
|
|
|
//开始分段上传
|
|
|
|
async subsectionUploading2 (e,result,reject,filesnum,selectedDataBank2) { |
|
|
|
async subsectionUploading2 (e,result,reject,filesnum,selectedDataBank2) { |
|
|
@ -558,20 +550,6 @@ export class AllFileComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新建文件夹
|
|
|
|
//新建文件夹
|
|
|
|
createFolder(){ |
|
|
|
createFolder(){ |
|
|
|
const dialogRef = this.dialog.open(FolderDialog); |
|
|
|
const dialogRef = this.dialog.open(FolderDialog); |
|
|
@ -601,7 +579,6 @@ export class AllFileComponent { |
|
|
|
config.duration = 3000 |
|
|
|
config.duration = 3000 |
|
|
|
this.snackBar.open('目前已是一级目录','确定',config) |
|
|
|
this.snackBar.open('目前已是一级目录','确定',config) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -631,10 +608,8 @@ export class AllFileComponent { |
|
|
|
let data = {fileName: file.name} |
|
|
|
let data = {fileName: file.name} |
|
|
|
this.uploadisLoading = true |
|
|
|
this.uploadisLoading = true |
|
|
|
this.http.post(`/api/NewMultipartUpload/drives/allFiles/${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() |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
@ -789,7 +764,6 @@ export class AllFileComponent { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// deleteFiles(){
|
|
|
|
// deleteFiles(){
|
|
|
|
// if (this.selection.selected.length == 1) {
|
|
|
|
// if (this.selection.selected.length == 1) {
|
|
|
|
// let isDelete = confirm('您确定要删除吗')
|
|
|
|
// let isDelete = confirm('您确定要删除吗')
|
|
|
@ -824,9 +798,6 @@ export class AllFileComponent { |
|
|
|
// this.isDelete = false
|
|
|
|
// this.isDelete = false
|
|
|
|
// })
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// if (this.selection.selected.length == 0) {
|
|
|
|
// if (this.selection.selected.length == 0) {
|
|
|
@ -843,8 +814,6 @@ export class AllFileComponent { |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//下载文件
|
|
|
|
|
|
|
|
//下载↓
|
|
|
|
//下载↓
|
|
|
|
selectDownloadFile:any; //选择下载的文件
|
|
|
|
selectDownloadFile:any; //选择下载的文件
|
|
|
|
download:any; //下载文件元数据
|
|
|
|
download:any; //下载文件元数据
|
|
|
|