ru.coon 2.5.68 → 2.6.0
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 +10 -0
- package/package.json +1 -1
- package/src/Function.scss +4 -0
- package/src/common/component/characteristic/CharacteristicPanel.js +91 -71
- package/src/common/component/characteristic/CharacteristicPanelController.js +21 -6
- package/src/common/component/characteristic/characteristicAlgorithm/AlgorithmChainEditWindow.js +24 -29
- package/src/common/component/characteristic/characteristicAlgorithm/AlgorithmChainSearchWindow.js +3 -1
- package/src/common/component/characteristic/characteristicAlgorithm/CharacteristicAlgorithmList.js +10 -1
- package/src/common/component/characteristic/characteristicAlgorithm/CharacteristicAlgorithmListController.js +6 -1
- package/src/common/component/characteristic/characteristicAlgorithm/CharacteristicAlgorithmSearchWindow.js +4 -4
- package/src/common/component/characteristic/characteristicGroup/CharacteristicAccessList.js +13 -2
- package/src/common/component/characteristic/characteristicGroup/CharacteristicAccessListController.js +7 -2
- package/src/common/component/characteristic/characteristicGroup/CharacteristicGroupPanel.js +2 -0
- package/src/common/component/characteristic/characteristicGroup/CharacteristicGroupSearchWindow.js +29 -6
- package/src/common/component/characteristic/characteristicGroup/CharacteristicTypeSearchWindow.js +1 -0
- package/src/common/component/characteristic/characteristicGroup/EditCharacteristicGroupWindow.js +24 -9
- package/src/common/component/characteristic/characteristicGroup/EntityGroupCharacteristicEditor.js +23 -6
- package/src/common/component/characteristic/characteristicGroup/EntityGroupCharacteristicEditorController.js +11 -3
- package/src/common/component/characteristic/characteristicGroup/UserGroupForeignWindow.js +1 -1
- package/src/common/component/editor/EditorFactory.js +56 -46
- package/src/common/component/editor/TypedCharacteristicEditor.js +7 -3
- package/src/common/component/editor/creators/CustomPanelEditorCreator.js +2 -2
- package/src/common/component/editor/creators/NoteEditorCreator.js +3 -2
- package/src/common/component/editor/creators/NumberEditorCreator.js +22 -6
- package/src/common/component/editor/creators/SimpleReportEditorCreator.js +3 -5
- package/src/common/component/editor/creators/TimeEditorCreator.js +3 -5
- package/src/version.js +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
# Version 2.6.0, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/78a28499d4ba7dc466ba5ff5a4b815d191c349bf)
|
|
2
|
+
* ## Features
|
|
3
|
+
* <span style='color:green'>feat: HT-7986: chars editor interface upgrade</span> ([9af20a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/9af20aa30d2b1fa494994e0cf7d84b26b19604e0))
|
|
4
|
+
* <span style='color:green'>feat: HT-7986: chars editor interface upgrade</span> ([ccf1d4], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ccf1d42831f67ca298e2598422430da06b01ab49))
|
|
5
|
+
|
|
6
|
+
* update: CHANGELOG.md ([e47fec], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e47fec57e3e5450390ece76176541c6e3a668bd1))
|
|
7
|
+
|
|
1
8
|
# Version 2.5.68, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/98ad55fc31f43905c6600483ea3665275bccbcb0)
|
|
2
9
|
* ## Features
|
|
10
|
+
* <span style='color:green'>feat: HT-7986: chars editor interface upgrade</span> ([a27806], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/a278066acdef2f6abd723de5a360f612179d50e9))
|
|
3
11
|
* <span style='color:green'>feat: NEVA-439: set null values before send on server for postgres</span> ([bf7739], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/bf7739be43a2bb3e52932059699b493e31f2371f))
|
|
4
12
|
* <span style='color:green'>feat: HT-7969: set xtypes for editors</span> ([8c4edc], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/8c4edc5c63f46d647bb4f3286e4517af31cbbe5b))
|
|
5
13
|
* <span style='color:green'>feat: HT-7969: view group description, fix fields name in chain</span> ([e19b98], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/e19b98356ac3738d40afdd92401d8433d3b86056))
|
|
6
14
|
|
|
7
15
|
* Resolve HT-7568 ([eb0297], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/eb0297d1927ae6e2d3a8d492d368d5ea7bef89ef))
|
|
16
|
+
* HT-7882 поддержать возможность передачи свойств редактора х-ки в поле mask в формате json ([ff9d88], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/ff9d88c6e8f12d59ea7fd4f8be344696670d13af))
|
|
8
17
|
* update: CHANGELOG.md ([fed09b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/fed09bab2391b2ef0adde36107c4c8e9f8e9ad32))
|
|
9
18
|
|
|
10
19
|
# Version 2.5.67, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/eda77f29b413590ae650c8fb7ba1615c63cf104a)
|
|
@@ -30,6 +39,7 @@
|
|
|
30
39
|
* <span style='color:red'> HT-7941: check if do not have saved data object then close window</span> ([0baf4e], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/0baf4ea72862a4a61230ffc3ac0af7f8b065d794))
|
|
31
40
|
|
|
32
41
|
* remove unnecessary filterItemsOnRow property ([772f61], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/772f6190df8b958bd6ff97e5731a59971c9a11fc))
|
|
42
|
+
* HT-7882 поддержать возможность передачи свойств редактора х-ки в поле mask в формате json ([507490], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/5074900afb170d9f11aa10de6549e05cef12f7cb))
|
|
33
43
|
* update: CHANGELOG.md ([2ec18c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2ec18ccddcb1d571ef6a1d00b9cde439355c8304))
|
|
34
44
|
|
|
35
45
|
# Version 2.5.63, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/49035e56acea653959f01f96ea96a10d962b1424)
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@ Ext.define('Coon.uielement.component.characteristic.CharacteristicPanel', {
|
|
|
7
7
|
entity: null,
|
|
8
8
|
isNew: false,
|
|
9
9
|
groups: null,
|
|
10
|
+
title: 'Редактирование сущности',
|
|
10
11
|
},
|
|
11
12
|
stores: {
|
|
12
13
|
characteristicEntityStore: {
|
|
@@ -15,6 +16,9 @@ Ext.define('Coon.uielement.component.characteristic.CharacteristicPanel', {
|
|
|
15
16
|
},
|
|
16
17
|
},
|
|
17
18
|
},
|
|
19
|
+
bind: {
|
|
20
|
+
title: '{title}',
|
|
21
|
+
},
|
|
18
22
|
layout: {
|
|
19
23
|
type: 'vbox',
|
|
20
24
|
align: 'stretch',
|
|
@@ -36,91 +40,107 @@ Ext.define('Coon.uielement.component.characteristic.CharacteristicPanel', {
|
|
|
36
40
|
reference: 'entityForm',
|
|
37
41
|
bodyPadding: 5,
|
|
38
42
|
layout: 'anchor',
|
|
39
|
-
defaults: {
|
|
40
|
-
anchor: '100%',
|
|
41
|
-
xtype: 'container',
|
|
42
|
-
layout: 'column',
|
|
43
|
-
defaults: {
|
|
44
|
-
columnWidth: 0.33,
|
|
45
|
-
xtype: 'textfield',
|
|
46
|
-
margin: '0 0 0 15px',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
43
|
items: [
|
|
50
44
|
{
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
anchor: '100%',
|
|
46
|
+
bind: {
|
|
47
|
+
collapsed: '{!!entity}',
|
|
48
|
+
title: 'Данные сущности {entity}',
|
|
49
|
+
},
|
|
50
|
+
defaults: {
|
|
51
|
+
xtype: 'container',
|
|
52
|
+
flex: 1,
|
|
53
|
+
layout: 'column',
|
|
54
|
+
defaults: {
|
|
55
|
+
columnWidth: 0.33,
|
|
56
|
+
xtype: 'textfield',
|
|
57
|
+
margin: '0 0 0 15px',
|
|
61
58
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
displayField: 'description',
|
|
70
|
-
valueField: 'value',
|
|
71
|
-
bind: {
|
|
72
|
-
store: '{characteristicEntityStore}',
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
fieldLabel: 'Тип сущности',
|
|
77
|
-
name: 'entityType',
|
|
78
|
-
}
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
{
|
|
59
|
+
},
|
|
60
|
+
xtype: 'fieldset',
|
|
61
|
+
collapsible: true,
|
|
62
|
+
layout: {
|
|
63
|
+
type: 'vbox',
|
|
64
|
+
align: 'stretch',
|
|
65
|
+
},
|
|
82
66
|
items: [
|
|
83
67
|
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
68
|
+
items: [
|
|
69
|
+
{
|
|
70
|
+
fieldLabel: 'Код',
|
|
71
|
+
name: 'entity',
|
|
72
|
+
reference: 'entityField',
|
|
73
|
+
margin: 0,
|
|
74
|
+
allowBlank: false,
|
|
75
|
+
bind: {
|
|
76
|
+
disabled: '{!isNew}',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
xtype: 'combo',
|
|
81
|
+
reference: 'characteristicEntityCombo',
|
|
82
|
+
fieldLabel: 'Класс сущности',
|
|
83
|
+
name: 'characteristicEntity',
|
|
84
|
+
allowBlank: false,
|
|
85
|
+
queryMode: 'local',
|
|
86
|
+
displayField: 'description',
|
|
87
|
+
valueField: 'value',
|
|
88
|
+
bind: {
|
|
89
|
+
store: '{characteristicEntityStore}',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
fieldLabel: 'Тип сущности',
|
|
94
|
+
name: 'entityType',
|
|
95
|
+
}
|
|
96
|
+
],
|
|
87
97
|
},
|
|
88
98
|
{
|
|
89
|
-
|
|
90
|
-
|
|
99
|
+
items: [
|
|
100
|
+
{
|
|
101
|
+
fieldLabel: 'Тип сущности 2-го порядка',
|
|
102
|
+
margin: 0,
|
|
103
|
+
name: 'entityType2',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
fieldLabel: 'Тип сущности 3-го порядка',
|
|
107
|
+
name: 'entityType3',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
fieldLabel: 'Тип сущности 4-го порядка',
|
|
111
|
+
name: 'entityType4',
|
|
112
|
+
}
|
|
113
|
+
],
|
|
91
114
|
},
|
|
92
115
|
{
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
116
|
+
items: [
|
|
117
|
+
{
|
|
118
|
+
fieldLabel: 'Тип сущности 5-го порядка',
|
|
119
|
+
name: 'entityType5',
|
|
120
|
+
margin: 0,
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
fieldLabel: 'entryPoint',
|
|
124
|
+
name: 'cmEntryPoint',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
fieldLabel: 'Описание',
|
|
128
|
+
name: 'description',
|
|
129
|
+
allowBlank: false,
|
|
130
|
+
}
|
|
131
|
+
],
|
|
108
132
|
},
|
|
109
133
|
{
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
134
|
+
boxLabel: 'Отображать только эффективные значения для предопределенных характеристик',
|
|
135
|
+
xtype: 'checkbox',
|
|
136
|
+
name: 'isEffective',
|
|
137
|
+
labelWidth: 500,
|
|
138
|
+
labelTextAlign: 'right',
|
|
139
|
+
boxLabelAlign: 'after',
|
|
113
140
|
}
|
|
114
141
|
],
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
boxLabel: 'Отображать только эффективные значения для предопределенных характеристик',
|
|
118
|
-
xtype: 'checkbox',
|
|
119
|
-
name: 'isEffective',
|
|
120
|
-
labelWidth: 500,
|
|
121
|
-
labelTextAlign: 'right',
|
|
122
|
-
boxLabelAlign: 'after',
|
|
123
142
|
}
|
|
143
|
+
|
|
124
144
|
],
|
|
125
145
|
},
|
|
126
146
|
{
|
|
@@ -13,14 +13,19 @@ Ext.define('Coon.uielement.component.characteristic.CharacteristicPanelControlle
|
|
|
13
13
|
|
|
14
14
|
doInitForm: function(entity) {
|
|
15
15
|
const vm = this.getViewModel();
|
|
16
|
-
vm.
|
|
16
|
+
entity = entity || vm.get('entity') || null;
|
|
17
|
+
vm.set('entity', entity);
|
|
17
18
|
vm.set('isNew', !vm.get('entity'));
|
|
18
19
|
if (entity) {
|
|
20
|
+
vm.set('title', 'Редактирование сущности ' + entity);
|
|
19
21
|
this.lookup('characteristicAlgorithmList').doInit(entity);
|
|
20
22
|
this.lookup('characteristicEditor').doInit(entity, 'SUBENTITY');
|
|
21
23
|
this.load();
|
|
24
|
+
} else {
|
|
25
|
+
vm.set('title', 'Добавление новой сущности ');
|
|
22
26
|
}
|
|
23
27
|
this.initCharacteristicEntityStore();
|
|
28
|
+
this.lookup('entityForm').isValid();
|
|
24
29
|
},
|
|
25
30
|
|
|
26
31
|
doInitFormGroupReload: function(entity) {
|
|
@@ -65,9 +70,12 @@ Ext.define('Coon.uielement.component.characteristic.CharacteristicPanelControlle
|
|
|
65
70
|
const isNew = this.getViewModel().get('isNew');
|
|
66
71
|
data.isNew = isNew;
|
|
67
72
|
this.getView().mask('Сохранение');
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
const me = this;
|
|
74
|
+
Coon.util.promisifyCmd(
|
|
75
|
+
'Iswe.command.IsweSaveEntity',
|
|
76
|
+
data
|
|
77
|
+
).then(() => {
|
|
78
|
+
me.getView().unmask();
|
|
71
79
|
if (isNew) {
|
|
72
80
|
this.getViewModel().set('isNew', false);
|
|
73
81
|
this.doInitForm(data['entity']);
|
|
@@ -76,8 +84,15 @@ Ext.define('Coon.uielement.component.characteristic.CharacteristicPanelControlle
|
|
|
76
84
|
this.lookup('characteristicEditor').save();
|
|
77
85
|
this.lookup('characteristicAlgorithmList').save();
|
|
78
86
|
}
|
|
79
|
-
}
|
|
80
|
-
|
|
87
|
+
}).catch((error) => {
|
|
88
|
+
me.getView().unmask();
|
|
89
|
+
Ext.Msg.show({
|
|
90
|
+
title: 'Ошибка',
|
|
91
|
+
message: error.responceText,
|
|
92
|
+
icon: Ext.Msg.ERROR,
|
|
93
|
+
buttons: Ext.Msg.OK,
|
|
94
|
+
});
|
|
95
|
+
});
|
|
81
96
|
}
|
|
82
97
|
},
|
|
83
98
|
validate: function() {
|
package/src/common/component/characteristic/characteristicAlgorithm/AlgorithmChainEditWindow.js
CHANGED
|
@@ -42,48 +42,41 @@ Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.Algo
|
|
|
42
42
|
{
|
|
43
43
|
xtype: 'form',
|
|
44
44
|
reference: 'formPanel',
|
|
45
|
-
bodyPadding:
|
|
46
|
-
layout: '
|
|
45
|
+
bodyPadding: 10,
|
|
46
|
+
layout: 'column',
|
|
47
47
|
defaults: {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
defaults: {
|
|
53
|
-
columnWidth: 0.5,
|
|
54
|
-
allowBlank: false,
|
|
55
|
-
xtype: 'textfield',
|
|
56
|
-
margin: '0 0 0 15px',
|
|
57
|
-
},
|
|
48
|
+
columnWidth: 0.5,
|
|
49
|
+
allowBlank: false,
|
|
50
|
+
xtype: 'textfield',
|
|
51
|
+
margin: '0 0 0 15px',
|
|
58
52
|
},
|
|
59
|
-
items: [
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
disabled: '{!isNew}',
|
|
67
|
-
},
|
|
53
|
+
items: [
|
|
54
|
+
{
|
|
55
|
+
fieldLabel: 'Код',
|
|
56
|
+
name: 'AlgorithmChain',
|
|
57
|
+
margin: 0,
|
|
58
|
+
bind: {
|
|
59
|
+
disabled: '{!isNew}',
|
|
68
60
|
},
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
fieldLabel: 'Наименование',
|
|
64
|
+
name: 'description',
|
|
65
|
+
}
|
|
66
|
+
],
|
|
75
67
|
},
|
|
76
68
|
{
|
|
77
69
|
xtype: 'panel',
|
|
70
|
+
margin: '10px 0 0 0',
|
|
78
71
|
flex: 1,
|
|
79
72
|
layout: {
|
|
80
|
-
type: '
|
|
81
|
-
align: 'stretch',
|
|
73
|
+
type: 'border',
|
|
82
74
|
},
|
|
83
75
|
items: [
|
|
84
76
|
{
|
|
85
77
|
reference: 'algorithmChainBindList',
|
|
86
78
|
flex: 2,
|
|
79
|
+
region: 'center',
|
|
87
80
|
xtype: 'AlgorithmChainBindList',
|
|
88
81
|
listeners: {
|
|
89
82
|
beforeselect: 'onBeforeSelectAlgorithmChainBindList',
|
|
@@ -93,6 +86,8 @@ Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.Algo
|
|
|
93
86
|
xtype: 'AlgorithmChainBindDependencyList',
|
|
94
87
|
reference: 'algorithmChainBindDependencyList',
|
|
95
88
|
flex: 1,
|
|
89
|
+
split: true,
|
|
90
|
+
region: 'east',
|
|
96
91
|
bind: {
|
|
97
92
|
disabled: '{!record}',
|
|
98
93
|
},
|
package/src/common/component/characteristic/characteristicAlgorithm/AlgorithmChainSearchWindow.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.AlgorithmChainSearchWindow', {
|
|
2
2
|
extend: 'Ext.window.Window',
|
|
3
3
|
xtype: 'AlgorithmChainSearchWindow',
|
|
4
|
-
width:
|
|
4
|
+
width: 800,
|
|
5
5
|
closeAction: 'hide',
|
|
6
6
|
modal: true,
|
|
7
7
|
title: 'Поиск цепочки алгоритмов',
|
|
@@ -124,6 +124,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.Algo
|
|
|
124
124
|
columnWidth: 0.12,
|
|
125
125
|
margin: '15px 0 0 10px',
|
|
126
126
|
text: 'Поиск',
|
|
127
|
+
ui: 'orange-button',
|
|
127
128
|
handler: 'searchHandler',
|
|
128
129
|
}
|
|
129
130
|
],
|
|
@@ -176,6 +177,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.Algo
|
|
|
176
177
|
},
|
|
177
178
|
{
|
|
178
179
|
header: 'Название',
|
|
180
|
+
flex: 1,
|
|
179
181
|
dataIndex: 'description',
|
|
180
182
|
xtype: 'hintColumn',
|
|
181
183
|
}
|
package/src/common/component/characteristic/characteristicAlgorithm/CharacteristicAlgorithmList.js
CHANGED
|
@@ -14,6 +14,14 @@ Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.Char
|
|
|
14
14
|
}
|
|
15
15
|
return false;
|
|
16
16
|
},
|
|
17
|
+
selectionChange: function(get) {
|
|
18
|
+
const rec = get('record');
|
|
19
|
+
if (rec) {
|
|
20
|
+
this.set('buttonText', rec.get('isDeleted') ? 'Восстановить': 'Удалить');
|
|
21
|
+
} else {
|
|
22
|
+
this.set('buttonText', 'Удалить');
|
|
23
|
+
}
|
|
24
|
+
},
|
|
17
25
|
},
|
|
18
26
|
stores: {
|
|
19
27
|
mainStore: {
|
|
@@ -26,6 +34,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.Char
|
|
|
26
34
|
},
|
|
27
35
|
},
|
|
28
36
|
data: {
|
|
37
|
+
buttonText: 'Удалить',
|
|
29
38
|
record: null,
|
|
30
39
|
},
|
|
31
40
|
},
|
|
@@ -54,10 +63,10 @@ Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.Char
|
|
|
54
63
|
},
|
|
55
64
|
},
|
|
56
65
|
{
|
|
57
|
-
text: 'Удалить',
|
|
58
66
|
handler: 'deleteHandler',
|
|
59
67
|
bind: {
|
|
60
68
|
disabled: '{!record}',
|
|
69
|
+
text: '{buttonText}',
|
|
61
70
|
},
|
|
62
71
|
}
|
|
63
72
|
],
|
|
@@ -78,13 +78,18 @@ Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.Char
|
|
|
78
78
|
},
|
|
79
79
|
|
|
80
80
|
deleteHandler: function() {
|
|
81
|
-
const
|
|
81
|
+
const vm = this.getViewModel();
|
|
82
|
+
const record = vm.get('record');
|
|
82
83
|
if (record) {
|
|
83
84
|
if (record.isNew) {
|
|
84
85
|
this.getViewModel().getStore('mainStore').remove(record);
|
|
86
|
+
vm.set('buttonText', 'Удалить');
|
|
85
87
|
} else {
|
|
86
88
|
record.set('isDeleted', !record.get('isDeleted'));
|
|
89
|
+
vm.set('buttonText', record.get('isDeleted') ? 'Восстановить': 'Удалить');
|
|
87
90
|
}
|
|
91
|
+
} else {
|
|
92
|
+
vm.set('buttonText', 'Удалить');
|
|
88
93
|
}
|
|
89
94
|
},
|
|
90
95
|
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.CharacteristicAlgorithmSearchWindow', {
|
|
2
2
|
extend: 'Ext.window.Window',
|
|
3
3
|
xtype: 'CharacteristicAlgorithmSearchWindow',
|
|
4
|
-
width:
|
|
4
|
+
width: 600,
|
|
5
5
|
closeAction: 'hide',
|
|
6
6
|
title: 'Поиск алгоритма',
|
|
7
7
|
modal: true,
|
|
8
8
|
height: '80%',
|
|
9
|
+
layout: 'fit',
|
|
9
10
|
controller: {
|
|
10
11
|
choose: function() {
|
|
11
12
|
this.getView().fireEvent('choose', this.getViewModel().get('record'));
|
|
@@ -47,12 +48,11 @@ Ext.define('Coon.uielement.component.characteristic.characteristicAlgorithm.Char
|
|
|
47
48
|
{
|
|
48
49
|
xtype: 'ReportPanel',
|
|
49
50
|
reference: 'algReport',
|
|
50
|
-
flex: 1,
|
|
51
51
|
reportId: 'ISWE_ALG_SEARCH',
|
|
52
52
|
scrollable: true,
|
|
53
|
-
hideFilterPanel:
|
|
53
|
+
hideFilterPanel: true,
|
|
54
54
|
header: false,
|
|
55
|
-
autoFilter:
|
|
55
|
+
autoFilter: true,
|
|
56
56
|
listeners: {
|
|
57
57
|
configured: 'onConfigured',
|
|
58
58
|
},
|
|
@@ -9,8 +9,19 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
9
9
|
data: [],
|
|
10
10
|
},
|
|
11
11
|
},
|
|
12
|
+
formulas: {
|
|
13
|
+
selectionChange: function(get) {
|
|
14
|
+
const rec = get('localRecord');
|
|
15
|
+
if (rec) {
|
|
16
|
+
this.set('buttonText', rec.get('isDeleted') ? 'Восстановить': 'Удалить');
|
|
17
|
+
} else {
|
|
18
|
+
this.set('buttonText', 'Удалить');
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
},
|
|
12
22
|
data: {
|
|
13
23
|
localRecord: null,
|
|
24
|
+
buttonText: 'Удалить',
|
|
14
25
|
},
|
|
15
26
|
},
|
|
16
27
|
bind: {
|
|
@@ -30,10 +41,10 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
30
41
|
handler: 'addHandler',
|
|
31
42
|
},
|
|
32
43
|
{
|
|
33
|
-
text: 'Удалить',
|
|
34
44
|
handler: 'deleteHandler',
|
|
35
45
|
bind: {
|
|
36
46
|
disabled: '{!localRecord}',
|
|
47
|
+
text: '{buttonText}',
|
|
37
48
|
},
|
|
38
49
|
}
|
|
39
50
|
],
|
|
@@ -43,7 +54,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
43
54
|
'header': 'Группа пользователя',
|
|
44
55
|
'dataIndex': 'userGroupDescription',
|
|
45
56
|
'xtype': 'hintColumn',
|
|
46
|
-
'
|
|
57
|
+
'width': 180,
|
|
47
58
|
'editable': false,
|
|
48
59
|
},
|
|
49
60
|
{
|
|
@@ -26,13 +26,18 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
26
26
|
},
|
|
27
27
|
|
|
28
28
|
deleteHandler: function() {
|
|
29
|
-
const
|
|
29
|
+
const vm = this.getViewModel();
|
|
30
|
+
const record = vm.get('localRecord');
|
|
30
31
|
if (record) {
|
|
31
32
|
if (record.get('isNew')) {
|
|
32
|
-
|
|
33
|
+
vm.getStore('mainStore').remove(record);
|
|
34
|
+
vm.set('buttonText', 'Удалить');
|
|
33
35
|
} else {
|
|
34
36
|
record.set('isDeleted', !record.get('isDeleted'));
|
|
37
|
+
vm.set('buttonText', record.get('isDeleted') ? 'Восстановить': 'Удалить');
|
|
35
38
|
}
|
|
39
|
+
} else {
|
|
40
|
+
vm.set('buttonText', 'Удалить');
|
|
36
41
|
}
|
|
37
42
|
},
|
|
38
43
|
getFullList: function(encode) {
|
|
@@ -23,6 +23,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
23
23
|
items: [
|
|
24
24
|
{
|
|
25
25
|
region: 'center',
|
|
26
|
+
layout: 'fit',
|
|
26
27
|
reference: 'entityGroupCharacteristicEditor',
|
|
27
28
|
flex: 1,
|
|
28
29
|
xtype: 'EntityGroupCharacteristicEditor',
|
|
@@ -32,6 +33,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
32
33
|
},
|
|
33
34
|
{
|
|
34
35
|
region: 'south',
|
|
36
|
+
layout: 'fit',
|
|
35
37
|
reference: 'characteristicAccessList',
|
|
36
38
|
xtype: 'CharacteristicAccessList',
|
|
37
39
|
flex: 1,
|
package/src/common/component/characteristic/characteristicGroup/CharacteristicGroupSearchWindow.js
CHANGED
|
@@ -7,8 +7,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
7
7
|
modal: true,
|
|
8
8
|
height: '80%',
|
|
9
9
|
layout: {
|
|
10
|
-
type: '
|
|
11
|
-
align: 'stretch',
|
|
10
|
+
type: 'border',
|
|
12
11
|
},
|
|
13
12
|
listeners: {
|
|
14
13
|
show: 'onShow',
|
|
@@ -39,7 +38,11 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
39
38
|
const record = Ext.create('Coon.uielement.component.characteristic.model.characteristicGroup.GroupBeanModel');
|
|
40
39
|
record.set('isNew', true);
|
|
41
40
|
this.getViewModel().getStore('mainStore').insert(0, record);
|
|
42
|
-
this.lookup('entryGrid')
|
|
41
|
+
const grid = this.lookup('entryGrid');
|
|
42
|
+
grid.getSelectionModel().select(0);
|
|
43
|
+
grid.getView().scrollTo(0, 0);
|
|
44
|
+
const context = grid.getView().getPosition(record, grid.getColumns()[0]);
|
|
45
|
+
grid.setActionableMode(true, context);
|
|
43
46
|
},
|
|
44
47
|
deleteHandler: function() {
|
|
45
48
|
const record = this.getViewModel().get('record');
|
|
@@ -78,6 +81,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
78
81
|
url: command.getUrl(),
|
|
79
82
|
method: 'POST',
|
|
80
83
|
params: rec.data,
|
|
84
|
+
processError: true,
|
|
81
85
|
}));
|
|
82
86
|
});
|
|
83
87
|
const me = this;
|
|
@@ -85,7 +89,15 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
85
89
|
me.onShow();
|
|
86
90
|
}).catch(function(err) {
|
|
87
91
|
me.onShow();
|
|
88
|
-
Coon.
|
|
92
|
+
const data = Coon.util.parseJSON(err.responseText);
|
|
93
|
+
if (data && Ext.isObject(data) && data.responceText) {
|
|
94
|
+
Ext.Msg.show({
|
|
95
|
+
title: 'Ошибка',
|
|
96
|
+
message: data.responceText,
|
|
97
|
+
icon: Ext.Msg.ERROR,
|
|
98
|
+
buttons: Ext.Msg.OK,
|
|
99
|
+
});
|
|
100
|
+
}
|
|
89
101
|
});
|
|
90
102
|
},
|
|
91
103
|
},
|
|
@@ -135,6 +147,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
135
147
|
items: [
|
|
136
148
|
{
|
|
137
149
|
xtype: 'grid',
|
|
150
|
+
region: 'center',
|
|
138
151
|
tbar: {
|
|
139
152
|
items: [
|
|
140
153
|
{
|
|
@@ -155,13 +168,14 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
155
168
|
],
|
|
156
169
|
},
|
|
157
170
|
reference: 'entryGrid',
|
|
158
|
-
flex:
|
|
171
|
+
flex: 2,
|
|
159
172
|
bind: {
|
|
160
173
|
store: '{mainStore}',
|
|
161
174
|
selection: '{record}',
|
|
162
175
|
},
|
|
163
176
|
plugins: {
|
|
164
177
|
cellediting: true,
|
|
178
|
+
gridfilterbar: true,
|
|
165
179
|
},
|
|
166
180
|
columns: {
|
|
167
181
|
defaults: {
|
|
@@ -173,22 +187,31 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.Characte
|
|
|
173
187
|
},
|
|
174
188
|
items: [
|
|
175
189
|
{
|
|
176
|
-
header: '
|
|
190
|
+
header: 'Код группы',
|
|
177
191
|
dataIndex: 'group',
|
|
192
|
+
editor: {
|
|
193
|
+
xtype: 'textfield',
|
|
194
|
+
maxLength: 12,
|
|
195
|
+
},
|
|
196
|
+
filterType: 'string',
|
|
178
197
|
},
|
|
179
198
|
{
|
|
180
199
|
header: 'Название',
|
|
181
200
|
dataIndex: 'description',
|
|
201
|
+
filterType: 'string',
|
|
182
202
|
},
|
|
183
203
|
{
|
|
184
204
|
header: 'Описание',
|
|
185
205
|
dataIndex: 'longDescription',
|
|
206
|
+
filterType: 'string',
|
|
186
207
|
}
|
|
187
208
|
],
|
|
188
209
|
},
|
|
189
210
|
},
|
|
190
211
|
{
|
|
191
212
|
xtype: 'ReportPanel',
|
|
213
|
+
region: 'south',
|
|
214
|
+
split: true,
|
|
192
215
|
bind: {
|
|
193
216
|
disabled: '{disabledElems}',
|
|
194
217
|
},
|
package/src/common/component/characteristic/characteristicGroup/EditCharacteristicGroupWindow.js
CHANGED
|
@@ -4,11 +4,10 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EditChar
|
|
|
4
4
|
xtype: 'EditCharacteristicGroupWindow',
|
|
5
5
|
width: '80%',
|
|
6
6
|
closeAction: 'hide',
|
|
7
|
-
title: '
|
|
7
|
+
title: 'Работа с группами',
|
|
8
8
|
height: '80%',
|
|
9
9
|
layout: {
|
|
10
|
-
type: '
|
|
11
|
-
align: 'stretch',
|
|
10
|
+
type: 'border',
|
|
12
11
|
},
|
|
13
12
|
data: null,
|
|
14
13
|
|
|
@@ -66,13 +65,18 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EditChar
|
|
|
66
65
|
},
|
|
67
66
|
|
|
68
67
|
deleteHandler: function() {
|
|
69
|
-
const
|
|
68
|
+
const vm = this.getViewModel();
|
|
69
|
+
const record = vm.get('record');
|
|
70
70
|
if (record) {
|
|
71
71
|
if (record.isNew) {
|
|
72
|
-
|
|
72
|
+
vm.getStore('groupStore').remove(record);
|
|
73
|
+
vm.set('buttonText', 'Удалить');
|
|
73
74
|
} else {
|
|
74
75
|
record.set('isDeleted', !record.get('isDeleted'));
|
|
76
|
+
vm.set('buttonText', record.get('isDeleted') ? 'Восстановить': 'Удалить');
|
|
75
77
|
}
|
|
78
|
+
} else {
|
|
79
|
+
vm.set('buttonText', 'Удалить');
|
|
76
80
|
}
|
|
77
81
|
},
|
|
78
82
|
|
|
@@ -100,20 +104,24 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EditChar
|
|
|
100
104
|
formulas: {
|
|
101
105
|
selectionChange: function(get) {
|
|
102
106
|
const report = this.getView().down('[reference="usedGrid"]');
|
|
103
|
-
|
|
107
|
+
const rec = get('record');
|
|
108
|
+
if (rec) {
|
|
104
109
|
report.applyFilter(
|
|
105
|
-
{GROUP:
|
|
110
|
+
{GROUP: rec.get('group')}
|
|
106
111
|
);
|
|
107
112
|
report.filterHandler();
|
|
113
|
+
this.set('buttonText', rec.get('isDeleted') ? 'Восстановить': 'Удалить');
|
|
108
114
|
} else {
|
|
109
115
|
if (report.grid) {
|
|
110
116
|
report.grid.clear();
|
|
111
117
|
}
|
|
118
|
+
this.set('buttonText', 'Удалить');
|
|
112
119
|
}
|
|
113
120
|
},
|
|
114
121
|
},
|
|
115
122
|
data: {
|
|
116
123
|
record: null,
|
|
124
|
+
buttonText: 'Удалить',
|
|
117
125
|
},
|
|
118
126
|
stores: {
|
|
119
127
|
groupStore: {
|
|
@@ -135,20 +143,25 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EditChar
|
|
|
135
143
|
handler: 'addHandler',
|
|
136
144
|
},
|
|
137
145
|
{
|
|
138
|
-
|
|
146
|
+
tooltip: 'Удалить связь группы характеристик и сущности',
|
|
139
147
|
handler: 'deleteHandler',
|
|
140
148
|
bind: {
|
|
141
149
|
disabled: '{!record}',
|
|
150
|
+
text: '{buttonText}',
|
|
142
151
|
},
|
|
143
152
|
}
|
|
144
153
|
],
|
|
145
154
|
},
|
|
146
155
|
reference: 'groupGrid',
|
|
147
|
-
flex:
|
|
156
|
+
flex: 2,
|
|
157
|
+
region: 'center',
|
|
148
158
|
bind: {
|
|
149
159
|
store: '{groupStore}',
|
|
150
160
|
selection: '{record}',
|
|
151
161
|
},
|
|
162
|
+
plugins: {
|
|
163
|
+
cellediting: true,
|
|
164
|
+
},
|
|
152
165
|
columns: {
|
|
153
166
|
defaults: {
|
|
154
167
|
flex: 1,
|
|
@@ -186,6 +199,8 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EditChar
|
|
|
186
199
|
bind: {
|
|
187
200
|
disabled: '{!record}',
|
|
188
201
|
},
|
|
202
|
+
region: 'south',
|
|
203
|
+
split: true,
|
|
189
204
|
xtype: 'ReportPanel',
|
|
190
205
|
reference: 'usedGrid',
|
|
191
206
|
flex: 1,
|
package/src/common/component/characteristic/characteristicGroup/EntityGroupCharacteristicEditor.js
CHANGED
|
@@ -5,6 +5,20 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
5
5
|
viewModel: {
|
|
6
6
|
data: {
|
|
7
7
|
mainRecord: null,
|
|
8
|
+
buttonText: 'Удалить',
|
|
9
|
+
},
|
|
10
|
+
formulas: {
|
|
11
|
+
getGroupLength: function(get) {
|
|
12
|
+
return get('mainRecord.groups').length > 0;
|
|
13
|
+
},
|
|
14
|
+
selectionChange: function(get) {
|
|
15
|
+
const rec = get('record');
|
|
16
|
+
if (rec) {
|
|
17
|
+
this.set('buttonText', rec.get('isDeleted') ? 'Восстановить': 'Удалить');
|
|
18
|
+
} else {
|
|
19
|
+
this.set('buttonText', 'Удалить');
|
|
20
|
+
}
|
|
21
|
+
},
|
|
8
22
|
},
|
|
9
23
|
stores: {
|
|
10
24
|
groupStore: {
|
|
@@ -36,16 +50,19 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
36
50
|
{
|
|
37
51
|
text: 'Добавить',
|
|
38
52
|
handler: 'addHandler',
|
|
53
|
+
bind: {
|
|
54
|
+
disabled: '{!getGroupLength}',
|
|
55
|
+
},
|
|
39
56
|
},
|
|
40
57
|
{
|
|
41
|
-
text: 'Удалить',
|
|
42
58
|
handler: 'deleteHandler',
|
|
43
59
|
bind: {
|
|
44
60
|
disabled: '{!record}',
|
|
61
|
+
text: '{buttonText}',
|
|
45
62
|
},
|
|
46
63
|
},
|
|
47
64
|
{
|
|
48
|
-
text: '
|
|
65
|
+
text: 'Работа с группами',
|
|
49
66
|
handler: 'editGroupHandler',
|
|
50
67
|
disabled: false,
|
|
51
68
|
}
|
|
@@ -53,7 +70,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
53
70
|
},
|
|
54
71
|
columns: [
|
|
55
72
|
{
|
|
56
|
-
header: '
|
|
73
|
+
header: '№',
|
|
57
74
|
dataIndex: 'sequence',
|
|
58
75
|
xtype: 'hintColumn',
|
|
59
76
|
editor: {
|
|
@@ -61,7 +78,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
61
78
|
allowBlank: false,
|
|
62
79
|
allowDecimals: false,
|
|
63
80
|
},
|
|
64
|
-
|
|
81
|
+
width: 50,
|
|
65
82
|
},
|
|
66
83
|
{
|
|
67
84
|
header: 'Тип',
|
|
@@ -74,7 +91,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
74
91
|
header: 'Название',
|
|
75
92
|
dataIndex: 'typeDescription',
|
|
76
93
|
xtype: 'hintColumn',
|
|
77
|
-
flex:
|
|
94
|
+
flex: 2,
|
|
78
95
|
},
|
|
79
96
|
{
|
|
80
97
|
header: 'Тип значения',
|
|
@@ -112,7 +129,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
112
129
|
dataIndex: 'single',
|
|
113
130
|
xtype: 'checkcolumn',
|
|
114
131
|
editable: true,
|
|
115
|
-
|
|
132
|
+
width: 100,
|
|
116
133
|
},
|
|
117
134
|
{
|
|
118
135
|
header: 'Refercence Code',
|
|
@@ -35,7 +35,10 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
35
35
|
},
|
|
36
36
|
onEditItem: function(editor, context) {
|
|
37
37
|
if (context.column.dataIndex === 'group') {
|
|
38
|
-
this.getViewModel()
|
|
38
|
+
const vm = this.getViewModel();
|
|
39
|
+
const index = vm.getStore('groupStore').find('group', context.value);
|
|
40
|
+
context.record.set('groupDescription', index >= 0 ? vm.getStore('groupStore').getAt(index).get('description'): '');
|
|
41
|
+
vm.getStore('EntityGroupStore').fireEvent('refresh');
|
|
39
42
|
}
|
|
40
43
|
},
|
|
41
44
|
createRow: function(record) {
|
|
@@ -51,13 +54,18 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.EntityGr
|
|
|
51
54
|
this.getViewModel().getStore('EntityGroupStore').insert(0, newRecord);
|
|
52
55
|
},
|
|
53
56
|
deleteHandler: function() {
|
|
54
|
-
const
|
|
57
|
+
const vm = this.getViewModel();
|
|
58
|
+
const record = vm.get('record');
|
|
55
59
|
if (record) {
|
|
56
60
|
if (record.isNew) {
|
|
57
|
-
|
|
61
|
+
vm.getStore('EntityGroupStore').remove(record);
|
|
62
|
+
vm.set('buttonText', 'Удалить');
|
|
58
63
|
} else {
|
|
59
64
|
record.set('isDeleted', !record.get('isDeleted'));
|
|
65
|
+
vm.set('buttonText', record.get('isDeleted') ? 'Восстановить': 'Удалить');
|
|
60
66
|
}
|
|
67
|
+
} else {
|
|
68
|
+
vm.set('buttonText', 'Удалить');
|
|
61
69
|
}
|
|
62
70
|
},
|
|
63
71
|
|
|
@@ -19,7 +19,7 @@ Ext.define('Coon.uielement.component.characteristic.characteristicGroup.UserGrou
|
|
|
19
19
|
this.lookup('form').reset();
|
|
20
20
|
const command = Ext.create('Iswe.command.IsweExecuteReportCommand');
|
|
21
21
|
command.on('complete', function(response) {
|
|
22
|
-
this.getViewModel().getStore('userStore').loadData(
|
|
22
|
+
this.getViewModel().getStore('userStore').loadData(Ext.isArray(response) ? response :[]);
|
|
23
23
|
}, this);
|
|
24
24
|
command.execute('USER_GROUP_LIST', []);
|
|
25
25
|
},
|
|
@@ -54,6 +54,9 @@ Ext.define('Coon.common.component.editor.EditorFactory', {
|
|
|
54
54
|
throw new Ext.Error('Тип редактора не задан');
|
|
55
55
|
}
|
|
56
56
|
Coon.log.debug('createEditor', type);
|
|
57
|
+
const mask = record.get('mask');
|
|
58
|
+
record.set('editorConfig', (mask && typeof mask === 'string' && Ext.decode(mask, true) && Ext.isObject(Ext.decode(mask))) ?
|
|
59
|
+
Ext.decode(mask, true) : {});
|
|
57
60
|
if (type === Coon.common.component.editor.CharacteristicEditorTypes.FOREIGN ||
|
|
58
61
|
type === Coon.common.component.editor.CharacteristicEditorTypes.FILE ||
|
|
59
62
|
!Ext.isEmpty(record.get(Coon.report.model.CharacteristicBeanFields.$editor))) {
|
|
@@ -70,10 +73,14 @@ Ext.define('Coon.common.component.editor.EditorFactory', {
|
|
|
70
73
|
editor = new Coon.common.component.editor.TextTypeEditor();
|
|
71
74
|
break;
|
|
72
75
|
case Coon.common.component.editor.CharacteristicEditorTypes.FLOAT:
|
|
73
|
-
editor = new Coon.common.component.editor.NumberTypeEditor(
|
|
76
|
+
editor = new Coon.common.component.editor.NumberTypeEditor({
|
|
77
|
+
record: record,
|
|
78
|
+
});
|
|
74
79
|
break;
|
|
75
80
|
case Coon.common.component.editor.CharacteristicEditorTypes.INT:
|
|
76
|
-
editor = new Coon.common.component.editor.IntTypeEditor(
|
|
81
|
+
editor = new Coon.common.component.editor.IntTypeEditor({
|
|
82
|
+
record: record,
|
|
83
|
+
});
|
|
77
84
|
break;
|
|
78
85
|
case Coon.common.component.editor.CharacteristicEditorTypes.DATE:
|
|
79
86
|
editor = new Coon.common.component.editor.DateTypeEditor({
|
|
@@ -81,7 +88,9 @@ Ext.define('Coon.common.component.editor.EditorFactory', {
|
|
|
81
88
|
});
|
|
82
89
|
break;
|
|
83
90
|
case Coon.common.component.editor.CharacteristicEditorTypes.LIST:
|
|
84
|
-
editor = new Coon.common.component.editor.DFVTypeEditor(
|
|
91
|
+
editor = new Coon.common.component.editor.DFVTypeEditor({
|
|
92
|
+
record: record,
|
|
93
|
+
});
|
|
85
94
|
break;
|
|
86
95
|
default:
|
|
87
96
|
throw new Ext.Error('Не определен тип редактора');
|
|
@@ -144,26 +153,32 @@ Ext.define('Coon.common.component.editor.TextTypeEditor', {
|
|
|
144
153
|
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
145
154
|
const re = new RegExp('^\\d{10}$');
|
|
146
155
|
if (record.recTyp && record.recTyp === 'passport' && re.test(value.replace(/\s/g, ''))) {
|
|
147
|
-
|
|
156
|
+
const passportNumber = value.replace(/\s/g, '');
|
|
157
|
+
value = passportNumber.slice(0, 2) + ' ' + passportNumber.slice(2, 4) + ' ' + passportNumber.slice(4);
|
|
148
158
|
}
|
|
149
159
|
record.set(ns.$valueDescription, value);
|
|
150
160
|
},
|
|
151
161
|
|
|
152
162
|
prepare: function() {
|
|
153
|
-
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
154
163
|
const record = this.context.record;
|
|
155
|
-
const type = this.grid.typeMap.get(record.get(
|
|
164
|
+
const type = this.grid.typeMap.get(record.get('type'));
|
|
156
165
|
const field = this.field;
|
|
157
|
-
if (
|
|
158
|
-
field.
|
|
159
|
-
field.regex = new RegExp(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
if (!Ext.Object.isEmpty(record.get('editorConfig'))) {
|
|
167
|
+
Ext.apply(field, record.get('editorConfig'));
|
|
168
|
+
field.regex = record.get('editorConfig').regex ? new RegExp(record.get('editorConfig').regex) : undefined;
|
|
169
|
+
record.recTyp = field.recTyp;
|
|
170
|
+
} else {
|
|
171
|
+
if (type && type.mask !== ' ') {
|
|
172
|
+
field.regexText = 'Некорректное заполнение поля';
|
|
173
|
+
field.regex = new RegExp(type.mask);
|
|
174
|
+
field.maskRe = field.regex;
|
|
175
|
+
record.recTyp = type.mask === '^\\d{2}\\s*\\d{2}\\s*\\d{6}$' ? 'passport' : undefined;
|
|
176
|
+
}
|
|
177
|
+
if (type && type.mask === ' ') {
|
|
178
|
+
field.regexText = undefined;
|
|
179
|
+
field.regex = undefined;
|
|
180
|
+
field.maskRe = undefined;
|
|
181
|
+
}
|
|
167
182
|
}
|
|
168
183
|
},
|
|
169
184
|
});
|
|
@@ -192,16 +207,13 @@ Ext.define('Coon.common.component.editor.NumberTypeEditor', {
|
|
|
192
207
|
const record = this.context.record;
|
|
193
208
|
const type = this.grid.typeMap.get(record.get(ns.$type));
|
|
194
209
|
const field = this.field;
|
|
195
|
-
|
|
210
|
+
field.minValue = Number.NEGATIVE_INFINITY;
|
|
211
|
+
if (!Ext.Object.isEmpty(record.get('editorConfig'))) {
|
|
212
|
+
Ext.apply(field, record.get('editorConfig'));
|
|
213
|
+
} else if (type && type.mask && type.mask.startsWith('minValue')) {
|
|
196
214
|
const range = type[ns.$mask].split(';');
|
|
197
215
|
field.minValue = range[0].slice(9);
|
|
198
|
-
|
|
199
|
-
field.maxValue = range[1].slice(10);
|
|
200
|
-
} else {
|
|
201
|
-
field.maxValue = Number.POSITIVE_INFINITY;
|
|
202
|
-
}
|
|
203
|
-
} else {
|
|
204
|
-
field.minValue = Number.NEGATIVE_INFINITY;
|
|
216
|
+
field.maxValue = range.length === 2 ? range[1].slice(10) : Number.POSITIVE_INFINITY;
|
|
205
217
|
}
|
|
206
218
|
},
|
|
207
219
|
|
|
@@ -247,25 +259,23 @@ Ext.define('Coon.common.component.editor.DateTypeEditor', {
|
|
|
247
259
|
],
|
|
248
260
|
|
|
249
261
|
createField: function() {
|
|
250
|
-
const
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
return new Ext.form.field.Date({
|
|
262
|
+
const mask = Ext.Object.isEmpty(this.record.get('editorConfig')) ? this.parseMask(this.record.get('mask')) : {};
|
|
263
|
+
return Ext.create(Ext.apply({
|
|
264
|
+
xtype: 'datefield',
|
|
254
265
|
allowBlank: true,
|
|
255
|
-
plugins:
|
|
256
|
-
format:
|
|
257
|
-
});
|
|
266
|
+
plugins: mask['periodPicker'] ? 'PeriodPickerPlugin' : [],
|
|
267
|
+
format: mask['valueFormat'] || 'd.m.Y',
|
|
268
|
+
}, this.record.get('editorConfig')));
|
|
258
269
|
},
|
|
259
270
|
|
|
260
271
|
setData: function(value, record) {
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
if (
|
|
264
|
-
record.set(
|
|
265
|
-
Ext.util.Format.dateRenderer(this.mask['valueFormat'])(value));
|
|
272
|
+
const mask = Ext.Object.isEmpty(this.record.get('editorConfig')) ? this.parseMask(this.record.get('mask')) : {};
|
|
273
|
+
const valueFormat = mask['valueFormat'] || (record.get('editorConfig') && record.get('editorConfig').format);
|
|
274
|
+
if (valueFormat) {
|
|
275
|
+
record.set('value', Ext.util.Format.dateRenderer(valueFormat)(value));
|
|
266
276
|
}
|
|
267
|
-
record.
|
|
268
|
-
|
|
277
|
+
const displayFormat = mask['displayFormat'] || (record.get('editorConfig') && record.get('editorConfig').displayFormat) || 'd.m.Y';
|
|
278
|
+
record.set('valueDescription', Ext.util.Format.dateRenderer(displayFormat)(value));
|
|
269
279
|
},
|
|
270
280
|
|
|
271
281
|
/**
|
|
@@ -303,19 +313,19 @@ Ext.define('Coon.common.component.editor.DFVTypeEditor', {
|
|
|
303
313
|
],
|
|
304
314
|
alias: 'widget.DFVTypeEditor',
|
|
305
315
|
|
|
306
|
-
|
|
307
|
-
|
|
316
|
+
setData: function(value, record) {
|
|
317
|
+
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
318
|
+
record.set(ns.$valueDescription, this.field.getVisibleValue());
|
|
319
|
+
},
|
|
320
|
+
|
|
321
|
+
createField: function() {
|
|
322
|
+
return Ext.create(Ext.apply({
|
|
308
323
|
xtype: 'DFVCharacteristicField',
|
|
309
324
|
characteristicType: '',
|
|
310
325
|
listWidth: 350,
|
|
311
326
|
allowBlank: true,
|
|
312
327
|
loadOnRender: false,
|
|
313
|
-
},
|
|
314
|
-
},
|
|
315
|
-
|
|
316
|
-
setData: function(value, record) {
|
|
317
|
-
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
318
|
-
record.set(ns.$valueDescription, this.field.getVisibleValue());
|
|
328
|
+
}, this.record.get('editorConfig')));
|
|
319
329
|
},
|
|
320
330
|
|
|
321
331
|
prepare: function() {
|
|
@@ -30,7 +30,7 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
|
|
|
30
30
|
text: 'Добавить',
|
|
31
31
|
disabled: !this.showEditButtons(),
|
|
32
32
|
hidden: this.hideButtons,
|
|
33
|
-
iconCls: 'svg-icon svg-icon-add',
|
|
33
|
+
// iconCls: 'svg-icon svg-icon-add',
|
|
34
34
|
createSelectWindow: function() {
|
|
35
35
|
return Ext.create('Coon.common.component.editor.CharacteristicForeignWindow');
|
|
36
36
|
},
|
|
@@ -44,7 +44,11 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
|
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
});
|
|
47
|
-
|
|
47
|
+
this.viewConfig = {
|
|
48
|
+
getRowClass: Coon.Function.markDelete(
|
|
49
|
+
'isDeleted'
|
|
50
|
+
),
|
|
51
|
+
};
|
|
48
52
|
this.plugins = Ext.clone(this.plugins) || [];
|
|
49
53
|
|
|
50
54
|
if (this.enableToolBar) {
|
|
@@ -72,7 +76,7 @@ Ext.define('Coon.common.component.editor.TypedCharacteristicEditor', {
|
|
|
72
76
|
add: this.addTypeButton,
|
|
73
77
|
del: {
|
|
74
78
|
text: 'Удалить',
|
|
75
|
-
iconCls: 'svg-icon svg-icon-status-refusing',
|
|
79
|
+
// iconCls: 'svg-icon svg-icon-status-refusing',
|
|
76
80
|
disabled: true,
|
|
77
81
|
hidden: this.hideButtons,
|
|
78
82
|
handler: this.delHandler.bind(this),
|
|
@@ -10,7 +10,7 @@ Ext.define('Coon.common.component.editor.creators.CustomPanelEditorCreator', {
|
|
|
10
10
|
},
|
|
11
11
|
createField: function(record, grid, context) {
|
|
12
12
|
this.context = context;
|
|
13
|
-
this.field = Ext.create({
|
|
13
|
+
this.field = Ext.create(Ext.apply({
|
|
14
14
|
xtype: 'textfield',
|
|
15
15
|
setVisibleValue: function(visibleValue) {
|
|
16
16
|
this.visibleValue = visibleValue;
|
|
@@ -19,7 +19,7 @@ Ext.define('Coon.common.component.editor.creators.CustomPanelEditorCreator', {
|
|
|
19
19
|
return this.visibleValue;
|
|
20
20
|
},
|
|
21
21
|
editable: false,
|
|
22
|
-
});
|
|
22
|
+
}, record.get('editorConfig')));
|
|
23
23
|
return this.field;
|
|
24
24
|
},
|
|
25
25
|
valueIsValidJson: function(str) {
|
|
@@ -7,7 +7,8 @@ Ext.define('Coon.common.component.editor.creators.NoteEditorCreator', {
|
|
|
7
7
|
xtype: 'NoteEditorCreator',
|
|
8
8
|
createField: function(record, parent) {
|
|
9
9
|
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
10
|
-
this.field = Ext.create(
|
|
10
|
+
this.field = Ext.create(Ext.apply({
|
|
11
|
+
xtype: 'OpenDialogField',
|
|
11
12
|
dialogForm: this.showPanel(record, parent),
|
|
12
13
|
getValue: this.getValue,
|
|
13
14
|
noteID: record.get(ns.$value),
|
|
@@ -18,7 +19,7 @@ Ext.define('Coon.common.component.editor.creators.NoteEditorCreator', {
|
|
|
18
19
|
getVisibleValue: function() {
|
|
19
20
|
return this.visibleValue;
|
|
20
21
|
},
|
|
21
|
-
},
|
|
22
|
+
}, record.get('editorConfig')));
|
|
22
23
|
return this.field;
|
|
23
24
|
},
|
|
24
25
|
|
|
@@ -16,15 +16,15 @@ Ext.define('Coon.common.component.editor.creators.NumberEditorCreator', {
|
|
|
16
16
|
return `${first},${rest.join('')}`;
|
|
17
17
|
},
|
|
18
18
|
|
|
19
|
-
createField: function(record
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return Ext.create({
|
|
19
|
+
createField: function(record) {
|
|
20
|
+
return Ext.create(Ext.apply({
|
|
23
21
|
xtype: 'numberfield',
|
|
24
22
|
allowDecimals: true,
|
|
25
23
|
isFieldHighlightOnChange: false,
|
|
26
|
-
decimalPrecision: record.get(
|
|
24
|
+
decimalPrecision: Ext.Object.isEmpty(record.get('editorConfig')) ? (record.get('mask') || 3) : 3,
|
|
27
25
|
enableKeyEvents: true,
|
|
26
|
+
truncate: false,
|
|
27
|
+
decimalSeparator: this.decimalSeparator,
|
|
28
28
|
listeners: {
|
|
29
29
|
keyup: {
|
|
30
30
|
fn: function(f, e) {
|
|
@@ -40,6 +40,22 @@ Ext.define('Coon.common.component.editor.creators.NumberEditorCreator', {
|
|
|
40
40
|
scope: this,
|
|
41
41
|
},
|
|
42
42
|
},
|
|
43
|
-
|
|
43
|
+
fixPrecision: function(value) {
|
|
44
|
+
const me = this;
|
|
45
|
+
const nan = isNaN(value);
|
|
46
|
+
let precision = me.decimalPrecision;
|
|
47
|
+
|
|
48
|
+
if (nan || !value) {
|
|
49
|
+
return nan ? '' : value;
|
|
50
|
+
} else if (!me.allowDecimals || precision <= 0) {
|
|
51
|
+
precision = 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return parseFloat(this.truncate ?
|
|
55
|
+
Ext.Number.truncateToPrecision(parseFloat(value), precision) :
|
|
56
|
+
Ext.Number.toFixed(parseFloat(value), precision)
|
|
57
|
+
);
|
|
58
|
+
},
|
|
59
|
+
}, record.get('editorConfig')));
|
|
44
60
|
},
|
|
45
61
|
});
|
|
@@ -13,8 +13,6 @@ Ext.define('Coon.common.component.editor.creators.SimpleReportEditorCreator', {
|
|
|
13
13
|
alias: 'widget.SimpleReportEditorCreator',
|
|
14
14
|
xtype: 'SimpleReportEditorCreator',
|
|
15
15
|
createField: function(record, parent, context) {
|
|
16
|
-
const ns = Coon.report.model.CharacteristicBeanFields;
|
|
17
|
-
const reportId = record.get(ns.$mask);
|
|
18
16
|
const entityID = parent && parent.model && parent.model.ID;
|
|
19
17
|
const entityTypeID = parent && parent.model && parent.model.subentityId;
|
|
20
18
|
const params = {};
|
|
@@ -24,14 +22,14 @@ Ext.define('Coon.common.component.editor.creators.SimpleReportEditorCreator', {
|
|
|
24
22
|
if (entityTypeID) {
|
|
25
23
|
params['ENTITY'] = entityTypeID;
|
|
26
24
|
}
|
|
27
|
-
return Ext.create({
|
|
25
|
+
return Ext.create(Ext.apply({
|
|
28
26
|
xtype: 'SimplestReportCombo',
|
|
29
|
-
reportId:
|
|
27
|
+
reportId: record.get('mask'),
|
|
30
28
|
defaultParameters: Object.assign(params, context),
|
|
31
29
|
valueField: 'VALUE',
|
|
32
30
|
displayField: 'DESCRIPTION',
|
|
33
31
|
searchBySubstring: true,
|
|
34
|
-
});
|
|
32
|
+
}, record.get('editorConfig')));
|
|
35
33
|
},
|
|
36
34
|
|
|
37
35
|
});
|
|
@@ -3,12 +3,10 @@ Ext.define('Coon.common.component.editor.creators.TimeEditorCreator', {
|
|
|
3
3
|
alias: 'widget.TimeEditorCreator',
|
|
4
4
|
xtype: 'TimeEditorCreator',
|
|
5
5
|
createField: function(record, parent) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
return Ext.create({
|
|
6
|
+
return Ext.create(Ext.apply({
|
|
9
7
|
xtype: 'DeliveryTimeField',
|
|
10
|
-
format: record.get(
|
|
8
|
+
format: Ext.Object.isEmpty(record.get('editorConfig')) ? record.get('mask').trim() || 'H:i' : 'H:i',
|
|
11
9
|
increment: 60,
|
|
12
|
-
});
|
|
10
|
+
}, record.get('editorConfig')));
|
|
13
11
|
},
|
|
14
12
|
});
|
package/src/version.js
CHANGED