ru.coon 2.7.3 → 2.7.5
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 +39 -0
- package/package.json +1 -1
- package/src/app/Readme.md +0 -0
- package/src/app/Router.js +44 -0
- package/src/app/component/CenterView.js +65 -0
- package/src/app/component/CenterViewController.js +152 -0
- package/src/app/viewPort/Main.js +76 -0
- package/src/app/viewPort/Main.scss +133 -0
- package/src/common/component/ChooseColorField.js +142 -0
- package/src/common/component/ColorPalette.js +151 -0
- package/src/common/component/ColorPalette.scss +102 -0
- package/src/common/component/ColorPaletteController.js +189 -0
- package/src/common/field/withDefault.js +3 -2
- package/src/nav/AppNavigationMenu.js +35 -44
- package/src/nav/AppNavigationMenuController.js +110 -56
- package/src/nav/AppNavigationToggleButton.js +9 -0
- package/src/nav/AppNavigationToggleButton.scss +6 -0
- package/src/nav/MenuEntity.js +35 -0
- package/src/nav/editor/menu/NavMenuTreeController.js +1 -0
- package/src/nav/editor/menu/form/NavMenuFormViewController.js +1 -0
- package/src/report/plugin/configPanel/GridEditorPluginConfig.js +3 -1
- package/src/report/plugin/configPanel/GridRowStylePluginConfig.js +130 -94
- package/src/report/plugin/configPanel/GridRowStylePluginConfigPropertyGrid.js +10 -15
- package/src/report/plugin/grid/GridEditorsPlugin.js +27 -21
- package/src/report/plugin/grid/GridRowStylePlugin.js +90 -0
- package/src/uielement/component/MenuItemList.js +35 -6
- package/src/uielement/component/formchips/Chip.js +2 -2
- package/src/uielement/component/formchips/FilterConditionToolbar.js +2 -1
- package/src/uielement/component/formchips/FilterConditionToolbarController.js +37 -60
- package/src/uielement/plugin/configPanel/executeCommand/ExecuteCommandPluginConfigPanelFormEditor.js +14 -11
- package/src/version.js +1 -1
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
Ext.define('Coon.nav.AppNavigationMenu', {
|
|
2
2
|
extend: 'Ext.Panel',
|
|
3
3
|
xtype: 'AppNavigationMenu',
|
|
4
|
-
|
|
5
4
|
// mixins: ['Coon.mixin.RelayMethods'],
|
|
6
|
-
|
|
7
5
|
requires: [
|
|
8
6
|
'Coon.nav.menu.WorkspaceMenuView',
|
|
9
7
|
'Coon.nav.AppNavigationMenuController'
|
|
10
8
|
],
|
|
9
|
+
scrollable: 'y',
|
|
10
|
+
selectFirstOnLoad: true,
|
|
11
11
|
controller: 'AppNavigationMenuController',
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
getFirstAvailable: function() {
|
|
24
|
-
return this.getController().getFirstAvailable();
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
changeMicro: function(micro) {
|
|
28
|
-
this.lookup('WorkspaceMenuView').setMicro(micro);
|
|
12
|
+
viewModel: {
|
|
13
|
+
data: {
|
|
14
|
+
workspace_descr: null,
|
|
15
|
+
workspace_list: null,
|
|
16
|
+
workspace_icon: null,
|
|
17
|
+
navCollapsed: false,
|
|
18
|
+
collapsedWidth: 44,
|
|
19
|
+
fullWidth: 260,
|
|
20
|
+
},
|
|
29
21
|
},
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
22
|
+
fullWidth: 260,
|
|
23
|
+
cls: 'AppNavigationMenu',
|
|
24
|
+
layout: {
|
|
25
|
+
type: 'vbox',
|
|
26
|
+
align: 'stretch',
|
|
33
27
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
28
|
+
items: [
|
|
29
|
+
{
|
|
30
|
+
xtype: 'button',
|
|
31
|
+
textAlign: 'left',
|
|
32
|
+
bind: {
|
|
33
|
+
text: '{workspace_descr}',
|
|
34
|
+
menu: '{workspace_list}',
|
|
35
|
+
iconCls: '{workspace_icon}',
|
|
36
|
+
arrowVisible: '{!navCollapsed}',
|
|
37
|
+
},
|
|
39
38
|
},
|
|
40
|
-
|
|
39
|
+
{
|
|
41
40
|
xtype: 'WorkspaceMenuView',
|
|
42
41
|
reference: 'WorkspaceMenuView',
|
|
43
42
|
store: {
|
|
@@ -46,23 +45,15 @@ Ext.define('Coon.nav.AppNavigationMenu', {
|
|
|
46
45
|
children: null,
|
|
47
46
|
},
|
|
48
47
|
},
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
menu: '{workspace_list}',
|
|
57
|
-
iconCls: '{workspace_icon}',
|
|
58
|
-
arrowVisible: '{!navCollapsed}',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
this.workspaceMenuView
|
|
62
|
-
];
|
|
63
|
-
this.relayEvents(this.workspaceMenuView, ['selectionchange']);
|
|
64
|
-
// this.relayMethods(this, ['getFirstAvailable', 'getMenuReady', 'updateSelection']);
|
|
48
|
+
}
|
|
49
|
+
],
|
|
50
|
+
|
|
51
|
+
bind: {
|
|
52
|
+
width: `{!navCollapsed ? fullWidth : collapsedWidth}`,
|
|
53
|
+
},
|
|
54
|
+
initComponent: function() {
|
|
65
55
|
this.callParent();
|
|
56
|
+
this.relayEvents(this.lookup('WorkspaceMenuView'), ['selectionchange']);
|
|
66
57
|
},
|
|
67
58
|
|
|
68
59
|
});
|
|
@@ -6,13 +6,52 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
|
|
|
6
6
|
data: null,
|
|
7
7
|
},
|
|
8
8
|
menuReady: false,
|
|
9
|
-
|
|
9
|
+
selectThenMenuReady: undefined,
|
|
10
|
+
addWorkspaceToUrl: false,
|
|
10
11
|
init: function(view) {
|
|
12
|
+
view.updateSelection = this.updateSelection.bind(this);
|
|
13
|
+
view.getMenuReady = this.getMenuReady.bind(this);
|
|
14
|
+
view.getFirstAvailable = this.getFirstAvailable.bind(this);
|
|
15
|
+
view.changeMicro = this.changeMicro.bind(this);
|
|
16
|
+
view.changeWorkspace = this.changeWorkspace.bind(this);
|
|
17
|
+
this.view.on('selectionchange', this.onSelectMenuItem, this);
|
|
11
18
|
this.loadMenu();
|
|
12
19
|
view.getFirstAvailable = this.getFirstAvailable.bind(this);
|
|
20
|
+
Ext.on('route:initial', (route) => {
|
|
21
|
+
this.selectThenMenuReady = route.id;
|
|
22
|
+
});
|
|
23
|
+
Ext.on('route:change', (route) => this.selectMenuItem.call(this, route.id));
|
|
24
|
+
Ext.on('route:unmatched', () => this.goTo(this.getFirstAvailable()));
|
|
25
|
+
const vm = this.getViewModel();
|
|
26
|
+
Ext.on('nav:toggle', () => {
|
|
27
|
+
vm.set('navCollapsed', !vm.get('navCollapsed'));
|
|
28
|
+
vm.getParent().set('navCollapsed', vm.get('navCollapsed'));
|
|
29
|
+
this.changeMicro(vm.get('navCollapsed'));
|
|
30
|
+
});
|
|
31
|
+
Ext.on('nav:reload', () => this.updateMenu());
|
|
32
|
+
},
|
|
33
|
+
initViewModel(vm) {
|
|
34
|
+
vm.set('fullWidth', this.getView().fullWidth);
|
|
35
|
+
},
|
|
36
|
+
onMenuReady() {
|
|
37
|
+
const ws = this.locals.data.ws.entries().next().value.at(0);
|
|
38
|
+
this.changeWorkspace(ws, false);
|
|
39
|
+
if (this.selectThenMenuReady) {
|
|
40
|
+
this.selectMenuItem(this.selectThenMenuReady);
|
|
41
|
+
} else {
|
|
42
|
+
this.view.selectFirstOnLoad && this.goTo(this.getFirstAvailable(), true);
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
updateSelection: function(selection) {
|
|
46
|
+
return this.selectMenuItem(selection);
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
changeMicro: function(micro) {
|
|
50
|
+
this.lookup('WorkspaceMenuView').setMicro(micro);
|
|
13
51
|
},
|
|
14
52
|
|
|
15
53
|
updateMenu: function() {
|
|
54
|
+
Coon.nav.MenuEntity.menuItems = null;
|
|
16
55
|
this.loadMenu();
|
|
17
56
|
},
|
|
18
57
|
|
|
@@ -74,6 +113,21 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
|
|
|
74
113
|
return Object.values(menu);
|
|
75
114
|
},
|
|
76
115
|
|
|
116
|
+
goTo(id, force = false) {
|
|
117
|
+
if (id) {
|
|
118
|
+
let prefix = '';
|
|
119
|
+
if (this.addWorkspaceToUrl) {
|
|
120
|
+
const ws = this.getViewModel().get('workspace') || this.getFirstAvailable().ws.ws;
|
|
121
|
+
prefix = ws && ws + '/';
|
|
122
|
+
}
|
|
123
|
+
this.redirectTo(prefix + id, {force});
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
|
|
127
|
+
onSelectMenuItem: function(navCmp, item) {
|
|
128
|
+
this.goTo(item && item.get('UI_ELEMENT_CD'));
|
|
129
|
+
},
|
|
130
|
+
|
|
77
131
|
selectMenuItem: function(uiElementCd) {
|
|
78
132
|
if (!this.menuReady) {
|
|
79
133
|
return;
|
|
@@ -90,6 +144,7 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
|
|
|
90
144
|
|
|
91
145
|
if (!menuItem) {
|
|
92
146
|
console.error('unmatchedRoute: ' + uiElementCd);
|
|
147
|
+
this.goTo(this.getFirstAvailable());
|
|
93
148
|
return;
|
|
94
149
|
}
|
|
95
150
|
|
|
@@ -111,65 +166,64 @@ Ext.define('Coon.nav.AppNavigationMenuController', {
|
|
|
111
166
|
this.fireViewEvent('select', node);
|
|
112
167
|
return node;
|
|
113
168
|
},
|
|
114
|
-
loadMenu
|
|
115
|
-
|
|
116
|
-
.
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
169
|
+
loadMenu() {
|
|
170
|
+
Coon.nav.MenuEntity.get().then((menu) => {
|
|
171
|
+
if (Array.isArray(menu)) {
|
|
172
|
+
const dataList = this.prepareMenuData(menu);
|
|
173
|
+
const transformData = dataList.map((el) => {
|
|
174
|
+
return Coon.Function.convertObjectByMapping(el, {
|
|
175
|
+
MENU_ENTRY_ICON: 'iconCls',
|
|
176
|
+
MENU_ENTRY_DESCR: 'text',
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
this.locals.data = transformData.reduce((acc, el) => {
|
|
180
|
+
acc.ws.set(el.WORKSPACE_CD, {
|
|
181
|
+
ws: el.WORKSPACE_CD,
|
|
182
|
+
text: el.WORKSPACE_DESCR,
|
|
183
|
+
iconCls: el.WORKSPACE_ICON,
|
|
123
184
|
});
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
width: 260,
|
|
142
|
-
value: item.ws,
|
|
143
|
-
iconCls: item.iconCls,
|
|
144
|
-
handler: function() {
|
|
145
|
-
me.changeWorkspace(this.value, true);
|
|
146
|
-
},
|
|
147
|
-
});
|
|
185
|
+
acc.items[el.WORKSPACE_CD] = acc.items[el.WORKSPACE_CD] || {};
|
|
186
|
+
acc.items[el.WORKSPACE_CD][el.MENU_ENTRY_CD] = el;
|
|
187
|
+
acc.menu.push(el);
|
|
188
|
+
return acc;
|
|
189
|
+
}, {ws: new Map(), items: {}, menu: []});
|
|
190
|
+
|
|
191
|
+
const items = [];
|
|
192
|
+
const me = this;
|
|
193
|
+
this.locals.data.ws.forEach((item) => {
|
|
194
|
+
items.push({
|
|
195
|
+
text: item.text,
|
|
196
|
+
width: this.getView().fullWidth,
|
|
197
|
+
value: item.ws,
|
|
198
|
+
iconCls: item.iconCls,
|
|
199
|
+
handler: function() {
|
|
200
|
+
me.changeWorkspace(this.value, true);
|
|
201
|
+
},
|
|
148
202
|
});
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
203
|
+
});
|
|
204
|
+
this.getViewModel().set('workspace_list', items);
|
|
205
|
+
|
|
206
|
+
Object.entries(this.locals.data.items).forEach(function(workspace) {
|
|
207
|
+
const [workspaceId, workspaceItems] = workspace;
|
|
208
|
+
Object.values(workspaceItems).forEach(function(el) {
|
|
209
|
+
el.leaf = el.LEAF_SW === 'Y';
|
|
210
|
+
if (el.PARENT_MENU_ENTRY_CD) { // значит вложенный
|
|
211
|
+
const parent = this.locals.data.items[workspaceId][el.PARENT_MENU_ENTRY_CD];
|
|
212
|
+
if (parent) {
|
|
213
|
+
parent.children = parent.children || [];
|
|
214
|
+
parent.children.push(el);
|
|
161
215
|
}
|
|
162
|
-
}
|
|
216
|
+
}
|
|
163
217
|
}, this);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
}
|
|
218
|
+
}, this);
|
|
219
|
+
this.menuReady = true;
|
|
220
|
+
this.fireViewEvent('menuReady');
|
|
221
|
+
Ext.fireEvent('nav:ready');
|
|
222
|
+
this.onMenuReady();
|
|
223
|
+
}
|
|
224
|
+
});
|
|
170
225
|
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
this.getViewModel().set('micro', micro);
|
|
226
|
+
prepareMenuData(data) {
|
|
227
|
+
return data;
|
|
174
228
|
},
|
|
175
229
|
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Ext.define('Coon.nav.MenuEntity', {
|
|
2
|
+
singleton: true,
|
|
3
|
+
menuItems: null,
|
|
4
|
+
isLoading: false,
|
|
5
|
+
promise: null,
|
|
6
|
+
get() {
|
|
7
|
+
if (typeof this.menuItems === 'object' && Array.isArray(this.menuItems) && this.isLoading === false) {
|
|
8
|
+
return new Promise((resolve) => {
|
|
9
|
+
resolve(this.menuItems);
|
|
10
|
+
});
|
|
11
|
+
} else if (!this.promise) {
|
|
12
|
+
this.isLoading = true;
|
|
13
|
+
this.promise = Coon.util.promisifyCmd('command.GetDynamicReportDataCommand', 'MENU_ALLITEMS')
|
|
14
|
+
.then((data) => {
|
|
15
|
+
if (Array.isArray(data.list)) {
|
|
16
|
+
this.menuItems = data.list;
|
|
17
|
+
} else {
|
|
18
|
+
Ext.Msg.alert('ошибка', 'некорректный формат ответа или нет данных');
|
|
19
|
+
}
|
|
20
|
+
this.isLoading = false;
|
|
21
|
+
return this.menuItems;
|
|
22
|
+
}).finally(() => {
|
|
23
|
+
this.promise = null;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
return this.promise;
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
isValid(uiElement) {
|
|
30
|
+
return this.get().then((data) => {
|
|
31
|
+
return !!data.find((i) => i.UI_ELEMENT_CD === uiElement);
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
});
|
|
@@ -188,6 +188,7 @@ Ext.define('Coon.nav.editor.menu.NavMenuTreeController', {
|
|
|
188
188
|
Coon.util.promisifyCmd('command.DeleteMenuCommand', menu)
|
|
189
189
|
.then(() => {
|
|
190
190
|
this.reloadMenu();
|
|
191
|
+
Ext.fireEvent('nav:reload');
|
|
191
192
|
Ext.Msg.alert('Сообщение', 'Меню успешно удалено');
|
|
192
193
|
})
|
|
193
194
|
.catch((error) => {
|
|
@@ -140,11 +140,13 @@ Ext.define('Coon.report.plugin.configPanel.GridEditorPluginConfig', {
|
|
|
140
140
|
xtype: 'fieldset',
|
|
141
141
|
title: 'Конфиг',
|
|
142
142
|
height: 200,
|
|
143
|
+
flex: 1,
|
|
144
|
+
layout: 'fit',
|
|
145
|
+
scrollable: true,
|
|
143
146
|
items: [
|
|
144
147
|
{
|
|
145
148
|
xtype: 'UiAceEditor',
|
|
146
149
|
useLinter: true,
|
|
147
|
-
scrollable: 'y',
|
|
148
150
|
name: ns.$mask,
|
|
149
151
|
value: {},
|
|
150
152
|
}
|