1 files renamed
1 files deleted
1 files added
2 files modified
| | |
| | | } |
| | | ); |
| | | } |
| | | getAreas(cityCode: string): Observable<{label: string, value: string}[]> { |
| | | getAreas(cityCode: string, isLeaf ?: Boolean): Observable<{label: string, value: string}[]> { |
| | | return this.http.get( this.baseUrl + '/area/get-areas', {cityCode: cityCode}).map( |
| | | (res: {code: number, data: any}) => { |
| | | let areas = []; |
| | | if (res !== null && res['code'] === 1 ) { |
| | | areas = res['data'].map((item) => { |
| | | return {label: item.areaName , value: item.areaCode}; |
| | | return {label: item.areaName , value: item.areaCode, isLeaf: isLeaf === undefined ? true : isLeaf}; |
| | | }); |
| | | } |
| | | return areas; |
| | |
| | | } |
| | | } |
| | | areaLazyLoad(event: { option: CascaderOption, index: number, resolve: (children: CascaderOption[]) => void, reject: () => void }) { |
| | | console.info(event); |
| | | // console.info(event); |
| | | const index = event['index']; |
| | | const option = event.option; |
| | | switch (index) { |
| | |
| | | } |
| | | ); break; |
| | | case 1: |
| | | this.areacodeService.getAreas(option.value).subscribe( |
| | | // 区不是叶节点 兼容旧组件 |
| | | this.areacodeService.getAreas(option.value , false).subscribe( |
| | | (res: {label: string, value: string}[]) => { |
| | | event.resolve( res ); |
| | | } |
New file |
| | |
| | | <div class="modal-header"> |
| | | <div class="modal-title">配置-传感器单位</div> |
| | | </div> |