Commit 43da7a409f62b9d3016296575784457eb6f0d964
Merge branch 'master' of gitlab.artweb.com.ua:root/maps-admin
Showing
10 changed files
with
206 additions
and
1 deletions
Show diff stats
src/app/app.module.ts
| ... | ... | @@ -30,6 +30,7 @@ import { RendererComponent } from '../helpers/renderer.component'; |
| 30 | 30 | import { FlowIntensityComponent } from './data/flow-intensity/flow-intensity.component'; |
| 31 | 31 | import { RoadComponent } from './data/road/road.component'; |
| 32 | 32 | import { RoadServiceComponent } from './data/road-service/road-service.component'; |
| 33 | +import { SettlementAddressLinkComponent } from './data/settlement-address-link/settlement-address-link.component'; | |
| 33 | 34 | |
| 34 | 35 | // Services |
| 35 | 36 | import { BusStopCreateService } from '../services/bus-stop-create.service'; |
| ... | ... | @@ -49,6 +50,8 @@ import { RoadCreateService } from '../services/road-create.service'; |
| 49 | 50 | import { RoadService } from '../services/road.service'; |
| 50 | 51 | import { RoadServiceService } from '../services/road-service.service'; |
| 51 | 52 | import { RoadServiceCreateService } from '../services/road-service-create.service'; |
| 53 | +import { SettlementAddressLinkService } from '../services/settlement-address-link.service'; | |
| 54 | +import { SettlementAddressLinkCreateService } from '../services/settlement-address-link-create.service'; | |
| 52 | 55 | |
| 53 | 56 | const httpInterceptorProviders: Type<any>[] = [ |
| 54 | 57 | RequestInterceptor, |
| ... | ... | @@ -72,6 +75,7 @@ const httpInterceptorProviders: Type<any>[] = [ |
| 72 | 75 | RoadComponent, |
| 73 | 76 | CrossSectionComponent, |
| 74 | 77 | RoadServiceComponent, |
| 78 | + SettlementAddressLinkComponent, | |
| 75 | 79 | ], // directives, components, and pipes owned by this NgModule |
| 76 | 80 | imports: [ |
| 77 | 81 | BrowserModule, |
| ... | ... | @@ -86,6 +90,7 @@ const httpInterceptorProviders: Type<any>[] = [ |
| 86 | 90 | RoadComponent, |
| 87 | 91 | CrossSectionComponent, |
| 88 | 92 | RoadServiceComponent, |
| 93 | + SettlementAddressLinkComponent, | |
| 89 | 94 | ]), |
| 90 | 95 | CovalentCoreModule.forRoot(), |
| 91 | 96 | CovalentChartsModule.forRoot(), |
| ... | ... | @@ -121,6 +126,8 @@ const httpInterceptorProviders: Type<any>[] = [ |
| 121 | 126 | CrossSectionService, |
| 122 | 127 | RoadServiceService, |
| 123 | 128 | RoadServiceCreateService, |
| 129 | + SettlementAddressLinkService, | |
| 130 | + SettlementAddressLinkCreateService, | |
| 124 | 131 | ], // additional providers needed for this module |
| 125 | 132 | entryComponents: [ ], |
| 126 | 133 | bootstrap: [ AppComponent ], | ... | ... |
src/app/app.routes.ts
| ... | ... | @@ -12,6 +12,7 @@ import { ServiceObjectComponent } from './data/service-object/service-object.com |
| 12 | 12 | import { FlowIntensityComponent } from './data/flow-intensity/flow-intensity.component'; |
| 13 | 13 | import { RoadComponent } from './data/road/road.component'; |
| 14 | 14 | import { RoadServiceComponent } from './data/road-service/road-service.component'; |
| 15 | +import { SettlementAddressLinkComponent } from './data/settlement-address-link/settlement-address-link.component'; | |
| 15 | 16 | |
| 16 | 17 | const routes: Routes = [ |
| 17 | 18 | {path: 'login', component: LoginComponent}, |
| ... | ... | @@ -26,6 +27,7 @@ const routes: Routes = [ |
| 26 | 27 | {path: 'cross-section', component: CrossSectionComponent}, |
| 27 | 28 | {path: 'road', component: RoadComponent}, |
| 28 | 29 | {path: 'road-service', component: RoadServiceComponent}, |
| 30 | + {path: 'settlement-address-link', component: SettlementAddressLinkComponent}, | |
| 29 | 31 | ]}, |
| 30 | 32 | ]}, |
| 31 | 33 | ]; | ... | ... |
src/app/data/data.component.html
| ... | ... | @@ -22,7 +22,7 @@ |
| 22 | 22 | <md-icon md-list-icon>insert_chart</md-icon> |
| 23 | 23 | Обслуговування |
| 24 | 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]="['features']"> | |
| 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 | 26 | <md-icon md-list-icon>star</md-icon> |
| 27 | 27 | Прив'язки населених пунктів |
| 28 | 28 | </a> | ... | ... |
src/app/data/settlement-address-link/settlement-address-link.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($event)" (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" [disabled]="isNew || isSelected" (click)="addNewRow()" type="button"><md-icon>add</md-icon></button> | |
| 10 | + <button md-fab color="warn" [disabled]="!isSelected" (click)="deleteRows()" type="button"><md-icon>delete</md-icon></button> | |
| 11 | + </div> | |
| 12 | +</div> | |
| 0 | 13 | \ No newline at end of file | ... | ... |
src/app/data/settlement-address-link/settlement-address-link.component.ts
0 → 100644
| 1 | +import { Component, ViewEncapsulation, AfterViewInit } from '@angular/core'; | |
| 2 | +import { TdLoadingService } from '@covalent/core'; | |
| 3 | +import { GridOptions, IGetRowsParams, IRowModel } from 'ag-grid/main'; | |
| 4 | + | |
| 5 | +import { StatementBase } from '../../../models/statement.base'; | |
| 6 | + | |
| 7 | +import { SettlementAddressLinkService } from '../../../services/settlement-address-link.service'; | |
| 8 | +import { SettlementAddressLink } from '../../../models/settlement-address-link'; | |
| 9 | +import { EditorComponent } from '../../../helpers/editor.component'; | |
| 10 | +import { RendererComponent } from '../../../helpers/renderer.component'; | |
| 11 | +import { SettlementAddressLinkCreateService } from '../../../services/settlement-address-link-create.service'; | |
| 12 | +import { RegionSelectList } from '../../../models/region-select-list'; | |
| 13 | +import { RoadSelectList } from '../../../models/road-select-list'; | |
| 14 | +import { SettlementSelectList } from '../../../models/settlement-select-list'; | |
| 15 | +import { SettlementLocationSelectList } from '../../../models/settlement-location-select-list'; | |
| 16 | + | |
| 17 | +import { routerTransition } from '../../../animations/router.animation'; | |
| 18 | + | |
| 19 | +@Component({ | |
| 20 | + // tslint:disable-next-line:component-selector | |
| 21 | + selector: 'bus-grid', | |
| 22 | + templateUrl: 'settlement-address-link.component.html', | |
| 23 | + styleUrls: ['settlement-address-link.scss'], | |
| 24 | + encapsulation: ViewEncapsulation.None, | |
| 25 | +}) | |
| 26 | +export class SettlementAddressLinkComponent extends StatementBase { | |
| 27 | + | |
| 28 | + public regions: RegionSelectList[]; | |
| 29 | + public settlements: SettlementSelectList[]; | |
| 30 | + public roads: RoadSelectList[]; | |
| 31 | + public settlementLocations: SettlementLocationSelectList[]; | |
| 32 | + | |
| 33 | + constructor( | |
| 34 | + protected service: SettlementAddressLinkService, | |
| 35 | + protected dataService: SettlementAddressLinkCreateService, | |
| 36 | + protected loadingService: TdLoadingService, | |
| 37 | + ) { | |
| 38 | + super(); | |
| 39 | + } | |
| 40 | + | |
| 41 | + protected createColumnDefs(): any[] { | |
| 42 | + return [ | |
| 43 | + { | |
| 44 | + headerName: '#', | |
| 45 | + width: 30, | |
| 46 | + checkboxSelection: true, | |
| 47 | + suppressSorting: true, | |
| 48 | + suppressMenu: true, | |
| 49 | + pinned: true, | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + headerName: 'ID', | |
| 53 | + field: 'id', | |
| 54 | + }, | |
| 55 | + { | |
| 56 | + headerName: 'Назва дороги', | |
| 57 | + field: 'roadId', | |
| 58 | + editable: true, | |
| 59 | + cellEditorFramework: EditorComponent, | |
| 60 | + cellRendererFramework: RendererComponent, | |
| 61 | + cellEditorParams: { | |
| 62 | + data: this.roads, | |
| 63 | + valueCol: 'roadId', | |
| 64 | + labelCol: 'name', | |
| 65 | + }, | |
| 66 | + }, | |
| 67 | + { | |
| 68 | + headerName: 'Область', | |
| 69 | + field: 'regionId', | |
| 70 | + editable: true, | |
| 71 | + cellEditorFramework: EditorComponent, | |
| 72 | + cellRendererFramework: RendererComponent, | |
| 73 | + cellEditorParams: { | |
| 74 | + data: this.regions, | |
| 75 | + valueCol: 'regionId', | |
| 76 | + labelCol: 'name', | |
| 77 | + }, | |
| 78 | + }, | |
| 79 | + { | |
| 80 | + headerName: 'Місцезнаходження, км+ початока', | |
| 81 | + field: 'begin', | |
| 82 | + editable: true, | |
| 83 | + }, | |
| 84 | + { | |
| 85 | + headerName: 'Місцезнаходження, км+ кінець', | |
| 86 | + field: 'end', | |
| 87 | + editable: true, | |
| 88 | + }, | |
| 89 | + { | |
| 90 | + headerName: 'Місце', | |
| 91 | + field: 'settlementLocationId', | |
| 92 | + editable: true, | |
| 93 | + cellEditorFramework: EditorComponent, | |
| 94 | + cellRendererFramework: RendererComponent, | |
| 95 | + cellEditorParams: { | |
| 96 | + data: this.settlementLocations, | |
| 97 | + valueCol: 'id', | |
| 98 | + labelCol: 'name', | |
| 99 | + }, | |
| 100 | + }, | |
| 101 | + { | |
| 102 | + headerName: 'Назва населенного пункту', | |
| 103 | + field: 'settlementId', | |
| 104 | + editable: true, | |
| 105 | + cellEditorFramework: EditorComponent, | |
| 106 | + cellRendererFramework: RendererComponent, | |
| 107 | + cellEditorParams: { | |
| 108 | + data: this.settlements, | |
| 109 | + valueCol: 'settlementId', | |
| 110 | + labelCol: 'name', | |
| 111 | + }, | |
| 112 | + }, | |
| 113 | + { | |
| 114 | + headerName: 'Відстань від проїзної частини до забудови, м', | |
| 115 | + field: 'distance', | |
| 116 | + editable: true, | |
| 117 | + }, | |
| 118 | + ]; | |
| 119 | + } | |
| 120 | + | |
| 121 | + protected initFunction(): void { | |
| 122 | + this.dataService.getModels().then((models: any) => { | |
| 123 | + this.regions = models.regionSelectListDsM as RegionSelectList[]; | |
| 124 | + this.settlements = models.settlementSelectListDsM as SettlementSelectList[]; | |
| 125 | + this.roads = models.roadSelectListDsM as RoadSelectList[]; | |
| 126 | + this.settlementLocations = models.settlementLocationSelectListDsM as SettlementLocationSelectList[]; | |
| 127 | + }).then(() => { | |
| 128 | + this.bootstrapGrid(); | |
| 129 | + }); | |
| 130 | + } | |
| 131 | +} | ... | ... |
src/app/data/settlement-address-link/settlement-address-link.scss
0 → 100644
src/services/settlement-address-link-create.service.ts
0 → 100644
| 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 SettlementAddressLinkCreateService extends CreateBaseService { | |
| 8 | + protected apiUrl: string = 'http://localhost:5000/settlementaddresslink/directory'; | |
| 9 | + constructor(protected http: Http) { | |
| 10 | + super(http); | |
| 11 | + } | |
| 12 | +} | ... | ... |
| 1 | +import { Injectable } from '@angular/core'; | |
| 2 | +import { Http } from '@angular/http'; | |
| 3 | + | |
| 4 | +import { StatementBaseService } from './statement.base.service'; | |
| 5 | + | |
| 6 | +import { SettlementAddressLink } from '../models/settlement-address-link'; | |
| 7 | + | |
| 8 | +@Injectable() | |
| 9 | +export class SettlementAddressLinkService extends StatementBaseService { | |
| 10 | + protected url: string = 'http://localhost:5000/settlementaddresslink'; | |
| 11 | + constructor(protected http: Http) { | |
| 12 | + super(http); | |
| 13 | + } | |
| 14 | + public createModel(): Object { | |
| 15 | + return new SettlementAddressLink(); | |
| 16 | + } | |
| 17 | + protected parseModels(json: any): any[] { | |
| 18 | + return json.settlementAddressLinkEditDsM as SettlementAddressLink[]; | |
| 19 | + }; | |
| 20 | + protected parseModel(json: any): any { | |
| 21 | + return json as SettlementAddressLink; | |
| 22 | + }; | |
| 23 | +} | ... | ... |