8084e2dd
Yarik
Bus Stop fatality
|
1
|
import { Component, ViewEncapsulation, AfterViewInit } from '@angular/core';
|
7085f966
Yarik
Validation try
|
2
|
import { TdLoadingService } from '@covalent/core';
|
8084e2dd
Yarik
Bus Stop fatality
|
3
|
import { GridOptions, IGetRowsParams, IRowModel } from 'ag-grid/main';
|
c680f5b4
Administrator
first commit
|
4
|
|
1392e7de
Yarik
Awesome
|
5
6
|
import { StatementBase } from '../../../models/statement.base';
|
c680f5b4
Administrator
first commit
|
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import { BusStopService } from '../../../services/bus-stop.service';
import { BusStop } from '../../../models/bus-stop';
import { EditorComponent } from '../../../helpers/editor.component';
import { RendererComponent } from '../../../helpers/renderer.component';
import { BusStopCreateService } from '../../../services/bus-stop-create.service';
import { BooleanSelectListService } from '../../../services/boolean-select-list.service';
import { RegionSelectList } from '../../../models/region-select-list';
import { StateCommonSelectList } from '../../../models/state-common-select-list';
import { RoadSelectList } from '../../../models/road-select-list';
import { BooleanSelectList } from '../../../models/boolean-select-list';
import { SettlementSelectList } from '../../../models/settlement-select-list';
import { SurfaceTypeSelectList } from '../../../models/surface-type-select-list';
|
c36e5ea5
Administrator
add service-object
|
20
|
import { routerTransition } from '../../../animations/router.animation';
|
c680f5b4
Administrator
first commit
|
21
|
|
c680f5b4
Administrator
first commit
|
22
|
@Component({
|
8ae52ec0
Administrator
add animation fil
|
23
|
// tslint:disable-next-line:component-selector
|
74a2441c
Administrator
Add ServiceObject
|
24
|
selector: 'bus-grid',
|
c680f5b4
Administrator
first commit
|
25
26
|
templateUrl: 'bus-stop.component.html',
styleUrls: ['bus-stop.scss'],
|
7085f966
Yarik
Validation try
|
27
|
encapsulation: ViewEncapsulation.None,
|
c680f5b4
Administrator
first commit
|
28
|
})
|
1392e7de
Yarik
Awesome
|
29
|
export class BusStopComponent extends StatementBase {
|
c680f5b4
Administrator
first commit
|
30
|
|
c680f5b4
Administrator
first commit
|
31
32
33
34
35
36
|
public regions: RegionSelectList[];
public states: StateCommonSelectList[];
public surfaceTypes: SurfaceTypeSelectList[];
public settlements: SettlementSelectList[];
public roads: RoadSelectList[];
public boolean: BooleanSelectList[];
|
c680f5b4
Administrator
first commit
|
37
38
39
|
constructor(
protected service: BusStopService,
|
1392e7de
Yarik
Awesome
|
40
41
42
|
protected dataService: BusStopCreateService,
protected booleanService: BooleanSelectListService,
protected loadingService: TdLoadingService,
|
c680f5b4
Administrator
first commit
|
43
|
) {
|
1392e7de
Yarik
Awesome
|
44
|
super();
|
8084e2dd
Yarik
Bus Stop fatality
|
45
46
|
}
|
1392e7de
Yarik
Awesome
|
47
48
|
protected createColumnDefs(): any[] {
return [
|
c680f5b4
Administrator
first commit
|
49
50
51
52
53
54
|
{
headerName: '#',
width: 30,
checkboxSelection: true,
suppressSorting: true,
suppressMenu: true,
|
8ae52ec0
Administrator
add animation fil
|
55
|
pinned: true,
|
c680f5b4
Administrator
first commit
|
56
57
58
|
},
{
headerName: 'ID',
|
1392e7de
Yarik
Awesome
|
59
|
field: 'id',
|
c680f5b4
Administrator
first commit
|
60
61
62
63
64
65
66
67
68
69
|
},
{
headerName: 'Назва дороги',
field: 'roadId',
editable: true,
cellEditorFramework: EditorComponent,
cellRendererFramework: RendererComponent,
cellEditorParams: {
data: this.roads,
valueCol: 'roadId',
|
8ae52ec0
Administrator
add animation fil
|
70
71
|
labelCol: 'name',
},
|
c680f5b4
Administrator
first commit
|
72
73
74
75
76
77
78
79
80
81
|
},
{
headerName: 'Область',
field: 'regionId',
editable: true,
cellEditorFramework: EditorComponent,
cellRendererFramework: RendererComponent,
cellEditorParams: {
data: this.regions,
valueCol: 'regionId',
|
8ae52ec0
Administrator
add animation fil
|
82
83
|
labelCol: 'name',
},
|
c680f5b4
Administrator
first commit
|
84
85
86
87
88
89
90
91
92
93
94
95
|
},
{
headerName: 'Місцезнаходження, км+ справа',
field: 'locationRight',
editable: true,
},
{
headerName: 'Місцезнаходження, км+ зліва',
field: 'locationLeft',
editable: true,
},
{
|
8f0bd441
Yarik
Fields
|
96
97
98
99
100
101
102
103
|
headerName: 'Тип покриття',
field: 'surfaceTypeId',
editable: true,
cellEditorFramework: EditorComponent,
cellRendererFramework: RendererComponent,
cellEditorParams: {
data: this.surfaceTypes,
valueCol: 'surfaceTypeId',
|
8ae52ec0
Administrator
add animation fil
|
104
105
|
labelCol: 'name',
},
|
8f0bd441
Yarik
Fields
|
106
107
|
},
{
|
c680f5b4
Administrator
first commit
|
108
109
110
111
112
113
114
115
|
headerName: 'Технічний стан',
field: 'stateCommonId',
editable: true,
cellEditorFramework: EditorComponent,
cellRendererFramework: RendererComponent,
cellEditorParams: {
data: this.states,
valueCol: 'stateCommonId',
|
8ae52ec0
Administrator
add animation fil
|
116
117
|
labelCol: 'value',
},
|
c680f5b4
Administrator
first commit
|
118
|
},
|
8f0bd441
Yarik
Fields
|
119
120
121
122
123
124
125
126
127
128
|
,
{
headerName: 'Наявність елементів зупин. майдан',
field: 'areaStopAvailability',
editable: true,
cellEditorFramework: EditorComponent,
cellRendererFramework: RendererComponent,
cellEditorParams: {
data: this.boolean,
valueCol: 'value',
|
8ae52ec0
Administrator
add animation fil
|
129
130
|
labelCol: 'label',
},
|
8f0bd441
Yarik
Fields
|
131
132
133
134
135
136
137
138
139
140
|
},
{
headerName: 'Наявність елементів посад. майдан',
field: 'areaLandAvailability',
editable: true,
cellEditorFramework: EditorComponent,
cellRendererFramework: RendererComponent,
cellEditorParams: {
data: this.boolean,
valueCol: 'value',
|
8ae52ec0
Administrator
add animation fil
|
141
142
|
labelCol: 'label',
},
|
8f0bd441
Yarik
Fields
|
143
144
145
146
147
148
149
150
151
152
|
},
{
headerName: 'Наявність елементів заїзна кишеня',
field: 'pocketAvailability',
editable: true,
cellEditorFramework: EditorComponent,
cellRendererFramework: RendererComponent,
cellEditorParams: {
data: this.boolean,
valueCol: 'value',
|
8ae52ec0
Administrator
add animation fil
|
153
154
|
labelCol: 'label',
},
|
8f0bd441
Yarik
Fields
|
155
|
},
|
c680f5b4
Administrator
first commit
|
156
157
158
159
160
161
162
163
164
|
{
headerName: 'Наявність туалету',
field: 'toiletAvailability',
editable: true,
cellEditorFramework: EditorComponent,
cellRendererFramework: RendererComponent,
cellEditorParams: {
data: this.boolean,
valueCol: 'value',
|
8ae52ec0
Administrator
add animation fil
|
165
166
|
labelCol: 'label',
},
|
8f0bd441
Yarik
Fields
|
167
168
169
170
171
172
173
174
175
176
|
},
{
headerName: 'Рік будівництва',
field: 'yearBuild',
editable: true,
},
{
headerName: 'Рік ремонту',
field: 'yearRepair',
editable: true,
|
8ae52ec0
Administrator
add animation fil
|
177
|
},
|
c680f5b4
Administrator
first commit
|
178
179
|
];
}
|
026fffbd
Yarik
Awesome
|
180
181
182
183
184
185
186
187
188
189
190
191
192
|
protected initFunction(): void {
this.booleanService.getModels().then((models: BooleanSelectList[]) => this.boolean = models);
this.dataService.getModels().then((models: any) => {
this.regions = models.regionSelectListDsM as RegionSelectList[];
this.states = models.stateCommonSelectListDsM as StateCommonSelectList[];
this.surfaceTypes = models.surfaceTypeSelectListDsM as SurfaceTypeSelectList[];
this.settlements = models.settlementSelectListDsM as SettlementSelectList[];
this.roads = models.roadSelectListDsM as RoadSelectList[];
}).then(() => {
this.bootstrapGrid();
});
}
|
c680f5b4
Administrator
first commit
|
193
|
}
|