|
|
|
@ -74,7 +74,8 @@ export class AllFileComponent implements OnInit {
|
|
|
|
|
getALLFileList(name){ |
|
|
|
|
this.selectedDataBank = name |
|
|
|
|
let paramsdata = { |
|
|
|
|
prefix : this.selectedDataBank |
|
|
|
|
prefix : this.selectedDataBank + "/", |
|
|
|
|
delimiter : "/" |
|
|
|
|
} |
|
|
|
|
this.http.get(`/api/Objects/drives`,{ |
|
|
|
|
params:paramsdata |
|
|
|
@ -249,26 +250,28 @@ export class AllFileComponent implements OnInit {
|
|
|
|
|
} |
|
|
|
|
//新建文件夹
|
|
|
|
|
createFolder(){ |
|
|
|
|
const dialogRef = this.dialog.open(FolderDialog, {//调用open方法打开对话框并且携带参数过去
|
|
|
|
|
// width: '1600px',
|
|
|
|
|
// height:'900px',
|
|
|
|
|
data: {} |
|
|
|
|
}); |
|
|
|
|
const dialogRef = this.dialog.open(FolderDialog); |
|
|
|
|
dialogRef.afterClosed().subscribe((data)=>{ |
|
|
|
|
if(data){ |
|
|
|
|
console.log(data) |
|
|
|
|
console.log(data,this.selectedDataBank) |
|
|
|
|
//创建空文件夹
|
|
|
|
|
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) |
|
|
|
|
this.http.post(`/api/Objects/drives/${this.selectedDataBank}/${data.name}/`,{}).subscribe(data=>{ |
|
|
|
|
console.log(data) |
|
|
|
|
// this.getALLFileList(this.selectedDataBank)
|
|
|
|
|
// const config = new MatSnackBarConfig();
|
|
|
|
|
// config.verticalPosition = 'top';
|
|
|
|
|
// config.duration = 3000
|
|
|
|
|
// this.snackBar.open('新建文件夹成功','确定',config)
|
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} //if
|
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//返回顶级目录
|
|
|
|
|
backToTop () { |
|
|
|
|
console.log(this.selectedDataBank,'返回') |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//上传文件
|
|
|
|
@ -451,24 +454,25 @@ export class ViewDetails {
|
|
|
|
|
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; |
|
|
|
|
// 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){ |
|
|
|
@ -476,4 +480,5 @@ export class FolderDialog {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |