diff --git a/src/animations/router.animation.ts b/src/animations/router.animation.ts new file mode 100644 index 0000000..db4482f --- /dev/null +++ b/src/animations/router.animation.ts @@ -0,0 +1,16 @@ +import {trigger, state, animate, style, transition} from '@angular/core'; + +export function routerTransition() { + return trigger('routerTransition', [ + state('void', style({position:'absolute', width:'1000px', height:'1000px'}) ), + state('*', style({position:'absolute', width:'1000px', height:'1000px'}) ), + transition(':enter', [ + style({transform: 'translateY(-100%)'}), + animate('0.5s ease-in-out', style({transform: 'translateY(0%)'})) + ]), + transition(':leave', [ + style({transform: 'translateY(0%)'}), + animate('0.5s ease-in-out', style({transform: 'translateY(100%)'})) + ]) + ]); +} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index bc6cd99..81ee4ce 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -21,13 +21,17 @@ import { RequestInterceptor } from '../config/interceptors/request.interceptor'; import { NgxChartsModule } from '@swimlane/ngx-charts'; import { BusStopComponent } from './data/bus-stop/bus-stop.component'; +import { ServiceObjectComponent } from './data/service-object/service-object.component'; import { EditorComponent } from '../helpers/editor.component'; import { RendererComponent } from '../helpers/renderer.component'; // Services import { BusStopCreateService } from '../services/bus-stop-create.service'; -import { BooleanSelectListService } from '../services/boolean-select-list.service'; import { BusStopService } from '../services/bus-stop.service'; +import { ServiceObjectCreateService } from '../services/service-object-create.service'; +import { ServiceObjectService } from '../services/service-object.service'; +import { BooleanSelectListService } from '../services/boolean-select-list.service'; + const httpInterceptorProviders: Type[] = [ RequestInterceptor, @@ -42,6 +46,7 @@ const httpInterceptorProviders: Type[] = [ ChartComponent, TemplatesComponent, BusStopComponent, + ServiceObjectComponent, EditorComponent, RendererComponent, ], // directives, components, and pipes owned by this NgModule @@ -49,6 +54,7 @@ const httpInterceptorProviders: Type[] = [ BrowserModule, AgGridModule.withComponents([ BusStopComponent, + ServiceObjectComponent, EditorComponent, RendererComponent, ]), @@ -69,9 +75,11 @@ const httpInterceptorProviders: Type[] = [ appRoutingProviders, httpInterceptorProviders, Title, - BusStopCreateService, BooleanSelectListService, + BusStopCreateService, BusStopService, + ServiceObjectCreateService, + ServiceObjectService ], // additional providers needed for this module entryComponents: [ ], bootstrap: [ AppComponent ], diff --git a/src/app/app.routes.ts b/src/app/app.routes.ts index 82dc10f..5bdaf94 100644 --- a/src/app/app.routes.ts +++ b/src/app/app.routes.ts @@ -5,6 +5,7 @@ import { DataComponent } from './data/data.component'; import { LoginComponent } from './login/login.component'; import { TemplatesComponent } from './templates/templates.component'; import { BusStopComponent } from './data/bus-stop/bus-stop.component'; +import { ServiceObjectComponent } from './data/service-object/service-object.component'; const routes: Routes = [ {path: 'login', component: LoginComponent}, @@ -12,6 +13,7 @@ const routes: Routes = [ {path: '', component: TemplatesComponent}, {path: 'data', component: DataComponent, children: [ {path: 'bus-stop', component: BusStopComponent}, + {path: 'service-object', component: ServiceObjectComponent}, ]}, ]}, ]; diff --git a/src/app/data/bus-stop/bus-stop.component.ts b/src/app/data/bus-stop/bus-stop.component.ts index 9fc7f40..37e6f59 100644 --- a/src/app/data/bus-stop/bus-stop.component.ts +++ b/src/app/data/bus-stop/bus-stop.component.ts @@ -15,6 +15,7 @@ import { BooleanSelectList } from '../../../models/boolean-select-list'; import { SettlementSelectList } from '../../../models/settlement-select-list'; import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list'; +import { routerTransition } from '../../../animations/router.animation'; // only import this if you are using the ag-Grid-Enterprise diff --git a/src/app/data/data.component.html b/src/app/data/data.component.html index 73def4c..2714011 100644 --- a/src/app/data/data.component.html +++ b/src/app/data/data.component.html @@ -46,7 +46,7 @@ dashboard Покриття доріг - + dashboard Об'єкти сервісу diff --git a/src/app/data/service-object/service-object.component.ts b/src/app/data/service-object/service-object.component.ts index ba58cad..f378b9b 100644 --- a/src/app/data/service-object/service-object.component.ts +++ b/src/app/data/service-object/service-object.component.ts @@ -10,10 +10,11 @@ import { BooleanSelectListService } from '../../../services/boolean-select-list. import { RegionSelectList } from '../../../models/region-select-list'; import { StateCommonSelectList } from '../../../models/state-common-select-list'; import { RoadSelectList } from '../../../models/road-select-list'; +import { DepartmentAffiliationList } from '../../../models/department-affiliation-list'; import { BooleanSelectList } from '../../../models/boolean-select-list'; import { SettlementSelectList } from '../../../models/settlement-select-list'; -import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list'; +import { routerTransition } from '../../../animations/router.animation'; // only import this if you are using the ag-Grid-Enterprise @@ -21,16 +22,16 @@ import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list' selector: 'service-object', templateUrl: 'service-object.component.html', styleUrls: ['service-object.scss'], - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, }) -export class BusStopComponent { +export class ServiceObjectComponent { public showGrid: boolean; public rowData: any[]; public rowCount: string; public regions: RegionSelectList[]; public states: StateCommonSelectList[]; - public surfaceTypes: SurfaceTypeSelectList[]; + public departmentAffiliation: DepartmentAffiliationList[]; public settlements: SettlementSelectList[]; public roads: RoadSelectList[]; public boolean: BooleanSelectList[]; @@ -53,7 +54,7 @@ export class BusStopComponent { this.dataService.getModels().then(models => { this.regions = models.regionSelectListDsM as RegionSelectList[]; this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; - this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[]; + this.departmentAffiliation = models.departmentAffiliationListDsM as DepartmentAffiliationList[]; this.settlements = models.settlementSelectListDsM as SettlementSelectList[]; this.roads = models.roadSelectListDsM as RoadSelectList[]; }).then(() => { @@ -117,7 +118,7 @@ export class BusStopComponent { }, { headerName: 'ID', - field: 'busStopId', + field: 'serviceObjectId', }, { headerName: 'Назва дороги', @@ -152,30 +153,6 @@ export class BusStopComponent { headerName: 'Місцезнаходження, км+ зліва', field: 'locationLeft', editable: true, - }, - { - headerName: 'Технічний стан', - field: 'stateCommonId', - editable: true, - cellEditorFramework: EditorComponent, - cellRendererFramework: RendererComponent, - cellEditorParams: { - data: this.states, - valueCol: 'stateCommonId', - labelCol: 'value' - } - }, - { - headerName: 'Наявність туалету', - field: 'toiletAvailability', - editable: true, - cellEditorFramework: EditorComponent, - cellRendererFramework: RendererComponent, - cellEditorParams: { - data: this.boolean, - valueCol: 'value', - labelCol: 'label' - } } ]; } diff --git a/src/models/department-affiliation-lis.ts b/src/models/department-affiliation-lis.ts deleted file mode 100644 index 8a507ff..0000000 --- a/src/models/department-affiliation-lis.ts +++ /dev/null @@ -1,4 +0,0 @@ -export class DepartmentAffiliationLis { - departmentAffiliationId: number; - name: string; - } diff --git a/src/models/department-affiliation-list.ts b/src/models/department-affiliation-list.ts new file mode 100644 index 0000000..451ed29 --- /dev/null +++ b/src/models/department-affiliation-list.ts @@ -0,0 +1,4 @@ +export class DepartmentAffiliationList { + departmentAffiliationId: number; + name: string; + } diff --git a/src/services/service-object.service.ts b/src/services/service-object.service.ts index 964257a..f23c568 100644 --- a/src/services/service-object.service.ts +++ b/src/services/service-object.service.ts @@ -13,7 +13,7 @@ export class ServiceObjectService { getData(): Promise { return this.http.get(this.url) .toPromise() - .then(response => response.json().busStopEditDsM as ServiceObject[]) + .then(response => response.json().serviceObjectEditDsM as ServiceObject[]) .catch(this.handleError); } update(id: number, data: string): Promise { -- libgit2 0.21.4