1a3a194e78e1169eec1e923e671daa5a8b9f4fa6
[usecase-ui.git] /
1 import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
2 import { WIRELESS_FORM_ITEMS, TRANSFRER_FORM_ITEMS, CORE_FORM_ITEMS } from '../.../../../../../../../../constants/constants'
3
4 @Component({
5         selector: 'app-subnet-params-model',
6         templateUrl: './subnet-params-model.component.html',
7         styleUrls: ['./subnet-params-model.component.less']
8 })
9 export class SubnetParamsModelComponent implements OnInit {
10
11         @Input() showModel: boolean;
12         @Input() detailData: any;
13         @Input() title: string;
14         @Output() cancel = new EventEmitter<boolean>();
15
16         transferFormItems = TRANSFRER_FORM_ITEMS;
17         coreFormItems = CORE_FORM_ITEMS;
18         wirelessFormItems = WIRELESS_FORM_ITEMS;
19         areaList: any[] = [];
20
21         constructor() { }
22
23         ngOnInit() { }
24
25         ngOnChanges() {
26                 if (this.title === '无线域') {
27                         this.AreaFormatting();
28                 }
29         }
30
31         AreaFormatting () {
32                 let areaList = [...this.detailData.an_coverage_area_ta_list];
33                 this.areaList = areaList.map ( (item: any) => {
34                         let arr = item.split(';');
35                         item = arr.map( ite => {
36                                 let obj: any = {};
37                                 obj.selected = ite
38                                 obj.options = [{name: ite, id: ite}]
39                                 return obj
40                         })
41                         return item;
42                 })
43         }
44
45         creatAreaList () {
46                 
47         }
48
49         handleCancel() {
50                 this.showModel = false
51                 this.cancel.emit(this.showModel)
52         }
53
54         handleOk(): void {
55                 this.handleCancel()
56         }
57
58 }