From 41747c44aa4ee1fd9a73c781822a452ec327b5ce Mon Sep 17 00:00:00 2001 From: cyuamber Date: Thu, 29 Aug 2019 17:19:11 +0800 Subject: feat: customer page code optimization Change-Id: Ia1ea7bcb8d2eb4c2561bb963b58467fa2d63a92b Issue-ID: USECASEUI-307 Signed-off-by: cyuamber --- .../components/customer/customer.component.html | 5 +---- .../components/customer/customer.component.less | 18 ++++++++-------- .../components/customer/customer.component.ts | 24 +++++++--------------- 3 files changed, 17 insertions(+), 30 deletions(-) diff --git a/usecaseui-portal/src/app/shared/components/customer/customer.component.html b/usecaseui-portal/src/app/shared/components/customer/customer.component.html index 646431b2..c0d3c8d5 100644 --- a/usecaseui-portal/src/app/shared/components/customer/customer.component.html +++ b/usecaseui-portal/src/app/shared/components/customer/customer.component.html @@ -18,10 +18,7 @@

{{"i18nTextDefine_Instance_Count_of_Customer" | translate}}

-
No - Service Instances
- +
No Service Instances

{{"i18nTextDefine_Instance_Count_of_ServiceType" | translate}}

diff --git a/usecaseui-portal/src/app/shared/components/customer/customer.component.less b/usecaseui-portal/src/app/shared/components/customer/customer.component.less index 83307dd7..e5bf2dd3 100644 --- a/usecaseui-portal/src/app/shared/components/customer/customer.component.less +++ b/usecaseui-portal/src/app/shared/components/customer/customer.component.less @@ -14,8 +14,7 @@ limitations under the License. */ .content { - display: flex; - + display: flex; width: 100%; height: 100%; i.anticon { @@ -55,13 +54,13 @@ color :#0DA9E2; font-family:"ArialMT"; } - .legend { - height: 10px; - width: 10px; - display: inline-block; - background: linear-gradient(to right,#7DCEFB, #0DA9E2); - border-radius: 50%; - margin: 15px 4px 0 43%; + div:last-child{ + color: #ddd; + font-weight: 700; + font-size: 19px; + height: 200px; + text-align: center; + line-height: 8; } } .type { @@ -272,5 +271,6 @@ } } + } \ No newline at end of file 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 a0cf8338..a510e6db 100644 --- a/usecaseui-portal/src/app/shared/components/customer/customer.component.ts +++ b/usecaseui-portal/src/app/shared/components/customer/customer.component.ts @@ -50,22 +50,21 @@ export class CustomerComponent implements OnInit { //2019.08.14 add notificationAttributes = { "title": "Customer", - "imgPath": "../../../../assets/images/execute-inproess.png", + "imgPath": "assets/images/execute-inproess.png", "action": "Create", "status": "InProgress", "name": "" }; notificationModelShow(template: TemplateRef<{}>): void { - console.log(this.notificationAttributes, "notificationModelShow show"); this.notification.template(template); } notificationSuccess(notificationModel) { - this.notificationAttributes.imgPath = "../../../../assets/images/execute-success.png"; + this.notificationAttributes.imgPath = "assets/images/execute-success.png"; this.notificationAttributes.status = "Success"; this.notificationModelShow(notificationModel); } notificationFailed(notificationModel) { - this.notificationAttributes.imgPath = "../../../../assets/images/execute-faild.png"; + this.notificationAttributes.imgPath = "assets/images/execute-faild.png"; this.notificationAttributes.status = "Failed"; this.notificationModelShow(notificationModel); } @@ -189,7 +188,6 @@ export class CustomerComponent implements OnInit { data: data.customerServiceList }] } - console.log(this.CUChartData) }, (err) => { console.log(err); }); @@ -380,7 +378,6 @@ export class CustomerComponent implements OnInit { data: this.value_s }] } - console.log(this.serviceData) }) } @@ -393,7 +390,7 @@ export class CustomerComponent implements OnInit { }; this.notificationAttributes = { "title": "Customer", - "imgPath": "../../../../assets/images/execute-inproess.png", + "imgPath": "assets/images/execute-inproess.png", "action": "Create", "status": "InProgress", "name": this.addNewCustomer @@ -403,7 +400,6 @@ export class CustomerComponent implements OnInit { if (data["status"] == 'SUCCESS') { this.notificationSuccess(notificationModel); this.getAllCustomers(); - console.log(data, "Interface returned success") } else { this.notificationFailed(notificationModel); console.log(data, "Interface returned error") @@ -428,7 +424,7 @@ export class CustomerComponent implements OnInit { this.getCustomerVersion(this.thisdeleteCustomer, notificationModel); this.notificationAttributes = { "title": "Customer", - "imgPath": "../../../../assets/images/execute-inproess.png", + "imgPath": "assets/images/execute-inproess.png", "action": "delete", "status": "InProgress", "name": this.thisdeleteCustomer.name @@ -443,7 +439,6 @@ export class CustomerComponent implements OnInit { version: data["result"]["resource-version"] }; this.deleteCustomer(params, notificationModel); - console.log(data, "Interface returned success") } else { console.log(data, "Interface returned error") } @@ -454,7 +449,6 @@ export class CustomerComponent implements OnInit { if (data["status"] == 'SUCCESS') { this.notificationSuccess(notificationModel); this.getAllCustomers(); - console.log(data, "Interface returned success") } else { this.notificationFailed(notificationModel); console.log(data, "Interface returned error") @@ -471,7 +465,7 @@ export class CustomerComponent implements OnInit { }; this.notificationAttributes = { "title": "ServiceType", - "imgPath": "../../../../assets/images/execute-inproess.png", + "imgPath": "assets/images/execute-inproess.png", "action": "Create", "status": "InProgress", "name": this.addNewServiceType @@ -482,7 +476,6 @@ export class CustomerComponent implements OnInit { this.notificationSuccess(notificationModel); this.getCustomersColumn(this.selectCustomer); this.getAllCustomers(); - console.log(data, "Interface returned success") } else { this.notificationFailed(notificationModel); console.log(data, "Interface returned error") @@ -512,14 +505,13 @@ export class CustomerComponent implements OnInit { }; this.notificationAttributes = { "title": "ServiceType", - "imgPath": "../../../../assets/images/execute-inproess.png", + "imgPath": "assets/images/execute-inproess.png", "action": "delete", "status": "InProgress", "name": this.thisdeleteServiceType["type"] }; this.notificationModelShow(notificationModel); this.managemencs.getdeleteServiceTypeVersion(paramss).subscribe((data) => { - console.log(data) if (data["status"] == 'SUCCESS') { let params = { customerId: this.selectCustomer, @@ -527,7 +519,6 @@ export class CustomerComponent implements OnInit { version: data["result"]["resource-version"] }; this.deleteServiceType(params, notificationModel); - console.log(data, "Interface returned success") } else { console.log(data, "Interface returned error") } @@ -540,7 +531,6 @@ export class CustomerComponent implements OnInit { this.getServiceTypes(params.customerId); this.getCustomersColumn(params.customerId); this.getAllCustomers(); - console.log(data, "Interface returned success") } else { this.notificationFailed(notificationModel); console.log(data, "Interface returned error") -- cgit 1.2.3-korg