ru.coon 2.5.31 → 2.5.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 +30 -1
- package/index.js +35 -46
- package/package.json +3 -9
- package/src/log.js +3 -2
- package/src/report/plugin/configPanel/ExportReportDataToFilePluginConfigPanel.js +23 -3
- package/src/report/plugin/grid/CopyRowsFromGrid.js +1 -7
- package/src/report/plugin/grid/ExportReportDataToFilePlugin.js +48 -23
- package/src/security/component/navmenu/RoleNavMenuEditorController.js +1 -5
- package/src/security/component/role/RoleEditorController.js +1 -5
- package/src/security/component/ui/UiCPRestrictionEditorController.js +1 -5
- package/src/security/component/user/UserRoleEditorController.js +1 -5
- package/src/util.js +8 -0
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
|
-
# Version 2.5.
|
|
1
|
+
# Version 2.5.32, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/de81a198b0ffcbe7ea296f9568023ab135bdb832)
|
|
2
|
+
* update: CHANGELOG.md ([79085d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/79085d7c621b2ebeb592dbff958a4a29d276aa90))
|
|
3
|
+
|
|
4
|
+
# Version 2.5.31, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/51eafa59b0b64087dacaafd66b754c04ada7e027)
|
|
5
|
+
* ## Features
|
|
6
|
+
* <span style='color:green'>feat: HT-4550 changed to Ext.ajax</span> ([3a4af5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3a4af588bb24b481c427749ca8d658edc9d42a57))
|
|
7
|
+
* <span style='color:green'>feat: Replace 'require' with 'import', cleanup dependencies. Related to TR-67434.</span> ([3ee407], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3ee40770a402547fa72a1cc5d1bc20e297186ebb))
|
|
8
|
+
* <span style='color:green'>feat: HT-4550 add new Coon.util method, fetch instead of XMLHttpRequest</span> ([748421], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7484218eddd0e2b2e0863e88bb595aa79c8c0009))
|
|
9
|
+
|
|
10
|
+
* ## Fixes
|
|
11
|
+
* <span style='color:red'> HT-4550 refactor</span> ([b87c1b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b87c1b54d15ea311968f8fe5ed1c15afd41391c2))
|
|
12
|
+
* <span style='color:red'> Update Coon.log.isProduction</span> ([9c7f2d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9c7f2db552b265a203ca60d79205149b863760a2))
|
|
13
|
+
* <span style='color:red'> Removed obsolete dependencies. Related to TR-67434.</span> ([1229d5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1229d5fc23c6c754acde1b62bed531630d7b67cf))
|
|
14
|
+
|
|
2
15
|
* refactoring && testing ([48b4e4], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/48b4e48d890379ea569293af8ca0badb16e5e871))
|
|
3
16
|
* update: CHANGELOG.md ([6a5128], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6a512898c2d35e2d34a293837b106703a0459929))
|
|
4
17
|
|
|
@@ -33,6 +46,9 @@
|
|
|
33
46
|
* ## Features
|
|
34
47
|
* <span style='color:green'>feat: TR-67310 исправление ситуации когда defaultFocus на поле в состоянии disabled приводит к возврату фокуса на предыдущий элемент</span> ([335b93], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/335b9374874e2406e6f5c80daada6ba49eef05dc))
|
|
35
48
|
|
|
49
|
+
* ## Fixes
|
|
50
|
+
* <span style='color:red'> HT-4550 add errorWindow</span> ([9a2fcd], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9a2fcdc4320a61b8d42ba5e6593185f648d075a3))
|
|
51
|
+
|
|
36
52
|
* minor changes ([b4067a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b4067ab11832201616725d3f60a48e647a30d3bd))
|
|
37
53
|
* update: CHANGELOG.md ([c39291], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c3929159ea685f05c9011c520b7f476d0fe57329))
|
|
38
54
|
|
|
@@ -40,6 +56,11 @@
|
|
|
40
56
|
* ## Features
|
|
41
57
|
* <span style='color:green'>feat: HT-6865 доработка сервиса начитывания репортов</span> ([d5204c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d5204c0e6470e9f4858b800da4bfb779bd9d3d6a))
|
|
42
58
|
|
|
59
|
+
* ## Fixes
|
|
60
|
+
* <span style='color:red'> HT-4550 fix excel file download</span> ([b81e8d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b81e8d28b762e38362624149ddaaf9d9b5daa272))
|
|
61
|
+
* <span style='color:red'> HT-4550 fix excel file download</span> ([e4844c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e4844c0511d5401d1659be45539fe390bc50aa16))
|
|
62
|
+
* <span style='color:red'> HT-4550 fix excel file download</span> ([a7b080], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a7b080f4a12fc6c0abd31fc06f623fc5122d4951))
|
|
63
|
+
|
|
43
64
|
* CRM-7619 Доработка ReportLookupCombo дефолтными параметрами ([b9ddb1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b9ddb10c22f857d4bf33a3f66ec0ee46d8ea2add))
|
|
44
65
|
* update: CHANGELOG.md ([e8d820], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e8d82018b4cb33252c4bc997473449a4bf9d94a0))
|
|
45
66
|
|
|
@@ -87,6 +108,9 @@ isolate lastValue from native ComboBox logic</span> ([57078e], [link](http://git
|
|
|
87
108
|
* update: CHANGELOG.md ([f3a0d9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f3a0d9873147e5bc99c6a04ac9fc4292166ebbcf))
|
|
88
109
|
|
|
89
110
|
# Version 2.5.19, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/60dafd3ee4e54456992b474b81201242521c3991)
|
|
111
|
+
* ## Features
|
|
112
|
+
* <span style='color:green'>feat: HT-4550 configPanel changes</span> ([7d3ac0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7d3ac0a6a4a1124c3b1a240e26a4096635573e6a))
|
|
113
|
+
|
|
90
114
|
* ## Fixes
|
|
91
115
|
* <span style='color:red'>fix HT-7070
|
|
92
116
|
|
|
@@ -115,6 +139,7 @@ fix ReportPropertiesPanelController</span> ([e2b928], [link](http://gitlab-dbr.s
|
|
|
115
139
|
* <span style='color:green'>feat: CRM-7705 add tooltip to checkboxes on DynamicCheckboxGroup</span> ([dddc4d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dddc4d3f8d8e4f6ca7d5e9c892431b1c6fba6ae5))
|
|
116
140
|
* <span style='color:green'>Feat:TR-67289 Включил возможность авторизации по гит токену</span> ([b9505b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b9505baa99ee5f5785e6da287063774918f0d698))
|
|
117
141
|
* <span style='color:green'>feat: TR-67140 разработка универсальной компонент-формы для обработки статуса требуемых полей</span> ([20e76d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/20e76d097db4ddf9120ddc56f86b6470ab7335ca))
|
|
142
|
+
* <span style='color:green'>feat: HT-4550 add localization field property</span> ([b3bd46], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b3bd466dd68c893fefae86ae7e16877aedb861ba))
|
|
118
143
|
* <span style='color:green'>feat BFL-7734: передача headers в ASyncBaseCommand</span> ([ed1202], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ed1202d1f90cb9c73bd858598a28f63b519642c7))
|
|
119
144
|
|
|
120
145
|
* ## Fixes
|
|
@@ -303,6 +328,7 @@ ReportSqlPreviewPanel - add UiAceEditor as sql preview field(readOnly) with sql
|
|
|
303
328
|
|
|
304
329
|
# Version 2.5.1, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b96e5a09990a265514d3f2c3647d032fd1a4306b)
|
|
305
330
|
* ## Features
|
|
331
|
+
* <span style='color:green'>feat: HT-4550 Приведение boolean полей к string при экспорте</span> ([5c70b0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5c70b008e5691e0caab7a7a56f18b6d5c0cc8818))
|
|
306
332
|
* <span style='color:green'>feat: HT-6580: create paging for tag field? creeate new mixin, fix errors</span> ([a913c5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a913c5a9735da882f7619c55dc67bea7d1d5e936))
|
|
307
333
|
|
|
308
334
|
* ## Fixes
|
|
@@ -320,6 +346,7 @@ ReportSqlPreviewPanel - add UiAceEditor as sql preview field(readOnly) with sql
|
|
|
320
346
|
|
|
321
347
|
# Version 2.4.41, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/95627ef5983aa5f2fd5eaf8bd4b808ba169a48fb)
|
|
322
348
|
* ## Features
|
|
349
|
+
* <span style='color:green'>feat: HT-4550 Приведение boolean полей к string при экспорте</span> ([1765f1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1765f1c1959e585ee724021ceaa840b0fb3c2485))
|
|
323
350
|
* <span style='color:green'>feat: HT-6314 Изменение отображения CharacteristicGridCopyPlugin</span> ([5fa321], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5fa3214c6e395bc66804a7acc7fe062780da1dfd))
|
|
324
351
|
|
|
325
352
|
* add no-console rule to eslint rules ([aa512d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/aa512db0fb0165af39481718d010c9748c5cebb5))
|
|
@@ -338,6 +365,8 @@ ReportSqlPreviewPanel - add UiAceEditor as sql preview field(readOnly) with sql
|
|
|
338
365
|
|
|
339
366
|
# Version 2.4.39, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/552f06c65ce026090b0c7ef6716f8fa6a4cba933)
|
|
340
367
|
* ## Features
|
|
368
|
+
* <span style='color:green'>feat: HT-4550 Приведение boolean полей к string при экспорте</span> ([7eded0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7eded0e3efb8b28d13d51c0330fbeca82f8efd05))
|
|
369
|
+
* <span style='color:green'>feat: HT-4550 Приведение boolean полей к string при экспорте</span> ([db6df1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/db6df1864086585229bf1b002e5caf59171ec1ac))
|
|
341
370
|
* <span style='color:green'>feat: auto select first submenu item on change workspace</span> ([f0bad3], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f0bad35d4cafa86b62be334c1967401d9c276552))
|
|
342
371
|
|
|
343
372
|
* upd ([24eade], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/24eade894692f4dc5f9ce6837a715dfc0d1c96b1))
|
package/index.js
CHANGED
|
@@ -1,47 +1,36 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import '
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
1
|
+
import * as xEchartsJs from 'echarts';
|
|
2
|
+
import xPrintJs from 'sigma-printjs/dist/print';
|
|
3
|
+
import xAceDiff from 'ace-diff';
|
|
4
|
+
import hashFromObj from 'object-hash';
|
|
5
|
+
import xAceEditor from 'ace-builds/src-noconflict/ace';
|
|
6
|
+
import xAceJson from 'ace-builds/src-noconflict/mode-json5';
|
|
7
|
+
import xAceLangTool from 'ace-builds/src-noconflict/ext-language_tools';
|
|
8
|
+
import xAceSnippets from 'ace-builds/src-noconflict/snippets/snippets';
|
|
9
|
+
import JSON5 from 'json5';
|
|
9
10
|
import 'extjs_iconpack';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
require('ace-builds/src-noconflict/mode-sql');
|
|
37
|
-
require('ace-builds/src-noconflict/mode-pgsql');
|
|
38
|
-
Ext.xAceJson = require('ace-builds/src-noconflict/mode-json5');
|
|
39
|
-
Ext.xAceLangTool = require('ace-builds/src-noconflict/ext-language_tools');
|
|
40
|
-
Ext.xAceSnippets = require('ace-builds/src-noconflict/snippets/snippets');
|
|
41
|
-
Ext.xPdfjsViewer = require('pdfjs-dist/legacy/build/pdf');
|
|
42
|
-
if (typeof window !== 'undefined' && 'Worker' in window) {
|
|
43
|
-
Ext.xPdfjsViewer.GlobalWorkerOptions.workerPort = new Worker('build/dist/pdf.worker.js');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
Ext.jss = jss;
|
|
47
|
-
Ext.jss.use(jssNested(), jssGlobal());
|
|
11
|
+
import 'ace-diff/dist/ace-diff.min.css';
|
|
12
|
+
import 'ace-builds/src-noconflict/worker-json';
|
|
13
|
+
import 'ace-builds/src-noconflict/theme-xcode';
|
|
14
|
+
import 'ace-builds/src-noconflict/theme-iplastic';
|
|
15
|
+
import 'ace-builds/src-noconflict/ext-searchbox';
|
|
16
|
+
import 'ace-builds/src-noconflict/mode-javascript';
|
|
17
|
+
import 'ace-builds/src-noconflict/mode-sql';
|
|
18
|
+
import 'ace-builds/src-noconflict/mode-pgsql';
|
|
19
|
+
import 'ace-builds/src-noconflict/snippets/javascript';
|
|
20
|
+
import 'ace-builds/src-noconflict/snippets/sql';
|
|
21
|
+
import 'ace-builds/src-noconflict/snippets/pgsql';
|
|
22
|
+
|
|
23
|
+
xAceEditor.config.set('basePath', '/node_modules/ace-builds/src-noconflict/');
|
|
24
|
+
|
|
25
|
+
Object.assign(window, {JSON5, ace: xAceEditor});
|
|
26
|
+
|
|
27
|
+
Object.assign(Ext || {}, {
|
|
28
|
+
xEchartsJs,
|
|
29
|
+
hashFromObj,
|
|
30
|
+
xPrintJs,
|
|
31
|
+
xAceDiff,
|
|
32
|
+
xAceEditor,
|
|
33
|
+
xAceJson,
|
|
34
|
+
xAceLangTool,
|
|
35
|
+
xAceSnippets,
|
|
36
|
+
});
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "ru.coon"
|
|
5
5
|
},
|
|
6
6
|
"description": "",
|
|
7
|
-
"version": "2.5.
|
|
7
|
+
"version": "2.5.32",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
|
|
@@ -26,16 +26,10 @@
|
|
|
26
26
|
"ace-builds": "1.4.12",
|
|
27
27
|
"ace-diff": "^3.0.3",
|
|
28
28
|
"echarts": "^5.3.3",
|
|
29
|
+
"extjs_iconpack": "1.3.15",
|
|
29
30
|
"json5": "2.2.3",
|
|
30
|
-
"jss": "^10.9.2",
|
|
31
|
-
"jss-plugin-global": "^10.9.2",
|
|
32
|
-
"jss-plugin-nested": "^10.9.2",
|
|
33
31
|
"object-hash": "^3.0.0",
|
|
34
|
-
"
|
|
35
|
-
"sigma-printjs": "^1.0.1",
|
|
36
|
-
"@sigma/editorjs-table": "0.2.5",
|
|
37
|
-
"extjs_iconpack": "1.3.15",
|
|
38
|
-
"@editorjs/editorjs": "2.27.0"
|
|
32
|
+
"sigma-printjs": "^1.0.1"
|
|
39
33
|
},
|
|
40
34
|
"devDependencies": {
|
|
41
35
|
"eslint": "^8.15.0",
|
package/src/log.js
CHANGED
|
@@ -50,8 +50,7 @@ Ext.define('Coon.log', {
|
|
|
50
50
|
},
|
|
51
51
|
|
|
52
52
|
isProduction() {
|
|
53
|
-
|
|
54
|
-
return Ext.Microloader && !Ext.Microloader.manifest.loadOrder;
|
|
53
|
+
return Ext.isProduction === true || Ext.Microloader && !Ext.Microloader.manifest.loadOrder;
|
|
55
54
|
},
|
|
56
55
|
|
|
57
56
|
searchXtype(cmp, idx = 0) {
|
|
@@ -97,11 +96,13 @@ Ext.define('Coon.log', {
|
|
|
97
96
|
return this;
|
|
98
97
|
}
|
|
99
98
|
if (trace) {
|
|
99
|
+
// eslint-disable-next-line no-console
|
|
100
100
|
console.trace(...args);
|
|
101
101
|
} else {
|
|
102
102
|
if (this.isProduction && level === 'error') {
|
|
103
103
|
this.getConsoleError()(` [${level}]: `, ...args);
|
|
104
104
|
} else {
|
|
105
|
+
// eslint-disable-next-line no-console
|
|
105
106
|
console[level](` [${level}]: `, ...args);
|
|
106
107
|
}
|
|
107
108
|
}
|
|
@@ -128,8 +128,18 @@ Ext.define('Coon.report.plugin.configPanel.ExportReportDataToFilePluginConfigPan
|
|
|
128
128
|
{
|
|
129
129
|
xtype: 'container',
|
|
130
130
|
html: `<div style="font-size:12px;color:gray">
|
|
131
|
-
|
|
132
|
-
<b
|
|
131
|
+
Укажите поля, которые будут доступны пользователю для выбора при экспорте.<br>
|
|
132
|
+
<b>Если не выбрано ни одной колонки, то пользователю будут для выбора все поля репорта!</b>
|
|
133
|
+
</div>`,
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
xtype: 'container',
|
|
137
|
+
reference: 'warning',
|
|
138
|
+
hidden: true,
|
|
139
|
+
html: `<div style="font-size:12px;color:brown">
|
|
140
|
+
<b>Отчет содержит поля с типом BOOLEAN!</b><br>
|
|
141
|
+
Чтобы преобразовать BOOLEAN в нужную строку, укажите localization в свойствах BOOLEAN поля.<br>
|
|
142
|
+
По умолчанию значения будут преобразованы в Y/N!<br>
|
|
133
143
|
</div>`,
|
|
134
144
|
},
|
|
135
145
|
this.grid
|
|
@@ -151,14 +161,23 @@ Ext.define('Coon.report.plugin.configPanel.ExportReportDataToFilePluginConfigPan
|
|
|
151
161
|
},
|
|
152
162
|
|
|
153
163
|
setFieldsData(fields) {
|
|
164
|
+
this.booleanFields = [];
|
|
154
165
|
const ns = Coon.report.model.ReportFieldMaintenanceBeanFields;
|
|
166
|
+
const fieldsNS = Coon.report.model.ReportFieldBeanFields;
|
|
167
|
+
const warningMessage = this.lookup('warning');
|
|
168
|
+
|
|
155
169
|
const fieldsData = fields.length && fields.map((field) => {
|
|
170
|
+
if (field[fieldsNS.$reportFieldTypeLookup] === 'BOOLEAN') {
|
|
171
|
+
this.booleanFields.push(field[fieldsNS.$reportFieldCd]);
|
|
172
|
+
}
|
|
156
173
|
return {
|
|
157
174
|
reportField: field[ns.$reportField],
|
|
158
175
|
description: field[ns.$description],
|
|
159
176
|
checkbox: (this.columnList && this.columnList.includes(field[ns.$reportField])),
|
|
160
177
|
};
|
|
161
178
|
});
|
|
179
|
+
|
|
180
|
+
warningMessage.setHidden(!this.booleanFields.length);
|
|
162
181
|
fieldsData && this.grid.getStore().loadData(fieldsData);
|
|
163
182
|
},
|
|
164
183
|
|
|
@@ -166,7 +185,8 @@ Ext.define('Coon.report.plugin.configPanel.ExportReportDataToFilePluginConfigPan
|
|
|
166
185
|
return this.callParent().then((config) => {
|
|
167
186
|
const allowUserColumns = Coon.Function.getFieldByName(this, 'allowUserColumns').getValue();
|
|
168
187
|
if (allowUserColumns) {
|
|
169
|
-
|
|
188
|
+
const checkedRecords = this.grid.getStore().queryRecords('checkbox', true);
|
|
189
|
+
config['columnList'] = JSON5.stringify(checkedRecords.length ? checkedRecords : this.grid.getStore().queryRecords());
|
|
170
190
|
config['allowUserSelectColumnsToUpload'] = allowUserColumns;
|
|
171
191
|
}
|
|
172
192
|
return config;
|
|
@@ -409,13 +409,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
409
409
|
const blob = new Blob(this.collectGridDataAsArray(this.getSelected()), {
|
|
410
410
|
type: 'text/xls;charset=UTF-8',
|
|
411
411
|
});
|
|
412
|
-
|
|
413
|
-
link.href = window.URL.createObjectURL(blob);
|
|
414
|
-
link.download = filename;
|
|
415
|
-
link.click();
|
|
416
|
-
if (blob) {
|
|
417
|
-
window.URL.revokeObjectURL(blob);
|
|
418
|
-
}
|
|
412
|
+
Coon.util.downloadFileFromBlob(blob, filename);
|
|
419
413
|
}
|
|
420
414
|
reportPanel && reportPanel.unmask();
|
|
421
415
|
},
|
|
@@ -17,6 +17,7 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
|
|
|
17
17
|
config.invisibleByDefault = config.addToSearchButton === true;
|
|
18
18
|
this.callParent(arguments);
|
|
19
19
|
},
|
|
20
|
+
|
|
20
21
|
init(grid) {
|
|
21
22
|
this.callParent([grid]);
|
|
22
23
|
const format = this.config.exportFileFormat;
|
|
@@ -32,14 +33,7 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
|
|
|
32
33
|
}
|
|
33
34
|
this.grid = grid;
|
|
34
35
|
}, this);
|
|
35
|
-
this.
|
|
36
|
-
`command.${
|
|
37
|
-
format === 'pdf' ?
|
|
38
|
-
'GetPdfReportDataCommand' :
|
|
39
|
-
'GetExcelFromRowsOrReportData'
|
|
40
|
-
}`,
|
|
41
|
-
{useRawFilterParams: this.getConfig('addToSearchButton')}
|
|
42
|
-
);
|
|
36
|
+
this.printPdfCommand = Ext.create('command.GetPdfReportDataCommand', {useRawFilterParams: this.getConfig('addToSearchButton')});
|
|
43
37
|
},
|
|
44
38
|
|
|
45
39
|
handler: function() {
|
|
@@ -47,8 +41,10 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
|
|
|
47
41
|
this.showPanel();
|
|
48
42
|
} else {
|
|
49
43
|
this.config.columns = this.config.columnList.map((record) => record.reportField);
|
|
50
|
-
this.
|
|
51
|
-
this.
|
|
44
|
+
this.getRecordsToPrint();
|
|
45
|
+
this.config.exportFileFormat === 'pdf' ?
|
|
46
|
+
this.printPdfCommand.execute(this.report, this.config) :
|
|
47
|
+
this.printExcelFile();
|
|
52
48
|
}
|
|
53
49
|
},
|
|
54
50
|
|
|
@@ -114,8 +110,10 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
|
|
|
114
110
|
title: 'Выводить колонки',
|
|
115
111
|
});
|
|
116
112
|
this.win.on('setColumns', function() {
|
|
117
|
-
this.
|
|
118
|
-
this.
|
|
113
|
+
this.getRecordsToPrint();
|
|
114
|
+
this.config.exportFileFormat === 'pdf' ?
|
|
115
|
+
this.printPdfCommand.execute(this.report, this.config) :
|
|
116
|
+
this.printExcelFile();
|
|
119
117
|
this.win.close();
|
|
120
118
|
}, this);
|
|
121
119
|
this.win.show();
|
|
@@ -126,24 +124,51 @@ Ext.define('Coon.report.plugin.grid.ExportReportDataToFilePlugin', {
|
|
|
126
124
|
},
|
|
127
125
|
|
|
128
126
|
setColumns: function() {
|
|
129
|
-
const
|
|
130
|
-
if (!
|
|
127
|
+
const checkedRecords = this.columnsGrid.getStore().queryRecords('checkbox', true);
|
|
128
|
+
if (!checkedRecords.length) {
|
|
131
129
|
return;
|
|
132
130
|
}
|
|
133
|
-
this.config.columns =
|
|
131
|
+
this.config.columns = checkedRecords.map((record) => record.get('reportField'));
|
|
134
132
|
this.win.fireEvent('setColumns');
|
|
135
133
|
},
|
|
136
134
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
135
|
+
getRecordsToPrint: function() {
|
|
136
|
+
this.config.toExcel = [];
|
|
137
|
+
const selectedRecords = this.grid.getSelectionModel().getSelection();
|
|
138
|
+
const records = selectedRecords.length ? selectedRecords : this.grid.getStore().getRange();
|
|
139
|
+
|
|
140
|
+
records.forEach((rec) => {
|
|
141
|
+
const recData = rec.getData();
|
|
142
|
+
delete recData['id'];
|
|
143
|
+
this.config.toExcel.push(recData);
|
|
144
|
+
});
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
printExcelFile: async function() {
|
|
148
|
+
const fileName = this.config.reportFileName || this.report.reportId || 'defaultReportName';
|
|
149
|
+
const currentParamList = this.report.currentParamList;
|
|
150
|
+
const parameterList = [];
|
|
151
|
+
|
|
152
|
+
for (const key in currentParamList) {
|
|
153
|
+
if (currentParamList.hasOwnProperty(key) && !Ext.isEmpty(currentParamList[key])) {
|
|
154
|
+
parameterList.push({type: key, value: currentParamList[key]});
|
|
145
155
|
}
|
|
146
156
|
}
|
|
157
|
+
|
|
158
|
+
Ext.Ajax.request({
|
|
159
|
+
url: 'ReportFormData/getExcelFromRowsOrReport',
|
|
160
|
+
method: 'POST',
|
|
161
|
+
binary: true,
|
|
162
|
+
params: {
|
|
163
|
+
reportId: this.report.reportId,
|
|
164
|
+
fileName: fileName,
|
|
165
|
+
appendDateToFileName: Ext.isBoolean(this.config.appendDateToFileName) ? this.config.appendDateToFileName : true,
|
|
166
|
+
parameterList: JSON.stringify(parameterList),
|
|
167
|
+
columnList: JSON.stringify(this.config.columns),
|
|
168
|
+
toExcel: JSON.stringify(this.config.toExcel),
|
|
169
|
+
},
|
|
170
|
+
success: (responce) => Coon.util.downloadFileFromBlob(new Blob([responce.responseBytes]), `${fileName}.xlsx`),
|
|
171
|
+
});
|
|
147
172
|
},
|
|
148
173
|
|
|
149
174
|
});
|
|
@@ -138,11 +138,7 @@ Ext.define('Coon.security.component.navmenu.RoleNavMenuEditorController', {
|
|
|
138
138
|
[data],
|
|
139
139
|
{type: 'text/xls;charset=UTF-8'}
|
|
140
140
|
);
|
|
141
|
-
|
|
142
|
-
link.href = window.URL.createObjectURL(blob);
|
|
143
|
-
link.download = filename;
|
|
144
|
-
link.click();
|
|
145
|
-
window.URL.revokeObjectURL(blob);
|
|
141
|
+
Coon.util.downloadFileFromBlob(blob, filename);
|
|
146
142
|
})
|
|
147
143
|
.catch(console.error);
|
|
148
144
|
} catch (ex) {
|
|
@@ -85,11 +85,7 @@ Ext.define('Coon.security.component.role.RoleEditorController', {
|
|
|
85
85
|
{
|
|
86
86
|
type: 'text/xls;charset=UTF-8',
|
|
87
87
|
});
|
|
88
|
-
|
|
89
|
-
link.href = window.URL.createObjectURL(blob);
|
|
90
|
-
link.download = 'roles.json';
|
|
91
|
-
link.click();
|
|
92
|
-
window.URL.revokeObjectURL(blob);
|
|
88
|
+
Coon.util.downloadFileFromBlob(blob, 'roles.json');
|
|
93
89
|
});
|
|
94
90
|
},
|
|
95
91
|
});
|
|
@@ -156,11 +156,7 @@ Ext.define('Coon.security.component.ui.UiCPRestrictionEditorController', {
|
|
|
156
156
|
{
|
|
157
157
|
type: 'text/xls;charset=UTF-8',
|
|
158
158
|
});
|
|
159
|
-
|
|
160
|
-
link.href = window.URL.createObjectURL(blob);
|
|
161
|
-
link.download = 'restrictionUICPConfig.json';
|
|
162
|
-
link.click();
|
|
163
|
-
window.URL.revokeObjectURL(blob);
|
|
159
|
+
Coon.util.downloadFileFromBlob(blob, 'restrictionUICPConfig.json');
|
|
164
160
|
});
|
|
165
161
|
},
|
|
166
162
|
});
|
|
@@ -105,11 +105,7 @@ Ext.define('Coon.security.component.user.UserRoleEditorController', {
|
|
|
105
105
|
{
|
|
106
106
|
type: 'text/xls;charset=UTF-8',
|
|
107
107
|
});
|
|
108
|
-
|
|
109
|
-
link.href = window.URL.createObjectURL(blob);
|
|
110
|
-
link.download = 'user_roles.json';
|
|
111
|
-
link.click();
|
|
112
|
-
window.URL.revokeObjectURL(blob);
|
|
108
|
+
Coon.util.downloadFileFromBlob(blob, 'user_roles.json');
|
|
113
109
|
});
|
|
114
110
|
},
|
|
115
111
|
});
|
package/src/util.js
CHANGED
|
@@ -568,4 +568,12 @@ Ext.define('Coon.util', {
|
|
|
568
568
|
return txt.documentElement.textContent;
|
|
569
569
|
},
|
|
570
570
|
|
|
571
|
+
downloadFileFromBlob(blob, fileName) {
|
|
572
|
+
const link = document.createElement('a');
|
|
573
|
+
link.href = window.URL.createObjectURL(blob);
|
|
574
|
+
link.download = fileName;
|
|
575
|
+
link.click();
|
|
576
|
+
window.URL.revokeObjectURL(blob);
|
|
577
|
+
},
|
|
578
|
+
|
|
571
579
|
});
|
package/src/version.js
CHANGED