|
|
|
@ -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); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |