Commit 7462a6be7ae7319ca59933993601f51708c8e6c7
1 parent
229df284
Authority and contractor links
Showing
9 changed files
with
336 additions
and
260 deletions
Show diff stats
src/app/app.routes.ts
| ... | ... | @@ -33,7 +33,9 @@ const routes: Routes = [ |
| 33 | 33 | {path: 'road-service', component: RoadServiceComponent}, |
| 34 | 34 | {path: 'road-to-category', component: RoadToCategoryComponent}, |
| 35 | 35 | {path: 'settlement-address-link', component: SettlementAddressLinkComponent}, |
| 36 | + {path: 'authority/:roadId', component: AuthorityComponent}, | |
| 36 | 37 | {path: 'authority', component: AuthorityComponent}, |
| 38 | + {path: 'contractor/:roadId', component: ContractorComponent}, | |
| 37 | 39 | {path: 'contractor', component: ContractorComponent}, |
| 38 | 40 | {path: 'map', component: MapComponent}, |
| 39 | 41 | ]}, | ... | ... |
src/app/data/authority/authority.component.ts
| 1 | -import {Component, ViewEncapsulation, AfterViewInit, ViewChild} from '@angular/core'; | |
| 1 | +import {Component, ViewEncapsulation, AfterViewInit, ViewChild, OnDestroy} from '@angular/core'; | |
| 2 | 2 | import {TdLoadingService} from '@covalent/core'; |
| 3 | 3 | |
| 4 | 4 | import {StatementBase} from '../../../models/statement.base'; |
| ... | ... | @@ -9,6 +9,7 @@ import {RendererComponent} from '../../../helpers/renderer.component'; |
| 9 | 9 | import {AuthorityCreateService} from '../../../services/authority-create.service'; |
| 10 | 10 | import {RoadSelectList} from '../../../models/road-select-list'; |
| 11 | 11 | import {CrossSectionSelectList} from "../../../models/cross-section-select-list"; |
| 12 | +import {ActivatedRoute} from "@angular/router"; | |
| 12 | 13 | |
| 13 | 14 | @Component({ |
| 14 | 15 | // tslint:disable-next-line:component-selector |
| ... | ... | @@ -17,13 +18,17 @@ import {CrossSectionSelectList} from "../../../models/cross-section-select-list" |
| 17 | 18 | styleUrls: ['authority.scss'], |
| 18 | 19 | encapsulation: ViewEncapsulation.None, |
| 19 | 20 | }) |
| 20 | -export class AuthorityComponent extends StatementBase { | |
| 21 | +export class AuthorityComponent extends StatementBase implements OnDestroy { | |
| 21 | 22 | public roads: RoadSelectList[]; |
| 22 | 23 | public crosssections: CrossSectionSelectList[]; |
| 24 | + public roadId: string; | |
| 25 | + protected roadSub: any; | |
| 23 | 26 | |
| 24 | 27 | constructor(protected service: AuthorityService, |
| 25 | 28 | protected dataService: AuthorityCreateService, |
| 26 | - protected loadingService: TdLoadingService,) { | |
| 29 | + protected loadingService: TdLoadingService, | |
| 30 | + protected route: ActivatedRoute | |
| 31 | + ) { | |
| 27 | 32 | super(); |
| 28 | 33 | } |
| 29 | 34 | |
| ... | ... | @@ -107,13 +112,31 @@ export class AuthorityComponent extends StatementBase { |
| 107 | 112 | }, |
| 108 | 113 | ]; |
| 109 | 114 | } |
| 110 | - | |
| 111 | 115 | protected initFunction(): void { |
| 112 | 116 | this.dataService.getModels().then((models: any) => { |
| 113 | 117 | this.roads = models.roadSelectListDsM as RoadSelectList[]; |
| 114 | 118 | this.crosssections = models.crossSectionSelectListDsM as CrossSectionSelectList[]; |
| 115 | 119 | }).then(() => { |
| 116 | 120 | this.bootstrapGrid(); |
| 121 | + this.filterRoad(); | |
| 122 | + }); | |
| 123 | + } | |
| 124 | + public ngOnDestroy() { | |
| 125 | + this.roadSub.unsubscribe(); | |
| 126 | + } | |
| 127 | + protected filterRoad(): void { | |
| 128 | + this.roadSub = this.route.params.subscribe(params => { | |
| 129 | + this.roadId = params['roadId']; | |
| 117 | 130 | }); |
| 131 | + if (this.roadId) { | |
| 132 | + setTimeout(() => { | |
| 133 | + let filter = this.gridOptions.api.getFilterInstance('roadId'); | |
| 134 | + filter.setModel({ | |
| 135 | + type: 'equals', | |
| 136 | + filter: this.roadId | |
| 137 | + }); | |
| 138 | + this.gridOptions.api.onFilterChanged(); | |
| 139 | + }, 0); | |
| 140 | + } | |
| 118 | 141 | } |
| 119 | 142 | } | ... | ... |
src/app/data/bus-stop/bus-stop.component.ts
| 1 | -import { Component, ViewEncapsulation, AfterViewInit,ViewChild } from '@angular/core'; | |
| 2 | -import { TdLoadingService } from '@covalent/core'; | |
| 3 | -import { GridOptions, IGetRowsParams, IRowModel } from 'ag-grid/main'; | |
| 1 | +import {Component, ViewEncapsulation, AfterViewInit, ViewChild} from '@angular/core'; | |
| 2 | +import {TdLoadingService} from '@covalent/core'; | |
| 3 | +import {GridOptions, IGetRowsParams, IRowModel} from 'ag-grid/main'; | |
| 4 | 4 | |
| 5 | -import { StatementBase } from '../../../models/statement.base'; | |
| 5 | +import {StatementBase} from '../../../models/statement.base'; | |
| 6 | 6 | |
| 7 | -import { BusStopService } from '../../../services/bus-stop.service'; | |
| 8 | -import { BusStop } from '../../../models/bus-stop'; | |
| 9 | -import { EditorComponent } from '../../../helpers/editor.component'; | |
| 10 | -import { RendererComponent } from '../../../helpers/renderer.component'; | |
| 11 | -import { MapEditorComponent } from '../../../helpers/map-editor.component'; | |
| 12 | -import { MapRendererComponent } from '../../../helpers/map-renderer.component'; | |
| 13 | -import { BusStopCreateService } from '../../../services/bus-stop-create.service'; | |
| 14 | -import { BooleanSelectListService } from '../../../services/boolean-select-list.service'; | |
| 15 | -import { RegionSelectList } from '../../../models/region-select-list'; | |
| 16 | -import { StateCommonSelectList } from '../../../models/state-common-select-list'; | |
| 17 | -import { RoadSelectList } from '../../../models/road-select-list'; | |
| 18 | -import { BooleanSelectList } from '../../../models/boolean-select-list'; | |
| 19 | -import { SettlementSelectList } from '../../../models/settlement-select-list'; | |
| 20 | -import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list'; | |
| 21 | -import { MapItemsComponent } from '../map-items/map-items.component'; | |
| 22 | -import { routerTransition } from '../../../animations/router.animation'; | |
| 7 | +import {BusStopService} from '../../../services/bus-stop.service'; | |
| 8 | +import {BusStop} from '../../../models/bus-stop'; | |
| 9 | +import {EditorComponent} from '../../../helpers/editor.component'; | |
| 10 | +import {RendererComponent} from '../../../helpers/renderer.component'; | |
| 11 | +import {MapEditorComponent} from '../../../helpers/map-editor.component'; | |
| 12 | +import {MapRendererComponent} from '../../../helpers/map-renderer.component'; | |
| 13 | +import {BusStopCreateService} from '../../../services/bus-stop-create.service'; | |
| 14 | +import {BooleanSelectListService} from '../../../services/boolean-select-list.service'; | |
| 15 | +import {RegionSelectList} from '../../../models/region-select-list'; | |
| 16 | +import {StateCommonSelectList} from '../../../models/state-common-select-list'; | |
| 17 | +import {RoadSelectList} from '../../../models/road-select-list'; | |
| 18 | +import {BooleanSelectList} from '../../../models/boolean-select-list'; | |
| 19 | +import {SettlementSelectList} from '../../../models/settlement-select-list'; | |
| 20 | +import {SurfaceTypeSelectList} from '../../../models/surface-type-select-list'; | |
| 21 | +import {MapItemsComponent} from '../map-items/map-items.component'; | |
| 22 | +import {routerTransition} from '../../../animations/router.animation'; | |
| 23 | 23 | |
| 24 | 24 | @Component({ |
| 25 | 25 | // tslint:disable-next-line:component-selector |
| ... | ... | @@ -37,187 +37,187 @@ export class BusStopComponent extends StatementBase { |
| 37 | 37 | public roads: RoadSelectList[]; |
| 38 | 38 | public boolean: BooleanSelectList[]; |
| 39 | 39 | |
| 40 | - constructor( | |
| 41 | - protected service: BusStopService, | |
| 42 | - protected dataService: BusStopCreateService, | |
| 43 | - protected booleanService: BooleanSelectListService, | |
| 44 | - protected loadingService: TdLoadingService, | |
| 45 | - ) { | |
| 40 | + constructor(protected service: BusStopService, | |
| 41 | + protected dataService: BusStopCreateService, | |
| 42 | + protected booleanService: BooleanSelectListService, | |
| 43 | + protected loadingService: TdLoadingService,) { | |
| 46 | 44 | super(); |
| 47 | 45 | } |
| 46 | + | |
| 48 | 47 | public showOnMap(): void { |
| 49 | 48 | this.mapItems.showMap(); |
| 50 | 49 | } |
| 51 | - protected createColumnDefs(): any[] { | |
| 52 | - return [ | |
| 53 | - { | |
| 54 | - headerName: '#', | |
| 55 | - width: 30, | |
| 56 | - checkboxSelection: true, | |
| 57 | - suppressSorting: true, | |
| 58 | - suppressMenu: true, | |
| 59 | - pinned: true, | |
| 60 | - }, | |
| 61 | - { | |
| 62 | - headerName: 'ID', | |
| 63 | - field: 'id', | |
| 64 | - }, | |
| 65 | - { | |
| 66 | - headerName: 'Назва дороги', | |
| 67 | - field: 'roadId', | |
| 68 | - editable: true, | |
| 69 | - cellEditorFramework: EditorComponent, | |
| 70 | - cellRendererFramework: RendererComponent, | |
| 71 | - cellEditorParams: { | |
| 72 | - data: this.roads, | |
| 73 | - valueCol: 'roadId', | |
| 74 | - labelCol: 'name', | |
| 75 | - }, | |
| 76 | - }, | |
| 77 | - { | |
| 78 | - headerName: 'Область', | |
| 79 | - field: 'regionId', | |
| 80 | - editable: true, | |
| 81 | - cellEditorFramework: EditorComponent, | |
| 82 | - cellRendererFramework: RendererComponent, | |
| 83 | - cellEditorParams: { | |
| 84 | - data: this.regions, | |
| 85 | - valueCol: 'regionId', | |
| 86 | - labelCol: 'name', | |
| 87 | - }, | |
| 88 | - }, | |
| 89 | - { | |
| 90 | - headerName: 'Місцезнаходження, км+ справа', | |
| 91 | - field: 'locationRight', | |
| 92 | - editable: true, | |
| 93 | - }, | |
| 94 | - { | |
| 95 | - headerName: 'Місцезнаходження, км+ зліва', | |
| 96 | - field: 'locationLeft', | |
| 97 | - editable: true, | |
| 98 | - }, | |
| 99 | - { | |
| 100 | - headerName: 'Тип покриття', | |
| 101 | - field: 'surfaceTypeId', | |
| 102 | - editable: true, | |
| 103 | - cellEditorFramework: EditorComponent, | |
| 104 | - cellRendererFramework: RendererComponent, | |
| 105 | - cellEditorParams: { | |
| 106 | - data: this.surfaceTypes, | |
| 107 | - valueCol: 'surfaceTypeId', | |
| 108 | - labelCol: 'name', | |
| 109 | - }, | |
| 110 | - }, | |
| 111 | - { | |
| 112 | - headerName: 'Технічний стан', | |
| 113 | - field: 'stateCommonId', | |
| 114 | - editable: true, | |
| 115 | - cellEditorFramework: EditorComponent, | |
| 116 | - cellRendererFramework: RendererComponent, | |
| 117 | - cellEditorParams: { | |
| 118 | - data: this.states, | |
| 119 | - valueCol: 'stateCommonId', | |
| 120 | - labelCol: 'value', | |
| 121 | - }, | |
| 122 | - }, | |
| 123 | - { | |
| 124 | - headerName: 'Наявність елементів зупин. майдан', | |
| 125 | - field: 'areaStopAvailability', | |
| 126 | - editable: true, | |
| 127 | - cellEditorFramework: EditorComponent, | |
| 128 | - cellRendererFramework: RendererComponent, | |
| 129 | - cellEditorParams: { | |
| 130 | - data: this.boolean, | |
| 131 | - valueCol: 'value', | |
| 132 | - labelCol: 'label', | |
| 133 | - }, | |
| 134 | - }, | |
| 135 | - { | |
| 136 | - headerName: 'Наявність елементів посад. майдан', | |
| 137 | - field: 'areaLandAvailability', | |
| 138 | - editable: true, | |
| 139 | - cellEditorFramework: EditorComponent, | |
| 140 | - cellRendererFramework: RendererComponent, | |
| 141 | - cellEditorParams: { | |
| 142 | - data: this.boolean, | |
| 143 | - valueCol: 'value', | |
| 144 | - labelCol: 'label', | |
| 145 | - }, | |
| 146 | - }, | |
| 147 | - { | |
| 148 | - headerName: 'Наявність елементів заїзна кишеня', | |
| 149 | - field: 'pocketAvailability', | |
| 150 | - editable: true, | |
| 151 | - cellEditorFramework: EditorComponent, | |
| 152 | - cellRendererFramework: RendererComponent, | |
| 153 | - cellEditorParams: { | |
| 154 | - data: this.boolean, | |
| 155 | - valueCol: 'value', | |
| 156 | - labelCol: 'label', | |
| 157 | - }, | |
| 158 | - }, | |
| 159 | - { | |
| 160 | - headerName: 'Наявність туалету', | |
| 161 | - field: 'toiletAvailability', | |
| 162 | - editable: true, | |
| 163 | - cellEditorFramework: EditorComponent, | |
| 164 | - cellRendererFramework: RendererComponent, | |
| 165 | - cellEditorParams: { | |
| 166 | - data: this.boolean, | |
| 167 | - valueCol: 'value', | |
| 168 | - labelCol: 'label', | |
| 169 | - }, | |
| 170 | - }, | |
| 171 | - { | |
| 172 | - headerName: 'Рік будівництва', | |
| 173 | - field: 'yearBuild', | |
| 174 | - editable: true, | |
| 175 | - }, | |
| 176 | - { | |
| 177 | - headerName: 'Рік ремонту', | |
| 178 | - field: 'yearRepair', | |
| 179 | - editable: true, | |
| 180 | - }, | |
| 181 | - { | |
| 182 | - headerName: 'position', | |
| 183 | - field: 'position', | |
| 184 | - editable: true, | |
| 185 | - cellEditorFramework: MapEditorComponent, | |
| 186 | - cellRendererFramework: MapRendererComponent, | |
| 187 | - cellEditorParams: { | |
| 188 | - position: 'position' | |
| 189 | - }, | |
| 190 | - }, | |
| 191 | - ]; | |
| 192 | - } | |
| 193 | 50 | |
| 194 | - protected initFunction(): void { | |
| 195 | - this.booleanService.getModels().then((models: BooleanSelectList[]) => this.boolean = models); | |
| 196 | - this.dataService.getModels().then((models: any) => { | |
| 51 | + protected createColumnDefs(): any[] { | |
| 52 | + return [ | |
| 53 | + { | |
| 54 | + headerName: '#', | |
| 55 | + width: 30, | |
| 56 | + checkboxSelection: true, | |
| 57 | + suppressSorting: true, | |
| 58 | + suppressMenu: true, | |
| 59 | + pinned: true, | |
| 60 | + }, | |
| 61 | + { | |
| 62 | + headerName: 'ID', | |
| 63 | + field: 'id', | |
| 64 | + }, | |
| 65 | + { | |
| 66 | + headerName: 'Назва дороги', | |
| 67 | + field: 'roadId', | |
| 68 | + editable: true, | |
| 69 | + cellEditorFramework: EditorComponent, | |
| 70 | + cellRendererFramework: RendererComponent, | |
| 71 | + cellEditorParams: { | |
| 72 | + data: this.roads, | |
| 73 | + valueCol: 'roadId', | |
| 74 | + labelCol: 'name', | |
| 75 | + }, | |
| 76 | + }, | |
| 77 | + { | |
| 78 | + headerName: 'Область', | |
| 79 | + field: 'regionId', | |
| 80 | + editable: true, | |
| 81 | + cellEditorFramework: EditorComponent, | |
| 82 | + cellRendererFramework: RendererComponent, | |
| 83 | + cellEditorParams: { | |
| 84 | + data: this.regions, | |
| 85 | + valueCol: 'regionId', | |
| 86 | + labelCol: 'name', | |
| 87 | + }, | |
| 88 | + }, | |
| 89 | + { | |
| 90 | + headerName: 'Місцезнаходження, км+ справа', | |
| 91 | + field: 'locationRight', | |
| 92 | + editable: true, | |
| 93 | + }, | |
| 94 | + { | |
| 95 | + headerName: 'Місцезнаходження, км+ зліва', | |
| 96 | + field: 'locationLeft', | |
| 97 | + editable: true, | |
| 98 | + }, | |
| 99 | + { | |
| 100 | + headerName: 'Тип покриття', | |
| 101 | + field: 'surfaceTypeId', | |
| 102 | + editable: true, | |
| 103 | + cellEditorFramework: EditorComponent, | |
| 104 | + cellRendererFramework: RendererComponent, | |
| 105 | + cellEditorParams: { | |
| 106 | + data: this.surfaceTypes, | |
| 107 | + valueCol: 'surfaceTypeId', | |
| 108 | + labelCol: 'name', | |
| 109 | + }, | |
| 110 | + }, | |
| 111 | + { | |
| 112 | + headerName: 'Технічний стан', | |
| 113 | + field: 'stateCommonId', | |
| 114 | + editable: true, | |
| 115 | + cellEditorFramework: EditorComponent, | |
| 116 | + cellRendererFramework: RendererComponent, | |
| 117 | + cellEditorParams: { | |
| 118 | + data: this.states, | |
| 119 | + valueCol: 'stateCommonId', | |
| 120 | + labelCol: 'value', | |
| 121 | + }, | |
| 122 | + }, | |
| 123 | + { | |
| 124 | + headerName: 'Наявність елементів зупин. майдан', | |
| 125 | + field: 'areaStopAvailability', | |
| 126 | + editable: true, | |
| 127 | + cellEditorFramework: EditorComponent, | |
| 128 | + cellRendererFramework: RendererComponent, | |
| 129 | + cellEditorParams: { | |
| 130 | + data: this.boolean, | |
| 131 | + valueCol: 'value', | |
| 132 | + labelCol: 'label', | |
| 133 | + }, | |
| 134 | + }, | |
| 135 | + { | |
| 136 | + headerName: 'Наявність елементів посад. майдан', | |
| 137 | + field: 'areaLandAvailability', | |
| 138 | + editable: true, | |
| 139 | + cellEditorFramework: EditorComponent, | |
| 140 | + cellRendererFramework: RendererComponent, | |
| 141 | + cellEditorParams: { | |
| 142 | + data: this.boolean, | |
| 143 | + valueCol: 'value', | |
| 144 | + labelCol: 'label', | |
| 145 | + }, | |
| 146 | + }, | |
| 147 | + { | |
| 148 | + headerName: 'Наявність елементів заїзна кишеня', | |
| 149 | + field: 'pocketAvailability', | |
| 150 | + editable: true, | |
| 151 | + cellEditorFramework: EditorComponent, | |
| 152 | + cellRendererFramework: RendererComponent, | |
| 153 | + cellEditorParams: { | |
| 154 | + data: this.boolean, | |
| 155 | + valueCol: 'value', | |
| 156 | + labelCol: 'label', | |
| 157 | + }, | |
| 158 | + }, | |
| 159 | + { | |
| 160 | + headerName: 'Наявність туалету', | |
| 161 | + field: 'toiletAvailability', | |
| 162 | + editable: true, | |
| 163 | + cellEditorFramework: EditorComponent, | |
| 164 | + cellRendererFramework: RendererComponent, | |
| 165 | + cellEditorParams: { | |
| 166 | + data: this.boolean, | |
| 167 | + valueCol: 'value', | |
| 168 | + labelCol: 'label', | |
| 169 | + }, | |
| 170 | + }, | |
| 171 | + { | |
| 172 | + headerName: 'Рік будівництва', | |
| 173 | + field: 'yearBuild', | |
| 174 | + editable: true, | |
| 175 | + }, | |
| 176 | + { | |
| 177 | + headerName: 'Рік ремонту', | |
| 178 | + field: 'yearRepair', | |
| 179 | + editable: true, | |
| 180 | + }, | |
| 181 | + { | |
| 182 | + headerName: 'position', | |
| 183 | + field: 'position', | |
| 184 | + editable: true, | |
| 185 | + cellEditorFramework: MapEditorComponent, | |
| 186 | + cellRendererFramework: MapRendererComponent, | |
| 187 | + cellEditorParams: { | |
| 188 | + position: 'position' | |
| 189 | + }, | |
| 190 | + }, | |
| 191 | + ]; | |
| 192 | + } | |
| 193 | + | |
| 194 | + protected initFunction(): void { | |
| 195 | + this.booleanService.getModels().then((models: BooleanSelectList[]) => this.boolean = models); | |
| 196 | + this.dataService.getModels().then((models: any) => { | |
| 197 | 197 | this.regions = models.regionSelectListDsM as RegionSelectList[]; |
| 198 | 198 | this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; |
| 199 | 199 | this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[]; |
| 200 | 200 | this.settlements = models.settlementSelectListDsM as SettlementSelectList[]; |
| 201 | 201 | this.roads = models.roadSelectListDsM as RoadSelectList[]; |
| 202 | - }).then(() => { | |
| 202 | + }).then(() => { | |
| 203 | 203 | this.bootstrapGrid(); |
| 204 | - }); | |
| 205 | - } | |
| 204 | + }); | |
| 205 | + } | |
| 206 | 206 | |
| 207 | - protected onCellFocused($event: any): void { | |
| 208 | - console.log($event); | |
| 209 | - // let model = this.gridOptions.api.getModel(); | |
| 210 | - // let row = model.getRow($event.rowIndex); | |
| 211 | - // console.log(row); | |
| 212 | - // this.mapItems.refreshMap(row); | |
| 213 | - } | |
| 207 | + protected onCellFocused($event: any): void { | |
| 208 | + console.log($event); | |
| 209 | + // let model = this.gridOptions.api.getModel(); | |
| 210 | + // let row = model.getRow($event.rowIndex); | |
| 211 | + // console.log(row); | |
| 212 | + // this.mapItems.refreshMap(row); | |
| 213 | + } | |
| 214 | 214 | |
| 215 | - protected onSelectionChanged() { | |
| 216 | - console.log('onSelectionChanged'); | |
| 217 | - super.onSelectionChanged(); | |
| 218 | - let rows: IRowModel[] = this.gridOptions.api.getSelectedRows(); | |
| 219 | - console.log(rows); | |
| 220 | - this.mapItems.refreshMap(rows); | |
| 221 | - } | |
| 215 | + protected onSelectionChanged() { | |
| 216 | + console.log('onSelectionChanged'); | |
| 217 | + super.onSelectionChanged(); | |
| 218 | + let rows: IRowModel[] = this.gridOptions.api.getSelectedRows(); | |
| 219 | + console.log(rows); | |
| 220 | + this.mapItems.refreshMap(rows); | |
| 221 | + } | |
| 222 | 222 | |
| 223 | 223 | } | ... | ... |
src/app/data/contractor/contractor.component.ts
| ... | ... | @@ -9,6 +9,7 @@ import {RendererComponent} from '../../../helpers/renderer.component'; |
| 9 | 9 | import {ContractorCreateService} from '../../../services/contractor-create.service'; |
| 10 | 10 | import {RoadSelectList} from '../../../models/road-select-list'; |
| 11 | 11 | import {CrossSectionSelectList} from "../../../models/cross-section-select-list"; |
| 12 | +import {ActivatedRoute} from "@angular/router"; | |
| 12 | 13 | |
| 13 | 14 | @Component({ |
| 14 | 15 | // tslint:disable-next-line:component-selector |
| ... | ... | @@ -20,10 +21,14 @@ import {CrossSectionSelectList} from "../../../models/cross-section-select-list" |
| 20 | 21 | export class ContractorComponent extends StatementBase { |
| 21 | 22 | public roads: RoadSelectList[]; |
| 22 | 23 | public crosssections: CrossSectionSelectList[]; |
| 24 | + public roadId: string; | |
| 25 | + protected roadSub: any; | |
| 23 | 26 | |
| 24 | 27 | constructor(protected service: ContractorService, |
| 25 | 28 | protected dataService: ContractorCreateService, |
| 26 | - protected loadingService: TdLoadingService,) { | |
| 29 | + protected loadingService: TdLoadingService, | |
| 30 | + protected route: ActivatedRoute | |
| 31 | + ) { | |
| 27 | 32 | super(); |
| 28 | 33 | } |
| 29 | 34 | |
| ... | ... | @@ -114,6 +119,25 @@ export class ContractorComponent extends StatementBase { |
| 114 | 119 | this.crosssections = models.crossSectionSelectListDsM as CrossSectionSelectList[]; |
| 115 | 120 | }).then(() => { |
| 116 | 121 | this.bootstrapGrid(); |
| 122 | + this.filterRoad(); | |
| 117 | 123 | }); |
| 118 | 124 | } |
| 125 | + public ngOnDestroy() { | |
| 126 | + this.roadSub.unsubscribe(); | |
| 127 | + } | |
| 128 | + protected filterRoad(): void { | |
| 129 | + this.roadSub = this.route.params.subscribe(params => { | |
| 130 | + this.roadId = params['roadId']; | |
| 131 | + }); | |
| 132 | + if (this.roadId) { | |
| 133 | + setTimeout(() => { | |
| 134 | + let filter = this.gridOptions.api.getFilterInstance('roadId'); | |
| 135 | + filter.setModel({ | |
| 136 | + type: 'equals', | |
| 137 | + filter: this.roadId | |
| 138 | + }); | |
| 139 | + this.gridOptions.api.onFilterChanged(); | |
| 140 | + }, 0); | |
| 141 | + } | |
| 142 | + } | |
| 119 | 143 | } | ... | ... |
src/app/data/data.component.html
| 1 | 1 | <td-layout-nav logo="assets:covalent"> |
| 2 | - <div td-toolbar-content layout="row" layout-align="center center" flex> | |
| 3 | - <span>Quickstart</span> | |
| 4 | - <span flex></span> | |
| 5 | - <a md-icon-button mdTooltip="Docs" href="https://teradata.github.io/covalent/" target="_blank"> | |
| 6 | - <md-icon>chrome_reader_mode</md-icon> | |
| 7 | - </a> | |
| 8 | - <a md-icon-button mdTooltip="Github" href="https://github.com/teradata/covalent" target="_blank"> | |
| 9 | - <md-icon svgIcon="assets:github"></md-icon> | |
| 10 | - </a> | |
| 2 | + <div td-toolbar-content layout="row" layout-align="center center" flex> | |
| 3 | + <span>Quickstart</span> | |
| 4 | + <span flex></span> | |
| 5 | + <a md-icon-button mdTooltip="Docs" href="https://teradata.github.io/covalent/" target="_blank"> | |
| 6 | + <md-icon>chrome_reader_mode</md-icon> | |
| 7 | + </a> | |
| 8 | + <a md-icon-button mdTooltip="Github" href="https://github.com/teradata/covalent" target="_blank"> | |
| 9 | + <md-icon svgIcon="assets:github"></md-icon> | |
| 10 | + </a> | |
| 11 | + </div> | |
| 12 | + <td-layout-manage-list #manageList [opened]="media.registerQuery('gt-sm') | async" [mode]="(media.registerQuery('gt-sm') | async) ? 'side' : 'push'" [sidenavWidth]="(media.registerQuery('gt-xs') | async) ? '257px' : '100%'"> | |
| 13 | + <md-toolbar td-sidenav-content> | |
| 14 | + <span>Відомості</span> | |
| 15 | + </md-toolbar> | |
| 16 | + <md-nav-list td-sidenav-content> | |
| 17 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road']"> | |
| 18 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 19 | + Автомобільні дороги | |
| 20 | + </a> | |
| 21 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['authority']"> | |
| 22 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 23 | + Органи управління | |
| 24 | + </a> | |
| 25 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['contractor']"> | |
| 26 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 27 | + Підрядники з експлуатаційного утримання | |
| 28 | + </a> | |
| 29 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road-service']"> | |
| 30 | + <md-icon md-list-icon>insert_chart</md-icon> | |
| 31 | + Обслуговування | |
| 32 | + </a> | |
| 33 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['settlement-address-link']"> | |
| 34 | + <md-icon md-list-icon>star</md-icon> | |
| 35 | + Прив'язки населених пунктів | |
| 36 | + </a> | |
| 37 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['flow-intensity']"> | |
| 38 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 39 | + Інтенсивності | |
| 40 | + </a> | |
| 41 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road-to-category']"> | |
| 42 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 43 | + Категорія доріг | |
| 44 | + </a> | |
| 45 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['cross-section']"> | |
| 46 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 47 | + З'їзди | |
| 48 | + </a> | |
| 49 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road-width']"> | |
| 50 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 51 | + Ширина проїзних частин | |
| 52 | + </a> | |
| 53 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road-surface']"> | |
| 54 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 55 | + Покриття доріг | |
| 56 | + </a> | |
| 57 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['service-object']"> | |
| 58 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 59 | + Об'єкти сервісу | |
| 60 | + </a> | |
| 61 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['bus-stop']"> | |
| 62 | + <md-icon md-list-icon>dashboard</md-icon> | |
| 63 | + Автобусні зупинки | |
| 64 | + </a> | |
| 65 | + </md-nav-list> | |
| 66 | + <div td-toolbar-content layout="row" layout-align="start center" flex> | |
| 67 | + <span>{{title}}</span> | |
| 68 | + <span flex></span> | |
| 69 | + <button md-icon-button> | |
| 70 | + <md-icon class="md-24">view_module</md-icon> | |
| 71 | + </button> | |
| 72 | + <button md-icon-button> | |
| 73 | + <md-icon class="md-24">sort</md-icon> | |
| 74 | + </button> | |
| 75 | + <button md-icon-button> | |
| 76 | + <md-icon class="md-24">settings</md-icon> | |
| 77 | + </button> | |
| 78 | + <button md-icon-button> | |
| 79 | + <md-icon class="md-24">more_vert</md-icon> | |
| 80 | + </button> | |
| 11 | 81 | </div> |
| 12 | - <td-layout-manage-list #manageList [opened]="media.registerQuery('gt-sm') | async" [mode]="(media.registerQuery('gt-sm') | async) ? 'side' : 'push'" [sidenavWidth]="(media.registerQuery('gt-xs') | async) ? '257px' : '100%'"> | |
| 13 | - <md-toolbar td-sidenav-content> | |
| 14 | - <span>Відомості</span> | |
| 15 | - </md-toolbar> | |
| 16 | - <md-nav-list td-sidenav-content> | |
| 17 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road']"> | |
| 18 | - <md-icon md-list-icon>dashboard</md-icon> | |
| 19 | - Автомобільні дороги | |
| 20 | - </a> | |
| 21 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road-service']"> | |
| 22 | - <md-icon md-list-icon>insert_chart</md-icon> | |
| 23 | - Обслуговування | |
| 24 | - </a> | |
| 25 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['settlement-address-link']"> | |
| 26 | - <md-icon md-list-icon>star</md-icon> | |
| 27 | - Прив'язки населених пунктів | |
| 28 | - </a> | |
| 29 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['flow-intensity']"> | |
| 30 | - <md-icon md-list-icon>dashboard</md-icon> | |
| 31 | - Інтенсивності | |
| 32 | - </a> | |
| 33 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road-to-category']"> | |
| 34 | - <md-icon md-list-icon>dashboard</md-icon> | |
| 35 | - Категорія доріг | |
| 36 | - </a> | |
| 37 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['cross-section']"> | |
| 38 | - <md-icon md-list-icon>dashboard</md-icon> | |
| 39 | - З'їзди | |
| 40 | - </a> | |
| 41 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road-width']"> | |
| 42 | - <md-icon md-list-icon>dashboard</md-icon> | |
| 43 | - Ширина проїзних частин | |
| 44 | - </a> | |
| 45 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['road-surface']"> | |
| 46 | - <md-icon md-list-icon>dashboard</md-icon> | |
| 47 | - Покриття доріг | |
| 48 | - </a> | |
| 49 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['service-object']"> | |
| 50 | - <md-icon md-list-icon>dashboard</md-icon> | |
| 51 | - Об'єкти сервісу | |
| 52 | - </a> | |
| 53 | - <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['bus-stop']"> | |
| 54 | - <md-icon md-list-icon>dashboard</md-icon> | |
| 55 | - Автобусні зупинки | |
| 56 | - </a> | |
| 57 | - </md-nav-list> | |
| 58 | - <div td-toolbar-content layout="row" layout-align="start center" flex> | |
| 59 | - <span>{{title}}</span> | |
| 60 | - <span flex></span> | |
| 61 | - <button md-icon-button><md-icon class="md-24">view_module</md-icon></button> | |
| 62 | - <button md-icon-button><md-icon class="md-24">sort</md-icon></button> | |
| 63 | - <button md-icon-button><md-icon class="md-24">settings</md-icon></button> | |
| 64 | - <button md-icon-button><md-icon class="md-24">more_vert</md-icon></button> | |
| 65 | - </div> | |
| 66 | - <router-outlet></router-outlet> | |
| 67 | - </td-layout-manage-list> | |
| 82 | + <router-outlet></router-outlet> | |
| 83 | + </td-layout-manage-list> | |
| 68 | 84 | </td-layout-nav> |
| 69 | 85 | \ No newline at end of file | ... | ... |
src/app/data/map-items/map-items.component.ts
src/app/data/road/road.component.ts
| 1 | 1 | import { Component, ViewEncapsulation, AfterViewInit, ViewChild } from '@angular/core'; |
| 2 | 2 | import { TdLoadingService } from '@covalent/core'; |
| 3 | -import { GridOptions, IGetRowsParams, IRowModel } from 'ag-grid/main'; | |
| 3 | +import {GridOptions, IGetRowsParams, IRowModel, IFilter} from 'ag-grid/main'; | |
| 4 | 4 | |
| 5 | 5 | import { StatementBase } from '../../../models/statement.base'; |
| 6 | 6 | import { RoadMapComponent } from '../../../components/road-map.component'; | ... | ... |
src/components/road-map.component.html
| ... | ... | @@ -17,5 +17,13 @@ |
| 17 | 17 | </td-expansion-panel> |
| 18 | 18 | </div> |
| 19 | 19 | <div class="legend-body" [innerHtml]="legend"></div> |
| 20 | + <div class="legend-footer" *ngIf="selectedRoad"> | |
| 21 | + <p> | |
| 22 | + <a [routerLink]="['/data/authority', selectedRoad.id]">Органи управління</a> | |
| 23 | + </p> | |
| 24 | + <p> | |
| 25 | + <a [routerLink]="['/data/contractor', selectedRoad.id]">Підрядники з експлуатаційного утримання</a> | |
| 26 | + </p> | |
| 27 | + </div> | |
| 20 | 28 | </div> |
| 21 | 29 | <div id="{{identificator}}" [style.height]="getHeight()" ></div> |
| 22 | 30 | \ No newline at end of file | ... | ... |
src/components/road-map.component.ts
| ... | ... | @@ -6,6 +6,7 @@ import {NodeMarker} from "../models/node-marker"; |
| 6 | 6 | import {Node} from "../models/node"; |
| 7 | 7 | import {RoadService} from "../services/road.service"; |
| 8 | 8 | import {TdExpansionPanelComponent} from "@covalent/core/expansion-panel/expansion-panel.component"; |
| 9 | +import {Road} from "../models/road"; | |
| 9 | 10 | |
| 10 | 11 | @Component({ |
| 11 | 12 | // tslint:disable-next-line:component-selector |
| ... | ... | @@ -21,6 +22,7 @@ export class RoadMapComponent implements AfterViewInit { |
| 21 | 22 | protected ways: Way[] = []; |
| 22 | 23 | protected legend: string; |
| 23 | 24 | protected legendSummary: string; |
| 25 | + protected selectedRoad: Road; | |
| 24 | 26 | @Input() identificator: string = 'mapID'; |
| 25 | 27 | |
| 26 | 28 | constructor( |
| ... | ... | @@ -82,6 +84,7 @@ export class RoadMapComponent implements AfterViewInit { |
| 82 | 84 | way.polyline.addTo(this.map).on('click', (event) => { |
| 83 | 85 | console.log(event); |
| 84 | 86 | this.service.getRoadByWay(event.target.way.id).then(road => { |
| 87 | + this.selectedRoad = road; | |
| 85 | 88 | this.setWaySummary(way); |
| 86 | 89 | this.showLegend(road, 'Дорога'); |
| 87 | 90 | }); |
| ... | ... | @@ -98,6 +101,7 @@ export class RoadMapComponent implements AfterViewInit { |
| 98 | 101 | way.nodes.forEach(node => { |
| 99 | 102 | node.marker.addTo(this.map).on('click', (event) => { |
| 100 | 103 | this.service.getRoadByNode(event.target.node.id).then(road => { |
| 104 | + this.selectedRoad = road; | |
| 101 | 105 | this.setNodeSummary(node); |
| 102 | 106 | this.showLegend(road, 'Дорога'); |
| 103 | 107 | }); | ... | ... |