ru.coon 2.8.66 → 3.0.2
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 +317 -10
- package/package.json +1 -1
- package/src/Function.js +1 -1
- package/src/VisualLinker.js +610 -0
- package/src/VisualLinker.scss +219 -0
- package/src/app/Application.js +1 -0
- package/src/app/ApplicationSettings.js +49 -0
- package/src/app/Config.js +60 -0
- package/src/app/Router.js +37 -21
- package/src/app/viewPort/CVWrapperPanel.js +53 -0
- package/src/app/viewPort/CenterView.js +153 -46
- package/src/app/viewPort/CenterView.scss +151 -0
- package/src/app/viewPort/ComponentContextManager.js +24 -0
- package/src/app/viewPort/Main.js +4 -1
- package/src/app/viewPort/Routing.d2 +23 -0
- package/src/app/viewPort/TabHistory.js +81 -0
- package/src/common/ComponentFactory.js +167 -0
- package/src/common/button/DropdownContentButton.js +146 -0
- package/src/common/button/DropdownContentButton.scss +92 -0
- package/src/common/button/DropdownContentButtonController.js +60 -0
- package/src/common/component/formeditor/UiCustomFilterForm.scss +0 -1
- package/src/common/component/settings/modules/settingClosePageConfirmation.js +1 -3
- package/src/common/component/settings/modules/settingFavoritePanelShow.js +21 -0
- package/src/common/component/settings/modules/settingReportCalculator.js +22 -0
- package/src/common/component/settings/modules/settingShowNeedReloadMessage.js +1 -3
- package/src/common/component/settings/modules/settingwindowHolder.js +2 -3
- package/src/common/panel/WindowWrap.js +19 -11
- package/src/common/tree/BaseContextMenu.js +4 -3
- package/src/log.js +4 -5
- package/src/nav/AppNavCalcButton.js +23 -0
- package/src/nav/AppNavCalcButton.scss +6 -0
- package/src/nav/AppNavigationBar.js +1 -1
- package/src/nav/AppNavigationMenuController.js +2 -2
- package/src/nav/AppNavigationMenuMinimized.js +61 -0
- package/src/nav/AppNavigationPanel.js +115 -0
- package/src/nav/AppNavigationPanel.scss +178 -0
- package/src/nav/AppNavigationPanelController.js +386 -0
- package/src/nav/FavoriteCfg.js +18 -0
- package/src/nav/MenuEntity.js +23 -15
- package/src/nav/MenuFavoritesBar.js +100 -0
- package/src/nav/MenuFavoritesBar.scss +92 -0
- package/src/nav/editor/NavigateElementEditorView.js +2 -2
- package/src/nav/editor/workspace/NavWorkspaceListView.js +1 -4
- package/src/nav/menu/WorkspaceMenuViewMinimized.js +22 -0
- package/src/overrides/panel/TabPanel.js +36 -0
- package/src/overrides/panel/TabPanel.scss +65 -0
- package/src/report/component/ClearFiltersButton.js +4 -1
- package/src/report/component/CopyCellValueMenuItem.js +18 -0
- package/src/report/component/ReportFieldMap.js +274 -0
- package/src/report/component/ReportPanel.js +73 -44
- package/src/report/component/ReportPanel.scss +2 -2
- package/src/report/component/ReportTagLookup.js +59 -2
- package/src/report/component/calculator/ReportCalculatorController.js +266 -0
- package/src/report/component/calculator/ReportCalculatorField.js +47 -0
- package/src/report/component/calculator/ReportCalculatorHistoryPlugin.js +128 -0
- package/src/report/component/calculator/ReportCalculatorHistoryPlugin.scss +33 -0
- package/src/report/component/calculator/ReportCalculatorMenuItem.js +101 -0
- package/src/report/component/calculator/ReportCalculatorMenuItem.scss +41 -0
- package/src/report/component/calculator/ReportCalculatorPanel.js +363 -0
- package/src/report/component/calculator/ReportCalculatorPanel.scss +86 -0
- package/src/report/component/reportpanel/CopyReportPanelController.js +1 -1
- package/src/report/component/reportpanel/FilterPanel.js +13 -15
- package/src/report/component/reportpanel/FilterPanel.scss +5 -1
- package/src/report/component/reportpanel/FormFieldFocusPlugin.js +157 -0
- package/src/report/component/reportpanel/FormFieldFocusPlugin.scss +14 -0
- package/src/report/component/reportpanel/NorthPanel.js +16 -17
- package/src/report/component/reportpanel/NorthPanel.scss +1 -1
- package/src/report/component/reportpanel/ReportContextMenu.js +219 -0
- package/src/report/component/reportpanel/ReportGrid.js +1 -0
- package/src/report/component/reportpanel/ReportGrid.scss +4 -0
- package/src/report/component/settings/field/ReportFormFieldsGrid.js +2 -2
- package/src/report/component/settings/field/ReportFormFieldsGridController.js +2 -2
- package/src/report/component/settings/property/ReportPropertiesPanelController.js +1 -1
- package/src/report/component/settings/property/ReportPropertyDictionary.js +7 -0
- package/src/report/plugin/configPanel/AddFilterConditionPluginConfigPanel.js +34 -11
- package/src/report/plugin/configPanel/GridFiltersPluginConfigPanelFiltersGrid.js +3 -2
- package/src/report/plugin/configPanel/openCustomPanelButtonPlugin/OpenCustomPanelButtonPluginConfigPanel.js +274 -255
- package/src/report/plugin/configPanel/openCustomPanelButtonPlugin/OpenCustomPanelButtonPluginConfigPanel.scss +17 -0
- package/src/report/plugin/grid/AddFilterConditionPlugin.js +530 -87
- package/src/report/plugin/grid/CalculatorPlugin.js +90 -0
- package/src/report/plugin/grid/GridContextMenu.js +12 -10
- package/src/report/plugin/grid/GridRowCountPlugin.js +0 -1
- package/src/report/plugin/grid/GridToolbarButtonPlugin.js +11 -2
- package/src/report/plugin/grid/OpenCustomPanelButtonPlugin.js +126 -89
- package/src/report/plugin/grid/ReportColumnStatePlugin.js +15 -3
- package/src/report/plugin/grid/SetSingleParameterPlugin.js +1 -1
- package/src/report/plugin/grid/ToolbarButtonPlugin.js +1 -1
- package/src/report/plugin/grid/addFilterConditionPlugin/AdvancedSearchPanel.js +55 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/AdvancedSearchPanelController.js +226 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/FilterConfigMixin.js +138 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/FilterFieldFactory.js +223 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/FilterItem.js +164 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/FilterItem.scss +21 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/FilterMenu.js +29 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/FilterWrapPanel.js +53 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/FilterWrapPanelController.js +57 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/InfoMenuItem.js +111 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/InfoMenuItem.scss +83 -0
- package/src/report/plugin/grid/addFilterConditionPlugin/SelectColumnPanel.js +102 -0
- package/src/report/selectionModels/MixedRowSelectionModel.js +36 -45
- package/src/report/toolbar/dropdown/ToolbarOverflowButton.js +16 -5
- package/src/report/toolbar/dropdown/ToolbarOverflowPanel.scss +26 -14
- package/src/report/toolbar/layout/ReportToolbarOverflow.js +5 -2
- package/src/ringBuffer.js +7 -3
- package/src/uielement/command/GetUIElementCommand.js +0 -1
- package/src/uielement/component/UiCPWrapper.js +26 -36
- package/src/uielement/component/UiCustomController.js +7 -0
- package/src/uielement/component/UiCustomPanel.js +46 -2
- package/src/uielement/component/settings/UiCustomPanelEditorController.js +35 -29
- package/src/uielement/component/settings/plugin/UiCustomPanelPluginGrid.js +146 -33
- package/src/uielement/component/settings/plugin/UiCustomPanelPluginGrid.scss +28 -0
- package/src/uielement/component/settings/plugin/UiCustomPanelPluginGridController.js +366 -22
- package/src/uielement/component/settings/plugin/UiCustomPanelPluginModel.js +1 -0
- package/src/uielement/component/settings/plugin/UiCustomPanelPluginPanel.js +10 -4
- package/src/uielement/component/settings/plugin/UiCustomPanelPluginPanelController.js +28 -30
- package/src/uielement/plugin/UnifiedButtonToolbarPlugin.js +203 -22
- package/src/uielement/plugin/configPanel/ExecuteFunctionPluginConfigPanelFormEditor.js +4 -36
- package/src/uielement/plugin/configPanel/FireEventPluginConfigPanelFormEditor.js +5 -36
- package/src/uielement/plugin/configPanel/MethodChainPluginConfigPanelFormEditor.js +4 -36
- package/src/uielement/plugin/configPanel/OpenPanelPluginConfigPanelFormEditor.js +2 -38
- package/src/uielement/plugin/configPanel/PrintPdfPluginConfigPanelFormEditor.js +2 -35
- package/src/uielement/plugin/configPanel/UiCPPluginFormPanel.js +54 -0
- package/src/uielement/plugin/configPanel/UnifiedButtonToolbarPluginConfigPanelFormEditor.js +28 -18
- package/src/userSettings.js +1 -0
- package/src/util/ContextManager.js +109 -0
- package/src/util.js +96 -15
- package/src/version.js +1 -1
- package/src/app/viewPort/CenterViewController.js +0 -158
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
// visualLinker-linkerLine - главный элемент соединения
|
|
2
|
+
.visualLinker-linkerLine {
|
|
3
|
+
--width: 30px;
|
|
4
|
+
--size: 6px;
|
|
5
|
+
--x: 0px;
|
|
6
|
+
--y: 0px;
|
|
7
|
+
--z-index: 1;
|
|
8
|
+
--bg-color: #fff;
|
|
9
|
+
--border-color: rgb(61, 103, 128);
|
|
10
|
+
|
|
11
|
+
position: absolute;
|
|
12
|
+
width: var(--width);
|
|
13
|
+
height: var(--size);
|
|
14
|
+
top: var(--y);
|
|
15
|
+
left: var(--x);
|
|
16
|
+
background-color: var(--bg-color);
|
|
17
|
+
z-index: var(--z-index);
|
|
18
|
+
|
|
19
|
+
&.linker-full {
|
|
20
|
+
border-right: 1px solid var(--border-color);
|
|
21
|
+
border-left: 1px solid var(--border-color);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
&.linker-right {
|
|
25
|
+
border-right: 1px solid var(--border-color);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.linker-left {
|
|
29
|
+
border-left: 1px solid var(--border-color);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.linker-bottom::before {
|
|
33
|
+
content: '';
|
|
34
|
+
display: block;
|
|
35
|
+
position: absolute;
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 1px;
|
|
38
|
+
top: 100%;
|
|
39
|
+
left: 0;
|
|
40
|
+
background-color: var(--bg-color);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&.linker-top::before {
|
|
44
|
+
content: '';
|
|
45
|
+
display: block;
|
|
46
|
+
position: absolute;
|
|
47
|
+
width: 100%;
|
|
48
|
+
height: 1px;
|
|
49
|
+
bottom: 100%;
|
|
50
|
+
left: 0;
|
|
51
|
+
background-color: var(--bg-color);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// закомментирован код для скруглённых углов
|
|
55
|
+
// &.linker-bottom.linker-right {
|
|
56
|
+
// &::after {
|
|
57
|
+
// content: '';
|
|
58
|
+
// display: block;
|
|
59
|
+
// position: absolute;
|
|
60
|
+
// bottom: 0;
|
|
61
|
+
// right: 100%;
|
|
62
|
+
// width: 3px;
|
|
63
|
+
// height: 1px;
|
|
64
|
+
// background-color: white;
|
|
65
|
+
// z-index: calc(var(--z-index) + 1);
|
|
66
|
+
// }
|
|
67
|
+
// }
|
|
68
|
+
|
|
69
|
+
// &.linker-bottom.linker-left {
|
|
70
|
+
// &::after {
|
|
71
|
+
// content: '';
|
|
72
|
+
// display: block;
|
|
73
|
+
// position: absolute;
|
|
74
|
+
// bottom: 0;
|
|
75
|
+
// left: 100%;
|
|
76
|
+
// width: 3px;
|
|
77
|
+
// height: 1px;
|
|
78
|
+
// background-color: white;
|
|
79
|
+
// z-index: calc(var(--z-index) + 1);
|
|
80
|
+
// }
|
|
81
|
+
// }
|
|
82
|
+
|
|
83
|
+
// &.linker-top.linker-right {
|
|
84
|
+
// &::after {
|
|
85
|
+
// content: '';
|
|
86
|
+
// display: block;
|
|
87
|
+
// position: absolute;
|
|
88
|
+
// top: 0;
|
|
89
|
+
// right: 100%;
|
|
90
|
+
// width: 3px;
|
|
91
|
+
// height: 1px;
|
|
92
|
+
// background-color: white;
|
|
93
|
+
// z-index: calc(var(--z-index) + 1);
|
|
94
|
+
// }
|
|
95
|
+
// }
|
|
96
|
+
|
|
97
|
+
// &.linker-top.linker-left {
|
|
98
|
+
// &::after {
|
|
99
|
+
// content: '';
|
|
100
|
+
// display: block;
|
|
101
|
+
// position: absolute;
|
|
102
|
+
// top: 0;
|
|
103
|
+
// left: 100%;
|
|
104
|
+
// width: 3px;
|
|
105
|
+
// height: 1px;
|
|
106
|
+
// background-color: white;
|
|
107
|
+
// z-index: calc(var(--z-index) + 1);
|
|
108
|
+
// }
|
|
109
|
+
// }
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// visualLinker-linkerCorner - элемент соединения для скруглённых границ
|
|
113
|
+
.visualLinker-linkerCorner {
|
|
114
|
+
--size: 6px;
|
|
115
|
+
--z-index: 1;
|
|
116
|
+
--border-color: #000;
|
|
117
|
+
--outer-bg-color: rgb(61, 103, 128);
|
|
118
|
+
|
|
119
|
+
content: '';
|
|
120
|
+
display: block;
|
|
121
|
+
width: var(--size);
|
|
122
|
+
height: var(--size);
|
|
123
|
+
position: absolute;
|
|
124
|
+
bottom: 0;
|
|
125
|
+
left: 0;
|
|
126
|
+
background-color: var(--outer-bg-color);
|
|
127
|
+
border-radius: 50%;
|
|
128
|
+
z-index: calc(var(--z-index) + 1);
|
|
129
|
+
|
|
130
|
+
&::before {
|
|
131
|
+
content: '';
|
|
132
|
+
position: absolute;
|
|
133
|
+
background-color: inherit;
|
|
134
|
+
width: calc(var(--size) - 0px);
|
|
135
|
+
height: calc(var(--size) - 0px);
|
|
136
|
+
z-index: calc(var(--z-index) + 2);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&::after {
|
|
140
|
+
content: '';
|
|
141
|
+
position: absolute;
|
|
142
|
+
display: block;
|
|
143
|
+
width: calc(var(--size) - 3px);
|
|
144
|
+
height: calc(var(--size) - 3px);
|
|
145
|
+
z-index: calc(var(--z-index) + 1);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&.linkerCorner-bottom {
|
|
149
|
+
&::before {
|
|
150
|
+
top: 0;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
&::after {
|
|
154
|
+
bottom: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
&.linkerCorner-left {
|
|
158
|
+
&::before {
|
|
159
|
+
right: 0;
|
|
160
|
+
border-bottom-left-radius: 66%;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
&::after {
|
|
164
|
+
left: 0;
|
|
165
|
+
border-bottom-left-radius: 6px;
|
|
166
|
+
outline: 1px solid var(--border-color);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
&.linkerCorner-right {
|
|
171
|
+
&::before {
|
|
172
|
+
left: 0;
|
|
173
|
+
border-bottom-right-radius: 66%;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
&::after {
|
|
177
|
+
right: 0;
|
|
178
|
+
border-bottom-right-radius: 6px;
|
|
179
|
+
outline: 1px solid var(--border-color);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
&.linkerCorner-top {
|
|
185
|
+
&::before {
|
|
186
|
+
bottom: 0;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
&::after {
|
|
190
|
+
top: 0;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
&.linkerCorner-left {
|
|
194
|
+
&::before {
|
|
195
|
+
right: 0;
|
|
196
|
+
border-top-left-radius: 66%;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&::after {
|
|
200
|
+
left: 0;
|
|
201
|
+
border-top-left-radius: 6px;
|
|
202
|
+
outline: 1px solid var(--border-color);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
&.linkerCorner-right {
|
|
207
|
+
&::before {
|
|
208
|
+
left: 0;
|
|
209
|
+
border-top-right-radius: 66%;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
&::after {
|
|
214
|
+
right: 0;
|
|
215
|
+
border-top-right-radius: 6px;
|
|
216
|
+
outline: 1px solid var(--border-color);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
package/src/app/Application.js
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
Ext.define('Coon.app.ApplicationSettings', {
|
|
2
|
+
singleton: true,
|
|
3
|
+
|
|
4
|
+
mainViewXType: undefined,
|
|
5
|
+
menuXType: undefined,
|
|
6
|
+
mainView: undefined,
|
|
7
|
+
requires: ['Coon.common.UserPropStorage'],
|
|
8
|
+
|
|
9
|
+
constructor: function(config) {
|
|
10
|
+
const storage = Ext.create('Coon.common.UserPropStorage', {
|
|
11
|
+
component: 'applicationSettings',
|
|
12
|
+
componentId: 'app',
|
|
13
|
+
module: 'applicationSettingsParameters',
|
|
14
|
+
propList: ['mainViewXType', 'menuXType'],
|
|
15
|
+
saveType: 'ls',
|
|
16
|
+
});
|
|
17
|
+
// console.log(storage.saveProps({mainViewXType: 'centerview', menuXType: 'AppNavigationMenuMinimized'}));
|
|
18
|
+
// console.log(storage.saveProps({mainViewXType: false, menuXType: 'AppNavigationMenu'}));
|
|
19
|
+
const props = storage.getSavedProps();
|
|
20
|
+
this.setMainViewXType(props.mainViewXType);
|
|
21
|
+
this.setMenuXType(props.menuXType);
|
|
22
|
+
},
|
|
23
|
+
setMenuXType: function(xtype) {
|
|
24
|
+
this.menuXType = xtype;
|
|
25
|
+
},
|
|
26
|
+
getMenuXType: function() {
|
|
27
|
+
return this.menuXType;
|
|
28
|
+
},
|
|
29
|
+
setMainViewXType(xtype) {
|
|
30
|
+
this.mainViewXType = xtype;
|
|
31
|
+
},
|
|
32
|
+
setMainView(view) {
|
|
33
|
+
this.mainView = view;
|
|
34
|
+
},
|
|
35
|
+
getMainView: function() {
|
|
36
|
+
if (this.mainView) {
|
|
37
|
+
return this.mainView;
|
|
38
|
+
}
|
|
39
|
+
let cmp = Ext.getBody();
|
|
40
|
+
if (this.mainViewXType) {
|
|
41
|
+
const result = Ext.ComponentQuery.query('centerview');
|
|
42
|
+
if (result && result.length > 0) {
|
|
43
|
+
cmp = result[0];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
this.setMainView(cmp);
|
|
47
|
+
return cmp;
|
|
48
|
+
},
|
|
49
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Ext.define('Coon.app.Config', {
|
|
2
|
+
singleton: true,
|
|
3
|
+
requires: ['Coon.common.UserPropStorage'],
|
|
4
|
+
configVersion: null,
|
|
5
|
+
locals: {},
|
|
6
|
+
appConfig: {
|
|
7
|
+
default: 'v1',
|
|
8
|
+
versions: {
|
|
9
|
+
v1: {
|
|
10
|
+
mainViewXType: 'centerview',
|
|
11
|
+
menuXType: 'AppNavigationMenuMinimized',
|
|
12
|
+
},
|
|
13
|
+
v2: {
|
|
14
|
+
mainViewXType: null,
|
|
15
|
+
menuXType: 'AppNavigationMenu',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
convert: {
|
|
19
|
+
mainViewXType(val) {
|
|
20
|
+
let cmp = Ext.getBody();
|
|
21
|
+
if (val) {
|
|
22
|
+
const result = Ext.ComponentQuery.query(val)[0];
|
|
23
|
+
if (result) {
|
|
24
|
+
cmp = result;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return cmp;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
constructor: function(config) {
|
|
34
|
+
this.storage = Ext.create('Coon.common.UserPropStorage', {
|
|
35
|
+
component: 'appConfig',
|
|
36
|
+
componentId: 'app',
|
|
37
|
+
module: 'appConfig',
|
|
38
|
+
propList: ['configVersion'],
|
|
39
|
+
saveType: 'ls',
|
|
40
|
+
});
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
getVersionKey() {
|
|
44
|
+
return this.storage.getSavedProps().configVersion || this.appConfig.default;
|
|
45
|
+
},
|
|
46
|
+
|
|
47
|
+
get(property) {
|
|
48
|
+
if (!property || !this.getVersionKey() || !(this.getVersionKey() in this.appConfig.versions)) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
if (property in this.locals) {
|
|
52
|
+
return this.locals[property];
|
|
53
|
+
}
|
|
54
|
+
const value = this.appConfig.versions[this.getVersionKey()][property];
|
|
55
|
+
const convertFn = typeof this.appConfig.convert[property] === 'function' && this.appConfig.convert[property];
|
|
56
|
+
this.locals[property] = convertFn ? convertFn.call(this, value) : value;
|
|
57
|
+
return this.locals[property];
|
|
58
|
+
},
|
|
59
|
+
|
|
60
|
+
});
|
package/src/app/Router.js
CHANGED
|
@@ -3,22 +3,20 @@ Ext.define('Coon.app.Router', {
|
|
|
3
3
|
singleton: true,
|
|
4
4
|
constructor() {
|
|
5
5
|
this.setRoutes({
|
|
6
|
-
':{type}/:{id}': {
|
|
7
|
-
action: 'onRouteEnter',
|
|
8
|
-
},
|
|
9
6
|
':{id}': {
|
|
10
7
|
action: 'onRouteEnter',
|
|
8
|
+
before: 'validateMenuItem',
|
|
11
9
|
},
|
|
12
|
-
':{type}/:{id}/:{params...}': {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
10
|
+
// ':{type}/:{id}/:{params...}': {
|
|
11
|
+
// action: 'onRouteEnter',
|
|
12
|
+
// types: {
|
|
13
|
+
// '...': {
|
|
14
|
+
// re: '(.+)?',
|
|
15
|
+
// split: '/',
|
|
16
|
+
// parse: (value) => value,
|
|
17
|
+
// },
|
|
18
|
+
// },
|
|
19
|
+
// },
|
|
22
20
|
});
|
|
23
21
|
Ext.on('router:goToLastRoute', () => {
|
|
24
22
|
this.onRouteEnter(this.lastRoute);
|
|
@@ -27,6 +25,28 @@ Ext.define('Coon.app.Router', {
|
|
|
27
25
|
|
|
28
26
|
lastRoute: null,
|
|
29
27
|
|
|
28
|
+
async validateMenuItem(route) {
|
|
29
|
+
if (!Ext.getApplication().isAuthenticated()) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
route.menuItem = await Coon.nav.MenuEntity.getMenuItem(route.id);
|
|
34
|
+
if (!route.menuItem) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
route.uiElement = await Coon.util.promisifyCmd(
|
|
38
|
+
'Coon.uielement.command.GetUIElementCommand',
|
|
39
|
+
route.menuItem.UI_ELEMENT_CD
|
|
40
|
+
);
|
|
41
|
+
if (!route.uiElement) {
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
} catch (ex) {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
|
|
30
50
|
onBeforeRouteEnterFn: null,
|
|
31
51
|
|
|
32
52
|
onBeforeRouteEnter() {
|
|
@@ -45,7 +65,6 @@ Ext.define('Coon.app.Router', {
|
|
|
45
65
|
return true;
|
|
46
66
|
},
|
|
47
67
|
|
|
48
|
-
|
|
49
68
|
getLastRoute() {
|
|
50
69
|
return this.lastRoute;
|
|
51
70
|
},
|
|
@@ -60,21 +79,18 @@ Ext.define('Coon.app.Router', {
|
|
|
60
79
|
if (!app.initialRoute) {
|
|
61
80
|
app.initialRoute = route;
|
|
62
81
|
}
|
|
63
|
-
|
|
64
|
-
if (valid === true) {
|
|
65
|
-
Ext.fireEvent('route:change', route);
|
|
66
|
-
} else {
|
|
67
|
-
Ext.fireEvent('route:unmatched', route);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
82
|
+
Ext.fireEvent('route:change', route);
|
|
70
83
|
},
|
|
84
|
+
|
|
71
85
|
getRouterView() {
|
|
72
86
|
return Ext.ComponentQuery.query('centerview')[0];
|
|
73
87
|
},
|
|
88
|
+
|
|
74
89
|
getActiveComponent() {
|
|
75
90
|
const routerView = this.getRouterView();
|
|
76
91
|
return routerView && routerView.getLayout().getActiveItem();
|
|
77
92
|
},
|
|
93
|
+
|
|
78
94
|
getAuthToken() {
|
|
79
95
|
const search = document.location.search;
|
|
80
96
|
let jwtToken;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
Ext.define('Coon.app.viewPort.CVWrapperPanel', {
|
|
2
|
+
extend: 'Ext.panel.Panel',
|
|
3
|
+
|
|
4
|
+
xtype: 'CVWrapperPanel',
|
|
5
|
+
cls: 'CVWrapperPanel',
|
|
6
|
+
layout: 'fit',
|
|
7
|
+
|
|
8
|
+
changeFavorite(menuEntryCd, state) {
|
|
9
|
+
if (this.menuItem.MENU_ENTRY_CD !== menuEntryCd) {
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const title = this.getComponentTitle();
|
|
13
|
+
if (state === 'add') {
|
|
14
|
+
title.iconEl.dom.classList.add('is-favorite-item');
|
|
15
|
+
} else {
|
|
16
|
+
title.iconEl.dom.classList.remove('is-favorite-item');
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
getComponentTitle() {
|
|
21
|
+
const component = this.getComponent(0);
|
|
22
|
+
const header = component.getHeader();
|
|
23
|
+
return header && header.getTitle();
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
initComponent(...args) {
|
|
27
|
+
this.callParent(...args);
|
|
28
|
+
const component = this.getComponent(0);
|
|
29
|
+
if (this.menuItem) {
|
|
30
|
+
component.on('afterrender', function() {
|
|
31
|
+
const title = this.getComponentTitle();
|
|
32
|
+
if (title && title.iconEl) {
|
|
33
|
+
const props = Coon.nav.menu.FavoriteCfg.get().favorite || [];
|
|
34
|
+
const index = props.indexOf(this.menuItem.MENU_ENTRY_CD);
|
|
35
|
+
if (index >= 0) {
|
|
36
|
+
title.iconEl.dom.classList.add('is-favorite-item');
|
|
37
|
+
}
|
|
38
|
+
Ext.on('nav:favoriteitemschange', this.changeFavorite, this);
|
|
39
|
+
}
|
|
40
|
+
}, this, {single: true});
|
|
41
|
+
|
|
42
|
+
component.on('beforedestroy', function() {
|
|
43
|
+
Ext.un('nav:favoriteitemschange', this.changeFavorite, this);
|
|
44
|
+
}, this);
|
|
45
|
+
}
|
|
46
|
+
if (component) {
|
|
47
|
+
this.on('activate', function(...args) {
|
|
48
|
+
this.menuItem && Ext.fireEvent('nav:menuitemchange', this.menuItem);
|
|
49
|
+
component.fireEvent('activatecomponent', ...args);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
});
|