ru.coon 2.7.30 → 2.7.32
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 +28 -0
- package/package.json +1 -1
- package/src/common/field/PeriodByReportField.js +139 -0
- package/src/common/field/checkbox/RoundCheckbox.js +5 -0
- package/src/common/field/checkbox/RoundCheckbox.scss +48 -0
- package/src/nav/MenuLoader.js +23 -0
- package/src/report/component/LocalPagingComboPicker.js +1 -1
- package/src/report/plugin/configPanel/TreeNestingToolbarButtonPluginConfigPanel.js +19 -0
- package/src/report/plugin/grid/ExportReportDataToFilePlugin.md +7 -0
- package/src/report/plugin/grid/TreeNestingToolbarButtonPlugin.js +128 -0
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,31 @@
|
|
|
1
|
+
# Version 2.7.32, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/40925f0ca399d6d5da42511e20b8c7fa10acadaf)
|
|
2
|
+
* ## Features
|
|
3
|
+
* <span style='color:green'>feat: HT-8492: create new type field</span> ([0657da], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0657da1e4ba8e54a47eaca571cf71596c8107c7c))
|
|
4
|
+
|
|
5
|
+
* update: CHANGELOG.md ([1e8b7b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1e8b7b6e038fb0ea66ce786f648af3e4934afc11))
|
|
6
|
+
|
|
7
|
+
# Version 2.7.31, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b6fab6651c567feee5d735e2fd1af27ea315d393)
|
|
8
|
+
* ## Features
|
|
9
|
+
* <span style='color:green'>feat: HT-8131 add TreeNestingToolbarButtonPlugin</span> ([15ec59], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/15ec59a4f41473a5d0cd8a174c641875ec95418b))
|
|
10
|
+
|
|
11
|
+
* ## Fixes
|
|
12
|
+
* <span style='color:red'> HT-8910 При загрузке страницы в LocalPagingComboPicker проверяется, что выполнена загрузка и есть страницы</span> ([c7f82c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c7f82cd4743eb568d75fb188217d3d3bfc1eba1a))
|
|
13
|
+
* <span style='color:red'> HT-8131 changed the menu order</span> ([e8b203], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e8b203fb937bd9acb9464cc48115764a227d31ba))
|
|
14
|
+
|
|
15
|
+
* update: CHANGELOG.md ([935b5a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/935b5a73025d3ff9cdf61188e1b3fb1f754b84da))
|
|
16
|
+
|
|
1
17
|
# Version 2.7.30, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a72ce199d2d79b7a5dcb52cc81cd68e46f34829a)
|
|
2
18
|
* ## Fixes
|
|
3
19
|
* <span style='color:red'> HT-8422: set filter panel height on afterlayout</span> ([d65a92], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d65a9277c2fcedaba912ff40ba7a912049bdd7f7))
|
|
20
|
+
* <span style='color:red'> HT-8131 add universal button for collapse/expand report lines in a hierarchy</span> ([0a7edf], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0a7edf4357213fd7872ecb361ce47261b3102b4c))
|
|
21
|
+
* <span style='color:red'> HT-8131 refactoring</span> ([f2b72a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f2b72a804d99b23988f0e25d2f5e0ec831c694bb))
|
|
4
22
|
|
|
5
23
|
* update: CHANGELOG.md ([880435], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/88043579448bda38f9c2b2ec4d159a2d502dba5a))
|
|
6
24
|
|
|
7
25
|
# Version 2.7.29, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/567513e38f7c7e6b90e1873785d5fb69e9fb9f4b)
|
|
8
26
|
* ## Fixes
|
|
27
|
+
* <span style='color:red'> HT-8131 set new menu</span> ([19b735], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/19b73537c87c685cdf11156c4cc95e120b7eb89e))
|
|
28
|
+
* <span style='color:red'> HT-8131 renaming</span> ([6a84ad], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6a84ad2ca12ee556278e9f2bb25a9fe94b8ae38e))
|
|
9
29
|
* <span style='color:red'> CustomValueCheckBox updateCheckedCls by transformed value. Closes HT-8838.</span> ([1ac9e0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1ac9e0051d72938c2942a2d528e40fd9b20ca4a0))
|
|
10
30
|
|
|
11
31
|
* add CoonQtip plugin for adding tooltip on fields with missing tooltip feature ([49dabd], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/49dabdd3c14afd50413d8a1b9a027a9fbd78713d))
|
|
@@ -111,6 +131,9 @@
|
|
|
111
131
|
* update: CHANGELOG.md ([7e0d7a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7e0d7a025de88c42cf8a8e93ff0a7450339b21d6))
|
|
112
132
|
|
|
113
133
|
# Version 2.0.104, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7358f6f6fdd7dc823e356d7a40416fab2dadd3cc)
|
|
134
|
+
* ## Features
|
|
135
|
+
* <span style='color:green'>feat: HT-8131 refactoring</span> ([de3817], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/de3817d1517e3b9153dca662361e900cf1b1208a))
|
|
136
|
+
|
|
114
137
|
* ## Fixes
|
|
115
138
|
* <span style='color:red'> HT-8422: fix colors</span> ([c97c54], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c97c546e5688fbba054bce8bc0655261972b7a27))
|
|
116
139
|
* <span style='color:red'> HT-8422: fix colors</span> ([eae5f9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/eae5f92b6d3b4629e79232cf8e214ac89114be78))
|
|
@@ -122,8 +145,10 @@
|
|
|
122
145
|
|
|
123
146
|
# Version 2.7.15, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1e27a6d56071c26951813a36d45daf805a6f750d)
|
|
124
147
|
* ## Features
|
|
148
|
+
* <span style='color:green'>feat: HT-8131 add universal button for collapse/expand report lines in a hierarchy</span> ([9e7242], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9e7242dadb2907ac135dd9e6bd2bf7309ef5996f))
|
|
125
149
|
* <span style='color:green'>feat: Вывод сообщения об ошибках при инициализации плагинов отчета. Closes HT-8531.</span> ([a35d09], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a35d09c39f20263dd032f6accc9d175a8241e111))
|
|
126
150
|
* <span style='color:green'>feat: Добавлено логирование ошибки, при возврате отчетом более одной строки. Related to HT-8223.</span> ([34491c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/34491c4ee3f5dc6d26f5c04652796d563c9fb6c4))
|
|
151
|
+
* <span style='color:green'>feat: HT-8131 add universal button for collapse/expand report lines in a hierarchy</span> ([4da24d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/4da24d2084419d57871be03bda1d714bc3e2cc7b))
|
|
127
152
|
|
|
128
153
|
* ## Fixes
|
|
129
154
|
* <span style='color:red'> HT-8257: publish state only on tab change and prepare data to save</span> ([81e5a6], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/81e5a64bf6c1f106f477877a94d61d5da55faf36))
|
|
@@ -135,6 +160,7 @@
|
|
|
135
160
|
* ## Fixes
|
|
136
161
|
* <span style='color:red'> BFL-3938: check plugin attribute is no=t empty and check row objects</span> ([94ce92], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/94ce92a1ee3d9a7313462b061a1b7ec8868c3275))
|
|
137
162
|
|
|
163
|
+
* upd ([da0796], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/da07969de4fad7688b9119331e1f5867fc7aff89))
|
|
138
164
|
* update: CHANGELOG.md ([91bb31], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/91bb31ecc6eac439793205fd9b9d7f748483ff8d))
|
|
139
165
|
|
|
140
166
|
# Version 2.7.13, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c2a509ebbdf7d3ddd07faaf3a42f0ef759a31cc4)
|
|
@@ -192,6 +218,7 @@
|
|
|
192
218
|
# Version 2.7.6, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ab36a4fa8f1d7894eb9bbf8bac33276c7659f90d)
|
|
193
219
|
* HT-8373 fix: Исправлена ошибка валидации параметров (свойств параметра)... ([46513a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/46513a1a976cb7440777508f13356667e72fd98f))
|
|
194
220
|
* HT-7448 feat: Изменяемый размер и сохранение состояния панели "Настройки команды" в ExecuteCommandButtonPluginConfigPanel. ([933ca2], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/933ca2edf1999a4e0f8bdfb0c54a4d4da4bfa603))
|
|
221
|
+
* draft ([8a1a53], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8a1a5352f5639bbe634b737e0c07b202412ac986))
|
|
195
222
|
* update: CHANGELOG.md ([baca35], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/baca356d93e141e0bb134de87f2cb60b1c15d0dc))
|
|
196
223
|
|
|
197
224
|
# Version 2.7.5, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/98f5d7b3391db7e90e8818d6071c674b71cb6afd)
|
|
@@ -199,6 +226,7 @@
|
|
|
199
226
|
* <span style='color:green'>feat: TR-67883: reload main navigation on change menu structure</span> ([a6a849], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a6a849e812bc3988abadc526aa4829830eb89ed2))
|
|
200
227
|
|
|
201
228
|
* HT-7448 fix: Исправление проверки валидности параметров команды ([99c08a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/99c08a16a68766ece123b717ef48400b14f51d54))
|
|
229
|
+
* draft ([589349], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/58934923b2f9959c9ea4b3e4e5833f5bba3ced04))
|
|
202
230
|
* update: CHANGELOG.md ([90c0e8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/90c0e823dcf1d3687c38ada3d6711a84fa15e083))
|
|
203
231
|
|
|
204
232
|
# Version 2.7.4, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7becde7cc7cfb8254525c8beca11cbd4604b8181)
|
package/package.json
CHANGED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
Ext.define('Coon.common.field.PeriodByReportField', {
|
|
2
|
+
extend: 'Coon.report.component.SimplestReportCombo',
|
|
3
|
+
xtype: 'PeriodByReportField',
|
|
4
|
+
config: {
|
|
5
|
+
periodEndName: undefined,
|
|
6
|
+
periodStart: undefined,
|
|
7
|
+
periodEnd: undefined,
|
|
8
|
+
dateFormatDB: 'Y-m',
|
|
9
|
+
/* defaultValueOpt: {
|
|
10
|
+
key: 'IS_DEFAULT',
|
|
11
|
+
value: 'Y',
|
|
12
|
+
},*/
|
|
13
|
+
defaultValueOpt: undefined,
|
|
14
|
+
},
|
|
15
|
+
setInitDateToEnd: false,
|
|
16
|
+
triggers: {
|
|
17
|
+
back: {
|
|
18
|
+
cls: 'x-fa fa-arrow-left',
|
|
19
|
+
handler: (cmp) => {
|
|
20
|
+
cmp.goBack();
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
forward: {
|
|
24
|
+
cls: 'x-fa fa-arrow-right',
|
|
25
|
+
handler: (cmp) => {
|
|
26
|
+
cmp.goForward();
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
goBack(setValToRef) {
|
|
32
|
+
if (!this.getValue()) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const store = this.getStore();
|
|
36
|
+
const curRecordPosition = store.find(this.valueField, this.getValue());
|
|
37
|
+
if (curRecordPosition >= 0 && curRecordPosition < (store.getData().length - 1)) {
|
|
38
|
+
const rec = store.getAt(curRecordPosition + 1);
|
|
39
|
+
rec && this.select(rec);
|
|
40
|
+
if (setValToRef) {
|
|
41
|
+
this.getPeriodStart() && this.getPeriodStart().setValue(rec.get(this.valueField));
|
|
42
|
+
this.getPeriodEnd() && this.getPeriodEnd().setValue(rec.get(this.valueField));
|
|
43
|
+
}
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
if (this.getPeriodStart()) {
|
|
47
|
+
this.getPeriodStart().fireEvent('goBack', true);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
goForward(setValToRef) {
|
|
53
|
+
if (!this.getValue()) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const store = this.getStore();
|
|
57
|
+
const curRecordPosition = store.find(this.valueField, this.getValue());
|
|
58
|
+
if (curRecordPosition > 0) {
|
|
59
|
+
const rec = store.getAt(curRecordPosition - 1);
|
|
60
|
+
rec && this.select(rec);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
|
|
65
|
+
doInit(startDate) {
|
|
66
|
+
if (startDate && Ext.isDate(new Date(startDate))) {
|
|
67
|
+
this.setStartDate(startDate);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
setStartDate(value) {
|
|
72
|
+
this.setValue(value);
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
setEndDate(value) {
|
|
76
|
+
const field = this.getEndField();
|
|
77
|
+
field && field.setValue(value);
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
getEndField() {
|
|
81
|
+
if (!this.getPeriodEndName()) {
|
|
82
|
+
return null;
|
|
83
|
+
};
|
|
84
|
+
const ownerCmp = this.up('FilterPanel') || this.up('[dataId=FilterPanel]') || this.up();
|
|
85
|
+
let cmpQuery = [];
|
|
86
|
+
if (ownerCmp) {
|
|
87
|
+
cmpQuery = Ext.ComponentQuery.query(`[name=${this.getPeriodEndName()}]`, ownerCmp);
|
|
88
|
+
}
|
|
89
|
+
return cmpQuery.length && this.setPeriodEnd(cmpQuery[0]) && cmpQuery[0];
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
onStoreLoad(store) {
|
|
93
|
+
if (this.getValue()) {
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const opt = this.getDefaultValueOpt();
|
|
97
|
+
let number = 0;
|
|
98
|
+
if (opt && opt.key && opt.value) {
|
|
99
|
+
number = store.find(opt.key, opt.value);
|
|
100
|
+
} else if (this.getPeriodEndName()) {
|
|
101
|
+
number = store.find(this.valueField, Ext.Date.format(new Date(), this.getDateFormatDB()));
|
|
102
|
+
}
|
|
103
|
+
if (this.getPeriodEndName()) {
|
|
104
|
+
this.setInitDateToEnd = true;
|
|
105
|
+
}
|
|
106
|
+
this.select(this.getStore().getAt(number >= 0 ? number : 0));
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
initComponent: function() {
|
|
110
|
+
this.callParent();
|
|
111
|
+
this.on('goForward', this.goForward, this);
|
|
112
|
+
this.on('goBack', this.goBack, this);
|
|
113
|
+
this.on('change', () => {
|
|
114
|
+
const startDate = this.getValue();
|
|
115
|
+
const fieldEndDate = this.getEndField();
|
|
116
|
+
if (fieldEndDate && startDate) {
|
|
117
|
+
fieldEndDate.setPeriodStart(this);
|
|
118
|
+
const endDate = fieldEndDate.getValue();
|
|
119
|
+
const filters = fieldEndDate.getStore().getFilters();
|
|
120
|
+
|
|
121
|
+
const fn = (item) => {
|
|
122
|
+
return item.get(fieldEndDate.valueField) >= this.getValue();
|
|
123
|
+
};
|
|
124
|
+
filters.remove(fn);
|
|
125
|
+
filters.add(fn);
|
|
126
|
+
if (this.setInitDateToEnd) {
|
|
127
|
+
this.setInitDateToEnd = false;
|
|
128
|
+
fieldEndDate.setValue(startDate);
|
|
129
|
+
fieldEndDate.getValue();
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (startDate > endDate) {
|
|
133
|
+
fieldEndDate.setValue(startDate);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, this);
|
|
137
|
+
this.getStore().on('load', this.onStoreLoad, this);
|
|
138
|
+
},
|
|
139
|
+
});
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.x-form-fieldCheckbox {
|
|
2
|
+
.x-form-field {
|
|
3
|
+
position: relative;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.x-form-field label {
|
|
7
|
+
background-color: #fff;
|
|
8
|
+
border: 1px solid #ccc;
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
cursor: pointer;
|
|
11
|
+
height: 28px;
|
|
12
|
+
left: 0;
|
|
13
|
+
position: absolute;
|
|
14
|
+
top: 0;
|
|
15
|
+
width: 28px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.x-form-field label:after {
|
|
19
|
+
border: 2px solid #fff;
|
|
20
|
+
border-top: none;
|
|
21
|
+
border-right: none;
|
|
22
|
+
content: "";
|
|
23
|
+
height: 6px;
|
|
24
|
+
left: 7px;
|
|
25
|
+
opacity: 0;
|
|
26
|
+
position: absolute;
|
|
27
|
+
top: 8px;
|
|
28
|
+
transform: rotate(-45deg);
|
|
29
|
+
width: 12px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.x-form-field input[type="checkbox"] {
|
|
33
|
+
visibility: hidden;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.x-form-field input[type="checkbox"]:checked + label {
|
|
37
|
+
background-color: #66bb6a;
|
|
38
|
+
border-color: #66bb6a;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.x-form-field input[type="checkbox"]:checked + label:after {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.x-form-item-body, .x-form-cb-wrap-inner {
|
|
46
|
+
margin: 0 auto;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
Ext.define('Coon.nav.MenuLoader', {
|
|
2
|
+
singleton: true,
|
|
3
|
+
|
|
4
|
+
isLoaded: false,
|
|
5
|
+
|
|
6
|
+
load() {
|
|
7
|
+
return Coon.util.promisifyCmd('command.GetDynamicReportDataCommand', 'MENU_ALLITEMS')
|
|
8
|
+
.then((data) => {
|
|
9
|
+
if (Array.isArray(data.list)) {
|
|
10
|
+
this.uiElementMap = data.list.reduce();
|
|
11
|
+
}
|
|
12
|
+
this.isLoaded = true;
|
|
13
|
+
});
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
get() {
|
|
17
|
+
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
isValidMenuItem(uiEmentId) {
|
|
21
|
+
return this.uiElementMap.has(uiEmentId);
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -141,7 +141,7 @@ Ext.define('Coon.report.component.LocalPagingComboPicker', {
|
|
|
141
141
|
const store = this.getStore();
|
|
142
142
|
const picker = this.picker;
|
|
143
143
|
|
|
144
|
-
if (page && picker) {
|
|
144
|
+
if (page && picker && pageControl.count > 0) {
|
|
145
145
|
if (page <= pageControl.count) {
|
|
146
146
|
pageControl.currentPage = page;
|
|
147
147
|
picker.pagingToolbar.setPageNumber(page);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Ext.define('Coon.report.plugin.configPanel.TreeNestingToolbarButtonPluginConfigPanel', {
|
|
2
|
+
extend: 'Coon.report.plugin.configPanel.GridToolbarButtonPluginConfigPanel',
|
|
3
|
+
alias: 'widget.TreeNestingToolbarButtonPluginConfigPanel',
|
|
4
|
+
uses: [],
|
|
5
|
+
requires: [],
|
|
6
|
+
|
|
7
|
+
description: 'Универсальная кнопка сворачивая/разворачивания строк отчета в иерархии\t\n',
|
|
8
|
+
tags: ['Кнопка', 'Дерево', 'Группировка'],
|
|
9
|
+
|
|
10
|
+
config: {
|
|
11
|
+
pluginTypeSettings: {
|
|
12
|
+
defaultType: 'GRID_PLUGIN',
|
|
13
|
+
allowedTypes: [
|
|
14
|
+
'GRID_PLUGIN'
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
scrollable: true,
|
|
19
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
Ext.define('Coon.report.plugin.grid.TreeNestingToolbarButtonPlugin', {
|
|
2
|
+
extend: 'Coon.report.plugin.grid.GridToolbarButtonPlugin',
|
|
3
|
+
alias: 'plugin.TreeNestingToolbarButtonPlugin',
|
|
4
|
+
uses: [],
|
|
5
|
+
|
|
6
|
+
parameters: [],
|
|
7
|
+
properties: {},
|
|
8
|
+
|
|
9
|
+
configurePanelWizard: 'TreeNestingToolbarButtonPluginConfigPanel',
|
|
10
|
+
|
|
11
|
+
isSingle: true,
|
|
12
|
+
|
|
13
|
+
createToolbarItem: function() {
|
|
14
|
+
this.nestingButton = Ext.create({
|
|
15
|
+
xtype: 'button',
|
|
16
|
+
iconCls: 'svg-icon svg-icon-scheme-3',
|
|
17
|
+
disabled: true,
|
|
18
|
+
width: 66,
|
|
19
|
+
height: 40,
|
|
20
|
+
});
|
|
21
|
+
return this.nestingButton;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
customInit: function() {
|
|
25
|
+
const reportTree = this.component;
|
|
26
|
+
|
|
27
|
+
if (!reportTree instanceof Ext.tree.Panel) {
|
|
28
|
+
console.warn('Coon.report.plugin.grid.TreeFilterPlugin incorrect plugin placement');
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
reportTree.getStore().on('load', function() {
|
|
33
|
+
const records = reportTree.getStore().getRange();
|
|
34
|
+
if (!records.length) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const menus = this.getMenu(reportTree);
|
|
39
|
+
this.nestingButton.setDisabled(false);
|
|
40
|
+
this.nestingButton.setMenu(menus, false);
|
|
41
|
+
}, this);
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
getMenu: function(reportTree) {
|
|
45
|
+
return [
|
|
46
|
+
{
|
|
47
|
+
text: 'Развернуть',
|
|
48
|
+
menu: this.collectionMenuItems(),
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
text: 'Развернуть всё',
|
|
52
|
+
handler: function() {
|
|
53
|
+
Ext.suspendLayouts();
|
|
54
|
+
reportTree.getView().getStore().suspendEvents();
|
|
55
|
+
|
|
56
|
+
reportTree.expandAll();
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
reportTree.getView().getStore().resumeEvents();
|
|
60
|
+
reportTree.getView().refresh();
|
|
61
|
+
Ext.resumeLayouts(true);
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
text: 'Свернуть всё',
|
|
66
|
+
handler: function() {
|
|
67
|
+
Ext.suspendLayouts();
|
|
68
|
+
reportTree.getView().getStore().suspendEvents();
|
|
69
|
+
|
|
70
|
+
reportTree.collapseAll();
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
reportTree.getView().getStore().resumeEvents();
|
|
74
|
+
reportTree.getView().refresh();
|
|
75
|
+
Ext.resumeLayouts(true);
|
|
76
|
+
},
|
|
77
|
+
}
|
|
78
|
+
];
|
|
79
|
+
},
|
|
80
|
+
|
|
81
|
+
getGroupedRecords: function(nodes) {
|
|
82
|
+
return nodes.reduce((acc, node) => {
|
|
83
|
+
if (!node.hasChildNodes()) {
|
|
84
|
+
return acc;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const property = node.get('depth');
|
|
88
|
+
acc[property] = acc[property] || [];
|
|
89
|
+
acc[property].push(node);
|
|
90
|
+
|
|
91
|
+
const nestedAcc = this.getGroupedRecords(node.childNodes);
|
|
92
|
+
for (const nestedAccKey in nestedAcc) {
|
|
93
|
+
if (!acc[nestedAccKey]) {
|
|
94
|
+
acc[nestedAccKey] = [];
|
|
95
|
+
}
|
|
96
|
+
acc[nestedAccKey] = acc[nestedAccKey].concat(nestedAcc[nestedAccKey]);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
return acc;
|
|
100
|
+
}, {});
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
collectionMenuItems: function() {
|
|
104
|
+
const reportTree = this.component;
|
|
105
|
+
const groupedRecords = this.getGroupedRecords(reportTree.getRootNode().childNodes);
|
|
106
|
+
|
|
107
|
+
const menu = [];
|
|
108
|
+
for (const nestingLevel in groupedRecords) {
|
|
109
|
+
menu.push({
|
|
110
|
+
text: `Уровень ${nestingLevel}`,
|
|
111
|
+
handler: Ext.bind(function() {
|
|
112
|
+
Ext.suspendLayouts();
|
|
113
|
+
reportTree.getView().getStore().suspendEvents();
|
|
114
|
+
|
|
115
|
+
for (const record of groupedRecords[nestingLevel]) {
|
|
116
|
+
record.expand();
|
|
117
|
+
record.collapseChildren(true);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
reportTree.getView().getStore().resumeEvents();
|
|
121
|
+
reportTree.getView().refresh();
|
|
122
|
+
Ext.resumeLayouts(true);
|
|
123
|
+
}, this),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
return menu;
|
|
127
|
+
},
|
|
128
|
+
});
|
package/src/version.js
CHANGED