ru.coon 2.7.34 → 2.7.35

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 CHANGED
@@ -1,6 +1,11 @@
1
+ # Version 2.7.35, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8a36c677b3a30a03bfb3b7045d0c663fdf090bf3)
2
+ * update: CHANGELOG.md ([78b2a5], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/78b2a5573bdea9aede4f354a0584f5e606f7c573))
3
+
1
4
  # Version 2.7.34, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9e609fb8d3d88af639747d63fc85cbb46440ac6d)
2
5
  * ## Features
6
+ * <span style='color:green'>feat: HT-8422: custom menu for filter editing, upgrade interface</span> ([0eb548], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0eb54815eb605b638868a77b3a334e779fc62b77))
3
7
  * <span style='color:green'>feat: HT-9095: move expander left, add padding-right (expander under text), update layout on item collapse</span> ([d246e1], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d246e1c110e98959b25e8f4a976104ebb2ea8921))
8
+ * <span style='color:green'>feat: HT-8492: create new type field</span> ([6c4d96], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6c4d967fa5e3a9fc787d692a2828ba1e3c0959d3))
4
9
 
5
10
  * ## Fixes
6
11
  * <span style='color:red'> HT-8148 CopyRowsFromGrid: exportAllRows default false</span> ([9be836], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9be8360fbc00aca06777895a34279463cf1a3696))
@@ -22,6 +27,7 @@
22
27
  # Version 2.7.32, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/40925f0ca399d6d5da42511e20b8c7fa10acadaf)
23
28
  * ## Features
24
29
  * <span style='color:green'>feat: HT-8492: create new type field</span> ([0657da], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0657da1e4ba8e54a47eaca571cf71596c8107c7c))
30
+ * <span style='color:green'>feat: HT-8422: make interface</span> ([9204dc], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9204dcabf8d689acf4ec9341fe97a26193b12e23))
25
31
 
26
32
  * update: CHANGELOG.md ([1e8b7b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1e8b7b6e038fb0ea66ce786f648af3e4934afc11))
