diff --git a/src/app/pages/register/register.component.ts b/src/app/pages/register/register.component.ts index 55013f6..6f9552f 100644 --- a/src/app/pages/register/register.component.ts +++ b/src/app/pages/register/register.component.ts @@ -13,7 +13,7 @@ export class RegisterComponent implements OnInit { } onSubmit(e){ - console.log(e) + // console.log(e) } } diff --git a/src/app/ui/all-file/all-file.component.ts b/src/app/ui/all-file/all-file.component.ts index 1283a2f..de666fd 100644 --- a/src/app/ui/all-file/all-file.component.ts +++ b/src/app/ui/all-file/all-file.component.ts @@ -240,7 +240,7 @@ export class AllFileComponent { this.checkedAllFiles.push(item) } }) - console.log(888888,data.contents) + // console.log(888888,data.contents) }, err=>{ diff --git a/src/app/ui/changeuserdata/changeuserdata.component.ts b/src/app/ui/changeuserdata/changeuserdata.component.ts index e1ab304..57ca57e 100644 --- a/src/app/ui/changeuserdata/changeuserdata.component.ts +++ b/src/app/ui/changeuserdata/changeuserdata.component.ts @@ -16,7 +16,7 @@ export class ChangeuserdataComponent implements OnInit { //修改资料 onSubmit (e) { - console.log(e) + // console.log(e) } } diff --git a/src/app/ui/enterpriseuser/addenterpriseuser.component.ts b/src/app/ui/enterpriseuser/addenterpriseuser.component.ts index 2493598..e7aab20 100644 --- a/src/app/ui/enterpriseuser/addenterpriseuser.component.ts +++ b/src/app/ui/enterpriseuser/addenterpriseuser.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import {MatDialogRef} from '@angular/material/dialog'; import {FormControl} from '@angular/forms'; - +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @Component({ selector: 'addenterpriseuser', @@ -12,7 +12,7 @@ import {FormControl} from '@angular/forms'; export class AddEnterpriserUser { toppings = new FormControl(); - constructor(private http: HttpClient,public dialogRef: MatDialogRef) {} + constructor(private http: HttpClient,public dialogRef: MatDialogRef,public snackBar: MatSnackBar) {} errmsg:any; //捕获错误信息 detachmentPosts: any = []//支队职务列表 brigadePosts: any = []//大队职务列表 @@ -24,7 +24,6 @@ export class AddEnterpriserUser { //获得所有职务 getAllPosts(){ this.http.get("/api/Posts").subscribe( (data:any) =>{ - console.log(123,data) data.forEach(item => { if(item.name.indexOf("支队级") != -1){ this.detachmentPosts.push(item) @@ -46,7 +45,6 @@ export class AddEnterpriserUser { postsArr.forEach((item) => { postsObj.push({id:item, name:""}) }) - // console.log(666,postsObj) let body = { name : e.idNumber, realName : e.realName, @@ -55,9 +53,13 @@ export class AddEnterpriserUser { creationTime : date, posts : postsObj } - // console.log(date) this.http.post("/api/Users",body).subscribe( data => { this.dialogRef.close(data); + },err => { + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open(err,'确定',config); }) } diff --git a/src/app/ui/enterpriseuser/enterpriseuser.component.ts b/src/app/ui/enterpriseuser/enterpriseuser.component.ts index bfa8860..e5c7af0 100644 --- a/src/app/ui/enterpriseuser/enterpriseuser.component.ts +++ b/src/app/ui/enterpriseuser/enterpriseuser.component.ts @@ -248,7 +248,6 @@ export class editenterpriseuser { //获得所有职务 getAllPosts(){ this.http.get("/api/Posts").subscribe( (data:any) =>{ - console.log(123,data) data.forEach(item => { if(item.name.indexOf("支队级") != -1){ this.detachmentPosts.push(item) diff --git a/src/app/ui/teacherManagement/addenterpriseuser.component.ts b/src/app/ui/teacherManagement/addenterpriseuser.component.ts index 2531639..c4d6c72 100644 --- a/src/app/ui/teacherManagement/addenterpriseuser.component.ts +++ b/src/app/ui/teacherManagement/addenterpriseuser.component.ts @@ -2,7 +2,7 @@ import { Component, OnInit, Inject } from '@angular/core'; import { HttpClient } from '@angular/common/http'; import {MatDialogRef} from '@angular/material/dialog'; import {FormControl} from '@angular/forms'; - +import { MatSnackBar, MatSnackBarConfig } from '@angular/material/snack-bar'; @Component({ selector: 'addenterpriseuser', @@ -12,7 +12,7 @@ import {FormControl} from '@angular/forms'; export class AddTeacher { toppings = new FormControl(); - constructor(private http: HttpClient,public dialogRef: MatDialogRef) {} + constructor(private http: HttpClient,public dialogRef: MatDialogRef,public snackBar: MatSnackBar) {} errmsg:any; //捕获错误信息 detachmentPosts: any = []//支队职务列表 brigadePosts: any = []//大队职务列表 @@ -55,6 +55,11 @@ export class AddTeacher { } this.http.post("/api/Users",body).subscribe( data => { this.dialogRef.close(data); + },err=>{ + const config = new MatSnackBarConfig(); + config.verticalPosition = 'top'; + config.duration = 3000 + this.snackBar.open(err,'确定',config); }) } diff --git a/src/app/ui/teacherManagement/enterpriseuser.component.ts b/src/app/ui/teacherManagement/enterpriseuser.component.ts index 217938a..d49e7e7 100644 --- a/src/app/ui/teacherManagement/enterpriseuser.component.ts +++ b/src/app/ui/teacherManagement/enterpriseuser.component.ts @@ -64,7 +64,7 @@ export class TeacherManagementComponent implements OnInit { RoleType: '1', } this.http.get('/api/Users',{params:data}).subscribe((data:any)=>{ - console.log(666,data) + // console.log(666,data) this.length = data.totalCount this.pageSize = data.pageSize this.pageEvent.pageIndex = 0 @@ -244,7 +244,7 @@ export class editTeacher { //获得所有职务 getAllPosts(){ this.http.get("/api/Posts").subscribe( (data:any) =>{ - console.log(123,data) + // console.log(123,data) data.forEach(item => { if(item.name.indexOf("支队级") != -1){ this.detachmentPosts.push(item)