Commit feb1ac3791b7960a066b0ab70b8e08815e3b52d2
Merge
Showing
9 changed files
with
191 additions
and
3 deletions
Show diff stats
src/app/app.module.ts
@@ -24,6 +24,7 @@ import { BusStopComponent } from './data/bus-stop/bus-stop.component'; | @@ -24,6 +24,7 @@ import { BusStopComponent } from './data/bus-stop/bus-stop.component'; | ||
24 | import { ServiceObjectComponent } from './data/service-object/service-object.component'; | 24 | import { ServiceObjectComponent } from './data/service-object/service-object.component'; |
25 | import { RoadSurfaceComponent } from './data/road-surface/road-surface.component'; | 25 | import { RoadSurfaceComponent } from './data/road-surface/road-surface.component'; |
26 | import { RoadWidthComponent } from './data/road-width/road-width.component'; | 26 | import { RoadWidthComponent } from './data/road-width/road-width.component'; |
27 | +import { CrossSectionComponent } from './data/cross-section/cross-section.component'; | ||
27 | import { EditorComponent } from '../helpers/editor.component'; | 28 | import { EditorComponent } from '../helpers/editor.component'; |
28 | import { RendererComponent } from '../helpers/renderer.component'; | 29 | import { RendererComponent } from '../helpers/renderer.component'; |
29 | import { FlowIntensityComponent } from './data/flow-intensity/flow-intensity.component'; | 30 | import { FlowIntensityComponent } from './data/flow-intensity/flow-intensity.component'; |
@@ -37,6 +38,8 @@ import { RoadSurfaceService } from '../services/road-surface.service'; | @@ -37,6 +38,8 @@ import { RoadSurfaceService } from '../services/road-surface.service'; | ||
37 | import { RoadSurfaceCreateService } from '../services/road-surface-create.service'; | 38 | import { RoadSurfaceCreateService } from '../services/road-surface-create.service'; |
38 | import { RoadWidthService } from '../services/road-width.service'; | 39 | import { RoadWidthService } from '../services/road-width.service'; |
39 | import { RoadWidthCreateService } from '../services/road-width-create.service'; | 40 | import { RoadWidthCreateService } from '../services/road-width-create.service'; |
41 | +import { CrossSectionService } from '../services/cross-section.service'; | ||
42 | +import { CrossSectionCreateService } from '../services/cross-section-create.service'; | ||
40 | import { BooleanSelectListService } from '../services/boolean-select-list.service'; | 43 | import { BooleanSelectListService } from '../services/boolean-select-list.service'; |
41 | import { FlowIntensityCreateService } from '../services/flow-intensity-create.service'; | 44 | import { FlowIntensityCreateService } from '../services/flow-intensity-create.service'; |
42 | import { FlowIntensityService } from '../services/flow-intensity.service'; | 45 | import { FlowIntensityService } from '../services/flow-intensity.service'; |
@@ -60,6 +63,7 @@ const httpInterceptorProviders: Type<any>[] = [ | @@ -60,6 +63,7 @@ const httpInterceptorProviders: Type<any>[] = [ | ||
60 | RendererComponent, | 63 | RendererComponent, |
61 | RoadWidthComponent, | 64 | RoadWidthComponent, |
62 | FlowIntensityComponent, | 65 | FlowIntensityComponent, |
66 | + CrossSectionComponent, | ||
63 | ], // directives, components, and pipes owned by this NgModule | 67 | ], // directives, components, and pipes owned by this NgModule |
64 | imports: [ | 68 | imports: [ |
65 | BrowserModule, | 69 | BrowserModule, |
@@ -71,6 +75,7 @@ const httpInterceptorProviders: Type<any>[] = [ | @@ -71,6 +75,7 @@ const httpInterceptorProviders: Type<any>[] = [ | ||
71 | RoadSurfaceComponent, | 75 | RoadSurfaceComponent, |
72 | RoadWidthComponent, | 76 | RoadWidthComponent, |
73 | FlowIntensityComponent, | 77 | FlowIntensityComponent, |
78 | + CrossSectionComponent, | ||
74 | ]), | 79 | ]), |
75 | CovalentCoreModule.forRoot(), | 80 | CovalentCoreModule.forRoot(), |
76 | CovalentChartsModule.forRoot(), | 81 | CovalentChartsModule.forRoot(), |
@@ -100,6 +105,8 @@ const httpInterceptorProviders: Type<any>[] = [ | @@ -100,6 +105,8 @@ const httpInterceptorProviders: Type<any>[] = [ | ||
100 | RoadWidthService, | 105 | RoadWidthService, |
101 | FlowIntensityCreateService, | 106 | FlowIntensityCreateService, |
102 | FlowIntensityService, | 107 | FlowIntensityService, |
108 | + CrossSectionCreateService, | ||
109 | + CrossSectionService, | ||
103 | ], // additional providers needed for this module | 110 | ], // additional providers needed for this module |
104 | entryComponents: [ ], | 111 | entryComponents: [ ], |
105 | bootstrap: [ AppComponent ], | 112 | bootstrap: [ AppComponent ], |
src/app/app.routes.ts
@@ -7,6 +7,7 @@ import { TemplatesComponent } from './templates/templates.component'; | @@ -7,6 +7,7 @@ import { TemplatesComponent } from './templates/templates.component'; | ||
7 | import { BusStopComponent } from './data/bus-stop/bus-stop.component'; | 7 | import { BusStopComponent } from './data/bus-stop/bus-stop.component'; |
8 | import { RoadSurfaceComponent } from './data/road-surface/road-surface.component'; | 8 | import { RoadSurfaceComponent } from './data/road-surface/road-surface.component'; |
9 | import { RoadWidthComponent } from './data/road-width/road-width.component'; | 9 | import { RoadWidthComponent } from './data/road-width/road-width.component'; |
10 | +import { CrossSectionComponent } from './data/cross-section/cross-section.component'; | ||
10 | import { ServiceObjectComponent } from './data/service-object/service-object.component'; | 11 | import { ServiceObjectComponent } from './data/service-object/service-object.component'; |
11 | import { FlowIntensityComponent } from './data/flow-intensity/flow-intensity.component'; | 12 | import { FlowIntensityComponent } from './data/flow-intensity/flow-intensity.component'; |
12 | 13 | ||
@@ -20,6 +21,7 @@ const routes: Routes = [ | @@ -20,6 +21,7 @@ const routes: Routes = [ | ||
20 | {path: 'road-surface', component: RoadSurfaceComponent}, | 21 | {path: 'road-surface', component: RoadSurfaceComponent}, |
21 | {path: 'road-width', component: RoadWidthComponent}, | 22 | {path: 'road-width', component: RoadWidthComponent}, |
22 | {path: 'flow-intensity', component: FlowIntensityComponent}, | 23 | {path: 'flow-intensity', component: FlowIntensityComponent}, |
24 | + {path: 'cross-section', component: CrossSectionComponent}, | ||
23 | ]}, | 25 | ]}, |
24 | ]}, | 26 | ]}, |
25 | ]; | 27 | ]; |
src/app/data/cross-section/cross-section.component.html
0 → 100644
1 | +<div class="grid_containert" *ngIf="showGrid"> | ||
2 | + <ag-grid-ng2 #agGrid style="width: 100%; height: 100%;" class="ag-blue" [gridOptions]="gridOptions" [columnDefs]="columnDefs" [rowData]="rowData" enableColResize enableSorting enableFilter groupHeaders suppressRowClickSelection toolPanelSuppressGroups | ||
3 | + toolPanelSuppressValues debug rowHeight="22" rowSelection="multiple" (cellClicked)="onCellClicked($event)" (cellDoubleClicked)="onCellDoubleClicked($event)" (cellContextMenu)="onCellContextMenu($event)" (cellValueChanged)="onCellValueChanged($event)" | ||
4 | + (cellFocused)="onCellFocused($event)" (rowSelected)="onRowSelected($event)" (selectionChanged)="onSelectionChanged()" (beforeFilterChanged)="onBeforeFilterChanged()" (afterFilterChanged)="onAfterFilterChanged()" (filterModified)="onFilterModified()" | ||
5 | + (beforeSortChanged)="onBeforeSortChanged()" (afterSortChanged)="onAfterSortChanged()" (virtualRowRemoved)="onVirtualRowRemoved($event)" (rowClicked)="onRowClicked($event)"> | ||
6 | + </ag-grid-ng2> | ||
7 | + <div class="control_button"> | ||
8 | + <div *tdLoading="'loading'; mode:'indeterminate'; type:'circle'; strategy:'replace'; color:'accent'"></div> | ||
9 | + <button md-fab color="accent" (click)="addNewRow()" type="button"><md-icon>add</md-icon></button> | ||
10 | + <button md-fab color="warn" (click)="deleteRows()" type="button"><md-icon>delete</md-icon></button> | ||
11 | + </div> | ||
12 | +</div> | ||
0 | \ No newline at end of file | 13 | \ No newline at end of file |
src/app/data/cross-section/cross-section.component.ts
0 → 100644
1 | +import {Component, ViewEncapsulation} from '@angular/core'; | ||
2 | +import {GridOptions} from 'ag-grid/main'; | ||
3 | +import { TdLoadingService } from '@covalent/core'; | ||
4 | + | ||
5 | +import { StatementBase } from '../../../models/statement.base'; | ||
6 | + | ||
7 | +import { CrossSectionService } from '../../../services/cross-section.service'; | ||
8 | +import { CrossSection } from '../../../models/cross-section'; | ||
9 | +import { EditorComponent } from '../../../helpers/editor.component'; | ||
10 | +import { RendererComponent } from '../../../helpers/renderer.component'; | ||
11 | +import { CrossSectionCreateService } from '../../../services/cross-section-create.service'; | ||
12 | +import { RegionSelectList } from '../../../models/region-select-list'; | ||
13 | +import { RoadSelectList } from '../../../models/road-select-list'; | ||
14 | +import { StateCommonSelectList } from '../../../models/state-common-select-list'; | ||
15 | +import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list'; | ||
16 | + | ||
17 | +import { routerTransition } from '../../../animations/router.animation'; | ||
18 | + | ||
19 | +@Component({ | ||
20 | + selector: 'cross-section', | ||
21 | + templateUrl: 'cross-section.component.html', | ||
22 | + styleUrls: ['cross-section.scss'], | ||
23 | + encapsulation: ViewEncapsulation.None, | ||
24 | +}) | ||
25 | +export class CrossSectionComponent extends StatementBase { | ||
26 | + | ||
27 | + public regions: RegionSelectList[]; | ||
28 | + public roads: RoadSelectList[]; | ||
29 | + public surfaceTypes: SurfaceTypeSelectList[]; | ||
30 | + public states: StateCommonSelectList[]; | ||
31 | + | ||
32 | + constructor( | ||
33 | + protected service: CrossSectionService, | ||
34 | + protected dataService: CrossSectionCreateService, | ||
35 | + protected loadingService: TdLoadingService, | ||
36 | + ) { | ||
37 | + super(); | ||
38 | + } | ||
39 | + | ||
40 | + protected createColumnDefs(): any[] { | ||
41 | + return [ | ||
42 | + { | ||
43 | + headerName: '#', | ||
44 | + width: 30, | ||
45 | + checkboxSelection: true, | ||
46 | + suppressSorting: true, | ||
47 | + suppressMenu: true, | ||
48 | + pinned: true, | ||
49 | + }, | ||
50 | + { | ||
51 | + headerName: 'ID', | ||
52 | + field: 'id', | ||
53 | + }, | ||
54 | + { | ||
55 | + headerName: 'Назва дороги', | ||
56 | + field: 'roadId', | ||
57 | + editable: true, | ||
58 | + cellEditorFramework: EditorComponent, | ||
59 | + cellRendererFramework: RendererComponent, | ||
60 | + cellEditorParams: { | ||
61 | + data: this.roads, | ||
62 | + valueCol: 'roadId', | ||
63 | + labelCol: 'name', | ||
64 | + }, | ||
65 | + }, | ||
66 | + { | ||
67 | + headerName: 'Область', | ||
68 | + field: 'regionId', | ||
69 | + editable: true, | ||
70 | + cellEditorFramework: EditorComponent, | ||
71 | + cellRendererFramework: RendererComponent, | ||
72 | + cellEditorParams: { | ||
73 | + data: this.regions, | ||
74 | + valueCol: 'regionId', | ||
75 | + labelCol: 'name', | ||
76 | + }, | ||
77 | + }, | ||
78 | + { | ||
79 | + headerName: 'Стан покриття', | ||
80 | + field: 'stateCommonId', | ||
81 | + editable: true, | ||
82 | + cellEditorFramework: EditorComponent, | ||
83 | + cellRendererFramework: RendererComponent, | ||
84 | + cellEditorParams: { | ||
85 | + data: this.states, | ||
86 | + valueCol: 'stateCommonId', | ||
87 | + labelCol: 'value', | ||
88 | + }, | ||
89 | + }, | ||
90 | + ]; | ||
91 | + } | ||
92 | + | ||
93 | + protected initFunction(): void { | ||
94 | + this.dataService.getModels().then((models: any) => { | ||
95 | + this.regions = models.regionSelectListDsM as RegionSelectList[]; | ||
96 | + this.roads = models.roadSelectListDsM as RoadSelectList[]; | ||
97 | + this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[]; | ||
98 | + this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; | ||
99 | + }).then(() => { | ||
100 | + this.bootstrapGrid(); | ||
101 | + }); | ||
102 | + } | ||
103 | + | ||
104 | + // tslint:disable-next-line:member-ordering | ||
105 | + public CreateModel(): Object { | ||
106 | + return new CrossSection(); | ||
107 | + } | ||
108 | +} |
src/app/data/data.component.html
@@ -26,15 +26,15 @@ | @@ -26,15 +26,15 @@ | ||
26 | <md-icon md-list-icon>star</md-icon> | 26 | <md-icon md-list-icon>star</md-icon> |
27 | Прив'язки населених пунктів | 27 | Прив'язки населених пунктів |
28 | </a> | 28 | </a> |
29 | - <a md-list-item (click)="!media.query('gt-sm') && manageList.close()" md-ripple class="block relative"> | ||
30 | - <md-icon md-list-icon>people</md-icon> | 29 | + <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['/product']"> |
30 | + <md-icon md-list-icon>dashboard</md-icon> | ||
31 | Інтенсивності | 31 | Інтенсивності |
32 | </a> | 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]="['/product']"> | 33 | <a md-list-item md-ripple class="block relative" (click)="!media.query('gt-sm') && manageList.close()" [routerLinkActive]="['active']" [routerLinkActiveOptions]="{exact:true}" [routerLink]="['/product']"> |
34 | <md-icon md-list-icon>dashboard</md-icon> | 34 | <md-icon md-list-icon>dashboard</md-icon> |
35 | Категорія доріг | 35 | Категорія доріг |
36 | </a> | 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]="['/product']"> | 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> | 38 | <md-icon md-list-icon>dashboard</md-icon> |
39 | З'їзди | 39 | З'їзди |
40 | </a> | 40 | </a> |
1 | +export class CrossSection { | ||
2 | + id: number; | ||
3 | + roadId: number; | ||
4 | + regionId: number; | ||
5 | + stateCommonid: number; | ||
6 | + locationLeft: number; | ||
7 | + locationRight: number; | ||
8 | + direction: string; | ||
9 | + surfaceTypeId: number; | ||
10 | + lengthSection: number; | ||
11 | + lengthSurface: number; | ||
12 | + distanceEdge: number; | ||
13 | + width: number; | ||
14 | + angle: number; | ||
15 | + tubeAvailability: number; | ||
16 | + safetyAvailability: number; | ||
17 | + yearBuild: number; | ||
18 | + yearRepair: number; | ||
19 | + | ||
20 | +} |
1 | +import { Injectable } from '@angular/core'; | ||
2 | +import { Http } from '@angular/http'; | ||
3 | + | ||
4 | +import { CreateBaseService } from './create.base.service'; | ||
5 | + | ||
6 | +@Injectable() | ||
7 | +export class CrossSectionCreateService extends CreateBaseService { | ||
8 | + protected apiUrl: string = 'http://localhost:5000/crosssection/directory'; | ||
9 | + constructor(protected http: Http) { | ||
10 | + super(http); | ||
11 | + } | ||
12 | +} |
1 | +import { Injectable } from '@angular/core'; | ||
2 | +import { Headers, Http } from '@angular/http'; | ||
3 | + | ||
4 | +import { StatementBaseService } from './statement.base.service'; | ||
5 | + | ||
6 | +import { CrossSection } from '../models/cross-section'; | ||
7 | + | ||
8 | +@Injectable() | ||
9 | +export class CrossSectionService extends StatementBaseService { | ||
10 | + protected url: string = 'http://localhost:5000/crosssection'; | ||
11 | + constructor(protected http: Http) { | ||
12 | + super(http); | ||
13 | + } | ||
14 | + public createModel(): Object { | ||
15 | + return new CrossSection(); | ||
16 | + } | ||
17 | + protected parseModels(json: any): any { | ||
18 | + return json.crossSectionEditDsM as CrossSection[]; | ||
19 | + } | ||
20 | + protected parseModel(json: any): any { | ||
21 | + return json as CrossSection; | ||
22 | + } | ||
23 | +} |