|
|
|
@ -233,7 +233,7 @@ export class AllFileComponent implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fileArr:any |
|
|
|
|
//文件夹
|
|
|
|
|
//上传文件夹
|
|
|
|
|
selectFiles (e) { |
|
|
|
|
this.fileArr = e.target.files || null //上传的文件
|
|
|
|
|
console.log(this.fileArr.length) |
|
|
|
@ -247,7 +247,27 @@ export class AllFileComponent implements OnInit {
|
|
|
|
|
this.downloadFile.startUploading(f,adddress) |
|
|
|
|
}
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//新建文件夹
|
|
|
|
|
createFolder(){ |
|
|
|
|
const dialogRef = this.dialog.open(FolderDialog, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
// width: '1600px',
|
|
|
|
|
// height:'900px',
|
|
|
|
|
data: {} |
|
|
|
|
}); |
|
|
|
|
dialogRef.afterClosed().subscribe((data)=>{ |
|
|
|
|
if(data){ |
|
|
|
|
console.log(data) |
|
|
|
|
//创建空文件夹
|
|
|
|
|
this.http.post(`/api/Objects/drives/${this.selectedDataBank}/`,"").subscribe(data=>{ |
|
|
|
|
this.getALLFileList(this.selectedDataBank) |
|
|
|
|
const config = new MatSnackBarConfig(); |
|
|
|
|
config.verticalPosition = 'top'; |
|
|
|
|
config.duration = 3000 |
|
|
|
|
this.snackBar.open('新建文件夹成功','确定',config) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -401,7 +421,7 @@ export class AllFileComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查看图片大图和视频
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'viewdetails', |
|
|
|
|
templateUrl: './viewdetails.html', |
|
|
|
@ -421,4 +441,39 @@ export class ViewDetails {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Component({ |
|
|
|
|
selector: 'folderdalog', |
|
|
|
|
templateUrl: './folderdalog.html', |
|
|
|
|
styleUrls: ['./all-file.component.scss'] |
|
|
|
|
}) |
|
|
|
|
export class FolderDialog { |
|
|
|
|
// myControl = new FormControl();
|
|
|
|
|
//注入MatDialogRef,可以用来关闭对话框
|
|
|
|
|
//要访问对话框组件中的数据,必须使用MAT_DIALOG_DATA注入令牌
|
|
|
|
|
constructor(private http: HttpClient,public dialogRef: MatDialogRef<FolderDialog>,@Inject(MAT_DIALOG_DATA) public data) {} |
|
|
|
|
newFolderName:string |
|
|
|
|
onNoClick(): void { |
|
|
|
|
this.dialogRef.close(); |
|
|
|
|
} |
|
|
|
|
ngOnInit(): void { |
|
|
|
|
var myDate = new Date(); |
|
|
|
|
var year = myDate.getFullYear(); |
|
|
|
|
var month = myDate.getMonth();
|
|
|
|
|
var day = myDate.getDate(); |
|
|
|
|
var hour = myDate.getHours(); //获取当前小时数(0-23)
|
|
|
|
|
var minutes = myDate.getMinutes(); //获取当前分钟数(0-59)
|
|
|
|
|
var seconds = myDate.getSeconds(); //获取当前秒数(0-59)
|
|
|
|
|
var data = year + '' + month + day + hour + minutes + seconds |
|
|
|
|
this.newFolderName = "新建文件夹_" + data; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onSubmit(value){ |
|
|
|
|
this.dialogRef.close(value); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |