diff options
author | 2020-08-28 17:15:55 +0800 | |
---|---|---|
committer | 2020-08-28 17:16:02 +0800 | |
commit | d3d6bbbae10670482186f1844e8389c877f384d3 (patch) | |
tree | dfc108e9937eac62ade85842f99d7264cf9e7a5d /usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts | |
parent | 6327a13cbc6290f6df92c125669c162f643d8616 (diff) |
fix: Fix the bug of Endpoint parameter rendering for 5g task
Change-Id: I324311620c586bb48e609068a8bb90007e31e80c
Issue-ID: USECASEUI-444
Signed-off-by: cyuamber <xuranyjy@chinamobile.com>
Diffstat (limited to 'usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts')
-rw-r--r-- | usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts | 30 |
1 files changed, 20 insertions, 10 deletions
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 280d2193..bceca197 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 @@ -15,7 +15,7 @@ export class SubnetParamsModelComponent implements OnInit { @Output() paramsDataChange = new EventEmitter<any>(); transferFormItems = TRANSFRER_FORM_ITEMS; - coreFormItems :object ={}; + coreFormItems: any[] = []; areaList: any[] = []; // 2020.08.17 Add 3 parameters for Endpoint, Comment: The following code NexthopInfoOptions = NexthopInfo_Options; @@ -28,15 +28,25 @@ export class SubnetParamsModelComponent implements OnInit { ngOnInit() { } ngOnChanges() { - this.coreFormItems = this.title === 'An'?CORE_FORM_ITEMS.An:CORE_FORM_ITEMS.Cn; - - // -------> 2020.08.17 Add 3 parameters for Endpoint, Comment: The following code - if(this.EndpointEnable){ - this.EndpointInputs = this.title === 'An' - ?this.detailData["an_Endpoint"] - :this.title === 'Cn' - ?this.detailData["cn_Endpoint"] - :[]; + if(this.title){ + this.coreFormItems = this.title === 'An'?CORE_FORM_ITEMS.An:this.title === 'Cn'?CORE_FORM_ITEMS.Cn:[]; + if(this.detailData !==undefined && Object.keys(this.detailData).length!==0){ + this.EndpointEnable = (this.detailData.hasOwnProperty("an_Endpoint") && this.detailData['an_Endpoint'].length!==0) || (this.detailData.hasOwnProperty("cn_Endpoint") && this.detailData['cn_Endpoint'].length!==0) + } + // -------> 2020.08.17 Add 3 parameters for Endpoint, Comment: The following code + if(this.EndpointEnable){ + this.EndpointInputs = this.title === 'An' + ?this.detailData["an_Endpoint"] + :this.title === 'Cn' + ?this.detailData["cn_Endpoint"] + :[]; + }else{ + this.coreFormItems.map((item,index)=>{ + if(item.title === 'Endpoint'){ + this.coreFormItems.splice(index,1) + } + }) + } } //-------> Comment: Above code if (this.title === 'An') { |