feat: Business Requirement Info: Render the page according to whether there is a... 21/112021/2
authorcyuamber <xuranyjy@chinamobile.com>
Wed, 2 Sep 2020 03:45:36 +0000 (11:45 +0800)
committercyuamber <xuranyjy@chinamobile.com>
Wed, 2 Sep 2020 04:02:48 +0000 (12:02 +0800)
Change-Id: I08008595568de563625c95ba75cb61d0dda832fa
Issue-ID: USECASEUI-444
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
usecaseui-portal/src/app/mock/json/slicing_task_auditInfo.json
usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.html
usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.ts
usecaseui-portal/src/constants/constants.ts

index 8305a03..687ec52 100644 (file)
@@ -10,7 +10,7 @@
         "processing_status": "WaitingToConfirm",\r
         "business_demand_info": {\r
             "service_name": "5G Slice eMMB",\r
-            "service_snssai": "1-010101",\r
+            "service_snssai": "",\r
             "exp_data_rate_dl": "300",\r
             "exp_data_rate_ul": "300",\r
             "ue_mobility_level": "stationary",\r
index 08edd8d..8931277 100644 (file)
@@ -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>
index d718d9d..538b08c 100644 (file)
@@ -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);
+        }
+    }
+
 }
index 3469dd9..2514b65 100644 (file)
@@ -22,7 +22,7 @@ export const TASK_PROCESSING_STATUS = [
 ]\r
 \r
 export const BUSINESS_REQUIREMENT = [\r
-       [\r
+\r
                {\r
                        title: 'Slicing Business Name',\r
                        key: 'service_name'\r
@@ -35,8 +35,6 @@ export const BUSINESS_REQUIREMENT = [
                        title: 'Data Rate Downlink (Mbps) ',\r
                        key: 'exp_data_rate_dl'\r
                },\r
-       ],\r
-       [\r
                {\r
                        title: 'Data Rate Uplink (Mbps) ',\r
                        key: 'exp_data_rate_ul'\r
@@ -49,10 +47,8 @@ export const BUSINESS_REQUIREMENT = [
                        title: 'Latency (ms)',\r
                        key: 'latency'\r
                },\r
-       ],\r
-       [\r
                {\r
-                       title: 'Use Interval (Moon) ',\r
+                       title: 'Use Interval (Month) ',\r
                        key: 'use_interval'\r
                },\r
 \r
@@ -64,8 +60,6 @@ export const BUSINESS_REQUIREMENT = [
                        title: 'Resource Sharing Level',\r
                        key: 'resource_sharing_level'\r
                },\r
-       ],\r
-       [\r
                {\r
                        title: 'Max Number of UEs',\r
                        key: 'max_number_of_ues'\r
@@ -77,15 +71,13 @@ export const BUSINESS_REQUIREMENT = [
                {\r
                        title: 'Downlink Regional Traffic Density(Mbps/km )',\r
                        key: 'area_traffic_cap_dl'\r
-               }\r
-       ],\r
-       [\r
-               {\r
-                       title: 'Area',\r
-                       key: 'area'\r
                },\r
-       ],\r
-\r
+               [\r
+            {\r
+                title: 'Area',\r
+                key: 'area'\r
+            }\r
+        ]\r
 \r
 ]\r
 \r