summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuyi Guo <guochuyi@chinamobile.com>2020-09-02 10:03:32 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-02 10:03:32 +0000
commite94d27cf4dfaad65da944e19dc6e542c635dd9b9 (patch)
tree86622cf38a375ed5cbd3245e1016607b9187d4eb
parentf2ab4faa09a577a1d5008b692c67ded0f480db9e (diff)
parent5debb7f786362a3312fd6e57df062acc1ad5560a (diff)
Merge "feat: Business Requirement Info: Render the page according to whether there is a value of 5G tast"
-rw-r--r--usecaseui-portal/src/app/mock/json/slicing_task_auditInfo.json2
-rw-r--r--usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.html6
-rw-r--r--usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.ts31
-rw-r--r--usecaseui-portal/src/constants/constants.ts24
4 files changed, 41 insertions, 22 deletions
diff --git a/usecaseui-portal/src/app/mock/json/slicing_task_auditInfo.json b/usecaseui-portal/src/app/mock/json/slicing_task_auditInfo.json
index 8305a03e..687ec521 100644
--- a/usecaseui-portal/src/app/mock/json/slicing_task_auditInfo.json
+++ b/usecaseui-portal/src/app/mock/json/slicing_task_auditInfo.json
@@ -10,7 +10,7 @@
"processing_status": "WaitingToConfirm",
"business_demand_info": {
"service_name": "5G Slice eMMB",
- "service_snssai": "1-010101",
+ "service_snssai": "",
"exp_data_rate_dl": "300",
"exp_data_rate_ul": "300",
"ue_mobility_level": "stationary",
diff --git a/usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.html b/usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.html
index 08edd8d6..8931277b 100644
--- a/usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.html
+++ b/usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.html
@@ -38,7 +38,7 @@
<nz-list
class="taskmodel_list"
- [nzDataSource]="businessRequirement"
+ [nzDataSource]="requirement"
nzBordered
[nzHeader]="businessItemTitle"
[nzFooter]="null"
@@ -53,7 +53,7 @@
nzType="flex"
nzJustify="start"
[nzGutter]="8"
- *ngFor="let list of businessList"
+ *ngFor="let list of businessListAfterSorting"
>
<div
nz-col
@@ -68,7 +68,7 @@
<nz-tag *ngFor="let value of item[ite.key]">
{{value}}
</nz-tag>
- </span>
+ </span>
</div>
</nz-list-item>
</ng-template>
diff --git a/usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.ts b/usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.ts
index d718d9d3..538b08c5 100644
--- a/usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.ts
+++ b/usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.ts
@@ -1,5 +1,6 @@
import { Component, OnInit, Input } from '@angular/core';
-import { BUSINESS_REQUIREMENT } from '../../../../constants/constants';
+import { BUSINESS_REQUIREMENT } from '@src/constants/constants';
+import {el} from "@angular/platform-browser/testing/src/browser_util";
@Component({
selector: 'app-basic-info',
templateUrl: './basic-info.component.html',
@@ -14,10 +15,36 @@ export class BasicInfoComponent implements OnInit {
// 业务需求列表
businessList: object[] = BUSINESS_REQUIREMENT;
-
+ requirement: object = [{}];
+ businessListAfterSorting: object[] = [];
constructor() { }
ngOnInit() {
+
}
+ ngOnChanges() { // Business Requirement Info: Render the page according to whether there is a value
+ this.businessListAfterSorting = [];
+ this.businessList = BUSINESS_REQUIREMENT.concat([]);
+ if(this.businessRequirement && this.businessRequirement.length !== 0){
+ Object.keys(this.businessRequirement[0]).map((item,index)=>{
+ if(this.businessRequirement[0][item] !== '' && this.businessRequirement[0][item] !== null){
+ this.requirement[0][item] = this.businessRequirement[0][item];
+
+ }else{
+ this.businessList.map((items,indexs)=>{
+ if(Array.isArray(items) === false && items["key"] === item){
+ this.businessList.splice(indexs,1)
+ }
+ })
+ }
+ });
+ let area = this.businessList.pop();
+ for(let i=0;i<this.businessList.length-1;i+=3){
+ this.businessListAfterSorting.push(this.businessList.slice(i,i+3));
+ }
+ this.businessListAfterSorting.push(area);
+ }
+ }
+
}
diff --git a/usecaseui-portal/src/constants/constants.ts b/usecaseui-portal/src/constants/constants.ts
index 412db5c8..9d5554d8 100644
--- a/usecaseui-portal/src/constants/constants.ts
+++ b/usecaseui-portal/src/constants/constants.ts
@@ -22,7 +22,7 @@ export const TASK_PROCESSING_STATUS = [
]
export const BUSINESS_REQUIREMENT = [
- [
+
{
title: 'Slicing Business Name',
key: 'service_name'
@@ -35,8 +35,6 @@ export const BUSINESS_REQUIREMENT = [
title: 'Data Rate Downlink (Mbps) ',
key: 'exp_data_rate_dl'
},
- ],
- [
{
title: 'Data Rate Uplink (Mbps) ',
key: 'exp_data_rate_ul'
@@ -49,10 +47,8 @@ export const BUSINESS_REQUIREMENT = [
title: 'Latency (ms)',
key: 'latency'
},
- ],
- [
{
- title: 'Use Interval (Moon) ',
+ title: 'Use Interval (Month) ',
key: 'use_interval'
},
@@ -64,8 +60,6 @@ export const BUSINESS_REQUIREMENT = [
title: 'Resource Sharing Level',
key: 'resource_sharing_level'
},
- ],
- [
{
title: 'Max Number of UEs',
key: 'max_number_of_ues'
@@ -77,15 +71,13 @@ export const BUSINESS_REQUIREMENT = [
{
title: 'Downlink Regional Traffic Density(Mbps/km )',
key: 'area_traffic_cap_dl'
- }
- ],
- [
- {
- title: 'Area',
- key: 'area'
},
- ],
-
+ [
+ {
+ title: 'Area',
+ key: 'area'
+ }
+ ]
]