ru.coon 3.0.73 → 3.0.75
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 -0
- package/package.json +1 -1
- package/src/app/Application.js +1 -1
- package/src/common/component/editor/EditorFactory.js +0 -8
- package/src/common/component/editor/TypedCharacteristicEditor.js +5 -1
- package/src/common/field/OpenDialogField.js +2 -0
- package/src/common/plugin/form/PeriodPickerPlugin.js +4 -0
- package/src/overrides/grid/feature/Grouping.js +15 -0
- package/src/report/component/reportpanel/NorthPanel.js +1 -1
- package/src/report/component/settings/context/ReportFormContextParametersGrid.js +71 -3
- package/src/report/plugin/configPanel/BindCustomPanelPluginConfigPanel.js +78 -1
- package/src/report/plugin/grid/GridToolbarButtonPlugin.js +1 -3
- package/src/report/plugin/grid/ToolbarItemPlugin.js +1 -1
- package/src/report/plugin/report/BindCustomPanelPlugin.js +52 -15
- package/src/uielement/component/UiCPWrapper.js +2 -6
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# Version 3.0.75, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bca8dfcc721f5bf5f9150e54f382e6224565f427)
|
|
2
|
+
* ## Fixes
|
|
3
|
+
* <span style='color:red'> исправление в PeriodPickerPlugin сообщений minText и maxText</span> ([552b34], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/552b3430b8535edf87c420f54cc16f8d5dc03011))
|
|
4
|
+
|
|
5
|
+
* HT-14725: исправление работы BindCustomPanelPlugin ([26547e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/26547e340cec89c0019b98ddf5c3ecd6a8b24438))
|
|
6
|
+
* HT-14681 исправление ошибки редактирования характеристик ([bb5a7a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bb5a7acab1af722623ef497234221bd3762a7b50))
|
|
7
|
+
* HT-15218: исправление ошибки формирования itemId ([b233ed], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b233ed8ba44305ca10acc8a1062573bbe7250124))
|
|
8
|
+
* update: CHANGELOG.md ([c0892b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c0892bd2441c94e5168773b008a262b28a31b39d))
|
|
9
|
+
|
|
10
|
+
# Version 3.0.74, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/723e4a3b5562fe1ce81ea131cba9987cfe286001)
|
|
11
|
+
* HT-10758: исправление доступности кнопок в зависимости от типа параметра ([db308d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/db308d95a02df99e875998bc2039380dff4c87c7))
|
|
12
|
+
* update: CHANGELOG.md ([734d0f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/734d0fed9b45fffbff8d29a7b43723e06d9265fb))
|
|
13
|
+
|
|
1
14
|
# Version 3.0.73, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d77f15a5f3bbd05c134e65d32edab3f7cbb2b80f)
|
|
2
15
|
* ## Features
|
|
3
16
|
* <span style='color:green'>feat: HT-12053: Добавил возможность изменить xtype кнопки, что позволит использовать split, segmented и кастомные кнопки</span> ([b0f2e7], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b0f2e72e4115266d83b9a39028159169355d2e73))
|
package/package.json
CHANGED
package/src/app/Application.js
CHANGED
|
@@ -348,17 +348,9 @@ 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);
|
|
352
351
|
this.field.doInit();
|
|
353
352
|
}
|
|
354
353
|
},
|
|
355
|
-
|
|
356
|
-
afterEdit: function() {
|
|
357
|
-
this.completeEdit && this.completeEdit();
|
|
358
|
-
if (this.boundEl || (this.context && this.context.getCell)) {
|
|
359
|
-
this.restoreCell();
|
|
360
|
-
}
|
|
361
|
-
},
|
|
362
354
|
});
|
|
363
355
|
|
|
364
356
|
/**
|
|
@@ -382,7 +382,11 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
|
|
|
382
382
|
this.activeEditor = this.factory.getEditorForType(record, this.context);
|
|
383
383
|
this.activeEditor.editingPlugin = this.editingPlugin;
|
|
384
384
|
this.activeEditor.grid = this;
|
|
385
|
-
|
|
385
|
+
if (this.activeEditor.field && this.activeEditor.field.externalEditor) {
|
|
386
|
+
return false;
|
|
387
|
+
} else {
|
|
388
|
+
return this.activeEditor;
|
|
389
|
+
}
|
|
386
390
|
},
|
|
387
391
|
|
|
388
392
|
applyContext: function(context) {
|
|
@@ -18,6 +18,8 @@ Ext.define('Coon.common.plugin.form.PeriodPickerPlugin', {
|
|
|
18
18
|
|
|
19
19
|
init: function(component) {
|
|
20
20
|
component.format = component.hasOwnProperty('format') ? component.format : this.defaultFormat;
|
|
21
|
+
component.minText = this.minText;
|
|
22
|
+
component.maxText = this.maxText;
|
|
21
23
|
component.createPicker = function() {
|
|
22
24
|
const me = this;
|
|
23
25
|
|
|
@@ -30,6 +32,8 @@ Ext.define('Coon.common.plugin.form.PeriodPickerPlugin', {
|
|
|
30
32
|
focusOnShow: true,
|
|
31
33
|
minDate: me.minValue,
|
|
32
34
|
maxDate: me.maxValue,
|
|
35
|
+
minText: Ext.String.format(me.minText, me.formatDate(me.minValue)),
|
|
36
|
+
maxText: Ext.String.format(me.maxText, me.formatDate(me.maxValue)),
|
|
33
37
|
format: me.format,
|
|
34
38
|
listeners: {
|
|
35
39
|
scope: me,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
Ext.define('Coon.overrides.grid.feature.Grouping', {
|
|
2
|
+
override: 'Ext.grid.feature.Grouping',
|
|
3
|
+
|
|
4
|
+
}, function() {
|
|
5
|
+
Ext.Function.interceptBefore(this.prototype, 'onGroupClick', function() {
|
|
6
|
+
if (
|
|
7
|
+
this.grid &&
|
|
8
|
+
this.grid.activeEditor &&
|
|
9
|
+
!this.grid.activeEditor.destroyed &&
|
|
10
|
+
this.grid.activeEditor.completeEdit
|
|
11
|
+
) {
|
|
12
|
+
this.grid.activeEditor.completeEdit();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -166,7 +166,7 @@ Ext.define('Coon.report.component.report.NorthPanel', {
|
|
|
166
166
|
},
|
|
167
167
|
|
|
168
168
|
configureFilterPanel: function(reportFormBean) {
|
|
169
|
-
this.reportPanel = this.reportPanel || this.up('ReportPanel');
|
|
169
|
+
this.reportPanel = this.reportPanel || this.up('ReportPanel,ReportFilterForm');
|
|
170
170
|
const properties = this.reportPanel && this.reportPanel.configProperties ||
|
|
171
171
|
Coon.Function.convertAdvancedProperties(reportFormBean.properties) || {};
|
|
172
172
|
Ext.merge(this, properties);
|
|
@@ -28,6 +28,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
|
|
|
28
28
|
},
|
|
29
29
|
|
|
30
30
|
initComponent: function() {
|
|
31
|
+
const me = this;
|
|
31
32
|
this.storeForSELR = [
|
|
32
33
|
{
|
|
33
34
|
value: 'CVW',
|
|
@@ -102,6 +103,8 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
|
|
|
102
103
|
allowBlank: false,
|
|
103
104
|
});
|
|
104
105
|
|
|
106
|
+
this.fullValueEditorCombo = this.getFullValueEditorCombo();
|
|
107
|
+
|
|
105
108
|
const valueDefaultEditor = Ext.create('Ext.form.field.Text', {
|
|
106
109
|
allowBlank: false,
|
|
107
110
|
});
|
|
@@ -132,7 +135,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
|
|
|
132
135
|
dataIndex: 'reportNavigationOptionContextSourceValue',
|
|
133
136
|
xtype: 'hintColumn',
|
|
134
137
|
width: 130,
|
|
135
|
-
|
|
138
|
+
editable: true,
|
|
136
139
|
renderer: Ext.bind(function(value, meta, record) {
|
|
137
140
|
const type = record.get('reportNavigationOptionContextSource');
|
|
138
141
|
let visibleValue;
|
|
@@ -140,16 +143,28 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
|
|
|
140
143
|
let found;
|
|
141
144
|
if (type === 'FLD') {
|
|
142
145
|
found = this.fieldsStore.findRecord('value', value);
|
|
143
|
-
visibleValue = found && found.get('description');
|
|
146
|
+
visibleValue = found && (`${found.get('value')} (${found.get('description')})`);
|
|
144
147
|
} else if (type === 'PRM') {
|
|
145
148
|
found = this.paramsStore.findRecord('value', value);
|
|
146
|
-
visibleValue = found && found.get('description');
|
|
149
|
+
visibleValue = found && (`${found.get('value')} (${found.get('description')})`);
|
|
147
150
|
} else if (type === 'SELR' || type === 'ALLR' || type === 'RCRD' || type === 'MDFD' || type === 'CHCK') {
|
|
148
151
|
found = this.storeForSELR.find((obj) => obj.value === value);
|
|
149
152
|
visibleValue = found && found.description;
|
|
150
153
|
}
|
|
151
154
|
return Coon.format.withHint(visibleValue);
|
|
152
155
|
}, this),
|
|
156
|
+
getEditor: function(record) {
|
|
157
|
+
const type = record.get('reportNavigationOptionContextSource');
|
|
158
|
+
let editor;
|
|
159
|
+
if (['PRM', 'FLD'].includes(type)) {
|
|
160
|
+
editor = me.fullValueEditorCombo;
|
|
161
|
+
} else {
|
|
162
|
+
editor = me.valueEditor;
|
|
163
|
+
}
|
|
164
|
+
return Ext.create('Ext.grid.CellEditor', {
|
|
165
|
+
field: editor,
|
|
166
|
+
});
|
|
167
|
+
},
|
|
153
168
|
},
|
|
154
169
|
{
|
|
155
170
|
text: 'Значение по умолчанию',
|
|
@@ -235,6 +250,37 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
|
|
|
235
250
|
}, this);
|
|
236
251
|
},
|
|
237
252
|
|
|
253
|
+
getFullValueEditorCombo() {
|
|
254
|
+
const {$reportField, $description, $reportFieldTypeLookup} =
|
|
255
|
+
Coon.report.model.ReportFieldMaintenanceBeanFields;
|
|
256
|
+
const fieldTypeStyle =
|
|
257
|
+
'opacity:.8;background-color:lightgrey;font-size:.7rem;padding:2px 4px;';
|
|
258
|
+
const listItemTpl = Ext.create(
|
|
259
|
+
'Ext.XTemplate',
|
|
260
|
+
'<ul class="x-list-plain"><tpl for=".">',
|
|
261
|
+
'<li role="option" class="x-boundlist-item">',
|
|
262
|
+
`<b>{[values["${$reportField}"]]}</b> : <i style="${fieldTypeStyle}">{[values["${$reportFieldTypeLookup}"]]}</i>`,
|
|
263
|
+
'<tpl if="description.length">',
|
|
264
|
+
`<div style="opacity:.8;font-size: 1rem;"><i>{[values["${$description}"]]}</i></div>`,
|
|
265
|
+
'</tpl>',
|
|
266
|
+
'</li>',
|
|
267
|
+
'</tpl></ul>'
|
|
268
|
+
);
|
|
269
|
+
return Ext.create(
|
|
270
|
+
'Coon.report.component.SimplestReportCombo',
|
|
271
|
+
{
|
|
272
|
+
valueField: $reportField,
|
|
273
|
+
displayField: $reportField,
|
|
274
|
+
listConfig: {
|
|
275
|
+
tpl: listItemTpl,
|
|
276
|
+
},
|
|
277
|
+
displayTpl: new Ext.XTemplate(
|
|
278
|
+
'<tpl>{[values[0].reportFieldCd]} ({[values[0].description]})</tpl>'
|
|
279
|
+
),
|
|
280
|
+
}
|
|
281
|
+
);
|
|
282
|
+
},
|
|
283
|
+
|
|
238
284
|
/**
|
|
239
285
|
* Инициализация
|
|
240
286
|
*/
|
|
@@ -323,9 +369,11 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
|
|
|
323
369
|
switch (type) {
|
|
324
370
|
case 'FLD':
|
|
325
371
|
list = Coon.Function.serializeRecords(this.fieldsStore.getRange());
|
|
372
|
+
this.fillFullValueCombo(this.fieldsStore.getRange());
|
|
326
373
|
break;
|
|
327
374
|
case 'PRM':
|
|
328
375
|
list = Coon.Function.serializeRecords(this.paramsStore.getRange());
|
|
376
|
+
this.fillFullValueCombo(this.paramsStore.getRange());
|
|
329
377
|
break;
|
|
330
378
|
case 'RCRD':
|
|
331
379
|
case 'ALLR':
|
|
@@ -342,10 +390,29 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
|
|
|
342
390
|
}
|
|
343
391
|
},
|
|
344
392
|
|
|
393
|
+
fillFullValueCombo(data) {
|
|
394
|
+
const {$reportField, $description, $reportFieldTypeLookup} =
|
|
395
|
+
Coon.report.model.ReportFieldMaintenanceBeanFields;
|
|
396
|
+
const columnsData = [];
|
|
397
|
+
data.forEach((item) => {
|
|
398
|
+
// const fieldData = item.getData();
|
|
399
|
+
const description = Ext.util.Format.stripTags(
|
|
400
|
+
String(item.get('description')).replaceAll('<br>', ' ')
|
|
401
|
+
);
|
|
402
|
+
columnsData.push({
|
|
403
|
+
[$description]: description || '',
|
|
404
|
+
[$reportField]: item.get('value'),
|
|
405
|
+
[$reportFieldTypeLookup]: item.get('typeLookup'),
|
|
406
|
+
});
|
|
407
|
+
});
|
|
408
|
+
this.fullValueEditorCombo.getStore().loadData(columnsData);
|
|
409
|
+
},
|
|
410
|
+
|
|
345
411
|
changeFieldsList: function(fields) {
|
|
346
412
|
const cvList = fields.map((field) => ({
|
|
347
413
|
value: field['reportFieldCd'],
|
|
348
414
|
description: field['description'],
|
|
415
|
+
typeLookup: field['reportFieldTypeLookup'],
|
|
349
416
|
}));
|
|
350
417
|
this.fieldsStore.loadData(cvList);
|
|
351
418
|
},
|
|
@@ -354,6 +421,7 @@ Ext.define('Coon.report.component.settings.common.ReportFormContextParametersGri
|
|
|
354
421
|
const cvList = parameters.map((param) => ({
|
|
355
422
|
value: param['reportParameterCd'],
|
|
356
423
|
description: param['description'],
|
|
424
|
+
typeLookup: param['reportParameterTypeLookup'],
|
|
357
425
|
}));
|
|
358
426
|
this.paramsStore.loadData(cvList);
|
|
359
427
|
},
|
|
@@ -208,7 +208,6 @@ Ext.define('Coon.report.plugin.configPanel.BindCustomPanelPluginConfigPanel', {
|
|
|
208
208
|
items: [
|
|
209
209
|
this.createDependsOnGridRow(),
|
|
210
210
|
this.createDependsOnGridParameter(),
|
|
211
|
-
// panelCombo,
|
|
212
211
|
{
|
|
213
212
|
xtype: 'container',
|
|
214
213
|
layout: {
|
|
@@ -346,6 +345,31 @@ Ext.define('Coon.report.plugin.configPanel.BindCustomPanelPluginConfigPanel', {
|
|
|
346
345
|
}
|
|
347
346
|
],
|
|
348
347
|
},
|
|
348
|
+
{
|
|
349
|
+
xtype: 'checkbox',
|
|
350
|
+
boxLabel: 'Блокировка и очистка компонента, если не выбрана строка',
|
|
351
|
+
boxLabelAlign: 'before',
|
|
352
|
+
checked: true,
|
|
353
|
+
margin: '20 0 0 0',
|
|
354
|
+
name: 'enableOnlyWhenSelected',
|
|
355
|
+
bind: '{enableOnlyWhenSelected}',
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
xtype: 'container',
|
|
359
|
+
width: '100%',
|
|
360
|
+
margin: '0 0 15 0',
|
|
361
|
+
bind: {
|
|
362
|
+
hidden: '{!enableOnlyWhenSelected}',
|
|
363
|
+
},
|
|
364
|
+
html: `
|
|
365
|
+
<div style="font-size:12px;padding:0 0 0 10px;color:gray">
|
|
366
|
+
<p style="margin:0">Если в качестве компонента выбран Репорт,
|
|
367
|
+
очистка будет осуществлена автоматически.</p>
|
|
368
|
+
<p style="margin:0">В ином случае, будет вызвано событие
|
|
369
|
+
<span style="font-weight: 800;">"clearComponentData"</span>.</p>
|
|
370
|
+
</div>
|
|
371
|
+
`,
|
|
372
|
+
},
|
|
349
373
|
{
|
|
350
374
|
xtype: 'checkbox',
|
|
351
375
|
boxLabel: 'Выключить обработку параметров',
|
|
@@ -380,19 +404,72 @@ Ext.define('Coon.report.plugin.configPanel.BindCustomPanelPluginConfigPanel', {
|
|
|
380
404
|
];
|
|
381
405
|
},
|
|
382
406
|
|
|
407
|
+
createDependsOnGridRow() {
|
|
408
|
+
return {
|
|
409
|
+
xtype: 'fieldset',
|
|
410
|
+
title: 'ВСЕГДА зависит от строки отчета',
|
|
411
|
+
checkboxToggle: true,
|
|
412
|
+
checkbox: {
|
|
413
|
+
name: 'dependOnGridRow',
|
|
414
|
+
readOnly: true,
|
|
415
|
+
disabled: true,
|
|
416
|
+
checked: true,
|
|
417
|
+
},
|
|
418
|
+
defaults: {
|
|
419
|
+
flex: 1,
|
|
420
|
+
},
|
|
421
|
+
layout: {
|
|
422
|
+
type: 'vbox',
|
|
423
|
+
align: 'stretch',
|
|
424
|
+
},
|
|
425
|
+
items: [
|
|
426
|
+
{
|
|
427
|
+
xtype: 'container',
|
|
428
|
+
width: '100%',
|
|
429
|
+
html: `
|
|
430
|
+
<div style="font-size:12px;color: red">
|
|
431
|
+
<p>Данное свойство в плагине является неизменяемым!</p>
|
|
432
|
+
<ul style="padding:0 0 0 15px; color: gray">Логика работы:
|
|
433
|
+
<li>Компонент, указанный в плагине, будет получать входные параметры при выборе сроки отчета.</li>
|
|
434
|
+
</ul>
|
|
435
|
+
</div>
|
|
436
|
+
`,
|
|
437
|
+
}
|
|
438
|
+
],
|
|
439
|
+
};
|
|
440
|
+
},
|
|
441
|
+
|
|
383
442
|
setContext: function(context) {
|
|
384
443
|
this.context = context;
|
|
444
|
+
this.setDependOnGridParameterData();
|
|
385
445
|
this.grid.changeFieldsList(context.fields);
|
|
386
446
|
this.grid.changeParametersList(context.parameters);
|
|
387
447
|
this.grid.updateTypeEditor(context.additionalContext);
|
|
388
448
|
},
|
|
389
449
|
|
|
450
|
+
setDependOnGridParameterData() {
|
|
451
|
+
const dependOnGridParameter = this.down('[name=dependOnGridParameters]');
|
|
452
|
+
if (dependOnGridParameter) {
|
|
453
|
+
const data = this.context.parameters.map((item) => {
|
|
454
|
+
item.descriptionFull = `${item.reportParameterCd} (${item.description})`;
|
|
455
|
+
return item;
|
|
456
|
+
});
|
|
457
|
+
dependOnGridParameter.getStore().loadData(data);
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
|
|
390
461
|
doInit: function(config) {
|
|
391
462
|
this.callParent(arguments);
|
|
392
463
|
this.grid.doInit(this.convertParameters(config['parameters']) || []);
|
|
393
464
|
const panelXTypeField = this.lookup('panelXTypeField');
|
|
394
465
|
this.propertiesGrid.setData(this.convertProperties(config['properties']) || []);
|
|
395
466
|
this.initPanelXType(panelXTypeField, panelXTypeField.getValue());
|
|
467
|
+
|
|
468
|
+
const dependOnGridRow = this.down('[name=dependOnGridRow]');
|
|
469
|
+
if (!config.dependOnGridRow) {
|
|
470
|
+
config.dependOnGridRow = true;
|
|
471
|
+
dependOnGridRow.setValue(true);
|
|
472
|
+
}
|
|
396
473
|
},
|
|
397
474
|
|
|
398
475
|
getConfiguration: function() {
|
|
@@ -243,10 +243,8 @@ Ext.define('Coon.report.plugin.grid.GridToolbarButtonPlugin', {
|
|
|
243
243
|
param.editable ? requiredMultiParameters.push(param) : notRequiredMultiParameters.push(param);
|
|
244
244
|
multiDependencyParameters.push(param);
|
|
245
245
|
onlyIndependentParameters = false;
|
|
246
|
-
} else if (param.reportNavigationOptionContextSource === 'DFLT') {
|
|
247
|
-
reportIndependentParameters.push(param);
|
|
248
246
|
} else {
|
|
249
|
-
|
|
247
|
+
(param.reportNavigationOptionContextSource === 'DFLT') && reportIndependentParameters.push(param);
|
|
250
248
|
}
|
|
251
249
|
});
|
|
252
250
|
|
|
@@ -104,7 +104,7 @@ Ext.define('Coon.report.plugin.grid.ToolbarItemPlugin', {
|
|
|
104
104
|
position: this.position,
|
|
105
105
|
sortSequence: this.sortSequence,
|
|
106
106
|
pType: this.pluginConfig ? this.pluginConfig.ptype : '',
|
|
107
|
-
itemId: this.pluginId,
|
|
107
|
+
itemId: 'p_' + this.pluginId,
|
|
108
108
|
};
|
|
109
109
|
if (!this.position || isNaN(Number(this.position)) || Number(this.position) <= 0) {
|
|
110
110
|
cfg.position = this.sortSequence;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.report.plugin.report.BindCustomPanelPlugin', {
|
|
2
|
-
extend: '
|
|
2
|
+
extend: 'Coon.report.plugin.grid.GridToolbarButtonPlugin',
|
|
3
3
|
alias: 'plugin.BindCustomPanelPlugin',
|
|
4
4
|
uses: [
|
|
5
5
|
'Coon.report.component.ReportPanel'
|
|
@@ -45,6 +45,7 @@ Ext.define('Coon.report.plugin.report.BindCustomPanelPlugin', {
|
|
|
45
45
|
this.panel = Ext.widget(this.panelXType, properties);
|
|
46
46
|
}
|
|
47
47
|
this.report.addSidePanel(this.panel, this.position, config);
|
|
48
|
+
this.inputParametersConfig = this.getInputParametersConfig();
|
|
48
49
|
this.afterCreatePanel(config);
|
|
49
50
|
}, this);
|
|
50
51
|
},
|
|
@@ -86,20 +87,16 @@ Ext.define('Coon.report.plugin.report.BindCustomPanelPlugin', {
|
|
|
86
87
|
contextPlugin.buildParamsOnContextChange(events, this.parameters, initPanelCallback);
|
|
87
88
|
};
|
|
88
89
|
|
|
89
|
-
addContextEventsListener(['load']);
|
|
90
|
+
addContextEventsListener(['load', 'clear', 'selectionchange', 'filterchange']);
|
|
91
|
+
this.panel.on('save', this.saveHandler, this);
|
|
92
|
+
if (this.reloadAfterComplete && this.panelXType === 'ReportPanel') {
|
|
93
|
+
this.panel.on('needReload', this.saveHandler, this);
|
|
94
|
+
};
|
|
90
95
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this.panel.on('needReload', this.saveHandler, this);
|
|
96
|
-
}
|
|
97
|
-
contextPlugin.executeFunction(this.parameters, initPanelCallback);
|
|
98
|
-
} else if (this.dependOnGridParameters) {
|
|
99
|
-
addContextEventsListener(['clear']);
|
|
100
|
-
} else {
|
|
101
|
-
contextPlugin.executeFunction(this.parameters, initPanelCallback);
|
|
102
|
-
}
|
|
96
|
+
this.enableOnlyWhenSelected = this.enableOnlyWhenSelected === undefined ? true : this.enableOnlyWhenSelected;
|
|
97
|
+
this.panel.setDisabled(this.enableOnlyWhenSelected);
|
|
98
|
+
|
|
99
|
+
this.doInitOnReady(contextPlugin.getParameters(this.parameters));
|
|
103
100
|
this.panel.on('close', this.closeHandler, this);
|
|
104
101
|
},
|
|
105
102
|
|
|
@@ -122,13 +119,53 @@ Ext.define('Coon.report.plugin.report.BindCustomPanelPlugin', {
|
|
|
122
119
|
}
|
|
123
120
|
},
|
|
124
121
|
|
|
122
|
+
doInitOnReady(parameters) {
|
|
123
|
+
if (this.panelXType === 'UiCustomPanel') {
|
|
124
|
+
this.panel.on('add', () => {
|
|
125
|
+
this.doInitDependForm(parameters);
|
|
126
|
+
});
|
|
127
|
+
} else if (this.panelXType === 'ReportPanel') {
|
|
128
|
+
this.panel.on('configured', () => {
|
|
129
|
+
this.doInitDependForm(parameters);
|
|
130
|
+
}, this, {single: true});
|
|
131
|
+
} else {
|
|
132
|
+
this.panel.on('afterrender', () => {
|
|
133
|
+
this.doInitDependForm(parameters);
|
|
134
|
+
}, this, {single: true});
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
|
|
125
138
|
doInitDependForm: function(params) {
|
|
139
|
+
const state = this.computeState();
|
|
126
140
|
if (!params.params) {
|
|
127
141
|
params.params = Ext.apply({}, params);
|
|
128
142
|
}
|
|
129
143
|
if (this.panel.currentParamList && this.mergeParameters) {
|
|
130
144
|
params.params = Ext.applyIf(params.params, this.panel.currentParamList);
|
|
131
145
|
}
|
|
132
|
-
|
|
146
|
+
if (!state.disabled) {
|
|
147
|
+
this.enableOnlyWhenSelected && this.panel.setDisabled(false);
|
|
148
|
+
Coon.Function.executeComponentDoInit(this.getTargetComponent(), params);
|
|
149
|
+
} else if (this.enableOnlyWhenSelected) {
|
|
150
|
+
this.panel.setDisabled(true);
|
|
151
|
+
this.clearTargetComponent();
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
|
|
155
|
+
getTargetComponent() {
|
|
156
|
+
if (this.panelXType === 'UiCustomPanel') {
|
|
157
|
+
return this.panel.uiPanel;
|
|
158
|
+
} else {
|
|
159
|
+
return this.panel;
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
|
|
163
|
+
clearTargetComponent() {
|
|
164
|
+
if (this.panelXType === 'ReportPanel') {
|
|
165
|
+
this.panel.clearFilter();
|
|
166
|
+
this.panel.clearData();
|
|
167
|
+
} else {
|
|
168
|
+
this.panel.fireEvent('clearComponentData');
|
|
169
|
+
}
|
|
133
170
|
},
|
|
134
171
|
});
|
|
@@ -126,12 +126,8 @@ Ext.define('Coon.uielement.component.UiCPWrapper', {
|
|
|
126
126
|
if (Array.isArray(this.customBubbleEvents) && this.customBubbleEvents.length) {
|
|
127
127
|
this.setCustomBubbleEvents(panel);
|
|
128
128
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
});
|
|
132
|
-
this.on('deactivate', () => {
|
|
133
|
-
panel.fireEvent('deactivate');
|
|
134
|
-
});
|
|
129
|
+
|
|
130
|
+
panel.relayEvents(this, ['activate', 'deactivate']);
|
|
135
131
|
panel.on('dirtychange', (component, state) => {
|
|
136
132
|
this.fireEvent('dirtychange', this, state);
|
|
137
133
|
});
|
package/src/version.js
CHANGED