ru.coon 2.8.54 → 2.8.56

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/.eslintrc.js CHANGED
@@ -19,7 +19,7 @@ module.exports = {
19
19
  'Iconpack': 'writable',
20
20
  },
21
21
  'parserOptions': {
22
- ecmaVersion: 2020,
22
+ ecmaVersion: 8,
23
23
  },
24
24
  'rules': {
25
25
  'max-len': [
package/CHANGELOG.md CHANGED
@@ -1,24 +1,21 @@
1
- # Version 2.8.54, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/04227601d5626e8dfe0e503202c0abe889af794c)
2
- * deactivate ReportPropertiesGridFields ([d48f79], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d48f79cc33c1bdb8565dddf47025a2cda341589c))
3
- * update: CHANGELOG.md ([c15697], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c15697ca7b353c5521c832f5fc574fca5c5f8b94))
1
+ # Version 2.8.56, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7ee71037ec8ad697db9c2dab51a68edb7779e39c)
2
+ * update: CHANGELOG.md ([2dbb53], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2dbb5364cf0654824ff535b7ee34c39d8a236bbb))
4
3
 
5
- # Version 2.8.53, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bcfb669a9fd715244f642af2782f77713ec4d9c5)
6
- # Version 2.8.52, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f09d0df73622befab3f7f6d08aaea3ad696e036d)
4
+ # Version 2.8.55, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/64f911d4d6fb3907fa76bd53d21e5d260ebeb655)
5
+ # Version 2.8.54, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/57cf1e02a88adae16228d487145fd5b1fa012078)
7
6
  * ## Features
8
- * <span style='color:green'>feat: сделан рефакторинг XtypeComboBox, reportPanel, общая логика контроллеров задачи вынесена в отдельный файл</span> ([36bf87], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/36bf8795641e73a576301067a330c32cefcbc78a))
7
+ * <span style='color:green'>feat: AddDoInitSupportPlugin predefine input parameters in viewModel, UiCPWrapper add inheritViewModel property</span> ([cf7bf1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/cf7bf17cf68a551b8746f750158964df33c22788))
9
8
 
10
- * UiCustomPanel - force init empty parameters as 'null' (AddDoInitSupportPlugin) ([aed95f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/aed95f7586a370fbee59166203d0482bc0a7ee42))
11
- * update: CHANGELOG.md ([345f39], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/345f398c6996e0245157c6e35afb3b98ef6e188a))
9
+ * ## Fixes
10
+ * <span style='color:red'> BFL-19473 preventSearchByValueField on ReportLookupCombo</span> ([99d306], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/99d306b414f0a0a43c94a5064b569922938cc5ff))
11
+ * <span style='color:red'> BFL-19473 preventSearchByValueField on ReportLookupCombo</span> ([188f53], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/188f53d7f99c448342b74061f4b9c77d025d7021))
12
12
 
13
- # Version 2.8.52, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/be9ffc268dd4c1848ee20989256eee92b54df85e)
14
- * ## Features
15
- * <span style='color:green'>feat: была сделана синхронизация комбобокса со стором, добавлена валидация и исрпавлены баги</span> ([c327ce], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c327cea395389df37417379a06f22c946e8fe297))
16
- * <span style='color:green'>feat: выведен XType колонок в св-ва репорта</span> ([771dd8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/771dd83b367a61faabc1d11a527ca10bfa1e23f2))
13
+ * update: CHANGELOG.md ([c15697], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c15697ca7b353c5521c832f5fc574fca5c5f8b94))
17
14
 
18
- * partial refactoring ([0ca420], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0ca42005599f8c73f3e725d30beb978341593027))
19
- * добавлена фильтрация в xtypecombobox ([1848a8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1848a8f96c9f05d8953b2c4231b714152e41e496))
15
+ # Version 2.8.53, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bcfb669a9fd715244f642af2782f77713ec4d9c5)
16
+ # Version 2.8.52, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f09d0df73622befab3f7f6d08aaea3ad696e036d)
17
+ * UiCustomPanel - force init empty parameters as 'null' (AddDoInitSupportPlugin) ([aed95f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/aed95f7586a370fbee59166203d0482bc0a7ee42))
20
18
  * TR-70438 fix: Исправление ошибки при копировании репорта ([2daff2], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2daff251cb9092c8058fee091cba3f2766e954bc))
