ru.coon 2.6.5 → 2.6.7
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 +25 -0
- package/index.js +0 -1
- package/package.json +2 -2
- package/src/Function.js +1 -1
- package/src/common/component/characteristic/characteristicGroup/EditorOptionsWindow.js +150 -0
- package/src/common/component/characteristic/characteristicGroup/EditorOptionsWindowController.js +174 -0
- package/src/common/component/characteristic/characteristicGroup/EntityGroupCharacteristicEditor.js +23 -0
- package/src/common/component/characteristic/characteristicGroup/EntityGroupCharacteristicEditorController.js +38 -0
- package/src/common/component/editor/CharacteristicGridEditor.js +3 -0
- package/src/common/component/editor/TypedCharacteristicEditor.js +0 -5
- package/src/common/component/editor/creators/BaseEditorCreator.js +0 -3
- package/src/common/component/editor/creators/ByReportEditorCreator.js +0 -3
- package/src/common/component/editor/creators/CustomPanelEditorCreator.js +0 -3
- package/src/common/component/editor/creators/ForeignKeyEditorCreator.js +0 -3
- package/src/common/component/editor/creators/NoteEditorCreator.js +0 -3
- package/src/common/component/editor/creators/NumberEditorCreator.js +17 -4
- package/src/common/component/editor/creators/SimpleReportEditorCreator.js +0 -3
- package/src/common/component/editor/creators/TriggerFieldEditorCreator.js +0 -3
- package/src/common/component/formeditor/UiCFCard.js +86 -0
- package/src/common/component/formeditor/UiCFCardsGrid.js +69 -0
- package/src/common/component/formeditor/UiCFCell.js +12 -0
- package/src/common/component/formeditor/UiCFCellController.js +236 -0
- package/src/common/component/formeditor/UiCFCheckboxGroup.js +53 -0
- package/src/common/component/formeditor/UiCFContainer.js +15 -0
- package/src/common/component/formeditor/UiCFContainerController.js +217 -0
- package/src/common/component/formeditor/UiCFFieldsConfig.js +342 -0
- package/src/common/component/formeditor/UiCFRadioGrid.js +70 -0
- package/src/common/component/formeditor/UiCFRadioGroup.js +53 -0
- package/src/common/component/formeditor/UiCFReportField.js +48 -0
- package/src/common/component/formeditor/UiCFRow.js +13 -0
- package/src/common/component/formeditor/UiCFRowController.js +155 -0
- package/src/common/component/formeditor/UiCFSegmentedButton.js +62 -0
- package/src/common/component/formeditor/UiCFSegmentedButtonGrid.js +70 -0
- package/src/common/component/formeditor/UiCFSettingsWindow.js +62 -0
- package/src/common/component/formeditor/UiCFSpacer.js +8 -0
- package/src/common/component/formeditor/UiCFTab.js +51 -0
- package/src/common/component/formeditor/UiCustomForm.js +33 -0
- package/src/common/component/formeditor/UiCustomFormController.js +6 -0
- package/src/common/component/formeditor/UiCustomFormEditor.js +191 -0
- package/src/common/component/formeditor/UiCustomFormEditor.scss +13 -0
- package/src/common/component/formeditor/UiCustomFormEditorController.js +654 -0
- package/src/common/component/formeditor/UiCustomFormEditorView.js +7 -0
- package/src/report/component/settings/plugin/ReportFormPluginPanelController.js +1 -1
- package/src/report/plugin/grid/ReportColumnStatePlugin.js +18 -2
- package/src/uielement/component/SearchByPropCombo.js +53 -0
- package/src/uielement/plugin/UnifiedButtonToolbarPlugin.js +19 -2
- package/src/uielement/plugin/configPanel/MethodChainPluginConfigPanelFormEditor.js +10 -6
- package/src/uielement/plugin/configPanel/UnifiedButtonToolbarPluginConfigPanelFormEditor.js +34 -46
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,23 @@
|
|
|
1
|
+
# Version 2.6.7, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6802942bc71e923767f61cfc703ea6385d7f932e)
|
|
2
|
+
* ## Features
|
|
3
|
+
* <span style='color:green'>feat: HT-8060: if we have grid AutoSize option true and have saved grid columns config set it in false</span> ([2c6e2d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2c6e2d28a88cfbd383ea963e35cd7289e8412c49))
|
|
4
|
+
|
|
5
|
+
* ## Fixes
|
|
6
|
+
* <span style='color:red'> HT-7489 убрана лишняя зависимость mode-sql</span> ([f8ae6d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f8ae6d20e8285ddeaaa9063f1e9f5524ed0832d5))
|
|
7
|
+
|
|
8
|
+
* BFL-11343 fix: creating SpecificPluginConfig widget ([f9a765], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f9a765b241ac2b44d0e12a4cc1c10acff765c4e7))
|
|
9
|
+
* update: CHANGELOG.md ([1ab75d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1ab75dc59921e43812349bf8bf38432c35d62fc1))
|
|
10
|
+
|
|
11
|
+
# Version 2.6.6, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5a18af0bcc182d756427e1fd5e522dab51f5f6ca)
|
|
12
|
+
* ## Features
|
|
13
|
+
* <span style='color:green'>feat: HT-8006: Create cancel button, add search plugin by name form combo, change field labels</span> ([7dc802], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/7dc8027771536eb1fcffd9d3f59a362699abf5c6))
|
|
14
|
+
|
|
15
|
+
* ## Fixes
|
|
16
|
+
* <span style='color:red'> HT-8036: remove override view config</span> ([f13055], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f1305573f3761f2657e995310a79a7d75887c091))
|
|
17
|
+
|
|
18
|
+
* update extjs_iconpack to 1.3.19 ([adff9d], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/adff9d7411fad6a04e153065c9c472b080d7e719))
|
|
19
|
+
* update: CHANGELOG.md ([f82d7f], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f82d7f36520836cc6733ac936ef98bf0589b15d2))
|
|
20
|
+
|
|
1
21
|
# Version 2.6.5, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5695d2c215ad6469aacd802ca46a536c81845c35)
|
|
2
22
|
* ## Fixes
|
|
3
23
|
* <span style='color:red'>Fix:TR-67289 refactoring authorization</span> ([8bdc4b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8bdc4b11e7443b819b52c4eef8e0cc2d9c8f3f5b))
|
|
@@ -5,6 +25,9 @@
|
|
|
5
25
|
* update: CHANGELOG.md ([490d0e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/490d0eb96a199419068bdf69e20aa0db63a6180d))
|
|
6
26
|
|
|
7
27
|
# Version 2.6.4, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f9a1013bbcc9c01ba7baa130b16648d222144ea0)
|
|
28
|
+
* ## Features
|
|
29
|
+
* <span style='color:green'>feat: HT-7986: Create mask editing form panel</span> ([5d812e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5d812e4dd2087bbf6be625630133bfc120b5a60f))
|
|
30
|
+
|
|
8
31
|
* ## Fixes
|
|
9
32
|
* <span style='color:red'>fix "сохнарить"</span> ([a5fa42], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a5fa421c079792cf51f04ac696664731427620bf))
|
|
10
33
|
|
|
@@ -15,6 +38,7 @@
|
|
|
15
38
|
* <span style='color:red'>fix uiElement/get request</span> ([edac67], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/edac674cb5d023de5ad274262db6d619de7d50fd))
|
|
16
39
|
* <span style='color:red'> Added 'nullable' then using command.GetUIElementCommand. Related to TR-67200.</span> ([dbc2bb], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/dbc2bbb53c333bab4d0e659cc4118de4e920a299))
|
|
17
40
|
|
|
41
|
+
* CRM-8252 2-й этап_Реализация перехода в карточку дела/документа ПИР ([d7b3f8], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/d7b3f8e9f622679fbffb338530ee014736b61446))
|
|
18
42
|
* update: CHANGELOG.md ([1e55ff], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/1e55ff88b8c2f2a8c0b71674c719a0daa1e2dbc3))
|
|
19
43
|
|
|
20
44
|
# Version 2.6.2, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b12213a59d39c7fd13513b74268eb902a0c86720)
|
|
@@ -419,6 +443,7 @@ fix ExecuteCommandPlugin - remove reject on failure if command hasnt erorHandler
|
|
|
419
443
|
# Version 2.5.26, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/da7767ea8d5507d8b2081aeaf13f46c21010f0d2)
|
|
420
444
|
* ## Features
|
|
421
445
|
* <span style='color:green'>feat: BFL-8383 механизм сравнения конфигураций кастомных панелей</span> ([ced608], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ced608b24610366e2fac65f7a9b546d31b6b34b8))
|
|
446
|
+
* <span style='color:green'>feat: TR-66759: create form editor</span> ([94e9ab], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/94e9ab0ca454e8835d36dcc88612702c74bad84d))
|
|
422
447
|
* <span style='color:green'>feat: HT-6956 add SQL beautifier</span> ([c8e391], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c8e391e07989f4e04dc5229ba8a1671ea84f9027))
|
|
423
448
|
* <span style='color:green'>feat: TR-67310 исправление ситуации когда defaultFocus на поле в состоянии disabled приводит к возврату фокуса на предыдущий элемент</span> ([335b93], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/335b9374874e2406e6f5c80daada6ba49eef05dc))
|
|
424
449
|
|
package/index.js
CHANGED
|
@@ -17,7 +17,6 @@ import 'ace-builds/src-noconflict/theme-xcode';
|
|
|
17
17
|
import 'ace-builds/src-noconflict/theme-iplastic';
|
|
18
18
|
import 'ace-builds/src-noconflict/ext-searchbox';
|
|
19
19
|
import 'ace-builds/src-noconflict/mode-javascript';
|
|
20
|
-
import 'ace-builds/src-noconflict/mode-sql';
|
|
21
20
|
import 'ace-builds/src-noconflict/mode-pgsql';
|
|
22
21
|
import 'ace-builds/src-noconflict/snippets/javascript';
|
|
23
22
|
import 'ace-builds/src-noconflict/snippets/sql';
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "ru.coon"
|
|
5
5
|
},
|
|
6
6
|
"description": "",
|
|
7
|
-
"version": "2.6.
|
|
7
|
+
"version": "2.6.7",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
10
|
"url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"ace-diff": "^3.0.3",
|
|
28
28
|
"decimal.js-light": "^2.5.1",
|
|
29
29
|
"echarts": "^5.3.3",
|
|
30
|
-
"extjs_iconpack": "1.3.
|
|
30
|
+
"extjs_iconpack": "1.3.19",
|
|
31
31
|
"json5": "2.2.3",
|
|
32
32
|
"object-hash": "^3.0.0",
|
|
33
33
|
"sigma-printjs": "^1.0.1",
|
package/src/Function.js
CHANGED
|
@@ -126,7 +126,7 @@ Ext.define('Coon.Function', {
|
|
|
126
126
|
*/
|
|
127
127
|
getDataFromForm: function(formPanel, valuesAsIs, dateFormat, excludeReadOnly, excludeDisabled) {
|
|
128
128
|
let fields = formPanel.query('field');
|
|
129
|
-
fields = (fields || []).concat(formPanel.query('fieldcontainer'));
|
|
129
|
+
fields = (fields || []).concat(formPanel.query('fieldcontainer')).concat(formPanel.query('UiCFSegmentedButton'));
|
|
130
130
|
const params = {};
|
|
131
131
|
for (let i = 0; i < fields.length; i++) {
|
|
132
132
|
const field = fields[i];
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EditorOptionsWindow', {
|
|
2
|
+
extend: 'Ext.window.Window',
|
|
3
|
+
controller: 'EditorOptionsWindowController',
|
|
4
|
+
modal: true,
|
|
5
|
+
xtype: 'EditorOptionsWindow',
|
|
6
|
+
width: 800,
|
|
7
|
+
closeAction: 'destroy',
|
|
8
|
+
title: 'Работа со свойствами',
|
|
9
|
+
height: '80%',
|
|
10
|
+
config: {
|
|
11
|
+
value: null,
|
|
12
|
+
editor: null,
|
|
13
|
+
editorOptions: {},
|
|
14
|
+
},
|
|
15
|
+
listeners: {
|
|
16
|
+
show: 'onShowWindow',
|
|
17
|
+
},
|
|
18
|
+
viewModel: {
|
|
19
|
+
stores: {
|
|
20
|
+
mainStore: {
|
|
21
|
+
type: 'json',
|
|
22
|
+
fields: ['option', 'value'],
|
|
23
|
+
data: [],
|
|
24
|
+
},
|
|
25
|
+
optionsStore: {
|
|
26
|
+
type: 'json',
|
|
27
|
+
data: [],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
data: {
|
|
31
|
+
record: null,
|
|
32
|
+
optionsDataLength: 0,
|
|
33
|
+
currentOption: null,
|
|
34
|
+
optionDescription: '',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
layout: 'border',
|
|
38
|
+
items: [
|
|
39
|
+
{
|
|
40
|
+
xtype: 'grid',
|
|
41
|
+
region: 'center',
|
|
42
|
+
width: 200,
|
|
43
|
+
plugins: {
|
|
44
|
+
cellediting: {
|
|
45
|
+
listeners: {
|
|
46
|
+
edit: 'onEditItem',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
viewConfig: {
|
|
51
|
+
plugins: {
|
|
52
|
+
gridviewdragdrop: {
|
|
53
|
+
dragText: 'Сортировка',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
tbar: {
|
|
58
|
+
items: [
|
|
59
|
+
{
|
|
60
|
+
text: 'Добавить',
|
|
61
|
+
handler: 'addHandler',
|
|
62
|
+
bind: {
|
|
63
|
+
disabled: '{!optionsDataLength}',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
handler: 'deleteHandler',
|
|
68
|
+
text: 'Удалить',
|
|
69
|
+
bind: {
|
|
70
|
+
disabled: '{!record}',
|
|
71
|
+
text: '{buttonText}',
|
|
72
|
+
},
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
bind: {
|
|
77
|
+
store: '{mainStore}',
|
|
78
|
+
selection: '{record}',
|
|
79
|
+
},
|
|
80
|
+
columns: [
|
|
81
|
+
{
|
|
82
|
+
header: 'Свойство',
|
|
83
|
+
dataIndex: 'option',
|
|
84
|
+
xtype: 'hintColumn',
|
|
85
|
+
editor: {
|
|
86
|
+
xtype: 'combo',
|
|
87
|
+
allowBlank: false,
|
|
88
|
+
tpl: Ext.create('Ext.XTemplate',
|
|
89
|
+
'<ul class="x-list-plain">' +
|
|
90
|
+
'<tpl for=".">',
|
|
91
|
+
'<li role="option" data-qtip="{[values.description]}" class="x-boundlist-item">{[values.option]}</li>',
|
|
92
|
+
'</tpl>' +
|
|
93
|
+
'</ul>'),
|
|
94
|
+
queryMode: 'local',
|
|
95
|
+
editable: false,
|
|
96
|
+
displayField: 'option',
|
|
97
|
+
valueField: 'option',
|
|
98
|
+
bind: {
|
|
99
|
+
store: '{optionsStore}',
|
|
100
|
+
},
|
|
101
|
+
listeners: {
|
|
102
|
+
select: 'onSelectCombo',
|
|
103
|
+
},
|
|
104
|
+
},
|
|
105
|
+
flex: 1,
|
|
106
|
+
}
|
|
107
|
+
],
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
xtype: 'form',
|
|
111
|
+
reference: 'valuesForm',
|
|
112
|
+
flex: 1,
|
|
113
|
+
bodyPadding: 10,
|
|
114
|
+
split: true,
|
|
115
|
+
region: 'east',
|
|
116
|
+
bind: {
|
|
117
|
+
disabled: '{!record || !currentOption}',
|
|
118
|
+
},
|
|
119
|
+
items: [
|
|
120
|
+
{
|
|
121
|
+
xtype: 'displayfield',
|
|
122
|
+
fieldLabel: 'Свойство',
|
|
123
|
+
anchor: '100%',
|
|
124
|
+
bind: {
|
|
125
|
+
value: '{currentOption}',
|
|
126
|
+
},
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
xtype: 'displayfield',
|
|
130
|
+
fieldLabel: 'Описание',
|
|
131
|
+
anchor: '100%',
|
|
132
|
+
bind: {
|
|
133
|
+
value: '{optionDescription}',
|
|
134
|
+
},
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
}
|
|
138
|
+
],
|
|
139
|
+
buttons: [
|
|
140
|
+
{
|
|
141
|
+
text: 'Сохранить',
|
|
142
|
+
ui: 'orange-button',
|
|
143
|
+
handler: 'saveHandler',
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
text: 'Закрыть',
|
|
147
|
+
handler: 'closeHandler',
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
});
|
package/src/common/component/characteristic/characteristicGroup/EditorOptionsWindowController.js
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EditorOptionsWindowController', {
|
|
2
|
+
extend: 'Ext.app.ViewController',
|
|
3
|
+
alias: 'controller.EditorOptionsWindowController',
|
|
4
|
+
saveHandler: function() {
|
|
5
|
+
this.updateValue();
|
|
6
|
+
const data = {};
|
|
7
|
+
const items = this.getViewModel().getStore('mainStore').getRange();
|
|
8
|
+
if (!items.length) {
|
|
9
|
+
this.fireViewEvent('dataIsSaved', '');
|
|
10
|
+
this.closeHandler();
|
|
11
|
+
}
|
|
12
|
+
items.forEach((rec) => {
|
|
13
|
+
if (rec.get('value')) {
|
|
14
|
+
data[rec.get('option')] = rec.get('value');
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
// console.log(data);
|
|
18
|
+
// const converted = Coon.Function.convertAdvancedProperties(data);
|
|
19
|
+
// console.log(converted);
|
|
20
|
+
this.fireViewEvent('dataIsSaved', Ext.JSON.encode(data));
|
|
21
|
+
this.closeHandler();
|
|
22
|
+
},
|
|
23
|
+
closeHandler: function() {
|
|
24
|
+
if (this.getView()) {
|
|
25
|
+
this.getView().close();
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
onShowWindow: function() {
|
|
29
|
+
if (!this.getView().getEditor()) {
|
|
30
|
+
Ext.Msg.show({
|
|
31
|
+
title: 'Ошибка',
|
|
32
|
+
message: 'Не определен едитор',
|
|
33
|
+
icon: Ext.Msg.ERROR,
|
|
34
|
+
buttons: Ext.Msg.OK,
|
|
35
|
+
});
|
|
36
|
+
this.closeHandler();
|
|
37
|
+
}
|
|
38
|
+
const value = this.getView().getValue();
|
|
39
|
+
const proto = Ext.ClassManager.classes[Ext.ClassManager.aliasToName['widget.'+this.getView().getEditor()]].prototype;
|
|
40
|
+
if (!Ext.isObject(proto.editorOptions)) {
|
|
41
|
+
Ext.Msg.show({
|
|
42
|
+
title: 'Ошибка',
|
|
43
|
+
message: 'Не определены опции едитора',
|
|
44
|
+
icon: Ext.Msg.ERROR,
|
|
45
|
+
buttons: Ext.Msg.OK,
|
|
46
|
+
});
|
|
47
|
+
this.closeHandler();
|
|
48
|
+
}
|
|
49
|
+
this.getView().setEditorOptions(proto.editorOptions);
|
|
50
|
+
if (value && Ext.isObject(value)) {
|
|
51
|
+
this.getViewModel().getStore('mainStore').add(Object.keys(value).map((key) => {
|
|
52
|
+
return {option: key, value: value[key]};
|
|
53
|
+
}));
|
|
54
|
+
}
|
|
55
|
+
this.initOptionStore();
|
|
56
|
+
this.getViewModel().bind('{record}', (rec) => {
|
|
57
|
+
this.getViewModel().set('currentOption', rec && !!rec.get('option') ? rec.get('option') : null);
|
|
58
|
+
}, this);
|
|
59
|
+
this.getViewModel().bind('{currentOption}', this.initValuePanel, this);
|
|
60
|
+
},
|
|
61
|
+
updateValue() {
|
|
62
|
+
const form = this.lookup('valuesForm');
|
|
63
|
+
if (form.getRecord()) {
|
|
64
|
+
form.updateRecord();
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
initValuePanel(currentOption) {
|
|
68
|
+
this.updateValue();
|
|
69
|
+
const editorOptions = this.getView().getEditorOptions();
|
|
70
|
+
this.getViewModel().set('optionDescription',
|
|
71
|
+
currentOption && Ext.isObject(editorOptions) && editorOptions[currentOption] ?
|
|
72
|
+
editorOptions[currentOption]['description'] : ''
|
|
73
|
+
);
|
|
74
|
+
const form = this.lookup('valuesForm');
|
|
75
|
+
if (form.items.items[1]) {
|
|
76
|
+
form.remove(form.items.items.find((field) => field.name === 'value'), true);
|
|
77
|
+
}
|
|
78
|
+
if (currentOption && Ext.isObject(editorOptions) && editorOptions[currentOption] && editorOptions[currentOption]['type']) {
|
|
79
|
+
let config = {
|
|
80
|
+
fieldLabel: 'Значение',
|
|
81
|
+
xtype: 'textfield',
|
|
82
|
+
anchor: '100%',
|
|
83
|
+
name: 'value',
|
|
84
|
+
allowBlank: true,
|
|
85
|
+
};
|
|
86
|
+
let isBool = false;
|
|
87
|
+
switch (editorOptions[currentOption]['type']) {
|
|
88
|
+
case 'bool':
|
|
89
|
+
isBool = true,
|
|
90
|
+
config = {
|
|
91
|
+
xtype: 'combobox',
|
|
92
|
+
allowBlank: true,
|
|
93
|
+
forceSelection: true,
|
|
94
|
+
editable: false,
|
|
95
|
+
anchor: '100%',
|
|
96
|
+
name: 'value',
|
|
97
|
+
value: true,
|
|
98
|
+
fieldLabel: 'Значение',
|
|
99
|
+
store: {
|
|
100
|
+
fields: ['val', 'descr'],
|
|
101
|
+
data: [
|
|
102
|
+
{'val': true, 'descr': 'Да'},
|
|
103
|
+
{'val': false, 'descr': 'Нет'}
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
queryMode: 'local',
|
|
107
|
+
displayField: 'descr',
|
|
108
|
+
valueField: 'val',
|
|
109
|
+
};
|
|
110
|
+
break;
|
|
111
|
+
case 'int':
|
|
112
|
+
config.xtype = 'numberfield';
|
|
113
|
+
break;
|
|
114
|
+
case 'js':
|
|
115
|
+
config.xtype = 'textarea';
|
|
116
|
+
config.grow = true;
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
form.add(config);
|
|
120
|
+
const record = this.getViewModel().get('record');
|
|
121
|
+
if (isBool && record && typeof record.get('value') !== 'boolean') {
|
|
122
|
+
record.set('value', true);
|
|
123
|
+
}
|
|
124
|
+
form.loadRecord(record);
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
addHandler() {
|
|
128
|
+
const record = this.getViewModel().getStore('mainStore').insert(0, {value: null});
|
|
129
|
+
const grid = this.getView().down('grid');
|
|
130
|
+
grid.getSelectionModel().select(0);
|
|
131
|
+
grid.getView().scrollTo(0, 0);
|
|
132
|
+
const context = grid.getView().getPosition(record[0], grid.getColumns()[0]);
|
|
133
|
+
grid.setActionableMode(true, context);
|
|
134
|
+
},
|
|
135
|
+
deleteHandler() {
|
|
136
|
+
const vm = this.getViewModel();
|
|
137
|
+
const record = vm.get('record');
|
|
138
|
+
if (record) {
|
|
139
|
+
vm.getStore('mainStore').remove(record);
|
|
140
|
+
this.initOptionStore();
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
onEditItem(el, context) {
|
|
144
|
+
if (context.field === 'option') {
|
|
145
|
+
this.initOptionStore();
|
|
146
|
+
this.getViewModel().set('currentOption', context.record.get('option') || null);
|
|
147
|
+
context.record.set('value', null);
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
onSelectCombo(el, rec) {
|
|
151
|
+
const record = this.getViewModel().get('record');
|
|
152
|
+
const field = this.lookup('valuesForm').items.items.find((f) => f.name === 'value');
|
|
153
|
+
if (field) {
|
|
154
|
+
field.setValue(null);
|
|
155
|
+
}
|
|
156
|
+
record.set('value', null);
|
|
157
|
+
const grid = this.getView().down('grid');
|
|
158
|
+
const context = grid.getView().getPosition(record, grid.getColumns()[0]);
|
|
159
|
+
grid.setActionableMode(false, context);
|
|
160
|
+
},
|
|
161
|
+
initOptionStore() {
|
|
162
|
+
const vm = this.getViewModel();
|
|
163
|
+
const options = vm.getStore('mainStore').getRange().map((rec) => rec.get('option'));
|
|
164
|
+
const optionsData = [];
|
|
165
|
+
const editorOptions = this.getView().getEditorOptions();
|
|
166
|
+
Object.keys(editorOptions).forEach((key) => {
|
|
167
|
+
if (options.indexOf(key) < 0) {
|
|
168
|
+
optionsData.push({option: key, description: editorOptions[key]['description']});
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
vm.set('optionsDataLength', optionsData.length);
|
|
172
|
+
vm.getStore('optionsStore').setData(optionsData);
|
|
173
|
+
},
|
|
174
|
+
});
|
package/src/common/component/characteristic/characteristicGroup/EntityGroupCharacteristicEditor.js
CHANGED
|
@@ -159,6 +159,14 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
159
159
|
xtype: 'hintColumn',
|
|
160
160
|
editor: {
|
|
161
161
|
xtype: 'textfield',
|
|
162
|
+
triggers: {
|
|
163
|
+
info: {
|
|
164
|
+
cls: 'svg-icon svg-icon-settings',
|
|
165
|
+
tooltip: 'Очистить поле',
|
|
166
|
+
hideOnReadOnly: true,
|
|
167
|
+
handler: 'onTriggerClick',
|
|
168
|
+
},
|
|
169
|
+
},
|
|
162
170
|
},
|
|
163
171
|
flex: 1,
|
|
164
172
|
},
|
|
@@ -188,6 +196,21 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
188
196
|
cellediting: {
|
|
189
197
|
listeners: {
|
|
190
198
|
edit: 'onEditItem',
|
|
199
|
+
beforeedit: (el, context) => {
|
|
200
|
+
if (context.field === 'mask') {
|
|
201
|
+
const editor = context.record.get('editor');
|
|
202
|
+
if (editor) {
|
|
203
|
+
const proto = Ext.ClassManager.classes[Ext.ClassManager.aliasToName['widget.'+editor]].prototype;
|
|
204
|
+
if (Ext.isObject(proto.editorOptions)) {
|
|
205
|
+
context.column.field.triggers.info.show();
|
|
206
|
+
} else {
|
|
207
|
+
context.column.field.triggers.info.hide();
|
|
208
|
+
}
|
|
209
|
+
} else {
|
|
210
|
+
context.column.field.triggers.info.hide();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
191
214
|
},
|
|
192
215
|
},
|
|
193
216
|
},
|
|
@@ -162,4 +162,42 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
162
162
|
}
|
|
163
163
|
},
|
|
164
164
|
|
|
165
|
+
onTriggerClick(el) {
|
|
166
|
+
const record = this.getViewModel().get('record');
|
|
167
|
+
if (record && record.get('editor')) {
|
|
168
|
+
const fn = () => {
|
|
169
|
+
const json = Ext.JSON.decode(el.getValue(), true);
|
|
170
|
+
const window = Ext.create('Coon.uielement.component.characteristic.characteristicGroup.EditorOptionsWindow', {
|
|
171
|
+
value: json || null,
|
|
172
|
+
editor: record.get('editor') || null,
|
|
173
|
+
});
|
|
174
|
+
window.on('dataIsSaved', (win, data) => {
|
|
175
|
+
record.set('mask', data);
|
|
176
|
+
}, this);
|
|
177
|
+
window.show();
|
|
178
|
+
};
|
|
179
|
+
if (el.getValue()) {
|
|
180
|
+
const json = Ext.JSON.decode(el.getValue(), true);
|
|
181
|
+
if (!json || !Ext.isObject(json)) {
|
|
182
|
+
Ext.Msg.show({
|
|
183
|
+
title: 'Внимание',
|
|
184
|
+
message: 'Текущее значение не является JSON объектом и оно будет удалено. Продолжить?',
|
|
185
|
+
buttons: Ext.Msg.YESNO,
|
|
186
|
+
icon: Ext.Msg.QUESTION,
|
|
187
|
+
fn: function(btn) {
|
|
188
|
+
if (btn === 'yes') {
|
|
189
|
+
record.set('mask', null);
|
|
190
|
+
fn();
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
} else {
|
|
195
|
+
fn();
|
|
196
|
+
}
|
|
197
|
+
} else {
|
|
198
|
+
fn();
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
|
|
165
203
|
});
|
|
@@ -24,6 +24,9 @@ Ext.define('Coon.common.component.editor.CharacteristicGridEditor', {
|
|
|
24
24
|
viewConfig: {
|
|
25
25
|
getRowClass(record) {
|
|
26
26
|
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
27
|
+
if (record.get('isDeleted')) {
|
|
28
|
+
return 'delete-row';
|
|
29
|
+
}
|
|
27
30
|
if (
|
|
28
31
|
record.get(ns.$required) &&
|
|
29
32
|
!record.get(ns.$allowEmpty) &&
|
|
@@ -44,11 +44,6 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
|
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
});
|
|
47
|
-
this.viewConfig = {
|
|
48
|
-
getRowClass: Coon.Function.markDelete(
|
|
49
|
-
'isDeleted'
|
|
50
|
-
),
|
|
51
|
-
};
|
|
52
47
|
this.plugins = Ext.clone(this.plugins) || [];
|
|
53
48
|
|
|
54
49
|
if (this.enableToolBar) {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.common.component.editor.creators.ByReportEditorCreator', {
|
|
2
2
|
extend: 'Coon.common.component.editor.creators.TriggerFieldEditorCreator',
|
|
3
|
-
alternateClassName: [
|
|
4
|
-
'SigmaUtilities.view.common.component.editor.creators.ByReportEditorCreator'
|
|
5
|
-
],
|
|
6
3
|
alias: 'widget.ByReportEditorCreator',
|
|
7
4
|
xtype: 'ByReportEditorCreator',
|
|
8
5
|
editable: false,
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.common.component.editor.creators.CustomPanelEditorCreator', {
|
|
2
2
|
extend: 'Coon.common.component.editor.creators.BaseEditorCreator',
|
|
3
|
-
alternateClassName: [
|
|
4
|
-
'SigmaUtilities.view.common.component.editor.creators.CustomPanelEditorCreator'
|
|
5
|
-
],
|
|
6
3
|
alias: 'widget.CustomPanelEditorCreator',
|
|
7
4
|
xtype: 'CustomPanelEditorCreator',
|
|
8
5
|
config: {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.common.component.editor.creators.ForeignKeyEditorCreator', {
|
|
2
2
|
extend: 'Coon.common.component.editor.creators.BaseEditorCreator',
|
|
3
|
-
alternateClassName: [
|
|
4
|
-
'SigmaUtilities.view.common.component.editor.creators.ForeignKeyEditorCreator'
|
|
5
|
-
],
|
|
6
3
|
alias: 'widget.ForeignKeyEditorCreator',
|
|
7
4
|
xtype: 'ForeignKeyEditorCreator',
|
|
8
5
|
disableInternalEditor: true,
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.common.component.editor.creators.NoteEditorCreator', {
|
|
2
2
|
extend: 'Coon.common.component.editor.creators.BaseEditorCreator',
|
|
3
|
-
alternateClassName: [
|
|
4
|
-
'SigmaUtilities.view.common.component.editor.creators.NoteEditorCreator'
|
|
5
|
-
],
|
|
6
3
|
alias: 'widget.NoteEditorCreator',
|
|
7
4
|
xtype: 'NoteEditorCreator',
|
|
8
5
|
createField: function(record, parent) {
|
|
@@ -1,12 +1,25 @@
|
|
|
1
1
|
Ext.define('Coon.common.component.editor.creators.NumberEditorCreator', {
|
|
2
2
|
extend: 'Coon.common.component.editor.creators.BaseEditorCreator',
|
|
3
|
-
alternateClassName: [
|
|
4
|
-
'SigmaUtilities.view.common.component.editor.creators.NumberEditorCreator'
|
|
5
|
-
],
|
|
6
3
|
alias: 'widget.NumberEditorCreator',
|
|
7
4
|
xtype: 'NumberEditorCreator',
|
|
8
5
|
decimalSeparator: ',',
|
|
9
|
-
|
|
6
|
+
/**
|
|
7
|
+
* @description Перенчень параметров разрешенных для добавление в поле маски сущности (характеристики)
|
|
8
|
+
* @param config
|
|
9
|
+
* @example
|
|
10
|
+
* editorOptions: {
|
|
11
|
+
* allowDecimals: {
|
|
12
|
+
* type: 'bool',
|
|
13
|
+
* description: 'Разрешать дробные значения',
|
|
14
|
+
* },
|
|
15
|
+
* },
|
|
16
|
+
*/
|
|
17
|
+
editorOptions: {
|
|
18
|
+
allowDecimals: {
|
|
19
|
+
type: 'bool',
|
|
20
|
+
description: 'Разрешать дробные значения',
|
|
21
|
+
},
|
|
22
|
+
},
|
|
10
23
|
normalizeRawValue(raw, separator) {
|
|
11
24
|
if (!raw) {
|
|
12
25
|
throw new Error('ERROR: normalizeRawValue, raw must be nonempty string!');
|
|
@@ -7,9 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Ext.define('Coon.common.component.editor.creators.SimpleReportEditorCreator', {
|
|
9
9
|
extend: 'Coon.common.component.editor.creators.BaseEditorCreator',
|
|
10
|
-
alternateClassName: [
|
|
11
|
-
'SigmaUtilities.view.common.component.editor.creators.SimpleReportEditorCreator'
|
|
12
|
-
],
|
|
13
10
|
alias: 'widget.SimpleReportEditorCreator',
|
|
14
11
|
xtype: 'SimpleReportEditorCreator',
|
|
15
12
|
createField: function(record, parent, context) {
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.common.component.editor.creators.TriggerFieldEditorCreator', {
|
|
2
2
|
extend: 'Coon.common.component.editor.creators.BaseEditorCreator',
|
|
3
|
-
alternateClassName: [
|
|
4
|
-
'SigmaUtilities.view.common.component.editor.creators.TriggerFieldEditorCreator'
|
|
5
|
-
],
|
|
6
3
|
alias: 'widget.TriggerFieldEditorCreator',
|
|
7
4
|
xtype: 'TriggerFieldEditorCreator',
|
|
8
5
|
assignDoubleClick: true,
|