Browse Source

[合并]合并代码

master
陈鹏飞 5 years ago
parent
commit
00d120f67f
  1. 4
      src/app/ui/all-file/all-file.component.html
  2. 25
      src/app/ui/all-file/all-file.component.ts

4
src/app/ui/all-file/all-file.component.html

@ -57,6 +57,8 @@
<div class="titlebox">
<div class="titleleft">
<span class="goBack" (click)='backToTop()' *ngIf="selectedDataBank.includes('/')">返回一级目录</span>
&nbsp;
<span class="goBack" (click)='backTominTop()' *ngIf="selectedDataBank.includes('/')">返回上一级目录</span>
<span style="margin: 0 3px;color: #c5d8f3;">|</span>
<span class="allFile">全部文件</span>
<span style="margin: 0 3px;color: #c5d8f3;"></span>
@ -92,7 +94,7 @@
<th style="width: 63%;" mat-header-cell *matHeaderCellDef> 文件名 </th>
<td mat-cell *matCellDef="let element">
<img *ngIf="element.type == 'pdf'" src="../../../assets/images/pdf.png" alt="">
<img *ngIf="element.type == 'jpeg' || element.type == 'jpg' || element.type == 'png' || element.type == 'gif' || element.type == 'svg'|| element.type == 'webp' || element.type == 'bmp'" src="../../../assets/images/img.png" alt="">
<img *ngIf="element.type == 'jpeg' || element.type == 'jpg' || element.type == 'png' || element.type == 'gif' || element.type == 'svg'|| element.type == 'webp' || element.type == 'bmp'|| element.type == 'JPG'" src="../../../assets/images/img.png" alt="">
<img *ngIf="element.type == 'doc' || element.type == 'docx'" src="../../../assets/images/word.png" alt="">
<img *ngIf="element.type == 'xlsx'" src="../../../assets/images/excel.png" alt="">
<img *ngIf="element.type == 'zip'" src="../../../assets/images/zip.png" alt="">

25
src/app/ui/all-file/all-file.component.ts

@ -225,12 +225,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"}
@ -285,7 +286,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();
@ -294,7 +297,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
}
//上传按钮鼠标移入
@ -348,9 +367,13 @@ export class AllFileComponent {
fileArr:any
//上传文件夹
async selectFiles (e) {
// console.log(e)
this.fileArr = e.target.files || null //上传的文件
this.uploadisLoading2 = true
this.child.handleData() //子组件处理数据格式
let _this = this
for (var i = 0;i < this.fileArr.length; i++) {
let f = this.fileArr[i];

Loading…
Cancel
Save