ru.coon 2.7.11 → 2.7.13
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 +17 -0
- package/package.json +1 -1
- package/src/common/component/formeditor/UiCFCardsGrid.js +12 -1
- package/src/common/component/formeditor/UiCFCell.js +1 -0
- package/src/common/component/formeditor/UiCFCellController.js +20 -10
- package/src/common/component/formeditor/UiCFConfigEditorWindow.js +213 -0
- package/src/common/component/formeditor/UiCFConfigEditorWindowController.js +191 -0
- package/src/common/component/formeditor/UiCFContainerController.js +27 -21
- package/src/common/component/formeditor/UiCFFavoriteMenuItem.js +282 -0
- package/src/common/component/formeditor/UiCFFieldsConfig.js +231 -0
- package/src/common/component/formeditor/UiCFMenuEditorWindow.js +90 -0
- package/src/common/component/formeditor/UiCFMenuEditorWindowController.js +120 -0
- package/src/common/component/formeditor/UiCFPropertiesChooseWindow.js +69 -0
- package/src/common/component/formeditor/UiCFRadioGrid.js +5 -1
- package/src/common/component/formeditor/UiCFReportField.js +3 -0
- package/src/common/component/formeditor/UiCFRowController.js +2 -9
- package/src/common/component/formeditor/UiCFSegmentedButtonGrid.js +5 -1
- package/src/common/component/formeditor/UiCFText.js +5 -0
- package/src/common/component/formeditor/UiCustomFilterForm.js +98 -0
- package/src/common/component/formeditor/UiCustomForm.js +22 -1
- package/src/common/component/formeditor/UiCustomFormEditor.js +77 -12
- package/src/common/component/formeditor/UiCustomFormEditor.scss +27 -4
- package/src/common/component/formeditor/UiCustomFormEditorController.js +309 -17
- package/src/common/field/checkbox/RoundCheckbox.js +5 -0
- package/src/common/field/checkbox/RoundCheckbox.scss +48 -0
- package/src/log.js +8 -0
- package/src/nav/AppNavigationMenuController.js +12 -6
- package/src/nav/MenuLoader.js +23 -0
- package/src/report/component/settings/FilterFormEditing.js +93 -0
- package/src/report/component/settings/ReportFormEditPanelController.js +2 -1
- package/src/report/component/settings/parameter/ReportFormParametersGrid.js +31 -5
- package/src/report/component/settings/parameter/ReportFormParametersGridController.js +7 -1
- package/src/report/component/settings/plugin/ReportFormPluginGridController.js +8 -3
- package/src/report/component/settings/property/ReportPropertiesPanel.js +4 -5
- package/src/report/component/settings/property/ReportPropertiesPanelController.js +16 -109
- package/src/report/component/settings/property/ReportPropertyDictionary.js +0 -2
- package/src/report/plugin/configPanel/AddFilterConditionPluginConfigPanel.js +1 -1
- package/src/report/plugin/configPanel/FilterFormEditingPluginConfigPanel.js +403 -0
- package/src/report/plugin/form/ReportGroupsFieldValidationPlugin.js +21 -7
- package/src/report/plugin/grid/ExportReportDataToFilePlugin.md +7 -0
- package/src/report/plugin/grid/FilterFormEditingPlugin.js +18 -0
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,19 @@
|
|
|
1
|
+
# Version 2.7.13, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c2a509ebbdf7d3ddd07faaf3a42f0ef759a31cc4)
|
|
2
|
+
* ## Fixes
|
|
3
|
+
* <span style='color:red'>fix report property editor</span> ([ba33a6], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ba33a6f5379601e92e243ee8f971fc5811ac648f))
|
|
4
|
+
|
|
5
|
+
* update: CHANGELOG.md ([52e5a1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/52e5a14c22b9cf57be5d97fc73d81adfcd2c53f1))
|
|
6
|
+
|
|
7
|
+
# Version 2.7.12, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c0f357b6b648867b16809b8dc164e2dcdf023eac)
|
|
8
|
+
* ## Features
|
|
9
|
+
* <span style='color:green'>feat: HT-8422: make plugin</span> ([c0f288], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c0f28814e230b079799bb7091ccfc6a4985027d7))
|
|
10
|
+
* <span style='color:green'>feat: HT-8422: make plugin</span> ([3a716f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3a716f1e031351cc9cb7e824dd547bb26a209d8a))
|
|
11
|
+
* <span style='color:green'>feat: HT-8422: make plugin</span> ([dfee6a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dfee6a538ab0930e3a6768024dd1cc3d680f379e))
|
|
12
|
+
|
|
13
|
+
* upd ([20702b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/20702be763b8d49e5844a472789d013fca40708b))
|
|
14
|
+
* HT-8467 fix: Проверка наличия плагина перед использованием его методов. ([e531df], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e531df48524bc9ccef92c62463eea5d114f3a9cf))
|
|
15
|
+
* update: CHANGELOG.md ([6a43ba], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6a43ba46583e65e72523c1b6f28c46049d02e372))
|
|
16
|
+
|
|
1
17
|
# Version 2.7.11, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/df21c0308ab8f5fdc70b103cdc158aaa72a9b979)
|
|
2
18
|
* BFL-12079 fix: Присваивание defaultValue до того как загрузится store в SimplestReportCombo в FilterPanel ([b5dbb5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b5dbb5c2b113b183124411080593e05878adff87))
|
|
3
19
|
* BFL-12079 fix: Присваивание defaultValue до того как загрузится store в SimplestReportCombo в FilterPanel ([52df37], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/52df37900c87c581f0bf641cf1a46bb8ec064964))
|
|
@@ -12,6 +28,7 @@
|
|
|
12
28
|
|
|
13
29
|
# Version 2.7.9, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b687fd4d4c5294233d74ca8f6b87c7448891da77)
|
|
14
30
|
* ## Features
|
|
31
|
+
* <span style='color:green'>feat: HT-8422: make plugin</span> ([47d667], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/47d667d764ed1bde1fc31aaa0e7510e42511bff6))
|
|
15
32
|
* <span style='color:green'>feat: HT-7823: set max width picker width 600 px</span> ([001228], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/00122840bb50e6895a72e8a3b3cd8acfbccb3c94))
|
|
16
33
|
|
|
17
34
|
* ## Fixes
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ Ext.define('Coon.common.component.formeditor.UiCFCardsGrid', {
|
|
|
25
25
|
this.getViewModel().getStore('cardsStore').add({itemId: 'UiCFCard_' + Ext.id().replace('-', '_')});
|
|
26
26
|
},
|
|
27
27
|
deleteRow() {
|
|
28
|
-
this.getViewModel().getStore('cardsStore').remove(this.
|
|
28
|
+
this.getViewModel().getStore('cardsStore').remove(this.getView().getSelectionModel().getSelection());
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
viewModel: {
|
|
@@ -66,4 +66,15 @@ Ext.define('Coon.common.component.formeditor.UiCFCardsGrid', {
|
|
|
66
66
|
plugins: [
|
|
67
67
|
{ptype: 'cellediting'}
|
|
68
68
|
],
|
|
69
|
+
selModel: {
|
|
70
|
+
selType: 'rowmodel',
|
|
71
|
+
mode: 'MULTI',
|
|
72
|
+
},
|
|
73
|
+
viewConfig: {
|
|
74
|
+
plugins: {
|
|
75
|
+
gridviewdragdrop: {
|
|
76
|
+
dragText: 'Перетащите что бы упорядочить',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
69
80
|
});
|
|
@@ -169,17 +169,27 @@ Ext.define('Coon.common.component.formeditor.UiCFCellController', {
|
|
|
169
169
|
if (this.readOnly) {
|
|
170
170
|
return;
|
|
171
171
|
}
|
|
172
|
-
const
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
172
|
+
const doForm = () => {
|
|
173
|
+
const contextMenu = new Ext.menu.Menu({
|
|
174
|
+
closeAction: 'destroy',
|
|
175
|
+
items: this.getMenuItems(),
|
|
176
|
+
listeners: {
|
|
177
|
+
hide: function() {
|
|
178
|
+
const me = this;
|
|
179
|
+
Ext.defer(() => me.destroy(), 2000);
|
|
180
|
+
},
|
|
179
181
|
},
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
|
|
182
|
+
});
|
|
183
|
+
contextMenu.showAt(event.pageX, event.pageY);
|
|
184
|
+
};
|
|
185
|
+
if (!Coon.UiCFFieldsConfig.menuIsLoaded) {
|
|
186
|
+
Coon.UiCFFieldsConfig.getMenuCfgFromStorage().then((data) => {
|
|
187
|
+
doForm();
|
|
188
|
+
});
|
|
189
|
+
} else {
|
|
190
|
+
doForm();
|
|
191
|
+
}
|
|
192
|
+
|
|
183
193
|
event.preventDefault();
|
|
184
194
|
return false;
|
|
185
195
|
},
|
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
/* global Ext */
|
|
2
|
+
Ext.define('Coon.common.component.formeditor.UiCFConfigEditorWindow', {
|
|
3
|
+
extend: 'Ext.window.Window',
|
|
4
|
+
controller: 'UiCFConfigEditorWindowController',
|
|
5
|
+
xtype: 'UiCFConfigEditorWindow',
|
|
6
|
+
layout: {
|
|
7
|
+
type: 'hbox',
|
|
8
|
+
align: 'stretch',
|
|
9
|
+
},
|
|
10
|
+
modal: true,
|
|
11
|
+
title: 'Редактирование конфига полей',
|
|
12
|
+
maximized: true,
|
|
13
|
+
buttons: [
|
|
14
|
+
{
|
|
15
|
+
text: 'Отмена',
|
|
16
|
+
handler: 'closeWindow',
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
text: 'Применить',
|
|
20
|
+
ui: 'orange-button',
|
|
21
|
+
handler: 'applyValues',
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
viewModel: {
|
|
25
|
+
data: {
|
|
26
|
+
mainStoreSelection: null,
|
|
27
|
+
treeRowSelection: null,
|
|
28
|
+
ownPropertiesStoreSelection: null,
|
|
29
|
+
linter: {errors: null},
|
|
30
|
+
},
|
|
31
|
+
stores: {
|
|
32
|
+
mainStore: {
|
|
33
|
+
type: 'json',
|
|
34
|
+
fields: ['name', 'description', 'cfg', 'ownProperties'],
|
|
35
|
+
data: [],
|
|
36
|
+
},
|
|
37
|
+
ownPropertiesStore: {
|
|
38
|
+
type: 'json',
|
|
39
|
+
fields: ['name', 'value'],
|
|
40
|
+
data: [],
|
|
41
|
+
},
|
|
42
|
+
typeStore: {
|
|
43
|
+
type: 'json',
|
|
44
|
+
data: [{key: 'text'}, {key: 'int'}, {key: 'bool'}, {key: 'date'}, {key: 'dateFormat'},
|
|
45
|
+
{key: 'timeFormat'}, {key: 'timeTextFormat'}, {key: 'reportsList'}, {key: 'html'},
|
|
46
|
+
{key: 'cards'}, {key: 'radio'}, {key: 'segmented'}, {key: 'allowedExtensions'}, {key: 'reportField'}],
|
|
47
|
+
fields: ['key'],
|
|
48
|
+
},
|
|
49
|
+
menuStore: {
|
|
50
|
+
type: 'tree',
|
|
51
|
+
root: {
|
|
52
|
+
expanded: true,
|
|
53
|
+
text: 'Структура меню',
|
|
54
|
+
fields: ['text'],
|
|
55
|
+
children: [
|
|
56
|
+
{
|
|
57
|
+
text: '11',
|
|
58
|
+
leaf: true,
|
|
59
|
+
checked: false,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
text: '22',
|
|
63
|
+
leaf: true,
|
|
64
|
+
checked: true,
|
|
65
|
+
}
|
|
66
|
+
],
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
items: [
|
|
72
|
+
{
|
|
73
|
+
xtype: 'grid',
|
|
74
|
+
title: 'Поля',
|
|
75
|
+
reference: 'mainGrid',
|
|
76
|
+
flex: 1,
|
|
77
|
+
tbar: [
|
|
78
|
+
{
|
|
79
|
+
text: 'Добавить',
|
|
80
|
+
handler: 'addRowMain',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
text: 'Удалить',
|
|
84
|
+
handler: 'deleteRow',
|
|
85
|
+
bind: {
|
|
86
|
+
disabled: '{!mainStoreSelection}',
|
|
87
|
+
},
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
listeners: {
|
|
91
|
+
beforeselect: 'onBeforeSelectMain',
|
|
92
|
+
},
|
|
93
|
+
bind: {
|
|
94
|
+
store: '{mainStore}',
|
|
95
|
+
selection: '{mainStoreSelection}',
|
|
96
|
+
},
|
|
97
|
+
columns: [
|
|
98
|
+
{dataIndex: 'name', text: 'xtype', flex: 1, editor: {xtype: 'textfield'}},
|
|
99
|
+
{dataIndex: 'description', text: 'Наименование', flex: 1, editor: {xtype: 'textfield'}}
|
|
100
|
+
],
|
|
101
|
+
plugins: [
|
|
102
|
+
{ptype: 'cellediting'}
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
xtype: 'panel',
|
|
107
|
+
flex: 3,
|
|
108
|
+
layout: {
|
|
109
|
+
type: 'vbox',
|
|
110
|
+
align: 'stretch',
|
|
111
|
+
},
|
|
112
|
+
items: [
|
|
113
|
+
{
|
|
114
|
+
xtype: 'panel',
|
|
115
|
+
layout: {
|
|
116
|
+
type: 'hbox',
|
|
117
|
+
align: 'stretch',
|
|
118
|
+
},
|
|
119
|
+
flex: 1,
|
|
120
|
+
items: [
|
|
121
|
+
{
|
|
122
|
+
xtype: 'grid',
|
|
123
|
+
reference: 'privateGrid',
|
|
124
|
+
title: 'Приватные свойства',
|
|
125
|
+
width: 250,
|
|
126
|
+
tbar: [
|
|
127
|
+
{
|
|
128
|
+
text: 'Добавить',
|
|
129
|
+
handler: 'addRow',
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
text: 'Удалить',
|
|
133
|
+
handler: 'deleteRow',
|
|
134
|
+
bind: {
|
|
135
|
+
disabled: '{!ownPropertiesStoreSelection}',
|
|
136
|
+
},
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
listeners: {
|
|
140
|
+
beforeselect: 'onBeforeSelectOwnProperties',
|
|
141
|
+
},
|
|
142
|
+
bind: {
|
|
143
|
+
store: '{ownPropertiesStore}',
|
|
144
|
+
selection: '{ownPropertiesStoreSelection}',
|
|
145
|
+
disabled: '{!mainStoreSelection}',
|
|
146
|
+
},
|
|
147
|
+
columns: [
|
|
148
|
+
{dataIndex: 'name', text: 'Property', flex: 1, editor: {xtype: 'textfield'}}
|
|
149
|
+
],
|
|
150
|
+
plugins: [
|
|
151
|
+
{ptype: 'cellediting'}
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
flex: 1,
|
|
156
|
+
bind: {
|
|
157
|
+
disabled: '{!ownPropertiesStoreSelection}',
|
|
158
|
+
},
|
|
159
|
+
xtype: 'form',
|
|
160
|
+
reference: 'ownPropertiesCfgForm',
|
|
161
|
+
layout: 'form',
|
|
162
|
+
items: [
|
|
163
|
+
{xtype: 'textfield', flex: 1, allowBlank: false, fieldLabel: 'Наименование', name: 'description'},
|
|
164
|
+
{
|
|
165
|
+
xtype: 'combo',
|
|
166
|
+
allowBlank: false,
|
|
167
|
+
bind: {
|
|
168
|
+
store: '{typeStore}',
|
|
169
|
+
},
|
|
170
|
+
queryMode: 'local',
|
|
171
|
+
displayField: 'key',
|
|
172
|
+
valueField: 'key', flex: 1, fieldLabel: 'Тип данных', name: 'type',
|
|
173
|
+
},
|
|
174
|
+
{xtype: 'textfield', flex: 2, fieldLabel: 'Описание', name: 'text'}
|
|
175
|
+
],
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
xtype: 'panel',
|
|
181
|
+
flex: 1,
|
|
182
|
+
layout: {
|
|
183
|
+
type: 'hbox',
|
|
184
|
+
align: 'stretch',
|
|
185
|
+
},
|
|
186
|
+
items: [
|
|
187
|
+
{
|
|
188
|
+
title: 'Дополнительная конфигурация',
|
|
189
|
+
flex: 1,
|
|
190
|
+
layout: 'fit',
|
|
191
|
+
items: [
|
|
192
|
+
{
|
|
193
|
+
xtype: 'UiAceEditor',
|
|
194
|
+
useLinter: true,
|
|
195
|
+
|
|
196
|
+
width: '100%',
|
|
197
|
+
|
|
198
|
+
bind: {
|
|
199
|
+
disabled: '{!mainStoreSelection}',
|
|
200
|
+
},
|
|
201
|
+
listeners: {
|
|
202
|
+
editorchange: 'onChangeAce',
|
|
203
|
+
},
|
|
204
|
+
reference: 'cfgPanel',
|
|
205
|
+
}
|
|
206
|
+
],
|
|
207
|
+
}
|
|
208
|
+
],
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
});
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
Ext.define('Coon.common.component.formeditor.UiCFConfigEditorWindowController', {
|
|
2
|
+
extend: 'Ext.app.ViewController',
|
|
3
|
+
alias: 'controller.UiCFConfigEditorWindowController',
|
|
4
|
+
init: function(view) {
|
|
5
|
+
const vm = this.getViewModel();
|
|
6
|
+
vm.bind('{mainStoreSelection}', 'onMainSelectionChange', this);
|
|
7
|
+
vm.bind('{ownPropertiesStoreSelection}', 'onOwnPropertiesStoreSelectionChange', this);
|
|
8
|
+
|
|
9
|
+
const doForm = () => {
|
|
10
|
+
vm.getStore('mainStore').loadData(Object.keys(Coon.UiCFFieldsConfig.UiCFFieldsConfig).map((key) => {
|
|
11
|
+
return Ext.apply(Coon.UiCFFieldsConfig.UiCFFieldsConfig[key], {'name': key});
|
|
12
|
+
}));
|
|
13
|
+
};
|
|
14
|
+
if (!Coon.UiCFFieldsConfig.settingsIsLoaded) {
|
|
15
|
+
Coon.UiCFFieldsConfig.getCfgFromStorage().then((data) => {
|
|
16
|
+
doForm();
|
|
17
|
+
});
|
|
18
|
+
} else {
|
|
19
|
+
doForm();
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
onOwnPropertiesStoreSelectionChange(record) {
|
|
23
|
+
const data = record && record.get('value') && Ext.isObject(record.get('value')) ? record.get('value'): {
|
|
24
|
+
'description': '',
|
|
25
|
+
'type': 'text',
|
|
26
|
+
'text': '',
|
|
27
|
+
};
|
|
28
|
+
const form = this.lookup('ownPropertiesCfgForm');
|
|
29
|
+
form.loadRecord(Ext.create('Ext.data.Model', Ext.apply({
|
|
30
|
+
fields: ['description', 'type', 'text'],
|
|
31
|
+
}, data)));
|
|
32
|
+
form.isValid();
|
|
33
|
+
},
|
|
34
|
+
onMainSelectionChange(record) {
|
|
35
|
+
let ownProperties = [];
|
|
36
|
+
let cfg = {};
|
|
37
|
+
if (record) {
|
|
38
|
+
const ownPropertiesRec = record.get('ownProperties');
|
|
39
|
+
if (Ext.isObject(ownPropertiesRec)) {
|
|
40
|
+
ownProperties = Object.keys(ownPropertiesRec).map((key) => {
|
|
41
|
+
return {
|
|
42
|
+
'name': key,
|
|
43
|
+
'value': ownPropertiesRec[key],
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
cfg = record.get('cfg') && Ext.isObject(record.get('cfg'))? record.get('cfg') : {};
|
|
48
|
+
}
|
|
49
|
+
this.lookup('cfgPanel').setValue(JSON5.stringify(cfg, undefined, 2));
|
|
50
|
+
this.getViewModel().getStore('ownPropertiesStore').loadData(ownProperties);
|
|
51
|
+
},
|
|
52
|
+
onChangeAce(ace) {
|
|
53
|
+
const cfgPanel = this.lookup('cfgPanel');
|
|
54
|
+
cfgPanel.doLint();
|
|
55
|
+
},
|
|
56
|
+
onBeforeSelectOwnProperties(model, selected) {
|
|
57
|
+
if (!model.selected.items[0]) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
return this.applyPrivateFormValues();
|
|
61
|
+
},
|
|
62
|
+
privateGridIsValid() {
|
|
63
|
+
const grid = this.lookup('privateGrid');
|
|
64
|
+
let gridValid = true;
|
|
65
|
+
if (!this.applyPrivateFormValues()) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
68
|
+
grid.getStore().getRange().forEach((rec) => {
|
|
69
|
+
if (!rec.get('name') || !/^[a-zA-Z]*$/.test(rec.get('name'))) {
|
|
70
|
+
gridValid = false;
|
|
71
|
+
Ext.Msg.show({
|
|
72
|
+
title: 'Ошибка',
|
|
73
|
+
message: 'Проверьте корректность заполнения Properties. Значениие может содержать только латинские символы',
|
|
74
|
+
icon: Ext.Msg.ERROR,
|
|
75
|
+
buttons: Ext.Msg.OK,
|
|
76
|
+
});
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return gridValid;
|
|
81
|
+
},
|
|
82
|
+
applyMainGridValues() {
|
|
83
|
+
const privateGrid = this.lookup('privateGrid');
|
|
84
|
+
const mainGrid = this.lookup('mainGrid');
|
|
85
|
+
const record = mainGrid.getSelection()[0];
|
|
86
|
+
if (!this.privateGridIsValid()) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const cfgPanel = this.lookup('cfgPanel');
|
|
90
|
+
if (!cfgPanel.isValid()) {
|
|
91
|
+
Ext.Msg.show({
|
|
92
|
+
title: 'Ошибка',
|
|
93
|
+
message: 'В дополнительной конфигурации есть ошибки',
|
|
94
|
+
icon: Ext.Msg.ERROR,
|
|
95
|
+
buttons: Ext.Msg.OK,
|
|
96
|
+
});
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (record) {
|
|
100
|
+
const obj = {};
|
|
101
|
+
privateGrid.getStore().getRange().forEach((rec) => {
|
|
102
|
+
obj[rec.get('name')] = rec.get('value');
|
|
103
|
+
});
|
|
104
|
+
record.set('ownProperties', obj);
|
|
105
|
+
record.set('cfg', JSON5.parse(cfgPanel.getValue()));
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
},
|
|
109
|
+
applyPrivateFormValues() {
|
|
110
|
+
const grid = this.lookup('privateGrid');
|
|
111
|
+
const form = this.lookup('ownPropertiesCfgForm');
|
|
112
|
+
const record = grid.getSelection()[0];
|
|
113
|
+
if (record) {
|
|
114
|
+
if (!form.isValid()) {
|
|
115
|
+
Ext.Msg.show({
|
|
116
|
+
title: 'Ошибка',
|
|
117
|
+
message: 'Проверьте корректность заполнения полей формы',
|
|
118
|
+
icon: Ext.Msg.ERROR,
|
|
119
|
+
buttons: Ext.Msg.OK,
|
|
120
|
+
});
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
record.set('value', this.lookup('ownPropertiesCfgForm').getValues());
|
|
124
|
+
}
|
|
125
|
+
return true;
|
|
126
|
+
},
|
|
127
|
+
mainGridIsValid() {
|
|
128
|
+
const grid = this.lookup('mainGrid');
|
|
129
|
+
let gridValid = true;
|
|
130
|
+
if (!this.applyMainGridValues()) {
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
grid.getStore().getRange().forEach((rec) => {
|
|
134
|
+
if (!rec.get('name') || !/^[a-zA-Z]*$/.test(rec.get('name')) || !rec.get('description')) {
|
|
135
|
+
gridValid = false;
|
|
136
|
+
Ext.Msg.show({
|
|
137
|
+
title: 'Ошибка',
|
|
138
|
+
message: 'Проверьте корректность заполнения полей. Значениие xtype может содержать только латинские символы, наименование' +
|
|
139
|
+
'не может быть пустым',
|
|
140
|
+
icon: Ext.Msg.ERROR,
|
|
141
|
+
buttons: Ext.Msg.OK,
|
|
142
|
+
});
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
return gridValid;
|
|
147
|
+
},
|
|
148
|
+
onBeforeSelectMain(model, selected) {
|
|
149
|
+
if (!model.selected.items[0]) {
|
|
150
|
+
return true;
|
|
151
|
+
}
|
|
152
|
+
if (!this.applyMainGridValues()) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
addRow(button) {
|
|
157
|
+
button.up('grid').getStore().add({});
|
|
158
|
+
},
|
|
159
|
+
addRowMain(button) {
|
|
160
|
+
button.up('grid').getStore().add({'ownProperties': '{}', 'cfg': '{}'});
|
|
161
|
+
},
|
|
162
|
+
deleteRow(button) {
|
|
163
|
+
button.up('grid').getStore().remove(button.up('grid').getSelection()[0]);
|
|
164
|
+
},
|
|
165
|
+
closeWindow() {
|
|
166
|
+
this.getView().close();
|
|
167
|
+
},
|
|
168
|
+
applyValues() {
|
|
169
|
+
if (!this.mainGridIsValid()) {
|
|
170
|
+
return false;
|
|
171
|
+
}
|
|
172
|
+
const obj = {};
|
|
173
|
+
const grid = this.lookup('mainGrid');
|
|
174
|
+
grid.getStore().getRange().forEach((rec) => {
|
|
175
|
+
obj[rec.get('name')] = {
|
|
176
|
+
description: rec.get('description'),
|
|
177
|
+
cfg: rec.get('cfg') || {},
|
|
178
|
+
ownProperties: rec.get('ownProperties') || {},
|
|
179
|
+
userCfg: Coon.UiCFFieldsConfig.UiCFFieldsConfig[rec.get('name')] ?
|
|
180
|
+
Coon.UiCFFieldsConfig.UiCFFieldsConfig[rec.get('name')]['userCfg'] : {},
|
|
181
|
+
};
|
|
182
|
+
});
|
|
183
|
+
this.getView().mask('Подождите, идет сохранение');
|
|
184
|
+
Coon.UiCFFieldsConfig.setCfgToStorage(obj).then(() => {
|
|
185
|
+
Coon.UiCFFieldsConfig.UiCFFieldsConfig = obj;
|
|
186
|
+
this.getView().unmask();
|
|
187
|
+
this.fireViewEvent('changesSaved');
|
|
188
|
+
this.closeWindow();
|
|
189
|
+
});
|
|
190
|
+
},
|
|
191
|
+
});
|
|
@@ -70,18 +70,30 @@ Ext.define('Coon.common.component.formeditor.UiCFContainerController', {
|
|
|
70
70
|
if (this.readOnly) {
|
|
71
71
|
return;
|
|
72
72
|
}
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
73
|
+
const doForm = () => {
|
|
74
|
+
const menu = this.getMenuItems();
|
|
75
|
+
const contextMenu = new Ext.menu.Menu({
|
|
76
|
+
closeAction: 'destroy',
|
|
77
|
+
collapsible: false,
|
|
78
|
+
|
|
79
|
+
items: menu[0]['menu'],
|
|
80
|
+
/* listeners: {
|
|
81
|
+
hide: function() {
|
|
82
|
+
const me = this;
|
|
83
|
+
Ext.defer(() => me.destroy(), 2000);
|
|
84
|
+
},
|
|
85
|
+
},*/
|
|
86
|
+
});
|
|
87
|
+
contextMenu.showAt(event.pageX, event.pageY);
|
|
88
|
+
};
|
|
89
|
+
if (!Coon.UiCFFieldsConfig.menuIsLoaded) {
|
|
90
|
+
Coon.UiCFFieldsConfig.getMenuCfgFromStorage().then((data) => {
|
|
91
|
+
doForm();
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
doForm();
|
|
95
|
+
}
|
|
96
|
+
|
|
85
97
|
event.preventDefault();
|
|
86
98
|
return false;
|
|
87
99
|
},
|
|
@@ -191,17 +203,11 @@ Ext.define('Coon.common.component.formeditor.UiCFContainerController', {
|
|
|
191
203
|
const menuItems = [
|
|
192
204
|
{
|
|
193
205
|
text: 'добавить', iconCls: 'fa fa-plus',
|
|
194
|
-
menu: Coon.UiCFFieldsConfig.
|
|
195
|
-
return {
|
|
196
|
-
text: item.description,
|
|
197
|
-
iconCls: '',
|
|
198
|
-
handler: () => {
|
|
199
|
-
me.addRow(item.type, activeRow);
|
|
200
|
-
},
|
|
201
|
-
};
|
|
202
|
-
}),
|
|
206
|
+
menu: Coon.UiCFFieldsConfig.getMenuCfg(me, 'addRow', activeRow),
|
|
203
207
|
}
|
|
204
208
|
];
|
|
209
|
+
// me.addRow(item.type, activeRow);
|
|
210
|
+
|
|
205
211
|
const cnt = this.getUiCFEditorController();
|
|
206
212
|
const cell = cnt.copyCell || cnt.cutCell;
|
|
207
213
|
if (cell && cell.getView() && cell.getView().id !== this.getView().id) {
|