diff --git a/src/app/navigation/navigation.component.html b/src/app/navigation/navigation.component.html index 7fa860f..7dfcd17 100644 --- a/src/app/navigation/navigation.component.html +++ b/src/app/navigation/navigation.component.html @@ -19,9 +19,10 @@ (mouseenter)="liEnter(item)" (mouseleave)="liLeave(item)" >{{item.name}} -

- edit - delete +

+ edit + delete

diff --git a/src/app/navigation/navigation.component.ts b/src/app/navigation/navigation.component.ts index 2acbb3c..239d666 100644 --- a/src/app/navigation/navigation.component.ts +++ b/src/app/navigation/navigation.component.ts @@ -106,7 +106,8 @@ export class NavigationComponent implements OnInit { this.hoverDataBank = "" } //修改资料库名称 - editDataBankName(item){ + editDataBankName(e,item){ + e.stopPropagation() const dialogRef = this.dialog.open(EditDataBankName, {//调用open方法打开对话框并且携带参数过去 width: '260px', data: {name:item.name} @@ -135,7 +136,8 @@ export class NavigationComponent implements OnInit { ); } //删除资料库 - deleteDataBank(item){ + deleteDataBank(e,item){ + e.stopPropagation() var r = confirm(`您确定要删除 ${item.name} 资料库吗?`); if (r == true) { this.http.delete(`/api/DataBanks/${item.id}`).subscribe(data => { @@ -170,8 +172,16 @@ export class AddDataBank { } onSubmit(value){ - this.dialogRef.close(value); + if ( value.name.includes('/') ) { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('名称不允许有特殊字符','确定',config); + } else { + this.dialogRef.close(value); + } } + } //更改资料库名称 @@ -191,6 +201,14 @@ export class EditDataBankName { } onSubmit(value){ - this.dialogRef.close(value); + if ( value.name.includes('/') ) { + let config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open('名称不允许有特殊字符','确定',config); + } else { + this.dialogRef.close(value); + } } + } \ No newline at end of file diff --git a/src/app/ui/all-file/all-file.component.html b/src/app/ui/all-file/all-file.component.html index add2cfc..026fd9e 100644 --- a/src/app/ui/all-file/all-file.component.html +++ b/src/app/ui/all-file/all-file.component.html @@ -56,7 +56,7 @@
- 返回一级目录 + 返回一级目录 | 全部文件 diff --git a/src/app/ui/all-file/all-file.component.ts b/src/app/ui/all-file/all-file.component.ts index 420ff3d..4f941e9 100644 --- a/src/app/ui/all-file/all-file.component.ts +++ b/src/app/ui/all-file/all-file.component.ts @@ -26,7 +26,7 @@ export class AllFileComponent { - selectedDataBank:string //当前需要显示的资料库 + selectedDataBank:string = '' //当前需要显示的资料库 fileNum:any = 0 //当前资料库文件数量 selection = new SelectionModel(true, []);