|
|
|
@ -36,9 +36,12 @@ export class AllFileComponent {
|
|
|
|
|
//表头排序
|
|
|
|
|
sortData (e) { |
|
|
|
|
let data = this.oldDataSource.concat(); |
|
|
|
|
// console.log(123,data)
|
|
|
|
|
data.forEach(element => { |
|
|
|
|
let typeArr = element.key.split('.') |
|
|
|
|
element.type = typeArr[typeArr.length - 1] |
|
|
|
|
if(element.key.indexOf(".") != -1){ |
|
|
|
|
let typeArr = element.key.split('.') |
|
|
|
|
element.type = typeArr[typeArr.length - 1] |
|
|
|
|
} |
|
|
|
|
element.newTime = new Date(element.lastModified).getTime() |
|
|
|
|
}); |
|
|
|
|
if( e.direction=='asc' ) { //从小到大排序
|
|
|
|
@ -73,6 +76,7 @@ export class AllFileComponent {
|
|
|
|
|
|
|
|
|
|
//获得当前资料库的文件列表
|
|
|
|
|
getALLFileList(name){ |
|
|
|
|
|
|
|
|
|
this.selectedDataBank = name |
|
|
|
|
let paramsdata = { |
|
|
|
|
prefix : this.selectedDataBank + "/", |
|
|
|
@ -83,11 +87,78 @@ export class AllFileComponent {
|
|
|
|
|
|
|
|
|
|
}).subscribe((data:any) => { |
|
|
|
|
// console.log(data)
|
|
|
|
|
this.oldDataSource = data.contents //保存表格数据
|
|
|
|
|
this.selection.clear() |
|
|
|
|
|
|
|
|
|
data.contents.forEach((item)=>{ |
|
|
|
|
let typeArr = item.key.split('.') |
|
|
|
|
item.type = typeArr[typeArr.length - 1] |
|
|
|
|
}) |
|
|
|
|
if(this.selectedDataBank == "装备车辆"){ |
|
|
|
|
data.contents.unshift( |
|
|
|
|
{ key: "装备车辆/高喷车", |
|
|
|
|
lastModified: null, |
|
|
|
|
eTag: null, |
|
|
|
|
size: 0, |
|
|
|
|
isDir: false, |
|
|
|
|
type: "gaopenche" |
|
|
|
|
}, |
|
|
|
|
{ key: "装备车辆/登高平台车", |
|
|
|
|
lastModified: null, |
|
|
|
|
eTag: null, |
|
|
|
|
size: 0, |
|
|
|
|
isDir: false, |
|
|
|
|
type: "denggao" |
|
|
|
|
}, |
|
|
|
|
{ key: "装备车辆/灭火侦查机器人", |
|
|
|
|
lastModified: null, |
|
|
|
|
eTag: null, |
|
|
|
|
size: 0, |
|
|
|
|
isDir: false, |
|
|
|
|
type: "miehuo" |
|
|
|
|
}, |
|
|
|
|
{ key: "装备车辆/空气呼吸器", |
|
|
|
|
lastModified: null, |
|
|
|
|
eTag: null, |
|
|
|
|
size: 0, |
|
|
|
|
isDir: false, |
|
|
|
|
type: "kongqi" |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
if(this.selectedDataBank == "设备设施"){ |
|
|
|
|
data.contents.unshift( |
|
|
|
|
{ key: "设备设施/外浮顶罐", |
|
|
|
|
lastModified: null, |
|
|
|
|
eTag: null, |
|
|
|
|
size: 0, |
|
|
|
|
isDir: false, |
|
|
|
|
type: "waifu" |
|
|
|
|
}, |
|
|
|
|
{ key: "设备设施/内浮顶罐", |
|
|
|
|
lastModified: null, |
|
|
|
|
eTag: null, |
|
|
|
|
size: 0, |
|
|
|
|
isDir: false, |
|
|
|
|
type: "neifu" |
|
|
|
|
}, |
|
|
|
|
{ key: "设备设施/拱顶罐", |
|
|
|
|
lastModified: null, |
|
|
|
|
eTag: null, |
|
|
|
|
size: 0, |
|
|
|
|
isDir: false, |
|
|
|
|
type: "gong" |
|
|
|
|
}, |
|
|
|
|
{ key: "设备设施/球罐", |
|
|
|
|
lastModified: null, |
|
|
|
|
eTag: null, |
|
|
|
|
size: 0, |
|
|
|
|
isDir: false, |
|
|
|
|
type: "qiu" |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
} |
|
|
|
|
this.oldDataSource = data.contents //保存表格数据
|
|
|
|
|
|
|
|
|
|
this.dataSource = new MatTableDataSource(data.contents); |
|
|
|
|
|
|
|
|
|
this.fileNum = data.contents.length |
|
|
|
@ -152,8 +223,10 @@ export class AllFileComponent {
|
|
|
|
|
|
|
|
|
|
//点击列表每一条的名字
|
|
|
|
|
clickName(e,item){ |
|
|
|
|
// console.log(item)
|
|
|
|
|
e.stopPropagation() |
|
|
|
|
if(item.type == "jpg" || item.type == "png" && !item.isDir){ |
|
|
|
|
|
|
|
|
|
if(item.type == "jpg" || item.type == "png" || item.type == "bmp"&& !item.isDir){ |
|
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '1600px', |
|
|
|
|
height:'900px', |
|
|
|
@ -169,23 +242,45 @@ export class AllFileComponent {
|
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
}else if(item.type == "mp3" || item.type == "MP3"&& !item.isDir){ |
|
|
|
|
|
|
|
|
|
const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
width: '380px', |
|
|
|
|
height:'108px', |
|
|
|
|
data: {url:item.key,type:"mp3"} |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe( |
|
|
|
|
|
|
|
|
|
); |
|
|
|
|
}else if(item.type == "pdf"){
|
|
|
|
|
// const config = new MatSnackBarConfig();
|
|
|
|
|
// config.verticalPosition = 'top';
|
|
|
|
|
// config.duration = 3000
|
|
|
|
|
// this.snackBar.open('该文件类型暂不支持在线查看,请下载查看','确定',config)
|
|
|
|
|
// "/api/Objects/drives/" + this.data.url
|
|
|
|
|
|
|
|
|
|
window.open("/api/Objects/drives/" + item.key) |
|
|
|
|
// const dialogRef = this.dialog.open(ViewDetails, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
// width: '1600px',
|
|
|
|
|
// height:'900px',
|
|
|
|
|
// data: {url:item.key,type:"pdf"}
|
|
|
|
|
// });
|
|
|
|
|
// dialogRef.afterClosed().subscribe(
|
|
|
|
|
|
|
|
|
|
// );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}else if(item.type == "gaopenche"){
|
|
|
|
|
|
|
|
|
|
window.open("GaoPenChe") |
|
|
|
|
|
|
|
|
|
}else if(item.type == "denggao"){
|
|
|
|
|
|
|
|
|
|
window.open("denggaoche") |
|
|
|
|
|
|
|
|
|
}else if(item.type == "waifu"){
|
|
|
|
|
|
|
|
|
|
window.open("waifudingguan") |
|
|
|
|
|
|
|
|
|
}else if(item.type == "neifu"){
|
|
|
|
|
|
|
|
|
|
window.open("neifudingguan") |
|
|
|
|
|
|
|
|
|
}else if(item.type == "gong"){
|
|
|
|
|
|
|
|
|
|
window.open("gongdingguan") |
|
|
|
|
|
|
|
|
|
}else if(item.type == "qiu"){
|
|
|
|
|
|
|
|
|
|
window.open("qiuguan") |
|
|
|
|
|
|
|
|
|
}else if (item.isDir) { |
|
|
|
|
this.selectedDataBank = item.key.substring(0, item.key.length - 1) |
|
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
|