ru.coon 2.8.42 → 2.8.44
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 +13 -6
- package/package.json +1 -1
- package/src/app/viewPort/CenterViewController.js +60 -74
- package/src/common/component/formeditor/UiCFCell.js +3 -0
- package/src/common/component/formeditor/UiCFCellController.js +15 -0
- package/src/log.js +17 -7
- package/src/report/component/ReportPanel.js +21 -27
- package/src/report/component/reportpanel/CopyReportPanelController.js +1 -1
- package/src/report/component/reportpanel/FilterPanel.js +15 -13
- package/src/report/component/reportpanel/FilterPanel.scss +0 -14
- package/src/report/component/reportpanel/NorthPanel.js +15 -15
- package/src/report/component/settings/property/ReportPropertiesPanelController.js +1 -1
- package/src/report/component/settings/property/ReportPropertyDictionary.js +0 -7
- package/src/report/plugin/form/ReportGroupsFieldValidationPlugin.js +12 -12
- package/src/report/plugin/grid/ExecuteCallbackFunctionPlugin.js +1 -0
- package/src/version.js +1 -1
- package/src/report/component/reportpanel/FormFieldFocusPlugin.js +0 -150
package/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
# Version 2.8.
|
|
1
|
+
# Version 2.8.44, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/50df0b225f3a1efaaa05828e6445e74667856840)
|
|
2
|
+
* ## Features
|
|
3
|
+
* <span style='color:green'>feat: HT-11254: Доработана возможность прокидывать функции в свойства элементов</span> ([94e499], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/94e499f50bc145ebc6fca12a75905ae0fb82b54b))
|
|
4
|
+
|
|
5
|
+
* update: CHANGELOG.md ([eaa39d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/eaa39d7b4b4c67e22b2c457a513e3f7aa0489a5c))
|
|
6
|
+
|
|
7
|
+
# Version 2.8.43, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/044b4f591c34eb73673a766fb6a59c361900e9c7)
|
|
8
|
+
# Version 2.8.42, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3167961fc1b81e3228f4b35669e8a58561bb2aa4)
|
|
9
|
+
* ## Features
|
|
10
|
+
* <span style='color:green'>feat: HT-11274: Скрываю части текста в зависимости от количества ошибок</span> ([2b896d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2b896d31464c3b9376f86cc774c02e6eccf2477b))
|
|
11
|
+
|
|
2
12
|
* ## Fixes
|
|
3
|
-
* <span style='color:red'>fix
|
|
4
|
-
* <span style='color:red'>
|
|
13
|
+
* <span style='color:red'>fix</span> ([ad1bcd], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ad1bcdfd3f50ea1aba06dc737671706a81bb5f0e))
|
|
14
|
+
* <span style='color:red'> made plugin deprecated</span> ([69e1bd], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/69e1bde0543dbb757fe91d7545cf6b3de36624b5))
|
|
5
15
|
|
|
6
16
|
* update: CHANGELOG.md ([1ead0c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1ead0c63f6c4c0423354ab2f41d5b5cb03eb7e0f))
|
|
7
17
|
|
|
@@ -22,7 +32,6 @@
|
|
|
22
32
|
* ## Fixes
|
|
23
33
|
* <span style='color:red'> HT-11130 FilterConditionToolbar location and width</span> ([9dddf6], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9dddf6739c500bb2a1f5a2a6558a9021ff40f192))
|
|
24
34
|
|
|
25
|
-
* HT-11129 устранение замечаний ([3fa826], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3fa826c9c083ac3f95266555b5dcb257bf5446fa))
|
|
26
35
|
* update: CHANGELOG.md ([2191ec], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2191eceb941229d37de6cafd03e47132a38fe8ec))
|
|
27
36
|
|
|
28
37
|
# Version 2.8.39, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4b6a41e64accf9c50f08e6404130431c4543fdb3)
|
|
@@ -35,7 +44,6 @@
|
|
|
35
44
|
* ## Features
|
|
36
45
|
* <span style='color:green'>feat: opa show user roles in roleEditPanel</span> ([3e4b47], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3e4b47dd951b1869d3bf3814dad6a035c6607fc2))
|
|
37
46
|
|
|
38
|
-
* HT-11129 бэкграунд полей с фокусом у FilterPanel ([496dfb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/496dfb646a59d9c13c8989a5b40eb3179eb64c44))
|
|
39
47
|
* update: CHANGELOG.md ([73d1e1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/73d1e1c828d201e6ae53c19106feed024cfb6c56))
|
|
40
48
|
|
|
41
49
|
# Version 2.8.37, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c1a016edfea1ebf863a02984d5a9589c69d75de3)
|
|
@@ -59,7 +67,6 @@
|
|
|
59
67
|
* <span style='color:red'> edit user roles</span> ([939a2d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/939a2d6bb50daddd8ed265c04f9e355e53c37098))
|
|
60
68
|
|
|
61
69
|
* Revert "Merge branch 'TR-69858' into 'develop'" ([f03f50], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f03f5087de3f78048cfa554985fe342ebfcb2792))
|
|
62
|
-
* HT-11129 :feat Переход по элементам формы при нажатии клавиши «Tab». Новый плагин для FilterPanel ([08785a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/08785a94165969ea406a8f894272414d71f0d778))
|
|
63
70
|
* update: CHANGELOG.md ([a4a1e9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a4a1e9873b0dbaf25ab17d854eb3bfee81924d0f))
|
|
64
71
|
|
|
65
72
|
# Version 2.8.34, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/74999de9bdff9c55e4f0b1d8840558559f532fa8)
|
package/package.json
CHANGED
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
Ext.define('Coon.app.viewPort.CenterViewController', {
|
|
2
2
|
extend: 'Ext.app.ViewController',
|
|
3
3
|
alias: 'controller.CenterViewController',
|
|
4
|
-
|
|
5
|
-
requires: [
|
|
6
|
-
'Coon.util',
|
|
7
|
-
'Coon.Function'
|
|
8
|
-
],
|
|
9
|
-
|
|
4
|
+
requires: ['Coon.util', 'Coon.Function'],
|
|
10
5
|
cache: new Map(),
|
|
11
|
-
|
|
12
6
|
privates: {
|
|
13
7
|
paramsToObject(params) {
|
|
14
8
|
const entries = [];
|
|
@@ -48,81 +42,21 @@ Ext.define('Coon.app.viewPort.CenterViewController', {
|
|
|
48
42
|
typeof c.doInit === 'function' && c.doInit.call(c, id);
|
|
49
43
|
},
|
|
50
44
|
},
|
|
51
|
-
|
|
52
|
-
getPanelConfig(id, filterDefaults, paramsObject) {
|
|
53
|
-
return Coon.util.promisifyCmd(
|
|
54
|
-
'Coon.uielement.command.GetUIElementCommand',
|
|
55
|
-
id
|
|
56
|
-
).then((config) => {
|
|
57
|
-
if (typeof config === 'object') {
|
|
58
|
-
if (typeof config.propertyData === 'string') {
|
|
59
|
-
config.propertyData = JSON5.parse(
|
|
60
|
-
config.propertyData,
|
|
61
|
-
(key, value) => {
|
|
62
|
-
if (value === 'true') {
|
|
63
|
-
return true;
|
|
64
|
-
}
|
|
65
|
-
if (value === 'false') {
|
|
66
|
-
return false;
|
|
67
|
-
}
|
|
68
|
-
return value;
|
|
69
|
-
}
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
config = Object.assign(
|
|
73
|
-
{xtype: config.xtype, itemId: id},
|
|
74
|
-
config.propertyData
|
|
75
|
-
);
|
|
76
|
-
if (config.xtype === 'ReportPanel') {
|
|
77
|
-
Object.assign(config, {
|
|
78
|
-
filterDefaults,
|
|
79
|
-
listeners: {
|
|
80
|
-
'router:activate': this.onActivateComponent.bind(
|
|
81
|
-
this,
|
|
82
|
-
paramsObject
|
|
83
|
-
),
|
|
84
|
-
},
|
|
85
|
-
});
|
|
86
|
-
} else if (config.xtype === 'UiCustomPanel') {
|
|
87
|
-
Object.assign(config, {
|
|
88
|
-
listeners: {
|
|
89
|
-
'router:activate': this.onActivateComponent.bind(
|
|
90
|
-
this,
|
|
91
|
-
paramsObject
|
|
92
|
-
),
|
|
93
|
-
'afterrender': (panel) =>
|
|
94
|
-
Coon.Function.executeComponentDoInit(panel, paramsObject),
|
|
95
|
-
},
|
|
96
|
-
});
|
|
97
|
-
} else {
|
|
98
|
-
Object.assign(config, {
|
|
99
|
-
listeners: {
|
|
100
|
-
'afterrender': (panel) =>
|
|
101
|
-
Coon.Function.executeComponentDoInit(panel, paramsObject),
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
return config;
|
|
107
|
-
});
|
|
108
|
-
},
|
|
109
|
-
|
|
110
45
|
async create(id, type = 'panel', params = [], useCache = true) {
|
|
46
|
+
const cacheKey = useCache && JSON.stringify({id, type, params});
|
|
111
47
|
let config;
|
|
112
48
|
if (!id) {
|
|
113
49
|
return config;
|
|
114
50
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
51
|
+
if (cacheKey) {
|
|
52
|
+
const cached = this.cache.get(cacheKey);
|
|
53
|
+
if (cached) {
|
|
54
|
+
return cached;
|
|
55
|
+
}
|
|
120
56
|
}
|
|
121
|
-
|
|
122
57
|
const paramsObject = this.paramsToObject(params);
|
|
123
58
|
const filterDefaults =
|
|
124
59
|
(paramsObject && Object.assign(paramsObject, {doFilter: true})) || {};
|
|
125
|
-
|
|
126
60
|
switch (String(type).toUpperCase()) {
|
|
127
61
|
case 'REPORT':
|
|
128
62
|
config = {
|
|
@@ -139,7 +73,59 @@ Ext.define('Coon.app.viewPort.CenterViewController', {
|
|
|
139
73
|
break;
|
|
140
74
|
case 'PANEL':
|
|
141
75
|
try {
|
|
142
|
-
config = await
|
|
76
|
+
config = await Coon.util.promisifyCmd(
|
|
77
|
+
'Coon.uielement.command.GetUIElementCommand',
|
|
78
|
+
id
|
|
79
|
+
);
|
|
80
|
+
if (typeof config === 'object') {
|
|
81
|
+
if (typeof config.propertyData === 'string') {
|
|
82
|
+
config.propertyData = JSON5.parse(
|
|
83
|
+
config.propertyData,
|
|
84
|
+
(key, value) => {
|
|
85
|
+
if (value === 'true') {
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
if (value === 'false') {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
config = Object.assign(
|
|
96
|
+
{xtype: config.xtype, itemId: id},
|
|
97
|
+
config.propertyData
|
|
98
|
+
);
|
|
99
|
+
if (config.xtype === 'ReportPanel') {
|
|
100
|
+
Object.assign(config, {
|
|
101
|
+
filterDefaults,
|
|
102
|
+
listeners: {
|
|
103
|
+
'router:activate': this.onActivateComponent.bind(
|
|
104
|
+
this,
|
|
105
|
+
paramsObject
|
|
106
|
+
),
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
} else if (config.xtype === 'UiCustomPanel') {
|
|
110
|
+
Object.assign(config, {
|
|
111
|
+
listeners: {
|
|
112
|
+
'router:activate': this.onActivateComponent.bind(
|
|
113
|
+
this,
|
|
114
|
+
paramsObject
|
|
115
|
+
),
|
|
116
|
+
'afterrender': (panel) =>
|
|
117
|
+
Coon.Function.executeComponentDoInit(panel, paramsObject),
|
|
118
|
+
},
|
|
119
|
+
});
|
|
120
|
+
} else {
|
|
121
|
+
Object.assign(config, {
|
|
122
|
+
listeners: {
|
|
123
|
+
'afterrender': (panel) =>
|
|
124
|
+
Coon.Function.executeComponentDoInit(panel, paramsObject),
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
}
|
|
143
129
|
} catch (e) {
|
|
144
130
|
Coon.log.error(e.message);
|
|
145
131
|
}
|
|
@@ -9,6 +9,21 @@ Ext.define('Coon.common.component.formeditor.UiCFCellController', {
|
|
|
9
9
|
this.setDefaultMenuItems();
|
|
10
10
|
this.initMouseEvents();
|
|
11
11
|
},
|
|
12
|
+
onBeforeAdd(cell, component, index, eOpts) {
|
|
13
|
+
// console.log(component);
|
|
14
|
+
if (component.initialConfig.rawCfg) {
|
|
15
|
+
Object.keys(component.initialConfig.rawCfg).forEach((key) => {
|
|
16
|
+
const value = component.initialConfig.rawCfg[key]+'';
|
|
17
|
+
if (value && Coon.format.startsWith(value, 'function')) {
|
|
18
|
+
try {
|
|
19
|
+
component[key] = eval('(' + value + ')').call(component);
|
|
20
|
+
} catch (e) {
|
|
21
|
+
Coon.log.error(`[UiCFCellController] for property:${key} & value:${value}, error: ${e}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
},
|
|
12
27
|
setDefaultMenuItems() {
|
|
13
28
|
const rowCnt = this.getUiCFRowController();
|
|
14
29
|
this.menuItems = {
|
package/src/log.js
CHANGED
|
@@ -15,11 +15,13 @@ Ext.define('Coon.log', {
|
|
|
15
15
|
|
|
16
16
|
locals: {},
|
|
17
17
|
|
|
18
|
-
constructor(
|
|
18
|
+
constructor() {
|
|
19
19
|
const me = this;
|
|
20
|
-
this.initConfig(config);
|
|
21
20
|
if (!this.getInit() && this.isDebug) {
|
|
22
21
|
this.setInit(true);
|
|
22
|
+
if (this.isDebug) {
|
|
23
|
+
this.injectViewer();
|
|
24
|
+
}
|
|
23
25
|
}
|
|
24
26
|
this.consoleError = window.console.error;
|
|
25
27
|
this.getConsoleError = function() {
|
|
@@ -32,16 +34,15 @@ Ext.define('Coon.log', {
|
|
|
32
34
|
},
|
|
33
35
|
|
|
34
36
|
subscribeToLogErrors() {
|
|
35
|
-
const me = this;
|
|
36
37
|
Ext.on('appready', function() {
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
Coon.log.getConsoleError().error = function(...args) {
|
|
39
|
+
Coon.log.error(...args);
|
|
39
40
|
};
|
|
40
41
|
window.onerror = function(msg, url, lineNumber) {
|
|
41
|
-
|
|
42
|
+
Coon.log.error(`at line: ${lineNumber} ${msg}`);
|
|
42
43
|
};
|
|
43
44
|
window.addEventListener('unhandledrejection', function(e) {
|
|
44
|
-
|
|
45
|
+
Coon.log.error(e.reason.message);
|
|
45
46
|
return false;
|
|
46
47
|
});
|
|
47
48
|
});
|
|
@@ -68,6 +69,15 @@ Ext.define('Coon.log', {
|
|
|
68
69
|
cmp && Coon.log.debug(cmp.$className, cmp.xtype, Coon.log.searchXtype(cmp));
|
|
69
70
|
},
|
|
70
71
|
|
|
72
|
+
injectViewer() {
|
|
73
|
+
document.body.addEventListener('mouseover', (e) => {
|
|
74
|
+
if (Coon.log.getPopup()) {
|
|
75
|
+
const id = e.target.id;
|
|
76
|
+
Coon.log.handler(id);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
},
|
|
80
|
+
|
|
71
81
|
isDebug: !!['1', 'true'].includes(Ext.util.Cookies.get('coon_log_debug')),
|
|
72
82
|
|
|
73
83
|
setDebug(flag) {
|
|
@@ -338,14 +338,7 @@ Ext.define('Coon.report.component.ReportPanel', {
|
|
|
338
338
|
|
|
339
339
|
this.layout = 'card';
|
|
340
340
|
|
|
341
|
-
this.
|
|
342
|
-
|
|
343
|
-
// для совместимости со старым кодом.
|
|
344
|
-
this.dockedItems = [].concat(this.dockedItems || []);
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
this.dockedItems.push({
|
|
348
|
-
xtype: 'NorthPanel',
|
|
341
|
+
this.northPanel = Ext.widget('NorthPanel', {
|
|
349
342
|
hideFilterPanel: this.hideFilterPanel,
|
|
350
343
|
hideFilterButtons: this.hideFilterButtons,
|
|
351
344
|
findButtonConfig: this.findButtonConfig || {},
|
|
@@ -357,23 +350,7 @@ Ext.define('Coon.report.component.ReportPanel', {
|
|
|
357
350
|
header: false,
|
|
358
351
|
});
|
|
359
352
|
|
|
360
|
-
this.
|
|
361
|
-
Ext.apply(this.centerProperties, {
|
|
362
|
-
xtype: 'panel',
|
|
363
|
-
itemId: 'centerPanel',
|
|
364
|
-
region: 'center',
|
|
365
|
-
minHeight: 100,
|
|
366
|
-
layout: 'fit',
|
|
367
|
-
cls: 'buttonsCenterFilterPanel',
|
|
368
|
-
})
|
|
369
|
-
];
|
|
370
|
-
|
|
371
|
-
this.callParent();
|
|
372
|
-
|
|
373
|
-
this.centerPanel = this.down('panel#centerPanel');
|
|
374
|
-
this.northPanel = this.down('NorthPanel');
|
|
375
|
-
this.filterContainer = this.northPanel.filterContainer;
|
|
376
|
-
|
|
353
|
+
this._visibleFieldsMap = new Map();
|
|
377
354
|
this.northPanel.on('hide', function() {
|
|
378
355
|
this.query('[validate][isReportFilterField][hidden=false]').forEach((field) => {
|
|
379
356
|
this._visibleFieldsMap.set(field, field.hidden);
|
|
@@ -388,6 +365,24 @@ Ext.define('Coon.report.component.ReportPanel', {
|
|
|
388
365
|
});
|
|
389
366
|
}, this);
|
|
390
367
|
|
|
368
|
+
// для совместимости со старым кодом.
|
|
369
|
+
this.filterContainer = this.northPanel.filterContainer;
|
|
370
|
+
this.centerPanel = Ext.widget('panel', Ext.apply(this.centerProperties, {
|
|
371
|
+
region: 'center',
|
|
372
|
+
minHeight: 100,
|
|
373
|
+
layout: 'fit',
|
|
374
|
+
cls: 'buttonsCenterFilterPanel',
|
|
375
|
+
}));
|
|
376
|
+
this.dockedItems = [].concat(this.dockedItems || []);
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
this.dockedItems.push(this.northPanel);
|
|
380
|
+
|
|
381
|
+
this.items = [
|
|
382
|
+
this.centerPanel
|
|
383
|
+
];
|
|
384
|
+
|
|
385
|
+
this.callParent();
|
|
391
386
|
|
|
392
387
|
if (this.reportID) {
|
|
393
388
|
this.reportId = this.reportID;
|
|
@@ -722,8 +717,7 @@ Ext.define('Coon.report.component.ReportPanel', {
|
|
|
722
717
|
return acc;
|
|
723
718
|
}, new Map());
|
|
724
719
|
|
|
725
|
-
|
|
726
|
-
Ext.merge(this, configProperties, {configProperties});
|
|
720
|
+
Ext.merge(this, Coon.Function.convertAdvancedProperties(reportFormBean[ns.$properties]));
|
|
727
721
|
if (this.getToggleFilterPanel() && !this.hideFilterPanel) {
|
|
728
722
|
this.addTool({
|
|
729
723
|
iconCls: 'x-fa fa-eye-slash',
|
|
@@ -159,7 +159,7 @@ Ext.define('Coon.report.component.reportpanel.CopyReportPanelController', {
|
|
|
159
159
|
.catch((error) => {
|
|
160
160
|
Coon.log.debug(error);
|
|
161
161
|
this.getViewModel().set('isReportIDValid', false);
|
|
162
|
-
this.lookup('copyToFieldRef')
|
|
162
|
+
this.lookup('copyToFieldRef').markInvalid('ReportID уже существует!');
|
|
163
163
|
Ext.Msg.alert('Ошибка', error.toString());
|
|
164
164
|
})
|
|
165
165
|
.finally(() => {
|
|
@@ -66,7 +66,8 @@ Ext.define('Coon.report.component.reportpanel.FilterPanel', {
|
|
|
66
66
|
let rowCount = 0;
|
|
67
67
|
for (let i = 0; i < configurationList.length; i++) {
|
|
68
68
|
const configuration = configurationList[i];
|
|
69
|
-
|
|
69
|
+
const ns = Coon.report.model.ReportParameterBeanFields;
|
|
70
|
+
if (currentLayout === null || (visibleCount >= this.itemsOnRow && configuration[ns.$visibleSwitch])) {
|
|
70
71
|
if (currentLayout !== null) {
|
|
71
72
|
height += currentLayout.height;
|
|
72
73
|
this.items.push(currentLayout);
|
|
@@ -92,7 +93,7 @@ Ext.define('Coon.report.component.reportpanel.FilterPanel', {
|
|
|
92
93
|
currentLayout.height = configuration.height;
|
|
93
94
|
}
|
|
94
95
|
const filterItem = this.createFilterItem(configuration);
|
|
95
|
-
if (configuration
|
|
96
|
+
if (configuration[ns.$visibleSwitch]) {
|
|
96
97
|
visibleCount += configuration.weight;
|
|
97
98
|
}
|
|
98
99
|
currentLayout.add(filterItem);
|
|
@@ -120,14 +121,15 @@ Ext.define('Coon.report.component.reportpanel.FilterPanel', {
|
|
|
120
121
|
},
|
|
121
122
|
|
|
122
123
|
createFilterItem: function(configuration) {
|
|
124
|
+
const ns = Coon.report.model.ReportParameterBeanFields;
|
|
125
|
+
|
|
123
126
|
const defaultConfig = {
|
|
124
127
|
// isReportFilterField флаг, позволяющий компоненту понимать,что он является частью фильтр панели отчета.
|
|
125
128
|
isReportFilterField: true,
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
name: configuration.reportParameterCd,
|
|
129
|
+
fieldLabel: configuration[ns.$description],
|
|
130
|
+
allowBlank: !configuration[ns.$requiredSwitch],
|
|
131
|
+
hidden: !configuration[ns.$visibleSwitch],
|
|
132
|
+
name: configuration[ns.$reportParameterCd],
|
|
131
133
|
labelWidth: configuration.labelWidth || 80,
|
|
132
134
|
triggers: {
|
|
133
135
|
clear: {
|
|
@@ -143,7 +145,7 @@ Ext.define('Coon.report.component.reportpanel.FilterPanel', {
|
|
|
143
145
|
},
|
|
144
146
|
};
|
|
145
147
|
let config;
|
|
146
|
-
switch (configuration
|
|
148
|
+
switch (configuration[ns.$reportParameterTypeLookup]) {
|
|
147
149
|
case 'DATETIME':
|
|
148
150
|
config = {
|
|
149
151
|
xtype: 'DateTimeField',
|
|
@@ -166,10 +168,10 @@ Ext.define('Coon.report.component.reportpanel.FilterPanel', {
|
|
|
166
168
|
};
|
|
167
169
|
break;
|
|
168
170
|
case 'DATE':
|
|
169
|
-
if (configuration
|
|
171
|
+
if (configuration[ns.$properties]['periodEnd']) {
|
|
170
172
|
config = Object.assign(
|
|
171
173
|
{xtype: 'DatePickerPresetsField'},
|
|
172
|
-
configuration
|
|
174
|
+
configuration[ns.$properties]
|
|
173
175
|
);
|
|
174
176
|
} else {
|
|
175
177
|
config = {
|
|
@@ -203,15 +205,15 @@ Ext.define('Coon.report.component.reportpanel.FilterPanel', {
|
|
|
203
205
|
break;
|
|
204
206
|
}
|
|
205
207
|
|
|
206
|
-
config = Ext.apply(config, Coon.Function.convertAdvancedProperties(configuration
|
|
208
|
+
config = Ext.apply(config, Coon.Function.convertAdvancedProperties(configuration[ns.$properties]), defaultConfig);
|
|
207
209
|
if (!Ext.isDefined(config.width) && !Ext.isDefined(config.flex)) {
|
|
208
210
|
config.flex = 1;
|
|
209
211
|
}
|
|
210
212
|
const field = Ext.widget(config);
|
|
211
213
|
field.on('change', this.setClearTrigger, this);
|
|
212
214
|
// Установка значения по-умолчанию
|
|
213
|
-
const value = configuration
|
|
214
|
-
const visibleValue = configuration
|
|
215
|
+
const value = configuration[ns.$defaultValue];
|
|
216
|
+
const visibleValue = configuration[ns.$defaultValueDescription];
|
|
215
217
|
if (!Ext.isEmpty(value)) {
|
|
216
218
|
field.on('afterrender', function() {
|
|
217
219
|
field.setValue(value);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
$focus-background-color: rgba(254, 249, 233, 1) !default;
|
|
2
1
|
.FilterPanel {
|
|
3
2
|
.x-form-type-checkbox {
|
|
4
3
|
|
|
@@ -12,19 +11,6 @@ $focus-background-color: rgba(254, 249, 233, 1) !default;
|
|
|
12
11
|
//.x-form-text-field-body-default {
|
|
13
12
|
// background-color: rgba(87,255,93,0.19) !important;
|
|
14
13
|
//}
|
|
15
|
-
.x-field:has(*:focus) {
|
|
16
|
-
background-color: $focus-background-color;
|
|
17
|
-
background-clip: content-box;
|
|
18
|
-
|
|
19
|
-
.x-form-item-body {
|
|
20
|
-
background-color: $focus-background-color;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.x-form-cb-wrap-inner:has(*:focus) {
|
|
25
|
-
background-color: $focus-background-color;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
14
|
}
|
|
29
15
|
|
|
30
16
|
|
|
@@ -137,12 +137,17 @@ Ext.define('Coon.report.component.report.NorthPanel', {
|
|
|
137
137
|
}
|
|
138
138
|
];
|
|
139
139
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
this.
|
|
145
|
-
|
|
140
|
+
/**
|
|
141
|
+
* Только при добавлении компонента в ReportPanel можно получить ссылку на родителя
|
|
142
|
+
*/
|
|
143
|
+
this.on('added', function() {
|
|
144
|
+
this.reportPanel = this.findParentByType('ReportPanel') || this.findParentByType('ReportFilterForm');
|
|
145
|
+
this.searchButton.handler = this.reportPanel ? Ext.bind(this.reportPanel.filterHandler, this.reportPanel) : Ext.emptyFn;
|
|
146
|
+
this.clearButton.handler = Ext.bind(function() {
|
|
147
|
+
this.clearFilter();
|
|
148
|
+
this.clearData();
|
|
149
|
+
}, this.reportPanel);
|
|
150
|
+
}, this);
|
|
146
151
|
|
|
147
152
|
this.callParent();
|
|
148
153
|
},
|
|
@@ -161,26 +166,21 @@ Ext.define('Coon.report.component.report.NorthPanel', {
|
|
|
161
166
|
},
|
|
162
167
|
|
|
163
168
|
configureFilterPanel: function(reportFormBean) {
|
|
164
|
-
const
|
|
165
|
-
const properties =
|
|
166
|
-
Coon.Function.convertAdvancedProperties(reportFormBean.properties) || {};
|
|
169
|
+
const ns = Coon.report.model.ReportBeanFields;
|
|
170
|
+
const properties = Coon.Function.convertAdvancedProperties(reportFormBean[ns.$properties]) || {};
|
|
167
171
|
Ext.merge(this, properties);
|
|
168
172
|
this.filterPlugins.push({
|
|
169
173
|
ptype: 'EnterConfirmFormPlugin',
|
|
170
174
|
confirmHandler: this.reportPanel ? Ext.bind(this.reportPanel.filterHandler, this.reportPanel) : Ext.emptyFn,
|
|
171
175
|
});
|
|
172
|
-
this.filterPlugins.push({
|
|
173
|
-
ptype: 'FormFieldFocusPlugin',
|
|
174
|
-
defaultFocusFirstField: true,
|
|
175
|
-
});
|
|
176
176
|
|
|
177
177
|
const [enableHighlightingRequiredFields, hiddenLegend] = this.hasPropertiesFilterPanel(reportFormBean.plugins, properties);
|
|
178
178
|
this.hiddenLegend = !!hiddenLegend;
|
|
179
179
|
this.enableHighlightingRequiredFields = enableHighlightingRequiredFields;
|
|
180
180
|
const filterPanel = Ext.widget('FilterPanel', {
|
|
181
|
-
configurationList: reportFormBean
|
|
181
|
+
configurationList: reportFormBean[ns.$parameters],
|
|
182
182
|
itemsOnRow: properties['filterItemsOnRow'] || 2,
|
|
183
|
-
enableHighlightingRequiredFields,
|
|
183
|
+
enableHighlightingRequiredFields: enableHighlightingRequiredFields,
|
|
184
184
|
plugins: this.filterPlugins,
|
|
185
185
|
});
|
|
186
186
|
this.filterPanel = filterPanel;
|
|
@@ -119,7 +119,7 @@ Ext.define('Coon.report.component.settings.property.ReportPropertiesPanelControl
|
|
|
119
119
|
const editor = this.getPropertyValueEditor(record);
|
|
120
120
|
if (editor && typeof editor.setValue === 'function') {
|
|
121
121
|
this.lookup('propertyValueContainer').add(editor);
|
|
122
|
-
editor.setBind({value: '{propertyGrid.selection.value
|
|
122
|
+
editor.setBind({value: '{propertyGrid.selection.value}'});
|
|
123
123
|
} else {
|
|
124
124
|
Coon.log.debug('HASN`T EDITOR', record.getData(), editor);
|
|
125
125
|
}
|
|
@@ -193,13 +193,6 @@ Ext.define('Coon.report.component.settings.property.ReportPropertyDictionary', {
|
|
|
193
193
|
leaf: true,
|
|
194
194
|
singleValue: true,
|
|
195
195
|
description: 'Свойство даёт возможность скрывать/показывать признак обязательности заполнения полей.',
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
id: 'formFieldFocusPluginConfig',
|
|
199
|
-
leaf: true,
|
|
200
|
-
defaultVal: '{disabled: false, defaultFocusFirstField: true}',
|
|
201
|
-
description: 'Свойства, передаваемые плагину formFieldFocusPlugin, используемому в фильтр панели репорта ',
|
|
202
|
-
propertyValueType: 'object',
|
|
203
196
|
}
|
|
204
197
|
],
|
|
205
198
|
},
|
|
@@ -118,9 +118,11 @@ Ext.define('Coon.report.plugin.form.ReportGroupsFieldValidationPlugin', {
|
|
|
118
118
|
}
|
|
119
119
|
} else {
|
|
120
120
|
valid = true;
|
|
121
|
+
let counter = 0;
|
|
121
122
|
for (const group of groups) {
|
|
122
123
|
if (!this.checkValidityOfGroup(group)) {
|
|
123
124
|
invalidMessage += `${group.checkResult}`;
|
|
125
|
+
counter++;
|
|
124
126
|
valid = false;
|
|
125
127
|
}
|
|
126
128
|
}
|
|
@@ -133,9 +135,7 @@ Ext.define('Coon.report.plugin.form.ReportGroupsFieldValidationPlugin', {
|
|
|
133
135
|
}, this);
|
|
134
136
|
}
|
|
135
137
|
if (invalidMessage) {
|
|
136
|
-
invalidMessage =
|
|
137
|
-
<ul>${invalidMessage}</ul>
|
|
138
|
-
`;
|
|
138
|
+
invalidMessage = (counter > 1 ? 'Все группы полей обязательны для заполнения: ' : '') + `<ul>${invalidMessage}</ul>`;
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
return {valid, invalidMessage};
|
|
@@ -160,7 +160,7 @@ Ext.define('Coon.report.plugin.form.ReportGroupsFieldValidationPlugin', {
|
|
|
160
160
|
}
|
|
161
161
|
if (this.isPluginEnabled(currentField)) {
|
|
162
162
|
currentField.changeFieldFlag(Ext.isEmpty(currentField.getValue()));
|
|
163
|
-
currentField.setFlagColor(Ext.isEmpty(currentField.getValue()) ? this.requiredFieldColorState1: this.requiredFieldColorState2);
|
|
163
|
+
currentField.setFlagColor(Ext.isEmpty(currentField.getValue()) ? this.requiredFieldColorState1 : this.requiredFieldColorState2);
|
|
164
164
|
}
|
|
165
165
|
}
|
|
166
166
|
group.checkResult = this.getCheckResultAnd(valid, group);
|
|
@@ -219,9 +219,9 @@ Ext.define('Coon.report.plugin.form.ReportGroupsFieldValidationPlugin', {
|
|
|
219
219
|
|
|
220
220
|
if (!group.invertValue) {
|
|
221
221
|
return !valid ?
|
|
222
|
-
this.fieldCount(group)===1 ?
|
|
223
|
-
`<li>Поле ${fieldNames} не заполнено.</li
|
|
224
|
-
`<li>Все поля группы (${fieldNames}) обязательны для заполнения.</li
|
|
222
|
+
this.fieldCount(group) === 1 ?
|
|
223
|
+
`<li>Поле ${fieldNames} не заполнено.</li>` :
|
|
224
|
+
`<li>Все поля группы (${fieldNames}) обязательны для заполнения.</li>` :
|
|
225
225
|
'';
|
|
226
226
|
} else {
|
|
227
227
|
// Инвертирование пока отключено
|
|
@@ -229,7 +229,7 @@ Ext.define('Coon.report.plugin.form.ReportGroupsFieldValidationPlugin', {
|
|
|
229
229
|
// !(true && true)=false
|
|
230
230
|
// !(true && false)=true
|
|
231
231
|
// !(false && false)=true
|
|
232
|
-
return !valid ? '': `<li>Из группы параметров (${fieldNames}) хотя бы один должен быть не заполнен`;
|
|
232
|
+
return !valid ? '' : `<li>Из группы параметров (${fieldNames}) хотя бы один должен быть не заполнен`;
|
|
233
233
|
}
|
|
234
234
|
},
|
|
235
235
|
|
|
@@ -243,9 +243,9 @@ Ext.define('Coon.report.plugin.form.ReportGroupsFieldValidationPlugin', {
|
|
|
243
243
|
const fieldNames = this.wrapFieldNames(group);
|
|
244
244
|
if (!group.invertValue) {
|
|
245
245
|
return !valid ?
|
|
246
|
-
this.fieldCount(group)===1 ?
|
|
247
|
-
`<li>Поле ${fieldNames} не заполнено.</li
|
|
248
|
-
`<li>Хотя бы одно из полей группы (${fieldNames}) обязательно для заполнения.</li
|
|
246
|
+
this.fieldCount(group) === 1 ?
|
|
247
|
+
`<li>Поле ${fieldNames} не заполнено.</li>` :
|
|
248
|
+
`<li>Хотя бы одно из полей группы (${fieldNames}) обязательно для заполнения.</li>` :
|
|
249
249
|
'';
|
|
250
250
|
} else {
|
|
251
251
|
// Инвертирование пока отключено
|
|
@@ -253,7 +253,7 @@ Ext.define('Coon.report.plugin.form.ReportGroupsFieldValidationPlugin', {
|
|
|
253
253
|
// !(false || false)=true
|
|
254
254
|
// !(false || true)=false
|
|
255
255
|
// !(true || true)=false
|
|
256
|
-
return !valid ? '': `<li>Все поля (${fieldNames}) группы
|
|
256
|
+
return !valid ? '' : `<li>Все поля (${fieldNames}) группы д. быть пустыми.`;
|
|
257
257
|
}
|
|
258
258
|
},
|
|
259
259
|
});
|
package/src/version.js
CHANGED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Плагин нормализует поведение переноса фокуса с поля на поле в FilterPanel по нажатию TAB и SHIFT+TAB.
|
|
3
|
-
* Включает на полях формы свойство enableKeyEvents.
|
|
4
|
-
*/
|
|
5
|
-
Ext.define('Coon.report.component.reportpanel.FormFieldFocusPlugin', {
|
|
6
|
-
extend: 'Ext.AbstractPlugin',
|
|
7
|
-
alias: 'plugin.FormFieldFocusPlugin',
|
|
8
|
-
id: 'FormFieldFocusPlugin',
|
|
9
|
-
// Установить фокус по умолчанию на первое поле
|
|
10
|
-
defaultFocusFirstField: true,
|
|
11
|
-
// Установить фокус на это поле.
|
|
12
|
-
defaultFocusField: undefined,
|
|
13
|
-
// Отключение плагина можно сделать путем установки свойства репорта formFieldFocusPluginConfig
|
|
14
|
-
disabled: false,
|
|
15
|
-
|
|
16
|
-
constructor: function(config) {
|
|
17
|
-
Ext.apply(this, config || {});
|
|
18
|
-
this.callParent([config]);
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
init: function(formPanel) {
|
|
22
|
-
const report = formPanel.reportPanel;
|
|
23
|
-
if (report) {
|
|
24
|
-
const config = report.configProperties.get('formFieldFocusPluginConfig');
|
|
25
|
-
if (Ext.isObject(config) && config.disabled) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
this.fields = Coon.Function.getFormFields(formPanel);
|
|
30
|
-
if (!this.fields.length) {
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
this.getCmp().on('afterrender', function() {
|
|
35
|
-
this.preprocessFields();
|
|
36
|
-
this.setFocus();
|
|
37
|
-
const centerView = this.getCmp().up('centerview');
|
|
38
|
-
if (centerView) {
|
|
39
|
-
const container = centerView.getLayout().getActiveItem();
|
|
40
|
-
container.on('activate', this.restoreFocus, this);
|
|
41
|
-
}
|
|
42
|
-
}, this);
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
getFields() {
|
|
46
|
-
return this.fields.filter((field) => this.isFieldFocusable(field));
|
|
47
|
-
},
|
|
48
|
-
|
|
49
|
-
buildFieldFocusIds() {
|
|
50
|
-
this.visibleFields = this.getFields();
|
|
51
|
-
this.visibleFields
|
|
52
|
-
.forEach((field, idx) => {
|
|
53
|
-
this.setFieldFocusId(field, idx);
|
|
54
|
-
}, this);
|
|
55
|
-
},
|
|
56
|
-
|
|
57
|
-
setFieldFocusId(field, idx) {
|
|
58
|
-
const fieldsCount = this.visibleFields.length;
|
|
59
|
-
field.prevFocusId = idx === 0 ? fieldsCount - 1 : idx - 1;
|
|
60
|
-
field.focusId = idx;
|
|
61
|
-
field.nextFocusId = idx === fieldsCount - 1 ? 0 : idx + 1;
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
preprocessFields() {
|
|
65
|
-
this.fields.sort(function(a, b) {
|
|
66
|
-
return a.orderSq - b.orderSq;
|
|
67
|
-
});
|
|
68
|
-
this.buildFieldFocusIds();
|
|
69
|
-
this.visibleFields
|
|
70
|
-
.forEach((field, idx) => {
|
|
71
|
-
if (field.defaultFocus) {
|
|
72
|
-
this.defaultFocusField = field;
|
|
73
|
-
}
|
|
74
|
-
this.setFieldFocusId(field, idx);
|
|
75
|
-
field.enableKeyEvents = true;
|
|
76
|
-
field.on({
|
|
77
|
-
specialkey: this.onSpecialkeyPress,
|
|
78
|
-
focus() {
|
|
79
|
-
this.setLastFocus(idx);
|
|
80
|
-
},
|
|
81
|
-
show: this.buildFieldFocusIds,
|
|
82
|
-
hide: this.buildFieldFocusIds,
|
|
83
|
-
scope: this,
|
|
84
|
-
});
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
setFocus() {
|
|
89
|
-
if (!this.visibleFields.length) {
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
if (this.defaultFocusFirstField) {
|
|
93
|
-
let fieldForFocus = this.defaultFocusField;
|
|
94
|
-
if (!fieldForFocus && this.defaultFocusFirstField) {
|
|
95
|
-
if (this.isFieldFocusable(this.visibleFields[0])) {
|
|
96
|
-
fieldForFocus = this.visibleFields[0].focus(false, 100);
|
|
97
|
-
} else {
|
|
98
|
-
fieldForFocus = this.getNextField(this.visibleFields[0]);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (fieldForFocus && this.isFieldFocusable(fieldForFocus)) {
|
|
102
|
-
fieldForFocus.focus(false, 100);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
restoreFocus() {
|
|
108
|
-
const lastFocusedFIeld = this.getLastFocusedFIeld();
|
|
109
|
-
if (lastFocusedFIeld) {
|
|
110
|
-
lastFocusedFIeld.focus(false, 100);
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
|
|
115
|
-
getFieldByFocusId(focusId) {
|
|
116
|
-
return this.getCmp().down(`[focusId=${focusId}]`);
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
getNextField(field) {
|
|
120
|
-
return this.getFieldByFocusId(field.nextFocusId);
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
getPrevField(field) {
|
|
124
|
-
return this.getFieldByFocusId(field.prevFocusId);
|
|
125
|
-
},
|
|
126
|
-
|
|
127
|
-
setLastFocus(focusId) {
|
|
128
|
-
this.lastFocusId = focusId;
|
|
129
|
-
},
|
|
130
|
-
|
|
131
|
-
getLastFocusedFIeld() {
|
|
132
|
-
const field = this.getFieldByFocusId(this.lastFocusId) || this.visibleFields[0];
|
|
133
|
-
return this.isFieldFocusable(field) && field;
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
onSpecialkeyPress: function(field, e) {
|
|
137
|
-
const shiftKey = e.shiftKey;
|
|
138
|
-
if (e.keyCode === e.TAB) {
|
|
139
|
-
e.stopEvent();
|
|
140
|
-
const nextFocusField = shiftKey ? this.getPrevField(field) : this.getNextField(field);
|
|
141
|
-
if (nextFocusField) {
|
|
142
|
-
nextFocusField.focus(false, 100);
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
|
|
147
|
-
isFieldFocusable(field) {
|
|
148
|
-
return field && !field.isHidden() && !field.readOnly && field.focusable;
|
|
149
|
-
},
|
|
150
|
-
});
|