From 0b5db174d96c70baa84d19b1dab579f7cdccc69d Mon Sep 17 00:00:00 2001 From: cyuamber Date: Thu, 3 Sep 2020 11:58:00 +0800 Subject: feat: Business Requirement Info Add some parameters of 5g task Change-Id: I430bf23a65ccb149e890d539badc8316793f7929 Issue-ID: USECASEUI-444 Signed-off-by: cyuamber --- .../shared/components/basic-info/basic-info.component.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'usecaseui-portal/src/app/shared/components/basic-info') 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 538b08c5..6539bbd3 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 @@ -27,6 +27,20 @@ export class BasicInfoComponent implements OnInit { this.businessListAfterSorting = []; this.businessList = BUSINESS_REQUIREMENT.concat([]); if(this.businessRequirement && this.businessRequirement.length !== 0){ + let businessListkeysList = []; + this.businessList.map(ite=>{ + if(!Array.isArray(ite)){businessListkeysList.push(ite["key"])} + }) + // Filter the difference between the local businessList and the requirement data returned by the backend. + // When the key is missing in the data returned by the backend, the local businessList data is deleted and filtered + let filterSubtractionKeysList = businessListkeysList.filter(item=>Object.keys(this.businessRequirement[0]).indexOf(item)==-1); + filterSubtractionKeysList.map(key=>{ + this.businessList.map((item,k)=>{ + if(Array.isArray(item) === false && item["key"] === key){ + this.businessList.splice(k,1) + } + }) + }); 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]; -- cgit 1.2.3-korg