diff options
author | 2021-02-04 18:19:30 +0800 | |
---|---|---|
committer | 2021-02-04 18:19:56 +0800 | |
commit | 2061c3faf34037670d3b71b0e1d4dc14dfff7de6 (patch) | |
tree | bec8431c9bf4a61c71e7b699cff0db42b77cac10 /usecaseui-portal/src/app/views/services/slicing-management/slicing-task-management/slicing-task-model/subnet-params-model/subnet-params-model.component.ts | |
parent | 3af39a2f4eb8e983fc8901de54538a984e4d73dc (diff) |
style: Split the area component from the subnet module
Signed-off-by: wangyuerg <wangyuerg@chinamobile.com>
Change-Id: I8d79b648b9b817f39d94799cb99be61e4ae8b393
Issue-ID: USECASEUI-527
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 | 81 |
1 files changed, 1 insertions, 80 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 bc352ad4..c826a7ec 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 @@ -6,7 +6,7 @@ import { EventEmitter, ElementRef, } from "@angular/core"; -import { TRANSFRER_FORM_ITEMS, CORE_FORM_ITEMS, ADDRESS } from "./constants"; +import { TRANSFRER_FORM_ITEMS, CORE_FORM_ITEMS } from "./constants"; import { NzMessageService } from "ng-zorro-antd"; import { stringify } from "@angular/core/src/util"; import { Util } from "../../../../../../shared/utils/utils"; @@ -323,90 +323,11 @@ export class SubnetParamsModelComponent implements OnInit { }); } - creatAreaList(): void { - let arr = [ - { - key: "province", - selected: "", - options: [], - }, - { - key: "city", - selected: "", - options: [], - }, - { - key: "district", - selected: "", - options: [], - }, - ]; - this.areaList.push(arr); - } - - deleteAreaList(index: number): void { - this.areaList.splice(index, 1); - } - - handleChange(area: any[], areaItem: any): void { - if (areaItem.key === "province" && areaItem.options.length <= 1) { - areaItem.options = ADDRESS; - } else if (areaItem.key === "city" && areaItem.options.length <= 1) { - ADDRESS.forEach((item) => { - if (item.name === area[0].selected) { - areaItem.options = item.city; - } - }); - } else if ( - areaItem.key === "district" && - areaItem.options.length <= 1 - ) { - ADDRESS.forEach((item: any) => { - item.city.forEach((city) => { - if (city.name === area[1].selected) { - areaItem.options = city.county; - } - }); - }); - } - } - - handleChangeSelected(area: any[], areaItem: any) { - if (areaItem.key === "province") { - area[1].selected = ""; - area[1].options = []; - area[2].selected = ""; - area[2].options = []; - } else if (areaItem.key === "city") { - area[2].selected = ""; - area[2].options = []; - } - } - handleCancel(): void { this.showModel = false; this.cancel.emit(this.showModel); } - // prompt text for each item of area_list - checkArea(area: any): string { - if ( - area.every((item) => { - return item.selected === ""; - }) - ) { - return "empty"; - } - if ( - area.some((item) => { - return item.selected === ""; - }) - ) { - return "incomplete"; - } - return ""; - } - // special handling for address areaCheckBeforeSubmit(target: object): Boolean { for (const prop in target) { |