ru.coon 2.5.24 → 2.5.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ # Version 2.5.26, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/da7767ea8d5507d8b2081aeaf13f46c21010f0d2)
2
+ * ## Features
3
+ * <span style='color:green'>feat: TR-67310 исправление ситуации когда defaultFocus на поле в состоянии disabled приводит к возврату фокуса на предыдущий элемент</span> ([335b93], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/335b9374874e2406e6f5c80daada6ba49eef05dc))
4
+
5
+ * minor changes ([b4067a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b4067ab11832201616725d3f60a48e647a30d3bd))
6
+ * update: CHANGELOG.md ([c39291], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c3929159ea685f05c9011c520b7f476d0fe57329))
7
+
8
+ # Version 2.5.25, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/598185e8f86f9268fd2b75354a0807450368af05)
9
+ * ## Features
10
+ * <span style='color:green'>feat: HT-6865 доработка сервиса начитывания репортов</span> ([d5204c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d5204c0e6470e9f4858b800da4bfb779bd9d3d6a))
11
+
12
+ * update: CHANGELOG.md ([e8d820], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e8d82018b4cb33252c4bc997473449a4bf9d94a0))
13
+
1
14
  # Version 2.5.24, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3a89ea72764c21d224fa2cf1142900d4c501320c)
2
15
  * Изменение параметров в codeVault/generateToken ([c84009], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c840092274cb1288ae5158b81f13b6f8531c28c8))
3
16
  * update: CHANGELOG.md ([d6a80a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d6a80a310c7693fc0ac43b3a2f97e6aec24c4b33))
@@ -125,6 +138,7 @@ ReportPropertiesPanelController.buildPropertiesTreeData was losing property "key
125
138
  * always initialize this.plugins ([49db6e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/49db6edec0edb898ea0dd53c952da581c0be91a0))
126
139
  * revert changes ([fc528a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fc528a2298acf08d8ab4cce8d84accad7dc1e33e))
127
140
  * revert changes ([4e4a73], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4e4a73bb5432c6fcac589b34b001d8aa401c5477))
141
+ * TR-66400 Добавлен триггер очистки. Убрана неиспользуемая переменная. Исправлена ошибка логики выполнения проверки существованию UI элемента. ([b53382], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b53382c2eb9228c55a948ce365aeff177e3ad857))
128
142
  * update: CHANGELOG.md ([3f5713], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3f5713a9a003bd789e7595388f94ec54c17c19d4))
129
143
 
130
144
  # Version 2.5.12, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/604d178d5d06bbc2ccd6a9c288b56a7faf189caa)
@@ -362,17 +376,22 @@ ReportSqlPreviewPanel - add UiAceEditor as sql preview field(readOnly) with sql
362
376
 
363
377
  # Version 2.4.26, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/01cf615efd9ec98124fa8f776062845bd4dda7f2)
364
378
  * ## Features
379
+ * <span style='color:green'>feat: Редактирование UI_ELEMENT_CD actionColumn</span> ([d1847b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d1847b90aa40ac560653429a0ebe936fd5ca37f0))
365
380
  * <span style='color:green'>feat: TR-66555: do lint and disable edit button on iframe load</span> ([563e0d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/563e0da0c2ea38d60e156a7aab11e1009c70c013))
366
381
 
367
382
  * ## Fixes
368
383
  * <span style='color:red'> CharacteristicGridCopyPlugin plugin adding</span> ([461a41], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/461a413ce7325de72a196e5eb87a88cef405e6e0))
384
+ * <span style='color:red'>fix update value</span> ([8636c3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8636c33a47e42496027abd48255dc0a66572d899))
385
+ * <span style='color:red'>fix update value</span> ([610ad2], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/610ad2bd75c74ccd7ddb98428f6126b61fe2b247))
369
386
 
370
387
  * add css class for ParameterizedReportCombo ([8082ac], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8082ac2b8be7b512c8bdd931bbbe9390a83c782a))
388
+ * rollback ([992cc6], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/992cc6881b8e24623c585a333228ef81d80d72bc))
371
389
  * update: CHANGELOG.md ([5b2772], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5b2772b0c52722625d9bede1f7114a60affd257c))
372
390
 
373
391
  # Version 2.4.25, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9b242097784b216abdf6091f4412ec43dbf5bcf4)
374
392
  * ## Features
375
393
  * <span style='color:green'>feat: HT-6592: select/deselect all rows</span> ([4f0c16], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4f0c1688693f6a357c0828b33c233631f2f71644))
394
+ * <span style='color:green'>feat: Выбор UI_ELEMENT_CD из панели редактирования плагина</span> ([ff3bf8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ff3bf82c9e4bc2d40363f869b17c29b9adc5bc9e))
376
395
 
377
396
  * ## Fixes
378
397
  * <span style='color:red'> HT-4550 ExportReportDataToFilePlugin исправлено сохранение конфигурации, починена верстка плагина, рефакторинг</span> ([a480c9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a480c9a0a12ee0b27ed256cca85f134ddc10126e))
@@ -428,6 +447,9 @@ ReportSqlPreviewPanel - add UiAceEditor as sql preview field(readOnly) with sql
428
447
  # Version 2.4.19, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bd564eac93d92af63673dd3f3267ea32aaec2886)
429
448
  * ## Features
430
449
  * <span style='color:green'>featute: reportPanel plugin.beforeInit function</span> ([4f5a93], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4f5a9302c76f09c01afd7269ab10e6aa6d13fd76))
450
+ * <span style='color:green'>feat: Added autoGenerateUiElementId property.
451
+
452
+ Closes TR-66400</span> ([d40a99], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d40a991f7ebab323e0b2a8e84df458afe1040048))
431
453
  * <span style='color:green'>feat: draft TR-65931 Рефакторинг закладки Свойства отчета</span> ([f52ffc], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f52ffc93440db4e32c8327ee3f68d1e07896645c))
432
454
  * <span style='color:green'>feat: TR-66426: get params in export</span> ([293776], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/293776b14a309891c3f7081b8f6cee6a5e958096))
