Commit 8ae52ec0f6cb7814eb66ec2c30ab3ccf7c55ff8c

Authored by Administrator
1 parent 781dc1c9

add animation fil

@@ -23,7 +23,7 @@ @@ -23,7 +23,7 @@
23 "../node_modules/@covalent/core/common/platform.css", 23 "../node_modules/@covalent/core/common/platform.css",
24 "../node_modules/@swimlane/ngx-charts/release/ngx-charts.css", 24 "../node_modules/@swimlane/ngx-charts/release/ngx-charts.css",
25 "../node_modules/ag-grid/dist/styles/ag-grid.css", 25 "../node_modules/ag-grid/dist/styles/ag-grid.css",
26 - "../node_modules/ag-grid/dist/styles/theme-dark.css" 26 + "../node_modules/ag-grid/dist/styles/theme-blue.css"
27 ], 27 ],
28 "scripts": [ 28 "scripts": [
29 "../node_modules/hammerjs/hammer.min.js", 29 "../node_modules/hammerjs/hammer.min.js",
src/animations/router.animation.ts
1 import {trigger, state, animate, style, transition} from '@angular/core'; 1 import {trigger, state, animate, style, transition} from '@angular/core';
2 2
  3 +// tslint:disable-next-line:typedef
3 export function routerTransition() { 4 export function routerTransition() {
4 return trigger('routerTransition', [ 5 return trigger('routerTransition', [
5 - state('void', style({position:'absolute', width:'1000px', height:'1000px'}) ),  
6 - state('*', style({position:'absolute', width:'1000px', height:'1000px'}) ), 6 + state('void', style({position: 'absolute', width: '100%', height: '100%', opacity: '1'}) ),
  7 + state('*', style({position: 'absolute', width: '100%', height: '100%', opacity: '1'}) ),
7 transition(':enter', [ 8 transition(':enter', [
8 - style({transform: 'translateY(-100%)'}),  
9 - animate('0.5s ease-in-out', style({transform: 'translateY(0%)'})) 9 + style({opacity: '0.5'}),
  10 + animate('0.6s ease-in-out', style({opacity: '1'})),
10 ]), 11 ]),
11 transition(':leave', [ 12 transition(':leave', [
12 - style({transform: 'translateY(0%)'}),  
13 - animate('0.5s ease-in-out', style({transform: 'translateY(100%)'}))  
14 - ]) 13 + style({transform: 'translateX(0%)', opacity: '1'}),
  14 + animate('0.6s ease-in-out', style({transform: 'translateX(100%)', opacity: '0.5'})),
  15 + ]),
15 ]); 16 ]);
16 } 17 }
src/app/data/bus-stop/bus-stop.component.html
1 <div class="grid_containert" *ngIf="showGrid"> 1 <div class="grid_containert" *ngIf="showGrid">
2 - <ag-grid-ng2 #agGrid style="width: 100%; height: 100%;" class="ag-dark" [gridOptions]="gridOptions" [columnDefs]="columnDefs" [rowData]="rowData" enableColResize enableSorting enableFilter groupHeaders suppressRowClickSelection toolPanelSuppressGroups 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)" 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()" 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)"> 5 (beforeSortChanged)="onBeforeSortChanged()" (afterSortChanged)="onAfterSortChanged()" (virtualRowRemoved)="onVirtualRowRemoved($event)" (rowClicked)="onRowClicked($event)">
src/app/data/bus-stop/bus-stop.component.ts
@@ -20,6 +20,7 @@ import { routerTransition } from &#39;../../../animations/router.animation&#39;; @@ -20,6 +20,7 @@ import { routerTransition } from &#39;../../../animations/router.animation&#39;;
20 // only import this if you are using the ag-Grid-Enterprise 20 // only import this if you are using the ag-Grid-Enterprise
21 21
22 @Component({ 22 @Component({
  23 + // tslint:disable-next-line:component-selector
23 selector: 'bus-grid', 24 selector: 'bus-grid',
24 templateUrl: 'bus-stop.component.html', 25 templateUrl: 'bus-stop.component.html',
25 styleUrls: ['bus-stop.scss'], 26 styleUrls: ['bus-stop.scss'],
@@ -53,7 +54,7 @@ export class BusStopComponent { @@ -53,7 +54,7 @@ export class BusStopComponent {
53 this.showGrid = true; 54 this.showGrid = true;
54 this.gridOptions.rowModelType = 'virtual'; 55 this.gridOptions.rowModelType = 'virtual';
55 this.booleanService.getModels().then((models) => this.boolean = models); 56 this.booleanService.getModels().then((models) => this.boolean = models);
56 - this.dataService.getModels().then(models => { 57 + this.dataService.getModels().then((models) => {
57 this.regions = models.regionSelectListDsM as RegionSelectList[]; 58 this.regions = models.regionSelectListDsM as RegionSelectList[];
58 this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; 59 this.states = models.stateCommonSelectListDsM as StateCommonSelectList[];
59 this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[]; 60 this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[];
@@ -75,10 +76,10 @@ export class BusStopComponent { @@ -75,10 +76,10 @@ export class BusStopComponent {
75 }); 76 });
76 } 77 }
77 setRowData(allOfTheData) { 78 setRowData(allOfTheData) {
  79 + // tslint:disable-next-line:typedef
78 let dataSource = { 80 let dataSource = {
79 rowCount: null, // behave as infinite scroll 81 rowCount: null, // behave as infinite scroll
80 getRows: function (params) { 82 getRows: function (params) {
81 - console.log('asking for ' + params.startRow + ' to ' + params.endRow);  
82 // At this point in your code, you would call the server, using $http if in AngularJS. 83 // At this point in your code, you would call the server, using $http if in AngularJS.
83 // To make the demo look real, wait for 500ms before returning 84 // To make the demo look real, wait for 500ms before returning
84 // take a slice of the total rows 85 // take a slice of the total rows
@@ -90,7 +91,7 @@ export class BusStopComponent { @@ -90,7 +91,7 @@ export class BusStopComponent {
90 } 91 }
91 // call the success callback 92 // call the success callback
92 params.successCallback(rowsThisPage, lastRow); 93 params.successCallback(rowsThisPage, lastRow);
93 - } 94 + },
94 }; 95 };
95 return dataSource; 96 return dataSource;
96 } 97 }
@@ -127,7 +128,7 @@ export class BusStopComponent { @@ -127,7 +128,7 @@ export class BusStopComponent {
127 checkboxSelection: true, 128 checkboxSelection: true,
128 suppressSorting: true, 129 suppressSorting: true,
129 suppressMenu: true, 130 suppressMenu: true,
130 - pinned: true 131 + pinned: true,
131 }, 132 },
132 { 133 {
133 headerName: 'ID', 134 headerName: 'ID',
@@ -142,8 +143,8 @@ export class BusStopComponent { @@ -142,8 +143,8 @@ export class BusStopComponent {
142 cellEditorParams: { 143 cellEditorParams: {
143 data: this.roads, 144 data: this.roads,
144 valueCol: 'roadId', 145 valueCol: 'roadId',
145 - labelCol: 'name'  
146 - } 146 + labelCol: 'name',
  147 + },
147 }, 148 },
148 { 149 {
149 headerName: 'Область', 150 headerName: 'Область',
@@ -154,8 +155,8 @@ export class BusStopComponent { @@ -154,8 +155,8 @@ export class BusStopComponent {
154 cellEditorParams: { 155 cellEditorParams: {
155 data: this.regions, 156 data: this.regions,
156 valueCol: 'regionId', 157 valueCol: 'regionId',
157 - labelCol: 'name'  
158 - } 158 + labelCol: 'name',
  159 + },
159 }, 160 },
160 { 161 {
161 headerName: 'Місцезнаходження, км+ справа', 162 headerName: 'Місцезнаходження, км+ справа',
@@ -176,8 +177,8 @@ export class BusStopComponent { @@ -176,8 +177,8 @@ export class BusStopComponent {
176 cellEditorParams: { 177 cellEditorParams: {
177 data: this.surfaceTypes, 178 data: this.surfaceTypes,
178 valueCol: 'surfaceTypeId', 179 valueCol: 'surfaceTypeId',
179 - labelCol: 'name'  
180 - } 180 + labelCol: 'name',
  181 + },
181 }, 182 },
182 { 183 {
183 headerName: 'Технічний стан', 184 headerName: 'Технічний стан',
@@ -188,8 +189,8 @@ export class BusStopComponent { @@ -188,8 +189,8 @@ export class BusStopComponent {
188 cellEditorParams: { 189 cellEditorParams: {
189 data: this.states, 190 data: this.states,
190 valueCol: 'stateCommonId', 191 valueCol: 'stateCommonId',
191 - labelCol: 'value'  
192 - } 192 + labelCol: 'value',
  193 + },
193 }, 194 },
194 , 195 ,
195 { 196 {
@@ -201,8 +202,8 @@ export class BusStopComponent { @@ -201,8 +202,8 @@ export class BusStopComponent {
201 cellEditorParams: { 202 cellEditorParams: {
202 data: this.boolean, 203 data: this.boolean,
203 valueCol: 'value', 204 valueCol: 'value',
204 - labelCol: 'label'  
205 - } 205 + labelCol: 'label',
  206 + },
206 }, 207 },
207 { 208 {
208 headerName: 'Наявність елементів посад. майдан', 209 headerName: 'Наявність елементів посад. майдан',
@@ -213,8 +214,8 @@ export class BusStopComponent { @@ -213,8 +214,8 @@ export class BusStopComponent {
213 cellEditorParams: { 214 cellEditorParams: {
214 data: this.boolean, 215 data: this.boolean,
215 valueCol: 'value', 216 valueCol: 'value',
216 - labelCol: 'label'  
217 - } 217 + labelCol: 'label',
  218 + },
218 }, 219 },
219 { 220 {
220 headerName: 'Наявність елементів заїзна кишеня', 221 headerName: 'Наявність елементів заїзна кишеня',
@@ -225,8 +226,8 @@ export class BusStopComponent { @@ -225,8 +226,8 @@ export class BusStopComponent {
225 cellEditorParams: { 226 cellEditorParams: {
226 data: this.boolean, 227 data: this.boolean,
227 valueCol: 'value', 228 valueCol: 'value',
228 - labelCol: 'label'  
229 - } 229 + labelCol: 'label',
  230 + },
230 }, 231 },
231 { 232 {
232 headerName: 'Наявність туалету', 233 headerName: 'Наявність туалету',
@@ -237,8 +238,8 @@ export class BusStopComponent { @@ -237,8 +238,8 @@ export class BusStopComponent {
237 cellEditorParams: { 238 cellEditorParams: {
238 data: this.boolean, 239 data: this.boolean,
239 valueCol: 'value', 240 valueCol: 'value',
240 - labelCol: 'label'  
241 - } 241 + labelCol: 'label',
  242 + },
242 }, 243 },
243 { 244 {
244 headerName: 'Рік будівництва', 245 headerName: 'Рік будівництва',
@@ -249,7 +250,7 @@ export class BusStopComponent { @@ -249,7 +250,7 @@ export class BusStopComponent {
249 headerName: 'Рік ремонту', 250 headerName: 'Рік ремонту',
250 field: 'yearRepair', 251 field: 'yearRepair',
251 editable: true, 252 editable: true,
252 - } 253 + },
253 ]; 254 ];
254 } 255 }
255 256
@@ -286,7 +287,7 @@ export class BusStopComponent { @@ -286,7 +287,7 @@ export class BusStopComponent {
286 if (!rows.length) { 287 if (!rows.length) {
287 return ; 288 return ;
288 } 289 }
289 - rows.forEach(element => { 290 + rows.forEach((element) => {
290 let id = element.data.busStopId; 291 let id = element.data.busStopId;
291 if (id) { 292 if (id) {
292 this.enableLoader(); 293 this.enableLoader();
@@ -301,7 +302,7 @@ export class BusStopComponent { @@ -301,7 +302,7 @@ export class BusStopComponent {
301 return 1; 302 return 1;
302 } 303 }
303 }); 304 });
304 - sorted.forEach(item => { 305 + sorted.forEach((item) => {
305 this.rowData.splice(item.rowIndex, 1); 306 this.rowData.splice(item.rowIndex, 1);
306 }); 307 });
307 this.gridOptions.api.setDatasource(this.setRowData(this.rowData)); 308 this.gridOptions.api.setDatasource(this.setRowData(this.rowData));
src/app/data/service-object/service-object.component.html
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <div *ngIf="isLoading" class=""> 2 <div *ngIf="isLoading" class="">
3 ...Loading 3 ...Loading
4 </div> 4 </div>
5 - <ag-grid-ng2 #agGrid style="width: 100%; height: 100%;" class="ag-dark" [gridOptions]="gridOptions" [columnDefs]="columnDefs" [rowData]="rowData" enableColResize enableSorting enableFilter groupHeaders suppressRowClickSelection toolPanelSuppressGroups 5 + <ag-grid-ng2 #agGrid style="width: 100%; height: 100%;" class="ag-blue" [gridOptions]="gridOptions" [columnDefs]="columnDefs" [rowData]="rowData" enableColResize enableSorting enableFilter groupHeaders suppressRowClickSelection toolPanelSuppressGroups
6 toolPanelSuppressValues debug rowHeight="22" rowSelection="multiple" (cellClicked)="onCellClicked($event)" (cellDoubleClicked)="onCellDoubleClicked($event)" (cellContextMenu)="onCellContextMenu($event)" (cellValueChanged)="onCellValueChanged($event)" 6 toolPanelSuppressValues debug rowHeight="22" rowSelection="multiple" (cellClicked)="onCellClicked($event)" (cellDoubleClicked)="onCellDoubleClicked($event)" (cellContextMenu)="onCellContextMenu($event)" (cellValueChanged)="onCellValueChanged($event)"
7 (cellFocused)="onCellFocused($event)" (rowSelected)="onRowSelected($event)" (selectionChanged)="onSelectionChanged()" (beforeFilterChanged)="onBeforeFilterChanged()" (afterFilterChanged)="onAfterFilterChanged()" (filterModified)="onFilterModified()" 7 (cellFocused)="onCellFocused($event)" (rowSelected)="onRowSelected($event)" (selectionChanged)="onSelectionChanged()" (beforeFilterChanged)="onBeforeFilterChanged()" (afterFilterChanged)="onAfterFilterChanged()" (filterModified)="onFilterModified()"
8 (beforeSortChanged)="onBeforeSortChanged()" (afterSortChanged)="onAfterSortChanged()" (virtualRowRemoved)="onVirtualRowRemoved($event)" (rowClicked)="onRowClicked($event)"> 8 (beforeSortChanged)="onBeforeSortChanged()" (afterSortChanged)="onAfterSortChanged()" (virtualRowRemoved)="onVirtualRowRemoved($event)" (rowClicked)="onRowClicked($event)">
src/app/data/service-object/service-object.component.ts
1 -import {Component, ViewEncapsulation} from "@angular/core";  
2 -import {GridOptions} from "ag-grid/main"; 1 +import {Component, ViewEncapsulation} from '@angular/core';
  2 +import {GridOptions} from 'ag-grid/main';
3 3
4 import { ServiceObjectService } from '../../../services/service-object.service'; 4 import { ServiceObjectService } from '../../../services/service-object.service';
5 import { ServiceObject } from '../../../models/service-object'; 5 import { ServiceObject } from '../../../models/service-object';
@@ -44,14 +44,14 @@ export class ServiceObjectComponent { @@ -44,14 +44,14 @@ export class ServiceObjectComponent {
44 constructor( 44 constructor(
45 protected service: ServiceObjectService, 45 protected service: ServiceObjectService,
46 private dataService: ServiceObjectCreateService, 46 private dataService: ServiceObjectCreateService,
47 - private booleanService: BooleanSelectListService 47 + private booleanService: BooleanSelectListService,
48 ) { 48 ) {
49 this.gridOptions = <GridOptions>{}; 49 this.gridOptions = <GridOptions>{};
50 - this.gridOptions.enableSorting = true;  
51 - this.showGrid = true;  
52 - this.gridOptions.rowModelType = 'virtual';  
53 - this.booleanService.getModels().then((models) => this.boolean = models);  
54 - this.dataService.getModels().then(models => { 50 + this.gridOptions.enableSorting = true;
  51 + this.showGrid = true;
  52 + this.gridOptions.rowModelType = 'virtual';
  53 + this.booleanService.getModels().then((models) => this.boolean = models);
  54 + this.dataService.getModels().then((models) => {
55 this.regions = models.regionSelectListDsM as RegionSelectList[]; 55 this.regions = models.regionSelectListDsM as RegionSelectList[];
56 this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; 56 this.states = models.stateCommonSelectListDsM as StateCommonSelectList[];
57 this.departmentAffiliation = models.departmentAffiliationListDsM as DepartmentAffiliationList[]; 57 this.departmentAffiliation = models.departmentAffiliationListDsM as DepartmentAffiliationList[];
@@ -61,7 +61,7 @@ export class ServiceObjectComponent { @@ -61,7 +61,7 @@ export class ServiceObjectComponent {
61 this.createColumnDefs(); 61 this.createColumnDefs();
62 this.isBootstrapping = false; 62 this.isBootstrapping = false;
63 }); 63 });
64 - this.service.getData().then((data) => { 64 + this.service.getData().then((data) => {
65 if (data.length){ 65 if (data.length){
66 this.rowData = data; 66 this.rowData = data;
67 } else { 67 } else {
@@ -88,7 +88,7 @@ export class ServiceObjectComponent { @@ -88,7 +88,7 @@ export class ServiceObjectComponent {
88 } 88 }
89 // call the success callback 89 // call the success callback
90 params.successCallback(rowsThisPage, lastRow); 90 params.successCallback(rowsThisPage, lastRow);
91 - } 91 + },
92 }; 92 };
93 return dataSource; 93 return dataSource;
94 94
@@ -114,7 +114,7 @@ export class ServiceObjectComponent { @@ -114,7 +114,7 @@ export class ServiceObjectComponent {
114 checkboxSelection: true, 114 checkboxSelection: true,
115 suppressSorting: true, 115 suppressSorting: true,
116 suppressMenu: true, 116 suppressMenu: true,
117 - pinned: true 117 + pinned: true,
118 }, 118 },
119 { 119 {
120 headerName: 'ID', 120 headerName: 'ID',
@@ -129,8 +129,8 @@ export class ServiceObjectComponent { @@ -129,8 +129,8 @@ export class ServiceObjectComponent {
129 cellEditorParams: { 129 cellEditorParams: {
130 data: this.roads, 130 data: this.roads,
131 valueCol: 'roadId', 131 valueCol: 'roadId',
132 - labelCol: 'name'  
133 - } 132 + labelCol: 'name',
  133 + },
134 }, 134 },
135 { 135 {
136 headerName: 'Область', 136 headerName: 'Область',
@@ -141,8 +141,8 @@ export class ServiceObjectComponent { @@ -141,8 +141,8 @@ export class ServiceObjectComponent {
141 cellEditorParams: { 141 cellEditorParams: {
142 data: this.regions, 142 data: this.regions,
143 valueCol: 'regionId', 143 valueCol: 'regionId',
144 - labelCol: 'name'  
145 - } 144 + labelCol: 'name',
  145 + },
146 }, 146 },
147 { 147 {
148 headerName: 'Місцезнаходження, км+ справа', 148 headerName: 'Місцезнаходження, км+ справа',
@@ -153,7 +153,7 @@ export class ServiceObjectComponent { @@ -153,7 +153,7 @@ export class ServiceObjectComponent {
153 headerName: 'Місцезнаходження, км+ зліва', 153 headerName: 'Місцезнаходження, км+ зліва',
154 field: 'locationLeft', 154 field: 'locationLeft',
155 editable: true, 155 editable: true,
156 - } 156 + },
157 ]; 157 ];
158 } 158 }
159 159
@@ -164,7 +164,7 @@ export class ServiceObjectComponent { @@ -164,7 +164,7 @@ export class ServiceObjectComponent {
164 private onCellValueChanged($event) { 164 private onCellValueChanged($event) {
165 if ($event.oldValue !== $event.newValue) { 165 if ($event.oldValue !== $event.newValue) {
166 let data = JSON.stringify($event.data); 166 let data = JSON.stringify($event.data);
167 - let id = $event.data.serviceObjectId; 167 + let id = $event.data.busStopId;
168 let result = null; 168 let result = null;
169 if (id) { 169 if (id) {
170 this.isLoading = true; 170 this.isLoading = true;
@@ -175,8 +175,8 @@ export class ServiceObjectComponent { @@ -175,8 +175,8 @@ export class ServiceObjectComponent {
175 return ; 175 return ;
176 } 176 }
177 this.isLoading = true; 177 this.isLoading = true;
178 - result = this.service.create(data).then((serviceObject) => {  
179 - this.rowData[$event.node.rowIndex] = serviceObject; 178 + result = this.service.create(data).then((busStop) => {
  179 + this.rowData[$event.node.rowIndex] = busStop;
180 this.gridOptions.api.setDatasource(this.setRowData(this.rowData)); 180 this.gridOptions.api.setDatasource(this.setRowData(this.rowData));
181 this.gridOptions.api.refreshVirtualPageCache(); 181 this.gridOptions.api.refreshVirtualPageCache();
182 this.isLoading = false; 182 this.isLoading = false;
@@ -190,8 +190,8 @@ export class ServiceObjectComponent { @@ -190,8 +190,8 @@ export class ServiceObjectComponent {
190 if (!rows.length) { 190 if (!rows.length) {
191 return ; 191 return ;
192 } 192 }
193 - rows.forEach(element => {  
194 - let id = element.data.serviceObjectId; 193 + rows.forEach((element) => {
  194 + let id = element.data.busStopId;
195 if (id) { 195 if (id) {
196 this.isLoading = true; 196 this.isLoading = true;
197 this.service.delete(id).then(() => this.isLoading = false); 197 this.service.delete(id).then(() => this.isLoading = false);
@@ -205,7 +205,7 @@ export class ServiceObjectComponent { @@ -205,7 +205,7 @@ export class ServiceObjectComponent {
205 return 1; 205 return 1;
206 } 206 }
207 }); 207 });
208 - sorted.forEach(item => { 208 + sorted.forEach((item) => {
209 this.rowData.splice(item.rowIndex, 1); 209 this.rowData.splice(item.rowIndex, 1);
210 }); 210 });
211 this.gridOptions.api.setDatasource(this.setRowData(this.rowData)); 211 this.gridOptions.api.setDatasource(this.setRowData(this.rowData));
@@ -273,4 +273,3 @@ export class ServiceObjectComponent { @@ -273,4 +273,3 @@ export class ServiceObjectComponent {
273 console.log('onColumnEvent: ' + $event); 273 console.log('onColumnEvent: ' + $event);
274 } 274 }
275 } 275 }
276 -ServiceObject  
277 \ No newline at end of file 276 \ No newline at end of file