ru.coon 3.0.53 → 3.0.55
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 +15 -0
- package/package.json +1 -1
- package/src/common/component/editor/EditorFactory.js +8 -0
- package/src/report/component/ReportPanel.js +19 -0
- package/src/report/component/reportpanel/ReportGrid.js +1 -8
- package/src/report/plugin/configPanel/GridToolbarButtonPluginConfigPanel.js +42 -21
- package/src/report/plugin/configPanel/GridToolbarButtonPluginConfigPanel.scss +5 -0
- package/src/report/plugin/configPanel/OpenURLButtonPluginConfigPanel.js +12 -1
- package/src/report/plugin/configPanel/RestoreSelectionPluginConfigPanel.js +1 -0
- package/src/report/plugin/configPanel/SelectionModelPluginConfigPanel.js +30 -6
- package/src/report/plugin/configPanel/SummaryPluginConfigPanelSummaryGrid.js +1 -1
- package/src/report/plugin/configPanel/openCustomPanelButtonPlugin/OpenCustomPanelButtonPluginConfigPanel.js +18 -47
- package/src/report/plugin/configPanel/openCustomPanelButtonPlugin/OpenCustomPanelButtonPluginConfigPanel.scss +0 -5
- package/src/report/plugin/grid/GridContextPlugin.js +98 -55
- package/src/report/plugin/grid/GridToolbarButtonPlugin.js +197 -94
- package/src/report/plugin/grid/OpenCustomPanelButtonPlugin.js +0 -23
- package/src/report/plugin/grid/ReportColumnStatePlugin.js +4 -1
- package/src/report/plugin/grid/SelectionModelPlugin.js +174 -95
- package/src/report/plugin/grid/SelectionModelPlugin.scss +8 -5
- package/src/report/plugin/report/BindCustomPanelPlugin.js +13 -22
- package/src/report/store/ReportFieldStore.js +0 -1
- package/src/uielement/component/settings/UiAceEditor.scss +3 -0
- package/src/util.js +1 -1
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
# Version 3.0.55, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3aa9d1a7bd56ffe2e12a7470620065930b6c9002)
|
|
2
|
+
* ## Fixes
|
|
3
|
+
* <span style='color:red'>fix HT-14573: DFVCharacteristicField completeEdit on select</span> ([683c19], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/683c19de5c78219346d6529d1f223afe16b480c5))
|
|
4
|
+
|
|
5
|
+
* HT-14532 feat: Четыре режима SelectionModelPlugin ([92c4a8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/92c4a8edcf4fd2cf79633732cd2e801a8ee4fd53))
|
|
6
|
+
* HT-13994: исправление ошибок при удалении колонок ([d47f7a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d47f7a00098c312b2ea2a665dfbea5aebfe0e9ac))
|
|
7
|
+
* update: CHANGELOG.md ([af2f08], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/af2f08fd3487b410c8ea7b7824da5a43289c4444))
|
|
8
|
+
|
|
9
|
+
# Version 3.0.54, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/91b425e436e17c3f26aa3c6eabb1c23ac52686c1)
|
|
10
|
+
* ## Fixes
|
|
11
|
+
* <span style='color:red'> src/util:mapObject acc[rule.to] or defValue</span> ([f2355c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f2355c41590bd574c51fdd6ed4a231ef59c29477))
|
|
12
|
+
|
|
13
|
+
* add scss ([1a6380], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1a63800f3db4aa3b5e29853fc2c71058f19dba42))
|
|
14
|
+
* update: CHANGELOG.md ([614a25], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/614a25f19071b375b0a09d2e771c8d7df2d63313))
|
|
15
|
+
|
|
1
16
|
# Version 3.0.53, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/18d790002292ecd0650d868dca06ddcf668fcede)
|
|
2
17
|
* ## Features
|
|
3
18
|
* <span style='color:green'>feat: NEVA-974: bug fix. Передаю нужный контекст</span> ([22bb87], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/22bb870b28bdafac81dca86804b482e6e365c9c8))
|
package/package.json
CHANGED
|
@@ -348,9 +348,17 @@ Ext.define('Coon.common.component.editor.DFVTypeEditor', {
|
|
|
348
348
|
this.field.on('load', function() {
|
|
349
349
|
this.field.setValue(value);
|
|
350
350
|
}, this, {single: true});
|
|
351
|
+
this.field.on('select', this.afterEdit, this);
|
|
351
352
|
this.field.doInit();
|
|
352
353
|
}
|
|
353
354
|
},
|
|
355
|
+
|
|
356
|
+
afterEdit: function() {
|
|
357
|
+
this.completeEdit && this.completeEdit();
|
|
358
|
+
if (this.boundEl || (this.context && this.context.getCell)) {
|
|
359
|
+
this.restoreCell();
|
|
360
|
+
}
|
|
361
|
+
},
|
|
354
362
|
});
|
|
355
363
|
|
|
356
364
|
/**
|
|
@@ -721,6 +721,7 @@ Ext.define('Coon.report.component.ReportPanel', {
|
|
|
721
721
|
|
|
722
722
|
configureGrid: function(ReportBean) {
|
|
723
723
|
this.grid = this.createGrid(ReportBean);
|
|
724
|
+
this.grid.getPluginProperty = (key) => this.getPluginProperty(key, this.grid);
|
|
724
725
|
// this.grid.on('added', this.chipsInit, this);
|
|
725
726
|
this.centerPanel.add(this.grid);
|
|
726
727
|
this.initGridEvents();
|
|
@@ -850,6 +851,7 @@ Ext.define('Coon.report.component.ReportPanel', {
|
|
|
850
851
|
configureNorthPanel: function(reportFormBean) {
|
|
851
852
|
this.northPanel.filterPlugins = this.getPluginConfigByType('FILTER_PLUGIN', 'p');
|
|
852
853
|
this.northPanel.configureFilterPanel(reportFormBean);
|
|
854
|
+
this.northPanel.getPluginProperty = (key) => this.getPluginProperty(key, this.northPanel.filterPanel);
|
|
853
855
|
},
|
|
854
856
|
|
|
855
857
|
getPluginConfigByType: function(type, prefix, pluginList) {
|
|
@@ -1292,4 +1294,21 @@ Ext.define('Coon.report.component.ReportPanel', {
|
|
|
1292
1294
|
}
|
|
1293
1295
|
return this.grid.getStore().getDataSource().getCount() === 0;
|
|
1294
1296
|
},
|
|
1297
|
+
|
|
1298
|
+
/**
|
|
1299
|
+
* Способ получения свойства плагина в контексте scope. Если scope не передается, то поиск плагина будет в контексте отчета.
|
|
1300
|
+
* Плагин и свойство задаются в строке key с разделителем "точка".
|
|
1301
|
+
* @param {String} key плагин плюс свойство плагина
|
|
1302
|
+
* @param scope контекст
|
|
1303
|
+
* @returns {*|undefined}
|
|
1304
|
+
*/
|
|
1305
|
+
getPluginProperty(key, scope) {
|
|
1306
|
+
scope = scope || this;
|
|
1307
|
+
if (!Ext.isString(key) || !/\./.test(key)) {
|
|
1308
|
+
return;
|
|
1309
|
+
}
|
|
1310
|
+
const [pluginName, propertyName] = key.split('.');
|
|
1311
|
+
const plugin = scope.findPlugin(pluginName);
|
|
1312
|
+
return plugin ? plugin[propertyName] : undefined;
|
|
1313
|
+
},
|
|
1295
1314
|
});
|
|
@@ -116,14 +116,7 @@ Ext.define('Coon.report.component.reportpanel.ReportGrid', {
|
|
|
116
116
|
},
|
|
117
117
|
|
|
118
118
|
getCheckedRecords() {
|
|
119
|
-
|
|
120
|
-
return this.checkedRecords;
|
|
121
|
-
} else if (this.findPlugin('SelectionModelPlugin')?.defaultMode) {
|
|
122
|
-
// В этой конфигурации плагина реализована синхронизация выделения с чекбоксами.
|
|
123
|
-
return this.getSelectionModel().getSelection();
|
|
124
|
-
} else {
|
|
125
|
-
return this.checkedRecords;
|
|
126
|
-
}
|
|
119
|
+
return this.checkedRecords;
|
|
127
120
|
},
|
|
128
121
|
|
|
129
122
|
getFeature(ftype) {
|
|
@@ -205,27 +205,6 @@ Ext.define('Coon.report.plugin.configPanel.GridToolbarButtonPluginConfigPanel',
|
|
|
205
205
|
},
|
|
206
206
|
|
|
207
207
|
controller: {
|
|
208
|
-
bindings: {
|
|
209
|
-
onContextChange: '{context}',
|
|
210
|
-
},
|
|
211
|
-
|
|
212
|
-
onContextChange(context) {
|
|
213
|
-
const dependOnGridParameters = this.view.down('[name=dependOnGridParameters]');
|
|
214
|
-
if (dependOnGridParameters) {
|
|
215
|
-
const data = JSON.parse(JSON.stringify(context.parameters));
|
|
216
|
-
data.map((item) => {
|
|
217
|
-
item.descriptionFull = `${item.reportParameterCd} (${item.description})`;
|
|
218
|
-
return item;
|
|
219
|
-
});
|
|
220
|
-
const store = dependOnGridParameters.getStore();
|
|
221
|
-
store.loadData(data);
|
|
222
|
-
|
|
223
|
-
// hack: to visually display value in the field
|
|
224
|
-
const values = dependOnGridParameters.getValue();
|
|
225
|
-
dependOnGridParameters.setValue(values);
|
|
226
|
-
}
|
|
227
|
-
},
|
|
228
|
-
|
|
229
208
|
setHideMsgValue() {
|
|
230
209
|
this.getViewModel().set('hideAddActionColumnMsg',
|
|
231
210
|
this.lookup('actionColumnRef').collapsed ||
|
|
@@ -234,6 +213,28 @@ Ext.define('Coon.report.plugin.configPanel.GridToolbarButtonPluginConfigPanel',
|
|
|
234
213
|
},
|
|
235
214
|
},
|
|
236
215
|
|
|
216
|
+
setContext: function(context) {
|
|
217
|
+
this.callParent(arguments);
|
|
218
|
+
const dependOnGridParameter = this.down('[name=dependOnGridParameters]');
|
|
219
|
+
if (dependOnGridParameter) {
|
|
220
|
+
const data = context.parameters.map((item) => {
|
|
221
|
+
item.descriptionFull = `${item.reportParameterCd} (${item.description})`;
|
|
222
|
+
return item;
|
|
223
|
+
});
|
|
224
|
+
dependOnGridParameter.getStore().loadData(data);
|
|
225
|
+
}
|
|
226
|
+
const reportFieldsCombo = this.down('[name=singleClickDataIndex]');
|
|
227
|
+
if (reportFieldsCombo) {
|
|
228
|
+
const reportFields = context.fields.map(
|
|
229
|
+
({viewComboDescription: description, reportFieldCd: value}) => ({
|
|
230
|
+
value,
|
|
231
|
+
description,
|
|
232
|
+
})
|
|
233
|
+
);
|
|
234
|
+
reportFieldsCombo.getStore().loadData(reportFields);
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
|
|
237
238
|
createActionColumnFieldSet: function() {
|
|
238
239
|
return {
|
|
239
240
|
xtype: 'fieldset',
|
|
@@ -275,4 +276,24 @@ Ext.define('Coon.report.plugin.configPanel.GridToolbarButtonPluginConfigPanel',
|
|
|
275
276
|
name: 'handleNewObjectEvent',
|
|
276
277
|
};
|
|
277
278
|
},
|
|
279
|
+
|
|
280
|
+
createActOnOnSingleClickControl() {
|
|
281
|
+
return {
|
|
282
|
+
xtype: 'BaseComboBox',
|
|
283
|
+
loadOnRender: false,
|
|
284
|
+
displayField: 'description',
|
|
285
|
+
valueField: 'value',
|
|
286
|
+
store: {
|
|
287
|
+
fields: ['description', 'value'],
|
|
288
|
+
},
|
|
289
|
+
fieldLabel: 'Активировать по одиночному клику на поле',
|
|
290
|
+
name: 'singleClickDataIndex',
|
|
291
|
+
bind: {
|
|
292
|
+
disabled: '{actOnDoubleClick.checked}',
|
|
293
|
+
},
|
|
294
|
+
reference: 'singleClickDataIndexRef',
|
|
295
|
+
flex: 1,
|
|
296
|
+
resettable: true,
|
|
297
|
+
};
|
|
298
|
+
},
|
|
278
299
|
});
|
|
@@ -59,7 +59,18 @@ Ext.define('Coon.report.plugin.configPanel.OpenURLButtonPluginConfigPanel', {
|
|
|
59
59
|
this.createDependsOnGridRow(),
|
|
60
60
|
this.createDependsOnGridParameter(),
|
|
61
61
|
this.createAddButtonPanel(),
|
|
62
|
-
|
|
62
|
+
{
|
|
63
|
+
xtype: 'fieldset',
|
|
64
|
+
items: [
|
|
65
|
+
Object.assign(this.createActOnDoubleClickCheckBox(), {
|
|
66
|
+
reference: 'actOnDoubleClick',
|
|
67
|
+
bind: {
|
|
68
|
+
disabled: '{!singleClickDataIndexRef.selection}',
|
|
69
|
+
},
|
|
70
|
+
}),
|
|
71
|
+
this.createActOnOnSingleClickControl()
|
|
72
|
+
],
|
|
73
|
+
},
|
|
63
74
|
this.createHotKeyPanel(),
|
|
64
75
|
this.createVisibilityKeyPanel(),
|
|
65
76
|
this.url,
|
|
@@ -39,19 +39,43 @@ Ext.define('Coon.report.plugin.configPanel.SelectionModelPluginConfigPanel', {
|
|
|
39
39
|
value: '{description}',
|
|
40
40
|
},
|
|
41
41
|
},
|
|
42
|
+
// {
|
|
43
|
+
// xtype: 'checkbox',
|
|
44
|
+
// boxLabel: 'Режим по умолчанию',
|
|
45
|
+
// bind: {
|
|
46
|
+
// value: '{defaultMode}',
|
|
47
|
+
// },
|
|
48
|
+
// readOnly: true,
|
|
49
|
+
// },
|
|
42
50
|
{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
51
|
+
html: `Описание режимов плагина SelectionModelPlugin в
|
|
52
|
+
<a href="https://confluence.sigma-it.ru/pages/viewpage.action?pageId=619754033" target="_blank">
|
|
53
|
+
confluence.sigma-it.ru.
|
|
54
|
+
</a>`,
|
|
55
|
+
padding: '0 0 10px',
|
|
48
56
|
},
|
|
49
57
|
{
|
|
50
|
-
|
|
58
|
+
xtype: 'radiogroup',
|
|
59
|
+
simpleValue: true,
|
|
60
|
+
vertical: true,
|
|
61
|
+
columns: 1,
|
|
62
|
+
items: [
|
|
63
|
+
{boxLabel: 'гибрид(по умолчанию SINGLE)', inputValue: 'hybridSingleDefault', checked: true},
|
|
64
|
+
{boxLabel: 'гибрид(по умолчанию MULTI)', inputValue: 'hybridMultiDefault'},
|
|
65
|
+
{boxLabel: 'только SINGLE(колонка с чекбоксами скрыта)', inputValue: 'singleOnly'},
|
|
66
|
+
{boxLabel: 'только MULTI', inputValue: 'multiOnly'}
|
|
67
|
+
],
|
|
68
|
+
reference: 'defaultModeVariants',
|
|
69
|
+
// disabled: true,
|
|
70
|
+
bind: {
|
|
71
|
+
// disabled: '{!defaultMode}',
|
|
72
|
+
value: '{defaultModeVariant}',
|
|
73
|
+
},
|
|
51
74
|
},
|
|
52
75
|
{
|
|
53
76
|
xtype: 'container',
|
|
54
77
|
margin: '20 0 0 0',
|
|
78
|
+
hidden: true,
|
|
55
79
|
bind: {
|
|
56
80
|
disabled: '{defaultMode}',
|
|
57
81
|
},
|
|
@@ -50,7 +50,7 @@ Ext.define('Coon.report.plugin.configPanel.SummaryPluginConfigPanelSummaryGrid',
|
|
|
50
50
|
['min', 'min (Минимальное значение в столбце)'],
|
|
51
51
|
['max', 'max (Максимальное значение в столбце)'],
|
|
52
52
|
['count', 'count (Количество значений в столбце)'],
|
|
53
|
-
['average', 'average (Среднее
|
|
53
|
+
['average', 'average (Среднее значение в столбце)'],
|
|
54
54
|
['unique', 'unique (Кастомная функция агрегации, указывается с помощью summaryRenderer в свойствах поля)']
|
|
55
55
|
],
|
|
56
56
|
};
|
|
@@ -47,11 +47,28 @@ Ext.define('Coon.report.plugin.configPanel.OpenCustomPanelButtonPluginConfigPane
|
|
|
47
47
|
this.createAddButtonPanel(),
|
|
48
48
|
{
|
|
49
49
|
xtype: 'fieldset',
|
|
50
|
+
title: 'активация по одинарному/двойному клику мышью(взаимоисключающие)',
|
|
51
|
+
layout: {type: 'hbox', align: 'middle'},
|
|
52
|
+
defaults: {
|
|
53
|
+
frame: true,
|
|
54
|
+
flex: 1,
|
|
55
|
+
},
|
|
50
56
|
items: [
|
|
57
|
+
{
|
|
58
|
+
xtype: 'button',
|
|
59
|
+
maxWidth: 130,
|
|
60
|
+
margin: '0 18 0 0',
|
|
61
|
+
text: 'отменить',
|
|
62
|
+
handler(btn) {
|
|
63
|
+
const view = btn.up('fieldset');
|
|
64
|
+
view.query('combo, checkbox:not(#mouseActivationBlock)')
|
|
65
|
+
.forEach((field) => field.reset());
|
|
66
|
+
},
|
|
67
|
+
},
|
|
51
68
|
Object.assign(this.createActOnDoubleClickCheckBox(), {
|
|
52
69
|
reference: 'actOnDoubleClick',
|
|
53
70
|
bind: {
|
|
54
|
-
disabled: '{
|
|
71
|
+
disabled: '{singleClickDataIndexRef.selection}',
|
|
55
72
|
},
|
|
56
73
|
}),
|
|
57
74
|
this.createActOnOnSingleClickControl()
|
|
@@ -62,7 +79,6 @@ Ext.define('Coon.report.plugin.configPanel.OpenCustomPanelButtonPluginConfigPane
|
|
|
62
79
|
this.createNewObjectCreated(),
|
|
63
80
|
{
|
|
64
81
|
boxLabel: 'Открыть экземпляр старой версии биллинга',
|
|
65
|
-
|
|
66
82
|
xtype: 'checkbox',
|
|
67
83
|
name: 'oldFrame',
|
|
68
84
|
},
|
|
@@ -319,14 +335,6 @@ Ext.define('Coon.report.plugin.configPanel.OpenCustomPanelButtonPluginConfigPane
|
|
|
319
335
|
gridSourceMapping.updateParametersList(context.parameters);
|
|
320
336
|
gridSourceMapping.updateTypeEditor(context.additionalContext);
|
|
321
337
|
}
|
|
322
|
-
this.reportFieldsCombo.getStore().loadData(
|
|
323
|
-
context.fields.map(
|
|
324
|
-
({viewComboDescription: description, reportFieldCd: value}) => ({
|
|
325
|
-
value,
|
|
326
|
-
description,
|
|
327
|
-
})
|
|
328
|
-
)
|
|
329
|
-
);
|
|
330
338
|
},
|
|
331
339
|
|
|
332
340
|
doInit: function(config) {
|
|
@@ -513,41 +521,4 @@ Ext.define('Coon.report.plugin.configPanel.OpenCustomPanelButtonPluginConfigPane
|
|
|
513
521
|
],
|
|
514
522
|
};
|
|
515
523
|
},
|
|
516
|
-
|
|
517
|
-
createActOnOnSingleClickControl() {
|
|
518
|
-
this.reportFieldsCombo = Ext.create({
|
|
519
|
-
xtype: 'BaseComboBox',
|
|
520
|
-
loadOnRender: false,
|
|
521
|
-
displayField: 'description',
|
|
522
|
-
valueField: 'value',
|
|
523
|
-
store: Ext.create('Coon.report.store.RefStore'),
|
|
524
|
-
fieldLabel: 'Поле',
|
|
525
|
-
name: 'singleClickDataIndex',
|
|
526
|
-
bind: {
|
|
527
|
-
disabled: '{!actOnSingleClick.checked}',
|
|
528
|
-
},
|
|
529
|
-
flex: 1,
|
|
530
|
-
});
|
|
531
|
-
return {
|
|
532
|
-
xtype: 'fieldcontainer',
|
|
533
|
-
layout: {
|
|
534
|
-
type: 'vbox',
|
|
535
|
-
align: 'stretch',
|
|
536
|
-
},
|
|
537
|
-
items: [
|
|
538
|
-
{
|
|
539
|
-
xtype: 'checkbox',
|
|
540
|
-
boxLabel: 'Активировать по одиночному клику на поле',
|
|
541
|
-
boxLabelAlign: 'after',
|
|
542
|
-
reference: 'actOnSingleClick',
|
|
543
|
-
name: 'actOnSingleClick',
|
|
544
|
-
bind: {
|
|
545
|
-
disabled: '{actOnDoubleClick.checked}',
|
|
546
|
-
},
|
|
547
|
-
flex: 1,
|
|
548
|
-
},
|
|
549
|
-
this.reportFieldsCombo
|
|
550
|
-
],
|
|
551
|
-
};
|
|
552
|
-
},
|
|
553
524
|
});
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Плагин, который управляет контекстом грида, возвращает из него необходимые параметры
|
|
3
|
+
* При обновлении контекста формируется события:
|
|
4
|
+
* - contextchange.load
|
|
5
|
+
* - contextchange.selectionchange
|
|
6
|
+
* - contextchange.clear
|
|
7
|
+
* - contextchange.filterchange
|
|
8
|
+
* Подписавшись на эти события можно получать обновленный контекст.
|
|
3
9
|
*/
|
|
4
10
|
Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
5
11
|
extend: 'Ext.AbstractPlugin',
|
|
6
12
|
alias: 'plugin.GridContextPlugin',
|
|
13
|
+
mixins: [
|
|
14
|
+
'Ext.mixin.Observable'
|
|
15
|
+
],
|
|
7
16
|
alternateClassName: [
|
|
8
17
|
'Sigma.common.plugin.grid.GridContextPlugin'
|
|
9
18
|
],
|
|
@@ -12,24 +21,45 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
12
21
|
* Для определения контекстной записи мы сохраняем в переменной lastClickedRecord ссылку на запись грида, на которой произошло событие itemclick
|
|
13
22
|
*/
|
|
14
23
|
lastClickedRecord: undefined,
|
|
24
|
+
constructor: function(config) {
|
|
25
|
+
this.callParent([config]);
|
|
26
|
+
this.mixins.observable.constructor.call(this);
|
|
27
|
+
},
|
|
28
|
+
|
|
15
29
|
init: function(component) {
|
|
16
30
|
if (component instanceof Ext.grid.Panel || component instanceof Ext.tree.Panel) {
|
|
17
31
|
const me = this;
|
|
18
|
-
|
|
19
|
-
|
|
32
|
+
|
|
33
|
+
component.getContextManager = function() {
|
|
20
34
|
return me;
|
|
21
35
|
};
|
|
22
|
-
this.resetContext(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
this.resetContext();
|
|
37
|
+
component.on({
|
|
38
|
+
boxready: function() {
|
|
39
|
+
this.isSelectionModelDefaultMode = component.getPluginProperty('SelectionModelPlugin.defaultMode');
|
|
40
|
+
},
|
|
41
|
+
rowmousedown: function(grid, record) {
|
|
42
|
+
this.lastClickedRecord = record;
|
|
43
|
+
this.resetContext('rowmousedown', false);
|
|
44
|
+
},
|
|
45
|
+
selectionchange: function() {
|
|
46
|
+
this.resetContext('selectionchange');
|
|
47
|
+
},
|
|
48
|
+
scope: this,
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
component.getStore().on({
|
|
52
|
+
filterchange: () => {
|
|
53
|
+
this.resetContext('filterchange');
|
|
54
|
+
},
|
|
55
|
+
load: () => {
|
|
56
|
+
this.resetContext('load');
|
|
57
|
+
},
|
|
58
|
+
clear: () => {
|
|
59
|
+
this.resetContext('clear');
|
|
60
|
+
},
|
|
61
|
+
scope: this,
|
|
62
|
+
});
|
|
33
63
|
this.functionsStack = [];
|
|
34
64
|
this.parametersStack = [];
|
|
35
65
|
} else {
|
|
@@ -61,9 +91,9 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
61
91
|
},
|
|
62
92
|
|
|
63
93
|
getParams() {
|
|
64
|
-
const store = this.
|
|
94
|
+
const store = this.getCmp().getStore();
|
|
65
95
|
let params;
|
|
66
|
-
if (this.
|
|
96
|
+
if (this.getCmp() instanceof Ext.tree.Panel) {
|
|
67
97
|
params = store.proxy && store.proxy.extraParams;
|
|
68
98
|
} else {
|
|
69
99
|
params = store.lastOptions && store.lastOptions.params;
|
|
@@ -77,15 +107,14 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
77
107
|
|
|
78
108
|
getSelectedRecord() {
|
|
79
109
|
let record;
|
|
80
|
-
const selModel = this.
|
|
110
|
+
const selModel = this.getCmp().getSelectionModel();
|
|
81
111
|
const mode = Ext.isFunction(selModel.getSelectionMode) && selModel.getSelectionMode();
|
|
82
|
-
|
|
83
112
|
if (this.isRowBasedModel()) {
|
|
84
|
-
if (mode === 'MULTI' && this.lastClickedRecord) {
|
|
113
|
+
if (this.isSelectionModelDefaultMode && mode === 'MULTI' && this.lastClickedRecord) {
|
|
85
114
|
record = this.lastClickedRecord;
|
|
86
115
|
} else {
|
|
87
|
-
const selected = this.
|
|
88
|
-
record = selected[0]
|
|
116
|
+
const selected = this.getCmp().getSelectionModel().getSelected().getRange();
|
|
117
|
+
record = selected[0];
|
|
89
118
|
}
|
|
90
119
|
} else {
|
|
91
120
|
record = undefined;
|
|
@@ -94,20 +123,41 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
94
123
|
return record;
|
|
95
124
|
},
|
|
96
125
|
|
|
97
|
-
|
|
126
|
+
/**
|
|
127
|
+
* Обновление контекста отчета и при необходимости формирование события на плагине/
|
|
128
|
+
* @param {String} transferEvent код наступившего события, по которому требуется обновление контекста отчета
|
|
129
|
+
* @param {Boolean} sendContextChangeEvent признак необходимости формирования события contextchange.[transferEvent]
|
|
130
|
+
*/
|
|
131
|
+
resetContext(transferEvent, sendContextChangeEvent = true) {
|
|
98
132
|
this.context = {
|
|
99
133
|
params: this.getParams(),
|
|
100
134
|
record: this.getSelectedRecord(),
|
|
101
135
|
};
|
|
136
|
+
if (sendContextChangeEvent && transferEvent) {
|
|
137
|
+
this.fireEvent(`contextchange.${transferEvent}`, this.context);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
102
140
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
141
|
+
/**
|
|
142
|
+
* The method provides an API for other components to call the passed callback by subscribing to a number of events.
|
|
143
|
+
* The events occur in this plugin.
|
|
144
|
+
* @param {String|Array} events - event or array events
|
|
145
|
+
* @param {Object} paramConfig - settings for receiving parameter values of the component's doInit method
|
|
146
|
+
* @param {Function} doInitCallback - the method the event invokes
|
|
147
|
+
*/
|
|
148
|
+
buildParamsOnContextChange(events, paramConfig, doInitCallback) {
|
|
149
|
+
if (!Array.isArray(events)) {
|
|
150
|
+
events = [events];
|
|
151
|
+
}
|
|
152
|
+
events.forEach((eventName) => {
|
|
153
|
+
this.on(`contextchange.${eventName}`, () => {
|
|
154
|
+
this.executeFunction(doInitCallback, paramConfig);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
107
157
|
},
|
|
108
158
|
|
|
109
159
|
isRowBasedModel: function() {
|
|
110
|
-
const sm = this.
|
|
160
|
+
const sm = this.getCmp().getSelectionModel();
|
|
111
161
|
return sm instanceof Ext.selection.RowModel || sm instanceof Ext.selection.CheckboxModel;
|
|
112
162
|
},
|
|
113
163
|
|
|
@@ -117,7 +167,7 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
117
167
|
}
|
|
118
168
|
if (this.additionalParametersNames.length > 0) {
|
|
119
169
|
const next = this.additionalParametersNames.pop();
|
|
120
|
-
this.
|
|
170
|
+
this.getCmp().fireEvent('loadContext', next);
|
|
121
171
|
} else {
|
|
122
172
|
this.functionsStack.pop()(this.getParameters(this.parametersStack.pop()));
|
|
123
173
|
}
|
|
@@ -154,8 +204,9 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
154
204
|
const paramName = param.reportParameter;
|
|
155
205
|
let paramValue;
|
|
156
206
|
let selectedRecords;
|
|
157
|
-
const valueField = param
|
|
158
|
-
|
|
207
|
+
const valueField = param.reportNavigationOptionContextSourceValue;
|
|
208
|
+
const paramType = param.reportNavigationOptionContextSource;
|
|
209
|
+
switch (paramType) {
|
|
159
210
|
case 'FLD':
|
|
160
211
|
paramValue = Ext.isEmpty(this.context.record) ? undefined : this.context.record.get(valueField);
|
|
161
212
|
break;
|
|
@@ -168,18 +219,18 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
168
219
|
this.convertRecord(this.context.record.data, valueField, param.defaultValue);
|
|
169
220
|
break;
|
|
170
221
|
case 'ALLR':
|
|
171
|
-
if (this.
|
|
172
|
-
this.
|
|
222
|
+
if (this.getCmp().getStore().isFiltered()) {
|
|
223
|
+
this.getCmp().getStore().clearFilter(true);
|
|
173
224
|
}
|
|
174
225
|
paramValue = this.convertRecords(
|
|
175
|
-
Coon.Function.getDataFromStore(this.
|
|
226
|
+
Coon.Function.getDataFromStore(this.getCmp().getStore(), false),
|
|
176
227
|
valueField,
|
|
177
228
|
param.defaultValue
|
|
178
229
|
);
|
|
179
230
|
break;
|
|
180
231
|
case 'MDFD':
|
|
181
232
|
paramValue = this.convertRecords(
|
|
182
|
-
Coon.Function.getDataFromModifiedRecords(this.
|
|
233
|
+
Coon.Function.getDataFromModifiedRecords(this.getCmp().getStore(), false),
|
|
183
234
|
valueField,
|
|
184
235
|
param.defaultValue
|
|
185
236
|
);
|
|
@@ -190,7 +241,7 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
190
241
|
break;
|
|
191
242
|
case 'SELR':
|
|
192
243
|
paramValue = this.convertRecords(
|
|
193
|
-
Coon.Function.getDataFromSelectionModel(this.
|
|
244
|
+
Coon.Function.getDataFromSelectionModel(this.getCmp().getSelectionModel(), false),
|
|
194
245
|
valueField,
|
|
195
246
|
param.defaultValue
|
|
196
247
|
);
|
|
@@ -200,14 +251,14 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
200
251
|
paramValue = param.defaultValue;
|
|
201
252
|
break;
|
|
202
253
|
default:
|
|
203
|
-
paramValue = this.context[
|
|
254
|
+
paramValue = this.context[paramType] ?
|
|
204
255
|
(
|
|
205
|
-
this.context[
|
|
206
|
-
this.context[
|
|
256
|
+
this.context[paramType][param.defaultValue] ||
|
|
257
|
+
this.context[paramType]
|
|
207
258
|
) :
|
|
208
|
-
this.context[
|
|
259
|
+
this.context[paramType];
|
|
209
260
|
if (Ext.isEmpty(paramValue) && param.editable) {
|
|
210
|
-
this.
|
|
261
|
+
this.getCmp().fireEvent('failContext', paramType);
|
|
211
262
|
}
|
|
212
263
|
break;
|
|
213
264
|
}
|
|
@@ -217,26 +268,18 @@ Ext.define('Coon.report.plugin.grid.GridContextPlugin', {
|
|
|
217
268
|
},
|
|
218
269
|
|
|
219
270
|
getCheckedRecords() {
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
if (checkColumnName) {
|
|
227
|
-
const store = this.component.getStore();
|
|
271
|
+
const checkColumnName = this.getCmp().up('[checkColumn]') || (this.getCmp().properties && this.getCmp().properties['checkColumn']);
|
|
272
|
+
const checkedRecords = this.getCmp().getCheckedRecords();
|
|
273
|
+
if (this.isSelectionModelDefaultMode) {
|
|
274
|
+
return checkedRecords;
|
|
275
|
+
} else if (checkColumnName) {
|
|
276
|
+
const store = this.getCmp().getStore();
|
|
228
277
|
const records = store.getRange(0, store.getCount());
|
|
229
|
-
|
|
230
|
-
for (let i = 0; i < records.length; i++) {
|
|
231
|
-
if (records[i].get(checkColumnName) === true) {
|
|
232
|
-
selectedRecords.push(records[i]);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
return selectedRecords;
|
|
278
|
+
return records.filter((record) => record.get(checkColumnName) === true || record.get('checked'));
|
|
236
279
|
} else if (checkedRecords && checkedRecords.length) {
|
|
237
280
|
return checkedRecords;
|
|
238
281
|
} else {
|
|
239
|
-
return Coon.Function.getDataFromSelectionModel(this.
|
|
282
|
+
return Coon.Function.getDataFromSelectionModel(this.getCmp().getSelectionModel(), false);
|
|
240
283
|
}
|
|
241
284
|
},
|
|
242
285
|
|