feat: fix bugs of submit vertification bug, change checkbox to radio, pagination... 47/117347/1
authorwangyuerg <wangyuerg@chinamobile.com>
Tue, 2 Feb 2021 10:29:24 +0000 (18:29 +0800)
committerwangyuerg <wangyuerg@chinamobile.com>
Tue, 2 Feb 2021 10:30:10 +0000 (18:30 +0800)
Signed-off-by: wangyuerg <wangyuerg@chinamobile.com>
Change-Id: Icde1865ce4c7fb2a8aae9127bbc5e27c526aa7b8
Issue-ID: USECASEUI-527

usecaseui-portal/src/app/mock/json/slicing_task_auditInfo.json
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.html
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.less
usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts
usecaseui-portal/src/constants/constants.ts

index 07e6c98..216a549 100644 (file)
@@ -70,7 +70,7 @@
             "sliceProfile_TN_BH_sST": "test_sliceProfile_TN_BH _sST",\r
             "sliceProfile_TN_BH_sNSSAI": "test_tn_service_snssai_01",\r
             "sliceProfile_TN_resourceSharingLevel": "shared",\r
-            "tn_connection_links": ["123213"],\r
+            "tn_connection_links": "123213",\r
             "tn_connection_links_option": [{\r
                     "id": "123213",\r
                     "AN": "1an",\r
index f9e5e28..6e5b5b0 100644 (file)
@@ -57,7 +57,8 @@
                                        </nz-input-group>
                                        <!-- connection links table -->
                                        <div *ngIf="item.title === 'Connection Links'">
-                                               <nz-table #basicTable [nzData]="[{}]" nzShowPagination="false">
+                                               <nz-table #basicTable [nzData]="this.formData[item.options.key]" nzShowPagination="true"
+                                                       nzPageSize="2">
                                                        <thead>
                                                                <tr>
                                                                        <th *ngFor="let val of item.header" class="subnet_td">{{val.title}}</th>
                                                                </tr>
                                                        </thead>
                                                        <tbody>
-                                                               <tr *ngFor="let t of formData[item.options.key]">
+                                                               <tr *ngFor="let t of basicTable.data">
                                                                        <td *ngFor="let val of item.header" class="subnet_td">
                                                                                {{t[val.key]}}
                                                                        </td>
-                                                                       <td nzShowCheckbox="true" [nzChecked]="t.checked"
+                                                                       <!-- <td nzShowCheckbox="true" [nzChecked]="t.checked"
                                                                                (nzCheckedChange)="changeLinkCheck(t.id, $event)" [nzDisabled]="item.disable"
                                                                                class="subnet_td">
-                                                                               <!-- <input type="checkbox" ng-model="t.checked" ng-change="nzCheckedChange(t.id)"> -->
+                                                                       </td> -->
+                                                                       <td>
+                                                                               <input type="radio" name="linkcheck" [value]="t.id"
+                                                                                       (click)="changeLinkCheck(t.id)" [checked]="t.checked"
+                                                                                       [disabled]="item.disable" class="table_radio" />
                                                                        </td>
                                                                </tr>
                                                        </tbody>
index a867469..589a507 100644 (file)
@@ -1,8 +1,18 @@
 .subnet_params_container {\r
     padding-left: 3%;\r
 \r
+    ::ng-deep .ant-table {\r
+        width: 600px !important;\r
+        overflow: scroll !important;\r
+        height: 200px;\r
+    }\r
+\r
+    .table_radio {\r
+        color: #EAEAEA;\r
+    }\r
+\r
     .subnet_td {\r
-        width: 100px;\r
+        min-width: 100px;\r
     }\r
 \r
     .subnet_params_area {\r
index c878de5..792e8dc 100644 (file)
@@ -56,12 +56,13 @@ export class SubnetParamsModelComponent implements OnInit {
                                this.CNkeyList = this.transferFormItems.find((item) => {return item.title === 'CN Endpoint'}).options.map((val) => {return val.key})
                                this.keyList = this.ANkeyList.concat(this.CNkeyList)
                                this.formData['tn_connection_links_option'].forEach((item) => { // add init selection status
-                                       if (this.formData['tn_connection_links']!== null && this.formData['tn_connection_links'].indexOf(item.id) !== -1) {
+                                       if (typeof this.formData['tn_connection_links'] !== 'undefined' && this.formData['tn_connection_links'] !== '' && this.formData['tn_connection_links'] !== null && item.id === this.formData['tn_connection_links']) {
                                                item.checked = true
                                        } else {
                                                item.checked = false
                                        }
                                })
+                               console.log(this.formData['tn_connection_links_option'])
                                this.judgeTn() // init judge
                        }
                        // If the endpoint related parameters from the back end are incomplete, delete the endpoint item
@@ -98,10 +99,10 @@ export class SubnetParamsModelComponent implements OnInit {
                                item.checked = false
                        })
                        this.formData['tn_connection_links'] = null
+                       this.notPassPara = ['tn_connection_links', 'tn_connection_links_option']
                        this.transferFormItems.forEach((item) => {
                                if (item.title === 'Connection Links') {
                                        item.disable = true
-                                       this.notPassPara = ['tn_connection_links', 'tn_connection_links_option']
                                } else if (item.title === 'AN Endpoint' || item.title === 'CN Endpoint') {
                                        item.required = true
                                        item.disable = false
@@ -112,15 +113,16 @@ export class SubnetParamsModelComponent implements OnInit {
                                if (item.title === 'Connection Links') {
                                        item.disable = false
                                } else if (item.title === 'AN Endpoint' || item.title === 'CN Endpoint') {
-                                       if (this.formData['tn_connection_links']!==null && this.formData['tn_connection_links'].length !== 0) {
+                                       if (typeof this.formData['tn_connection_links'] !== 'undefined' && this.formData['tn_connection_links']!==null && this.formData['tn_connection_links'] !== '') {
                                                item.disable = true
                                                item.required = false
                                                this.notPassPara = ['tn_connection_links_option']
                                                this.notPassPara = this.notPassPara.concat(this.ANkeyList, this.CNkeyList)
-                                               console.log('not', this.notPassPara)
-                                       } else if (this.formData['tn_connection_links']!==null && this.formData['tn_connection_links'].length === 0) {
+                                       } else { //:todo
+                                               this.formData['tn_connection_links'] = ''
                                                item.disable = false
                                                item.required = true
+                                               this.notPassPara = ['tn_connection_links_option']
                                        }
                                }
                        })
@@ -158,12 +160,16 @@ export class SubnetParamsModelComponent implements OnInit {
                }
        }
 
-       changeLinkCheck (id: string, e: boolean) : void{ // update the selection state
-               this.formData['tn_connection_links_option'].find((item) => {
-                       return item.id === id
-               }).checked = e
-               const checkedList = this.formData['tn_connection_links_option'].filter((item) => {return item.checked === true})
-               this.formData['tn_connection_links'] = checkedList.map((item) => {return item.id}) //  get the selected id
+       changeLinkCheck (id: string) : void{ // update the selection state
+               this.formData['tn_connection_links_option'].forEach((item) => {
+                       if (item.id === id) {
+                               item.checked = true
+                       } else {
+                               item.checked = false
+                       }
+               })
+               console.log(this.formData['tn_connection_links_option'])
+               this.formData['tn_connection_links'] = id //  get the selected id
                this.judgeTn()
        }
 
@@ -386,17 +392,26 @@ export class SubnetParamsModelComponent implements OnInit {
                } else {
                        params = {...this.formData};
                }
-               // Verify that each item exclude endpoint is not empty, include special handeling of area_list
-               let checkParams = params
-               if (this.title === 'An' || this.title === 'Cn') {
-                       checkParams = this.coreFormItems.filter((item) => {
-                               return item.required === true
-                       })
-               } else if (this.title = 'Tn') {
-                       checkParams = this.transferFormItems.filter((item) => {
-                               return item.required === true
-                       })
-               }
+        // Verify that each item exclude endpoint is not empty, include special handeling of area_list
+        let checkParams : object= params
+        let requireKeyList :string[] = []
+        let targetFormItems : any[] = []
+        if (this.title === 'An' || this.title === 'Cn') {
+            targetFormItems = this.coreFormItems
+        } else if (this.title = 'Tn') {
+            targetFormItems = this.transferFormItems
+        }
+        for (let item of targetFormItems) {
+            if (typeof item.required !== 'undefined' && item.required) {
+                if (typeof item.type !== 'undefined' && item.type !== 'endpoint')
+                    {
+                        requireKeyList.push(item.key)
+                    }
+            }
+        }
+        console.log(requireKeyList)
+        checkParams = this.Util.pick(params, requireKeyList)
+        console.log(checkParams)
                if (this.Util.deepCheck(checkParams) && this.areaCheckBeforeSubmit(params)) {
                        this.paramsDataChange.emit(params);
                        this.noPassParaChange.emit(this.notPassPara)
index ab40534..fecbcda 100644 (file)
@@ -134,27 +134,31 @@ export const TRANSFRER_FORM_ITEMS = [
         title: 'S-NSSAI',\r
         key: 'sliceProfile_TN_BH_sNSSAI',\r
         required: true,\r
+        type: 'input'\r
     },\r
        {\r
         title: 'Latency (ms)',\r
         key: 'tn_bh_latency',\r
-        required: true\r
+        required: true,\r
+        type: 'input'\r
     },\r
     {\r
         title: 'Jitter',\r
         key: 'sliceProfile_TN_BH_jitte',\r
         required: false,\r
+        type: 'input'\r
     },\r
        {\r
                title: 'MaxBandwidth',\r
         key: 'tn_bh_bandwidth',\r
-        required: true\r
+        required: true,\r
+        type: 'input'\r
     },\r
     {\r
         title: 'Resource Sharing Level', // select\r
         key: 'sliceProfile_TN_resourceSharingLevel', // :new\r
         required: true,\r
-        type: '',\r
+        type: 'radio',\r
         options: [\r
             {\r
                 title: 'Shared',\r
@@ -170,6 +174,7 @@ export const TRANSFRER_FORM_ITEMS = [
         title: 'Connection Links',// table\r
         key: 'tn_connection_links', // :new\r
         required: false, // combined\r
+        type: 'table',\r
         options: {\r
             title: 'connection_links_option',\r
             key: 'tn_connection_links_option'\r
@@ -201,6 +206,7 @@ export const TRANSFRER_FORM_ITEMS = [
     {\r
         title:'AN Endpoint', // input group\r
         key:"an_Endpoint",\r
+        type: 'endpoint',\r
         required: false,\r
         disable: false,\r
         options: [\r
@@ -224,6 +230,7 @@ export const TRANSFRER_FORM_ITEMS = [
     {\r
         title:'CN Endpoint',\r
         key:"cn_Endpoint",\r
+        type: 'endpoint',\r
         required: false,\r
         disable: false,\r
         options: [\r
@@ -251,12 +258,14 @@ export const CORE_FORM_ITEMS = {
         {\r
             title: 'S-NSSAI',\r
             key: 'sliceProfile_AN_sNSSAI',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Resource Sharing Level',\r
             key: 'sliceProfile_AN_resourceSharingLevel',\r
             required: true,\r
+            type: 'radio',\r
             options: [\r
                 {\r
                     title: 'Shared',\r
@@ -272,6 +281,7 @@ export const CORE_FORM_ITEMS = {
             title: 'Mobility',\r
             key: 'sliceProfile_AN_uEMobilityLevel',\r
             required: true,\r
+            type: 'select',\r
             options: [\r
                 {\r
                     title: 'Stationary',\r
@@ -294,69 +304,82 @@ export const CORE_FORM_ITEMS = {
         {\r
             title: 'Latency (ms)',\r
             key: 'an_latency',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Max Number of PUD Session',\r
             key: 'sliceProfile_AN_maxNumberofPDUSession',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Max Number of UEs',\r
             key: 'sliceProfile_AN_maxNumberofUEs',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Activity Factor (%)',\r
             key: 'sliceProfile_AN_activityFactor',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'User Downlink Experience Rate(Mbps)',\r
             key: 'sliceProfile_AN_expDataRateDL',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'User Uplink Experience Rate(Mbps)',\r
             key: 'sliceProfile_AN_expDataRateUL',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Downlink Regional Traffic Density(Mbps/km )',\r
             key: 'sliceProfile_AN_areaTrafficCapDL',\r
-            required: false\r
+            required: false,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Uplink Regional Traffic Density(Mbps/km )',\r
             key: 'sliceProfile_AN_areaTrafficCapUL',\r
-            required: false\r
+            required: false,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Script Name',\r
             key: 'an_script_name',\r
-            required: false\r
+            required: false,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Overall User Density',\r
             key: 'sliceProfile_AN_overallUserDensity',\r
-            required: false\r
+            required: false,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Coverage Area Ta List',\r
             key: 'an_coverage_area_ta_list',\r
-            required: true\r
+            required: true,\r
+            type: 'area'\r
         }\r
     ],\r
     "Cn": [\r
         {\r
             title: 'S-NSSAI',\r
             key: 'cn_service_snssai',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Resource Sharing Level',\r
             key: 'cn_resource_sharing_level',\r
             required: true,\r
+            type: 'radio',\r
             options: [\r
                 {\r
                     title: 'Shared',\r
@@ -372,6 +395,7 @@ export const CORE_FORM_ITEMS = {
             title: 'Mobility',\r
             key: 'cn_ue_mobility_level',\r
             required: true,\r
+            type: 'select',\r
             options: [\r
                 {\r
                     title: 'Stationary',\r
@@ -394,52 +418,62 @@ export const CORE_FORM_ITEMS = {
         {\r
             title: 'Latency (ms)',\r
             key: 'cn_latency',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Max Number of UEs',\r
             key: 'cn_max_number_of_ues',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Activity Factor (%)',\r
             key: 'cn_activity_factor',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'User Downlink Experience Rate(Mbps)',\r
             key: 'cn_exp_data_rate_dl',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'User Uplink Experience Rate(Mbps)',\r
             key: 'cn_exp_data_rate_ul',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Downlink Regional Traffic Density(Mbps/km )',\r
             key: 'cn_area_traffic_cap_dl',\r
-            required: false\r
+            required: false,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Uplink Regional Traffic Density(Mbps/km )',\r
             key: 'cn_area_traffic_cap_ul',\r
-            required: false\r
+            required: false,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Script Name',\r
             key: 'cn_script_name',\r
-            required: false\r
+            required: false,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'Max Number of PUD Session',\r
             key: 'sliceProfile_CN_maxNumberofPDUSession',\r
-            required: true\r
+            required: true,\r
+            type: 'input'\r
         },\r
         {\r
             title: 'OverAll User Density',\r
             key: 'sliceProfile_CN_overallUserDensity',\r
-            required: false\r
+            required: false,\r
+            type: 'input'\r
         },\r
         // {\r
         //     title: 'ip-address',\r