|
|
|
@ -224,12 +224,13 @@ export class AllFileComponent {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
goback:any //记录上一级目录
|
|
|
|
|
//点击列表每一条的名字
|
|
|
|
|
clickName(e,item){ |
|
|
|
|
// console.log(item)
|
|
|
|
|
e.stopPropagation() |
|
|
|
|
|
|
|
|
|
if(item.type == "jpg" || item.type == "png" || item.type == "bmp"|| item.type == "gif"&& !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方法打开对话框并且携带参数过去
|
|
|
|
|
|
|
|
|
|
data: {url:item.key,type:"img"} |
|
|
|
@ -284,7 +285,9 @@ export class AllFileComponent {
|
|
|
|
|
window.open("qiuguan") |
|
|
|
|
|
|
|
|
|
}else if (item.isDir) { |
|
|
|
|
|
|
|
|
|
this.selectedDataBank = item.key.substring(0, item.key.length - 1) |
|
|
|
|
// console.log(this.selectedDataBank)
|
|
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
|
}else{ |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
@ -293,7 +296,23 @@ export class AllFileComponent {
|
|
|
|
|
this.snackBar.open('该文件类型暂不支持在线查看,请下载查看','确定',config) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
//返回上一级目录
|
|
|
|
|
backTominTop(){ |
|
|
|
|
let topnum = this.gettoplist(this.selectedDataBank) |
|
|
|
|
this.getALLFileList(topnum) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//上级目录产生函数
|
|
|
|
|
gettoplist(item){ |
|
|
|
|
let list = item |
|
|
|
|
let listArr = list.split("/") |
|
|
|
|
let listresult = "" |
|
|
|
|
for(let i = 0;i < listArr.length - 1;i++){ |
|
|
|
|
listresult += listArr[i] + "/" |
|
|
|
|
} |
|
|
|
|
let listresult2 = listresult.substring(0, listresult.length - 1) |
|
|
|
|
return listresult2 |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//上传按钮鼠标移入
|
|
|
|
@ -347,7 +366,11 @@ export class AllFileComponent {
|
|
|
|
|
fileArr:any |
|
|
|
|
//上传文件夹
|
|
|
|
|
async selectFiles (e) { |
|
|
|
|
|
|
|
|
|
// console.log(e)
|
|
|
|
|
|
|
|
|
|
this.fileArr = e.target.files || null //上传的文件
|
|
|
|
|
console.log(111,this.fileArr) |
|
|
|
|
let _this = this |
|
|
|
|
for (var i = 0;i < this.fileArr.length; i++) { |
|
|
|
|
let f = this.fileArr[i]; |
|
|
|
|