Commit df66c2075a2c4d76b071f15015aab172b41b26ac
Merge branch 'master' of gitlab.artweb.com.ua:root/maps-admin
Showing
10 changed files
with
48 additions
and
50 deletions
Show diff stats
1 | +import {trigger, state, animate, style, transition} from '@angular/core'; | ||
2 | + | ||
3 | +export function routerTransition() { | ||
4 | + return trigger('routerTransition', [ | ||
5 | + state('void', style({position:'absolute', width:'1000px', height:'1000px'}) ), | ||
6 | + state('*', style({position:'absolute', width:'1000px', height:'1000px'}) ), | ||
7 | + transition(':enter', [ | ||
8 | + style({transform: 'translateY(-100%)'}), | ||
9 | + animate('0.5s ease-in-out', style({transform: 'translateY(0%)'})) | ||
10 | + ]), | ||
11 | + transition(':leave', [ | ||
12 | + style({transform: 'translateY(0%)'}), | ||
13 | + animate('0.5s ease-in-out', style({transform: 'translateY(100%)'})) | ||
14 | + ]) | ||
15 | + ]); | ||
16 | +} |
src/app/app.module.ts
@@ -21,13 +21,17 @@ import { RequestInterceptor } from '../config/interceptors/request.interceptor'; | @@ -21,13 +21,17 @@ import { RequestInterceptor } from '../config/interceptors/request.interceptor'; | ||
21 | import { NgxChartsModule } from '@swimlane/ngx-charts'; | 21 | import { NgxChartsModule } from '@swimlane/ngx-charts'; |
22 | 22 | ||
23 | import { BusStopComponent } from './data/bus-stop/bus-stop.component'; | 23 | import { BusStopComponent } from './data/bus-stop/bus-stop.component'; |
24 | +import { ServiceObjectComponent } from './data/service-object/service-object.component'; | ||
24 | import { EditorComponent } from '../helpers/editor.component'; | 25 | import { EditorComponent } from '../helpers/editor.component'; |
25 | import { RendererComponent } from '../helpers/renderer.component'; | 26 | import { RendererComponent } from '../helpers/renderer.component'; |
26 | 27 | ||
27 | // Services | 28 | // Services |
28 | import { BusStopCreateService } from '../services/bus-stop-create.service'; | 29 | import { BusStopCreateService } from '../services/bus-stop-create.service'; |
29 | -import { BooleanSelectListService } from '../services/boolean-select-list.service'; | ||
30 | import { BusStopService } from '../services/bus-stop.service'; | 30 | import { BusStopService } from '../services/bus-stop.service'; |
31 | +import { ServiceObjectCreateService } from '../services/service-object-create.service'; | ||
32 | +import { ServiceObjectService } from '../services/service-object.service'; | ||
33 | +import { BooleanSelectListService } from '../services/boolean-select-list.service'; | ||
34 | + | ||
31 | 35 | ||
32 | const httpInterceptorProviders: Type<any>[] = [ | 36 | const httpInterceptorProviders: Type<any>[] = [ |
33 | RequestInterceptor, | 37 | RequestInterceptor, |
@@ -42,6 +46,7 @@ const httpInterceptorProviders: Type<any>[] = [ | @@ -42,6 +46,7 @@ const httpInterceptorProviders: Type<any>[] = [ | ||
42 | ChartComponent, | 46 | ChartComponent, |
43 | TemplatesComponent, | 47 | TemplatesComponent, |
44 | BusStopComponent, | 48 | BusStopComponent, |
49 | + ServiceObjectComponent, | ||
45 | EditorComponent, | 50 | EditorComponent, |
46 | RendererComponent, | 51 | RendererComponent, |
47 | ], // directives, components, and pipes owned by this NgModule | 52 | ], // directives, components, and pipes owned by this NgModule |
@@ -49,6 +54,7 @@ const httpInterceptorProviders: Type<any>[] = [ | @@ -49,6 +54,7 @@ const httpInterceptorProviders: Type<any>[] = [ | ||
49 | BrowserModule, | 54 | BrowserModule, |
50 | AgGridModule.withComponents([ | 55 | AgGridModule.withComponents([ |
51 | BusStopComponent, | 56 | BusStopComponent, |
57 | + ServiceObjectComponent, | ||
52 | EditorComponent, | 58 | EditorComponent, |
53 | RendererComponent, | 59 | RendererComponent, |
54 | ]), | 60 | ]), |
@@ -69,9 +75,11 @@ const httpInterceptorProviders: Type<any>[] = [ | @@ -69,9 +75,11 @@ const httpInterceptorProviders: Type<any>[] = [ | ||
69 | appRoutingProviders, | 75 | appRoutingProviders, |
70 | httpInterceptorProviders, | 76 | httpInterceptorProviders, |
71 | Title, | 77 | Title, |
72 | - BusStopCreateService, | ||
73 | BooleanSelectListService, | 78 | BooleanSelectListService, |
79 | + BusStopCreateService, | ||
74 | BusStopService, | 80 | BusStopService, |
81 | + ServiceObjectCreateService, | ||
82 | + ServiceObjectService | ||
75 | ], // additional providers needed for this module | 83 | ], // additional providers needed for this module |
76 | entryComponents: [ ], | 84 | entryComponents: [ ], |
77 | bootstrap: [ AppComponent ], | 85 | bootstrap: [ AppComponent ], |
src/app/app.routes.ts
@@ -5,6 +5,7 @@ import { DataComponent } from './data/data.component'; | @@ -5,6 +5,7 @@ import { DataComponent } from './data/data.component'; | ||
5 | import { LoginComponent } from './login/login.component'; | 5 | import { LoginComponent } from './login/login.component'; |
6 | import { TemplatesComponent } from './templates/templates.component'; | 6 | 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 { ServiceObjectComponent } from './data/service-object/service-object.component'; | ||
8 | 9 | ||
9 | const routes: Routes = [ | 10 | const routes: Routes = [ |
10 | {path: 'login', component: LoginComponent}, | 11 | {path: 'login', component: LoginComponent}, |
@@ -12,6 +13,7 @@ const routes: Routes = [ | @@ -12,6 +13,7 @@ const routes: Routes = [ | ||
12 | {path: '', component: TemplatesComponent}, | 13 | {path: '', component: TemplatesComponent}, |
13 | {path: 'data', component: DataComponent, children: [ | 14 | {path: 'data', component: DataComponent, children: [ |
14 | {path: 'bus-stop', component: BusStopComponent}, | 15 | {path: 'bus-stop', component: BusStopComponent}, |
16 | + {path: 'service-object', component: ServiceObjectComponent}, | ||
15 | ]}, | 17 | ]}, |
16 | ]}, | 18 | ]}, |
17 | ]; | 19 | ]; |
src/app/data/bus-stop/bus-stop.component.ts
@@ -15,6 +15,7 @@ import { BooleanSelectList } from '../../../models/boolean-select-list'; | @@ -15,6 +15,7 @@ import { BooleanSelectList } from '../../../models/boolean-select-list'; | ||
15 | import { SettlementSelectList } from '../../../models/settlement-select-list'; | 15 | import { SettlementSelectList } from '../../../models/settlement-select-list'; |
16 | import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list'; | 16 | import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list'; |
17 | 17 | ||
18 | +import { routerTransition } from '../../../animations/router.animation'; | ||
18 | 19 | ||
19 | // only import this if you are using the ag-Grid-Enterprise | 20 | // only import this if you are using the ag-Grid-Enterprise |
20 | 21 |
src/app/data/bus-stop/bus-stop.scss
1 | .toolbar button { | 1 | .toolbar button { |
2 | margin: 2px; | 2 | margin: 2px; |
3 | padding: 0; | 3 | padding: 0; |
4 | -} | ||
5 | - | ||
6 | -.control_button { | ||
7 | - position: fixed; | ||
8 | - bottom: 10px; | ||
9 | - right: 10px; | ||
10 | - td-loading { | ||
11 | - width: 56px; | ||
12 | - height: 56px; | ||
13 | - float: left; | ||
14 | - margin-right: 20px; | ||
15 | - .td-loading-wrapper { | ||
16 | - margin-top: -10px; | ||
17 | - } | ||
18 | - } | ||
19 | } | 4 | } |
20 | \ No newline at end of file | 5 | \ No newline at end of file |
src/app/data/data.component.html
@@ -46,7 +46,7 @@ | @@ -46,7 +46,7 @@ | ||
46 | <md-icon md-list-icon>dashboard</md-icon> | 46 | <md-icon md-list-icon>dashboard</md-icon> |
47 | Покриття доріг | 47 | Покриття доріг |
48 | </a> | 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]="['/product']"> | 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> | 50 | <md-icon md-list-icon>dashboard</md-icon> |
51 | Об'єкти сервісу | 51 | Об'єкти сервісу |
52 | </a> | 52 | </a> |
src/app/data/service-object/service-object.component.ts
@@ -10,10 +10,11 @@ import { BooleanSelectListService } from '../../../services/boolean-select-list. | @@ -10,10 +10,11 @@ import { BooleanSelectListService } from '../../../services/boolean-select-list. | ||
10 | import { RegionSelectList } from '../../../models/region-select-list'; | 10 | import { RegionSelectList } from '../../../models/region-select-list'; |
11 | import { StateCommonSelectList } from '../../../models/state-common-select-list'; | 11 | import { StateCommonSelectList } from '../../../models/state-common-select-list'; |
12 | import { RoadSelectList } from '../../../models/road-select-list'; | 12 | import { RoadSelectList } from '../../../models/road-select-list'; |
13 | +import { DepartmentAffiliationList } from '../../../models/department-affiliation-list'; | ||
13 | import { BooleanSelectList } from '../../../models/boolean-select-list'; | 14 | import { BooleanSelectList } from '../../../models/boolean-select-list'; |
14 | import { SettlementSelectList } from '../../../models/settlement-select-list'; | 15 | import { SettlementSelectList } from '../../../models/settlement-select-list'; |
15 | -import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list'; | ||
16 | 16 | ||
17 | +import { routerTransition } from '../../../animations/router.animation'; | ||
17 | 18 | ||
18 | // only import this if you are using the ag-Grid-Enterprise | 19 | // only import this if you are using the ag-Grid-Enterprise |
19 | 20 | ||
@@ -21,16 +22,16 @@ import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list' | @@ -21,16 +22,16 @@ import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list' | ||
21 | selector: 'service-object', | 22 | selector: 'service-object', |
22 | templateUrl: 'service-object.component.html', | 23 | templateUrl: 'service-object.component.html', |
23 | styleUrls: ['service-object.scss'], | 24 | styleUrls: ['service-object.scss'], |
24 | - encapsulation: ViewEncapsulation.None | 25 | + encapsulation: ViewEncapsulation.None, |
25 | }) | 26 | }) |
26 | -export class BusStopComponent { | 27 | +export class ServiceObjectComponent { |
27 | 28 | ||
28 | public showGrid: boolean; | 29 | public showGrid: boolean; |
29 | public rowData: any[]; | 30 | public rowData: any[]; |
30 | public rowCount: string; | 31 | public rowCount: string; |
31 | public regions: RegionSelectList[]; | 32 | public regions: RegionSelectList[]; |
32 | public states: StateCommonSelectList[]; | 33 | public states: StateCommonSelectList[]; |
33 | - public surfaceTypes: SurfaceTypeSelectList[]; | 34 | + public departmentAffiliation: DepartmentAffiliationList[]; |
34 | public settlements: SettlementSelectList[]; | 35 | public settlements: SettlementSelectList[]; |
35 | public roads: RoadSelectList[]; | 36 | public roads: RoadSelectList[]; |
36 | public boolean: BooleanSelectList[]; | 37 | public boolean: BooleanSelectList[]; |
@@ -53,7 +54,7 @@ export class BusStopComponent { | @@ -53,7 +54,7 @@ export class BusStopComponent { | ||
53 | this.dataService.getModels().then(models => { | 54 | this.dataService.getModels().then(models => { |
54 | this.regions = models.regionSelectListDsM as RegionSelectList[]; | 55 | this.regions = models.regionSelectListDsM as RegionSelectList[]; |
55 | this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; | 56 | this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; |
56 | - this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[]; | 57 | + this.departmentAffiliation = models.departmentAffiliationListDsM as DepartmentAffiliationList[]; |
57 | this.settlements = models.settlementSelectListDsM as SettlementSelectList[]; | 58 | this.settlements = models.settlementSelectListDsM as SettlementSelectList[]; |
58 | this.roads = models.roadSelectListDsM as RoadSelectList[]; | 59 | this.roads = models.roadSelectListDsM as RoadSelectList[]; |
59 | }).then(() => { | 60 | }).then(() => { |
@@ -117,7 +118,7 @@ export class BusStopComponent { | @@ -117,7 +118,7 @@ export class BusStopComponent { | ||
117 | }, | 118 | }, |
118 | { | 119 | { |
119 | headerName: 'ID', | 120 | headerName: 'ID', |
120 | - field: 'busStopId', | 121 | + field: 'serviceObjectId', |
121 | }, | 122 | }, |
122 | { | 123 | { |
123 | headerName: 'Назва дороги', | 124 | headerName: 'Назва дороги', |
@@ -152,30 +153,6 @@ export class BusStopComponent { | @@ -152,30 +153,6 @@ export class BusStopComponent { | ||
152 | headerName: 'Місцезнаходження, км+ зліва', | 153 | headerName: 'Місцезнаходження, км+ зліва', |
153 | field: 'locationLeft', | 154 | field: 'locationLeft', |
154 | editable: true, | 155 | editable: true, |
155 | - }, | ||
156 | - { | ||
157 | - headerName: 'Технічний стан', | ||
158 | - field: 'stateCommonId', | ||
159 | - editable: true, | ||
160 | - cellEditorFramework: EditorComponent, | ||
161 | - cellRendererFramework: RendererComponent, | ||
162 | - cellEditorParams: { | ||
163 | - data: this.states, | ||
164 | - valueCol: 'stateCommonId', | ||
165 | - labelCol: 'value' | ||
166 | - } | ||
167 | - }, | ||
168 | - { | ||
169 | - headerName: 'Наявність туалету', | ||
170 | - field: 'toiletAvailability', | ||
171 | - editable: true, | ||
172 | - cellEditorFramework: EditorComponent, | ||
173 | - cellRendererFramework: RendererComponent, | ||
174 | - cellEditorParams: { | ||
175 | - data: this.boolean, | ||
176 | - valueCol: 'value', | ||
177 | - labelCol: 'label' | ||
178 | - } | ||
179 | } | 156 | } |
180 | ]; | 157 | ]; |
181 | } | 158 | } |
src/models/department-affiliation-lis.ts renamed to src/models/department-affiliation-list.ts
src/services/service-object.service.ts
@@ -13,7 +13,7 @@ export class ServiceObjectService { | @@ -13,7 +13,7 @@ export class ServiceObjectService { | ||
13 | getData(): Promise<ServiceObject[]> { | 13 | getData(): Promise<ServiceObject[]> { |
14 | return this.http.get(this.url) | 14 | return this.http.get(this.url) |
15 | .toPromise() | 15 | .toPromise() |
16 | - .then(response => response.json().busStopEditDsM as ServiceObject[]) | 16 | + .then(response => response.json().serviceObjectEditDsM as ServiceObject[]) |
17 | .catch(this.handleError); | 17 | .catch(this.handleError); |
18 | } | 18 | } |
19 | update(id: number, data: string): Promise<any> { | 19 | update(id: number, data: string): Promise<any> { |
src/styles.scss
@@ -21,4 +21,13 @@ a[md-icon-button] { | @@ -21,4 +21,13 @@ a[md-icon-button] { | ||
21 | position: fixed; | 21 | position: fixed; |
22 | bottom: 40px; | 22 | bottom: 40px; |
23 | right: 40px; | 23 | right: 40px; |
24 | + td-loading { | ||
25 | + width: 56px; | ||
26 | + height: 56px; | ||
27 | + float: left; | ||
28 | + margin-right: 20px; | ||
29 | + .td-loading-wrapper { | ||
30 | + margin-top: -10px; | ||
31 | + } | ||
32 | + } | ||
24 | } | 33 | } |
25 | \ No newline at end of file | 34 | \ No newline at end of file |