From 2ddfe6c8f2c8f2d472a1e1756bd3491cb6550149 Mon Sep 17 00:00:00 2001 From: wangyuerg Date: Thu, 11 Mar 2021 09:40:01 +0800 Subject: feat:Logic plus protection Signed-off-by: wangyuerg Change-Id: Ifdeb26671445944bbf7a4fc6c5e551636bb13dd2 Issue-ID: USECASEUI-527 --- .../subnet-params-model.component.ts | 34 ++++++++++++---------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management') diff --git a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts index 83d16a62..310a1cb9 100644 --- a/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts +++ b/usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts @@ -128,21 +128,23 @@ export class SubnetParamsModelComponent implements OnInit { } addCheckStatus() { - this.connectionLinkTable.forEach((item) => { - if ( - item.hasOwnProperty("linkId") && - typeof this.formData["sliceProfile_TN_connection_links"] !== - "undefined" && - this.formData["sliceProfile_TN_connection_links"] !== "" && - this.formData["sliceProfile_TN_connection_links"] !== null && - item["linkId"] === - this.formData["sliceProfile_TN_connection_links"] - ) { - item.checked = true; - } else { - item.checked = false; - } - }); + if(this.connectionLinkTable && this.connectionLinkTable.length>0){ + this.connectionLinkTable.forEach((item) => { + if ( + item.hasOwnProperty("linkId") && + typeof this.formData["sliceProfile_TN_connection_links"] !== + "undefined" && + this.formData["sliceProfile_TN_connection_links"] !== "" && + this.formData["sliceProfile_TN_connection_links"] !== null && + item["linkId"] === + this.formData["sliceProfile_TN_connection_links"] + ) { + item.checked = true; + } else { + item.checked = false; + } + }); + } } // changeResourceShare() { @@ -218,6 +220,7 @@ export class SubnetParamsModelComponent implements OnInit { getTableHeader(): void { // Find the common key of all data + if(this.connectionLinkTable && this.connectionLinkTable.length>0){ let keyList: any[] = this.connectionLinkTable.map((item) => { return Object.keys(item); }); @@ -250,6 +253,7 @@ export class SubnetParamsModelComponent implements OnInit { } } }); + } } pageIndexChange(e) { -- cgit 1.2.3-korg