21
- * добавлена валидация и изменены св-ва в параметрах ([52f184], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/52f184eb2a1d82384566eba0f61091fd3ecc3bb6))
22
19
  * upd ([b25431], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b2543126f38df56102e68899166567d348a32828))
23
20
  * update: CHANGELOG.md ([a34646], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a3464679903d68a5018f930b30ad2ead401a893d))
24
21
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.8.54",
7
+ "version": "2.8.56",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -6,13 +6,23 @@ Ext.define('Coon.common.field.combo.XTypeComboBox', {
6
6
  searchBySubstring: true,
7
7
  xtypeBound: undefined,
8
8
  getData: function() {
9
- const xtypeList = Object.keys(Ext.ClassManager.classes);
9
+ let xtypeList;
10
+ if (Ext.isArray(this.xtypeBound)) {
11
+ xtypeList = Object.keys(Ext.ClassManager.classes)
12
+ .filter((clsName) => this.xtypeBound.find((bound) => clsName.includes(bound)));
13
+ } else if (Ext.isFunction(this.xtypeBound)) {
14
+ xtypeList = Object.keys(Ext.ClassManager.classes)
15
+ .filter((clsName) => this.xtypeBound(Ext.ClassManager.get(clsName)));
16
+ } else if (this.xtypeBound) {
17
+ xtypeList = Object.keys(Ext.ClassManager.classes)
18
+ .filter((clsName) => clsName.includes(this.xtypeBound));
19
+ } else {
20
+ xtypeList = Object.keys(Ext.ClassManager.classes);
21
+ }
10
22
  const data = [];
11
- const pairsObject = {};
12
23
  xtypeList.forEach((clsName) => {
13
24
  const cls = Ext.ClassManager.get(clsName);
14
- const xtypeClsName = clsName.split('.').pop();
15
- if (cls && cls.prototype && cls.prototype.xtype) {
25
+ if (cls && cls.prototype) {
16
26
  let type = cls.prototype.xtype;
17
27
  if (!type) {
18
28
  if (Ext.isArray(cls.prototype.alias)) {
@@ -25,13 +35,9 @@ Ext.define('Coon.common.field.combo.XTypeComboBox', {
25
35
  type = type.replace(tmpl, '');
26
36
  }
27
37
  }
28
- type && data.push([type, xtypeClsName]);
38
+ type && data.push([type, clsName]);
29
39
  }
30
40
  });
31
- data.forEach((item) => {
32
- const pairKey = JSON.stringify(item);
33
- pairsObject[pairKey] = item;
34
- });
35
- return Object.values(pairsObject);
41
+ return data;
36
42
  },
37
43
  });
@@ -41,6 +41,8 @@
41
41
  * <поле в записи>: <путь во ViewModel>,
42
42
  * })
43
43
  * @param {boolean} isReportFilterField. По умолчанию false. true - значит компонент является полем фильтрпанели ReportPanel
44
+ * @param {boolean} preventSearchByValueField позволяет предотвратить повторный вызов репорта после выбора записи в WindowWrap
45
+ * (если ReportLookupCombo используется для вызова окна доп.параметров команды и его не нужно инициализировать c value)
44
46
  */
45
47
  Ext.define('Coon.report.component.ReportLookupCombo', {
46
48
  extend: 'Ext.form.field.ComboBox',
@@ -57,6 +59,7 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
57
59
  xtype: 'ReportLookupCombo',
58
60
 
59
61
  searchField: undefined,
62
+ preventSearchByValueField: undefined,
60
63
  config: {
61
64
  autoLoadData: true,
62
65
  resettable: false,
@@ -85,7 +88,7 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
85
88
 
86
89
  initComponent() {
87
90
  this._cachedValue = Boolean(false);
88
- this._inited = Boolean(false);
91
+ this._inited = Boolean(this.preventSearchByValueField);
89
92
 
90
93
  if (!this.getDisplayField()) {
91
94
  Coon.log.error('displayField is empty!');
@@ -106,7 +109,7 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
106
109
  this._inited = true;// don't touch this
107
110
  if (value) {
108
111
  this.loadReportData(value);
109
- };
112
+ }
110
113
  }
111
114
  };
112
115
  if (Ext.isObject(this.defaultParameters)) {
@@ -20,7 +20,6 @@ Ext.define('Coon.report.component.ReportPanel', {
20
20
  'Coon.report.column.HintColumn',
21
21
  'Coon.report.component.reportpanel.ReportGrid',
22
22
  'Coon.report.component.reportpanel.FilterPanel',
23
- 'Coon.report.component.reportpanel.ReportGridDataType',
24
23
  'Coon.report.model.*',
25
24
  'Coon.report.model.CharacteristicBeanFields',
26
25
  'Coon.report.plugin.form.EnterConfirmFormPlugin',
@@ -190,8 +189,93 @@ Ext.define('Coon.report.component.ReportPanel', {
190
189
  },
191
190
 
192
191
  setColumnType: function(typeOfValue) {
193
- const columnType = Coon.report.component.reportpanel.ReportGridDataType.getTypeConfig(typeOfValue);
194
- return columnType;
192
+ const convertFloatFn = Coon.format.parseFloat;
193
+ const convertDateTime = function(value) {
194
+ return Ext.Date.parse(value, Coon.format.dateTimeInternal);
195
+ };
196
+ const convertDate = function(value) {
197
+ if (!Ext.Date.parse(value, Coon.format.dateInternal)) {
198
+ value = Ext.Date.format(convertDateTime(value), Coon.format.dateInternal);
199
+ }
200
+ return Ext.Date.parse(value, Coon.format.dateInternal);
201
+ };
202
+ const cConfig = {
203
+ xtype: 'hintColumn',
204
+ filter: {type: 'string'},
205
+ }; // по-умолчанию
206
+ let storeRecordType = 'string';
207
+ let convert = undefined;
208
+
209
+ switch (typeOfValue) {
210
+ case 'DATETIME':
211
+ cConfig.xtype = 'hintDateColumn';
212
+ cConfig.format = Coon.format.timeDate;
213
+ storeRecordType = 'date';
214
+ convert = convertDateTime;
215
+ break;
216
+ case 'TIME':
217
+ cConfig.xtype = 'hintDateColumn';
218
+ cConfig.format = Coon.format.time;
219
+ storeRecordType = 'date';
220
+ convert = convertDateTime;
221
+ break;
222
+ case 'DATE':
223
+ cConfig.xtype = 'hintDateColumn';
224
+ cConfig.format = Coon.format.date;
225
+ cConfig.filter = {type: 'date'};
226
+ cConfig.align = 'right';
227
+ storeRecordType = 'date';
228
+ convert = convertDate;
229
+ break;
230
+
231
+ case 'MONEY':
232
+ cConfig.xtype = 'MoneyColumn';
233
+ cConfig.filter = {type: 'numeric'};
234
+ storeRecordType = 'float';
235
+ convert = convertFloatFn;
236
+ break;
237
+
238
+ case 'DECIMAL':
239
+ cConfig.xtype = 'BigNumColumn';
240
+ cConfig.filter = {type: 'numeric'};
241
+ storeRecordType = 'float';
242
+ convert = convertFloatFn;
243
+ break;
244
+
245
+ case 'INTEGER':
246
+ cConfig.xtype = 'BigNumColumn';
247
+ cConfig.filter = {type: 'numeric'};
248
+ cConfig.precision = 0;
249
+ storeRecordType = 'float';
250
+ convert = convertFloatFn;
251
+ break;
252
+
253
+ case 'BOOLEAN':
254
+ cConfig.xtype = 'checkcolumn';
255
+ cConfig.stopSelection = false;
256
+ cConfig.allowSelect = false;
257
+ cConfig.filterType = 'boolean';
258
+ cConfig.listeners = {
259
+ beforecheckchange: function() {
260
+ const panel = this.findParentByType('ReportPanel');
261
+ if (panel && panel.readOnly) {
262
+ return false;
263
+ }
264
+ return this.allowSelect || this.stopSelection;
265
+ },
266
+ };
267
+ cConfig.precision = 0;
268
+ cConfig.filter = {type: 'boolean'};
269
+ storeRecordType = 'boolean';
270
+ convert = function(value) {
271
+ return Ext.isBoolean(value) ? value : ('Y' === value) || ('true' === value);
272
+ };
273
+ break;
274
+
275
+ default:
276
+ break;
277
+ }
278
+ return [cConfig, storeRecordType, convert];
195
279
  },
196
280
  },
197
281
 
@@ -260,6 +260,9 @@ Ext.define('Coon.report.component.SimplestReportCombo', {
260
260
  },
261
261
 
262
262
  onComplete: function(map) {
263
+ if (this.destroyed) {
264
+ return;
265
+ };
263
266
  this.setBusy(false);
264
267
  if (this.DANGEROUS_AMOUNT_OF_DATA && map.length > this.DANGEROUS_AMOUNT_OF_DATA) {
265
268
  if (this.getCutDangerousAmount()) {
@@ -97,11 +97,6 @@ Ext.define('Coon.report.component.settings.ReportPropertiesGrid', {
97
97
  editor: {
98
98
  xtype: 'textfield',
99
99
  allowBlank: false,
100
- // validateOnChange: true,
101
- // regex: /^[^xtype]+$/,
102
- // listeners: {
103
- // change: 'checkValidation',
104
- // },
105
100
  },
106
101
  },
107
102
  {
@@ -383,47 +383,4 @@ Ext.define('Coon.report.component.settings.ReportPropertiesGridController', {
383
383
  win.down('UiAceEditor').setValue(value);
384
384
  win.down('UiAceEditor').editor.focus();
385
385
  },
386
-
387
- // checkValidation: function(field) {
388
- // const value = field.getValue().toLowerCase();
389
- // if (value === 'xtype') {
390
- // Ext.Msg.alert('Ошибка', 'Запрещен ручной ввод "xtype"');
391
- // }
392
- // },
393
-
394
- setXtypeColumn: function(_, record) {
395
- const xtypeColumn = record.getData().xtype;
396
- const viewModel = this.getViewModel();
397
- const properties = viewModel.get('fieldsGrid.selection.properties') || viewModel.get('parametersGrid.selection.properties');
398
- const description = Ext.ComponentQuery.query(xtypeColumn)[0]?.$metaConfig?.description;
399
- const index = properties.find((el) => el.key === 'xtype');
400
-
401
- if (index) {
402
- properties.forEach((item) => {
403
- item.key === 'xtype' ? item.value = xtypeColumn : null;
404
- });
405
- } else {
406
- properties.push({
407
- isDeleted: false,
408
- isNew: true,
409
- key: 'xtype',
410
- value: xtypeColumn,
411
- sequenceNumber: properties.length + 1,
412
- });
413
- }
414
-
415
- this.setDescriptionColumn(description);
416
-
417
- this.setData(properties);
418
- },
419
-
420
- setDescriptionColumn: function(description) {
421
- const viewModel = this.getViewModel();
422
-
423
- if (description) {
424
- viewModel.set('descriptionColumn', description);
425
- } else {
426
- viewModel.set('descriptionColumn', 'Нет описания');
427
- }
428
- },
429
386
  });
@@ -4,6 +4,7 @@ Ext.define('Coon.report.component.settings.field.ReportFormFieldEditPanel', {
4
4
  controller: 'reportformfieldeditpanelcontroller',
5
5
  uses: [],
6
6
  requires: [
7
+ 'Coon.report.component.settings.ReportPropertiesGrid',
7
8
  'Coon.report.component.settings.field.ReportFormFieldsGrid'
8
9
  ],
9
10
  alternateClassName: [
@@ -174,6 +174,5 @@ Ext.define('Coon.report.component.settings.field.ReportFormFieldsGrid', {
174
174
  listeners: {
175
175
  drop: 'onDrop',
176
176
  rowcontextmenu: 'showContextMenu',
177
- selectionchange: 'saveSelectedTypeColumn',
178
177
  },
179
178
  });
@@ -298,10 +298,4 @@ Ext.define('Coon.report.component.settings.ReportFormFieldsGridController', {
298
298
  const view = this.getView();
299
299
  view.publishState('data', view.getData(true));
300
300
  },
301
-
302
- saveSelectedTypeColumn: function(_, selected) {
303
- const viewModel = this.getViewModel();
304
- const selectedType = selected[0]?.getData().reportFieldTypeLookup ?? selected[0]?.getData().reportParameterTypeLookup;
305
- Coon.report.component.settings.ReportFormConfigProperties.getSelectedTypeColumn(selected, viewModel, selectedType);
306
- },
307
301
  });
@@ -234,8 +234,4 @@ Ext.define('Coon.report.component.settings.parameter.ReportFormParametersGrid',
234
234
  {ptype: 'rowediting', clicksToEdit: 2}
235
235
  // {ptype: 'gridexporter'}
236
236
  ],
237
-
238
- listeners: {
239
- selectionchange: 'saveSelectedTypeColumn',
240
- },
241
237
  });
@@ -94,10 +94,4 @@ Ext.define('Coon.report.component.settings.ReportFormParametersGridController',
94
94
  Ext.Msg.alert('Сообщение системы', 'Отчет не имеет параметров');
95
95
  }
96
96
  },
97
-
98
- saveSelectedTypeColumn: function(_, selected) {
99
- const viewModel = this.getViewModel();
100
- const selectedType = selected[0]?.getData().reportFieldTypeLookup ?? selected[0]?.getData().reportParameterTypeLookup;
101
- Coon.report.component.settings.ReportFormConfigProperties.getSelectedTypeColumn(selected, viewModel, selectedType);
102
- },
103
97
  });
@@ -63,6 +63,11 @@ Ext.define('Coon.uielement.component.UiCPWrapper', {
63
63
 
64
64
  renderPanel: function(panelConfig) {
65
65
  const config = Object.assign({}, panelConfig, this.initConfig);
66
+ config.inheritViewModel = this.inheritViewModel;
67
+ if (this.inheritViewModel) {
68
+ const parentViewModel = this.findParentByType('UiCustomPanel').getViewModel();
69
+ config.viewModel = parentViewModel;
70
+ }
66
71
  const panel = Ext.create('widget.UiCustomPanel', config);
67
72
  this.uiPanel = panel;
68
73
  panel.on('afterrender', function() {
@@ -57,4 +57,26 @@ Ext.define('Coon.uielement.component.UiCustomPanel', {
57
57
 
58
58
  copyLink: false,
59
59
 
60
+ initComponent() {
61
+ if (!this.inheritViewModel) {
62
+ this.viewModel = this.viewModel || {type: 'UiCustomPanelViewModel'};
63
+ this.viewModel.data = this.viewModel.data || {};
64
+ this.viewModel = {
65
+ data: Ext.applyIf(this.viewModel.data, this.getViewModelData()),
66
+ };
67
+ }
68
+ this.callParent();
69
+ },
70
+
71
+ getViewModelData() {
72
+ const data = {};
73
+ const addDoInitSupportPlugin = this.plugins && this.plugins.find((plugin) => plugin.ptype === 'AddDoInitSupportPlugin');
74
+ if (addDoInitSupportPlugin) {
75
+ addDoInitSupportPlugin.parametersToModel.forEach((param) => {
76
+ data[param.value] = undefined;
77
+ });
78
+ }
79
+ return data;
80
+ },
81
+
60
82
  });
@@ -59,10 +59,9 @@ Ext.define('Coon.uielement.plugin.AddDoInitSupportPlugin', {
59
59
  }
60
60
  const dataMapping = this.getInputParams();
61
61
  parameters.forEach((el, index) => {
62
- if (!this.validatePath(dataMapping[index].valuePath)) {
63
- return;
62
+ if (this.validatePath(dataMapping[index].valuePath) && (el !== null)) {
63
+ this.vm.set(dataMapping[index].valuePath, el);
64
64
  }
65
- this.vm.set(dataMapping[index].valuePath, el || null);
66
65
  });
67
66
  },
68
67
 
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.8.54',
3
+ number: '2.8.56',
4
4
  });
@@ -1,98 +0,0 @@
1
- Ext.define('Coon.report.component.reportpanel.ReportGridDataType', {
2
- statics: {
3
- convertFloatFn: Coon.format.parseFloat,
4
- convertDateTime(value) {
5
- return Ext.Date.parse(value, Coon.format.dateTimeInternal);
6
- },
7
- convertDate(value) {
8
- if (!Ext.Date.parse(value, Coon.format.dateInternal)) {
9
- value = Ext.Date.format(
10
- Coon.report.component.reportpanel.ReportGridColumnMap.convertDateTime(value),
11
- Coon.format.dateInternal
12
- );
13
- }
14
- return Ext.Date.parse(value, Coon.format.dateInternal);
15
- },
16
-
17
- getTypeConfig(typeOfValue) {
18
- const cConfig = {
19
- xtype: 'HintColumn',
20
- filter: {type: 'string'},
21
- }; // по-умолчанию
22
-
23
- let storeRecordType = 'string';
24
- let convert = undefined;
25
-
26
- switch (typeOfValue) {
27
- case 'DATETIME':
28
- cConfig.xtype = 'HintDateColumn';
29
- cConfig.format = Coon.format.timeDate;
30
- storeRecordType = 'date';
31
- convert = this.convertDateTime;
32
- break;
33
- case 'TIME':
34
- cConfig.xtype = 'HintDateColumn';
35
- cConfig.format = Coon.format.time;
36
- storeRecordType = 'date';
37
- convert = this.convertDateTime;
38
- break;
39
- case 'DATE':
40
- cConfig.xtype = 'HintDateColumn';
41
- cConfig.format = Coon.format.date;
42
- cConfig.filter = {type: 'date'};
43
- cConfig.align = 'right';
44
- storeRecordType = 'date';
45
- convert = this.convertDate;
46
- break;
47
-
48
- case 'MONEY':
49
- cConfig.xtype = 'MoneyColumn';
50
- cConfig.filter = {type: 'numeric'};
51
- storeRecordType = 'float';
52
- convert = this.convertFloatFn;
53
- break;
54
-
55
- case 'DECIMAL':
56
- cConfig.xtype = 'BigNumColumn';
57
- cConfig.filter = {type: 'numeric'};
58
- storeRecordType = 'float';
59
- convert = this.convertFloatFn;
60
- break;
61
-
62
- case 'INTEGER':
63
- cConfig.xtype = 'BigNumColumn';
64
- cConfig.filter = {type: 'numeric'};
65
- cConfig.precision = 0;
66
- storeRecordType = 'float';
67
- convert = this.convertFloatFn;
68
- break;
69
-
70
- case 'BOOLEAN':
71
- cConfig.xtype = 'checkcolumn';
72
- cConfig.stopSelection = false;
73
- cConfig.allowSelect = false;
74
- cConfig.filterType = 'boolean';
75
- cConfig.listeners = {
76
- beforecheckchange: function() {
77
- const panel = this.findParentByType('ReportPanel');
78
- if (panel && panel.readOnly) {
79
- return false;
80
- }
81
- return this.allowSelect || this.stopSelection;
82
- },
83
- };
84
- cConfig.precision = 0;
85
- cConfig.filter = {type: 'boolean'};
86
- storeRecordType = 'boolean';
87
- convert = function(value) {
88
- return Ext.isBoolean(value) ? value : ('Y' === value) || ('true' === value);
89
- };
90
- break;
91
-
92
- default:
93
- break;
94
- }
95
- return [cConfig, storeRecordType, convert];
96
- },
97
- },
98
- });
@@ -1,36 +0,0 @@
1
- Ext.define('Coon.report.component.settings.ReportFormConfigProperties', {
2
- statics: {
3
- getSelectedTypeColumn: function(selected, viewModel, selectedType) {
4
- const [cConfig] = Coon.report.component.reportpanel.ReportGridDataType.getTypeConfig(selectedType);
5
- let description = null;
6
- let xtypeInProperties = null;
7
-
8
- selected[0]?.getData().properties.forEach((item) => {
9
- if (item.key === 'xtype') {
10
- xtypeInProperties = item.value;
11
- }
12
- });
13
-
14
- if (xtypeInProperties) {
15
- viewModel.set('typeColumn', xtypeInProperties);
16
- description = Ext.ComponentQuery.query(xtypeInProperties)[0].$metaConfig?.description;
17
- this.setDescriptionColumn(description);
18
- return;
19
- }
20
-
21
- description = Ext.ComponentQuery.query(cConfig.xtype)[0].$metaConfig?.description;
22
-
23
- this.setDescriptionColumn(description, viewModel);
24
-
25
- viewModel.set('typeColumn', cConfig.xtype);
26
- },
27
-
28
- setDescriptionColumn: function(description, viewModel) {
29
- if (description) {
30
- viewModel.set('descriptionColumn', description);
31
- } else {
32
- viewModel.set('descriptionColumn', 'Нет описания');
33
- }
34
- },
35
- },
36
- });
@@ -1,64 +0,0 @@
1
- Ext.define('Coon.report.component.settings.ReportPropertiesGridFields', {
2
- extend: 'Coon.report.component.settings.ReportPropertiesGrid',
3
- alias: 'widget.ReportPropertiesGridFields',
4
-
5
- initComponent: function() {
6
- this.callParent();
7
-
8
- this.addDocked({
9
- xtype: 'toolbar',
10
- dataIndex: 'reportParameterTypeLookup',
11
- dock: 'top',
12
- itemId: 'bottomToolbar',
13
- layout: 'vbox',
14
- items: [
15
- {
16
- xtype: 'container',
17
- layout: 'hbox',
18
- margin: '10 0 0 10',
19
- items: [
20
- {
21
- xtype: 'label',
22
- text: 'xtype:',
23
- margin: '10 30 0 0',
24
- },
25
- {
26
- xtype: 'XTypeComboBox',
27
- name: 'reportParameterTypeLookup',
28
- width: '40vw',
29
- flex: 1,
30
- fieldStyle: 'text-align: center;',
31
- bind: '{typeColumn}',
32
- listeners: {
33
- select: 'setXtypeColumn',
34
- },
35
- validator(value) {
36
- const isValid = this.getStore()
37
- .findBy((record) => record.get('description') === value || record.get('xtype') === value) !== -1;
38
- return isValid || `xtype ${value} не найден!`;
39
- },
40
- }
41
- ],
42
- }, {
43
- xtype: 'container',
44
- layout: 'hbox',
45
- margin: '10 0 0 0',
46
- items: [
47
- {
48
- xtype: 'label',
49
- text: 'Описание:',
50
- margin: '10 10 0 0',
51
- },
52
- {
53
- xtype: 'textarea',
54
- readOnly: true,
55
- width: '39vw',
56
- bind: '{descriptionColumn}',
57
- fieldStyle: 'border: 1px solid #3d6780; border-radius: 4px; padding: 5px; text-align: center;',
58
- }
59
- ],
60
- }
61
- ],
62
- });
63
- },
64
- });