ru.coon 2.8.58 → 2.8.60
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/.eslintrc.js +1 -1
- package/CHANGELOG.md +14 -0
- package/package.json +1 -1
- package/src/common/component/editor/CharacteristicGridCopyPlugin.js +5 -0
- package/src/report/plugin/grid/CopyRowsFromGrid.js +39 -5
- package/src/report/plugin/grid/exporters/xlsxExporter.js +10 -6
- package/src/uielement/component/UiCustomPanel.js +9 -7
- package/src/version.js +1 -1
package/.eslintrc.js
CHANGED
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
# Version 2.8.60, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c3691034b2a4144a1773defc7b6d4aab109ee210)
|
|
2
|
+
* ## Features
|
|
3
|
+
* <span style='color:green'>feat: TR-70149: Доработка выгрузки, фикс формата числовых значений, фикс отображения шапки и футера</span> ([38f11a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/38f11a281de81b654bdd7a0af6da48099fd833ae))
|
|
4
|
+
|
|
5
|
+
* update: CHANGELOG.md ([38b9ed], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/38b9edc4241421ec41051f9502b910d7201e5a69))
|
|
6
|
+
|
|
7
|
+
# Version 2.8.59, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d00dc72d4c63777c77785e2e13a5a29d994237e5)
|
|
8
|
+
* ## Fixes
|
|
9
|
+
* <span style='color:red'> AddInitSupport in UiCustomPanel init</span> ([9b3207], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9b3207c7ac0138bb5d03f6aac4218983e408da95))
|
|
10
|
+
|
|
11
|
+
* HT-11664 CharacteristicGridCopyPlugin disable widget on beforeedit ([8d5005], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8d5005fcf699864d9637caa4589df88e83b3c4f6))
|
|
12
|
+
* HT-11664 CharacteristicGridCopyPlugin disable widget on beforeedit ([0ff68e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0ff68efac5d37bb689fa7c358e9f5bc443cf888c))
|
|
13
|
+
* update: CHANGELOG.md ([9fb639], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9fb6392f8f74efd3c929cc0dc31efc14cb6a760e))
|
|
14
|
+
|
|
1
15
|
# Version 2.8.58, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/22b074ceba901b09c71842d17588be1f35dc9d38)
|
|
2
16
|
* ## Fixes
|
|
3
17
|
* <span style='color:red'> UiCustomPanel init</span> ([3126b1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3126b1b4cfc544658ca0df91832c0dcf75b7034e))
|
package/package.json
CHANGED
|
@@ -27,11 +27,15 @@ Ext.define('Coon.common.component.editor.CharacteristicGridCopyPlugin', {
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
editor.on('load', this.createWidgetColumn, this, {single: true});
|
|
30
|
+
editor.on('beforeedit', () => {
|
|
31
|
+
this.slaveWidgets.forEach((widget) => widget.setDisabled(true));
|
|
32
|
+
});
|
|
30
33
|
},
|
|
31
34
|
|
|
32
35
|
createWidgetColumn() {
|
|
33
36
|
const me = this;
|
|
34
37
|
me.masterWidgets = [];
|
|
38
|
+
me.slaveWidgets = [];
|
|
35
39
|
|
|
36
40
|
this.component.getView().grid.getEl().down('[class="x-grid-item-container"]').addCls('CharacteristicGridCopyPlugin');
|
|
37
41
|
const widgetColumn = Ext.create('Ext.grid.column.Widget', {
|
|
@@ -55,6 +59,7 @@ Ext.define('Coon.common.component.editor.CharacteristicGridCopyPlugin', {
|
|
|
55
59
|
widget.on('mouseover', me.showSlaveIcon, me, {args: [type, false, me.masterWidgets]});
|
|
56
60
|
widget.on('mouseout', me.showSlaveIcon, me, {args: [type, true, me.masterWidgets]});
|
|
57
61
|
widget.testIdToken = type;
|
|
62
|
+
me.slaveWidgets.push(widget);
|
|
58
63
|
}
|
|
59
64
|
},
|
|
60
65
|
});
|
|
@@ -422,6 +422,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
422
422
|
Coon.util.bindMethods([
|
|
423
423
|
'mergeDeep',
|
|
424
424
|
'getRenderedValue',
|
|
425
|
+
'parseJsEditorObj',
|
|
425
426
|
'getCellClass',
|
|
426
427
|
'getConfig',
|
|
427
428
|
'getCmp',
|
|
@@ -1092,6 +1093,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
1092
1093
|
collectColumns({record, idx, xlsx}) {
|
|
1093
1094
|
const {grid, visibleColumns, columnIndexToDataIndex, columnModel, dataIndexToColumn, workbook} = this.localData;
|
|
1094
1095
|
const result = xlsx ? [] : ['<tr>'];
|
|
1096
|
+
let rowStyles = null;
|
|
1095
1097
|
visibleColumns.forEach(function(columnIndex) {
|
|
1096
1098
|
const columnConfig = columnModel[columnIndex];
|
|
1097
1099
|
if (columnConfig.ignoreExport) {
|
|
@@ -1117,16 +1119,21 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
1117
1119
|
) :
|
|
1118
1120
|
record.data[dataIndex] || '';
|
|
1119
1121
|
if (!xlsx) {
|
|
1120
|
-
|
|
1122
|
+
if (!rowStyles) {
|
|
1123
|
+
rowStyles = this.getRowStyle(grid, record);
|
|
1124
|
+
}
|
|
1121
1125
|
result.push(`
|
|
1122
1126
|
<td
|
|
1123
1127
|
class="${this.getCellClass(value, valueType) || ''}"
|
|
1124
|
-
style="${
|
|
1128
|
+
style="${rowStyles || ''}">
|
|
1125
1129
|
${this.getRenderedValue(value, valueType) || ''}
|
|
1126
1130
|
</td>
|
|
1127
1131
|
`);
|
|
1128
1132
|
} else {
|
|
1129
|
-
|
|
1133
|
+
if (!rowStyles) {
|
|
1134
|
+
rowStyles = this.getRowStyleXlsx(grid, record, workbook);
|
|
1135
|
+
}
|
|
1136
|
+
let styles = rowStyles;
|
|
1130
1137
|
const col = {value: this.getRenderedValue(value, valueType) || ''};
|
|
1131
1138
|
styles = this.mergeDeep(styles, this.allBordersStyle);
|
|
1132
1139
|
if (valueType === 'float') {
|
|
@@ -1156,6 +1163,34 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
1156
1163
|
getRowStyleXlsx(grid, record) {
|
|
1157
1164
|
let styles = {};
|
|
1158
1165
|
const rowElement = Ext.fly(grid.getView().getRow(grid.getStore().indexOf(record)));
|
|
1166
|
+
const plugin = grid.plugins.find((p) => p.ptype === 'GridRowStylePlugin');
|
|
1167
|
+
const recordStyles = plugin.classCache.get(record.id);
|
|
1168
|
+
if (recordStyles) {
|
|
1169
|
+
recordStyles.forEach((key) => {
|
|
1170
|
+
if (key === 'gridrow-bold') {
|
|
1171
|
+
styles = this.mergeDeep(styles, {font: {bold: true}});
|
|
1172
|
+
} else if (key === 'gridrow-underline') {
|
|
1173
|
+
styles = this.mergeDeep(styles, {font: {underline: 'Single'}});
|
|
1174
|
+
} else if (key.indexOf('gridrow-color-rgba-') >= 0) {
|
|
1175
|
+
const rgb = key.replace('gridrow-color-rgba-', '').split('--').splice(0, 3);
|
|
1176
|
+
styles = this.mergeDeep(styles, {
|
|
1177
|
+
font: {
|
|
1178
|
+
color: this.rgbToHex(rgb),
|
|
1179
|
+
},
|
|
1180
|
+
});
|
|
1181
|
+
} /* else if (key.indexOf('gridrow-background-rgba-') >= 0) {
|
|
1182
|
+
const rgb = key.replace('gridrow-background-rgba-', '').split('--').splice(0, 3);
|
|
1183
|
+
styles = this.mergeDeep(styles, {
|
|
1184
|
+
interior: {
|
|
1185
|
+
color: this.rgbToHex(rgb),
|
|
1186
|
+
pattern: 'Solid',
|
|
1187
|
+
},
|
|
1188
|
+
});
|
|
1189
|
+
}*/
|
|
1190
|
+
});
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
|
|
1159
1194
|
if (rowElement) {
|
|
1160
1195
|
if (rowElement.hasCls('boldOnRow')) {
|
|
1161
1196
|
styles = this.mergeDeep(styles, {font: {bold: true}});
|
|
@@ -1167,8 +1202,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
1167
1202
|
styles = this.mergeDeep(styles, {font: {underline: 'Single'}});
|
|
1168
1203
|
}
|
|
1169
1204
|
}
|
|
1170
|
-
|
|
1171
|
-
return {styles: styles};
|
|
1205
|
+
return styles;
|
|
1172
1206
|
},
|
|
1173
1207
|
getRowStyle(grid, record) {
|
|
1174
1208
|
const rowElement = Ext.fly(grid.getView().getRow(grid.getStore().indexOf(record)));
|
|
@@ -75,8 +75,8 @@ Ext.define('Coon.report.plugin.grid.exporters.xlsxExporter', {
|
|
|
75
75
|
this.collectFiltersJson(columnCount, workbook)
|
|
76
76
|
);
|
|
77
77
|
}
|
|
78
|
-
if (this.headerXlsx) {
|
|
79
|
-
headerRows = headerRows.concat(this.parseJsEditorObj(this.headerXlsx, workbook));
|
|
78
|
+
if (this.plugin.headerXlsx) {
|
|
79
|
+
headerRows = headerRows.concat(this.parseJsEditorObj(this.plugin.headerXlsx, workbook));
|
|
80
80
|
}
|
|
81
81
|
const dataIndexToColumn = {};
|
|
82
82
|
const visibleColumns = [];
|
|
@@ -113,8 +113,8 @@ Ext.define('Coon.report.plugin.grid.exporters.xlsxExporter', {
|
|
|
113
113
|
})
|
|
114
114
|
);
|
|
115
115
|
}, this);
|
|
116
|
-
if (this.footerXlsx) {
|
|
117
|
-
footerRows = this.parseJsEditorObj(this.footerXlsx, workbook);
|
|
116
|
+
if (this.plugin.footerXlsx) {
|
|
117
|
+
footerRows = this.parseJsEditorObj(this.plugin.footerXlsx, workbook);
|
|
118
118
|
}
|
|
119
119
|
// Coon.log.debug(
|
|
120
120
|
// Coon.perf.getLog(stopMeasure())
|
|
@@ -226,6 +226,7 @@ Ext.define('Coon.report.plugin.grid.exporters.xlsxExporter', {
|
|
|
226
226
|
// const stopMeasure = Coon.perf.startSerie('collectColumns');
|
|
227
227
|
const {grid, visibleColumns, columnIndexToDataIndex, columnModel, dataIndexToColumn, workbook} = this.localData;
|
|
228
228
|
const result = [];
|
|
229
|
+
let rowStyles = null;
|
|
229
230
|
visibleColumns.forEach(function(columnIndex) {
|
|
230
231
|
const columnConfig = columnModel[columnIndex];
|
|
231
232
|
if (columnConfig.ignoreExport) {
|
|
@@ -251,7 +252,10 @@ Ext.define('Coon.report.plugin.grid.exporters.xlsxExporter', {
|
|
|
251
252
|
) :
|
|
252
253
|
record.data[dataIndex] || '';
|
|
253
254
|
// const stopMeasure1 = Coon.perf.startSerie('getRowStyleXlsx');
|
|
254
|
-
|
|
255
|
+
if (!rowStyles) {
|
|
256
|
+
rowStyles = this.getRowStyleXlsx(grid, record, workbook);
|
|
257
|
+
}
|
|
258
|
+
let styles = rowStyles;
|
|
255
259
|
// stopMeasure1();
|
|
256
260
|
const col = {value: this.getRenderedValue(value, valueType) || ''};
|
|
257
261
|
// const stopMeasure = Coon.perf.startSerie('mergeDeep');
|
|
@@ -260,7 +264,7 @@ Ext.define('Coon.report.plugin.grid.exporters.xlsxExporter', {
|
|
|
260
264
|
if (valueType === 'float') {
|
|
261
265
|
let precision = Number(columnConfig.precision);
|
|
262
266
|
if (!Number.isInteger(precision)) {
|
|
263
|
-
precision = Number(this.getConfig('floatPrecision') || this.defaultFloatPrecision);
|
|
267
|
+
precision = Number(this.getConfig('floatPrecision') || this.plugin.defaultFloatPrecision);
|
|
264
268
|
}
|
|
265
269
|
styles = this.mergeDeep(styles, {format: precision !== 0 ? '0.'.padEnd(precision + 2, '0') : '0'});
|
|
266
270
|
if (col['value'].length) {
|
|
@@ -9,7 +9,7 @@ Ext.define('Coon.uielement.component.UiCustomPanel', {
|
|
|
9
9
|
'Coon.uielement.component.UiCustomPanelTraceWindow'
|
|
10
10
|
],
|
|
11
11
|
controller: {type: 'UiCustomController'},
|
|
12
|
-
viewModel: {type: 'UiCustomPanelViewModel'},
|
|
12
|
+
// viewModel: {type: 'UiCustomPanelViewModel'},
|
|
13
13
|
|
|
14
14
|
keyMap: {
|
|
15
15
|
'Ctrl+Shift+Alt+F8': {
|
|
@@ -58,13 +58,15 @@ Ext.define('Coon.uielement.component.UiCustomPanel', {
|
|
|
58
58
|
copyLink: false,
|
|
59
59
|
|
|
60
60
|
initComponent() {
|
|
61
|
+
let data = Object.assign(this.viewModel && this.viewModel.data || {}, {
|
|
62
|
+
name: 'UiCustomPanel',
|
|
63
|
+
});
|
|
61
64
|
if (!this.inheritViewModel) {
|
|
62
|
-
|
|
63
|
-
this.viewModel.data = this.viewModel.data || {};
|
|
64
|
-
this.viewModel = {
|
|
65
|
-
data: Ext.applyIf(this.viewModel.data, this.getViewModelData()),
|
|
66
|
-
};
|
|
65
|
+
data = Ext.applyIf(data, this.getViewModelData());
|
|
67
66
|
}
|
|
67
|
+
this.viewModel = Ext.create('Ext.app.ViewModel', {
|
|
68
|
+
data,
|
|
69
|
+
});
|
|
68
70
|
this.callParent();
|
|
69
71
|
},
|
|
70
72
|
|
|
@@ -76,7 +78,7 @@ Ext.define('Coon.uielement.component.UiCustomPanel', {
|
|
|
76
78
|
Array.isArray(addDoInitSupportPlugin.parametersToModel)
|
|
77
79
|
) {
|
|
78
80
|
addDoInitSupportPlugin.parametersToModel.forEach((param) => {
|
|
79
|
-
data[param.valuePath] = param.forceInit ?
|
|
81
|
+
data[param.valuePath] = param.forceInit ? null : undefined;
|
|
80
82
|
});
|
|
81
83
|
}
|
|
82
84
|
return data;
|
package/src/version.js
CHANGED