Commit 7d063e752435f6353f6f452caf4802627b12c7df
1 parent
06a997f1
add new rows
Showing
3 changed files
with
70 additions
and
9 deletions
Show diff stats
src/app/data/service-object/service-object.component.ts
... | ... | @@ -8,9 +8,9 @@ import { RendererComponent } from '../../../helpers/renderer.component'; |
8 | 8 | import { ServiceObjectCreateService } from '../../../services/service-object-create.service'; |
9 | 9 | import { BooleanSelectListService } from '../../../services/boolean-select-list.service'; |
10 | 10 | import { RegionSelectList } from '../../../models/region-select-list'; |
11 | -import { StateCommonSelectList } from '../../../models/state-common-select-list'; | |
11 | +import { ServiceObjectTypeSelectList } from '../../../models/service-object-type-select-list'; | |
12 | 12 | import { RoadSelectList } from '../../../models/road-select-list'; |
13 | -import { DepartmentAffiliationList } from '../../../models/department-affiliation-list'; | |
13 | +import { DepartmentAffiliationSelectList } from '../../../models/department-affiliation-select-list'; | |
14 | 14 | import { BooleanSelectList } from '../../../models/boolean-select-list'; |
15 | 15 | import { SettlementSelectList } from '../../../models/settlement-select-list'; |
16 | 16 | |
... | ... | @@ -30,8 +30,8 @@ export class ServiceObjectComponent { |
30 | 30 | public rowData: any[]; |
31 | 31 | public rowCount: string; |
32 | 32 | public regions: RegionSelectList[]; |
33 | - public states: StateCommonSelectList[]; | |
34 | - public departmentAffiliation: DepartmentAffiliationList[]; | |
33 | + public serviceObjectType: ServiceObjectTypeSelectList[]; | |
34 | + public departmentAffiliation: DepartmentAffiliationSelectList[]; | |
35 | 35 | public settlements: SettlementSelectList[]; |
36 | 36 | public roads: RoadSelectList[]; |
37 | 37 | public boolean: BooleanSelectList[]; |
... | ... | @@ -53,8 +53,8 @@ export class ServiceObjectComponent { |
53 | 53 | this.booleanService.getModels().then((models) => this.boolean = models); |
54 | 54 | this.dataService.getModels().then((models) => { |
55 | 55 | this.regions = models.regionSelectListDsM as RegionSelectList[]; |
56 | - this.states = models.stateCommonSelectListDsM as StateCommonSelectList[]; | |
57 | - this.departmentAffiliation = models.departmentAffiliationListDsM as DepartmentAffiliationList[]; | |
56 | + this.serviceObjectType = models.serviceObjectTypeSelectListDsM as ServiceObjectTypeSelectList[]; | |
57 | + this.departmentAffiliation = models.departmentAffiliationSelectListDsM as DepartmentAffiliationSelectList[]; | |
58 | 58 | this.settlements = models.settlementSelectListDsM as SettlementSelectList[]; |
59 | 59 | this.roads = models.roadSelectListDsM as RoadSelectList[]; |
60 | 60 | }).then(() => { |
... | ... | @@ -145,6 +145,42 @@ export class ServiceObjectComponent { |
145 | 145 | }, |
146 | 146 | }, |
147 | 147 | { |
148 | + headerName: 'Вид споруди чи об\'єкту', | |
149 | + field: 'serviceObjectTypeId', | |
150 | + editable: true, | |
151 | + cellEditorFramework: EditorComponent, | |
152 | + cellRendererFramework: RendererComponent, | |
153 | + cellEditorParams: { | |
154 | + data: this.serviceObjectType, | |
155 | + valueCol: 'serviceObjectTypeId', | |
156 | + labelCol: 'name', | |
157 | + }, | |
158 | + }, | |
159 | + { | |
160 | + headerName: 'Назва підприємства та населеного пункту', | |
161 | + field: 'settlementId', | |
162 | + editable: true, | |
163 | + cellEditorFramework: EditorComponent, | |
164 | + cellRendererFramework: RendererComponent, | |
165 | + cellEditorParams: { | |
166 | + data: this.settlements, | |
167 | + valueCol: 'settlementId', | |
168 | + labelCol: 'name', | |
169 | + }, | |
170 | + }, | |
171 | + { | |
172 | + headerName: 'Відоча приналежність', | |
173 | + field: 'departmentAffiliationId', | |
174 | + editable: true, | |
175 | + cellEditorFramework: EditorComponent, | |
176 | + cellRendererFramework: RendererComponent, | |
177 | + cellEditorParams: { | |
178 | + data: this.departmentAffiliation, | |
179 | + valueCol: 'departmentAffiliationId', | |
180 | + labelCol: 'name', | |
181 | + }, | |
182 | + }, | |
183 | + { | |
148 | 184 | headerName: 'Місцезнаходження, км+ справа', |
149 | 185 | field: 'locationRight', |
150 | 186 | editable: true, |
... | ... | @@ -154,6 +190,27 @@ export class ServiceObjectComponent { |
154 | 190 | field: 'locationLeft', |
155 | 191 | editable: true, |
156 | 192 | }, |
193 | + { | |
194 | + headerName: 'Місцезнаходження, км+ по осі', | |
195 | + field: 'locationAxis', | |
196 | + editable: true, | |
197 | + }, | |
198 | + { | |
199 | + headerName: 'Відстань до об\'єкту від вісі дор., м', | |
200 | + field: 'distance', | |
201 | + editable: true, | |
202 | + }, | |
203 | + { | |
204 | + headerName: 'Потужність', | |
205 | + field: 'capacity', | |
206 | + editable: true, | |
207 | + }, | |
208 | + { | |
209 | + headerName: 'Елементи облаштування', | |
210 | + field: 'arrangementElements', | |
211 | + editable: true, | |
212 | + cellEditor: 'largeText', | |
213 | + }, | |
157 | 214 | ]; |
158 | 215 | } |
159 | 216 | |
... | ... | @@ -164,7 +221,7 @@ export class ServiceObjectComponent { |
164 | 221 | private onCellValueChanged($event) { |
165 | 222 | if ($event.oldValue !== $event.newValue) { |
166 | 223 | let data = JSON.stringify($event.data); |
167 | - let id = $event.data.busStopId; | |
224 | + let id = $event.data.serviceObjectId; | |
168 | 225 | let result = null; |
169 | 226 | if (id) { |
170 | 227 | this.isLoading = true; |
... | ... | @@ -191,7 +248,7 @@ export class ServiceObjectComponent { |
191 | 248 | return ; |
192 | 249 | } |
193 | 250 | rows.forEach((element) => { |
194 | - let id = element.data.busStopId; | |
251 | + let id = element.data.serviceObjectId; | |
195 | 252 | if (id) { |
196 | 253 | this.isLoading = true; |
197 | 254 | this.service.delete(id).then(() => this.isLoading = false); | ... | ... |
src/models/department-affiliation-list.ts renamed to src/models/department-affiliation-select-list.ts