tplus-components-touch 3.54.1 → 3.55.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/components/cloudPrint/printTemplate/template.js +52 -0
- package/dist/components/cloudPrint/printTemplate/template.js.map +1 -0
- package/dist/components/commonForm/addressPicker/index.js +255 -0
- package/dist/components/commonForm/addressPicker/index.js.map +1 -0
- package/dist/components/commonForm/autoComplete/index.js +260 -0
- package/dist/components/commonForm/autoComplete/index.js.map +1 -0
- package/dist/components/commonForm/datePicker/index.js +92 -0
- package/dist/components/commonForm/datePicker/index.js.map +1 -0
- package/dist/components/commonForm/formControl/index.js +144 -0
- package/dist/components/commonForm/formControl/index.js.map +1 -0
- package/dist/components/commonForm/index.js +231 -0
- package/dist/components/commonForm/index.js.map +1 -0
- package/dist/components/commonForm/inputNumber/index.js +272 -0
- package/dist/components/commonForm/inputNumber/index.js.map +1 -0
- package/dist/components/commonForm/radio/index.js +132 -0
- package/dist/components/commonForm/radio/index.js.map +1 -0
- package/dist/components/deliverySearch/api.js +355 -0
- package/dist/components/deliverySearch/api.js.map +1 -0
- package/dist/components/deliverySearch/index.js +1222 -0
- package/dist/components/deliverySearch/index.js.map +1 -0
- package/dist/components/form/index.js +310 -0
- package/dist/components/form/index.js.map +1 -0
- package/dist/components/hardwareAPI/index.js +215 -0
- package/dist/components/hardwareAPI/index.js.map +1 -0
- package/dist/components/hotKey/config.js +306 -0
- package/dist/components/hotKey/config.js.map +1 -0
- package/dist/components/hotKey/hotKeyModal.js +479 -0
- package/dist/components/hotKey/hotKeyModal.js.map +1 -0
- package/dist/components/hotKey/index.js +795 -0
- package/dist/components/hotKey/index.js.map +1 -0
- package/dist/components/hotKey/localConfig.js +1216 -0
- package/dist/components/hotKey/localConfig.js.map +1 -0
- package/dist/components/hotKey/utils.js +135 -0
- package/dist/components/hotKey/utils.js.map +1 -0
- package/dist/components/input/index.js +254 -0
- package/dist/components/input/index.js.map +1 -0
- package/dist/components/input/scanInput.js +98 -0
- package/dist/components/input/scanInput.js.map +1 -0
- package/dist/components/input/tplusInput/index.js +81 -0
- package/dist/components/input/tplusInput/index.js.map +1 -0
- package/dist/components/input/tplusInput/inputContent.js +128 -0
- package/dist/components/input/tplusInput/inputContent.js.map +1 -0
- package/dist/components/input/tplusInput/inputs.js +151 -0
- package/dist/components/input/tplusInput/inputs.js.map +1 -0
- package/dist/components/input/utils/index.js +26 -0
- package/dist/components/input/utils/index.js.map +1 -0
- package/dist/components/inventorySearch/api.js +214 -0
- package/dist/components/inventorySearch/api.js.map +1 -0
- package/dist/components/inventorySearch/index.js +303 -0
- package/dist/components/inventorySearch/index.js.map +1 -0
- package/dist/components/inventorySearch/store.js +363 -0
- package/dist/components/inventorySearch/store.js.map +1 -0
- package/dist/components/inventorySearch/tab.js +280 -0
- package/dist/components/inventorySearch/tab.js.map +1 -0
- package/dist/components/keyboard/index.js +259 -0
- package/dist/components/keyboard/index.js.map +1 -0
- package/dist/components/keyboard/letterKeyboard.js +227 -0
- package/dist/components/keyboard/letterKeyboard.js.map +1 -0
- package/dist/components/keyboard/numKeyboard.js +469 -0
- package/dist/components/keyboard/numKeyboard.js.map +1 -0
- package/dist/components/keyboard/numKeyboardScan.js +208 -0
- package/dist/components/keyboard/numKeyboardScan.js.map +1 -0
- package/dist/components/keyboard/numberButton_input.js +305 -0
- package/dist/components/keyboard/numberButton_input.js.map +1 -0
- package/dist/components/keyboard/numkeyboardPassword.js +477 -0
- package/dist/components/keyboard/numkeyboardPassword.js.map +1 -0
- package/dist/components/keyboard/onlyKeyboard.js +90 -0
- package/dist/components/keyboard/onlyKeyboard.js.map +1 -0
- package/dist/components/keyboard/onlyLetterButton.js +187 -0
- package/dist/components/keyboard/onlyLetterButton.js.map +1 -0
- package/dist/components/keyboard/onlyLetterButton2.js +235 -0
- package/dist/components/keyboard/onlyLetterButton2.js.map +1 -0
- package/dist/components/keyboard/onlyNumberButton.js +128 -0
- package/dist/components/keyboard/onlyNumberButton.js.map +1 -0
- package/dist/components/keyboard/onlyNumberButton2.js +115 -0
- package/dist/components/keyboard/onlyNumberButton2.js.map +1 -0
- package/dist/components/keyboard/textKeyboard.js +50 -0
- package/dist/components/keyboard/textKeyboard.js.map +1 -0
- package/dist/components/layout/hamburger.js +29 -0
- package/dist/components/layout/hamburger.js.map +1 -0
- package/dist/components/layout/index.js +31 -0
- package/dist/components/layout/index.js.map +1 -0
- package/dist/components/layout/layout.js +182 -0
- package/dist/components/layout/layout.js.map +1 -0
- package/dist/components/layout/sider.js +167 -0
- package/dist/components/layout/sider.js.map +1 -0
- package/dist/components/loading/index.js +198 -0
- package/dist/components/loading/index.js.map +1 -0
- package/dist/components/loading/loadingContent.js +188 -0
- package/dist/components/loading/loadingContent.js.map +1 -0
- package/dist/components/loading/utils.js +29 -0
- package/dist/components/loading/utils.js.map +1 -0
- package/dist/components/message/index.js +309 -0
- package/dist/components/message/index.js.map +1 -0
- package/dist/components/modal/index.js +93 -0
- package/dist/components/modal/index.js.map +1 -0
- package/dist/components/modalVertical/index.js +325 -0
- package/dist/components/modalVertical/index.js.map +1 -0
- package/dist/components/modalWraper/index.js +485 -0
- package/dist/components/modalWraper/index.js.map +1 -0
- package/dist/components/modalWraper/utils.js +48 -0
- package/dist/components/modalWraper/utils.js.map +1 -0
- package/dist/components/notification/index.js +118 -0
- package/dist/components/notification/index.js.map +1 -0
- package/dist/components/overflowTip/index.js +269 -0
- package/dist/components/overflowTip/index.js.map +1 -0
- package/dist/components/page/index.js +49 -0
- package/dist/components/page/index.js.map +1 -0
- package/dist/components/presale/pickup.js +479 -0
- package/dist/components/presale/pickup.js.map +1 -0
- package/dist/components/product/detail.js +148 -0
- package/dist/components/product/detail.js.map +1 -0
- package/dist/components/product/getCard.js +145 -0
- package/dist/components/product/getCard.js.map +1 -0
- package/dist/components/progressState/EmptyAndErrorView.js +142 -0
- package/dist/components/progressState/EmptyAndErrorView.js.map +1 -0
- package/dist/components/progressState/ProgressState.js +158 -0
- package/dist/components/progressState/ProgressState.js.map +1 -0
- package/dist/components/progressState/index.js +14 -0
- package/dist/components/progressState/index.js.map +1 -0
- package/dist/components/scan/index.js +219 -0
- package/dist/components/scan/index.js.map +1 -0
- package/dist/components/select/index.js +28 -0
- package/dist/components/select/index.js.map +1 -0
- package/dist/components/settlement/asyncModal.js +207 -0
- package/dist/components/settlement/asyncModal.js.map +1 -0
- package/dist/components/settlement/index.js +25 -0
- package/dist/components/settlement/index.js.map +1 -0
- package/dist/components/settlement/moreCzkTable/index.js +156 -0
- package/dist/components/settlement/moreCzkTable/index.js.map +1 -0
- package/dist/components/settlement/prototypeTable/index.js +353 -0
- package/dist/components/settlement/prototypeTable/index.js.map +1 -0
- package/dist/components/settlement/prototypeTable/utils.js +14 -0
- package/dist/components/settlement/prototypeTable/utils.js.map +1 -0
- package/dist/components/settlement/settlement.js +5557 -0
- package/dist/components/settlement/settlement.js.map +1 -0
- package/dist/components/settlement/settlement.less +0 -10
- package/dist/components/settlement/settlementApi.js +512 -0
- package/dist/components/settlement/settlementApi.js.map +1 -0
- package/dist/components/settlement/settlementStore.js +2833 -0
- package/dist/components/settlement/settlementStore.js.map +1 -0
- package/dist/components/settlement/utils.js +249 -0
- package/dist/components/settlement/utils.js.map +1 -0
- package/dist/components/socket/index.js +221 -0
- package/dist/components/socket/index.js.map +1 -0
- package/dist/components/spin/index.js +95 -0
- package/dist/components/spin/index.js.map +1 -0
- package/dist/components/test/index.js +330 -0
- package/dist/components/test/index.js.map +1 -0
- package/dist/components/ticon/iconfont/demo_index.html +3 -72
- package/dist/components/ticon/iconfont/iconfont.css +3 -15
- package/dist/components/ticon/iconfont/iconfont.js +36 -0
- package/dist/components/ticon/iconfont/iconfont.js.map +1 -0
- package/dist/components/ticon/iconfont/iconfont.json +0 -21
- package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
- package/dist/components/ticon/index.js +60 -0
- package/dist/components/ticon/index.js.map +1 -0
- package/dist/components/touchScroll/index.js +186 -0
- package/dist/components/touchScroll/index.js.map +1 -0
- package/dist/components/touchTable/AuthProcess.js +42 -0
- package/dist/components/touchTable/AuthProcess.js.map +1 -0
- package/dist/components/touchTable/generateWater.js +59 -0
- package/dist/components/touchTable/generateWater.js.map +1 -0
- package/dist/components/touchTable/index.js +1148 -0
- package/dist/components/touchTable/index.js.map +1 -0
- package/dist/components/touchTable/utils.js +27 -0
- package/dist/components/touchTable/utils.js.map +1 -0
- package/dist/index.js +1 -22
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/collection/api.js +0 -105
- package/dist/components/collection/api.js.map +0 -1
- package/dist/components/collection/searchView/index.less +0 -134
- package/dist/components/password/style.less +0 -95
@@ -0,0 +1,795 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
|
7
|
+
var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray');
|
8
|
+
|
9
|
+
var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
|
10
|
+
|
11
|
+
var _from = require('babel-runtime/core-js/array/from');
|
12
|
+
|
13
|
+
var _from2 = _interopRequireDefault(_from);
|
14
|
+
|
15
|
+
var _getIterator2 = require('babel-runtime/core-js/get-iterator');
|
16
|
+
|
17
|
+
var _getIterator3 = _interopRequireDefault(_getIterator2);
|
18
|
+
|
19
|
+
var _promise = require('babel-runtime/core-js/promise');
|
20
|
+
|
21
|
+
var _promise2 = _interopRequireDefault(_promise);
|
22
|
+
|
23
|
+
var _extends2 = require('babel-runtime/helpers/extends');
|
24
|
+
|
25
|
+
var _extends3 = _interopRequireDefault(_extends2);
|
26
|
+
|
27
|
+
var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');
|
28
|
+
|
29
|
+
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
|
30
|
+
|
31
|
+
var _keys = require('babel-runtime/core-js/object/keys');
|
32
|
+
|
33
|
+
var _keys2 = _interopRequireDefault(_keys);
|
34
|
+
|
35
|
+
var _keymaster = require('keymaster');
|
36
|
+
|
37
|
+
var _keymaster2 = _interopRequireDefault(_keymaster);
|
38
|
+
|
39
|
+
var _utils = require('./utils');
|
40
|
+
|
41
|
+
var _config = require('./config');
|
42
|
+
|
43
|
+
var _hotKeyModal = require('./hotKeyModal');
|
44
|
+
|
45
|
+
var _mutantsUtil = require('mutants-util');
|
46
|
+
|
47
|
+
var _mutantsMicrofx = require('mutants-microfx');
|
48
|
+
|
49
|
+
require('./style.less');
|
50
|
+
|
51
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
52
|
+
|
53
|
+
var keyboard = _keymaster2.default.noConflict(); /**
|
54
|
+
* Created by hzy on 2019/11/27.
|
55
|
+
*/
|
56
|
+
/**
|
57
|
+
* @hotKey(option) 调用hotKey方法初始化状态
|
58
|
+
* @option 可传入选项 {handler: 全局的句柄默认为$}
|
59
|
+
* @observerCallback dom变化后的回调
|
60
|
+
* @log 是否显示log
|
61
|
+
* @hotKeyConfig 快捷键配置项
|
62
|
+
* @operationControl 快捷键权限控制
|
63
|
+
* @clickBefore 点击事件前的回调方法
|
64
|
+
*
|
65
|
+
* 初始化后的方法
|
66
|
+
* action 传入第一个参数 按键字符串,触发config中的动作,返回一个promise,执行then方法可以从参数中拿到当前的上下文对象
|
67
|
+
* action 第二个参数为回调函数,回调函数的参数会返回当前的动作触发的元素属性以及当前为第几步
|
68
|
+
*
|
69
|
+
* observer 监听dom变化,第一个参数为监听的dom目标,第二个参数为配置 具体查看 new MutationObserver observer
|
70
|
+
* find 查找dom,可链式调用
|
71
|
+
* next 查找下一个兄弟节点,参数中可传入数量跳过几个相邻的
|
72
|
+
* prev 查找上一个兄弟节点,参数中可传入数量跳过几个相邻的
|
73
|
+
* click 触发点击事件
|
74
|
+
* register 注册一个全局的快捷键,第一个方法参数为快捷键名,第二个方法参数为目标容器class名,第三个方法参数为触发事件dom class名
|
75
|
+
* unRegister 注销一个全局的快捷键
|
76
|
+
*
|
77
|
+
*
|
78
|
+
* config & control 说明 见 ./config.js 文件
|
79
|
+
*
|
80
|
+
*/
|
81
|
+
|
82
|
+
|
83
|
+
var hotKeyFactory = {
|
84
|
+
constructor: function constructor() {
|
85
|
+
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
86
|
+
_ref$keys = _ref.keys,
|
87
|
+
keys = _ref$keys === undefined ? [] : _ref$keys,
|
88
|
+
_ref$handler = _ref.handler,
|
89
|
+
handler = _ref$handler === undefined ? '$' : _ref$handler,
|
90
|
+
observerCallback = _ref.observerCallback,
|
91
|
+
pressed = _ref.pressed,
|
92
|
+
_ref$log = _ref.log,
|
93
|
+
log = _ref$log === undefined ? false : _ref$log,
|
94
|
+
_ref$hotKeyConfig = _ref.hotKeyConfig,
|
95
|
+
hotKeyConfig = _ref$hotKeyConfig === undefined ? _config.hotKeyConfig : _ref$hotKeyConfig,
|
96
|
+
_ref$operationControl = _ref.operationControl,
|
97
|
+
operationControl = _ref$operationControl === undefined ? _config.operationControl : _ref$operationControl,
|
98
|
+
filter = _ref.filter,
|
99
|
+
clickBefore = _ref.clickBefore;
|
100
|
+
|
101
|
+
// keys = ['esc', 'enter', 'ctrl+f1', ...Object.keys(hotKeyInjectOrEject)];
|
102
|
+
var observe = observerCallback && new MutationObserver(observerCallback);
|
103
|
+
hotKeyFactory.showLog = log;
|
104
|
+
// 如果快捷键配置不存在使用默认
|
105
|
+
var defineHotKeyConfig = this.getDefineHotKeyConfigByStore();
|
106
|
+
|
107
|
+
// hotKeyFactory.hotKeyConfig = Object.keys(defineHotKeyConfig).length?defineHotKeyConfig:hotKeyConfig;
|
108
|
+
hotKeyFactory.hotKeyConfig = (0, _keys2.default)(defineHotKeyConfig).length ? defineHotKeyConfig : hotKeyConfig;
|
109
|
+
keys = keys.length == 0 ? ['esc', 'enter', 'ctrl+f1'].concat((0, _toConsumableArray3.default)((0, _keys2.default)(hotKeyFactory.hotKeyConfig))) : keys;
|
110
|
+
|
111
|
+
// 删除原来挂载的按键监听
|
112
|
+
if (window[handler]) {
|
113
|
+
keyboard.deleteScope(keyboard.getScope());
|
114
|
+
}
|
115
|
+
keyboard(keys.join(), pressed);
|
116
|
+
keyboard.filter = filter;
|
117
|
+
|
118
|
+
var defineOperationControl = this.getDefineOperationControlByStore(hotKeyFactory.hotKeyConfig);
|
119
|
+
hotKeyFactory.operationControl = defineOperationControl || operationControl;
|
120
|
+
|
121
|
+
// 排序复合结算
|
122
|
+
if (hotKeyFactory.operationControl[5] && hotKeyFactory.operationControl[5].control && hotKeyFactory.operationControl[5].dynamicSelector) {
|
123
|
+
var dynamicSelector = hotKeyFactory.operationControl[5].dynamicSelector;
|
124
|
+
hotKeyFactory.operationControl[5].control = hotKeyFactory.newhotKeyArraySort(hotKeyFactory.operationControl[5].control, function (a, b) {
|
125
|
+
return dynamicSelector[a] && dynamicSelector[b] ? dynamicSelector[a][0].replace('.settlement .paymode:', '') - dynamicSelector[b][0].replace('.settlement .paymode:', '') : -1;
|
126
|
+
});
|
127
|
+
}
|
128
|
+
|
129
|
+
hotKeyFactory.clickBeforeProp = clickBefore;
|
130
|
+
var controller = {
|
131
|
+
keys: keys,
|
132
|
+
hotKeyConfig: hotKeyFactory.hotKeyConfig,
|
133
|
+
operationControl: hotKeyFactory.operationControl,
|
134
|
+
action: this.actuator,
|
135
|
+
find: this.find,
|
136
|
+
next: this.next,
|
137
|
+
find_element: this.find_element,
|
138
|
+
getFocusId: this.getFocusId.bind(this),
|
139
|
+
register: this.register,
|
140
|
+
unRegister: this.unRegister,
|
141
|
+
setFocus: this.setFocus,
|
142
|
+
clearFocus: this.clearFocus,
|
143
|
+
observerTrigger: observerCallback,
|
144
|
+
bind: this.bind,
|
145
|
+
unbind: this.unbind,
|
146
|
+
on: this.on,
|
147
|
+
off: this.off,
|
148
|
+
observer: function observer(dom) {
|
149
|
+
var config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { attributes: true, childList: true, subtree: true };
|
150
|
+
|
151
|
+
var containerDom = dom || document.body;
|
152
|
+
observe.observe(containerDom, config);
|
153
|
+
}
|
154
|
+
};
|
155
|
+
// if (!window[handler]) {
|
156
|
+
window[handler] = controller;
|
157
|
+
// }
|
158
|
+
return controller;
|
159
|
+
},
|
160
|
+
asyncQueryHotKeyDom: function asyncQueryHotKeyDom(operator, currentNode) {
|
161
|
+
var pollQueryDom = function pollQueryDom() {
|
162
|
+
if (Array.isArray(operator)) {
|
163
|
+
for (var index = 0; index < operator.length; index++) {
|
164
|
+
var element = operator[index];
|
165
|
+
var target = (0, _utils.queryHotKey)(element, currentNode);
|
166
|
+
if (target) return target;
|
167
|
+
}
|
168
|
+
} else {
|
169
|
+
var _target = (0, _utils.queryHotKey)(operator, currentNode);
|
170
|
+
if (_target) return _target;
|
171
|
+
}
|
172
|
+
var result = (0, _utils.queryCount)();
|
173
|
+
if (result === 'done') return;
|
174
|
+
|
175
|
+
return pollQueryDom();
|
176
|
+
};
|
177
|
+
|
178
|
+
return pollQueryDom();
|
179
|
+
},
|
180
|
+
|
181
|
+
|
182
|
+
// 获取自定义快捷键
|
183
|
+
getDefineHotKeyConfigByStore: function getDefineHotKeyConfigByStore() {
|
184
|
+
// 正式环境使用缓存对象
|
185
|
+
var setting_setData = _mutantsUtil.localStore.get("setting_setData");
|
186
|
+
setting_setData = setting_setData == 'undefined' || !setting_setData ? [] : setting_setData;
|
187
|
+
if (setting_setData == null) {
|
188
|
+
setting_setData = JSON.parse(localStorage.getItem("setting_setData"));
|
189
|
+
}
|
190
|
+
|
191
|
+
// 本地调试使用
|
192
|
+
// const setting_setData = window.web_hotKeyConfig
|
193
|
+
var defineHotKeyConfig = {};
|
194
|
+
var defineHotKeyConfigList = [];
|
195
|
+
var conflictHotKeyConfigList = [];
|
196
|
+
if (setting_setData && setting_setData.length != 0) {
|
197
|
+
setting_setData.forEach(function (settingItem) {
|
198
|
+
// 快捷键固定ParamType
|
199
|
+
var _enumController$getEn = _mutantsUtil.enumController.getEnumOj(),
|
200
|
+
RE_POSParamType = _enumController$getEn.RE_POSParamType;
|
201
|
+
|
202
|
+
var SHORTCUT_KEY = RE_POSParamType.SHORTCUT_KEY;
|
203
|
+
|
204
|
+
if (settingItem.ParamType && (settingItem.ParamType.Id === SHORTCUT_KEY || settingItem.ParamType === SHORTCUT_KEY)) {
|
205
|
+
var _ref2 = settingItem || {},
|
206
|
+
DefaultValue = _ref2.DefaultValue,
|
207
|
+
ExtField = _ref2.ExtField,
|
208
|
+
Title = _ref2.Title,
|
209
|
+
ID = _ref2.ID,
|
210
|
+
Value = _ref2.Value,
|
211
|
+
Name = _ref2.Name,
|
212
|
+
TabIndex = _ref2.TabIndex;
|
213
|
+
|
214
|
+
var ExtFieldParse = { dynamic: false, classification: "", enableEdit: false, operation: [], operationType: 1, isdisplay: false };
|
215
|
+
try {
|
216
|
+
ExtFieldParse = JSON.parse(ExtField);
|
217
|
+
} catch (error) {}
|
218
|
+
var _ExtFieldParse = ExtFieldParse,
|
219
|
+
dynamic = _ExtFieldParse.dynamic,
|
220
|
+
classification = _ExtFieldParse.classification,
|
221
|
+
enableEdit = _ExtFieldParse.enableEdit,
|
222
|
+
operation = _ExtFieldParse.operation,
|
223
|
+
operationType = _ExtFieldParse.operationType,
|
224
|
+
isdisplay = _ExtFieldParse.isdisplay;
|
225
|
+
|
226
|
+
|
227
|
+
var configItem = { Name: Name, describe: Title, dynamic: dynamic, keyValue: Value, operation: operation, enableEdit: enableEdit, classification: classification, id: ID, DefaultValue: DefaultValue, operationType: operationType, TabIndex: TabIndex, isdisplay: isdisplay };
|
228
|
+
|
229
|
+
if (Value !== '') {
|
230
|
+
// 快捷键未被设置为空
|
231
|
+
if (defineHotKeyConfig[Value]) {
|
232
|
+
// 存在使用相同快捷键
|
233
|
+
var operationControl = defineHotKeyConfig[Value].operationControl;
|
234
|
+
|
235
|
+
if (operationControl) {
|
236
|
+
// 之前已经存入过两个快捷键 这是第三个
|
237
|
+
if (!operationControl[operationType]) {
|
238
|
+
defineHotKeyConfig[Value].operationControl[operationType] = configItem;
|
239
|
+
} else {
|
240
|
+
// 表示有冲突快捷键
|
241
|
+
conflictHotKeyConfigList.push((0, _extends3.default)({}, configItem, { keyValue: "" }));
|
242
|
+
return null;
|
243
|
+
}
|
244
|
+
} else {
|
245
|
+
var itemOperationType = defineHotKeyConfig[Value].operationType;
|
246
|
+
|
247
|
+
if (operationType == itemOperationType) {
|
248
|
+
// 存在冲突快捷键 因为 dynamic 并未改变为动态键所致
|
249
|
+
conflictHotKeyConfigList.push((0, _extends3.default)({}, configItem, { keyValue: "" }));
|
250
|
+
return null;
|
251
|
+
} else {
|
252
|
+
// 存储第二个快捷键
|
253
|
+
var _operationControl = (0, _extends3.default)({}, defineHotKeyConfig[Value], { dynamic: true });
|
254
|
+
defineHotKeyConfig[Value] = {
|
255
|
+
operationControl: {}
|
256
|
+
};
|
257
|
+
// 搬移一层对象信息到第二次 变为动态键
|
258
|
+
defineHotKeyConfig[Value].dynamic = true;
|
259
|
+
defineHotKeyConfig[Value].operationControl[itemOperationType] = _operationControl;
|
260
|
+
// 增加第二个动态键
|
261
|
+
defineHotKeyConfig[Value].operationControl[operationType] = (0, _extends3.default)({}, configItem, { dynamic: true });
|
262
|
+
}
|
263
|
+
}
|
264
|
+
} else {
|
265
|
+
// 单个动态键
|
266
|
+
if (dynamic) {
|
267
|
+
defineHotKeyConfig[Value] = {
|
268
|
+
dynamic: true,
|
269
|
+
operationControl: {}
|
270
|
+
};
|
271
|
+
defineHotKeyConfig[Value].operationControl[operationType] = (0, _extends3.default)({}, configItem, { dynamic: true });
|
272
|
+
} else {
|
273
|
+
defineHotKeyConfig[Value] = (0, _extends3.default)({}, configItem, { dynamic: false });
|
274
|
+
}
|
275
|
+
}
|
276
|
+
} else {
|
277
|
+
// 快捷键设置为空
|
278
|
+
}
|
279
|
+
|
280
|
+
defineHotKeyConfigList.push(configItem);
|
281
|
+
}
|
282
|
+
});
|
283
|
+
} else {
|
284
|
+
defineHotKeyConfig = _config.hotKeyConfig;
|
285
|
+
}
|
286
|
+
window.defineHotKeyConfigList = [].concat(defineHotKeyConfigList, conflictHotKeyConfigList);
|
287
|
+
return defineHotKeyConfig;
|
288
|
+
},
|
289
|
+
|
290
|
+
|
291
|
+
// 获取自定义权限
|
292
|
+
getDefineOperationControlByStore: function getDefineOperationControlByStore(defineHotKey) {
|
293
|
+
// 获取自定义快捷键配置JSON KEY值集合
|
294
|
+
var defineHotKeyList = (0, _keys2.default)(defineHotKey);
|
295
|
+
|
296
|
+
var defineOperationControl = {};
|
297
|
+
|
298
|
+
// 遍历自定义快捷键的key值
|
299
|
+
defineHotKeyList.forEach(function (defineKey) {
|
300
|
+
var _ref3 = defineHotKey[defineKey] || {},
|
301
|
+
dynamic = _ref3.dynamic,
|
302
|
+
operationControl = _ref3.operationControl;
|
303
|
+
// 是否是动态键
|
304
|
+
|
305
|
+
|
306
|
+
if (dynamic) {
|
307
|
+
if (operationControl) {
|
308
|
+
// 动态键
|
309
|
+
var operationKeys = (0, _keys2.default)(operationControl);
|
310
|
+
operationKeys.forEach(function (opKey) {
|
311
|
+
var _ref4 = operationControl[opKey] || {},
|
312
|
+
operation = _ref4.operation;
|
313
|
+
// 构建权限页面结构
|
314
|
+
|
315
|
+
|
316
|
+
if (!defineOperationControl[opKey]) {
|
317
|
+
defineOperationControl[opKey] = {
|
318
|
+
control: [],
|
319
|
+
dynamicSelector: {}
|
320
|
+
};
|
321
|
+
}
|
322
|
+
|
323
|
+
// 添加键值
|
324
|
+
defineOperationControl[opKey].control.push(defineKey);
|
325
|
+
// 如果是上下键 dynamicSelector值有所不同
|
326
|
+
if (defineKey === 'down' || defineKey === 'up') {
|
327
|
+
defineOperationControl[opKey].dynamicSelector['up&down'] = operation;
|
328
|
+
return;
|
329
|
+
}
|
330
|
+
defineOperationControl[opKey].dynamicSelector[defineKey] = operation;
|
331
|
+
});
|
332
|
+
} else {
|
333
|
+
var _ref5 = defineHotKey[defineKey] || {},
|
334
|
+
operationType = _ref5.operationType,
|
335
|
+
operation = _ref5.operation;
|
336
|
+
|
337
|
+
if (!defineOperationControl[operationType]) {
|
338
|
+
defineOperationControl[operationType] = {
|
339
|
+
control: [],
|
340
|
+
dynamicSelector: {}
|
341
|
+
};
|
342
|
+
}
|
343
|
+
// 添加键值
|
344
|
+
defineOperationControl[operationType].control.push(defineKey);
|
345
|
+
defineOperationControl[operationType].dynamicSelector[defineKey] = operation;
|
346
|
+
// const {}
|
347
|
+
}
|
348
|
+
}
|
349
|
+
});
|
350
|
+
return defineOperationControl;
|
351
|
+
},
|
352
|
+
newhotKeyArraySort: function newhotKeyArraySort(array, fn) {
|
353
|
+
var t = void 0;
|
354
|
+
fn = fn || function (x, y) {
|
355
|
+
return x - y;
|
356
|
+
};
|
357
|
+
for (var i = 0; i < array.length; i++) {
|
358
|
+
for (var j = i; j < array.length; j++) {
|
359
|
+
if (fn(array[i], array[j]) > 0) {
|
360
|
+
t = array[i];
|
361
|
+
array[i] = array[j];
|
362
|
+
array[j] = t;
|
363
|
+
}
|
364
|
+
}
|
365
|
+
}
|
366
|
+
return array;
|
367
|
+
},
|
368
|
+
dynamicAction: function dynamicAction(keyName, target) {
|
369
|
+
var _ref6 = this.hotKeyConfig[keyName] || {},
|
370
|
+
dynamic = _ref6.dynamic;
|
371
|
+
|
372
|
+
if (!dynamic) return;
|
373
|
+
|
374
|
+
var _ref7 = this.operationControl[this.focusId] || {},
|
375
|
+
_ref7$dynamicSelector = _ref7.dynamicSelector,
|
376
|
+
dynamicSelector = _ref7$dynamicSelector === undefined ? {} : _ref7$dynamicSelector;
|
377
|
+
|
378
|
+
var _ref8 = this.operationControl[this.focusId] || {},
|
379
|
+
_ref8$directionSelect = _ref8.directionSelector,
|
380
|
+
directionSelector = _ref8$directionSelect === undefined ? {} : _ref8$directionSelect;
|
381
|
+
|
382
|
+
var targetKey = 'up&down';
|
383
|
+
|
384
|
+
if (keyName !== 'up' && keyName !== 'down') {
|
385
|
+
targetKey = (0, _keys2.default)(dynamicSelector).find(function (key) {
|
386
|
+
return key === keyName;
|
387
|
+
});
|
388
|
+
}
|
389
|
+
|
390
|
+
var domSelector = dynamicSelector[targetKey];
|
391
|
+
var actionNode = hotKeyFactory.queryNode(target).find(domSelector);
|
392
|
+
|
393
|
+
if ('updown'.includes(keyName) && actionNode.currentNode) {
|
394
|
+
var fnName = { down: 'next', up: 'prev' };
|
395
|
+
actionNode = actionNode[fnName[keyName]]();
|
396
|
+
}
|
397
|
+
|
398
|
+
if (this.focusId == 7 && 'leftright'.includes(keyName) && actionNode.currentNode) {
|
399
|
+
var _fnName = { right: 'next', left: 'prev' };
|
400
|
+
actionNode = actionNode[_fnName[keyName]]();
|
401
|
+
}
|
402
|
+
|
403
|
+
actionNode.currentNode && actionNode.click();
|
404
|
+
|
405
|
+
if (!actionNode.currentNode) {
|
406
|
+
hotKeyFactory.log(true, { waring: 'the [' + keyName + '] hot-key of dynamic trigger Dom not found' });
|
407
|
+
return true;
|
408
|
+
}
|
409
|
+
|
410
|
+
return actionNode.currentNode;
|
411
|
+
},
|
412
|
+
triggerRegister: function triggerRegister(keyName) {
|
413
|
+
if (!hotKeyFactory.registerKey) return;
|
414
|
+
|
415
|
+
var trigger = this.registerKey.find(function (item) {
|
416
|
+
return item.key === keyName;
|
417
|
+
});
|
418
|
+
if (!trigger) return;
|
419
|
+
|
420
|
+
var container = trigger.container,
|
421
|
+
className = trigger.className;
|
422
|
+
|
423
|
+
var containerDom = this.asyncQueryHotKeyDom(container);
|
424
|
+
var targetDom = void 0;
|
425
|
+
var classNameList = Array.isArray(className) ? className : [className];
|
426
|
+
classNameList.some(function (name) {
|
427
|
+
var queryDom = hotKeyFactory.queryNode(containerDom).find(name);
|
428
|
+
targetDom = queryDom;
|
429
|
+
return !!queryDom.currentNode;
|
430
|
+
});
|
431
|
+
|
432
|
+
targetDom.currentNode && targetDom.click();
|
433
|
+
hotKeyFactory.log(!targetDom.currentNode, { waring: 'register hot-key trigger Dom not found' });
|
434
|
+
|
435
|
+
hotKeyFactory.unlock();
|
436
|
+
},
|
437
|
+
register: function register(keyName) {
|
438
|
+
return function (containerName) {
|
439
|
+
return function (className) {
|
440
|
+
var registerKey = {
|
441
|
+
key: keyName,
|
442
|
+
container: containerName,
|
443
|
+
className: className
|
444
|
+
};
|
445
|
+
|
446
|
+
if (!hotKeyFactory.registerKey) {
|
447
|
+
hotKeyFactory.registerKey = [registerKey];
|
448
|
+
} else {
|
449
|
+
var addKey = [].concat((0, _toConsumableArray3.default)(hotKeyFactory.registerKey.filter(function (item) {
|
450
|
+
return item.key !== keyName;
|
451
|
+
})), [registerKey]);
|
452
|
+
hotKeyFactory.registerKey = addKey;
|
453
|
+
}
|
454
|
+
};
|
455
|
+
};
|
456
|
+
},
|
457
|
+
unRegister: function unRegister(keyName) {
|
458
|
+
if (hotKeyFactory.registerKey) {
|
459
|
+
var keys = hotKeyFactory.registerKey.filter(function (item) {
|
460
|
+
return item.key !== keyName;
|
461
|
+
});
|
462
|
+
hotKeyFactory.registerKey = keys;
|
463
|
+
}
|
464
|
+
},
|
465
|
+
queryNode: function queryNode(target) {
|
466
|
+
var find = this.find,
|
467
|
+
next = this.next,
|
468
|
+
prev = this.prev,
|
469
|
+
setFocus = this.setFocus,
|
470
|
+
clearFocus = this.clearFocus;
|
471
|
+
|
472
|
+
|
473
|
+
return {
|
474
|
+
currentNode: target,
|
475
|
+
find: find,
|
476
|
+
next: next,
|
477
|
+
prev: prev,
|
478
|
+
setFocus: setFocus,
|
479
|
+
clearFocus: clearFocus,
|
480
|
+
click: function click() {
|
481
|
+
hotKeyFactory.clickBefore();
|
482
|
+
this.currentNode.click();
|
483
|
+
}
|
484
|
+
};
|
485
|
+
},
|
486
|
+
rejectDoAction: function rejectDoAction(keyName) {
|
487
|
+
var id = hotKeyFactory.getFocusId();
|
488
|
+
if (!id) return true;
|
489
|
+
|
490
|
+
var _ref9 = this.operationControl[id] || {},
|
491
|
+
control = _ref9.control,
|
492
|
+
directionSelector = _ref9.directionSelector;
|
493
|
+
|
494
|
+
// if (control === 'ALL') return;
|
495
|
+
|
496
|
+
|
497
|
+
if (id == '1') return; //动态生成id=='1' 代替ALL
|
498
|
+
if (!control || !control.includes(keyName)) return true;
|
499
|
+
},
|
500
|
+
action: function action(keyName, className) {
|
501
|
+
var _this = this;
|
502
|
+
|
503
|
+
return new _promise2.default(function (resolve, reject) {
|
504
|
+
var target = _this.asyncQueryHotKeyDom(className);
|
505
|
+
|
506
|
+
var dynamicActionTarget = hotKeyFactory.dynamicAction(keyName, target);
|
507
|
+
if (dynamicActionTarget) return resolve(dynamicActionTarget);
|
508
|
+
|
509
|
+
if (target) {
|
510
|
+
var hotKeyProto = hotKeyFactory.queryNode(target);
|
511
|
+
|
512
|
+
hotKeyProto.click();
|
513
|
+
hotKeyFactory.unlock();
|
514
|
+
|
515
|
+
resolve(hotKeyProto);
|
516
|
+
} else {
|
517
|
+
hotKeyFactory.log(true, { waring: 'not found hot ket target of [' + className + ']' });
|
518
|
+
hotKeyFactory.unlock();
|
519
|
+
}
|
520
|
+
});
|
521
|
+
},
|
522
|
+
actionCompose: function actionCompose(operation, keyName, callback) {
|
523
|
+
var _this2 = this;
|
524
|
+
|
525
|
+
var actionPromise = null;
|
526
|
+
var prveValue = null;
|
527
|
+
var listener = hotKeyFactory.listener;
|
528
|
+
|
529
|
+
|
530
|
+
operation.forEach(function (value, index) {
|
531
|
+
if (!actionPromise) {
|
532
|
+
prveValue = value;
|
533
|
+
actionPromise = hotKeyFactory.action(keyName, value);
|
534
|
+
if (index === operation.length - 1) {
|
535
|
+
actionPromise.then(function (res) {
|
536
|
+
listener(callback, res, index);
|
537
|
+
hotKeyFactory.unlock();
|
538
|
+
return _this2;
|
539
|
+
});
|
540
|
+
}
|
541
|
+
} else {
|
542
|
+
actionPromise.then(function (res) {
|
543
|
+
listener(callback, res, index - 1);
|
544
|
+
prveValue = value;
|
545
|
+
return hotKeyFactory.action(keyName, value);
|
546
|
+
});
|
547
|
+
|
548
|
+
if (index === operation.length - 1) {
|
549
|
+
actionPromise.then(function (res) {
|
550
|
+
listener(callback, res, index);
|
551
|
+
hotKeyFactory.unlock();
|
552
|
+
return _this2;
|
553
|
+
});
|
554
|
+
}
|
555
|
+
}
|
556
|
+
});
|
557
|
+
|
558
|
+
return actionPromise;
|
559
|
+
},
|
560
|
+
actuator: function actuator(keyName, callback) {
|
561
|
+
hotKeyFactory.log(true, { keyName: keyName });
|
562
|
+
|
563
|
+
if (hotKeyFactory.isShouldQuickKeyClicked()) return null;
|
564
|
+
// if (hotKeyFactory.lock) return;
|
565
|
+
hotKeyFactory.lock = true;
|
566
|
+
|
567
|
+
if (hotKeyFactory.triggerRegister(keyName)) return;
|
568
|
+
if (hotKeyFactory.rejectDoAction(keyName)) return;
|
569
|
+
|
570
|
+
var _ref10 = this.hotKeyConfig[keyName] || {},
|
571
|
+
_ref10$operation = _ref10.operation,
|
572
|
+
operation = _ref10$operation === undefined ? ['.hot-key-focus-container'] : _ref10$operation;
|
573
|
+
|
574
|
+
var operations = Array.isArray(operation[0]) ? operation : [operation]; // 存在一个按键操作多个节点
|
575
|
+
|
576
|
+
operations.forEach(function (operationItem) {
|
577
|
+
return hotKeyFactory.actionCompose(operationItem, keyName, callback);
|
578
|
+
});
|
579
|
+
},
|
580
|
+
find: function find(selector, isNew) {
|
581
|
+
var currentNode = void 0;
|
582
|
+
if (!this.currentNode || isNew) {
|
583
|
+
currentNode = hotKeyFactory.asyncQueryHotKeyDom(selector);
|
584
|
+
} else {
|
585
|
+
currentNode = hotKeyFactory.asyncQueryHotKeyDom(selector, this.currentNode);
|
586
|
+
}
|
587
|
+
|
588
|
+
return hotKeyFactory.queryNode(currentNode);
|
589
|
+
},
|
590
|
+
next: function next() {
|
591
|
+
var filterNum = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
592
|
+
|
593
|
+
for (var i = 0; i < filterNum; i++) {
|
594
|
+
if (!this.currentNode) {
|
595
|
+
hotKeyFactory.log(true, { waring: 'There is a warning in the next,trigger Dom is not found ' });
|
596
|
+
break;
|
597
|
+
}
|
598
|
+
this.currentNode = this.currentNode.nextSibling;
|
599
|
+
}
|
600
|
+
|
601
|
+
return this;
|
602
|
+
},
|
603
|
+
prev: function prev() {
|
604
|
+
var filterNum = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
605
|
+
|
606
|
+
for (var i = 0; i < filterNum; i++) {
|
607
|
+
if (!this.currentNode) {
|
608
|
+
hotKeyFactory.log(true, { waring: 'There is a warning in the prev,trigger Dom is not found ' });
|
609
|
+
break;
|
610
|
+
}
|
611
|
+
this.currentNode = this.currentNode.previousSibling;
|
612
|
+
}
|
613
|
+
|
614
|
+
return this;
|
615
|
+
},
|
616
|
+
find_element: function find_element(selector) {
|
617
|
+
var returnValue = [];
|
618
|
+
var arr = selector.split(' ');
|
619
|
+
if (arr && arr.length > 0) {
|
620
|
+
arr.map(function (item) {
|
621
|
+
var el = document.querySelectorAll('.hot-key-focus-container ' + item);
|
622
|
+
returnValue = [].concat((0, _toConsumableArray3.default)(returnValue), (0, _toConsumableArray3.default)(el));
|
623
|
+
});
|
624
|
+
returnValue = returnValue && [].concat((0, _toConsumableArray3.default)(returnValue)).filter(function (v) {
|
625
|
+
return v.style.display != 'none';
|
626
|
+
});
|
627
|
+
}
|
628
|
+
return returnValue;
|
629
|
+
},
|
630
|
+
setFocus: function setFocus(target) {
|
631
|
+
var container = target || this.currentNode;
|
632
|
+
container && container.classList.add('hot-key-focus-container');
|
633
|
+
//hotKeyFactory.log(!container, { waring: 'the set focus container Dom is not found' });
|
634
|
+
},
|
635
|
+
clearFocus: function clearFocus() {
|
636
|
+
var focusContainer = document.querySelectorAll('.hot-key-focus-container');
|
637
|
+
|
638
|
+
var _iteratorNormalCompletion = true;
|
639
|
+
var _didIteratorError = false;
|
640
|
+
var _iteratorError = undefined;
|
641
|
+
|
642
|
+
try {
|
643
|
+
for (var _iterator = (0, _getIterator3.default)(focusContainer), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
644
|
+
var dom = _step.value;
|
645
|
+
|
646
|
+
dom.classList.remove('hot-key-focus-container');
|
647
|
+
}
|
648
|
+
} catch (err) {
|
649
|
+
_didIteratorError = true;
|
650
|
+
_iteratorError = err;
|
651
|
+
} finally {
|
652
|
+
try {
|
653
|
+
if (!_iteratorNormalCompletion && _iterator.return) {
|
654
|
+
_iterator.return();
|
655
|
+
}
|
656
|
+
} finally {
|
657
|
+
if (_didIteratorError) {
|
658
|
+
throw _iteratorError;
|
659
|
+
}
|
660
|
+
}
|
661
|
+
}
|
662
|
+
|
663
|
+
hotKeyFactory.log(true, { log: 'the focus container is clear' });
|
664
|
+
},
|
665
|
+
clickBefore: function clickBefore() {
|
666
|
+
var clickBeforeProp = hotKeyFactory.clickBeforeProp;
|
667
|
+
|
668
|
+
clickBeforeProp && clickBeforeProp();
|
669
|
+
},
|
670
|
+
unlock: function unlock() {
|
671
|
+
hotKeyFactory.lock = false;
|
672
|
+
},
|
673
|
+
getFocusId: function getFocusId() {
|
674
|
+
var focusContainer = document.querySelector('.hot-key-focus-container');
|
675
|
+
if (!focusContainer) return hotKeyFactory.log(true, { waring: 'the focus container is not found' });
|
676
|
+
|
677
|
+
var classList = void 0;
|
678
|
+
var currentClassList = (0, _from2.default)(focusContainer.classList) || [];
|
679
|
+
if (currentClassList.includes('hot-key-id')) {
|
680
|
+
classList = currentClassList;
|
681
|
+
} else {
|
682
|
+
var hotKeyIdNode = focusContainer.querySelector('.hot-key-id');
|
683
|
+
hotKeyFactory.log(!hotKeyIdNode, { waring: 'not have any bind hot-key id node' });
|
684
|
+
|
685
|
+
if (!hotKeyIdNode) return;
|
686
|
+
|
687
|
+
classList = (0, _from2.default)(hotKeyIdNode.classList) || [];
|
688
|
+
}
|
689
|
+
|
690
|
+
var _split = (classList.find(function (className) {
|
691
|
+
return className.includes('hot-key-id=');
|
692
|
+
}) || '').split('='),
|
693
|
+
_split2 = (0, _slicedToArray3.default)(_split, 2),
|
694
|
+
id = _split2[1];
|
695
|
+
|
696
|
+
this.focusId = id;
|
697
|
+
|
698
|
+
return id;
|
699
|
+
},
|
700
|
+
bind: function bind() {
|
701
|
+
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
702
|
+
var callBack = arguments[1];
|
703
|
+
|
704
|
+
keyboard(keys.join(), callBack);
|
705
|
+
},
|
706
|
+
unbind: function unbind() {
|
707
|
+
var keys = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
708
|
+
|
709
|
+
keys.forEach(function (key) {
|
710
|
+
return keyboard.unbind(key);
|
711
|
+
});
|
712
|
+
},
|
713
|
+
|
714
|
+
handles: [],
|
715
|
+
on: function on(callback) {
|
716
|
+
var handles = hotKeyFactory.handles || [];
|
717
|
+
var isHaveEvent = handles.some(function (handle) {
|
718
|
+
return handle === callback;
|
719
|
+
});
|
720
|
+
|
721
|
+
if (!isHaveEvent) {
|
722
|
+
handles.push(callback);
|
723
|
+
}
|
724
|
+
},
|
725
|
+
off: function off(callback) {
|
726
|
+
var handles = hotKeyFactory.handles || [];
|
727
|
+
var handleIndex = handles.findIndex(function (handle) {
|
728
|
+
return handle === callback;
|
729
|
+
});
|
730
|
+
|
731
|
+
if (~handleIndex) {
|
732
|
+
handles.splice(handleIndex, 1);
|
733
|
+
}
|
734
|
+
},
|
735
|
+
listener: function listener(callback) {
|
736
|
+
var result = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
737
|
+
var index = arguments[2];
|
738
|
+
|
739
|
+
var node = result.nodeType === 1 ? result : result.currentNode;
|
740
|
+
hotKeyFactory.handles.forEach(function (handle) {
|
741
|
+
return handle(node, index);
|
742
|
+
});
|
743
|
+
|
744
|
+
callback && callback(node, index);
|
745
|
+
},
|
746
|
+
log: function log(isShowLog) {
|
747
|
+
var _ref11 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
|
748
|
+
keyName = _ref11.keyName,
|
749
|
+
waring = _ref11.waring;
|
750
|
+
|
751
|
+
if (!this.showLog || !isShowLog) return;
|
752
|
+
|
753
|
+
if (keyName) console.log('[hot-key]: ' + keyName);
|
754
|
+
if (waring) console.log('[hot-key-waring]: ' + waring);
|
755
|
+
},
|
756
|
+
isShouldQuickKeyClicked: function isShouldQuickKeyClicked() {
|
757
|
+
var loadingImgs = document.querySelector("img.loading-img-symbol");
|
758
|
+
// const doNotSettleQuickKey = document.querySelector("#doNotSettleQuickKey");
|
759
|
+
var isCanSettleOnQuickKey = _mutantsMicrofx.stores.settlementVoucherStore.isCanSettleOnQuickKey;
|
760
|
+
|
761
|
+
if (loadingImgs || !isCanSettleOnQuickKey) return true;
|
762
|
+
}
|
763
|
+
};
|
764
|
+
|
765
|
+
function hotKey(option) {
|
766
|
+
return hotKeyFactory.constructor.call(hotKeyFactory, option);
|
767
|
+
}
|
768
|
+
|
769
|
+
hotKey.hotKeyPart = function (partName) {
|
770
|
+
var otherClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
771
|
+
|
772
|
+
return otherClassName + ' hot-key-part-' + partName;
|
773
|
+
};
|
774
|
+
|
775
|
+
hotKey.hotKeyBindClass = function (id) {
|
776
|
+
var otherClassName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
777
|
+
|
778
|
+
return otherClassName + ' hot-key-id hot-key-id=' + id;
|
779
|
+
};
|
780
|
+
|
781
|
+
hotKey.hotKeyNotFilter = function () {
|
782
|
+
var otherClassName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
783
|
+
|
784
|
+
return otherClassName + ' hot-key-not-filter';
|
785
|
+
};
|
786
|
+
|
787
|
+
hotKey.hotKeyConfig = _config.hotKeyConfig;
|
788
|
+
hotKey.operationControl = _config.operationControl;
|
789
|
+
hotKey.showHotKeyModal = _hotKeyModal.showHotKeyModal;
|
790
|
+
hotKey.classificationList = _config.classificationList;
|
791
|
+
hotKey.keyReplaceStringList = _config.keyReplaceStringList;
|
792
|
+
hotKey.operationTypeName = _config.operationTypeName;
|
793
|
+
|
794
|
+
exports.default = hotKey;
|
795
|
+
//# sourceMappingURL=index.js.map
|