ru.coon 2.5.63 → 2.5.65
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 +31 -0
- package/package.json +1 -1
- package/src/common/component/editor/creators/TimeEditorCreator.js +14 -0
- package/src/common/field/DeliveryTimeField.js +30 -0
- package/src/common/panel/WindowWrap.js +10 -1
- package/src/report/component/reportpanel/ReportGrid.scss +11 -0
- package/src/report/component/settings/common/ReportFormCommonPanel.js +5 -22
- package/src/report/component/settings/common/ReportFormCommonPanelController.js +41 -31
- package/src/report/component/settings/common/ReportSqlPreviewPanel.js +132 -29
- package/src/report/component/settings/parameter/ReportFormParameterEditPanelController.js +4 -2
- package/src/report/component/settings/property/ReportPropertiesPanelController.js +2 -2
- package/src/report/plugin/configPanel/GridEditorPluginConfig.js +188 -15
- package/src/report/plugin/configPanel/GridEditorPluginConfigPanel.js +22 -0
- package/src/report/plugin/configPanel/selectionModelFeature/SelectionModelFeatureConfigPanel.js +1 -1
- package/src/report/plugin/grid/GridEditorsPlugin.js +17 -0
- package/src/uielement/component/UiCPVisualEditor.js +896 -0
- package/src/uielement/component/UiCPVisualEditor.scss +108 -0
- package/src/uielement/component/UiCPVisualEditorConfigWindow.js +303 -0
- package/src/uielement/plugin/UnifiedButtonToolbarPlugin.js +8 -1
- package/src/version.js +1 -1
|
@@ -21,33 +21,206 @@ Ext.define('Coon.report.plugin.configPanel.GridEditorPluginConfig', {
|
|
|
21
21
|
},
|
|
22
22
|
|
|
23
23
|
createItems: function() {
|
|
24
|
-
this.
|
|
24
|
+
this.layout = 'fit';
|
|
25
|
+
this.fieldEditor = this.createFieldColumns({
|
|
26
|
+
hideLabel: true,
|
|
27
|
+
allowBlank: false,
|
|
28
|
+
});
|
|
29
|
+
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
30
|
+
this.grid = Ext.create('Ext.grid.Panel', {
|
|
25
31
|
flex: 1,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
region: 'center',
|
|
33
|
+
store: {
|
|
34
|
+
type: 'json',
|
|
35
|
+
data: [],
|
|
36
|
+
},
|
|
37
|
+
tbar: {
|
|
38
|
+
defaults: {
|
|
39
|
+
margin: 5,
|
|
40
|
+
},
|
|
41
|
+
items: [
|
|
42
|
+
{
|
|
43
|
+
xtype: 'button',
|
|
44
|
+
text: 'Добавить',
|
|
45
|
+
ui: 'blue-text-button-border',
|
|
46
|
+
handler: Ext.bind(this.addHandler, this),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
xtype: 'button',
|
|
50
|
+
text: 'Удалить',
|
|
51
|
+
ui: 'blue-text-button-border',
|
|
52
|
+
handler: Ext.bind(this.deleteHandler, this),
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
columns: [
|
|
57
|
+
{
|
|
58
|
+
header: 'Поле',
|
|
59
|
+
dataIndex: ns.$type,
|
|
60
|
+
xtype: 'hintColumn',
|
|
61
|
+
editor: this.fieldEditor,
|
|
62
|
+
flex: 1,
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
plugins: [
|
|
66
|
+
{ptype: 'cellediting', clicksToEdit: 2}
|
|
67
|
+
],
|
|
68
|
+
listeners: {
|
|
69
|
+
select: function(grid, record) {
|
|
70
|
+
Coon.Function.clearAllFieldsOnForm(this.editForm);
|
|
71
|
+
const recordConfig = this.editorConfig.find((el) => el.type === record.get(ns.$type));
|
|
72
|
+
Coon.Function.fillFormFields(this.editForm, recordConfig);
|
|
73
|
+
if (recordConfig[ns.$mask]) {
|
|
74
|
+
this.editForm.down('UiAceEditor').setValue(recordConfig[ns.$mask]);
|
|
75
|
+
}
|
|
76
|
+
this.editForm.setDisabled(!record);
|
|
77
|
+
}.bind(this),
|
|
78
|
+
deselect: this.setEditorConfig.bind(this),
|
|
79
|
+
},
|
|
30
80
|
});
|
|
31
81
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
82
|
+
this.editForm = Ext.create({
|
|
83
|
+
xtype: 'form',
|
|
84
|
+
region: 'east',
|
|
85
|
+
header: {
|
|
86
|
+
title: 'Редактор',
|
|
87
|
+
height: 55,
|
|
88
|
+
},
|
|
89
|
+
disabled: true,
|
|
90
|
+
flex: 2,
|
|
91
|
+
defaults: {
|
|
92
|
+
margin: 10,
|
|
93
|
+
anchor: '100%',
|
|
94
|
+
},
|
|
95
|
+
items: [
|
|
96
|
+
{
|
|
97
|
+
fieldLabel: 'Тип редактора',
|
|
98
|
+
name: ns.$typeOfValue,
|
|
99
|
+
xtype: 'lookupCombo',
|
|
100
|
+
lookupId: 'ADHOC_CHAR_TYPE_FLG',
|
|
101
|
+
submitFormat: false,
|
|
102
|
+
allowBlank: false,
|
|
103
|
+
loadOnRender: false,
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
boxLabel: 'Значение обязательно',
|
|
107
|
+
name: ns.$required,
|
|
108
|
+
xtype: 'checkbox',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: 'Редактировать в зависимости от поля',
|
|
112
|
+
xtype: 'fieldset',
|
|
113
|
+
checkboxName: 'dependsOnField',
|
|
114
|
+
checkboxToggle: true,
|
|
115
|
+
layout: {
|
|
116
|
+
type: 'vbox',
|
|
117
|
+
align: 'stretch',
|
|
118
|
+
},
|
|
119
|
+
defaults: {
|
|
120
|
+
flex: 1,
|
|
121
|
+
},
|
|
122
|
+
items: [
|
|
123
|
+
{
|
|
124
|
+
xtype: 'checkbox',
|
|
125
|
+
boxLabel: 'Редактировать если значение поля false/пусто',
|
|
126
|
+
name: 'invertValue',
|
|
127
|
+
},
|
|
128
|
+
this.createFieldColumns({
|
|
129
|
+
name: 'dependsOnFieldName',
|
|
130
|
+
}),
|
|
131
|
+
{
|
|
132
|
+
boxLabel: 'Выделить редактируемые ячейки',
|
|
133
|
+
name: 'highlightEditableCells',
|
|
134
|
+
xtype: 'checkbox',
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
xtype: 'fieldset',
|
|
140
|
+
title: 'Конфиг',
|
|
141
|
+
height: 200,
|
|
142
|
+
items: [
|
|
143
|
+
{
|
|
144
|
+
xtype: 'UiAceEditor',
|
|
145
|
+
useLinter: true,
|
|
146
|
+
scrollable: 'y',
|
|
147
|
+
name: ns.$mask,
|
|
148
|
+
value: {},
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
return [{
|
|
156
|
+
frame: true,
|
|
157
|
+
align: 'stretch',
|
|
158
|
+
layout: 'border',
|
|
159
|
+
defaults: {
|
|
160
|
+
split: true,
|
|
161
|
+
border: false,
|
|
162
|
+
},
|
|
163
|
+
items: [
|
|
164
|
+
this.grid,
|
|
165
|
+
this.editForm
|
|
166
|
+
],
|
|
167
|
+
}];
|
|
35
168
|
},
|
|
36
169
|
|
|
37
170
|
doInit: function(properties) {
|
|
38
171
|
if (properties) {
|
|
39
|
-
|
|
40
|
-
if (Ext.isString(editorConfig)) {
|
|
41
|
-
editorConfig = Ext.decode(editorConfig);
|
|
172
|
+
this.editorConfig = properties['editorConfig'];
|
|
173
|
+
if (Ext.isString(this.editorConfig)) {
|
|
174
|
+
this.editorConfig = Ext.decode(this.editorConfig);
|
|
42
175
|
}
|
|
43
|
-
this.
|
|
176
|
+
if (!Ext.isEmpty(this.editorConfig) && !Ext.isArray(this.editorConfig)) {
|
|
177
|
+
this.editorConfig = [this.editorConfig];
|
|
178
|
+
}
|
|
179
|
+
this.grid.getStore().loadData(this.editorConfig || []);
|
|
44
180
|
}
|
|
45
181
|
},
|
|
46
182
|
|
|
47
|
-
|
|
48
|
-
const
|
|
49
|
-
|
|
183
|
+
addHandler: function() {
|
|
184
|
+
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
185
|
+
const data = {};
|
|
186
|
+
data[ns.$entity] = 'ADV';
|
|
187
|
+
const newRecord = Ext.create('Coon.report.model.CharacteristicBean', data);
|
|
188
|
+
this.grid.getStore().add(newRecord);
|
|
189
|
+
const editor = this.grid.findPlugin('cellediting');
|
|
190
|
+
editor.startEditByPosition({row: this.grid.getStore().getCount() - 1, column: 0});
|
|
191
|
+
},
|
|
192
|
+
|
|
193
|
+
deleteHandler: function() {
|
|
194
|
+
const record = this.grid.getSelectionModel().getSelection()[0];
|
|
195
|
+
if (!record) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
record.set('isDeleted', true);
|
|
199
|
+
const foundIndex = this.editorConfig.findIndex((el) => el.type === record.get('type'));
|
|
200
|
+
this.editorConfig.splice(foundIndex, 1);
|
|
201
|
+
Coon.Function.clearAllFieldsOnForm(this.editForm);
|
|
202
|
+
this.editForm.setDisabled(true);
|
|
203
|
+
this.grid.getStore().remove(record);
|
|
204
|
+
},
|
|
50
205
|
|
|
206
|
+
setEditorConfig: function() {
|
|
207
|
+
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
208
|
+
const record = this.grid.getSelection()[0];
|
|
209
|
+
if (!record || record.get('isDeleted')) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
record.set(ns.$mask, this.editForm.down('UiAceEditor').getValue());
|
|
213
|
+
const foundIndex = this.editorConfig.findIndex((el) => el.type === record.get(ns.$type));
|
|
214
|
+
const deleteCount = foundIndex === -1 ? 0 : 1;
|
|
215
|
+
const position = foundIndex === -1 ? this.editorConfig.length : foundIndex;
|
|
216
|
+
this.editorConfig.splice(position, deleteCount, Object.assign(
|
|
217
|
+
record.getData(),
|
|
218
|
+
Coon.Function.getDataFromForm(this.editForm)));
|
|
219
|
+
},
|
|
220
|
+
|
|
221
|
+
getConfiguration: function() {
|
|
222
|
+
this.setEditorConfig();
|
|
223
|
+
const config = {editorConfig: this.editorConfig};
|
|
51
224
|
return config;
|
|
52
225
|
},
|
|
53
226
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Ext.define('Coon.report.plugin.configPanel.GridEditorPluginConfigPanel', {
|
|
2
|
+
extend: 'Coon.report.plugin.configPanel.BasePluginConfig',
|
|
3
|
+
alias: 'widget.GridEditorPluginConfigPanel',
|
|
4
|
+
uses: [],
|
|
5
|
+
requires: [
|
|
6
|
+
'Coon.Function'
|
|
7
|
+
],
|
|
8
|
+
alternateClassName: 'Sigma.common.grid.plugin.configPanel.GridEditorPluginConfig',
|
|
9
|
+
|
|
10
|
+
description: 'Плагин позволяет задать редактор для столбцов',
|
|
11
|
+
tags: ['Редактирование'],
|
|
12
|
+
|
|
13
|
+
config: {
|
|
14
|
+
pluginTypeSettings: {
|
|
15
|
+
defaultType: 'GRID_PLUGIN',
|
|
16
|
+
allowedTypes: [
|
|
17
|
+
'GRID_PLUGIN'
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
});
|
package/src/report/plugin/configPanel/selectionModelFeature/SelectionModelFeatureConfigPanel.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Ext.define('Coon.report.plugin.configPanel.selectionModelFeature.SelectionModelFeatureConfigPanel', {
|
|
2
2
|
extend: 'Coon.report.plugin.configPanel.PluginDefaults',
|
|
3
3
|
alias: 'widget.SelectionModelFeatureConfigPanel',
|
|
4
|
-
|
|
4
|
+
requires: ['Ext.selection.MixedRowSelectionModel'],
|
|
5
5
|
pluginType: 'SelectionModelPlugin',
|
|
6
6
|
description: 'Настройки SelectionModel',
|
|
7
7
|
tags: ['Поведение', 'Выделение'],
|
|
@@ -58,6 +58,9 @@ Ext.define('Coon.report.plugin.grid.GridEditorsPlugin', {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
|
+
hasEditor.on('beforeedit', function(editor, context) {
|
|
62
|
+
return context.record.allowEditWithEditorPlugin;
|
|
63
|
+
}, this);
|
|
61
64
|
},
|
|
62
65
|
|
|
63
66
|
createEditorItem: function(configuration) {
|
|
@@ -134,6 +137,20 @@ Ext.define('Coon.report.plugin.grid.GridEditorsPlugin', {
|
|
|
134
137
|
editor.on('beforeedit', function() {
|
|
135
138
|
Ext.emptyFn();
|
|
136
139
|
}, this);
|
|
140
|
+
let editable = true;
|
|
141
|
+
if (configuration['dependsOnField'] && configuration['dependsOnFieldName']) {
|
|
142
|
+
const editableColumn = this.grid.getColumns().find((col) => col.dataIndex === configuration[ns.$type]);
|
|
143
|
+
editableColumn.renderer = (value, metaData, record) => {
|
|
144
|
+
const dependsOnFieldName = configuration['dependsOnFieldName'];
|
|
145
|
+
const invertValue = configuration['invertValue'];
|
|
146
|
+
editable = invertValue === !record.get(dependsOnFieldName);
|
|
147
|
+
record.allowEditWithEditorPlugin = editable;
|
|
148
|
+
if (configuration['highlightEditableCells']) {
|
|
149
|
+
metaData.tdCls = editable ? 'create-line-left' : 'hover-style';
|
|
150
|
+
}
|
|
151
|
+
return value;
|
|
152
|
+
};
|
|
153
|
+
}
|
|
137
154
|
return editor;
|
|
138
155
|
},
|
|
139
156
|
});
|