ru.coon 2.5.43 → 2.5.45
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 +22 -0
- package/package.json +1 -1
- package/src/Function.js +3 -1
- package/src/chart/editor/CoonChartEditorController.js +1 -1
- package/src/common/component/editor/CharacteristicGridEditor.js +1 -0
- package/src/common/component/editor/EditorFactory.js +45 -6
- package/src/common/field/EditorJs.js +91 -0
- package/src/common/field/EditorJs.scss +41 -0
- package/src/common/field/EditorJsField.js +36 -0
- package/src/report/component/ParameterizedReportCombo.js +2 -2
- package/src/report/component/ReportLookupCombo.js +6 -4
- package/src/report/component/ReportPickerLookupCombo.js +1 -1
- package/src/report/plugin/grid/ExportReportDataToFilePlugin.js +12 -2
- package/src/uielement/component/UiElementController.js +1 -2
- package/src/uielement/plugin/MethodChainPlugin.js +43 -3
- package/src/uielement/plugin/configPanel/MethodChainPluginConfigPanelFormEditor.js +58 -2
- package/src/util.js +17 -3
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
|
+
# Version 2.5.45, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f1e28ba95e77bbe4be40d19ea9fde58a74fbb645)
|
|
2
|
+
* ## Fixes
|
|
3
|
+
* <span style='color:red'> hot-fix: move EditorJs to coon from project</span> ([12daf8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/12daf8abb9dbaf48910870616b0e6d52f3b2bbfd))
|
|
4
|
+
|
|
5
|
+
* ([Update], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/Update src/util.js5a11846bc2f75dd40b3c0f2239047d95f1a9371c))
|
|
6
|
+
* BFL-9850 Ошибка при сохранении пункта меню ([270e31], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/270e3170b5a70b306591730dce53023dcebf6f34))
|
|
7
|
+
* update: CHANGELOG.md ([8b0186], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8b0186d787ec77ad2a4dfc211e85c8ffadee6559))
|
|
8
|
+
|
|
9
|
+
# Version 2.5.44, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0c4d4a663ae3451dec321c0d68bf1d5c8d70ff58)
|
|
10
|
+
* ## Fixes
|
|
11
|
+
* <span style='color:red'> HT-7469: commit store state on doInit action. This method remove all modified records from store state</span> ([34c025], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/34c02583013b66314a74c2fbc9512f04f218d85e))
|
|
12
|
+
|
|
13
|
+
* hotfix Coon.Function.executeComponentDoInit ([c9e04c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c9e04c22329f1d7822b91a47eca899c6f6e7f95e))
|
|
14
|
+
* update: CHANGELOG.md ([f47bce], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f47bce91314446c8f88961ba976fc132e11318d0))
|
|
15
|
+
|
|
1
16
|
# Version 2.5.43, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bc0bf6f30c6fa63c8af9ccfaa0ee75431bda6029)
|
|
17
|
+
* ## Features
|
|
18
|
+
* <span style='color:green'>feat: HT-7499: await promise before execute next function. Processing errors</span> ([2b07d4], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2b07d43af09c4e1d5c31b367c451220a45784af2))
|
|
19
|
+
|
|
2
20
|
* hotfix ExportReportDataToFilePlugin ([391a17], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/391a175384ff87e18e3ed14b75094f2d204270ad))
|
|
21
|
+
* BFL-8607 Доработка редактора характеристики типа "Дата" ([6b2ee8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6b2ee8c52c6f89799f0de52b30b78179650f518c))
|
|
22
|
+
* BFL-8607 Доработка редактора характеристики типа "Дата" ([20c221], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/20c2210c3c15817168bf0a3465a219fe49f7d2fe))
|
|
23
|
+
* BFL-8607 Доработка редактора характеристики типа "Дата" ([0c7529], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0c752984e1e82cdf68d9aa25413375319adfe30e))
|
|
3
24
|
* update: CHANGELOG.md ([892608], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/892608eb6ddd2ef85d205ba9e1e857aa27672320))
|
|
4
25
|
|
|
5
26
|
# Version 2.5.42, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a6256f14a891eda0974a2af1ee2c108c8904feab)
|
|
@@ -29,6 +50,7 @@
|
|
|
29
50
|
* <span style='color:red'>fix</span> ([5400c1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5400c17b624f78acfa1dbe8c27742e7a1f4b1cc1))
|
|
30
51
|
* <span style='color:red'> Переделан механизм добавления меню в кнопку "Поиск"</span> ([0437f3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0437f3f77c410d545f65d75516091db6ba41ad80))
|
|
31
52
|
|
|
53
|
+
* CRM-7853 ParameterizedReportCombo исправлена ошибка отображения параметров поиска ([702d8a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/702d8a5a99970682b0ad3ac50112553685b27e34))
|
|
32
54
|
* revert to bf9339051130805e551f48ce07bd5bac3d49d140 ([80394d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/80394d8e7b64a12c3e137d74661c529d6162004c))
|
|
33
55
|
* update: CHANGELOG.md ([14b820], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/14b8208316d9994deafbbd54ccab2fdae4900e74))
|
|
34
56
|
|
package/package.json
CHANGED
package/src/Function.js
CHANGED
|
@@ -476,7 +476,9 @@ Ext.define('Coon.Function', {
|
|
|
476
476
|
},
|
|
477
477
|
|
|
478
478
|
executeComponentDoInit: function(component, parameters) {
|
|
479
|
-
const appropriateToInit = component
|
|
479
|
+
const appropriateToInit = component &&
|
|
480
|
+
typeof component.getController === 'function' &&
|
|
481
|
+
component.getController() || component;
|
|
480
482
|
if (Ext.isFunction(appropriateToInit.doInit)) {
|
|
481
483
|
const initArguments = [];
|
|
482
484
|
const p = parameters || [];
|
|
@@ -172,7 +172,7 @@ Ext.define('Coon.chart.editor.CoonChartEditorController', {
|
|
|
172
172
|
},
|
|
173
173
|
|
|
174
174
|
getReportFieldsData(reportId) {
|
|
175
|
-
return Coon.util.promisifyCmd('command.LoadDynamicReportCommand', {reportId: reportId});
|
|
175
|
+
return Coon.util.promisifyCmd({command: 'command.LoadDynamicReportCommand', params: {reportId: reportId}});
|
|
176
176
|
},
|
|
177
177
|
|
|
178
178
|
getCommandsList() {
|
|
@@ -76,7 +76,9 @@ Ext.define('Coon.common.component.editor.EditorFactory', {
|
|
|
76
76
|
editor = new Coon.common.component.editor.IntTypeEditor();
|
|
77
77
|
break;
|
|
78
78
|
case Coon.common.component.editor.CharacteristicEditorTypes.DATE:
|
|
79
|
-
editor = new Coon.common.component.editor.DateTypeEditor(
|
|
79
|
+
editor = new Coon.common.component.editor.DateTypeEditor({
|
|
80
|
+
record: record,
|
|
81
|
+
});
|
|
80
82
|
break;
|
|
81
83
|
case Coon.common.component.editor.CharacteristicEditorTypes.LIST:
|
|
82
84
|
editor = new Coon.common.component.editor.DFVTypeEditor();
|
|
@@ -240,17 +242,54 @@ Ext.define('Coon.common.component.editor.DateTypeEditor', {
|
|
|
240
242
|
'SigmaUtilities.view.common.component.editor.DateTypeEditor'
|
|
241
243
|
],
|
|
242
244
|
alias: 'widget.DateTypeEditor',
|
|
245
|
+
requires: [
|
|
246
|
+
'Ext.form.field.Date'
|
|
247
|
+
],
|
|
243
248
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
249
|
+
createField: function() {
|
|
250
|
+
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
251
|
+
this.mask = this.parseMask(this.record.get(ns.$mask));
|
|
252
|
+
const plugins = this.mask['periodPicker'] ? 'PeriodPickerPlugin' : [];
|
|
253
|
+
return new Ext.form.field.Date({
|
|
247
254
|
allowBlank: true,
|
|
248
|
-
|
|
255
|
+
plugins: plugins,
|
|
256
|
+
format: this.mask['valueFormat'] || 'd.m.Y',
|
|
257
|
+
});
|
|
249
258
|
},
|
|
250
259
|
|
|
251
260
|
setData: function(value, record) {
|
|
252
261
|
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
253
|
-
|
|
262
|
+
this.mask = this.parseMask(record.get(ns.$mask));
|
|
263
|
+
if (this.mask['valueFormat']) {
|
|
264
|
+
this.record.set(ns.$value,
|
|
265
|
+
Ext.util.Format.dateRenderer(this.mask['valueFormat'])(value));
|
|
266
|
+
}
|
|
267
|
+
this.record.set(ns.$valueDescription,
|
|
268
|
+
Ext.util.Format.dateRenderer(this.mask['displayFormat'] || 'd.m.Y')(value));
|
|
269
|
+
},
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* В поле 'Маска' настройки редактора можно указать следующие свойства (в качестве разделителя используется знак "|" или ":"):
|
|
273
|
+
* valueFormat - формат занчения характеристики. По умолчанию 'd.m.Y';
|
|
274
|
+
* displayFormat - формат отображения данных после редактирования.
|
|
275
|
+
* Если значение не указано, но указан формат valueFormat, то используется формат valueFormat. По умолчанию 'd.m.Y';
|
|
276
|
+
* periodPicker - дабавлять ли к редактору плагин PeriodPickerPlugin. По умолчанию false
|
|
277
|
+
*
|
|
278
|
+
* Примеры использования: 'Y-m|F Y|true', 'Y-m', 'Y-m|F Y'
|
|
279
|
+
*/
|
|
280
|
+
parseMask: function(mask) {
|
|
281
|
+
let result = {};
|
|
282
|
+
if (!Ext.isEmpty(mask)) {
|
|
283
|
+
const arr = mask.split(/[:|]/);
|
|
284
|
+
let ind = 0;
|
|
285
|
+
const valueFormat = arr[ind++];
|
|
286
|
+
result = {
|
|
287
|
+
valueFormat: valueFormat,
|
|
288
|
+
displayFormat: ind < arr.length ? arr[ind++] : valueFormat,
|
|
289
|
+
periodPicker: ind < arr.length ? arr[ind++] : false,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
return result;
|
|
254
293
|
},
|
|
255
294
|
});
|
|
256
295
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
Ext.define('Coon.common.field.EditorJs', {
|
|
2
|
+
extend: 'Ext.Component',
|
|
3
|
+
xtype: 'EditorJs',
|
|
4
|
+
cls: 'EditorJs',
|
|
5
|
+
config: {
|
|
6
|
+
value: '',
|
|
7
|
+
name: '',
|
|
8
|
+
},
|
|
9
|
+
countColumns: 1,
|
|
10
|
+
twoWayBindable: ['value', 'countColumns'],
|
|
11
|
+
|
|
12
|
+
margin: '40 0 0 0',
|
|
13
|
+
|
|
14
|
+
listeners: {
|
|
15
|
+
boxready: function() {
|
|
16
|
+
this.renderEditor();
|
|
17
|
+
},
|
|
18
|
+
beforedestroy: function() {
|
|
19
|
+
if (this.editor) {
|
|
20
|
+
Ext.dom.Query.select('[data-id="' + this.getId() + '"]').forEach((elem) => {
|
|
21
|
+
elem.remove();
|
|
22
|
+
});
|
|
23
|
+
typeof this.editor.destroy === 'function' && this.editor.destroy();
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
setCountColumns: function(value) {
|
|
28
|
+
// console.log(this.editor,value)
|
|
29
|
+
this.countColumns = value;
|
|
30
|
+
},
|
|
31
|
+
getCountColumns: function() {
|
|
32
|
+
return this.countColumns;
|
|
33
|
+
},
|
|
34
|
+
setValue: function(value) {
|
|
35
|
+
if (this.editor && typeof this.editor.render === 'function' && value) {
|
|
36
|
+
this.editor.render(JSON.parse(value));
|
|
37
|
+
}
|
|
38
|
+
this.value = value;
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
getValue: function() {
|
|
42
|
+
return this.editor && typeof this.editor.save === 'function' && this.editor.save();
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
renderEditor: function() {
|
|
46
|
+
const me = this;
|
|
47
|
+
this.editor = new Ext.xEditorJS({
|
|
48
|
+
logLevel: 'ERROR',
|
|
49
|
+
tools: {
|
|
50
|
+
table: {
|
|
51
|
+
class: Ext.xTable,
|
|
52
|
+
inlineToolbar: false,
|
|
53
|
+
config: {
|
|
54
|
+
rows: 1,
|
|
55
|
+
cols: this.getCountColumns(),
|
|
56
|
+
dataTarget: this.getId(),
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
i18n: {
|
|
61
|
+
messages: {
|
|
62
|
+
tools: {
|
|
63
|
+
table: {
|
|
64
|
+
'Merge Cells': 'Объеденить ячейки',
|
|
65
|
+
'Divide Cell': 'Разъеденить ячейки',
|
|
66
|
+
'Insert Column On Right': 'Добавить колонку справа',
|
|
67
|
+
'Insert Row Below': 'Добавить строку ниже',
|
|
68
|
+
'Remove Column': 'Удалить колонку',
|
|
69
|
+
'Remove Row': 'Удалить строку',
|
|
70
|
+
'Cell Color': 'Стили ячейки',
|
|
71
|
+
'Header Row': 'Заголавная строка',
|
|
72
|
+
'Header Column': 'Заглавная колонка',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
holder: this.getId(),
|
|
78
|
+
onChange: (api, event) => {
|
|
79
|
+
api.saver.save().then((data) => {
|
|
80
|
+
me.value = JSON.stringify(data);
|
|
81
|
+
});
|
|
82
|
+
},
|
|
83
|
+
onReady: () => {
|
|
84
|
+
me.setValue(me.value);
|
|
85
|
+
if (me.getEl() && me.getEl().dom) {
|
|
86
|
+
Ext.dom.Query.select('[data-item-name="paragraph"]', me.getEl().dom).forEach((el) => el.style.display = 'none');
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
.tc-table__color-palette, .tc-table__option_table {
|
|
2
|
+
z-index: 9999999 !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.codex-editor__redactor {
|
|
6
|
+
padding-bottom: 50px !important;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.EditorJs {
|
|
10
|
+
.ce-block {
|
|
11
|
+
max-width: 650px;
|
|
12
|
+
border: 1px solid #dddddd;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.codex-editor__redactor {
|
|
16
|
+
padding-bottom: 50px !important;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.ce-block__content {
|
|
20
|
+
margin: 5px 0 0 50px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.ce-toolbar__content {
|
|
24
|
+
margin: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ce-toolbar__actions {
|
|
28
|
+
left: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.tc-editor {
|
|
32
|
+
padding: 0 10px 10px 10px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.tc-table__container {
|
|
36
|
+
padding: 40px 2px 16px 40px;
|
|
37
|
+
}
|
|
38
|
+
.codex-editor--narrow .ce-toolbox .ce-popover{
|
|
39
|
+
left: 0;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Ext.define('Coon.common.field.EditorJsField', {
|
|
2
|
+
extend: 'Ext.form.FieldContainer',
|
|
3
|
+
xtype: 'EditorJsField',
|
|
4
|
+
config: {
|
|
5
|
+
value: '',
|
|
6
|
+
name: '',
|
|
7
|
+
},
|
|
8
|
+
countColumns: 1,
|
|
9
|
+
twoWayBindable: ['value', 'countColumns'],
|
|
10
|
+
layout: {
|
|
11
|
+
type: 'hbox',
|
|
12
|
+
align: 'stretch',
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
initComponent: function() {
|
|
16
|
+
this.editor = Ext.create('Coon.common.field.EditorJs', {overflowY: true, width: '100%'});
|
|
17
|
+
this.items = [
|
|
18
|
+
{height: 40},
|
|
19
|
+
this.editor
|
|
20
|
+
];
|
|
21
|
+
this.callParent();
|
|
22
|
+
},
|
|
23
|
+
setCountColumns: function(value) {
|
|
24
|
+
this.editor && this.editor.setCountColumns(value);
|
|
25
|
+
},
|
|
26
|
+
getCountColumns: function() {
|
|
27
|
+
return this.countColumns;
|
|
28
|
+
},
|
|
29
|
+
setValue: function(value) {
|
|
30
|
+
this.editor && this.editor.setValue(value);
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
getValue: function() {
|
|
34
|
+
return this.editor && this.editor.getValue();
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -98,8 +98,8 @@ Ext.define('Coon.report.component.ParameterizedReportCombo', {
|
|
|
98
98
|
const memberFn = Ext.applyIf(this.memberFn || {}, {
|
|
99
99
|
getLastOptions: function() {
|
|
100
100
|
const data = [];
|
|
101
|
-
const searchParamsConfig = !Ext.isEmpty(this.getSearchParams()) ?
|
|
102
|
-
this.getSearchParams() :
|
|
101
|
+
const searchParamsConfig = !Ext.isEmpty(this.combo.getSearchParams()) ?
|
|
102
|
+
this.combo.getSearchParams() :
|
|
103
103
|
Coon.report.component.ParameterizedReportCombo.searchRules;
|
|
104
104
|
for (let i = 0; i < searchParamsConfig.length; i++) {
|
|
105
105
|
const obj = searchParamsConfig[i];
|
|
@@ -262,11 +262,13 @@ Ext.define('Coon.report.component.ReportLookupCombo', {
|
|
|
262
262
|
);
|
|
263
263
|
this.disable();
|
|
264
264
|
return Coon.util.promisifyCmd(
|
|
265
|
-
'command.GetDynamicReportDataCommand',
|
|
266
265
|
{
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
266
|
+
command: 'command.GetDynamicReportDataCommand',
|
|
267
|
+
params: {
|
|
268
|
+
reportId: this.reportId,
|
|
269
|
+
parameterList: this.prepareParams(parameters),
|
|
270
|
+
necessaryFields: this.useNecessaryFields && this.getReportFields(),
|
|
271
|
+
},
|
|
270
272
|
}
|
|
271
273
|
).then((result) => {
|
|
272
274
|
if (this.destroyed) {
|
|
@@ -444,7 +444,7 @@ Ext.define('Coon.report.component.ReportPickerLookupCombo', {
|
|
|
444
444
|
if (this.reportConfig) {
|
|
445
445
|
return Promise.resolve(this.reportConfig);
|
|
446
446
|
}
|
|
447
|
-
return Coon.util.promisifyCmd('command.LoadDynamicReportCommand', {reportId: this.reportId})
|
|
447
|
+
return Coon.util.promisifyCmd({command: 'command.LoadDynamicReportCommand', params: {reportId: this.reportId}})
|
|
448
448
|
.then((config) => {
|
|
449
449
|
this.reportConfig = config;
|
|
450
450
|
return this.reportConfig;
|
|
@@ -22,6 +22,7 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
|
|
|
22
22
|
|
|
23
23
|
init(grid) {
|
|
24
24
|
this.callParent([grid]);
|
|
25
|
+
this.grid = grid;
|
|
25
26
|
const format = this.config.exportFileFormat;
|
|
26
27
|
this.buttonText = this.buttonText || (format && 'Экспорт в ' + format);
|
|
27
28
|
grid.on('render', function() {
|
|
@@ -33,7 +34,6 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
|
|
|
33
34
|
handler: Ext.bind(this.handler, this),
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
|
-
this.grid = grid;
|
|
37
37
|
}, this);
|
|
38
38
|
this.printPdfCommand = Ext.create('command.GetPdfReportDataCommand', {useRawFilterParams: this.getConfig('addToSearchButton')});
|
|
39
39
|
},
|
|
@@ -157,6 +157,7 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
|
|
|
157
157
|
},
|
|
158
158
|
|
|
159
159
|
printExcelFile: async function() {
|
|
160
|
+
this.grid.mask('подождите пожалуйста...');
|
|
160
161
|
const fileName = this.config.reportFileName || this.report.reportId || 'defaultReportName';
|
|
161
162
|
const currentParamList = this.getConfig('addToSearchButton') ? this.report.northPanel.collectParams() : this.report.currentParamList;
|
|
162
163
|
|
|
@@ -186,7 +187,16 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
|
|
|
186
187
|
columnList: JSON.stringify(this.config.columns),
|
|
187
188
|
toExcel: JSON.stringify(this.config.toExcel),
|
|
188
189
|
},
|
|
189
|
-
success
|
|
190
|
+
success(responce) {
|
|
191
|
+
this.grid.unmask();
|
|
192
|
+
Coon.util.downloadFileFromBlob(new Blob([responce.responseBytes]), `${fileName}.xlsx`);
|
|
193
|
+
},
|
|
194
|
+
failure(error) {
|
|
195
|
+
this.grid.unmask();
|
|
196
|
+
Coon.log.error('ExportReportDataToFilePlugin error: ', error);
|
|
197
|
+
Ext.Msg.alert('ошибка', 'ошибка загрузки файла');
|
|
198
|
+
},
|
|
199
|
+
scope: this,
|
|
190
200
|
});
|
|
191
201
|
},
|
|
192
202
|
|
|
@@ -6,6 +6,7 @@ Ext.define('Coon.uielement.plugin.MethodChainPlugin', {
|
|
|
6
6
|
config: {
|
|
7
7
|
handlerName: undefined,
|
|
8
8
|
methodNames: [],
|
|
9
|
+
errorHandlers: undefined,
|
|
9
10
|
},
|
|
10
11
|
|
|
11
12
|
init: function(view) {
|
|
@@ -16,9 +17,48 @@ Ext.define('Coon.uielement.plugin.MethodChainPlugin', {
|
|
|
16
17
|
}
|
|
17
18
|
},
|
|
18
19
|
|
|
19
|
-
handler
|
|
20
|
-
for (
|
|
21
|
-
|
|
20
|
+
async handler() {
|
|
21
|
+
for (const methodName of this.methodNames) {
|
|
22
|
+
let result;
|
|
23
|
+
if (typeof this.controller[methodName] === 'function') {
|
|
24
|
+
try {
|
|
25
|
+
result = this.controller[methodName].call();
|
|
26
|
+
} catch (error) {
|
|
27
|
+
this.showError(methodName);
|
|
28
|
+
break;
|
|
29
|
+
}
|
|
30
|
+
} else {
|
|
31
|
+
this.showError(false, `Ошибка в обработчике ${methodName} в ${this.handlerName}`);
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
if (result && result instanceof Promise) {
|
|
35
|
+
const isError = await result.catch(() => 'error');
|
|
36
|
+
if (isError=== 'error') {
|
|
37
|
+
if (this.errorHandlers && this.errorHandlers[methodName]) {
|
|
38
|
+
if (typeof this.controller[this.errorHandlers[methodName]] === 'function') {
|
|
39
|
+
try {
|
|
40
|
+
this.controller[this.errorHandlers[methodName]].call();
|
|
41
|
+
} catch (error) {
|
|
42
|
+
this.showError(false, `Ошибка в обработчике ${this.errorHandlers[methodName]} в ${this.handlerName}`);
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
} else {
|
|
47
|
+
this.showError(methodName);
|
|
48
|
+
}
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
22
52
|
}
|
|
23
53
|
},
|
|
54
|
+
|
|
55
|
+
showError(methodName, msg) {
|
|
56
|
+
Ext.Msg.show({
|
|
57
|
+
title: 'Ошибка',
|
|
58
|
+
message: msg || `Произошла ошибка в методе ${methodName} при выполнении последовательности ${this.handlerName}`,
|
|
59
|
+
buttons: Ext.Msg.OK,
|
|
60
|
+
icon: Ext.Msg.ERROR,
|
|
61
|
+
});
|
|
62
|
+
},
|
|
63
|
+
|
|
24
64
|
});
|
|
@@ -66,7 +66,7 @@ Ext.define('Coon.uielement.plugin.configPanel.MethodChainPluginConfigPanelFormEd
|
|
|
66
66
|
text: 'Method',
|
|
67
67
|
dataIndex: 'value',
|
|
68
68
|
required: true,
|
|
69
|
-
flex:
|
|
69
|
+
flex: 1,
|
|
70
70
|
xtype: 'hintColumn',
|
|
71
71
|
editor: {
|
|
72
72
|
xtype: 'BaseComboBox',
|
|
@@ -86,6 +86,46 @@ Ext.define('Coon.uielement.plugin.configPanel.MethodChainPluginConfigPanelFormEd
|
|
|
86
86
|
},
|
|
87
87
|
},
|
|
88
88
|
},
|
|
89
|
+
{
|
|
90
|
+
xtype: 'widgetcolumn',
|
|
91
|
+
widget: {
|
|
92
|
+
xtype: 'SearchByPropButton',
|
|
93
|
+
tooltip: 'перейти к плагину с таким обработчиком',
|
|
94
|
+
handler() {},
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
text: 'Error handler',
|
|
99
|
+
dataIndex: 'errorHandler',
|
|
100
|
+
required: true,
|
|
101
|
+
flex: 1,
|
|
102
|
+
xtype: 'hintColumn',
|
|
103
|
+
editor: {
|
|
104
|
+
xtype: 'BaseComboBox',
|
|
105
|
+
loadOnRender: false,
|
|
106
|
+
hideMode: 'offsets',
|
|
107
|
+
bind: {
|
|
108
|
+
store: '{handlersStore}',
|
|
109
|
+
},
|
|
110
|
+
valueField: 'handlerName',
|
|
111
|
+
displayField: 'handlerWithPtype',
|
|
112
|
+
minChars: 2,
|
|
113
|
+
triggers: {
|
|
114
|
+
clear: {
|
|
115
|
+
cls: 'svg-icon svg-icon-cancel-small',
|
|
116
|
+
tooltip: 'Очистить поле',
|
|
117
|
+
handler: function() {
|
|
118
|
+
this.clear();
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
listeners: {
|
|
123
|
+
focus: (combo) => {
|
|
124
|
+
combo.up('MethodChainPluginConfigPanelFormEditor').getActualPlugins();
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
},
|
|
89
129
|
{
|
|
90
130
|
xtype: 'widgetcolumn',
|
|
91
131
|
widget: {
|
|
@@ -100,6 +140,9 @@ Ext.define('Coon.uielement.plugin.configPanel.MethodChainPluginConfigPanelFormEd
|
|
|
100
140
|
if (cellIndex === 1) {
|
|
101
141
|
view.up('MethodChainPluginConfigPanelFormEditor').fireEvent('searchbyprop', rec.get('value'));
|
|
102
142
|
}
|
|
143
|
+
if (cellIndex === 3) {
|
|
144
|
+
view.up('MethodChainPluginConfigPanelFormEditor').fireEvent('searchbyprop', rec.get('errorHandler'));
|
|
145
|
+
}
|
|
103
146
|
},
|
|
104
147
|
},
|
|
105
148
|
store: {},
|
|
@@ -128,7 +171,13 @@ Ext.define('Coon.uielement.plugin.configPanel.MethodChainPluginConfigPanelFormEd
|
|
|
128
171
|
}
|
|
129
172
|
if (Ext.isArray(config['methodNames'])) {
|
|
130
173
|
const parArr = [];
|
|
131
|
-
config['methodNames'].forEach((el) =>
|
|
174
|
+
config['methodNames'].forEach((el) => {
|
|
175
|
+
const res = {value: el};
|
|
176
|
+
if (config['errorHandlers'] && config['errorHandlers'][el]) {
|
|
177
|
+
res['errorHandler'] = config['errorHandlers'][el];
|
|
178
|
+
}
|
|
179
|
+
parArr.push(res);
|
|
180
|
+
});
|
|
132
181
|
this.getViewModel().set('methodNames', parArr);
|
|
133
182
|
}
|
|
134
183
|
},
|
|
@@ -136,9 +185,13 @@ Ext.define('Coon.uielement.plugin.configPanel.MethodChainPluginConfigPanelFormEd
|
|
|
136
185
|
const result = {};
|
|
137
186
|
const vm = this.getViewModel();
|
|
138
187
|
const parameters = [];
|
|
188
|
+
const errorHandlers = {};
|
|
139
189
|
this.down('ReportPropertiesGrid').getStore().each((record) => {
|
|
140
190
|
if (record.get('value') && !record.get('isDeleted')) {
|
|
141
191
|
parameters.push(record.get('value'));
|
|
192
|
+
if (record.get('errorHandler')) {
|
|
193
|
+
errorHandlers[record.get('value')] = record.get('errorHandler');
|
|
194
|
+
}
|
|
142
195
|
}
|
|
143
196
|
});
|
|
144
197
|
if (parameters.length) {
|
|
@@ -147,6 +200,9 @@ Ext.define('Coon.uielement.plugin.configPanel.MethodChainPluginConfigPanelFormEd
|
|
|
147
200
|
if (vm.get('handlerName')) {
|
|
148
201
|
result['handlerName'] = vm.get('handlerName');
|
|
149
202
|
}
|
|
203
|
+
if (Object.keys(errorHandlers).length) {
|
|
204
|
+
result['errorHandlers'] = errorHandlers;
|
|
205
|
+
}
|
|
150
206
|
return result;
|
|
151
207
|
},
|
|
152
208
|
|
package/src/util.js
CHANGED
|
@@ -18,11 +18,25 @@ Ext.define('Coon.util', {
|
|
|
18
18
|
return Ext.isObject(cmd) && cmd.isCommand;
|
|
19
19
|
},
|
|
20
20
|
|
|
21
|
+
isCommandAlias(cmd) {
|
|
22
|
+
return typeof cmd === 'string' && typeof Ext.ClassManager.getByAlias(cmd) === 'function';
|
|
23
|
+
},
|
|
24
|
+
|
|
21
25
|
promisifyCmd(cls, ...args) {
|
|
22
|
-
|
|
26
|
+
let alias = cls;
|
|
27
|
+
if (Ext.isObject(cls)) {
|
|
28
|
+
alias = cls.command;
|
|
29
|
+
cls.getParamsFromObject = true;
|
|
30
|
+
}
|
|
31
|
+
let command;
|
|
32
|
+
command = Coon.util.isCommand(alias) && alias;
|
|
33
|
+
command = Coon.util.isCommandAlias(alias) && Ext.create(alias, {processError: true})
|
|
34
|
+
if (!command) {
|
|
35
|
+
throw new Error('promisifyCmd command in invalid!')
|
|
36
|
+
}
|
|
23
37
|
return new Promise((resolve, reject) => {
|
|
24
|
-
if (
|
|
25
|
-
command.executeWith(
|
|
38
|
+
if (cls.getParamsFromObject) {
|
|
39
|
+
command.executeWith(cls.params);
|
|
26
40
|
} else {
|
|
27
41
|
command.execute(...args);
|
|
28
42
|
}
|
package/src/version.js
CHANGED