diff options
author | cyuamber <xuranyjy@chinamobile.com> | 2019-09-20 14:07:01 +0800 |
---|---|---|
committer | cyuamber <xuranyjy@chinamobile.com> | 2019-09-20 14:07:17 +0800 |
commit | ee2d1333ff4a8a233dd00bdbda7aa9f9e38061af (patch) | |
tree | 338002f050802c39dc037f8a5e3ad49163d4bb24 /usecaseui-portal/src/app/shared/components | |
parent | 781aad0ded84716dce4cd88f661e33d0cea852e8 (diff) |
bug: prompt box repeat rendering display has been fixed
Change-Id: I80a31b7e5f0caf97bcf9954643eff566c407b912
Issue-ID: USECASEUI-306
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/shared/components')
-rw-r--r-- | usecaseui-portal/src/app/shared/components/customer/customer.component.ts | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/usecaseui-portal/src/app/shared/components/customer/customer.component.ts b/usecaseui-portal/src/app/shared/components/customer/customer.component.ts index b74509e6..c9419887 100644 --- a/usecaseui-portal/src/app/shared/components/customer/customer.component.ts +++ b/usecaseui-portal/src/app/shared/components/customer/customer.component.ts @@ -47,22 +47,29 @@ export class CustomerComponent implements OnInit { deleteCustomerModelVisible = false; deleteServiceTypeModelVisible = false; //2019.08.14 add - notificationAttributes = { - "title": "Customer", - "imgPath": "assets/images/execute-inproess.png", - "action": "Create", - "status": "InProgress", - "name": "" - }; - notificationSuccess(notificationModel) { - this.notificationAttributes.imgPath = "assets/images/execute-success.png"; - this.notificationAttributes.status = "Success"; + notificationAttributes = null; + key: string = 'notigication' + notificationSuccess(notificationModel,title,action,name) { + this.notification.remove() + this.notificationAttributes = { + title: title, + imgPath: "assets/images/execute-success.png", + action: action, + status: 'Success', + name: name + } this.notification.template(notificationModel); } - notificationFailed(notificationModel) { - this.notificationAttributes.imgPath = "assets/images/execute-faild.png"; - this.notificationAttributes.status = "Failed"; - this.notification.template(notificationModel); + notificationFailed(notificationModel,title,action,name) { + this.notification.remove() + this.notificationAttributes = { + title: title, + imgPath: "assets/images/execute-faild.png", + action: action, + status: 'Failed', + name: name + } + this.notification.template(notificationModel) } getAllCustomers() { this.managemencs.getAllCustomers().subscribe((data) => { @@ -376,15 +383,12 @@ export class CustomerComponent implements OnInit { 'subscriber-name': this.addNewCustomer, 'subscriber-type': 'INFRA' }; - this.notificationAttributes.title = 'Customer'; - this.notificationAttributes.action = 'Create'; - this.notificationAttributes.name = this.addNewCustomer; this.managemencs.createCustomer(this.addNewCustomer, createParams).subscribe((data) => { if (data["status"] == 'SUCCESS') { - this.notificationSuccess(notificationModel); + this.notificationSuccess(notificationModel,'Customer','Create',this.addNewCustomer); this.getAllCustomers(); } else { - this.notificationFailed(notificationModel); + this.notificationFailed(notificationModel,'Customer','Create',this.addNewCustomer); } }) } @@ -404,9 +408,6 @@ export class CustomerComponent implements OnInit { deleteCustomerOk(notificationModel) { this.deleteCustomerModelVisible = false; this.getCustomerVersion(this.thisdeleteCustomer, notificationModel); - this.notificationAttributes.title = 'Customer'; - this.notificationAttributes.action = 'delete'; - this.notificationAttributes.name = this.thisdeleteCustomer.name; } getCustomerVersion(thisdeleteCustomer, notificationModel) { this.managemencs.getdeleteCustomerVersion(thisdeleteCustomer).subscribe((data) => { @@ -424,10 +425,10 @@ export class CustomerComponent implements OnInit { deleteCustomer(paramsObj, notificationModel) { this.managemencs.deleteSelectCustomer(paramsObj).subscribe((data) => { if (data["status"] == 'SUCCESS') { - this.notificationSuccess(notificationModel); + this.notificationSuccess(notificationModel,'Customer','delete',this.thisdeleteCustomer.name); this.getAllCustomers(); } else { - this.notificationFailed(notificationModel); + this.notificationFailed(notificationModel,'Customer','delete',this.thisdeleteCustomer.name); } }) } @@ -439,15 +440,12 @@ export class CustomerComponent implements OnInit { "service-type": this.addNewServiceType, "temp-ub-sub-account-id": "sotnaccount" }; - this.notificationAttributes.title = 'ServiceType'; - this.notificationAttributes.action = 'Create'; - this.notificationAttributes.name = this.addNewServiceType; this.managemencs.createServiceType(createParams).subscribe((data) => { if (data["status"] == 'SUCCESS') { - this.notificationSuccess(notificationModel); + this.notificationSuccess(notificationModel,'ServiceType','Create',this.addNewServiceType); this.getAllCustomers(); } else { - this.notificationFailed(notificationModel); + this.notificationFailed(notificationModel,'ServiceType','Create',this.addNewServiceType); } }) } @@ -472,9 +470,6 @@ export class CustomerComponent implements OnInit { customerId: this.selectCustomer, ServiceType: this.thisdeleteServiceType["type"] }; - this.notificationAttributes.title = 'ServiceType'; - this.notificationAttributes.action = 'delete'; - this.notificationAttributes.name = this.thisdeleteServiceType["type"]; this.managemencs.getdeleteServiceTypeVersion(paramss).subscribe((data) => { if (data["status"] == 'SUCCESS') { let params = { @@ -490,12 +485,11 @@ export class CustomerComponent implements OnInit { } deleteServiceType(params, notificationModel) { this.managemencs.deleteSelectServiceType(params).subscribe((data) => { - console.log(data) if (data["status"] == 'SUCCESS') { - this.notificationSuccess(notificationModel); + this.notificationSuccess(notificationModel,'ServiceType','delete',this.thisdeleteServiceType["type"]); this.getAllCustomers(); } else { - this.notificationFailed(notificationModel); + this.notificationFailed(notificationModel,'ServiceType','delete',this.thisdeleteServiceType["type"]); } }) } |