ru.coon 2.7.45 → 2.7.46
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 +8 -0
- package/package.json +1 -1
- package/src/common/panel/MainUploadPanel.js +5 -1
- package/src/report/plugin/grid/CopyRowsFromGrid.js +1 -1
- package/src/ringBuffer.js +36 -0
- package/src/uielement/component/UiCustomController.js +20 -2
- package/src/uielement/component/UiCustomPanel.js +19 -1
- package/src/uielement/component/UiCustomPanelTraceWindow.js +50 -0
- package/src/uielement/plugin/AddBindingsPlugin.js +4 -1
- package/src/uielement/plugin/AddDoInitSupportPlugin.js +4 -1
- package/src/uielement/plugin/CustomPanelPlugin.js +41 -3
- package/src/uielement/plugin/ExecuteCommandPlugin.js +4 -1
- package/src/uielement/plugin/ExecuteFunctionPlugin.js +10 -3
- package/src/uielement/plugin/FireEventPlugin.js +4 -1
- package/src/uielement/plugin/MethodChainPlugin.js +4 -1
- package/src/uielement/plugin/OpenPanelPlugin.js +4 -1
- package/src/uielement/plugin/PrintPdfPlugin.js +4 -1
- package/src/util.js +24 -3
- package/src/version.js +1 -1
- package/src/common/field/checkbox/RoundCheckbox.js +0 -5
- package/src/common/field/checkbox/RoundCheckbox.scss +0 -48
- package/src/nav/MenuLoader.js +0 -23
- package/src/report/plugin/grid/ExportReportDataToFilePlugin.md +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
+
# Version 2.7.46, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/19e7bc15c819e0dda639b962060e1993b1f29b6b)
|
|
2
|
+
* upd ([b76ef9], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b76ef97561c257ff2c4956cebd21a69813219c2a))
|
|
3
|
+
* sync ([31dbbf], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/31dbbf2431bf2bbc6aff326d50edc1fd61af841d))
|
|
4
|
+
* update: CHANGELOG.md ([c9af96], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/c9af967e425b3f60570f9bf2198c105c7480f8e6))
|
|
5
|
+
|
|
1
6
|
# Version 2.7.45, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/6d09543c991b7ecfb2ea0f7e4369298dbfd2327f)
|
|
7
|
+
* ## Fixes
|
|
8
|
+
* <span style='color:red'> Added required deps. Related to TR-68743, TR-63848.</span> ([27be06], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/27be06f608741d363f0c7e8521e94aefb2e9ba81))
|
|
9
|
+
|
|
2
10
|
* HT-9325 Контрагент - добавление подсказки для полей, имеющих определенное количество символов ([3b8085], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/3b8085665232b2b937129dde2173bbbc3734ce36))
|
|
3
11
|
* HT-9325 Контрагент - добавление подсказки для полей, имеющих определенное количество символов ([2491d0], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/2491d05dca04c86a97b5d9da3c1720fd5fe55d78))
|
|
4
12
|
* update: CHANGELOG.md ([882183], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/882183d4ad048bfc623600f3235a14081a2c6629))
|
package/package.json
CHANGED
|
@@ -28,7 +28,11 @@ Ext.define('Coon.common.panel.MainUploadPanel', {
|
|
|
28
28
|
alias: 'widget.MainUploadPanel',
|
|
29
29
|
uses: [],
|
|
30
30
|
requires: [
|
|
31
|
-
'Coon.Function'
|
|
31
|
+
'Coon.Function',
|
|
32
|
+
'Coon.log',
|
|
33
|
+
'Coon.MessageResources',
|
|
34
|
+
'Coon.common.panel.ExtFileUploadField',
|
|
35
|
+
'Coon.common.component.Auth'
|
|
32
36
|
],
|
|
33
37
|
alternateClassName: 'Sigma.common.panels.MainUploadPanel',
|
|
34
38
|
bodyStyle: 'padding:5px',
|
|
@@ -434,7 +434,7 @@ Ext.define('Coon.report.plugin.grid.CopyRowsFromGrid', {
|
|
|
434
434
|
}
|
|
435
435
|
try {
|
|
436
436
|
fileName = new Ext.XTemplate(fileName, {strict: true}).apply({
|
|
437
|
-
parameters: this.component.up('ReportPanel').currentParamList,
|
|
437
|
+
parameters: this.component.up('ReportPanel').currentParamList || {},
|
|
438
438
|
});
|
|
439
439
|
} catch (err) {
|
|
440
440
|
Coon.log.warn(err);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
Ext.define('Coon.ringBuffer', {
|
|
2
|
+
statics: {
|
|
3
|
+
maxLength: 2000,
|
|
4
|
+
},
|
|
5
|
+
|
|
6
|
+
constructor(cfg) {
|
|
7
|
+
const buffer = [];
|
|
8
|
+
let cursor = 0;
|
|
9
|
+
this.getLength = () => (cfg.length || this.self.maxLength) - 1;
|
|
10
|
+
this.getBuffer = () => buffer;
|
|
11
|
+
this.getCursor = () => cursor;
|
|
12
|
+
this.advanceCursor = () => {
|
|
13
|
+
if (cursor < this.getLength()) {
|
|
14
|
+
cursor += 1;
|
|
15
|
+
} else {
|
|
16
|
+
cursor = 0;
|
|
17
|
+
}
|
|
18
|
+
return cursor;
|
|
19
|
+
};
|
|
20
|
+
Ext.apply(this, cfg);
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
push(el) {
|
|
24
|
+
this.getBuffer()[this.getCursor()] = {el, idx: Date.now()};
|
|
25
|
+
this.advanceCursor();
|
|
26
|
+
return this;
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
get() {
|
|
30
|
+
return this.getBuffer().sort((a, b) => a.idx - b.idx);
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
getElements() {
|
|
34
|
+
return this.get().map(({el, idx}) => Object.assign(el, {time: new Date(idx)}));
|
|
35
|
+
},
|
|
36
|
+
});
|
|
@@ -3,7 +3,12 @@ Ext.define('Coon.uielement.component.UiCustomController', {
|
|
|
3
3
|
alias: 'controller.UiCustomController',
|
|
4
4
|
requires: ['Coon.security.Manager'],
|
|
5
5
|
|
|
6
|
+
locals: {},
|
|
7
|
+
|
|
6
8
|
init: function(view) {
|
|
9
|
+
if (this.isTracePluginsEnabled()) {
|
|
10
|
+
this.getTraceBuffer();
|
|
11
|
+
}
|
|
7
12
|
const config = view.propertyData || view.initialConfig;
|
|
8
13
|
if (!view || typeof view.on !== 'function') {
|
|
9
14
|
Coon.log.debug(` [Error]UiCustomController.init - view not found or view.on is not a function`);
|
|
@@ -16,7 +21,6 @@ Ext.define('Coon.uielement.component.UiCustomController', {
|
|
|
16
21
|
return;
|
|
17
22
|
}
|
|
18
23
|
const viewButtons = view.query('button');
|
|
19
|
-
// console.time('UiCustomController.buttons');
|
|
20
24
|
const allowedMap = new Set(accessDecision.allowedItems);
|
|
21
25
|
if (Ext.isObject(securePoints.buttons) && Object.keys(securePoints.buttons).length) {
|
|
22
26
|
Coon.log.debug(`used securePoints, allowed: ${accessDecision.allowedItems}, secureButtons: ${Object.keys(securePoints.buttons)}`);
|
|
@@ -45,7 +49,6 @@ Ext.define('Coon.uielement.component.UiCustomController', {
|
|
|
45
49
|
}
|
|
46
50
|
});
|
|
47
51
|
}
|
|
48
|
-
// console.timeEnd('UiCustomController.buttons');
|
|
49
52
|
}, this);
|
|
50
53
|
},
|
|
51
54
|
|
|
@@ -94,6 +97,7 @@ Ext.define('Coon.uielement.component.UiCustomController', {
|
|
|
94
97
|
Coon.util.copyToClipboard(url);
|
|
95
98
|
Ext.toast('Ссылка скопирована в буфер обмена!');
|
|
96
99
|
},
|
|
100
|
+
|
|
97
101
|
applyRestrictions(map) {
|
|
98
102
|
Coon.security.Manager.sync({map, component: this.getView()});
|
|
99
103
|
},
|
|
@@ -107,4 +111,18 @@ Ext.define('Coon.uielement.component.UiCustomController', {
|
|
|
107
111
|
const map = ctx.toJSON().map;
|
|
108
112
|
return {buttons: map && map.buttons};
|
|
109
113
|
},
|
|
114
|
+
|
|
115
|
+
getTraceBuffer() {
|
|
116
|
+
if (!this.locals.traceBuffer) {
|
|
117
|
+
this.locals.traceBuffer = Ext.create('Coon.ringBuffer', {length: 1000});
|
|
118
|
+
}
|
|
119
|
+
return this.locals.traceBuffer;
|
|
120
|
+
},
|
|
121
|
+
|
|
122
|
+
isTracePluginsEnabled() {
|
|
123
|
+
return Boolean(
|
|
124
|
+
Coon.setup.get('trace.cpPlugins')
|
|
125
|
+
);
|
|
126
|
+
},
|
|
127
|
+
|
|
110
128
|
});
|
|
@@ -4,12 +4,30 @@ Ext.define('Coon.uielement.component.UiCustomPanel', {
|
|
|
4
4
|
xtype: 'UiCustomPanel',
|
|
5
5
|
uses: [],
|
|
6
6
|
requires: [
|
|
7
|
-
'Coon.uielement.component.UiCustomController'
|
|
7
|
+
'Coon.uielement.component.UiCustomController',
|
|
8
|
+
'Coon.uielement.plugin.CustomPanelPlugin',
|
|
9
|
+
'Coon.uielement.component.UiCustomPanelTraceWindow'
|
|
8
10
|
],
|
|
9
11
|
controller: {type: 'UiCustomController'},
|
|
10
12
|
viewModel: {type: 'UiCustomPanelViewModel'},
|
|
11
13
|
|
|
12
14
|
keyMap: {
|
|
15
|
+
'Ctrl+Shift+Alt+F8': {
|
|
16
|
+
handler(_, view) {
|
|
17
|
+
const scope = view.getController();
|
|
18
|
+
if (!scope) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const win = Ext.create({xtype: 'UiCustomPanelTraceWindow'});
|
|
22
|
+
if (win.isTraceEnabled(scope)) {
|
|
23
|
+
const traceBuffer = scope.getTraceBuffer();
|
|
24
|
+
win.down('grid')
|
|
25
|
+
.getStore()
|
|
26
|
+
.loadData(traceBuffer.getElements());
|
|
27
|
+
win.show();
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
},
|
|
13
31
|
'Ctrl+Alt+U': {
|
|
14
32
|
handler: function(_, scope) {
|
|
15
33
|
const inputParameters = scope.getController().inputParameters().map((el) => el.name);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
Ext.define('Coon.uielement.component.UiCustomPanelTraceWindow', {
|
|
2
|
+
extend: 'Ext.window.Window',
|
|
3
|
+
|
|
4
|
+
xtype: 'UiCustomPanelTraceWindow',
|
|
5
|
+
|
|
6
|
+
title: 'трассировка выполнения плагинов',
|
|
7
|
+
|
|
8
|
+
scrollable: 'y',
|
|
9
|
+
|
|
10
|
+
width: 800,
|
|
11
|
+
height: 600,
|
|
12
|
+
modal: true,
|
|
13
|
+
maximizable: true,
|
|
14
|
+
layout: 'fit',
|
|
15
|
+
|
|
16
|
+
items: [
|
|
17
|
+
{
|
|
18
|
+
xtype: 'grid',
|
|
19
|
+
store: {
|
|
20
|
+
type: 'json',
|
|
21
|
+
},
|
|
22
|
+
columns: [
|
|
23
|
+
{xtype: 'datecolumn', dataIndex: 'time', text: 'время', flex: 1, format: 'h:m:s.u'},
|
|
24
|
+
{dataIndex: 'ptype', text: 'плагин', flex: 1},
|
|
25
|
+
{dataIndex: 'handlerName', text: 'название обработчика', flex: 1},
|
|
26
|
+
{
|
|
27
|
+
dataIndex: 'args',
|
|
28
|
+
text: 'args',
|
|
29
|
+
flex: 1,
|
|
30
|
+
renderer(args) {
|
|
31
|
+
return Array.isArray(args) && args.map((arg) => Coon.util.runIfTypeIn(
|
|
32
|
+
arg,
|
|
33
|
+
['boolean', 'string', 'integer'],
|
|
34
|
+
() => arg,
|
|
35
|
+
Coon.util.typeOf
|
|
36
|
+
)).join('<br />') || 'empty';
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
}
|
|
41
|
+
],
|
|
42
|
+
|
|
43
|
+
isTraceEnabled(scope) {
|
|
44
|
+
return Boolean(
|
|
45
|
+
scope &&
|
|
46
|
+
typeof scope.isTracePluginsEnabled === 'function' ||
|
|
47
|
+
scope.isTracePluginsEnabled()
|
|
48
|
+
);
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.plugin.AddBindingsPlugin', {
|
|
2
|
-
extend: '
|
|
2
|
+
extend: 'Coon.uielement.plugin.CustomPanelPlugin',
|
|
3
3
|
alias: 'plugin.AddBindingsPlugin',
|
|
4
4
|
uses: [],
|
|
5
5
|
configurePanelWizardForFormEditor: 'AddBindingsPluginConfigPanelFormEditor',
|
|
@@ -11,6 +11,9 @@ Ext.define('Coon.uielement.plugin.AddBindingsPlugin', {
|
|
|
11
11
|
|
|
12
12
|
init: function(view) {
|
|
13
13
|
const controller = view.getController();
|
|
14
|
+
if (this.isTraceEnabled()) {
|
|
15
|
+
this.tracePlugin(this.bindings);
|
|
16
|
+
}
|
|
14
17
|
if (controller) {
|
|
15
18
|
controller.setBindings(this.bindings);
|
|
16
19
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.plugin.AddDoInitSupportPlugin', {
|
|
2
|
-
extend: '
|
|
2
|
+
extend: 'Coon.uielement.plugin.CustomPanelPlugin',
|
|
3
3
|
alias: 'plugin.AddDoInitSupportPlugin',
|
|
4
4
|
uses: [],
|
|
5
5
|
configurePanelWizardForFormEditor: 'AddDoInitSupportPluginConfigPanel',
|
|
@@ -49,6 +49,9 @@ Ext.define('Coon.uielement.plugin.AddDoInitSupportPlugin', {
|
|
|
49
49
|
});
|
|
50
50
|
},
|
|
51
51
|
handler: function(...parameters) { // Инициализируем во ViewModel входные параметры
|
|
52
|
+
if (this.isTraceEnabled()) {
|
|
53
|
+
this.tracePlugin(...parameters);
|
|
54
|
+
}
|
|
52
55
|
const dataMapping = this.getInputParams();
|
|
53
56
|
parameters.forEach((el, index) => {
|
|
54
57
|
if (el !== undefined && el !== null && this.validatePath(dataMapping[index].valuePath)) {
|
|
@@ -1,18 +1,56 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.plugin.CustomPanelPlugin', {
|
|
2
2
|
extend: 'Ext.AbstractPlugin',
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
locals: {},
|
|
5
|
+
|
|
6
|
+
getExecuteScope() {
|
|
7
|
+
if (this.locals.executeScope) {
|
|
8
|
+
return this.locals.executeScope;
|
|
9
|
+
}
|
|
5
10
|
let scope;
|
|
6
11
|
if (this.getScope && this.getScope() === 'view') {
|
|
7
12
|
scope = this.getCmp();
|
|
8
13
|
} else {
|
|
9
14
|
scope = this.getCmp().getController() || this.getCmp();
|
|
10
15
|
}
|
|
16
|
+
this.locals.executeScope = scope;
|
|
17
|
+
return scope;
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
bindHandler(names) {
|
|
21
|
+
const executeScope = this.getExecuteScope();
|
|
11
22
|
if (!this.handlerName) {
|
|
12
23
|
throw new Error(`${this.$className}: handlerName cant be empty!`);
|
|
13
24
|
}
|
|
14
25
|
|
|
15
|
-
Coon.util.bindMethods(this.handlerName,
|
|
16
|
-
return
|
|
26
|
+
Coon.util.bindMethods(names || this.handlerName, executeScope, this.getCmp(), executeScope);
|
|
27
|
+
return executeScope;
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
isTraceEnabled() {
|
|
31
|
+
return typeof this.getExecuteScope().isTracePluginsEnabled === 'function' &&
|
|
32
|
+
this.getExecuteScope().isTracePluginsEnabled();
|
|
33
|
+
},
|
|
34
|
+
|
|
35
|
+
getPtype() {
|
|
36
|
+
const alias = Array.isArray(this.alias) && this.alias[0] || this.alias;
|
|
37
|
+
this.locals.ptype = alias ? alias.split('plugin.').pop() : this.$className.split('.').pop();
|
|
38
|
+
return this.locals.ptype;
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
tracePlugin(...args) {
|
|
42
|
+
this.logTraceMessages({
|
|
43
|
+
ptype: this.getPtype(),
|
|
44
|
+
handlerName: this.handlerName && this.handlerName.toString() || '-/-',
|
|
45
|
+
args,
|
|
46
|
+
});
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
logTraceMessages(msg) {
|
|
50
|
+
const scope = this.getExecuteScope();
|
|
51
|
+
if (!scope.locals.traceBuffer) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
scope.locals.traceBuffer.push(msg);
|
|
17
55
|
},
|
|
18
56
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.plugin.ExecuteCommandPlugin', {
|
|
2
|
-
extend: '
|
|
2
|
+
extend: 'Coon.uielement.plugin.CustomPanelPlugin',
|
|
3
3
|
alias: 'plugin.ExecuteCommandPlugin',
|
|
4
4
|
requires: [
|
|
5
5
|
'Coon.log',
|
|
@@ -72,6 +72,9 @@ Ext.define('Coon.uielement.plugin.ExecuteCommandPlugin', {
|
|
|
72
72
|
|
|
73
73
|
handler: function() {
|
|
74
74
|
const parameters = Ext.decode(Ext.encode(this.parameters));
|
|
75
|
+
if (this.isTraceEnabled()) {
|
|
76
|
+
this.tracePlugin(parameters);
|
|
77
|
+
}
|
|
75
78
|
return new Promise((resolve, reject) => {
|
|
76
79
|
this.setDisabled(true);
|
|
77
80
|
if (this.ctype) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.plugin.ExecuteFunctionPlugin', {
|
|
2
|
-
extend: '
|
|
2
|
+
extend: 'Coon.uielement.plugin.CustomPanelPlugin',
|
|
3
3
|
alias: 'plugin.ExecuteFunctionPlugin',
|
|
4
4
|
uses: [],
|
|
5
5
|
configurePanelWizardForFormEditor: 'ExecuteFunctionPluginConfigPanelFormEditor',
|
|
@@ -20,7 +20,14 @@ Ext.define('Coon.uielement.plugin.ExecuteFunctionPlugin', {
|
|
|
20
20
|
console.error("Error in " + '${this.handlerName}' + ' : ', e.stack);
|
|
21
21
|
throw e;
|
|
22
22
|
}`;
|
|
23
|
-
|
|
24
|
-
this.
|
|
23
|
+
const me = this;
|
|
24
|
+
const fn = (new Function(this.getFnParameters() || '', wrappedBody || '')).bind(this.executeScope);
|
|
25
|
+
this.executeScope[this.handlerName] =
|
|
26
|
+
function(...args) {
|
|
27
|
+
if (me.isTraceEnabled()) {
|
|
28
|
+
me.tracePlugin(...args);
|
|
29
|
+
}
|
|
30
|
+
return fn(...args);
|
|
31
|
+
};
|
|
25
32
|
},
|
|
26
33
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.plugin.FireEventPlugin', {
|
|
2
|
-
extend: '
|
|
2
|
+
extend: 'Coon.uielement.plugin.CustomPanelPlugin',
|
|
3
3
|
alias: 'plugin.FireEventPlugin',
|
|
4
4
|
uses: [],
|
|
5
5
|
configurePanelWizardForFormEditor: 'FireEventPluginConfigPanelFormEditor',
|
|
@@ -18,6 +18,9 @@ Ext.define('Coon.uielement.plugin.FireEventPlugin', {
|
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
handler: function() {
|
|
21
|
+
if (this.isTraceEnabled()) {
|
|
22
|
+
this.tracePlugin(this.eventName);
|
|
23
|
+
}
|
|
21
24
|
const eventArguments = [this.eventName];
|
|
22
25
|
for (let i = 0; i < this.parameters.length; i++) {
|
|
23
26
|
let paramValue = this.parameters[i];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.plugin.MethodChainPlugin', {
|
|
2
|
-
extend: '
|
|
2
|
+
extend: 'Coon.uielement.plugin.CustomPanelPlugin',
|
|
3
3
|
alias: 'plugin.MethodChainPlugin',
|
|
4
4
|
uses: [],
|
|
5
5
|
configurePanelWizardForFormEditor: 'MethodChainPluginConfigPanelFormEditor',
|
|
@@ -28,6 +28,9 @@ Ext.define('Coon.uielement.plugin.MethodChainPlugin', {
|
|
|
28
28
|
this.controller[this.errorHandlers[methodName]].bind(this.controller);
|
|
29
29
|
},
|
|
30
30
|
async handler() {
|
|
31
|
+
if (this.isTraceEnabled()) {
|
|
32
|
+
this.tracePlugin();
|
|
33
|
+
}
|
|
31
34
|
for (const methodName of this.methodNames) {
|
|
32
35
|
let result;
|
|
33
36
|
if (typeof this.controller[methodName] === 'function') {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.plugin.OpenPanelPlugin', {
|
|
2
|
-
extend: '
|
|
2
|
+
extend: 'Coon.uielement.plugin.CustomPanelPlugin',
|
|
3
3
|
alias: 'plugin.OpenPanelPlugin',
|
|
4
4
|
uses: [],
|
|
5
5
|
mixins: [
|
|
@@ -36,6 +36,9 @@ Ext.define('Coon.uielement.plugin.OpenPanelPlugin', {
|
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
handler: function() {
|
|
39
|
+
if (this.isTraceEnabled()) {
|
|
40
|
+
this.tracePlugin(this.config.uiElementCd);
|
|
41
|
+
}
|
|
39
42
|
this.uiElementCd = this.config.uiElementCd;
|
|
40
43
|
if (this.uiElementCd) {
|
|
41
44
|
this.uiElementCd = this.getFromModel(this.uiElementCd);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Ext.define('Coon.uielement.plugin.PrintPdfPlugin', {
|
|
2
|
-
extend: '
|
|
2
|
+
extend: 'Coon.uielement.plugin.CustomPanelPlugin',
|
|
3
3
|
alias: 'plugin.PrintPdfPlugin',
|
|
4
4
|
uses: [],
|
|
5
5
|
configurePanelWizardForFormEditor: 'PrintPdfPluginConfigPanelFormEditor',
|
|
@@ -69,6 +69,9 @@ Ext.define('Coon.uielement.plugin.PrintPdfPlugin', {
|
|
|
69
69
|
},
|
|
70
70
|
|
|
71
71
|
handler: function() {
|
|
72
|
+
if (this.isTraceEnabled()) {
|
|
73
|
+
this.tracePlugin();
|
|
74
|
+
}
|
|
72
75
|
return new Promise((resolve, reject) => {
|
|
73
76
|
this.setDisabled(true);
|
|
74
77
|
if (this.ctype) {
|
package/src/util.js
CHANGED
|
@@ -534,7 +534,21 @@ Ext.define('Coon.util', {
|
|
|
534
534
|
|
|
535
535
|
isTypeIn(data, types) {
|
|
536
536
|
return Array.isArray(types) &&
|
|
537
|
-
types.
|
|
537
|
+
types.includes(Coon.util.typeOf(data));
|
|
538
|
+
},
|
|
539
|
+
|
|
540
|
+
runIfTypeIn(data, types, trueFn, falseFn) {
|
|
541
|
+
if (Coon.util.isTypeIn(data, types)) {
|
|
542
|
+
if (typeof trueFn === 'function') {
|
|
543
|
+
return trueFn(data);
|
|
544
|
+
} else {
|
|
545
|
+
return data;
|
|
546
|
+
}
|
|
547
|
+
} else {
|
|
548
|
+
if (typeof falseFn === 'function') {
|
|
549
|
+
return falseFn(data);
|
|
550
|
+
}
|
|
551
|
+
}
|
|
538
552
|
},
|
|
539
553
|
|
|
540
554
|
typeEqual(src, dst) {
|
|
@@ -629,14 +643,21 @@ Ext.define('Coon.util', {
|
|
|
629
643
|
* @param {*} scope context
|
|
630
644
|
* @returns
|
|
631
645
|
*/
|
|
632
|
-
bindMethods(methods, from, to, scope) {
|
|
646
|
+
bindMethods(methods, from, to, scope, force) {
|
|
647
|
+
if (typeof methods === 'string') {
|
|
648
|
+
methods = [methods];
|
|
649
|
+
}
|
|
633
650
|
if (!Array.isArray(methods) || !Ext.isObject(from) || !Ext.isObject(to)) {
|
|
634
651
|
return;
|
|
635
652
|
}
|
|
636
653
|
methods.forEach((name) => {
|
|
637
654
|
const method = from[name];
|
|
638
655
|
if (typeof method === 'function') {
|
|
639
|
-
|
|
656
|
+
if (force) {
|
|
657
|
+
to[name] = method.bind(scope || from);
|
|
658
|
+
} else if (!to[name]) {
|
|
659
|
+
to[name] = method.bind(scope || from);
|
|
660
|
+
}
|
|
640
661
|
}
|
|
641
662
|
});
|
|
642
663
|
},
|
package/src/version.js
CHANGED
|
@@ -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
|
-
}
|
package/src/nav/MenuLoader.js
DELETED
|
@@ -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
|
-
});
|