ru.coon 2.7.50 → 2.7.52
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/.gitattributes +1 -1
- package/.husky/pre-commit +4 -4
- package/.lintstagedrc.json +2 -2
- package/CHANGELOG.md +15 -0
- package/Readme.md +24 -24
- package/TODO.md +7 -7
- package/doc/changelog.md +118 -118
- package/doc/shortcuts.md +5 -5
- package/jsdoc.config.json +29 -29
- package/package.json +78 -78
- package/sass/src/common/plugin/form/PeriodPicker.scss +8 -8
- package/src/Function.scss +4 -4
- package/src/app/viewPort/Main.scss +133 -133
- package/src/command/Readme.md +4 -4
- package/src/common/component/ColorPalette.scss +102 -102
- package/src/common/component/ExternalFrame.scss +8 -8
- package/src/common/component/HotkeyHelpText.scss +34 -34
- package/src/common/component/TreeComponentStructure.scss +5 -5
- package/src/common/component/editor/CharacteristicGridEditor.scss +66 -66
- package/src/common/component/editor/TypedCharacteristicEditor.scss +7 -7
- package/src/common/component/formeditor/UiCustomFilterForm.scss +7 -7
- package/src/common/component/formeditor/UiCustomFormEditor.scss +42 -42
- package/src/common/component/visualeditor/UiCPVisualEditor.scss +108 -108
- package/src/common/field/EditorJs.scss +41 -41
- package/src/common/field/FieldsHelper.js +0 -0
- package/src/common/field/ReportValueField.scss +2 -2
- package/src/common/field/combo/CommandComboBox.scss +19 -19
- package/src/common/panel/DayPicker.scss +15 -15
- package/src/common/panel/MainUploadPanel.scss +13 -13
- package/src/common/panel/SelectIconClassPanel.scss +38 -38
- package/src/common/panel/SelectIconClassPanelTemplate.scss +14 -14
- package/src/common/panel/StopwatchWindow.js +147 -0
- package/src/common/panel/StopwatchWindow.scss +44 -0
- package/src/common/panel/UniversalUploadResults.js +31 -0
- package/src/common/panel/UniversalUploadResults.scss +40 -0
- package/src/common/panel/WindowWrap.js +0 -0
- package/src/common/panel/WindowWrap.scss +8 -8
- package/src/common/panel/dropzone/UniversalMultiUploadForm.scss +29 -29
- package/src/common/panel/dropzone/UploadDropZone.scss +36 -36
- package/src/common/panel/widget/WidgetPanel.scss +157 -157
- package/src/info.scss +12 -12
- package/src/nav/AppNavTab.scss +20 -20
- package/src/nav/AppNavigationBar.scss +9 -9
- package/src/nav/AppNavigationMenu.scss +60 -60
- package/src/nav/AppNavigationToggleButton.scss +6 -6
- package/src/nav/editor/menu/NavMenuTreeView.scss +104 -104
- package/src/nav/editor/workspace/NavWorkspaceListView.scss +35 -35
- package/src/nav/menu/NavMenuPanel.scss +11 -11
- package/src/nav/menu/WorkspaceMenuView.scss +218 -218
- package/src/nav/windowHolderTab.scss +13 -13
- package/src/report/column/MultiFilesColumn.scss +8 -8
- package/src/report/component/BoundListPagingToolbar.scss +7 -7
- package/src/report/component/ErrorWindow.scss +15 -15
- package/src/report/component/ParameterizedReportCombo.scss +85 -85
- package/src/report/component/ReportPanel.scss +69 -69
- package/src/report/component/SimpleReportTag.scss +22 -22
- package/src/report/component/reportpanel/CopyReportPanel.scss +14 -14
- package/src/report/component/reportpanel/FilterPanel.scss +16 -16
- package/src/report/component/reportpanel/FilterPanelLegend.scss +23 -23
- package/src/report/component/reportpanel/NorthPanel.scss +18 -18
- package/src/report/component/reportpanel/ReportGrid.scss +37 -37
- package/src/report/component/settings/ReportFormEditPanel.scss +87 -87
- package/src/report/component/settings/ReportPropertiesGrid.scss +25 -25
- package/src/report/component/settings/field/ReportFormFieldsGrid.scss +5 -5
- package/src/report/component/settings/property/ReportPropertiesPanel.scss +12 -12
- package/src/report/plugin/SettingsManagerPlugin/view/SMPMainView.scss +3 -3
- package/src/report/plugin/configPanel/AddFilterConditionPluginConfigPanel.scss +53 -53
- package/src/report/plugin/configPanel/CopyRowsFromGridConfigPanel.js +38 -21
- package/src/report/plugin/configPanel/ExecuteCommandButtonPluginConfigPanel.scss +5 -5
- package/src/report/plugin/configPanel/GroupRowsPluginConfigPanel.scss +3 -3
- package/src/report/plugin/configPanel/UiAceEditorField.scss +20 -20
- package/src/report/plugin/configPanel/common/pluginDescriptionLabel.scss +8 -8
- package/src/report/plugin/grid/CopyRowsFromGrid.js +99 -38
- package/src/report/plugin/grid/GridRowStylePlugin.scss +56 -56
- package/src/report/plugin/grid/OpenURLButtonPlugin.js +1 -1
- package/src/report/plugin/grid/ReportTabContainerPlugin.scss +3 -3
- package/src/report/plugin/grid/ToggleColumnsPlugin.scss +7 -7
- package/src/report/plugin/grid/ToolbarButtonPlugin.scss +3 -3
- package/src/research/ResearchTreeView.scss +19 -19
- package/src/security/component/RoleFileUploadForm.scss +4 -4
- package/src/security/component/ui/UiCPRestrictionEditor.scss +4 -4
- package/src/security/securitySettingComponent/RoleEditPanel.scss +16 -16
- package/src/security/securitySettingComponent/RoleEditPanelController.js +12 -7
- package/src/security/securitySettingComponent/menu/RoleEditMenuController.js +3 -3
- package/src/security/securitySettingComponent/report/RoleEditReportController.js +7 -1
- package/src/security/securitySettingComponent/uiCP/RoleEditUiCPController.js +7 -2
- package/src/security/securitySettingComponent/url/RoleEditUrlController.js +6 -1
- package/src/security/securitySettingComponent/user/RoleEditUserController.js +6 -1
- package/src/uielement/component/MenuItemList.scss +35 -35
- package/src/uielement/component/formchips/FilterConditionToolbar.scss +74 -74
- package/src/uielement/component/settings/UiCustomPanelEditor.scss +9 -9
- package/src/uielement/component/settings/config/UiCPConfigPanelController.scss +24 -24
- package/src/uielement/component/settings/plugin/UiCustomPanelPluginGrid.scss +11 -11
- package/src/uielement/component/settings/plugin/UiCustomPanelPluginPanel.scss +30 -30
- package/src/uielement/component/settings/version/UiCPVersionPanel.scss +15 -15
- package/src/uielement/plugin/configPanel/AddBindingsPluginConfigPanelFormEditor.scss +29 -29
- package/src/uielement/plugin/configPanel/executeCommand/ExecuteCommandPluginConfigPanelFormEditor.scss +22 -22
- package/src/version.js +1 -1
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
.AddFilterConditionPluginConfigPanel {
|
|
2
|
-
.svg-icon{
|
|
3
|
-
height: 24px;
|
|
4
|
-
width: 24px;
|
|
5
|
-
}
|
|
6
|
-
.fa{
|
|
7
|
-
height: 24px;
|
|
8
|
-
width: 24px;
|
|
9
|
-
padding-top: 6px;
|
|
10
|
-
color: black;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
.x-segmented-button-item{
|
|
14
|
-
background-color: transparent;
|
|
15
|
-
}
|
|
16
|
-
.x-segmented-button-item:hover{
|
|
17
|
-
background-color: rgba(61, 103, 128, 0.04);
|
|
18
|
-
}
|
|
19
|
-
.x-segmented-button-item:active{
|
|
20
|
-
background-color: rgba(61, 103, 128, 0.12);
|
|
21
|
-
}
|
|
22
|
-
.x-btn-pressed .x-btn-icon-el {
|
|
23
|
-
color: #ffffff !important;
|
|
24
|
-
}
|
|
25
|
-
.x-segmented-button .x-segmented-button-item .x-btn-inner{
|
|
26
|
-
color: #3D6780;
|
|
27
|
-
}
|
|
28
|
-
.x-segmented-button .x-segmented-button-item .x-btn-icon-el{
|
|
29
|
-
color: #3D6780;
|
|
30
|
-
}
|
|
31
|
-
.x-btn-icon-el{
|
|
32
|
-
color: #3D6780;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@include extjs-button-small-ui(
|
|
37
|
-
$ui: 'FilterSegmentedButton',
|
|
38
|
-
$padding: 8px 12px,
|
|
39
|
-
$color: #3D6780,
|
|
40
|
-
$icon-size: 16px,
|
|
41
|
-
|
|
42
|
-
$background-color-over: rgba(61, 103, 128, 0.04),
|
|
43
|
-
$background-color-focus-over: rgba(61, 103, 128, 0.04),
|
|
44
|
-
|
|
45
|
-
$background-color-pressed: rgba(61, 103, 128, 0.12),
|
|
46
|
-
$background-color-focus-pressed: rgba(61, 103, 128, 0.12),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
$border-color: 'none',
|
|
50
|
-
$background-color: transparent,
|
|
51
|
-
$border-color-focus: #3D6780,
|
|
52
|
-
$background-color-focus: rgba(61, 103, 128, 0.12)
|
|
53
|
-
);
|
|
1
|
+
.AddFilterConditionPluginConfigPanel {
|
|
2
|
+
.svg-icon{
|
|
3
|
+
height: 24px;
|
|
4
|
+
width: 24px;
|
|
5
|
+
}
|
|
6
|
+
.fa{
|
|
7
|
+
height: 24px;
|
|
8
|
+
width: 24px;
|
|
9
|
+
padding-top: 6px;
|
|
10
|
+
color: black;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.x-segmented-button-item{
|
|
14
|
+
background-color: transparent;
|
|
15
|
+
}
|
|
16
|
+
.x-segmented-button-item:hover{
|
|
17
|
+
background-color: rgba(61, 103, 128, 0.04);
|
|
18
|
+
}
|
|
19
|
+
.x-segmented-button-item:active{
|
|
20
|
+
background-color: rgba(61, 103, 128, 0.12);
|
|
21
|
+
}
|
|
22
|
+
.x-btn-pressed .x-btn-icon-el {
|
|
23
|
+
color: #ffffff !important;
|
|
24
|
+
}
|
|
25
|
+
.x-segmented-button .x-segmented-button-item .x-btn-inner{
|
|
26
|
+
color: #3D6780;
|
|
27
|
+
}
|
|
28
|
+
.x-segmented-button .x-segmented-button-item .x-btn-icon-el{
|
|
29
|
+
color: #3D6780;
|
|
30
|
+
}
|
|
31
|
+
.x-btn-icon-el{
|
|
32
|
+
color: #3D6780;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@include extjs-button-small-ui(
|
|
37
|
+
$ui: 'FilterSegmentedButton',
|
|
38
|
+
$padding: 8px 12px,
|
|
39
|
+
$color: #3D6780,
|
|
40
|
+
$icon-size: 16px,
|
|
41
|
+
|
|
42
|
+
$background-color-over: rgba(61, 103, 128, 0.04),
|
|
43
|
+
$background-color-focus-over: rgba(61, 103, 128, 0.04),
|
|
44
|
+
|
|
45
|
+
$background-color-pressed: rgba(61, 103, 128, 0.12),
|
|
46
|
+
$background-color-focus-pressed: rgba(61, 103, 128, 0.12),
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
$border-color: 'none',
|
|
50
|
+
$background-color: transparent,
|
|
51
|
+
$border-color-focus: #3D6780,
|
|
52
|
+
$background-color-focus: rgba(61, 103, 128, 0.12)
|
|
53
|
+
);
|
|
@@ -4,11 +4,6 @@ Ext.define('Coon.report.plugin.configPanel.CopyRowsFromGridConfigPanel', {
|
|
|
4
4
|
uses: [],
|
|
5
5
|
requires: [],
|
|
6
6
|
alternateClassName: 'Sigma.common.grid.plugin.CopyRowsFromGridConfigPanel',
|
|
7
|
-
listeners: {
|
|
8
|
-
'boxready': function() {
|
|
9
|
-
this.onChangeFormat(null, 'xls');
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
7
|
description: 'Экспорт в Excel.<br>' +
|
|
13
8
|
'Возможно указать верхний и нижний колонтитулы для отчета в формате HTML.<br>' +
|
|
14
9
|
'Также возможно подставлять данные из отчета и другие параметры.<br>' +
|
|
@@ -37,7 +32,23 @@ Ext.define('Coon.report.plugin.configPanel.CopyRowsFromGridConfigPanel', {
|
|
|
37
32
|
],
|
|
38
33
|
},
|
|
39
34
|
},
|
|
40
|
-
|
|
35
|
+
viewModel: {
|
|
36
|
+
data: {
|
|
37
|
+
format: 'xls',
|
|
38
|
+
activeEditor: 'xls',
|
|
39
|
+
askFormat: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
controller: {
|
|
43
|
+
bindings: {
|
|
44
|
+
onChangeFormat: '{format}',
|
|
45
|
+
},
|
|
46
|
+
onChangeFormat(format) {
|
|
47
|
+
if (!this.getViewModel().get('askFormat')) {
|
|
48
|
+
this.getViewModel().set('activeEditor', format);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
},
|
|
41
52
|
createItems: function() {
|
|
42
53
|
return [
|
|
43
54
|
{
|
|
@@ -104,12 +115,6 @@ Ext.define('Coon.report.plugin.configPanel.CopyRowsFromGridConfigPanel', {
|
|
|
104
115
|
});
|
|
105
116
|
}
|
|
106
117
|
},
|
|
107
|
-
onChangeFormat: function(cmp, newValue) {
|
|
108
|
-
const fields = Ext.ComponentQuery.query('[xtype="htmleditor"]', this);
|
|
109
|
-
const fieldsXlsx = Ext.ComponentQuery.query('[xtype="EditorJsField"]', this);
|
|
110
|
-
fieldsXlsx.forEach((field) => field.setHidden(newValue === 'xls'));
|
|
111
|
-
fields.forEach((field) => field.setHidden(newValue === 'xlsx'));
|
|
112
|
-
},
|
|
113
118
|
createFormatField: function() {
|
|
114
119
|
return {
|
|
115
120
|
xtype: 'fieldset',
|
|
@@ -133,12 +138,17 @@ Ext.define('Coon.report.plugin.configPanel.CopyRowsFromGridConfigPanel', {
|
|
|
133
138
|
allowBlank: false,
|
|
134
139
|
width: 430,
|
|
135
140
|
value: 'xls',
|
|
141
|
+
bind: {
|
|
142
|
+
value: '{format}',
|
|
143
|
+
},
|
|
136
144
|
},
|
|
137
145
|
{
|
|
138
146
|
xtype: 'checkbox',
|
|
139
147
|
boxLabel: 'Спрашивать формат перед выгрузкой',
|
|
140
148
|
name: 'showFormatSelectDialog',
|
|
141
|
-
|
|
149
|
+
bind: {
|
|
150
|
+
value: '{askFormat}',
|
|
151
|
+
},
|
|
142
152
|
}
|
|
143
153
|
],
|
|
144
154
|
};
|
|
@@ -272,21 +282,25 @@ Ext.define('Coon.report.plugin.configPanel.CopyRowsFromGridConfigPanel', {
|
|
|
272
282
|
width: 1100,
|
|
273
283
|
height: 200,
|
|
274
284
|
plugins: [Ext.create('Coon.report.plugin.htmlEditor.ToolbarCombo', {element: element})],
|
|
285
|
+
bind: {
|
|
286
|
+
hidden: '{activeEditor !=="xls"}',
|
|
287
|
+
},
|
|
275
288
|
};
|
|
276
289
|
},
|
|
277
290
|
createEditorFlag: function() {
|
|
278
291
|
return {
|
|
279
292
|
xtype: 'ConstantList',
|
|
280
|
-
value: 'xls',
|
|
281
|
-
data: [
|
|
282
|
-
['xls', 'xls'],
|
|
283
|
-
['xlsx', 'xlsx']
|
|
284
|
-
],
|
|
285
293
|
fieldLabel: 'Отобразить редактор',
|
|
286
294
|
local: true,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
295
|
+
data: [
|
|
296
|
+
['xls', 'xls - старый формат'],
|
|
297
|
+
['xlsx', 'xlsx - новый формат']
|
|
298
|
+
],
|
|
299
|
+
name: 'activeEditor',
|
|
300
|
+
width: 430,
|
|
301
|
+
bind: {
|
|
302
|
+
value: '{activeEditor}',
|
|
303
|
+
disabled: '{!askFormat}',
|
|
290
304
|
},
|
|
291
305
|
};
|
|
292
306
|
},
|
|
@@ -298,6 +312,9 @@ Ext.define('Coon.report.plugin.configPanel.CopyRowsFromGridConfigPanel', {
|
|
|
298
312
|
name: name,
|
|
299
313
|
width: '100%',
|
|
300
314
|
height: 300,
|
|
315
|
+
bind: {
|
|
316
|
+
hidden: '{activeEditor !=="xlsx"}',
|
|
317
|
+
},
|
|
301
318
|
};
|
|
302
319
|
},
|
|
303
320
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
.addActionColumnMsg {
|
|
2
|
-
font-size: 15px;
|
|
3
|
-
margin: 0 0 0 12px;
|
|
4
|
-
color: red;
|
|
5
|
-
}
|
|
1
|
+
.addActionColumnMsg {
|
|
2
|
+
font-size: 15px;
|
|
3
|
+
margin: 0 0 0 12px;
|
|
4
|
+
color: red;
|
|
5
|
+
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.tpl-key {
|
|
2
|
-
font-weight: bold;
|
|
3
|
-
}
|
|
1
|
+
.tpl-key {
|
|
2
|
+
font-weight: bold;
|
|
3
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
.UiAceEditorField {
|
|
2
|
-
.ace-editor-editor{
|
|
3
|
-
width: 100%;
|
|
4
|
-
height: 100px;
|
|
5
|
-
display: block;
|
|
6
|
-
background-color: red !important;
|
|
7
|
-
min-height: 30px !important;
|
|
8
|
-
}
|
|
9
|
-
.ace-editor-content .x-grid-cell-editor{
|
|
10
|
-
width: 100%;
|
|
11
|
-
height: 100%;
|
|
12
|
-
display: block;
|
|
13
|
-
position: relative !important;
|
|
14
|
-
min-height: 100px;
|
|
15
|
-
}
|
|
16
|
-
.ace-editor-content .ace_editor{
|
|
17
|
-
height: 100%;
|
|
18
|
-
min-height: 100px;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
1
|
+
.UiAceEditorField {
|
|
2
|
+
.ace-editor-editor{
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100px;
|
|
5
|
+
display: block;
|
|
6
|
+
background-color: red !important;
|
|
7
|
+
min-height: 30px !important;
|
|
8
|
+
}
|
|
9
|
+
.ace-editor-content .x-grid-cell-editor{
|
|
10
|
+
width: 100%;
|
|
11
|
+
height: 100%;
|
|
12
|
+
display: block;
|
|
13
|
+
position: relative !important;
|
|
14
|
+
min-height: 100px;
|
|
15
|
+
}
|
|
16
|
+
.ace-editor-content .ace_editor{
|
|
17
|
+
height: 100%;
|
|
18
|
+
min-height: 100px;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
.pluginDescriptionLabel {
|
|
2
|
-
height: 2.5em;
|
|
3
|
-
margin: 5px 10px;
|
|
4
|
-
text-overflow: clip;
|
|
5
|
-
overflow: hidden;
|
|
6
|
-
.x-form-display-field {
|
|
7
|
-
color: #555!important;
|
|
8
|
-
}
|
|
1
|
+
.pluginDescriptionLabel {
|
|
2
|
+
height: 2.5em;
|
|
3
|
+
margin: 5px 10px;
|
|
4
|
+
text-overflow: clip;
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
.x-form-display-field {
|
|
7
|
+
color: #555!important;
|
|
8
|
+
}
|
|
9
9
|
}
|
|
@@ -245,16 +245,15 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
245
245
|
},
|
|
246
246
|
/**
|
|
247
247
|
* Формируем заголовок
|
|
248
|
-
* @returns {
|
|
248
|
+
* @returns {Object[] || []}
|
|
249
249
|
*/
|
|
250
250
|
collectHeaderJson: function(columnCount, workbook) {
|
|
251
251
|
const reportPanel = this.component.up('ReportPanel');
|
|
252
|
-
|
|
252
|
+
const result = [];
|
|
253
253
|
// Работа с отображением выгрузок
|
|
254
254
|
if (this.addHeader === true) {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
value: nameReport,
|
|
255
|
+
result.push({
|
|
256
|
+
value: reportPanel.title,
|
|
258
257
|
mergeAcross: columnCount || 1,
|
|
259
258
|
styleId: workbook.addCellStyle({
|
|
260
259
|
font: {
|
|
@@ -262,7 +261,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
262
261
|
size: 17,
|
|
263
262
|
},
|
|
264
263
|
}),
|
|
265
|
-
};
|
|
264
|
+
});
|
|
266
265
|
}
|
|
267
266
|
return result;
|
|
268
267
|
},
|
|
@@ -333,23 +332,28 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
333
332
|
return result;
|
|
334
333
|
},
|
|
335
334
|
collectGridDataAsObject: function(selections, workbook) {
|
|
336
|
-
|
|
335
|
+
const dataRows = [];
|
|
336
|
+
let headerRows = [];
|
|
337
|
+
let footerRows = [];
|
|
337
338
|
const dataForTemplate = this.getDataForTemplate();
|
|
338
339
|
const grid = this.component;
|
|
339
340
|
const columnModel = grid.getColumns();
|
|
340
341
|
const columnCount = grid.getColumns().length;
|
|
341
342
|
if (this.addHeader === true) {
|
|
342
|
-
|
|
343
|
+
headerRows = this.collectHeaderJson(columnCount, workbook);
|
|
343
344
|
}
|
|
344
345
|
if (this.addFilters === true) {
|
|
345
|
-
|
|
346
|
+
headerRows = headerRows.concat(
|
|
347
|
+
this.collectFiltersJson(columnCount, workbook)
|
|
348
|
+
);
|
|
346
349
|
}
|
|
347
350
|
if (this.headerXlsx) {
|
|
348
351
|
const headerXlsx = this.parseJsEditorObj(this.headerXlsx, workbook);
|
|
349
|
-
const tmpl = new Ext.XTemplate(
|
|
350
|
-
|
|
352
|
+
const tmpl = new Ext.XTemplate(
|
|
353
|
+
this.processingTemplate(JSON.stringify(headerXlsx))
|
|
354
|
+
).apply(dataForTemplate);
|
|
355
|
+
headerRows = headerRows.concat(JSON.parse(tmpl));
|
|
351
356
|
}
|
|
352
|
-
const headers = [];
|
|
353
357
|
const dataIndexToColumn = [];
|
|
354
358
|
const visibleColumns = [];
|
|
355
359
|
const columnIndexToDataIndex = [];
|
|
@@ -361,30 +365,32 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
361
365
|
visibleColumns.push(c);
|
|
362
366
|
columnIndexToDataIndex[c] = dataIndex;
|
|
363
367
|
dataIndexToColumn[dataIndex] = columnModel[c];
|
|
364
|
-
const value = columnModel[c].text || columnModel[c].header;
|
|
365
|
-
headers.push({
|
|
366
|
-
value: this.getRenderedValue(value, 'string'),
|
|
367
|
-
styleId: workbook.addCellStyle({
|
|
368
|
-
alignment: {
|
|
369
|
-
wrapText: true,
|
|
370
|
-
},
|
|
371
|
-
}),
|
|
372
|
-
});
|
|
373
368
|
}
|
|
374
369
|
}
|
|
375
370
|
}
|
|
376
|
-
resultObj.push(headers);
|
|
377
371
|
selections.forEach(function(record, i) {
|
|
378
|
-
|
|
379
|
-
this.collectColumns(
|
|
372
|
+
dataRows.push(
|
|
373
|
+
this.collectColumns(
|
|
374
|
+
grid,
|
|
375
|
+
record,
|
|
376
|
+
visibleColumns,
|
|
377
|
+
columnIndexToDataIndex,
|
|
378
|
+
columnModel,
|
|
379
|
+
dataIndexToColumn,
|
|
380
|
+
i,
|
|
381
|
+
true,
|
|
382
|
+
workbook
|
|
383
|
+
)
|
|
380
384
|
);
|
|
381
385
|
}, this);
|
|
382
386
|
if (this.footerXlsx) {
|
|
383
387
|
const footerXlsx = this.parseJsEditorObj(this.footerXlsx, workbook);
|
|
384
|
-
const tmpl = new Ext.XTemplate(
|
|
385
|
-
|
|
388
|
+
const tmpl = new Ext.XTemplate(
|
|
389
|
+
this.processingTemplate(JSON.stringify(footerXlsx))
|
|
390
|
+
).apply(dataForTemplate);
|
|
391
|
+
footerRows = JSON.parse(tmpl);
|
|
386
392
|
}
|
|
387
|
-
return
|
|
393
|
+
return {headerRows, dataRows, footerRows};
|
|
388
394
|
},
|
|
389
395
|
execute: function() {
|
|
390
396
|
const reportPanel = this.component.up('ReportPanel');
|
|
@@ -415,7 +421,11 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
415
421
|
});
|
|
416
422
|
} else {
|
|
417
423
|
filename += '.xls';
|
|
418
|
-
const
|
|
424
|
+
const exporter = Ext.create('Ext.exporter.text.Html', {fileName: filename});
|
|
425
|
+
const blob = new Blob(this.collectGridDataAsArray(
|
|
426
|
+
this.getSelected(),
|
|
427
|
+
this.getTableHeaderRows(exporter, 'xls')
|
|
428
|
+
), {
|
|
419
429
|
type: 'text/xls;charset=UTF-8',
|
|
420
430
|
});
|
|
421
431
|
Coon.util.downloadFileFromBlob(blob, filename);
|
|
@@ -484,7 +494,10 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
484
494
|
exporter.worksheet = exporter.excel.addWorksheet({
|
|
485
495
|
name: 'Лист 1',
|
|
486
496
|
});
|
|
487
|
-
|
|
497
|
+
const {headerRows, dataRows, footerRows} =
|
|
498
|
+
this.collectGridDataAsObject(this.getSelected(), exporter.excel);
|
|
499
|
+
const tableHeaderRows = this.getTableHeaderRows(exporter);
|
|
500
|
+
exporter.jsonData = [...headerRows, ...tableHeaderRows, ...dataRows, ...footerRows];
|
|
488
501
|
exporter.getContent = this.getContent.bind(exporter);
|
|
489
502
|
return exporter;
|
|
490
503
|
},
|
|
@@ -504,7 +517,48 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
504
517
|
|
|
505
518
|
return me.excel.render();
|
|
506
519
|
},
|
|
507
|
-
|
|
520
|
+
getTableHeaderRows(exporter, type = 'xlsx') {
|
|
521
|
+
let exporterPlugin = this.component.plugins.find(
|
|
522
|
+
(p) => p.ptype === 'gridexporter'
|
|
523
|
+
);
|
|
524
|
+
if (!exporterPlugin) {
|
|
525
|
+
exporterPlugin = Ext.create('Ext.grid.plugin.Exporter');
|
|
526
|
+
exporterPlugin.init(this.component);
|
|
527
|
+
}
|
|
528
|
+
exporter.setData(exporterPlugin.prepareData({}));
|
|
529
|
+
if (type === 'xls') {
|
|
530
|
+
const config = exporter.getConfig();
|
|
531
|
+
exporter.doc = new Ext.exporter.file.html.Doc({
|
|
532
|
+
title: config.title,
|
|
533
|
+
author: config.author,
|
|
534
|
+
tpl: config.tpl,
|
|
535
|
+
styles: [config.defaultStyle, config.titleStyle, config.groupHeaderStyle,
|
|
536
|
+
config.groupFooterStyle, config.tableHeaderStyle, config.tableFooterStyle],
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
const header = exporter.buildHeader();
|
|
540
|
+
return type === 'xls' ? header : header.map((row) => {
|
|
541
|
+
row.cells.forEach((cell) => {
|
|
542
|
+
Object.assign(cell, {
|
|
543
|
+
styleId: exporter.excel.addCellStyle(
|
|
544
|
+
{
|
|
545
|
+
alignment: {
|
|
546
|
+
wrapText: true,
|
|
547
|
+
horizontal: 'Center',
|
|
548
|
+
vertical: 'Automatic',
|
|
549
|
+
},
|
|
550
|
+
font: {
|
|
551
|
+
fontName: 'Arial',
|
|
552
|
+
family: 'Swiss',
|
|
553
|
+
bold: true,
|
|
554
|
+
},
|
|
555
|
+
}
|
|
556
|
+
),
|
|
557
|
+
});
|
|
558
|
+
});
|
|
559
|
+
return row.cells;
|
|
560
|
+
});
|
|
561
|
+
},
|
|
508
562
|
getTitle: function() {
|
|
509
563
|
return this.addHeader === true ? this.component.up('ReportPanel').title : '';
|
|
510
564
|
},
|
|
@@ -808,9 +862,10 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
808
862
|
/**
|
|
809
863
|
* Формируем данные для экспорта в файл в виде массива строк, чтобы преодолеть максимальный размер строки, допустимый в браузере.
|
|
810
864
|
* @param selections
|
|
865
|
+
* @param tableHeaderRows
|
|
811
866
|
* @returns {*[]}
|
|
812
867
|
*/
|
|
813
|
-
collectGridDataAsArray: function(selections) {
|
|
868
|
+
collectGridDataAsArray: function(selections, tableHeaderRows = []) {
|
|
814
869
|
const result = [];
|
|
815
870
|
const grid = this.component;
|
|
816
871
|
const columnCount = grid.getColumns().length;
|
|
@@ -838,10 +893,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
838
893
|
if (!Ext.isEmpty(this.header)) {
|
|
839
894
|
result.push(new Ext.XTemplate(this.processingTemplate(this.headerTemplate.html)).apply(dataForTemplates));
|
|
840
895
|
}
|
|
841
|
-
result.push('<table border="1">');
|
|
842
|
-
result.push('<tr>');
|
|
843
896
|
// собираем заголовки
|
|
844
|
-
const headers = [];
|
|
845
897
|
const dataIndexToColumn = [];
|
|
846
898
|
const visibleColumns = [];
|
|
847
899
|
const columnIndexToDataIndex = [];
|
|
@@ -854,13 +906,22 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
854
906
|
visibleColumns.push(c);
|
|
855
907
|
columnIndexToDataIndex[c] = dataIndex;
|
|
856
908
|
dataIndexToColumn[dataIndex] = columnModel[c];
|
|
857
|
-
const value = columnModel[c].text || columnModel[c].header;
|
|
858
|
-
headers.push('<td style="' + this.getHeaderStyle(value, 'string') + '">' + this.getRenderedValue(value, 'string') + '</td>');
|
|
859
909
|
}
|
|
860
910
|
}
|
|
861
911
|
}
|
|
862
|
-
result.push(
|
|
863
|
-
|
|
912
|
+
result.push('<table border="1">');
|
|
913
|
+
/* eslint-disable max-len */
|
|
914
|
+
const headerTpl = new Ext.XTemplate(
|
|
915
|
+
'<tpl for="columns">',
|
|
916
|
+
' <tr>\n',
|
|
917
|
+
'<tpl for=".">',
|
|
918
|
+
' <th<tpl if="width"> width="{width}"</tpl><tpl if="mergeAcross"> colSpan="{mergeAcross}"</tpl><tpl if="mergeDown"> rowSpan="{mergeDown}"</tpl>>{text}</th>\n',
|
|
919
|
+
'</tpl>',
|
|
920
|
+
' </tr>\n',
|
|
921
|
+
'</tpl>'
|
|
922
|
+
);
|
|
923
|
+
/* eslint-enable max-len */
|
|
924
|
+
result.push(headerTpl.apply({columns: tableHeaderRows}));
|
|
864
925
|
let chunk = '';
|
|
865
926
|
selections.forEach(function(record, i) {
|
|
866
927
|
const row = [];
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
|
|
2
|
-
.boldOnRow.x-grid-row {
|
|
3
|
-
font-weight: bold;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.italicOnRow.x-grid-row {
|
|
7
|
-
font-style: italic;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
.underlineOnRow.x-grid-row {
|
|
11
|
-
text-decoration: underline;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.linkColor.x-grid-row {
|
|
15
|
-
a {
|
|
16
|
-
color: inherit;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
.boldOnRow .x-grid-row {
|
|
21
|
-
font-weight: bold;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.italicOnRow .x-grid-row {
|
|
25
|
-
font-style: italic;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.underlineOnRow .x-grid-row {
|
|
29
|
-
text-decoration: underline;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
.linkColor .x-grid-row {
|
|
33
|
-
a {
|
|
34
|
-
color: inherit;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.x-grid-checkcolumn::after {
|
|
39
|
-
color: inherit !important;
|
|
40
|
-
font-weight: inherit;
|
|
41
|
-
font-style: inherit;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.x-grid-cell-inner .link-button {
|
|
45
|
-
color: inherit !important;
|
|
46
|
-
font-weight: inherit;
|
|
47
|
-
font-style: inherit;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
.x-grid-cell-inner {
|
|
51
|
-
a {
|
|
52
|
-
font-weight: inherit;
|
|
53
|
-
font-style: inherit;
|
|
54
|
-
color: inherit;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
1
|
+
|
|
2
|
+
.boldOnRow.x-grid-row {
|
|
3
|
+
font-weight: bold;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.italicOnRow.x-grid-row {
|
|
7
|
+
font-style: italic;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.underlineOnRow.x-grid-row {
|
|
11
|
+
text-decoration: underline;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.linkColor.x-grid-row {
|
|
15
|
+
a {
|
|
16
|
+
color: inherit;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.boldOnRow .x-grid-row {
|
|
21
|
+
font-weight: bold;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.italicOnRow .x-grid-row {
|
|
25
|
+
font-style: italic;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.underlineOnRow .x-grid-row {
|
|
29
|
+
text-decoration: underline;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.linkColor .x-grid-row {
|
|
33
|
+
a {
|
|
34
|
+
color: inherit;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.x-grid-checkcolumn::after {
|
|
39
|
+
color: inherit !important;
|
|
40
|
+
font-weight: inherit;
|
|
41
|
+
font-style: inherit;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.x-grid-cell-inner .link-button {
|
|
45
|
+
color: inherit !important;
|
|
46
|
+
font-weight: inherit;
|
|
47
|
+
font-style: inherit;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.x-grid-cell-inner {
|
|
51
|
+
a {
|
|
52
|
+
font-weight: inherit;
|
|
53
|
+
font-style: inherit;
|
|
54
|
+
color: inherit;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -28,7 +28,7 @@ Ext.define('Coon.report.plugin.grid.OpenURLButtonPlugin', {
|
|
|
28
28
|
if (!Ext.isEmpty(this.dynamicContextField) && !Ext.isEmpty(context.record)) {
|
|
29
29
|
url += context.record.get(this.dynamicContextField);
|
|
30
30
|
}
|
|
31
|
-
let paramsURL = this.url.indexOf('?') == -1 ? '?' : '';
|
|
31
|
+
let paramsURL = this.url && this.url.indexOf('?') == -1 ? '?' : '';
|
|
32
32
|
for (const paramName in params) {
|
|
33
33
|
if (params.hasOwnProperty(paramName)) {
|
|
34
34
|
if (!Ext.isEmpty(params)) {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
.x-tab-bar-default-top .x-tab-bar-body-default {
|
|
2
|
-
padding-top: 0;
|
|
3
|
-
}
|
|
1
|
+
.x-tab-bar-default-top .x-tab-bar-body-default {
|
|
2
|
+
padding-top: 0;
|
|
3
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
.ToggleColumnsPlugin {
|
|
2
|
-
.toggle-pressed {
|
|
3
|
-
.x-btn-icon-el-blue-text-button-small.svg-icon {
|
|
4
|
-
background-color: #1E3B4B;
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
}
|
|
1
|
+
.ToggleColumnsPlugin {
|
|
2
|
+
.toggle-pressed {
|
|
3
|
+
.x-btn-icon-el-blue-text-button-small.svg-icon {
|
|
4
|
+
background-color: #1E3B4B;
|
|
5
|
+
}
|
|
6
|
+
}
|
|
7
|
+
}
|