diff options
Diffstat (limited to 'usecaseui-portal/src/app/shared/components')
-rw-r--r-- | usecaseui-portal/src/app/shared/components/basic-info/basic-info.component.ts | 14 |
1 files changed, 14 insertions, 0 deletions
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]; |