Commit df66c2075a2c4d76b071f15015aab172b41b26ac

Authored by Yarik
2 parents 8f0bd441 c36e5ea5

Merge branch 'master' of gitlab.artweb.com.ua:root/maps-admin

src/animations/router.animation.ts 0 → 100644
  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 21 import { NgxChartsModule } from '@swimlane/ngx-charts';
22 22  
23 23 import { BusStopComponent } from './data/bus-stop/bus-stop.component';
  24 +import { ServiceObjectComponent } from './data/service-object/service-object.component';
24 25 import { EditorComponent } from '../helpers/editor.component';
25 26 import { RendererComponent } from '../helpers/renderer.component';
26 27  
27 28 // Services
28 29 import { BusStopCreateService } from '../services/bus-stop-create.service';
29   -import { BooleanSelectListService } from '../services/boolean-select-list.service';
30 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 36 const httpInterceptorProviders: Type<any>[] = [
33 37 RequestInterceptor,
... ... @@ -42,6 +46,7 @@ const httpInterceptorProviders: Type&lt;any&gt;[] = [
42 46 ChartComponent,
43 47 TemplatesComponent,
44 48 BusStopComponent,
  49 + ServiceObjectComponent,
45 50 EditorComponent,
46 51 RendererComponent,
47 52 ], // directives, components, and pipes owned by this NgModule
... ... @@ -49,6 +54,7 @@ const httpInterceptorProviders: Type&lt;any&gt;[] = [
49 54 BrowserModule,
50 55 AgGridModule.withComponents([
51 56 BusStopComponent,
  57 + ServiceObjectComponent,
52 58 EditorComponent,
53 59 RendererComponent,
54 60 ]),
... ... @@ -69,9 +75,11 @@ const httpInterceptorProviders: Type&lt;any&gt;[] = [
69 75 appRoutingProviders,
70 76 httpInterceptorProviders,
71 77 Title,
72   - BusStopCreateService,
73 78 BooleanSelectListService,
  79 + BusStopCreateService,
74 80 BusStopService,
  81 + ServiceObjectCreateService,
  82 + ServiceObjectService
75 83 ], // additional providers needed for this module
76 84 entryComponents: [ ],
77 85 bootstrap: [ AppComponent ],
... ...
src/app/app.routes.ts
... ... @@ -5,6 +5,7 @@ import { DataComponent } from &#39;./data/data.component&#39;;
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 { ServiceObjectComponent } from './data/service-object/service-object.component';
8 9  
9 10 const routes: Routes = [
10 11 {path: 'login', component: LoginComponent},
... ... @@ -12,6 +13,7 @@ const routes: Routes = [
12 13 {path: '', component: TemplatesComponent},
13 14 {path: 'data', component: DataComponent, children: [
14 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 &#39;../../../models/boolean-select-list&#39;;
15 15 import { SettlementSelectList } from '../../../models/settlement-select-list';
16 16 import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list';
17 17  
  18 +import { routerTransition } from '../../../animations/router.animation';
18 19  
19 20 // only import this if you are using the ag-Grid-Enterprise
20 21  
... ...
src/app/data/bus-stop/bus-stop.scss
1 1 .toolbar button {
2 2 margin: 2px;
3 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 5 \ No newline at end of file
... ...
src/app/data/data.component.html
... ... @@ -46,7 +46,7 @@
46 46 <md-icon md-list-icon>dashboard</md-icon>
47 47 Покриття доріг
48 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 50 <md-icon md-list-icon>dashboard</md-icon>
51 51 Об'єкти сервісу
52 52 </a>
... ...
src/app/data/service-object/service-object.component.ts
... ... @@ -10,10 +10,11 @@ import { BooleanSelectListService } from &#39;../../../services/boolean-select-list.
10 10 import { RegionSelectList } from '../../../models/region-select-list';
11 11 import { StateCommonSelectList } from '../../../models/state-common-select-list';
12 12 import { RoadSelectList } from '../../../models/road-select-list';
  13 +import { DepartmentAffiliationList } from '../../../models/department-affiliation-list';
13 14 import { BooleanSelectList } from '../../../models/boolean-select-list';
14 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 19 // only import this if you are using the ag-Grid-Enterprise
19 20  
... ... @@ -21,16 +22,16 @@ import { SurfaceTypeSelectList } from &#39;../../../models/surface-type-select-list&#39;
21 22 selector: 'service-object',
22 23 templateUrl: 'service-object.component.html',
23 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 29 public showGrid: boolean;
29 30 public rowData: any[];
30 31 public rowCount: string;
31 32 public regions: RegionSelectList[];
32 33 public states: StateCommonSelectList[];
33   - public surfaceTypes: SurfaceTypeSelectList[];
  34 + public departmentAffiliation: DepartmentAffiliationList[];
34 35 public settlements: SettlementSelectList[];
35 36 public roads: RoadSelectList[];
36 37 public boolean: BooleanSelectList[];
... ... @@ -53,7 +54,7 @@ export class BusStopComponent {
53 54 this.dataService.getModels().then(models => {
54 55 this.regions = models.regionSelectListDsM as RegionSelectList[];
55 56 this.states = models.stateCommonSelectListDsM as StateCommonSelectList[];
56   - this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[];
  57 + this.departmentAffiliation = models.departmentAffiliationListDsM as DepartmentAffiliationList[];
57 58 this.settlements = models.settlementSelectListDsM as SettlementSelectList[];
58 59 this.roads = models.roadSelectListDsM as RoadSelectList[];
59 60 }).then(() => {
... ... @@ -117,7 +118,7 @@ export class BusStopComponent {
117 118 },
118 119 {
119 120 headerName: 'ID',
120   - field: 'busStopId',
  121 + field: 'serviceObjectId',
121 122 },
122 123 {
123 124 headerName: 'Назва дороги',
... ... @@ -152,30 +153,6 @@ export class BusStopComponent {
152 153 headerName: 'Місцезнаходження, км+ зліва',
153 154 field: 'locationLeft',
154 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
1   -export class DepartmentAffiliationLis {
  1 +export class DepartmentAffiliationList {
2 2 departmentAffiliationId: number;
3 3 name: string;
4 4 }
... ...
src/services/service-object.service.ts
... ... @@ -13,7 +13,7 @@ export class ServiceObjectService {
13 13 getData(): Promise<ServiceObject[]> {
14 14 return this.http.get(this.url)
15 15 .toPromise()
16   - .then(response => response.json().busStopEditDsM as ServiceObject[])
  16 + .then(response => response.json().serviceObjectEditDsM as ServiceObject[])
17 17 .catch(this.handleError);
18 18 }
19 19 update(id: number, data: string): Promise<any> {
... ...
src/styles.scss
... ... @@ -21,4 +21,13 @@ a[md-icon-button] {
21 21 position: fixed;
22 22 bottom: 40px;
23 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 34 \ No newline at end of file
... ...