Commit e06cfa2b02d86389df23a9ef40ed9c61bd2a1f7b
1 parent
a04ea953
add road width
Showing
18 changed files
with
463 additions
and
4 deletions
Show diff stats
src/app/app.module.ts
| ... | ... | @@ -22,6 +22,8 @@ import { NgxChartsModule } from '@swimlane/ngx-charts'; |
| 22 | 22 | |
| 23 | 23 | import { BusStopComponent } from './data/bus-stop/bus-stop.component'; |
| 24 | 24 | import { ServiceObjectComponent } from './data/service-object/service-object.component'; |
| 25 | +import { RoadSurfaceComponent } from './data/road-surface/road-surface.component'; | |
| 26 | +import { RoadWidthComponent } from './data/road-width/road-width.component'; | |
| 25 | 27 | import { EditorComponent } from '../helpers/editor.component'; |
| 26 | 28 | import { RendererComponent } from '../helpers/renderer.component'; |
| 27 | 29 | |
| ... | ... | @@ -30,9 +32,12 @@ import { BusStopCreateService } from '../services/bus-stop-create.service'; |
| 30 | 32 | import { BusStopService } from '../services/bus-stop.service'; |
| 31 | 33 | import { ServiceObjectCreateService } from '../services/service-object-create.service'; |
| 32 | 34 | import { ServiceObjectService } from '../services/service-object.service'; |
| 35 | +import { RoadSurfaceService } from '../services/road-surface.service'; | |
| 36 | +import { RoadSurfaceCreateService } from '../services/road-surface-create.service'; | |
| 37 | +import { RoadWidthService } from '../services/road-width.service'; | |
| 38 | +import { RoadWidthCreateService } from '../services/road-width-create.service'; | |
| 33 | 39 | import { BooleanSelectListService } from '../services/boolean-select-list.service'; |
| 34 | 40 | |
| 35 | - | |
| 36 | 41 | const httpInterceptorProviders: Type<any>[] = [ |
| 37 | 42 | RequestInterceptor, |
| 38 | 43 | ]; |
| ... | ... | @@ -47,8 +52,10 @@ const httpInterceptorProviders: Type<any>[] = [ |
| 47 | 52 | TemplatesComponent, |
| 48 | 53 | BusStopComponent, |
| 49 | 54 | ServiceObjectComponent, |
| 55 | + RoadSurfaceComponent, | |
| 50 | 56 | EditorComponent, |
| 51 | 57 | RendererComponent, |
| 58 | + RoadWidthComponent, | |
| 52 | 59 | ], // directives, components, and pipes owned by this NgModule |
| 53 | 60 | imports: [ |
| 54 | 61 | BrowserModule, |
| ... | ... | @@ -57,6 +64,8 @@ const httpInterceptorProviders: Type<any>[] = [ |
| 57 | 64 | ServiceObjectComponent, |
| 58 | 65 | EditorComponent, |
| 59 | 66 | RendererComponent, |
| 67 | + RoadSurfaceComponent, | |
| 68 | + RoadWidthComponent, | |
| 60 | 69 | ]), |
| 61 | 70 | CovalentCoreModule.forRoot(), |
| 62 | 71 | CovalentChartsModule.forRoot(), |
| ... | ... | @@ -79,7 +88,11 @@ const httpInterceptorProviders: Type<any>[] = [ |
| 79 | 88 | BusStopCreateService, |
| 80 | 89 | BusStopService, |
| 81 | 90 | ServiceObjectCreateService, |
| 82 | - ServiceObjectService | |
| 91 | + ServiceObjectService, | |
| 92 | + RoadSurfaceCreateService, | |
| 93 | + RoadSurfaceService, | |
| 94 | + RoadWidthCreateService, | |
| 95 | + RoadWidthService, | |
| 83 | 96 | ], // additional providers needed for this module |
| 84 | 97 | entryComponents: [ ], |
| 85 | 98 | bootstrap: [ AppComponent ], | ... | ... |
src/app/app.routes.ts
| ... | ... | @@ -5,6 +5,8 @@ import { DataComponent } from './data/data.component'; |
| 5 | 5 | import { LoginComponent } from './login/login.component'; |
| 6 | 6 | import { TemplatesComponent } from './templates/templates.component'; |
| 7 | 7 | import { BusStopComponent } from './data/bus-stop/bus-stop.component'; |
| 8 | +import { RoadSurfaceComponent } from './data/road-surface/road-surface.component'; | |
| 9 | +import { RoadWidthComponent } from './data/road-width/road-width.component'; | |
| 8 | 10 | import { ServiceObjectComponent } from './data/service-object/service-object.component'; |
| 9 | 11 | |
| 10 | 12 | const routes: Routes = [ |
| ... | ... | @@ -14,6 +16,8 @@ const routes: Routes = [ |
| 14 | 16 | {path: 'data', component: DataComponent, children: [ |
| 15 | 17 | {path: 'bus-stop', component: BusStopComponent}, |
| 16 | 18 | {path: 'service-object', component: ServiceObjectComponent}, |
| 19 | + {path: 'road-surface', component: RoadSurfaceComponent}, | |
| 20 | + {path: 'road-width', component: RoadWidthComponent}, | |
| 17 | 21 | ]}, |
| 18 | 22 | ]}, |
| 19 | 23 | ]; | ... | ... |
src/app/data/data.component.html
| ... | ... | @@ -38,11 +38,11 @@ |
| 38 | 38 | <md-icon md-list-icon>dashboard</md-icon> |
| 39 | 39 | ะ'ัะทะดะธ |
| 40 | 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]="['/product']"> | |
| 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 | 42 | <md-icon md-list-icon>dashboard</md-icon> |
| 43 | 43 | ะจะธัะธะฝะฐ ะฟัะพัะทะฝะธั ัะฐััะธะฝ |
| 44 | 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]="['/product']"> | |
| 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 | 46 | <md-icon md-list-icon>dashboard</md-icon> |
| 47 | 47 | ะะพะบัะธััั ะดะพััะณ |
| 48 | 48 | </a> | ... | ... |
src/app/data/road-surface/road-surface.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 | 13 | \ No newline at end of file | ... | ... |
src/app/data/road-surface/road-surface.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 { RoadSurfaceService } from '../../../services/road-surface.service'; | |
| 8 | +import { RoadSurface } from '../../../models/road-surface'; | |
| 9 | +import { EditorComponent } from '../../../helpers/editor.component'; | |
| 10 | +import { RendererComponent } from '../../../helpers/renderer.component'; | |
| 11 | +import { RoadSurfaceCreateService } from '../../../services/road-surface-create.service'; | |
| 12 | +import { RegionSelectList } from '../../../models/region-select-list'; | |
| 13 | +import { RoadSelectList } from '../../../models/road-select-list'; | |
| 14 | +import { RoadDirectionSelectList } from '../../../models/road-direction-select-list'; | |
| 15 | +import { SurfaceTreatmentSelectList } from '../../../models/surface-treatment-select-list'; | |
| 16 | +import { StateCommonSelectList } from '../../../models/state-common-select-list'; | |
| 17 | +import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list'; | |
| 18 | + | |
| 19 | +import { routerTransition } from '../../../animations/router.animation'; | |
| 20 | + | |
| 21 | +@Component({ | |
| 22 | + selector: 'road-surface', | |
| 23 | + templateUrl: 'road-surface.component.html', | |
| 24 | + styleUrls: ['road-surface.scss'], | |
| 25 | + encapsulation: ViewEncapsulation.None, | |
| 26 | +}) | |
| 27 | +export class RoadSurfaceComponent extends StatementBase { | |
| 28 | + | |
| 29 | + public regions: RegionSelectList[]; | |
| 30 | + public roadDirection: RoadDirectionSelectList[]; | |
| 31 | + public roads: RoadSelectList[]; | |
| 32 | + public surfaceTypes: SurfaceTypeSelectList[]; | |
| 33 | + public states: StateCommonSelectList[]; | |
| 34 | + public surfaceTreatment: SurfaceTreatmentSelectList[]; | |
| 35 | + | |
| 36 | + constructor( | |
| 37 | + protected service: RoadSurfaceService, | |
| 38 | + protected dataService: RoadSurfaceCreateService, | |
| 39 | + protected loadingService: TdLoadingService, | |
| 40 | + ) { | |
| 41 | + super(); | |
| 42 | + } | |
| 43 | + | |
| 44 | + protected createColumnDefs(): any[] { | |
| 45 | + return [ | |
| 46 | + { | |
| 47 | + headerName: '#', | |
| 48 | + width: 30, | |
| 49 | + checkboxSelection: true, | |
| 50 | + suppressSorting: true, | |
| 51 | + suppressMenu: true, | |
| 52 | + pinned: true, | |
| 53 | + }, | |
| 54 | + { | |
| 55 | + headerName: 'ID', | |
| 56 | + field: 'id', | |
| 57 | + }, | |
| 58 | + { | |
| 59 | + headerName: 'ะะฐะทะฒะฐ ะดะพัะพะณะธ', | |
| 60 | + field: 'roadId', | |
| 61 | + editable: true, | |
| 62 | + cellEditorFramework: EditorComponent, | |
| 63 | + cellRendererFramework: RendererComponent, | |
| 64 | + cellEditorParams: { | |
| 65 | + data: this.roads, | |
| 66 | + valueCol: 'roadId', | |
| 67 | + labelCol: 'name', | |
| 68 | + }, | |
| 69 | + }, | |
| 70 | + { | |
| 71 | + headerName: 'ะะฑะปะฐััั', | |
| 72 | + field: 'regionId', | |
| 73 | + editable: true, | |
| 74 | + cellEditorFramework: EditorComponent, | |
| 75 | + cellRendererFramework: RendererComponent, | |
| 76 | + cellEditorParams: { | |
| 77 | + data: this.regions, | |
| 78 | + valueCol: 'regionId', | |
| 79 | + labelCol: 'name', | |
| 80 | + }, | |
| 81 | + }, | |
| 82 | + { | |
| 83 | + headerName: 'ะะฐะฟััะผะพะบ ัะผัะณะธ ััั ั', | |
| 84 | + field: 'roadDirectionId', | |
| 85 | + editable: true, | |
| 86 | + cellEditorFramework: EditorComponent, | |
| 87 | + cellRendererFramework: RendererComponent, | |
| 88 | + cellEditorParams: { | |
| 89 | + data: this.roadDirection, | |
| 90 | + valueCol: 'roadDirectionId', | |
| 91 | + labelCol: 'name', | |
| 92 | + }, | |
| 93 | + }, | |
| 94 | + { | |
| 95 | + headerName: 'ะัััะตะทะฝะฐั ะพะดะถะตะฝะฝั, ะบะผ+ ะฟะพัะฐัะพะบ', | |
| 96 | + field: 'begin', | |
| 97 | + editable: true, | |
| 98 | + }, | |
| 99 | + { | |
| 100 | + headerName: 'ะัััะตะทะฝะฐั ะพะดะถะตะฝะฝั, ะบะผ+ ะบัะฝะตัั', | |
| 101 | + field: 'end', | |
| 102 | + editable: true, | |
| 103 | + }, | |
| 104 | + { | |
| 105 | + headerName: 'ะขะธะฟ ะฟะพะบัะธััั', | |
| 106 | + field: 'surfaceTypeId', | |
| 107 | + editable: true, | |
| 108 | + cellEditorFramework: EditorComponent, | |
| 109 | + cellRendererFramework: RendererComponent, | |
| 110 | + cellEditorParams: { | |
| 111 | + data: this.surfaceTypes, | |
| 112 | + valueCol: 'surfaceTypeId', | |
| 113 | + labelCol: 'name', | |
| 114 | + }, | |
| 115 | + }, | |
| 116 | + { | |
| 117 | + headerName: 'ะขะธะฟ ะฟะพะฒะตัั ะฝะตะฒะพั ะพะฑัะพะฑะบะธ', | |
| 118 | + field: 'surfaceTreatmentId', | |
| 119 | + editable: true, | |
| 120 | + cellEditorFramework: EditorComponent, | |
| 121 | + cellRendererFramework: RendererComponent, | |
| 122 | + cellEditorParams: { | |
| 123 | + data: this.surfaceTreatment, | |
| 124 | + valueCol: 'surfaceTreatmentId', | |
| 125 | + labelCol: 'name', | |
| 126 | + }, | |
| 127 | + }, | |
| 128 | + { | |
| 129 | + headerName: 'ะกัะฐะฝ ะฟะพะบัะธััั', | |
| 130 | + field: 'stateCommonId', | |
| 131 | + editable: true, | |
| 132 | + cellEditorFramework: EditorComponent, | |
| 133 | + cellRendererFramework: RendererComponent, | |
| 134 | + cellEditorParams: { | |
| 135 | + data: this.states, | |
| 136 | + valueCol: 'stateCommonId', | |
| 137 | + labelCol: 'value', | |
| 138 | + }, | |
| 139 | + }, | |
| 140 | + ]; | |
| 141 | + } | |
| 142 | + | |
| 143 | + protected initFunction(): void { | |
| 144 | + this.dataService.getModels().then((models: any) => { | |
| 145 | + this.regions = models.regionSelectListDsM as RegionSelectList[]; | |
| 146 | + this.roads = models.roadSelectListDsM as RoadSelectList[]; | |
| 147 | + this.roadDirection = models.roadDirectionSelectListDsM as RoadDirectionSelectList[]; | |
| 148 | + this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[]; | |
| 149 | + this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; | |
| 150 | + this.surfaceTreatment = models.surfaceTreatmentSelectListDsM as SurfaceTreatmentSelectList[]; | |
| 151 | + }).then(() => { | |
| 152 | + this.bootstrapGrid(); | |
| 153 | + }); | |
| 154 | + } | |
| 155 | + | |
| 156 | + // tslint:disable-next-line:member-ordering | |
| 157 | + public CreateModel(): Object { | |
| 158 | + return new RoadSurface(); | |
| 159 | + } | |
| 160 | +} | ... | ... |
src/app/data/road-width/road-width.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 | 13 | \ No newline at end of file | ... | ... |
| 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 | + | |
| 8 | +import { RoadWidth } from '../../../models/road-width'; | |
| 9 | +import { EditorComponent } from '../../../helpers/editor.component'; | |
| 10 | +import { RendererComponent } from '../../../helpers/renderer.component'; | |
| 11 | +import { RoadWidthService } from '../../../services/road-width.service'; | |
| 12 | +import { RoadWidthCreateService } from '../../../services/road-width-create.service'; | |
| 13 | +import { RegionSelectList } from '../../../models/region-select-list'; | |
| 14 | +import { RoadSelectList } from '../../../models/road-select-list'; | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | +import { routerTransition } from '../../../animations/router.animation'; | |
| 20 | + | |
| 21 | +@Component({ | |
| 22 | + selector: 'road-width', | |
| 23 | + templateUrl: 'road-width.component.html', | |
| 24 | + styleUrls: ['road-width.scss'], | |
| 25 | + encapsulation: ViewEncapsulation.None, | |
| 26 | +}) | |
| 27 | +export class RoadWidthComponent extends StatementBase { | |
| 28 | + | |
| 29 | + public regions: RegionSelectList[]; | |
| 30 | + | |
| 31 | + public roads: RoadSelectList[]; | |
| 32 | + | |
| 33 | + constructor( | |
| 34 | + protected service: RoadWidthService, | |
| 35 | + protected dataService: RoadWidthCreateService, | |
| 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: 'widthRoadsideLeft', | |
| 92 | + editable: true, | |
| 93 | + }, | |
| 94 | + { | |
| 95 | + headerName: 'ะจะธัะธะฝะฐ, ะฟัะพัะทะฝะฐ ะทะฒะพัะพัะฝัะพะณะพ ะฝะฐะฟััะผะบั', | |
| 96 | + field: 'widthReverseRoad', | |
| 97 | + editable: true, | |
| 98 | + }, | |
| 99 | + { | |
| 100 | + headerName: 'ะจะธัะธะฝะฐ, ัะพะทะฟะพะดัะปััะฐ ัะผัะณะฐ', | |
| 101 | + field: 'widthStrip', | |
| 102 | + editable: true, | |
| 103 | + }, | |
| 104 | + { | |
| 105 | + headerName: 'ะจะธัะธะฝะฐ, ะฟัะพัะทะฝะฐ ะฟััะผะพะณะพ ะฝะฐะฟััะผะบั', | |
| 106 | + field: 'widthRoadwayForward', | |
| 107 | + editable: true, | |
| 108 | + }, | |
| 109 | + { | |
| 110 | + headerName: 'ะจะธัะธะฝะฐ, ัะทะฑัััั ัะฟัะฐะฒะฐ', | |
| 111 | + field: 'widthRoadsideRight', | |
| 112 | + editable: true, | |
| 113 | + }, | |
| 114 | + { | |
| 115 | + headerName: 'ะัะปัะบัััั ัะผัะณ ััั ั ะทะปัะฒะฐ', | |
| 116 | + field: 'countLaneLeft', | |
| 117 | + editable: true, | |
| 118 | + }, | |
| 119 | + { | |
| 120 | + headerName: 'ะัะปัะบัััั ัะผัะณ ััั ั ัะฟัะฐะฒะฐ', | |
| 121 | + field: 'countLaneRight', | |
| 122 | + editable: true, | |
| 123 | + }, | |
| 124 | + ]; | |
| 125 | + } | |
| 126 | + | |
| 127 | + protected initFunction(): void { | |
| 128 | + this.dataService.getModels().then((models: any) => { | |
| 129 | + this.regions = models.regionSelectListDsM as RegionSelectList[]; | |
| 130 | + this.roads = models.roadSelectListDsM as RoadSelectList[]; | |
| 131 | + }).then(() => { | |
| 132 | + this.bootstrapGrid(); | |
| 133 | + }); | |
| 134 | + } | |
| 135 | + | |
| 136 | + // tslint:disable-next-line:member-ordering | |
| 137 | + public CreateModel(): Object { | |
| 138 | + return new RoadWidth(); | |
| 139 | + } | |
| 140 | +} | ... | ... |
src/app/data/service-object/service-object.component.ts
| 1 | 1 | import {Component, ViewEncapsulation} from '@angular/core'; |
| 2 | 2 | import {GridOptions} from 'ag-grid/main'; |
| 3 | +import { TdLoadingService } from '@covalent/core'; | |
| 3 | 4 | |
| 4 | 5 | import { StatementBase } from '../../../models/statement.base'; |
| 5 | 6 | |
| ... | ... | @@ -37,6 +38,7 @@ export class ServiceObjectComponent extends StatementBase { |
| 37 | 38 | protected service: ServiceObjectService, |
| 38 | 39 | protected dataService: ServiceObjectCreateService, |
| 39 | 40 | protected booleanService: BooleanSelectListService, |
| 41 | + protected loadingService: TdLoadingService, | |
| 40 | 42 | ) { |
| 41 | 43 | super(); |
| 42 | 44 | } |
| ... | ... | @@ -162,4 +164,9 @@ export class ServiceObjectComponent extends StatementBase { |
| 162 | 164 | this.bootstrapGrid(); |
| 163 | 165 | }); |
| 164 | 166 | } |
| 167 | + | |
| 168 | + // tslint:disable-next-line:member-ordering | |
| 169 | + public CreateModel(): Object { | |
| 170 | + return new ServiceObject(); | |
| 171 | + } | |
| 165 | 172 | } | ... | ... |
| 1 | +export class RoadWidth { | |
| 2 | + id: number; | |
| 3 | + roadId: number; | |
| 4 | + regionId: number; | |
| 5 | + begin: number; | |
| 6 | + end: number; | |
| 7 | + withRoadsideLeft: number; | |
| 8 | + widthReverseRoad: number; | |
| 9 | + widthStrip: number; | |
| 10 | + widthRoadwayForward: number; | |
| 11 | + widthRoadsideRight: number; | |
| 12 | + countLaneLeft: number; | |
| 13 | + countLaneRight: number; | |
| 14 | +} | ... | ... |
| 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 RoadSurfaceCreateService extends CreateBaseService { | |
| 8 | + protected apiUrl: string = 'http://localhost:5000/roadsurface/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 { RoadSurface } from '../models/road-surface'; | |
| 7 | + | |
| 8 | +@Injectable() | |
| 9 | +export class RoadSurfaceService extends StatementBaseService { | |
| 10 | + protected url: string = 'http://localhost:5000/roadsurface'; | |
| 11 | + constructor(protected http: Http) { | |
| 12 | + super(http); | |
| 13 | + } | |
| 14 | + public createModel(): Object { | |
| 15 | + return new RoadSurface(); | |
| 16 | + } | |
| 17 | + protected parseModels(json: any): any { | |
| 18 | + return json.roadSurfaceEditDsM as RoadSurface[]; | |
| 19 | + } | |
| 20 | + protected parseModel(json: any): any { | |
| 21 | + return json as RoadSurface; | |
| 22 | + } | |
| 23 | +} | ... | ... |
| 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 RoadWidthCreateService extends CreateBaseService { | |
| 8 | + protected apiUrl: string = 'http://localhost:5000/roadwidth/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 { RoadWidth } from '../models/road-width'; | |
| 7 | + | |
| 8 | +@Injectable() | |
| 9 | +export class RoadWidthService extends StatementBaseService { | |
| 10 | + protected url: string = 'http://localhost:5000/roadwidth'; | |
| 11 | + constructor(protected http: Http) { | |
| 12 | + super(http); | |
| 13 | + } | |
| 14 | + public createModel(): Object { | |
| 15 | + return new RoadWidth(); | |
| 16 | + } | |
| 17 | + protected parseModels(json: any): any { | |
| 18 | + return json.roadWidthEditDsM as RoadWidth[]; | |
| 19 | + } | |
| 20 | + protected parseModel(json: any): any { | |
| 21 | + return json as RoadWidth; | |
| 22 | + } | |
| 23 | +} | ... | ... |