From 00ff3eb8ebd4ea4311832dbad9748f4ae2bd02b2 Mon Sep 17 00:00:00 2001 From: cyuamber Date: Tue, 11 Feb 2020 11:21:41 +0800 Subject: feat: Optimize slice business management Change-Id: I95a55038c22cb3d54d3217fb3b0031adafc3a56a Issue-ID: USECASEUI-369 Signed-off-by: cyuamber --- .../business-order/business-order.component.html | 6 ++-- .../business-order/business-order.component.ts | 11 +++++- ...csmf-slicing-business-management.component.html | 15 ++++---- .../csmf-slicing-business-management.component.ts | 40 +++++++++++++--------- 4 files changed, 45 insertions(+), 27 deletions(-) (limited to 'usecaseui-portal/src/app/views') diff --git a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.html b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.html index 606d9e15..d4914dd1 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.html @@ -1,3 +1,3 @@ -

- business-order works! -

+ + diff --git a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts index bf95a83c..0647b76d 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/business-order/business-order.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core'; import {COMMUNICATION_FORM_ITEMS} from "../../../../../../constants/constants"; @Component({ selector: 'app-business-order', @@ -11,5 +11,14 @@ export class BusinessOrderComponent implements OnInit { ngOnInit() { } + @Input() showModel: boolean; + @Output() cancel = new EventEmitter(); + handleCancel() { + this.showModel = false; + this.cancel.emit(this.showModel) + } + handleOk() { + console.log(1) + } } diff --git a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html index c260de77..818fc136 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html +++ b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.html @@ -7,7 +7,7 @@ - +
No Service Instance Id Service Instance Name + Creation Time Service Type S-NSSAI Status @@ -28,8 +29,9 @@ {{i+1}} - {{ data.service_instance_id }} - {{ data.service_instance_name }} + {{ data.order_id }} + {{ data.order_name }} + {{ data.order_creation_time }} {{ data.service_type?data.service_type:'--' }} {{ data.service_snssai }} @@ -38,13 +40,13 @@ {{data.last_operation_progress+'%'}}
- {{data.orchestration_status}} + {{data.order_status}}
-
-
+
\ No newline at end of file diff --git a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts index fac4e0cf..76f0bcdf 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/csmf-slicing-business-management/csmf-slicing-business-management.component.ts @@ -2,6 +2,7 @@ import {Component, OnInit} from '@angular/core'; import {BUSINESS_STATUS} from "../../../../../constants/constants"; import {SlicingTaskServices} from '.././../../../core/services/slicingTaskServices'; import { NzModalService, NzMessageService } from 'ng-zorro-antd'; +import *as moment from 'moment'; @Component({ selector: 'app-csmf-slicing-business-management', templateUrl: './csmf-slicing-business-management.component.html', @@ -33,36 +34,37 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit { total: number = 0; loading = false; statusOptions: any[] = BUSINESS_STATUS; - isSelect: boolean = false; + // isSelect: boolean = false; progressingTimer: any[] = []; terminateStart: boolean = false; - + businessOrderShow: boolean = false; getCSMFBusinessList() { this.loading = true; - this.isSelect = false; + // this.isSelect = false; this.listOfData = []; let paramsObj = { status: this.selectedValue, pageNo: this.pageIndex, pageSize: this.pageSize }; - if (this.selectedValue !== BUSINESS_STATUS[0]) { - paramsObj["businessStatus"] = this.selectedValue; - this.isSelect = true; - } - this.myhttp.getSlicingBusinessList(paramsObj, this.isSelect).subscribe(res => { - const {result_header: {result_code}, result_body: {slicing_business_list, record_number}} = res; + // if (this.selectedValue !== BUSINESS_STATUS[0]) { + // paramsObj["businessStatus"] = this.selectedValue; + // this.isSelect = true; + // } + this.myhttp.getCSMFSlicingBusinessList(paramsObj).subscribe(res => { + const {result_header: {result_code}, result_body: {slicing_order_list, record_number}} = res; this.loading = false; if (+result_code === 200) { this.total = record_number; - if (slicing_business_list !== null && slicing_business_list.length > 0) { - this.listOfData = slicing_business_list.map((item, index) => { + if (slicing_order_list !== null && slicing_order_list.length > 0) { + this.listOfData = slicing_order_list.map((item, index) => { + item.order_creation_time = moment(Number(item.order_creation_time)).format('YYYY-MM-DD'); if (item.last_operation_progress && item.last_operation_type && Number(item.last_operation_progress) < 100) { let updata = (prodata: { operation_progress: string }) => { item.last_operation_progress = prodata.operation_progress || item.last_operation_progress; }; let obj = { - serviceId: item.service_instance_id + serviceId: item.order_id }; if (item.last_operation_type === 'DELETE') this.terminateStart = true; this.queryProgress(obj, index, updata).then((res) => { @@ -99,12 +101,12 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit { console.log(slicing, i, "slicing"); this.modalService.confirm({ nzTitle: 'Are you sure you want to perform this task?', - nzContent: 'Name:' + slicing.service_instance_name + '', + nzContent: 'Name:' + slicing.order_name + '', nzOnOk: () => { let paramsObj = { - serviceId: slicing.service_instance_id + serviceId: slicing.order_id }; - if (slicing.orchestration_status === 'activated') { + if (slicing.order_status === 'activated') { this.changeActivate(paramsObj, false, slicing, "deactivate", "deactivated", i) } else { this.changeActivate(paramsObj, true, slicing, "activate", "activated", i); @@ -145,9 +147,9 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit { console.log(slicing, "slicing"); this.modalService.confirm({ nzTitle: 'Are you sure you want to terminate this task?', - nzContent: 'Name: ' + slicing.service_instance_name, + nzContent: 'Name: ' + slicing.order_name, nzOnOk: () => { - let paramsObj = { serviceId: slicing.service_instance_id }; + let paramsObj = { serviceId: slicing.order_id }; this.terminateStart = true; this.loading = true; this.myhttp.terminateSlicingService(paramsObj).subscribe(res => { @@ -215,4 +217,8 @@ export class CsmfSlicingBusinessManagementComponent implements OnInit { requery(); }) } + + OrderModelShow(){ + this.businessOrderShow = true; + } } -- cgit 1.2.3-korg