comparison app/view/form/Messprogramm.js @ 1086:61cc583c3649

Messprogramm form redesign
author Michael Stanko <mstanko@bfs.de>
date Fri, 29 Apr 2016 10:20:05 +0200
parents 116b9629eb2c
children 414f7c9908d6
comparison
equal deleted inserted replaced
1083:cbe5a19449a4 1086:61cc583c3649
12 Ext.define('Lada.view.form.Messprogramm', { 12 Ext.define('Lada.view.form.Messprogramm', {
13 extend: 'Ext.form.Panel', 13 extend: 'Ext.form.Panel',
14 alias: 'widget.messprogrammform', 14 alias: 'widget.messprogrammform',
15 requires: [ 15 requires: [
16 'Lada.view.widget.Datenbasis', 16 'Lada.view.widget.Datenbasis',
17 'Lada.view.widget.base.CheckBox',
17 'Lada.view.widget.Messstelle', 18 'Lada.view.widget.Messstelle',
18 'Lada.view.widget.Netzbetreiber', 19 'Lada.view.widget.Netzbetreiber',
19 'Lada.view.widget.Betriebsart', 20 'Lada.view.widget.Betriebsart',
20 'Lada.view.widget.Testdatensatz',
21 'Lada.view.widget.Probenart', 21 'Lada.view.widget.Probenart',
22 'Lada.view.widget.Umwelt', 22 'Lada.view.widget.Umwelt',
23 'Lada.view.widget.base.TextField', 23 'Lada.view.widget.base.TextField',
24 'Lada.view.widget.base.FieldSet', 24 'Lada.view.widget.base.FieldSet',
25 'Lada.model.Messprogramm', 25 'Lada.model.Messprogramm',
72 action: 'discard', 72 action: 'discard',
73 disabled: true 73 disabled: true
74 }] 74 }]
75 }], 75 }],
76 items: [{ 76 items: [{
77 layout: 'hbox',
78 border: 0,
79 items: [{
80 border: 0, 77 border: 0,
81 width: '50%',
82 minWidth: 290, 78 minWidth: 290,
83 layout: { 79 layout: {
84 type: 'vbox', 80 type: 'vbox',
85 align: 'stretch' 81 align: 'stretch'
86 }, 82 },
87 margin: '0, 10, 0, 0', 83 margin: '0, 10, 0, 0',
88 items: [{ 84 items: [{
89 xtype: 'messstellelabor', 85 layout: {
90 name: 'mstlabor', 86 type: 'hbox',
91 fieldLabel: 'Messstelle/Labor', 87 align: 'stretch'
92 margin: '0, 5, 5, 5', 88 },
93 width: '35%', 89 border: 0,
94 labelWidth: 95, 90 items: [{
95 allowBlank: false, 91 xtype: 'messstellelabor',
96 editable: true, 92 name: 'mstlabor',
97 listeners: { 93 fieldLabel: 'Messstelle/Labor',
98 select: { 94 margin: '0, 5, 5, 5',
99 fn: function(combo, newValue) { 95 width: '35%',
100 var mst = newValue[0].get('messStelle'); 96 labelWidth: 95,
101 var labor = newValue[0].get('laborMst'); 97 allowBlank: false,
102 combo.up('fieldset').down('messstelle[name=mstId]').setValue(mst); 98 editable: true,
103 combo.up('fieldset').down('messstelle[name=laborMstId]').setValue(labor); 99 listeners: {
100 select: {
101 fn: function(combo, newValue) {
102 var mst = newValue[0].get('messStelle');
103 var labor = newValue[0].get('laborMst');
104 combo.up('fieldset').down('messstelle[name=mstId]').setValue(mst);
105 combo.up('fieldset').down('messstelle[name=laborMstId]').setValue(labor);
106 }
104 } 107 }
105 } 108 }
106 } 109 }, {
107 }, { 110 xtype: 'messstelle',
108 xtype: 'messstelle', 111 name: 'mstId',
109 name: 'mstId', 112 fieldLabel: 'Messstelle/Labor',
110 fieldLabel: 'Messstelle/Labor', 113 margin: '0, 5, 5, 5',
111 margin: '0, 5, 5, 5', 114 width: '35%',
112 width: '35%', 115 labelWidth: 95,
113 labelWidth: 95, 116 allowBlank: false,
114 allowBlank: false, 117 editable: true,
115 editable: true, 118 hidden: true
116 hidden: true 119 }, {
117 }, { 120 xtype: 'messstelle',
118 xtype: 'messstelle', 121 name: 'laborMstId',
119 name: 'laborMstId', 122 fieldLabel: 'Messstelle/Labor',
120 fieldLabel: 'Messstelle/Labor', 123 margin: '0, 5, 5, 5',
121 margin: '0, 5, 5, 5', 124 width: '35%',
122 width: '35%', 125 labelWidth: 95,
123 labelWidth: 95, 126 allowBlank: false,
124 allowBlank: false, 127 editable: true,
125 editable: true, 128 hidden: true
126 hidden: true 129 }, {
127 }, { 130 xtype: 'netzbetreiber',
128 xtype: 'tfield', 131 name: 'netzbetreiberId',
129 name: 'name', 132 editable: false,
130 fieldLabel: i18n.getMsg('name'), 133 readOnly: true,
131 labelWidth: 135, 134 fieldLabel: i18n.getMsg('netzbetreiberId'),
132 allowBlank: false, 135 margin : '0, 5, 5, 5',
133 editable: true 136 width : '35%',
134 }, {
135 xtype: 'textarea',
136 name: 'probeKommentar',
137 labelAlign: 'top',
138 fieldLabel: i18n.getMsg('probeKommentar'),
139 labelwidth: 135,
140 anchor: '100%'
141 }, {
142 layout: 'column',
143 border: 0,
144 items: [{
145 xtype: 'location',
146 name: 'ortId',
147 fieldLabel: i18n.getMsg('ortId'),
148 labelWidth: 80, 137 labelWidth: 80,
149 allowBlank: true, 138 }, {
150 forceSelection: true,
151 editable: false,
152 columnWidth: '0.75'
153 }, {
154 xtype: 'button',
155 name: 'ortIdButton',
156 margin: '0 0 0 5',
157 text: i18n.getMsg('messprogrammort.button.title'),
158 action: 'ort',
159 columnWidth: '0.25'
160 }]
161 }]
162 }, {
163 border: 0,
164 width: '50%',
165 minWidth: 300,
166 margin: '0, 1, 0, 0',
167 items: [{
168 xtype: 'fset',
169 title: i18n.getMsg('erwAngaben'),
170 name: 'erwAngaben',
171 collapsible: false,
172 collapsed: false,
173 items: [{
174 xtype: 'datenbasis', 139 xtype: 'datenbasis',
175 editable: false, 140 editable: false,
176 name: 'datenbasisId', 141 name: 'datenbasisId',
177 fieldLabel: i18n.getMsg('datenbasisId'), 142 fieldLabel: i18n.getMsg('datenbasisId'),
143 margin : '0, 5, 5, 5',
144 width : '20%',
145 labelWidth: 65
146 }, {
147 xtype: 'chkbox',
148 name: 'test',
149 fieldLabel: i18n.getMsg('test'),
178 anchor: '100%', 150 anchor: '100%',
179 labelWidth: 105 151 margin : '0, 5, 5, 5',
152 width : '10%',
153 labelWidth: 30,
154 allowBlank: false
155 }]
156 }, {
157 layout: {
158 type: 'hbox',
159 align: 'stretch'
160 },
161 border: 0,
162 items: [{
163 xtype: 'tfield',
164 name: 'name',
165 fieldLabel: i18n.getMsg('mprId'),
166 margin: '0, 5, 5, 5',
167 width: '35%',
168 labelWidth: 95,
169 maxLength: 20,
170 editable: true
180 }, { 171 }, {
181 xtype: 'betriebsart', 172 xtype: 'betriebsart',
182 name: 'baId', 173 name: 'baId',
183 fieldLabel: i18n.getMsg('baId'), 174 fieldLabel: i18n.getMsg('baId'),
184 anchor: '100%', 175 anchor: '100%',
185 labelWidth: 105 176 labelWidth: 105
186 }, { 177 }, {
187 xtype: 'testdatensatz',
188 name: 'test',
189 fieldLabel: i18n.getMsg('test'),
190 anchor: '100%',
191 labelWidth: 105,
192 allowBlank: false
193 }, {
194 xtype: 'probenart', 178 xtype: 'probenart',
195 editable: false, 179 editable: false,
196 name: 'probenartId', 180 name: 'probenartId',
197 fieldLabel: i18n.getMsg('probenartId'), 181 fieldLabel: i18n.getMsg('probenartId'),
198 anchor: '100%', 182 margin: '0, 15, 5, 5',
199 labelWidth: 105, 183 width: '20%',
184 labelWidth: 65,
200 allowBlank: false 185 allowBlank: false
201 }, { 186 }]
202 xtype: 'numberfield', 187 }]
203 allowDecimals: false, 188 }, {
204 name: 'probeNehmerId', 189 // Zeit
205 fieldLabel: i18n.getMsg('probeNehmerId'), 190 xtype: 'fieldset',
206 anchor: '100%', 191 title: i18n.getMsg('probenintervall'),
207 labelWidth: 105 192 layout: {
208 }, { 193 type: 'vbox',
209 xtype: 'netzbetreiber', 194 align: 'stretch'
210 name: 'netzbetreiberId', 195 },
211 editable: false, 196 items: [{
212 readOnly: true, 197 xtype: 'fset',
213 fieldLabel: i18n.getMsg('netzbetreiberId'), 198 name: 'probenIntervallFieldset',
214 anchor: '100%', 199 layout: {
215 labelWidth: 105, 200 type: 'hbox',
216 allowBlank: false 201 align: 'stretch'
217 }] 202 },
203 border: 0,
204 margin: '0, 0, 0, 0',
205 items: [{
206 xtype: 'probenintervall',
207 fieldLabel: i18n.getMsg('probenintervall'),
208 margin: '0, 10, 5, 5',
209 labelWidth: 50,
210 // anchor: '100%',
211 width: '40%',
212 name: 'probenintervall'
213 }, {
214 xtype: 'numberfield',
215 fieldLabel: i18n.getMsg('teilintervallVon'),
216 margin: '0, 10, 5, 10',
217 labelWidth: 90,
218 // anchor: '100%',
219 width: '28%',
220 name: 'teilintervallVon',
221 period: 'start'
222 }, {
223 xtype: 'numberfield',
224 fieldLabel: i18n.getMsg('teilintervallBis'),
225 margin: '0, 15, 5, 5',
226 labelWidth: 18,
227 // anchor: '100%',
228 width: '12%',
229 name: 'teilintervallBis',
230 period: 'end'
231 }, {
232 xtype: 'numberfield',
233 margin: '0, 10, 5, 5',
234 fieldLabel: i18n.getMsg('offset'),
235 labelWidth: 45,
236 // anchor: '100%',
237 width: '18%',
238 name: 'intervallOffset'
239 }]
240 }, {
241 xtype: 'probenintervallslider',
242 // fieldLabel: i18n.getMsg('intervall'),
243 // labelWidth: 70,
244 pack: 'center',
245 width: '70%',
246 margin: '0, 40, 10, 40',
247 // anchor: '950%',
248 values: [0, 0]
249 //this will be overridden
250 // by setRecord
251 }, {
252 xtype: 'fset',
253 name: 'gueltigPeriodFieldset',
254 layout: {
255 type: 'hbox',
256 align: 'stretch'
257 },
258 border: 0,
259 items: [{
260 xtype: 'datetime',
261 fieldLabel: i18n.getMsg('gueltigVon'),
262 margin: '0, 30, 5, 5',
263 labelWidth: 90,
264 // anchor: '100%',
265 name: 'gueltigVon',
266 format: 'd.m.Y',
267 period: 'start'
268 }, {
269 xtype: 'datetime',
270 fieldLabel: i18n.getMsg('gueltigBis'),
271 margin: '0, 5, 5, 5',
272 labelWidth: 40,
273 // anchor: '100%',
274 name: 'gueltigBis',
275 format: 'd.m.Y',
276 period: 'end'
218 }] 277 }]
219 }] 278 }]
220 }, { 279 }, {
221 // Medium 280 // Medium
222 xtype: 'fieldset', 281 xtype: 'fieldset',
223 title: i18n.getMsg('medium'), 282 title: i18n.getMsg('medium'),
283 width: '100%',
224 items: [{ 284 items: [{
225 border: 0, 285 border: 0,
226 layout: { 286 layout: {
227 type: 'vbox', 287 type: 'vbox',
228 align: 'stretch' 288 align: 'stretch'
229 }, 289 },
230 width: '100%', 290 width: '100%',
231 items: [{ 291 items: [{
232 xtype: 'textfield',
233 maxLength: 38,
234 enforceMaxLength: true,
235 name: 'mediaDesk',
236 labelWidth: 125,
237 fieldLabel: i18n.getMsg('mediaDesk'),
238 regex: new RegExp('(?:D: ){1}(?:[0-9]{2} ){11}[0-9]{2}'),
239 regexText: i18n.getMsg('err.msg.deskriptorvalidation'),
240 listeners: {
241 dirtychange: {
242 fn: this.updateOnChange,
243 scope: me
244 }
245 }
246 }, {
247 xtype: 'umwelt', 292 xtype: 'umwelt',
248 name: 'umwId', 293 name: 'umwId',
249 fieldLabel: i18n.getMsg('umwId'), 294 fieldLabel: i18n.getMsg('umwId'),
250 labelWidth: 125, 295 labelWidth: 125,
251 allowBlank: false, 296 allowBlank: false,
255 fn: this.updateOnChange, 300 fn: this.updateOnChange,
256 scope: me 301 scope: me
257 } 302 }
258 } 303 }
259 }, { 304 }, {
305 border: 0,
306 layout: {
307 type: 'hbox',
308 align: 'stretch'
309 },
310 width: '100%',
311 items: [{
312 xtype: 'textfield',
313 maxLength: 38,
314 enforceMaxLength: true,
315 name: 'mediaDesk',
316 width: '60%',
317 labelWidth: 125,
318 fieldLabel: i18n.getMsg('mediaDesk'),
319 editable: false,
320 readOnly: true,
321 listeners: {
322 dirtychange: {
323 fn: this.updateOnChange,
324 scope: me
325 }
326 }
327 }, {
328 xtype: 'textfield',
329 name: 'media',
330 margin: '0, 10, 5, 10',
331 width: '40%',
332 enforceMaxLength: true,
333 editable: false,
334 readOnly: true
335 }]
336 }, {
260 xtype: 'fieldset', 337 xtype: 'fieldset',
261 title: i18n.getMsg('deskDetails'), 338 title: i18n.getMsg('deskDetails'),
262 collapsible: true, 339 collapsible: true,
263 collapsed: true, 340 collapsed: true,
264 defaultType: 'textfield', 341 defaultType: 'textfield',
265 layout: { 342 layout: {
266 type: 'table', 343 type: 'vbox',
267 columns: 3 344 align: 'stretch'
268 }, 345 },
269 items: this.buildDescriptors(), 346 items: this.buildDescriptors(),
270 listeners: { 347 listeners: {
271 dirtychange: { 348 dirtychange: {
272 fn: this.updateOnChange, 349 fn: this.updateOnChange,
274 } 351 }
275 } 352 }
276 }] 353 }]
277 }] 354 }]
278 }, { 355 }, {
279 // Zeit 356 // Ort
280 xtype: 'fieldset', 357 xtype: 'fieldset',
281 title: i18n.getMsg('time'), 358 title: 'Ort',
282 layout: { 359 layout: {
283 type: 'hbox', 360 type: 'hbox',
284 pack: 'center', 361 // pack: 'center',
285 align: 'stretch' 362 align: 'stretch'
286 }, 363 },
364 width: '100%',
287 items: [{ 365 items: [{
288 xtype: 'fset', 366 xtype: 'location',
289 title: i18n.getMsg('validity'), 367 name: 'ortId',
290 name: 'gueltigPeriodFieldset', 368 fieldLabel: i18n.getMsg('ortId'),
291 anchor: '100%', 369 labelWidth: 80,
292 width: '50%', 370 allowBlank: true,
293 margin: '0, 5, 5, 5', 371 forceSelection: true,
294 layout: { 372 editable: false,
295 type: 'vbox', 373 columnWidth: '0.75'
296 align: 'stretch'
297 },
298 items: [{
299 xtype: 'datetime',
300 fieldLabel: i18n.getMsg('gueltigVon'),
301 labelWidth: 90,
302 anchor: '100%',
303 name: 'gueltigVon',
304 format: 'd.m.Y',
305 period: 'start'
306 }, {
307 xtype: 'datetime',
308 fieldLabel: i18n.getMsg('gueltigBis'),
309 labelWidth: 90,
310 anchor: '100%',
311 name: 'gueltigBis',
312 format: 'd.m.Y',
313 period: 'end'
314 }, {
315 xtype: 'numberfield',
316 fieldLabel: i18n.getMsg('offset'),
317 labelWidth: 90,
318 anchor: '100%',
319 name: 'intervallOffset'
320 }]
321 }, { 374 }, {
322 xtype: 'fset', 375 xtype: 'button',
323 title: i18n.getMsg('probenintervall'), 376 name: 'ortIdButton',
324 name: 'probenIntervallFieldset', 377 margin: '0 0 0 5',
325 anchor: '100%', 378 text: i18n.getMsg('messprogrammort.button.title'),
326 width: '50%', 379 action: 'ort',
327 margin: '0, 5, 5, 5', 380 columnWidth: '0.25'
328 layout: {
329 type: 'vbox',
330 align: 'stretch'
331 },
332 items: [{
333 xtype: 'probenintervall',
334 fieldLabel: i18n.getMsg('probenintervall'),
335 labelWidth: 90,
336 anchor: '100%',
337 name: 'probenintervall'
338 }, {
339 xtype: 'numberfield',
340 fieldLabel: i18n.getMsg('teilintervallVon'),
341 labelWidth: 90,
342 anchor: '100%',
343 name: 'teilintervallVon',
344 period: 'start'
345 }, {
346 xtype: 'numberfield',
347 fieldLabel: i18n.getMsg('teilintervallBis'),
348 labelWidth: 90,
349 anchor: '100%',
350 name: 'teilintervallBis',
351 period: 'end'
352 }, {
353 xtype: 'probenintervallslider',
354 fieldLabel: i18n.getMsg('intervall'),
355 labelWidth: 90,
356 anchor: '100%',
357 values: [0, 0]
358 //this will be overridden
359 // by setRecord
360 }]
361 }] 381 }]
382 }, {
383 xtype: 'numberfield',
384 allowDecimals: false,
385 name: 'probeNehmerId',
386 fieldLabel: i18n.getMsg('probeNehmerId'),
387 width: '100%',
388 anchor: '100%',
389 labelWidth: 105
390 }, {
391 xtype: 'textarea',
392 name: 'probeKommentar',
393 labelAlign: 'top',
394 fieldLabel: i18n.getMsg('probeKommentar'),
395 width: '100%',
396 labelwidth: 135,
397 anchor: '100%'
362 }] 398 }]
363 }] 399 }]
364 }]; 400 }];
365 this.callParent(arguments); 401 this.callParent(arguments);
366 }, 402 },
486 return true; 522 return true;
487 } 523 }
488 }); 524 });
489 this.down('messstellelabor').setValue(items.getAt(0)); 525 this.down('messstellelabor').setValue(items.getAt(0));
490 } 526 }
527 // set media field
528 // this.down('media').setValue('XXXX');
491 }, 529 },
492 530
493 setMediaDesk: function(record) { 531 setMediaDesk: function(record) {
494 var media = record.get('mediaDesk').split(' '); 532 var media = record.get('mediaDesk').split(' ');
495 this.setMediaSN(0, media); 533 this.setMediaSN(0, media);
564 clearMessages: function() { 602 clearMessages: function() {
565 // TODO 603 // TODO
566 this.down('cbox[name=mstlabor]').clearWarningOrError(); 604 this.down('cbox[name=mstlabor]').clearWarningOrError();
567 this.down('tfield[name=name]').clearWarningOrError(); 605 this.down('tfield[name=name]').clearWarningOrError();
568 //no clearmsg for probeKommentar 606 //no clearmsg for probeKommentar
569 this.down('fset[name=erwAngaben]').clearMessages();
570 this.down('cbox[name=datenbasisId]').clearWarningOrError(); 607 this.down('cbox[name=datenbasisId]').clearWarningOrError();
571 this.down('cbox[name=baId]').clearWarningOrError(); 608 this.down('cbox[name=baId]').clearWarningOrError();
572 this.down('cbox[name=test]').clearWarningOrError(); 609 this.down('chkbox[name=test]').clearWarningOrError();
573 this.down('cbox[name=probenartId]').clearWarningOrError(); 610 this.down('cbox[name=probenartId]').clearWarningOrError();
574 this.down('cbox[name=netzbetreiberId]').clearWarningOrError(); 611 this.down('cbox[name=netzbetreiberId]').clearWarningOrError();
575 //no clear for probeNehmerId 612 //no clear for probeNehmerId
576 // Deskriptoren are missing 613 // Deskriptoren are missing
577 this.down('cbox[name=umwId]').clearWarningOrError(); 614 this.down('cbox[name=umwId]').clearWarningOrError();

http://lada.wald.intevation.org