27
33
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.7.34",
7
+ "version": "2.7.35",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -183,7 +183,8 @@ Ext.define('Coon.common.component.formeditor.UiCFCellController', {
183
183
  contextMenu.showAt(event.pageX, event.pageY);
184
184
  };
185
185
  if (!Coon.UiCFFieldsConfig.menuIsLoaded) {
186
- Coon.UiCFFieldsConfig.getMenuCfgFromStorage().then((data) => {
186
+ const cnt = this.getUiCFEditorController();
187
+ Coon.UiCFFieldsConfig.getMenuCfgFromStorage(cnt.storageMenuId, cnt.defaultMenuId).then((data) => {
187
188
  doForm();
188
189
  });
189
190
  } else {
@@ -8,7 +8,7 @@ Ext.define('Coon.common.component.formeditor.UiCFConfigEditorWindow', {
8
8
  align: 'stretch',
9
9
  },
10
10
  modal: true,
11
- title: 'Редактирование конфига полей',
11
+ title: 'Справочник доступных компонентов',
12
12
  maximized: true,
13
13
  buttons: [
14
14
  {
@@ -87,7 +87,8 @@ Ext.define('Coon.common.component.formeditor.UiCFContainerController', {
87
87
  contextMenu.showAt(event.pageX, event.pageY);
88
88
  };
89
89
  if (!Coon.UiCFFieldsConfig.menuIsLoaded) {
90
- Coon.UiCFFieldsConfig.getMenuCfgFromStorage().then((data) => {
90
+ const cnt = this.getUiCFEditorController();
91
+ Coon.UiCFFieldsConfig.getMenuCfgFromStorage(cnt.storageMenuId, cnt.defaultMenuId).then((data) => {
91
92
  doForm();
92
93
  });
93
94
  } else {
@@ -200,15 +201,15 @@ Ext.define('Coon.common.component.formeditor.UiCFContainerController', {
200
201
 
201
202
  getMenuItems(activeRow) {
202
203
  const me = this;
204
+ const cnt = this.getUiCFEditorController();
203
205
  const menuItems = [
204
206
  {
205
207
  text: 'добавить', iconCls: 'fa fa-plus',
206
- menu: Coon.UiCFFieldsConfig.getMenuCfg(me, 'addRow', activeRow),
208
+ menu: Coon.UiCFFieldsConfig.getMenuCfg(me, 'addRow', activeRow, cnt.defaultMenuId),
207
209
  }
208
210
  ];
209
211
  // me.addRow(item.type, activeRow);
210
212
 
211
- const cnt = this.getUiCFEditorController();
212
213
  const cell = cnt.copyCell || cnt.cutCell;
213
214
  if (cell && cell.getView() && cell.getView().id !== this.getView().id) {
214
215
  menuItems[0].menu.push({
@@ -5,6 +5,7 @@ Ext.define('Coon.common.component.formeditor.UiCFFieldsConfig', {
5
5
  storageElem: null,
6
6
  settingsIsLoaded: false,
7
7
  storageMenuId: 'UiCFMenuCfg',
8
+ menuId: 'formEditorMenu',
8
9
  storageMenu: null,
9
10
  menuIsLoaded: false,
10
11
  propsCfg: {},
@@ -60,8 +61,9 @@ Ext.define('Coon.common.component.formeditor.UiCFFieldsConfig', {
60
61
  this.UiCFMenuConfig = cfg;
61
62
  }
62
63
  },
63
- getMenuCfgFromStorage() {
64
- return Coon.util.promisifyCmd('command.GetUIElementCommand', this.storageMenuId).then((data) => {
64
+ getMenuCfgFromStorage(storageMenuId, menuId) {
65
+ return Coon.util.promisifyCmd('command.GetUIElementCommand',
66
+ storageMenuId ? storageMenuId : this.storageMenuId).then((data) => {
65
67
  this.storageMenu = data;
66
68
  this.applyMenuCfg(data && data.propertyData ? JSON.parse(data.propertyData) :{});
67
69
  this.menuIsLoaded = true;
@@ -70,74 +72,144 @@ Ext.define('Coon.common.component.formeditor.UiCFFieldsConfig', {
70
72
  Ext.Msg.alert('Ошибка', error.toString());
71
73
  });
72
74
  },
73
- setMenuCfgToStorage(cfg) {
74
- this.storageMenu.propertyData = JSON.stringify(cfg || {});
75
- return Coon.util.promisifyCmd('command.SaveUIElementCommand', this.storageMenu).catch((error) => {
75
+ setMenuCfgToStorage(cfg, storageMenuId, menuId) {
76
+ if (menuId) {
77
+ const oldCfg = JSON.parse(this.storageMenu.propertyData);
78
+ if (Ext.isObject(oldCfg) && oldCfg[menuId]) {
79
+ oldCfg[menuId] = cfg;
80
+ this.storageMenu.propertyData = JSON.stringify(oldCfg || {});
81
+ } else {
82
+ this.storageMenu.propertyData = JSON.stringify(cfg || {});
83
+ }
84
+ } else {
85
+ this.storageMenu.propertyData = JSON.stringify(cfg || {});
86
+ }
87
+ return Coon.util.promisifyCmd('command.SaveUIElementCommand',
88
+ storageMenuId ? storageMenuId : this.storageMenu).catch((error) => {
76
89
  Coon.log.debug(error);
77
90
  Ext.Msg.alert('Ошибка', error.toString());
78
91
  });
79
92
  },
80
93
  UiCFMenuConfig: {
81
- expanded: true,
82
- text: 'Структура меню',
83
- fields: [],
84
- children: [
85
- {
86
- text: 'Избранное',
87
- leaf: true,
88
- expanded: true,
89
- fields: [],
90
- tag: 'favorite',
91
- children: [
92
- ],
93
- },
94
- {
95
- text: 'Поля ввода',
96
- leaf: false,
97
- expanded: true,
98
- fields: [],
99
- children: [
100
- {
101
- text: 'Бизнес-поля',
102
- leaf: true,
103
- fields: [],
104
- }
105
- ],
106
- },
107
- {
108
- text: 'Выбор из списка',
109
- leaf: false,
110
- fields: [],
111
- expanded: true,
112
- children: [
113
- {
114
- text: 'Чекбокс',
115
- fields: [],
116
- leaf: true,
117
- },
118
- {
119
- text: 'Радио',
120
- fields: [],
121
- leaf: true,
122
- },
123
- {
124
- text: 'Выбор из отчета',
125
- fields: [],
126
- leaf: true,
127
- }
128
- ],
129
- },
130
- {
131
- text: 'Группировка полей',
132
- fields: [],
133
- leaf: true,
134
- },
135
- {
136
- text: 'Оформление задания',
137
- fields: [],
138
- leaf: true,
139
- }
140
- ],
94
+ formEditorMenu: {
95
+ expanded: true,
96
+ text: 'Структура меню',
97
+ fields: [],
98
+ children: [
99
+ {
100
+ text: 'Избранное',
101
+ leaf: true,
102
+ expanded: true,
103
+ fields: [],
104
+ tag: 'favorite',
105
+ children: [
106
+ ],
107
+ },
108
+ {
109
+ text: 'Поля ввода',
110
+ leaf: false,
111
+ expanded: true,
112
+ fields: [],
113
+ children: [
114
+ {
115
+ text: 'Бизнес-поля',
116
+ leaf: true,
117
+ fields: [],
118
+ }
119
+ ],
120
+ },
121
+ {
122
+ text: 'Выбор из списка',
123
+ leaf: false,
124
+ fields: [],
125
+ expanded: true,
126
+ children: [
127
+ {
128
+ text: 'Чекбокс',
129
+ fields: [],
130
+ leaf: true,
131
+ },
132
+ {
133
+ text: 'Радио',
134
+ fields: [],
135
+ leaf: true,
136
+ },
137
+ {
138
+ text: 'Выбор из отчета',
139
+ fields: [],
140
+ leaf: true,
141
+ }
142
+ ],
143
+ },
144
+ {
145
+ text: 'Группировка полей',
146
+ fields: [],
147
+ leaf: true,
148
+ },
149
+ {
150
+ text: 'Оформление задания',
151
+ fields: [],
152
+ leaf: true,
153
+ }
154
+ ],
155
+ },
156
+ filterFormEditorMenu: {
157
+ expanded: true,
158
+ text: 'Структура меню',
159
+ fields: [],
160
+ children: [
161
+ {
162
+ text: 'Избранное',
163
+ leaf: true,
164
+ expanded: true,
165
+ fields: [],
166
+ tag: 'favorite',
167
+ children: [
168
+ ],
169
+ },
170
+ {
171
+ text: 'Поля ввода',
172
+ leaf: false,
173
+ expanded: true,
174
+ fields: [],
175
+ children: [
176
+ {
177
+ text: 'Бизнес-поля',
178
+ leaf: true,
179
+ fields: [],
180
+ }
181
+ ],
182
+ },
183
+ {
184
+ text: 'Выбор из списка',
185
+ leaf: false,
186
+ fields: [],
187
+ expanded: true,
188
+ children: [
189
+ {
190
+ text: 'Чекбокс',
191
+ fields: [],
192
+ leaf: true,
193
+ },
194
+ {
195
+ text: 'Радио',
196
+ fields: [],
197
+ leaf: true,
198
+ },
199
+ {
200
+ text: 'Выбор из отчета',
201
+ fields: [],
202
+ leaf: true,
203
+ }
204
+ ],
205
+ },
206
+ {
207
+ text: 'Группировка полей',
208
+ fields: [],
209
+ leaf: true,
210
+ }
211
+ ],
212
+ },
141
213
  },
142
214
  UiCFFieldsConfig: {
143
215
  textfield: {
@@ -426,8 +498,8 @@ Ext.define('Coon.common.component.formeditor.UiCFFieldsConfig', {
426
498
  description: 'Изображение',
427
499
  },
428
500
  },
429
- getMenuStructure() {
430
- return this.UiCFMenuConfig;
501
+ getMenuStructure(menuId) {
502
+ return this.UiCFMenuConfig[menuId ? menuId : this.menuId];
431
503
  },
432
504
  getFieldsTypes() {
433
505
  return Object.keys(this.UiCFFieldsConfig).map((key) => {
@@ -476,15 +548,17 @@ Ext.define('Coon.common.component.formeditor.UiCFFieldsConfig', {
476
548
  getFavoriteItemsName() {
477
549
  return localStorage.getItem(this.favoriteMenuItemsPath) ? localStorage.getItem(this.favoriteMenuItemsPath).split(',') : []; ;
478
550
  },
479
- getMenuCfg(scope, fn, active) {
551
+ getMenuCfg(scope, fn, active, menuId) {
480
552
  if (!this.UiCFMenuConfig) {
481
553
  return [];
482
554
  }
483
555
  const favorites = this.getFavoriteItemsName();
484
556
  let cfg = [];
485
557
  const me = this;
486
- if (this.UiCFMenuConfig.fields && this.UiCFMenuConfig.fields.length) {
487
- this.UiCFMenuConfig.fields.forEach((field) => {
558
+ menuId = menuId ? menuId : this.menuId;
559
+ const menu = this.UiCFMenuConfig[menuId];
560
+ if (menu.fields && menu.fields.length) {
561
+ menu.fields.forEach((field) => {
488
562
  cfg.push({
489
563
  text: this.getFieldDescription(field),
490
564
  xtype: 'UiCFFavoriteMenuItem',
@@ -502,8 +576,8 @@ Ext.define('Coon.common.component.formeditor.UiCFFieldsConfig', {
502
576
  });
503
577
  });
504
578
  }
505
- if (this.UiCFMenuConfig.children && this.UiCFMenuConfig.children.length) {
506
- cfg = cfg.concat(this.getMenuRecursive(this.UiCFMenuConfig.children, scope, fn, active));
579
+ if (menu.children && menu.children.length) {
580
+ cfg = cfg.concat(this.getMenuRecursive(menu.children, scope, fn, active));
507
581
  }
508
582
  return cfg;
509
583
  },
@@ -1,6 +1,7 @@
1
1
  /* global Ext */
2
2
  Ext.define('Coon.common.component.formeditor.UiCFMenuEditorWindow', {
3
3
  extend: 'Ext.window.Window',
4
+ defaultMenuId: undefined,
4
5
  xtype: 'UiCFMenuEditorWindow',
5
6
  cls: 'UiCFMenuEditorWindow',
6
7
  controller: 'UiCFMenuEditorWindowController',
@@ -9,7 +10,7 @@ Ext.define('Coon.common.component.formeditor.UiCFMenuEditorWindow', {
9
10
  align: 'stretch',
10
11
  },
11
12
  modal: true,
12
- title: 'Редактирование структуры меню',
13
+ title: 'Настройка компонентов меню',
13
14
  maximized: true,
14
15
  buttons: [
15
16
  {
@@ -1,11 +1,12 @@
1
1
  Ext.define('Coon.common.component.formeditor.UiCFMenuEditorWindowController', {
2
2
  extend: 'Ext.app.ViewController',
3
3
  alias: 'controller.UiCFMenuEditorWindowController',
4
+ defaultMenuId: undefined,
4
5
  init: function(view) {
5
6
  const vm = this.getViewModel();
6
-
7
+ this.defaultMenuId = view.defaultMenuId;
7
8
  const doForm = () => {
8
- const structure = JSON.parse(JSON.stringify(Coon.UiCFFieldsConfig.getMenuStructure()));
9
+ const structure = JSON.parse(JSON.stringify(Coon.UiCFFieldsConfig.getMenuStructure(this.defaultMenuId)));
9
10
  structure.children.splice(0, 1);
10
11
  structure.children.push(Coon.UiCFFieldsConfig.unusedMenuItem);
11
12
  vm.getStore('menuStore').setRoot(structure);
@@ -111,8 +112,8 @@ Ext.define('Coon.common.component.formeditor.UiCFMenuEditorWindowController', {
111
112
  const savedValues = this.getMenuCfg(this.getViewModel().getStore('menuStore').getRoot().getData());
112
113
  savedValues.children.splice(0, 0, Coon.UiCFFieldsConfig.favoriteMenuItem);
113
114
  this.getView().mask('Подождите, идет сохранение');
114
- Coon.UiCFFieldsConfig.setMenuCfgToStorage(savedValues).then(() => {
115
- Coon.UiCFFieldsConfig.UiCFMenuConfig = savedValues;
115
+ Coon.UiCFFieldsConfig.setMenuCfgToStorage(savedValues, null, this.defaultMenuId).then(() => {
116
+ Coon.UiCFFieldsConfig.UiCFMenuConfig[this.defaultMenuId || Coon.UiCFFieldsConfig.menuId] = savedValues;
116
117
  this.getView().unmask();
117
118
  this.closeWindow();
118
119
  });
@@ -7,6 +7,7 @@ Ext.define('Coon.common.component.formeditor.UiCFPropertiesChooseWindow', {
7
7
  maximized: false,
8
8
  width: 300,
9
9
  height: '90%',
10
+ layout: 'fit',
10
11
  controller: {
11
12
  init(view) {
12
13
  if (view.initialConfig && view.initialConfig.unusedProps && view.initialConfig.unusedProps.length) {
@@ -49,6 +50,7 @@ Ext.define('Coon.common.component.formeditor.UiCFPropertiesChooseWindow', {
49
50
  items: [
50
51
  {
51
52
  xtype: 'grid',
53
+ scrollable: 'y',
52
54
  selModel: {
53
55
  selType: 'rowmodel',
54
56
  mode: 'MULTI',
@@ -19,11 +19,15 @@ Ext.define('Coon.common.component.formeditor.UiCFRowController', {
19
19
  getRowIndex() {
20
20
  return this.getUiCFContainerController().getRowIndex(this.getView());
21
21
  },
22
+ getUiCFEditorController() {
23
+ return this.getView().up('UiCustomFormEditor').getController();
24
+ },
22
25
  getMenuItems(activeCell) {
23
26
  const me = this;
27
+ const cnt = this.getUiCFEditorController();
24
28
  const menuItems = [{
25
29
  text: 'в строку', iconCls: 'fa fa-plus',
26
- menu: Coon.UiCFFieldsConfig.getMenuCfg(me, 'addCell', activeCell),
30
+ menu: Coon.UiCFFieldsConfig.getMenuCfg(me, 'addCell', activeCell, cnt.defaultMenuId),
27
31
  }];
28
32
  // me.addCell(item.type, activeCell);
29
33
  const count = this.getCountRows();
@@ -14,6 +14,7 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
14
14
  UI_ELEMENT_CD: null,
15
15
  description: null,
16
16
  configStoreSelection: null,
17
+ settingsText: 'Настройки',
17
18
  },
18
19
  stores: {
19
20
  configStore: {
@@ -63,12 +64,16 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
63
64
  },
64
65
  {
65
66
  xtype: 'panel',
66
- title: 'Доп настройки',
67
+ collapsible: true,
68
+ collapsed: true,
69
+ title: 'Дополнительные настройки',
67
70
  height: 200,
68
71
  layout: 'fit',
69
72
  items: [
70
73
  {
71
- xtype: 'UiAceEditorField',
74
+ xtype: 'UiAceEditor',
75
+ flex: true,
76
+ scrollable: 'y',
72
77
  reference: 'rawValueField',
73
78
  margin: '5px 0',
74
79
  bind: {
@@ -131,6 +136,7 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
131
136
  },
132
137
  columns: [
133
138
  {text: 'Переменная', dataIndex: 'property', flex: 1, filter: {type: 'string'}},
139
+ {text: 'Заголовок', dataIndex: 'title', editor: {xtype: 'textfield'}, flex: 1, filter: {type: 'string'}},
134
140
  {
135
141
  text: 'Тип',
136
142
  dataIndex: 'type',
@@ -144,10 +150,7 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
144
150
  valueField: 'key',
145
151
  },
146
152
  flex: 1,
147
- },
148
- {text: 'Заголовок', dataIndex: 'title', editor: {xtype: 'textfield'}, flex: 1, filter: {type: 'string'}}
149
- /* {text: '№', dataIndex: 'order', editor: {xtype: 'numberfield'}, width: 30}*/
150
- /* {text: 'Описание', dataIndex: 'description', editor: {xtype: 'textfield'}, flex: 1}*/
153
+ }
151
154
  ],
152
155
  plugins: [
153
156
  {ptype: 'cellediting', clicksToEdit: 2},
@@ -174,8 +177,10 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
174
177
  collapseMode: 'header',
175
178
  collapsed: true,
176
179
  header: {
177
- iconCls: 'x-fa fa-th',
178
180
  title: 'Настройки',
181
+ bind: {
182
+ title: '{settingsText}',
183
+ },
179
184
  },
180
185
  bind: {
181
186
  activeItem: '{activeForm}',
@@ -183,19 +188,22 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
183
188
  tools: [
184
189
  {
185
190
  iconCls: 'fa fa-columns',
191
+ tooltip: 'Задать количество колонок',
186
192
  callback: 'fieldsToCols',
187
193
  },
188
- {
194
+ /* {
189
195
  iconCls: 'fa fa-sitemap',
190
196
  callback: 'openMenuEditorWindow',
191
197
  },
192
198
  {
193
199
  iconCls: 'fa fa-cog',
200
+
194
201
  callback: 'openConfigEditorWindow',
195
- },
202
+ },*/
196
203
  {
197
204
  iconCls: 'fa fa-eye',
198
205
  hidden: true,
206
+ tooltip: 'Отобразить скрытые поля',
199
207
  bind: {
200
208
  hidden: '{viewMode === true}',
201
209
  },
@@ -206,6 +214,7 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
206
214
  {
207
215
  iconCls: 'fa fa-eye-slash',
208
216
  hidden: true,
217
+ tooltip: 'Убрать скрытые поля',
209
218
  bind: {
210
219
  hidden: '{viewMode === false}',
211
220
  },
@@ -215,6 +224,7 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
215
224
  },
216
225
  {
217
226
  iconCls: 'fa fa-cogs', // Reply icon
227
+ tooltip: 'Управление настройками поля',
218
228
  bind: {
219
229
  hidden: '{activeForm !== 0}',
220
230
  },
@@ -224,6 +234,7 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
224
234
  },
225
235
  {
226
236
  iconCls: 'fa fa-reply', // Reply icon
237
+ tooltip: 'Вернуться к настройкам',
227
238
  hidden: true,
228
239
  bind: {
229
240
  hidden: '{activeForm !== 1}',
@@ -235,6 +246,7 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditor', {
235
246
  {
236
247
  type: 'pin',
237
248
  itemId: 'pinned',
249
+ tooltip: 'Закрепить/открепить панель',
238
250
  callback(view, tool) {
239
251
  if (tool.type === 'pin') {
240
252
  tool.setType('unpin');
@@ -7,14 +7,17 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditorController', {
7
7
  id: null,
8
8
  description: null,
9
9
  },
10
+ defaultMenuId: undefined/* 'filterFormEditorMenu'*/,
11
+ storageMenuId: undefined,
10
12
  activeResizer: null,
11
13
  paramsList: {},
12
14
  init(view) {
13
15
  view.doInit = this.doInit.bind(this);
16
+ this.defaultMenuId = view.defaultMenuId ? view.defaultMenuId : undefined;
14
17
  this.getViewModel().bind('{viewMode}', 'changeViewMode', this);
15
18
  this.getViewModel().bind('{description}', (description) => {
16
19
  const window = this.getView().up('WindowWrap');
17
- if (window) {
20
+ if (window && !this.defaultMenuId) {
18
21
  window.setTitle(description ? 'Редактирование формы ' + description : 'Создание новой формы');
19
22
  }
20
23
  }, this);
@@ -59,8 +62,10 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditorController', {
59
62
  }
60
63
  return cfg;
61
64
  },
62
- openMenuEditorWindow() {
63
- const window = Ext.create('Coon.common.component.formeditor.UiCFMenuEditorWindow');
65
+ openMenuEditorWindow(defaultMenuId) {
66
+ const window = Ext.create('Coon.common.component.formeditor.UiCFMenuEditorWindow', {
67
+ defaultMenuId: defaultMenuId,
68
+ });
64
69
  window.show();
65
70
  },
66
71
  openConfigEditorWindow() {
@@ -115,26 +120,84 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditorController', {
115
120
  },
116
121
  showWindowWrapTools() {
117
122
  const me = this;
123
+ let mountCmp = undefined;
118
124
  if (this.getView().up().xtype === 'WindowWrap') {
119
- const header = this.getView().up().header;
120
- Ext.ComponentQuery.query('[dataType=widgetPanelBtn]', header).map((item) => {
125
+ mountCmp = this.getView().up().header;
126
+ Ext.ComponentQuery.query('[dataType=widgetPanelBtn]', mountCmp).map((item) => {
121
127
  item.destroy();
122
128
  });
123
- this.getView().up().header.insert(1, {
129
+ mountCmp.insert(1, {
130
+ xtype: 'tool',
131
+ tooltip: 'Справочник доступных компонентов',
132
+ dataType: 'widgetPanelBtn',
133
+ reference: 'componentsKlsToolButton',
134
+ handler: me.openConfigEditorWindow.bind(me),
135
+ style: {
136
+ marginRight: '5px',
137
+ },
138
+ iconCls: 'svg-icon-tool svg-icon-apps',
139
+ });
140
+ mountCmp.insert(2, {
141
+ xtype: 'tool',
142
+ tooltip: 'Настройка компонентов меню',
143
+ dataType: 'widgetPanelBtn',
144
+ reference: 'menuEditorToolButton',
145
+ handler: me.openMenuEditorWindow.bind(me, this.defaultMenuId),
146
+ iconCls: 'svg-icon-tool svg-icon-flow-chart',
147
+ style: {
148
+ marginRight: '5px',
149
+ },
150
+ });
151
+ mountCmp.insert(3, {
124
152
  xtype: 'tool',
125
153
  tooltip: 'Сохранить',
126
154
  dataType: 'widgetPanelBtn',
127
155
  reference: 'saveToolButton',
128
156
  handler: me.saveForm.bind(me),
129
157
  iconCls: 'svg-icon-tool svg-icon-save-view',
158
+ style: {
159
+ marginRight: '5px',
160
+ },
130
161
  });
131
- this.getView().up().header.insert(2, {
162
+ mountCmp.insert(4, {
132
163
  xtype: 'tool',
133
164
  dataType: 'widgetPanelBtn',
134
- tooltip: 'Настройки',
165
+ tooltip: 'Настройки редактируемой формы',
135
166
  handler: me.onSettingsClick.bind(me),
136
167
  iconCls: 'svg-icon-tool svg-icon-settings',
168
+ style: {
169
+ marginRight: '5px',
170
+ },
137
171
  });
172
+ } else {
173
+ const query = this.getView().up().query('[reference="mountButtons"]');
174
+ if (query && query.length) {
175
+ mountCmp = query[0];
176
+ Ext.ComponentQuery.query('[dataType=widgetPanelBtn]', mountCmp).map((item) => {
177
+ item.destroy();
178
+ });
179
+ mountCmp.add([{
180
+ xtype: 'tool',
181
+ tooltip: 'Справочник доступных компонентов',
182
+ dataType: 'widgetPanelBtn',
183
+ reference: 'componentsKlsToolButton',
184
+ handler: me.openConfigEditorWindow.bind(me),
185
+ style: {
186
+ marginRight: '5px',
187
+ },
188
+ iconCls: 'svg-icon svg-icon-apps',
189
+ }, {
190
+ xtype: 'tool',
191
+ tooltip: 'Настройка компонентов меню',
192
+ dataType: 'widgetPanelBtn',
193
+ reference: 'menuEditorToolButton',
194
+ handler: me.openMenuEditorWindow.bind(me, this.defaultMenuId),
195
+ iconCls: 'svg-icon svg-icon-flow-chart',
196
+ style: {
197
+ marginRight: '5px',
198
+ },
199
+ }]);
200
+ }
138
201
  }
139
202
  },
140
203
  applySettings() {
@@ -498,10 +561,14 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditorController', {
498
561
  form.removeAll();
499
562
  rawValueField.setValue('{}');
500
563
  if (field) {
564
+ this.getViewModel().set('settingsText', `Настройки ${field.xtype}`);
501
565
  field.up('UiCFCell').getController().setResizer();
502
566
  this.getViewModel().set('focusedFieldXType', field.xtype);
503
567
  if (Ext.isObject(field.rawCfg)) {
504
- rawValueField.setValue(JSON.stringify(field.rawCfg));
568
+ rawValueField.setValue(JSON5.stringify(field.rawCfg, {
569
+ space: 4,
570
+ quote: '\'',
571
+ }));
505
572
  }
506
573
 
507
574
  const doForm = () => {
@@ -666,6 +733,7 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditorController', {
666
733
  });
667
734
  break;
668
735
  }
736
+ fieldCfg.fieldLabel = `${fieldCfg.name} - ${fieldCfg.fieldLabel || fieldCfg.boxLabel}`;
669
737
  form.add(fieldCfg);
670
738
  });
671
739
  }
@@ -679,6 +747,7 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditorController', {
679
747
  }
680
748
  } else {
681
749
  this.getViewModel().set('focusedFieldXType', null);
750
+ this.getViewModel().set('settingsText', `Настройки`);
682
751
  if (this.activeResizer) {
683
752
  this.activeResizer.destroy();
684
753
  this.activeResizer = null;
@@ -773,21 +842,28 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditorController', {
773
842
  const props = this.getAllProperties(field.xtype).concat(Object.keys(ownCfg));
774
843
  const fieldCfg = Coon.UiCFFieldsConfig.getFieldUserCfg(field.xtype);
775
844
  const usedProps = this.lookup('configGrid').getStore().getRange().map((item) => item.get('property'));
776
- const data = props.sort().filter((item) => usedProps.indexOf(item) < 0).map((item) => {
777
- return {
778
- key: field.xtype,
779
- visible: typeof fieldCfg[item] !== 'undefined' ? true : false,
780
- property: item,
781
- title: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['description'] :
782
- typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['description'] : '',
783
- description: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['text'] :
784
- typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['text'] : '',
785
- type: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['type'] :
786
- typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['type'] : this.detectPropertyType(field[item]),
787
- order: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['order'] :
788
- typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['order'] : '',
789
- };
790
- });
845
+ const data =Object.values(
846
+ props.sort().filter((item) => usedProps.indexOf(item) < 0).map((item) => {
847
+ return {
848
+ key: field.xtype,
849
+ visible: typeof fieldCfg[item] !== 'undefined' ? true : false,
850
+ property: item,
851
+ title: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['description'] :
852
+ typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['description'] : '',
853
+ description: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['text'] :
854
+ typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['text'] : '',
855
+ type: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['type'] :
856
+ typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['type'] : this.detectPropertyType(field[item]),
857
+ order: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['order'] :
858
+ typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['order'] : '',
859
+ };
860
+ }).reduce((c, e) => {
861
+ if (!c[e.property]) {
862
+ c[e.property] = e;
863
+ }
864
+ return c;
865
+ }, {})
866
+ );
791
867
  if (!data.length) {
792
868
  return false;
793
869
  }
@@ -829,21 +905,28 @@ Ext.define('Coon.common.component.formeditor.UiCustomFormEditorController', {
829
905
  const ownCfg = Coon.UiCFFieldsConfig.getOwnProperties(field.xtype);
830
906
  const props = this.getAllProperties(field.xtype).concat(Object.keys(ownCfg));
831
907
  const fieldCfg = Coon.UiCFFieldsConfig.getFieldUserCfg(field.xtype);
832
- const data = props.filter((item) => typeof fieldCfg[item] !== 'undefined').map((item) => {
833
- return {
834
- key: field.xtype,
835
- visible: typeof fieldCfg[item] !== 'undefined' ? true : false,
836
- property: item,
837
- title: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['description'] :
838
- typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['description'] : '',
839
- description: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['text'] :
840
- typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['text'] : '',
841
- type: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['type'] :
842
- typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['type'] : this.detectPropertyType(field[item]),
843
- order: typeof fieldCfg[item] !== 'undefined' && fieldCfg[item]['order'] >= 0 ? fieldCfg[item]['order'] :
844
- typeof ownCfg[item] !== 'undefined' && ownCfg[item]['order'] >= 0 ? ownCfg[item]['order'] : 1000,
845
- };
846
- });
908
+ const data = Object.values(
909
+ props.filter((item) => typeof fieldCfg[item] !== 'undefined').map((item) => {
910
+ return {
911
+ key: field.xtype,
912
+ visible: typeof fieldCfg[item] !== 'undefined' ? true : false,
913
+ property: item,
914
+ title: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['description'] :
915
+ typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['description'] : '',
916
+ description: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['text'] :
917
+ typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['text'] : '',
918
+ type: typeof fieldCfg[item] !== 'undefined' ? fieldCfg[item]['type'] :
919
+ typeof ownCfg[item] !== 'undefined' ? ownCfg[item]['type'] : this.detectPropertyType(field[item]),
920
+ order: typeof fieldCfg[item] !== 'undefined' && fieldCfg[item]['order'] >= 0 ? fieldCfg[item]['order'] :
921
+ typeof ownCfg[item] !== 'undefined' && ownCfg[item]['order'] >= 0 ? ownCfg[item]['order'] : 1000,
922
+ };
923
+ }).reduce((c, e) => {
924
+ if (!c[e.property]) {
925
+ c[e.property] = e;
926
+ }
927
+ return c;
928
+ }, {})
929
+ );
847
930
  data.sort((a, b) => (a.order > b.order) ? 1 : ((b.order > a.order) ? -1 : 0));
848
931
  store.loadData(data);
849
932
  };
@@ -15,14 +15,20 @@ Ext.define('Coon.report.plugin.configPanel.FilterFormEditingPluginConfigPanel',
15
15
  scrollable: true,
16
16
  createItems: function() {
17
17
  this.layout = 'fit';
18
- this.tbar = [{
19
- text: 'Сравнить',
20
- handler: this.onCompareClick.bind(this),
21
- }, {
22
- text: 'Заполнить из параметров',
23
- handler: this.onResetClick.bind(this),
24
- }];
25
- return [{reference: 'editor', xtype: 'UiCustomFormEditor'}];
18
+ this.tbar ={
19
+ reference: 'mountButtons',
20
+ items: [
21
+ {
22
+ text: 'Сравнить',
23
+ handler: this.onCompareClick.bind(this),
24
+ }, {
25
+ text: 'Заполнить из параметров',
26
+ handler: this.onResetClick.bind(this),
27
+ },
28
+ {xtype: 'tbfill'}
29
+ ],
30
+ };
31
+ return [{reference: 'editor', xtype: 'UiCustomFormEditor', defaultMenuId: 'filterFormEditorMenu'}];
26
32
  },
27
33
  onResetClick() {
28
34
  const me = this;
@@ -141,7 +147,6 @@ Ext.define('Coon.report.plugin.configPanel.FilterFormEditingPluginConfigPanel',
141
147
  addItem(fieldName) {
142
148
  const vm = this.up('ReportFormEditPanel').getViewModel();
143
149
  const parameters = vm.get('report.parameters');
144
- // const countCols = this.getCountCols();
145
150
  if (parameters && parameters.length) {
146
151
  const field = this.createFilterItem(this.createFieldCfg([parameters.find((param) => param.reportParameterCd === fieldName)]).pop());
147
152
  const formContainer = this.editor.down('UiCFContainer');
@@ -217,7 +222,6 @@ Ext.define('Coon.report.plugin.configPanel.FilterFormEditingPluginConfigPanel',
217
222
  generateFields() {
218
223
  const vm = this.up('ReportFormEditPanel').getViewModel();
219
224
  const parameters = vm.get('report.parameters');
220
- // const countCols = this.getCountCols();
221
225
  if (parameters && parameters.length) {
222
226
  const data = this.createFieldCfg(parameters);
223
227
  let tpl = '{"xtype":"UiCFContainer","cls":"UiCFContainer","items":[';
@@ -394,10 +398,4 @@ Ext.define('Coon.report.plugin.configPanel.FilterFormEditingPluginConfigPanel',
394
398
  }*/
395
399
  return config;
396
400
  },
397
- getCountCols() {
398
- const vm = this.up('ReportFormEditPanel').getViewModel();
399
- const properties = vm.get('report.properties');
400
- const cols = properties.find((prop) => prop.key === 'filterItemsOnRow');
401
- return cols ? cols.value : false;
402
- },
403
401
  });
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.7.34',
3
+ number: '2.7.35',
4
4
  });
@@ -1,5 +0,0 @@
1
- Ext.define('Coon.common.field.checkbox.RoundCheckbox', {
2
- extend: 'Ext.form.field.Checkbox',
3
- cls: 'RoundCheckbox',
4
- xtype: ['roundcheckbox', 'RoundCheckbox'],
5
- });
@@ -1,48 +0,0 @@
1
- .x-form-fieldCheckbox {
2
- .x-form-field {
3
- position: relative;
4
- }
5
-
6
- .x-form-field label {
7
- background-color: #fff;
8
- border: 1px solid #ccc;
9
- border-radius: 50%;
10
- cursor: pointer;
11
- height: 28px;
12
- left: 0;
13
- position: absolute;
14
- top: 0;
15
- width: 28px;
16
- }
17
-
18
- .x-form-field label:after {
19
- border: 2px solid #fff;
20
- border-top: none;
21
- border-right: none;
22
- content: "";
23
- height: 6px;
24
- left: 7px;
25
- opacity: 0;
26
- position: absolute;
27
- top: 8px;
28
- transform: rotate(-45deg);
29
- width: 12px;
30
- }
31
-
32
- .x-form-field input[type="checkbox"] {
33
- visibility: hidden;
34
- }
35
-
36
- .x-form-field input[type="checkbox"]:checked + label {
37
- background-color: #66bb6a;
38
- border-color: #66bb6a;
39
- }
40
-
41
- .x-form-field input[type="checkbox"]:checked + label:after {
42
- opacity: 1;
43
- }
44
-
45
- .x-form-item-body, .x-form-cb-wrap-inner {
46
- margin: 0 auto;
47
- }
48
- }
@@ -1,23 +0,0 @@
1
- Ext.define('Coon.nav.MenuLoader', {
2
- singleton: true,
3
-
4
- isLoaded: false,
5
-
6
- load() {
7
- return Coon.util.promisifyCmd('command.GetDynamicReportDataCommand', 'MENU_ALLITEMS')
8
- .then((data) => {
9
- if (Array.isArray(data.list)) {
10
- this.uiElementMap = data.list.reduce();
11
- }
12
- this.isLoaded = true;
13
- });
14
- },
15
-
16
- get() {
17
-
18
- },
19
-
20
- isValidMenuItem(uiEmentId) {
21
- return this.uiElementMap.has(uiEmentId);
22
- },
23
- });
@@ -1,7 +0,0 @@
1
- **спецификация:**
2
-
3
- входные параметры:
4
-
5
- - exportFileFormat [xls/pdf]
6
- - allowUserSelectColumnsToUpload
7
- - addToSearchButton добавить в кнопку "поиск", в этом случае в качестве параметра отправляем текущие параметры из FilterPanel(useRawFilterParams: true)