433
455
 
@@ -533,6 +555,7 @@ ReportSqlPreviewPanel - add UiAceEditor as sql preview field(readOnly) with sql
533
555
  * ## Fixes
534
556
  * <span style='color:red'> HT-6604 hotfix</span> ([54bbab], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/54bbabd3b778737b89f15ef81a88931b6b8af137))
535
557
  * <span style='color:red'> TR-66234: change event move from listeners config in to init component function</span> ([c4779d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c4779df636ccb0834e957aeb15568a43ba38ec01))
558
+ * <span style='color:red'>fix scope reference</span> ([cc4b46], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cc4b4601b02d72473302e8ed4832fc4192dbf3d4))
536
559
 
537
560
  * update: CHANGELOG.md ([55fecb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/55fecbc15c052d7ca487ed8a7b3df699c20f7a13))
538
561
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.5.24",
7
+ "version": "2.5.26",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -0,0 +1,176 @@
1
+ Ext.define('Coon.common.panel.UIElementPickerPanel', {
2
+ extend: 'Ext.panel.Panel',
3
+ xtype: 'UIElementPickerPanel',
4
+ requires: ['Coon.util', 'Coon.report.command.GetDynamicReportDataCommand'],
5
+ layout: {
6
+ type: 'vbox',
7
+ align: 'stretch',
8
+ },
9
+ searchXtype: undefined,
10
+ value: null,
11
+ preload: true,
12
+ bodyPadding: 10,
13
+ setValue(value) {
14
+ this.value = value;
15
+ },
16
+ getValue() {
17
+ return this.value;
18
+ },
19
+ viewModel: {
20
+ data: {
21
+ selected: null,
22
+ searchString: '',
23
+ searchXtype: '',
24
+ value: '',
25
+ listIsLoading: false,
26
+ },
27
+ stores: {
28
+ list: {
29
+ // TODO type:'command', loadMask
30
+ data: [],
31
+ },
32
+ },
33
+ },
34
+ controller: {
35
+ bindings: {
36
+ onChangeListIsLoading: '{listIsLoading}',
37
+ },
38
+ onChangeListIsLoading(isLoading) {
39
+ if (isLoading) {
40
+ this.mask();
41
+ } else {
42
+ this.unmask();
43
+ }
44
+ },
45
+ onGridRender() {
46
+ this.vm.get('listIsLoading') && this.mask();
47
+ },
48
+ mask() {
49
+ this.lookup('grid').getEl().mask('Загрузка...');
50
+ },
51
+ unmask() {
52
+ this.lookup('grid').getEl().unmask();
53
+ },
54
+ initViewModel(vm) {
55
+ this.vm = vm;
56
+ const searchXtype = this.getView().getConfig('searchXtype');
57
+ searchXtype && this.getView().getConfig('preload') === true && this.searchHandler();
58
+ vm.set({
59
+ value: this.getView().getValue(),
60
+ searchXtype,
61
+ });
62
+ },
63
+ searchHandler() {
64
+ const searchStr = this.vm.get('searchString');
65
+ const params = Ext.encode([
66
+ {type: 'XTYPE', value: this.getView().getConfig('searchXtype')},
67
+ {type: 'UI_ELEMENT_CD', value: (searchStr.length && searchStr) || undefined}
68
+ ]);
69
+ this.vm.set('listIsLoading', true);
70
+ Coon.util
71
+ .promisifyCmd(
72
+ 'command.GetDynamicReportDataCommand',
73
+ 'UI_ELEMENTS_LIST',
74
+ params
75
+ )
76
+ .then((data) => {
77
+ if (!this.vm) {
78
+ return;
79
+ }
80
+ this.vm.set('listIsLoading', false);
81
+ this.vm.getStore('list').loadData(data.list);
82
+ const value = this.getView().getValue();
83
+ if (value && value.length) {
84
+ this.lookup('grid').setSelection(this.vm.getStore('list').findRecord('UI_ELEMENT_CD', value));
85
+ }
86
+ })
87
+ .catch((error) => {
88
+ this.vm && this.vm.set('listIsLoading', false);
89
+ Coon.log.debug(error);
90
+ Ext.Msg.alert('Ошибка', error.toString());
91
+ });
92
+ },
93
+ handler() {
94
+ const selected = this.vm.get('selected');
95
+ if (selected) {
96
+ this.getView().setValue(selected.get('UI_ELEMENT_CD'));
97
+ this.getView().fireEvent('select', selected);
98
+ }
99
+ },
100
+ },
101
+ items: [
102
+ {
103
+ xtype: 'container',
104
+ layout: {
105
+ type: 'hbox',
106
+ align: 'end',
107
+ },
108
+ autoHeight: true,
109
+ items: [
110
+ {
111
+ xtype: 'textfield',
112
+ fieldLabel: 'UI_ELEMENT_CD',
113
+ flex: 1,
114
+ bind: {
115
+ value: '{searchString}',
116
+ },
117
+ triggers: {
118
+ clear: {
119
+ cls: 'svg-icon svg-icon-cancel-small',
120
+ tooltip: 'Очистить поле',
121
+ handler: function() {
122
+ this.clear();
123
+ },
124
+ },
125
+ },
126
+ enableKeyEvents: true,
127
+ listeners: {
128
+ keypress: (fld, e) => {
129
+ if (e.getKey() === e.ENTER) {
130
+ fld.ownerCt.getComponent('searchBtn').click();
131
+ }
132
+ },
133
+ },
134
+ },
135
+ {
136
+ xtype: 'button',
137
+ itemId: 'searchBtn',
138
+ text: 'Поиск',
139
+ ui: 'blue-button',
140
+ handler: 'searchHandler',
141
+ }
142
+ ],
143
+ },
144
+ {
145
+ xtype: 'grid',
146
+ reference: 'grid',
147
+ bind: {
148
+ store: '{list}',
149
+ selection: '{selected}',
150
+ },
151
+ flex: 1,
152
+ columns: [
153
+ {dataIndex: 'UI_ELEMENT_CD', flex: 1, text: 'UI_ELEMENT_CD'},
154
+ {dataIndex: 'DESCR', flex: 2, text: 'DESCR'},
155
+ {dataIndex: 'XTYPE', flex: 1, text: 'XTYPE'},
156
+ {dataIndex: 'LAST_CHANGE_DATE', flex: 1, text: 'DATE'}
157
+ ],
158
+ listeners: {
159
+ itemdblclick: 'handler',
160
+ render: 'onGridRender',
161
+ },
162
+ }
163
+ ],
164
+ bbar: {
165
+ items: [
166
+ '->',
167
+ {
168
+ xtype: 'button',
169
+ text: 'Выбрать',
170
+ ui: 'orange-button',
171
+ dock: 'bottom',
172
+ handler: 'handler',
173
+ }
174
+ ],
175
+ },
176
+ });
@@ -75,8 +75,8 @@ Ext.define('Coon.common.plugin.form.DragDropFilePlugin', {
75
75
  onDragEnter: function() {
76
76
  console.info('Enter '+ this.component.id);
77
77
  const dropView = this.getDropView();
78
- const isViewDroppable = Ext.isFunction(dropView.isFileDroppable) && dropView.isFileDroppable();
79
- if (dropView && this.mask.hidden && isViewDroppable) {
78
+ const isViewDroppable = dropView && Ext.isFunction(dropView.isFileDroppable) && dropView.isFileDroppable();
79
+ if (this.mask.hidden && isViewDroppable) {
80
80
  this.mask.show();
81
81
  }
82
82
  },
@@ -153,9 +153,12 @@ Ext.define('Coon.report.ReportEntity', {
153
153
  *
154
154
  * @param {String} reportId
155
155
  * @param {Object,Array,String} parameters if the parameters are defined as an Object or Array they will be converted
156
+ * @param start
157
+ * @param limit
158
+ * @param {[string]} necessaryFields Массив необходимых полей отчета
156
159
  * @returns {Promise}
157
160
  */
158
- loadReportData(reportId, parameters) {
161
+ loadReportData(reportId, parameters, start, limit, necessaryFields) {
159
162
  if (Array.isArray(parameters)) {
160
163
  parameters = Ext.encode(parameters);
161
164
  } else if (Ext.isObject(parameters)) {
@@ -170,7 +173,10 @@ Ext.define('Coon.report.ReportEntity', {
170
173
  return Coon.util.promisifyCmd(
171
174
  'command.GetDynamicReportDataCommand',
172
175
  reportId,
173
- parameters
176
+ parameters,
177
+ start,
178
+ limit,
179
+ necessaryFields
174
180
  );
175
181
  },
176
182
  });
@@ -11,16 +11,20 @@ Ext.define('Coon.report.command.GetDynamicReportDataCommand', {
11
11
  ],
12
12
  url: '/ReportFormData/get',
13
13
 
14
- execute: function(reportId, parameterList, start, limit) {
14
+ execute: function(reportId, parameterList, start, limit, necessaryFields) {
15
15
  if (!parameterList) {
16
16
  parameterList = '[]';
17
17
  }
18
- this.callParent([{
18
+ const params = {
19
19
  reportId: reportId,
20
20
  parameterList,
21
21
  start: start,
22
22
  limit: limit,
23
- }]);
23
+ };
24
+ if (Array.isArray(necessaryFields) && necessaryFields.length) {
25
+ params.filterReportFieldCdList = necessaryFields.join(',');
26
+ }
27
+ this.callParent([params]);
24
28
  },
25
29
 
26
30
  processData: function(window, success, response, requestOptions) {
@@ -32,7 +36,8 @@ Ext.define('Coon.report.command.GetDynamicReportDataCommand', {
32
36
  {name: 'reportId', description: 'reportId'},
33
37
  {name: 'parameterList', description: 'parameterList'},
34
38
  {name: 'start', description: 'start'},
35
- {name: 'limit', description: 'limit'}
39
+ {name: 'limit', description: 'limit'},
40
+ {name: 'necessaryFields', description: 'necessaryFields'}
36
41
  ];
37
42
  },
38
43
  });
@@ -28,7 +28,7 @@ Ext.define('Coon.report.command.GetKeyValueListByReportCommand', {
28
28
  /**
29
29
  * Преобразование данных для отправки запроса серверу.
30
30
  **/
31
- execute: function(reportId, parametersMap, keyField, valueField) {
31
+ execute: function(reportId, parametersMap, keyField, valueField, necessaryFields) {
32
32
  this.reportId = reportId;
33
33
  this.keyField = keyField || this.keyField;
34
34
  this.valueField = valueField || this.valueField;
@@ -41,10 +41,14 @@ Ext.define('Coon.report.command.GetKeyValueListByReportCommand', {
41
41
  }
42
42
  }
43
43
  this.parametersList = Ext.encode(paramsList);
44
- this.callParent([{
44
+ const params = {
45
45
  parameterList: this.parametersList,
46
46
  reportId: this.reportId,
47
- }]);
47
+ };
48
+ if (Array.isArray(necessaryFields) && necessaryFields.length) {
49
+ params.filterReportFieldCdList = necessaryFields.join(',');
50
+ }
51
+ this.callParent([params]);
48
52
  },
49
53
 
50
54
  /**
@@ -61,7 +65,8 @@ Ext.define('Coon.report.command.GetKeyValueListByReportCommand', {
61
65
  {name: 'reportID', description: 'Идентификатор отчета', required: true},
62
66
  {name: 'parametersMap', description: 'Параметры для отчета', required: true},
63
67
  {name: 'keyField', description: 'Поле отчета с ключами', required: true},
64
- {name: 'valueField', description: 'Поле отчета со значениями', required: true}
68
+ {name: 'valueField', description: 'Поле отчета со значениями', required: true},
69
+ {name: 'necessaryFields', description: 'Требуемые поля отчета', required: false}
65
70
  ];
66
71
  },
67
72
 
@@ -38,6 +38,7 @@
38
38
  * (bindToModel: {
39
39
  * <поле в записи>: <путь во ViewModel>,
40
40
  * })
41
+ * @param {boolean} isReportFilterField. По умолчанию false. true - значит компонент является полем фильтрпанели ReportPanel
41
42
  */
42
43
  Ext.define('Coon.report.component.ReportLookupCombo', {
43
44
  extend: 'Ext.form.field.ComboBox',
@@ -52,6 +53,11 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
52
53
  config: {
53
54
  autoLoadData: true,
54
55
  resettable: false,
56
+ bindToModel: undefined,
57
+ },
58
+
59
+ getBindToModel() {
60
+ return Ext.isObject(this.bindToModel) && !Ext.Object.isEmpty(this.bindToModel) && this.bindToModel;
55
61
  },
56
62
 
57
63
  triggers: {
@@ -73,6 +79,12 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
73
79
  Coon.log.error('displayField is empty!');
74
80
  }
75
81
  this.store = Ext.create('Ext.data.ArrayStore');
82
+ if (
83
+ this.isReportFilterField ||
84
+ this.getBindToModel()
85
+ ) {
86
+ this.useNecessaryFields = true;
87
+ }
76
88
  this.callParent(arguments);
77
89
 
78
90
  this.on('beforequery', function() {
@@ -185,7 +197,10 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
185
197
  return Coon.util.promisifyCmd(
186
198
  'command.GetDynamicReportDataCommand',
187
199
  this.reportId,
188
- Ext.encode([params])
200
+ Ext.encode([params]),
201
+ undefined,
202
+ undefined,
203
+ this.useNecessaryFields && this.getReportFields()
189
204
  ).then((result) => {
190
205
  if (this.destroyed) {
191
206
  return;
@@ -336,4 +351,17 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
336
351
  {name: 'params'}
337
352
  ];
338
353
  },
354
+ /**
355
+ * Получение списка необходимых полей репорта.
356
+ * @returns {(*|string)[]}
357
+ */
358
+ getReportFields() {
359
+ const fieldList = new Set([this.valueField, this.displayField].filter((field) => !Ext.isEmpty(field)));
360
+ if (this.getBindToModel()) {
361
+ Object.keys(this.getBindToModel()).forEach((fieldName) => {
362
+ fieldList.add(fieldName);
363
+ });
364
+ }
365
+ return [...fieldList];
366
+ },
339
367
  });
@@ -284,7 +284,10 @@ Ext.define('Coon.report.component.ReportPickerLookupCombo', {
284
284
  try {
285
285
  result = await Coon.report.ReportEntity.loadReportData(
286
286
  this.reportId,
287
- params
287
+ params,
288
+ undefined,
289
+ undefined,
290
+ this.useNecessaryFields && this.getReportFields()
288
291
  );
289
292
  } catch (error) {
290
293
  Ext.Msg.alert('ошибка', JSON.stringify(error));
@@ -1,5 +1,10 @@
1
1
  /**
2
2
  * @constant DANGEROUS_AMOUNT_OF_DATA максимальное количество записей, загружаемых в store компонента.
3
+ * При начитывании репорта есть параметр, который может ограничить возвращаемые поля определенным списком полей, чтобы экономить память и уменьшить
4
+ * нагрузку на сеть.
5
+ * @param {[string]} extraFields список дополнительных полей (в дополнении к основным displayField, valueField), которые будут
6
+ * запрошены у отчета.
7
+ * @param {boolean} isReportFilterField. По умолчанию false. true - значит компонент является полем фильтрпанели ReportPanel
3
8
  */
4
9
  Ext.define('Coon.report.component.SimpleReportTag', {
5
10
  extend: 'Ext.form.field.Tag',
@@ -22,15 +27,16 @@ Ext.define('Coon.report.component.SimpleReportTag', {
22
27
  activeComponent: undefined,
23
28
  allowBlank: true,
24
29
  parseParameters: false,
25
- additionalFields: [],
26
30
  dependOn: undefined,
27
31
  dependedParameters: {},
28
32
  useRemoveFlag: false,
29
33
  tagMarkToRemoveCls: 'mark-to-remove',
30
34
  charSeq: {},
31
- grow: false,
35
+ isReportFilterField: false,
32
36
  },
33
37
 
38
+ grow: false,
39
+ extraFields: undefined,
34
40
  displayField: undefined,
35
41
 
36
42
  updateDefaultParameters: function() {
@@ -101,6 +107,10 @@ Ext.define('Coon.report.component.SimpleReportTag', {
101
107
  }
102
108
  },
103
109
 
110
+ getExtraFields() {
111
+ return Array.isArray(this.extraFields) && this.extraFields.length && this.extraFields;
112
+ },
113
+
104
114
  initComponent: function() {
105
115
  // this parameter should be always set to false because this component managed store by itself.
106
116
  this.loadOnRender = false;
@@ -123,12 +133,17 @@ Ext.define('Coon.report.component.SimpleReportTag', {
123
133
  this.setTriggers(triggers);
124
134
  }
125
135
  this.store = new Ext.data.Store({
126
- fields: [this.valueField, this.displayField].concat(this.additionalFields),
136
+ fields: this.getReportFields(),
127
137
  idProperty: this.valueField,
128
138
  autoLoad: false,
129
139
  });
130
140
  this.on('beforedeselect', this.removeValueHandler, this);
131
-
141
+ if (
142
+ this.isReportFilterField ||
143
+ this.getExtraFields()
144
+ ) {
145
+ this.useNecessaryFields = true;
146
+ }
132
147
  this.callParent();
133
148
 
134
149
  this.on({
@@ -240,7 +255,13 @@ Ext.define('Coon.report.component.SimpleReportTag', {
240
255
 
241
256
  loadHandler: function(params) {
242
257
  this.disable();
243
- this.command.execute(this.reportId, Ext.apply({}, params, this.defaultParameters || {}), this.valueField, this.displayField);
258
+ this.command.execute(
259
+ this.reportId,
260
+ Ext.apply({}, params, this.defaultParameters || {}),
261
+ this.valueField,
262
+ this.displayField,
263
+ this.useNecessaryFields && this.getReportFields()
264
+ );
244
265
  },
245
266
 
246
267
  setupCss: function() {
@@ -264,4 +285,18 @@ Ext.define('Coon.report.component.SimpleReportTag', {
264
285
  }
265
286
  return data;
266
287
  },
288
+
289
+ /**
290
+ * Получение списка необходимых полей репорта.
291
+ * @returns {(*|string)[]}
292
+ */
293
+ getReportFields() {
294
+ const fieldList = new Set([this.valueField, this.displayField].filter((field) => !Ext.isEmpty(field)));
295
+ if (this.getExtraFields()) {
296
+ for (const fieldName of this.getExtraFields()) {
297
+ fieldList.add(fieldName);
298
+ }
299
+ }
300
+ return [...fieldList];
301
+ },
267
302
  });
@@ -7,15 +7,25 @@
7
7
  * @param autoLoadData загружать репорт при инстанцировании
8
8
  * @param {boolean} cutDangerousAmount урезать данные репорта при превышении DANGEROUS_AMOUNT_OF_DATA. По умолчанию true (данные будут усечены).
9
9
  * @constant DANGEROUS_AMOUNT_OF_DATA предел количества строк в репорте, считающийся опасным
10
+ * @param {[string]} extraFields список дополнительных полей (в дополнении к основным displayField, valueField, поля bindToModel), которые будут
11
+ * запрошены у отчета.
12
+ *
13
+ * При начитывании данных репорта есть параметр, который может ограничить возвращаемые поля определенным списком полей, чтобы экономить память
14
+ * и уменьшить нагрузку на сеть. Этот параметр принимает список полей, которые необходимо начитать.
15
+ * Свойство компонента useNecessaryFields отвечает за использование этого функционала:
16
+ * Если в конфигурации компонента extraFields определен как не пустой массив, то свойство useNecessaryFields автоматически становится true, и
17
+ * компонент определяет перечень полей для начитывания.
18
+ * Если компонент SimplestReportCombo находится в ReportPanel (определяется по свойству isReportFilterField, которое примешивается в конфиг
19
+ * компонента, когда компонент конструируется в FilterPanel), useNecessaryFields выставляется в значение true.
20
+ *
10
21
  */
11
-
12
22
  Ext.define('Coon.report.component.SimplestReportCombo', {
13
23
  extend: 'Coon.report.component.ParameterizedReportCombo',
14
24
  alias: 'widget.SimplestReportCombo',
15
25
  cls: 'SimplestReportCombo',
16
26
  uses: [],
17
27
  requires: [
18
- 'Coon.report.command.GetKeyValueListByReport'
28
+ 'Coon.report.command.GetKeyValueListByReportCommand'
19
29
  ],
20
30
  alternateClassName: [
21
31
  'Sigma.common.fields.SimplestReportCombo',
@@ -34,7 +44,6 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
34
44
  activeComponent: undefined,
35
45
  allowBlank: true,
36
46
  parseParameters: false,
37
- additionalFields: [],
38
47
  dependOn: undefined,
39
48
  dependedParameters: {},
40
49
  loadOnFocus: false,
@@ -44,6 +53,7 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
44
53
  disableBusyFeature: false,
45
54
  },
46
55
  displayField: undefined,
56
+ extraFields: undefined,
47
57
 
48
58
  updateDefaultParameters: function() {
49
59
  if (this.getDefaultParameters() && this.getDefaultParameters().doLoad) {
@@ -100,19 +110,26 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
100
110
  });
101
111
  });
102
112
  },
103
-
113
+ getExtraFields() {
114
+ return Array.isArray(this.extraFields) && this.extraFields.length && this.extraFields;
115
+ },
104
116
  initComponent: function() {
105
117
  // this parameter should be always set to false because this component managed store by itself.
106
118
  this.loadOnRender = false;
107
119
  this.valueField = this.valueField || 'VALUE';
108
120
  this.displayField = this.displayField || 'DESCRIPTION';
109
- this.defaultValueFlg = this.defaultValueFlg || 'IS_DEFAULT';
110
121
 
111
122
  this.store = new Ext.data.Store({
112
- fields: [this.valueField, this.displayField, this.defaultValueFlg].concat(this.additionalFields),
123
+ fields: this.getReportFields(),
113
124
  idProperty: this.valueField,
114
125
  autoLoad: false,
115
126
  });
127
+ if (
128
+ this.isReportFilterField ||
129
+ this.getExtraFields()
130
+ ) {
131
+ this.useNecessaryFields = true;
132
+ }
116
133
 
117
134
  this.callParent();
118
135
  if (!this.loadingText) {
@@ -221,7 +238,7 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
221
238
  },
222
239
 
223
240
  createCommand() {
224
- this.command = Ext.create('Coon.report.command.GetKeyValueListByReport', {
241
+ this.command = Ext.create('command.GetKeyValueListByReportCommand', {
225
242
  maskText: this.maskText,
226
243
  activeComponent: this.activeComponent,
227
244
  callerId: this.id,
@@ -242,7 +259,7 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
242
259
  this.store.loadData(map);
243
260
  this.store.fireEvent('load', this.store, this.store.getRange(), true);
244
261
  this.fireEvent('load', this, this.store);
245
- const find = map.find((e) => e[this.defaultValueFlg] === 'Y');
262
+ const find = map.find((e) => e[this.defaultValueFlg || 'IS_DEFAULT'] === 'Y');
246
263
  const defaultValue = this.value || (find && find[this.valueField]);
247
264
  if (defaultValue) {
248
265
  this.setValue(defaultValue);
@@ -275,7 +292,7 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
275
292
  Ext.apply({}, params, this.defaultParameters || {}),
276
293
  this.valueField,
277
294
  this.displayField,
278
- this.defaultValueFlg
295
+ this.useNecessaryFields && this.getReportFields()
279
296
  );
280
297
  },
281
298
 
@@ -292,4 +309,23 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
292
309
  this.setDisabled(isBusy);
293
310
  this.setEmptyText(isBusy ? this.getLoadingText() : null);
294
311
  },
312
+
313
+ /**
314
+ * Получение списка необходимых полей репорта.
315
+ * @returns {*[]|(*|string)[]}
316
+ */
317
+ getReportFields() {
318
+ const fieldList = new Set([this.valueField, this.displayField, this.defaultValueFlg].filter((field) => !Ext.isEmpty(field)));
319
+ if (Ext.isObject(this.bindToModel)) {
320
+ Object.keys(this.bindToModel).forEach((fieldName) => {
321
+ fieldList.add(fieldName);
322
+ });
323
+ }
324
+ if (this.getExtraFields()) {
325
+ for (const fieldName of this.getExtraFields()) {
326
+ fieldList.add(fieldName);
327
+ }
328
+ }
329
+ return [...fieldList];
330
+ },
295
331
  });
@@ -153,6 +153,8 @@ Ext.define('Coon.report.component.reportpanel.FilterPanel', {
153
153
  const ns = Coon.report.model.ReportParameterBeanFields;
154
154
 
155
155
  const defaultConfig = {
156
+ // isReportFilterField флаг, позволяющий компоненту понимать,что он является частью фильтр панели отчета.
157
+ isReportFilterField: true,
156
158
  fieldLabel: configuration[ns.$description],
157
159
  allowBlank: !configuration[ns.$requiredSwitch],
158
160
  hidden: !configuration[ns.$visibleSwitch],
@@ -14,6 +14,7 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGrid', {
14
14
  'Coon.common.field.IDField'
15
15
  ],
16
16
  controller: 'reportformplugingridcontroller',
17
+ autoGenerateUiElementId: true,
17
18
  loadMask: true,
18
19
  stripeRows: true,
19
20
  twoWayBindable: ['data'],
@@ -94,8 +95,25 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGrid', {
94
95
  ],
95
96
  }],
96
97
  columns: [
98
+ {
99
+ xtype: 'actioncolumn',
100
+ width: 50,
101
+ items: [
102
+ {
103
+ iconCls: 'fa fa-cog',
104
+ tooltip: 'Настройка',
105
+ handler() {
106
+ Ext.create({
107
+ xtype: 'ReportFormPluginSettings',
108
+ selection: Array.from(arguments)[5],
109
+ });
110
+ },
111
+ }
112
+ ],
113
+ },
97
114
  {
98
115
  dataIndex: 'xtype',
116
+ hidden: true,
99
117
  header: '',
100
118
  width: 60,
101
119
  sortable: false,
@@ -120,7 +138,7 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGrid', {
120
138
  renderer(v, metaData) {
121
139
  if (Coon.report.ReportEntity.isAliasExist(v)) {
122
140
  return v && v.split('').map((char) => {
123
- return Coon.util.isUpperLetter(char) ? `<span style="font-weight:bold;color: brown">${char}</span>` : char;
141
+ return Coon.util.isUpperLetter(char) ? `<span style='font-weight:bold;color: brown'>${char}</span>` : char;
124
142
  }).join('');
125
143
  } else {
126
144
  metaData.tdStyle = 'color:red;';
@@ -137,21 +155,14 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGrid', {
137
155
  sortable: false,
138
156
  tooltip: 'разрешенные символы: a-zA_Z0-9_-.',
139
157
  flex: 0.35,
158
+ hidden: true,
140
159
  editor: {
141
160
  xtype: 'IDField',
142
161
  allowBlank: false,
143
162
  triggers: {
144
163
  autoGenerateUiElement: {
145
164
  cls: 'x-fa fa-magic',
146
- handler(editorField) {
147
- const record = editorField.up('grid').selection;
148
- if (record) {
149
- const prefix = record.get('xtype').split('').filter(Coon.util.isUpperLetter).join('');
150
- editorField.setValue(prefix + '-' + Date.now().toString());
151
- } else {
152
- editorField.setValue(Date.now().toString());
153
- }
154
- },
165
+ handler: 'autoGenerateUiElementHandler',
155
166
  },
156
167
  resetUiElement: {
157
168
  cls: 'x-fa fa-times',
@@ -167,9 +178,6 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGrid', {
167
178
  },
168
179
  },
169
180
  },
170
- bind: {
171
- hidden: '{formEditor}',
172
- },
173
181
  },
174
182
  {
175
183
  header: 'Тип',
@@ -189,10 +197,10 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGrid', {
189
197
  renderer: function(v, _, rec) {
190
198
  if (!v) {
191
199
  return `
192
- <div data-qtip="плагин не активен, для активации укажите тип" style="text-align:center;color: brown;font-size: 0.9em;">
193
- <span class="x-fa fa-exclamation" />
200
+ <div data-qtip='плагин не активен, для активации укажите тип' style='text-align:center;color: brown;font-size: 0.9em;'>
201
+ <span class='x-fa fa-exclamation' />
194
202
  плагин не активен
195
- <span class="x-fa fa-exclamation" />
203
+ <span class='x-fa fa-exclamation' />
196
204
  </div>
197
205
 
198
206
  `;
@@ -19,8 +19,8 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGridController
19
19
  const initialText = deleteButton.initialConfig.text;
20
20
  deleteButton.setDisabled(Ext.isEmpty(selection));
21
21
  this.lookup('cloneButton').setDisabled(Ext.isEmpty(selection));
22
- deleteButton.setText(!Ext.isEmpty(selection)?
23
- (selection[0].get('isDeleted')? 'Восстановить' : initialText) : initialText);
22
+ deleteButton.setText(!Ext.isEmpty(selection) ?
23
+ (selection[0].get('isDeleted') ? 'Восстановить' : initialText) : initialText);
24
24
  },
25
25
 
26
26
  addHandler: function(xtype) {
@@ -32,9 +32,12 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGridController
32
32
  data['jsonProperties'] = [];
33
33
  data['xtype'] = xtype;
34
34
  data['sequenceNumber'] = this.getNextIDSeq();
35
+ if (view.autoGenerateUiElementId) {
36
+ data['uiElement'] = this.generateUiElementId(data);
37
+ }
35
38
  view.getStore().add(data);
36
39
  view.publishState('data', view.getData());
37
- view.getSelectionModel().select(view.getStore().getCount() -1);
40
+ view.getSelectionModel().select(view.getStore().getCount() - 1);
38
41
  },
39
42
  createPluginSelectWindow: function() {
40
43
  const view = this.getView();
@@ -110,7 +113,7 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGridController
110
113
  view.getStore().remove(record);
111
114
  } else {
112
115
  record.set('isDeleted', !record.get('isDeleted'));
113
- deleteButton.setText(record.get('isDeleted')? 'Восстановить' : initialText);
116
+ deleteButton.setText(record.get('isDeleted') ? 'Восстановить' : initialText);
114
117
  }
115
118
  view.publishState('data', view.getData());
116
119
  }
@@ -125,10 +128,11 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGridController
125
128
  data['uiElement'] = '';
126
129
  data['sortSequence'] = this.getNextSeq();
127
130
  data['sequenceNumber'] = this.getNextIDSeq();
128
- if (data) {
129
- view.getStore().add(data);
130
- view.publishState('data', view.getData());
131
+ if (view.autoGenerateUiElementId) {
132
+ data['uiElement'] = this.generateUiElementId(data);
131
133
  }
134
+ view.getStore().add(data);
135
+ view.publishState('data', view.getData());
132
136
  },
133
137
 
134
138
  beforeCellEditHandler: function(cellEditingPlugin, cellContext) {
@@ -292,5 +296,18 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginGridController
292
296
  },
293
297
  });
294
298
  },
295
-
299
+ autoGenerateUiElementHandler(editorField) {
300
+ const record = editorField.up('grid').selection;
301
+ record && editorField.setValue(this.generateUiElementId(record.getData()));
302
+ },
303
+ generateUiElementId: function(data) {
304
+ const {xtype} = data;
305
+ const reportId = this.getViewModel().get('report.reportId');
306
+ const pluginClass = Ext.ClassManager.getByAlias('plugin.' + xtype);
307
+ let id;
308
+ if (pluginClass && typeof pluginClass.getPluginId === 'function') {
309
+ id = pluginClass.getPluginId();
310
+ }
311
+ return [reportId, xtype, id || Date.now()].join('_');
312
+ },
296
313
  });
@@ -27,11 +27,13 @@ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginPanel', {
27
27
  style: 'margin-right: 8px;',
28
28
  bodyPadding: 8,
29
29
  reference: 'paramPanel',
30
- title: 'Параметры плагина',
31
30
  region: 'center',
32
31
  flex: 1,
33
32
  split: true,
34
33
  layout: 'fit',
34
+ bind: {
35
+ title: 'Параметры плагина {pluginsGrid.selection.xtype}: {pluginsGrid.selection.uiElement}',
36
+ },
35
37
  }
36
38
  ],
37
39
  });
@@ -0,0 +1,208 @@
1
+ Ext.define('Coon.report.component.settings.plugin.ReportFormPluginSettings', {
2
+ extend: 'Coon.common.panel.WindowWrap',
3
+ requires: [
4
+ 'Coon.common.panel.UIElementPickerPanel',
5
+ 'Coon.report.command.GetDynamicReportDataCommand'
6
+ ],
7
+ xtype: 'ReportFormPluginSettings',
8
+ autoShow: true,
9
+ selection: null,
10
+ viewModel: {
11
+ data: {
12
+ selection: null,
13
+ newUiElementCd: '',
14
+ initialUiElementCd: '',
15
+ existingUiElement: null,
16
+ isConfirmed: false,
17
+ canApply: false,
18
+ isValidating: false,
19
+ },
20
+ formulas: {
21
+ isDirty: (get) => {
22
+ return get('initialUiElementCd') !== get('newUiElementCd');
23
+ },
24
+ },
25
+ },
26
+ constructor(config) {
27
+ if (config.selection) {
28
+ if (!config.title) {
29
+ config.title = 'Настройки плагина ' + config.selection.get('xtype');
30
+ }
31
+ }
32
+ this.callParent(arguments);
33
+ const c = this.getController();
34
+ c.vm = this.getViewModel();
35
+ c.vm.set({
36
+ selection: config.selection,
37
+ newUiElementCd: config.selection && config.selection.get('uiElement'),
38
+ initialUiElementCd: config.selection && config.selection.get('uiElement'),
39
+ });
40
+ this.lookup('uiElementField').validator = c.uiElementValidator.bind(c);
41
+ },
42
+ controller: {
43
+ vm: null,
44
+ confirmUsingExisting() {
45
+ const newUiElementCd = this.lookup('uiElementField').getValue();
46
+ if (this.vm.get('isConfirmed') === true || newUiElementCd === this.vm.get('initialUiElementCd')) {
47
+ return Promise.resolve(true);
48
+ }
49
+ return new Promise((resolve) => {
50
+ Ext.Msg.show({
51
+ title: 'Данный UI_ELEMENT_CD уже используется',
52
+ message: `Вы уверены что хотите использовать существующий UI_ELEMENT_CD: ${newUiElementCd} ?`,
53
+ buttons: Ext.Msg.OKCANCEL,
54
+ fn: (btn) => {
55
+ resolve(btn === 'ok');
56
+ },
57
+ });
58
+ });
59
+ },
60
+ uiElementValidator(value) {
61
+ if (Ext.isEmpty(value)) {
62
+ this.vm.set('canApply', false);
63
+ return true;
64
+ }
65
+ const existing = this.vm.get('existingUiElement');
66
+ if (existing) {
67
+ const sameType = existing.XTYPE === this.vm.get('selection.xtype');
68
+ if (!sameType) {
69
+ this.vm.set('canApply', false);
70
+ return 'Этот UI_ELEMENT_CD используется в плагине другого типа.';
71
+ } else {
72
+ this.confirmUsingExisting().then((ok) => {
73
+ this.vm.set('isConfirmed', true);
74
+ if (!ok) {
75
+ this.vm.set('newUiElementCd', this.vm.get('initialUiElementCd'));
76
+ }
77
+ });
78
+ }
79
+ }
80
+ const isValidValue = /^[a-zA-Z0-9_\-]+$/.test(value);
81
+ this.vm.set('canApply', isValidValue);
82
+ return isValidValue || 'Значение содержит недопустимые символы';
83
+ },
84
+ testExistingHandler(fld) {
85
+ this.vm.set('existingUiElement', null);
86
+ const value = fld.getValue();
87
+ if (!value.length || !this.vm.get('isDirty') || !this.vm.get('canApply') || this.vm.get('isConfirmed')) {
88
+ if (this.vm.get('isConfirmed')) {
89
+ this.vm.set('isConfirmed', false);
90
+ }
91
+ return true;
92
+ }
93
+ this.vm.set('isValidating', true);
94
+ Coon.util
95
+ .promisifyCmd(
96
+ 'command.GetDynamicReportDataCommand',
97
+ 'UI_ELEMENTS_LIST',
98
+ Ext.encode([
99
+ {type: 'UI_ELEMENT_CD', value}
100
+ ])
101
+ )
102
+ .then((data) => {
103
+ const existing = data.list.find((item) => item.UI_ELEMENT_CD === value);
104
+ this.vm.set('existingUiElement', existing);
105
+ this.lookup('uiElementField').isValid();
106
+ this.vm.set('isValidating', false);
107
+ })
108
+ .catch((error) => {
109
+ Coon.log.debug(error);
110
+ this.vm.set('isValidating', false);
111
+ Ext.Msg.alert('Ошибка', error.toString());
112
+ });
113
+ },
114
+ applyHandler() {
115
+ this.vm.get('selection').set('uiElement', this.lookup('uiElementField').getValue());
116
+ this.closeHandler();
117
+ },
118
+ closeHandler() {
119
+ this.getView().close();
120
+ },
121
+ pickerHandler() {
122
+ const selection = this.vm.get('selection');
123
+ if (!selection) {
124
+ throw new Error('Не выбран plugin');
125
+ }
126
+ const win = Ext.create('Coon.common.panel.WindowWrap', {
127
+ autoShow: true,
128
+ title: 'Список доступных UI элементов плагина ' + selection.get('xtype'),
129
+ items: [
130
+ {
131
+ xtype: 'UIElementPickerPanel',
132
+ width: 800,
133
+ height: 600,
134
+ searchXtype: selection.get('xtype'),
135
+ value: (!selection.get('isNew') && selection.get('uiElement')) || undefined,
136
+ listeners: {
137
+ select: (record) => {
138
+ this.vm.set('newUiElementCd', record.get('UI_ELEMENT_CD'));
139
+ this.vm.set('isConfirmed', true);
140
+ win.close();
141
+ },
142
+ },
143
+ }
144
+ ],
145
+ });
146
+ },
147
+ },
148
+ items: [
149
+ {
150
+ xtype: 'container',
151
+ flex: 1,
152
+ padding: 10,
153
+ width: 800,
154
+ layout: {
155
+ type: 'hbox',
156
+ align: 'end',
157
+ },
158
+ items: [
159
+ {
160
+ xtype: 'textfield',
161
+ fieldLabel: 'UI_ELEMENT_CD',
162
+ allowBlank: false,
163
+ reference: 'uiElementField',
164
+ flex: 1,
165
+ bind: {
166
+ value: '{newUiElementCd}',
167
+ },
168
+ enableKeyEvents: true,
169
+ minLength: 2,
170
+ listeners: {
171
+ change: {
172
+ buffer: 500,
173
+ fn: 'testExistingHandler',
174
+ },
175
+ },
176
+ triggers: {
177
+ reset: {
178
+ cls: 'svg-icon svg-icon-cancel-small',
179
+ handler(field) {
180
+ field.reset();
181
+ },
182
+ },
183
+ open: {
184
+ cls: 'svg-icon svg-icon-magnifying-glass',
185
+ tooltip: 'Выбрать существующий UI_ELEMENT_CD',
186
+ handler: 'pickerHandler',
187
+ },
188
+ },
189
+ }
190
+ ],
191
+ }
192
+ ],
193
+ buttons: [
194
+ {
195
+ text: 'Закрыть',
196
+ ui: 'blue-button',
197
+ handler: 'closeHandler',
198
+ },
199
+ {
200
+ text: 'Применить',
201
+ ui: 'orange-button',
202
+ handler: 'applyHandler',
203
+ bind: {
204
+ disabled: '{!canApply || newUiElementCd === initialUiElementCd || isValidating}',
205
+ },
206
+ }
207
+ ],
208
+ });
@@ -45,6 +45,13 @@ Ext.define('Coon.uielement.plugin.ExecuteCommandPlugin', {
45
45
  this.vm = view.getController().getViewModel();
46
46
  this.disablingElement = this.disabledReference && view.getController().lookup(this.disabledReference);
47
47
  }
48
+
49
+ if (this.disablingElement) {
50
+ const defaultFocus = view.getDefaultFocus();
51
+ defaultFocus && defaultFocus.setConfig({
52
+ preventRefocus: true,
53
+ });
54
+ }
48
55
  },
49
56
 
50
57
  parseProperty: function(obj, property) {
@@ -101,6 +108,7 @@ Ext.define('Coon.uielement.plugin.ExecuteCommandPlugin', {
101
108
 
102
109
  command.processError = !!this.errorHandler;
103
110
  command.on('failure', function(e) {
111
+ this.setDisabled(false);
104
112
  if (this.errorHandler) {
105
113
  try {
106
114
  const controller = this.view.getController();
@@ -117,9 +125,6 @@ Ext.define('Coon.uielement.plugin.ExecuteCommandPlugin', {
117
125
  reject(e);
118
126
  }
119
127
  }, this);
120
- this.disablingElement && command.on('failure', function() {
121
- this.setDisabled(false);
122
- }, this);
123
128
 
124
129
  Ext.each(command.inputParameters(), (field) => {
125
130
  let paramValue = parameters[field.name];
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.5.24',
3
+ number: '2.5.26',
4
4
  });