tplus-portaltouch 1.26.2 → 1.27.1

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.
Files changed (90) hide show
  1. package/package.json +4 -4
  2. package/dist/api/ModifyPassApi.js +0 -165
  3. package/dist/api/ModifyPassApi.js.map +0 -1
  4. package/dist/components/dutyandsettle/dutysettlebill.js +0 -897
  5. package/dist/components/dutyandsettle/dutysettlebill.js.map +0 -1
  6. package/dist/components/dutyandsettle/dutysettlehistory.js +0 -228
  7. package/dist/components/dutyandsettle/dutysettlehistory.js.map +0 -1
  8. package/dist/components/dutyandsettle/index.js +0 -25
  9. package/dist/components/dutyandsettle/index.js.map +0 -1
  10. package/dist/components/dutyandsettle/tipContent.js +0 -105
  11. package/dist/components/dutyandsettle/tipContent.js.map +0 -1
  12. package/dist/components/header/customUse.js +0 -79
  13. package/dist/components/header/customUse.js.map +0 -1
  14. package/dist/components/header/headContent.js +0 -439
  15. package/dist/components/header/headContent.js.map +0 -1
  16. package/dist/components/header/index.js +0 -102
  17. package/dist/components/header/index.js.map +0 -1
  18. package/dist/components/header/style.less +0 -331
  19. package/dist/components/header/vertical-touch.js +0 -273
  20. package/dist/components/header/vertical-touch.js.map +0 -1
  21. package/dist/components/header/vertical-touch.less +0 -213
  22. package/dist/containers/Main/index.js +0 -634
  23. package/dist/containers/Main/index.js.map +0 -1
  24. package/dist/dutyService/index.js +0 -277
  25. package/dist/dutyService/index.js.map +0 -1
  26. package/dist/index.js +0 -40
  27. package/dist/index.js.map +0 -1
  28. package/dist/middleWare/index.js +0 -75
  29. package/dist/middleWare/index.js.map +0 -1
  30. package/dist/modalRouter/StaticRouter.js +0 -134
  31. package/dist/modalRouter/StaticRouter.js.map +0 -1
  32. package/dist/modalRouter/index.js +0 -144
  33. package/dist/modalRouter/index.js.map +0 -1
  34. package/dist/pages/Modal/index.js +0 -71
  35. package/dist/pages/Modal/index.js.map +0 -1
  36. package/dist/pages/Modal/style.less +0 -5
  37. package/dist/pages/Portal/PortalPage.less +0 -662
  38. package/dist/pages/Portal/data.js +0 -42
  39. package/dist/pages/Portal/data.js.map +0 -1
  40. package/dist/pages/Portal/horizontalPadPortal.js +0 -130
  41. package/dist/pages/Portal/horizontalPadPortal.js.map +0 -1
  42. package/dist/pages/Portal/horizontalSunMiPortal.js +0 -140
  43. package/dist/pages/Portal/horizontalSunMiPortal.js.map +0 -1
  44. package/dist/pages/Portal/index.js +0 -830
  45. package/dist/pages/Portal/index.js.map +0 -1
  46. package/dist/pages/Portal/verticalPortal.js +0 -136
  47. package/dist/pages/Portal/verticalPortal.js.map +0 -1
  48. package/dist/pages/dutyandsettle/AuthProcess.js +0 -42
  49. package/dist/pages/dutyandsettle/AuthProcess.js.map +0 -1
  50. package/dist/pages/dutyandsettle/index.js +0 -37
  51. package/dist/pages/dutyandsettle/index.js.map +0 -1
  52. package/dist/pages/dutyandsettle/index.less +0 -576
  53. package/dist/pages/dutyandsettle/offDuty.js +0 -608
  54. package/dist/pages/dutyandsettle/offDuty.js.map +0 -1
  55. package/dist/pages/dutyandsettle/onDialy.js +0 -196
  56. package/dist/pages/dutyandsettle/onDialy.js.map +0 -1
  57. package/dist/pages/dutyandsettle/onDuty.js +0 -256
  58. package/dist/pages/dutyandsettle/onDuty.js.map +0 -1
  59. package/dist/pages/dutyandsettle/onUnDaily.js +0 -149
  60. package/dist/pages/dutyandsettle/onUnDaily.js.map +0 -1
  61. package/dist/pages/dutyandsettle/settleDialy.js +0 -132
  62. package/dist/pages/dutyandsettle/settleDialy.js.map +0 -1
  63. package/dist/pages/index.js +0 -57
  64. package/dist/pages/index.js.map +0 -1
  65. package/dist/pages/modifyPass/index.js +0 -174
  66. package/dist/pages/modifyPass/index.js.map +0 -1
  67. package/dist/pages/modifyPass/style.less +0 -75
  68. package/dist/pages/notFound/index.js +0 -95
  69. package/dist/pages/notFound/index.js.map +0 -1
  70. package/dist/pages/notFound/style.less +0 -4
  71. package/dist/stores/ModalRouter.js +0 -182
  72. package/dist/stores/ModalRouter.js.map +0 -1
  73. package/dist/stores/ModifyPassStore.js +0 -205
  74. package/dist/stores/ModifyPassStore.js.map +0 -1
  75. package/dist/stores/PortalStore.js +0 -214
  76. package/dist/stores/PortalStore.js.map +0 -1
  77. package/dist/stores/PosLoginStore.js +0 -111
  78. package/dist/stores/PosLoginStore.js.map +0 -1
  79. package/dist/stores/billHistoryStore.js +0 -114
  80. package/dist/stores/billHistoryStore.js.map +0 -1
  81. package/dist/stores/dutySettleStore.js +0 -115
  82. package/dist/stores/dutySettleStore.js.map +0 -1
  83. package/dist/stores/index.js +0 -36
  84. package/dist/stores/index.js.map +0 -1
  85. package/dist/utils/PrintProcess.js +0 -112
  86. package/dist/utils/PrintProcess.js.map +0 -1
  87. package/dist/utils/index.js +0 -93
  88. package/dist/utils/index.js.map +0 -1
  89. package/dist/utils/networkCheck.js +0 -78
  90. package/dist/utils/networkCheck.js.map +0 -1
@@ -1,634 +0,0 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
-
7
- var _Button2 = require('tinper-bee/dist/Button');
8
-
9
- var _Button3 = _interopRequireDefault(_Button2);
10
-
11
- var _getIterator2 = require('babel-runtime/core-js/get-iterator');
12
-
13
- var _getIterator3 = _interopRequireDefault(_getIterator2);
14
-
15
- var _keys = require('babel-runtime/core-js/object/keys');
16
-
17
- var _keys2 = _interopRequireDefault(_keys);
18
-
19
- var _slicedToArray2 = require('babel-runtime/helpers/slicedToArray');
20
-
21
- var _slicedToArray3 = _interopRequireDefault(_slicedToArray2);
22
-
23
- var _extends2 = require('babel-runtime/helpers/extends');
24
-
25
- var _extends3 = _interopRequireDefault(_extends2);
26
-
27
- var _defineProperty2 = require('babel-runtime/helpers/defineProperty');
28
-
29
- var _defineProperty3 = _interopRequireDefault(_defineProperty2);
30
-
31
- var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');
32
-
33
- var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
34
-
35
- var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
36
-
37
- var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
38
-
39
- var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
40
-
41
- var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
42
-
43
- var _createClass2 = require('babel-runtime/helpers/createClass');
44
-
45
- var _createClass3 = _interopRequireDefault(_createClass2);
46
-
47
- var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
48
-
49
- var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
50
-
51
- var _inherits2 = require('babel-runtime/helpers/inherits');
52
-
53
- var _inherits3 = _interopRequireDefault(_inherits2);
54
-
55
- var _class, _class2, _temp, _initialiseProps;
56
-
57
- exports.default = Main;
58
-
59
- require('tinper-bee/dist/Button/index.css');
60
-
61
- var _react = require('react');
62
-
63
- var _react2 = _interopRequireDefault(_react);
64
-
65
- var _propTypes = require('prop-types');
66
-
67
- var _propTypes2 = _interopRequireDefault(_propTypes);
68
-
69
- var _mobxReact = require('mobx-react');
70
-
71
- var _rxjs = require('rxjs');
72
-
73
- var _operators = require('rxjs/operators');
74
-
75
- var _mutantsMicrofx = require('mutants-microfx');
76
-
77
- var _reactRouter = require('react-router');
78
-
79
- var _header = require('../../components/header');
80
-
81
- var _header2 = _interopRequireDefault(_header);
82
-
83
- var _Portal = require('../../pages/Portal');
84
-
85
- var _Portal2 = _interopRequireDefault(_Portal);
86
-
87
- var _tplusComponentsTouch = require('tplus-components-touch');
88
-
89
- var _tplusApi = require('tplus-api');
90
-
91
- var _stores = require('../../stores');
92
-
93
- var _stores2 = _interopRequireDefault(_stores);
94
-
95
- var _index = require('../../utils/index');
96
-
97
- var _ModifyPassApi = require('../../api/ModifyPassApi');
98
-
99
- var _mutantsUtil = require('mutants-util');
100
-
101
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
102
-
103
- window.rx$ = {};
104
-
105
- var MainContainer = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_Component) {
106
- (0, _inherits3.default)(MainContainer, _Component);
107
-
108
- function MainContainer(props) {
109
- (0, _classCallCheck3.default)(this, MainContainer);
110
-
111
- var _this = (0, _possibleConstructorReturn3.default)(this, (MainContainer.__proto__ || (0, _getPrototypeOf2.default)(MainContainer)).call(this, props));
112
-
113
- _initialiseProps.call(_this);
114
-
115
- _this.state = {};
116
- var isTpEnv = (0, _index.getQueryString)(location.search, 'tp') === 'on'; // 是否为线上环境
117
- var recordEnvironmentParams = (0, _index.getQueryString)(location.search, 'cia_env'); // 获取环境参数
118
- var isFirstStartUp = (0, _index.getQueryString)(location.search, 'ft') === '1'; // 是否为安装后第一次打开
119
- var isVerticalTouch = (0, _index.getQueryString)(location.search, 'vt') === '1'; // 是否为竖屏
120
- var isHorizontalPad = (0, _index.getQueryString)(location.search, 'vt') === '2'; // 是否在PAD
121
- var isHorizontalSunMi = (0, _index.getQueryString)(location.search, 'vt') === '3'; //是否在商米(SunMi)
122
- var isHorizontalSunMi_FuPing = (0, _index.getQueryString)(location.search, 'fuping') === '3'; //是否在商米(SunMi)
123
- var deviceUuid = (0, _index.getQueryString)(location.search, 'uuid'); // 设备uuid
124
- _this.clearStorage(isFirstStartUp);
125
- _mutantsUtil.localStore.set('isTpEnv', isTpEnv);
126
- _mutantsUtil.localStore.set('recordEnvironmentParams', recordEnvironmentParams);
127
- _mutantsUtil.localStore.set('isFirstStartUp', isFirstStartUp);
128
- _mutantsUtil.localStore.set('isVerticalTouch', isVerticalTouch);
129
- //自助屏 是给终端客户用的 不显示vconsole
130
- window.vconsoleShow = !isVerticalTouch;
131
- _mutantsUtil.localStore.set('isHorizontalPad', isHorizontalPad);
132
- _mutantsUtil.localStore.set('isHorizontalSunMi', isHorizontalSunMi);
133
- _mutantsUtil.localStore.set('mobileDeviceUuid', deviceUuid);
134
- _stores2.default.posLoginStore.savePosCode();
135
-
136
- _this.hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
137
- _this.electron = _mutantsMicrofx.nativeMs && _mutantsMicrofx.nativeMs.get('electron');
138
- _this.isAutoTest = (0, _index.getQueryString)(location.search, 'at');
139
- _this.isShowFourTab = _this.hasElectron && window.screen.width < 1024 ? true : false;
140
- //针对800*600分辨率下,页面显示不全的做一下处理。
141
- if (_this.isShowFourTab == true) _this.initWebFrameZoom();
142
-
143
- // 商米副屏
144
- _this.isHorizontalSunMi_FuPing = !!isHorizontalSunMi_FuPing;
145
- _this.isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi || !!isHorizontalSunMi_FuPing;
146
- return _this;
147
- }
148
-
149
- (0, _createClass3.default)(MainContainer, [{
150
- key: 'getChildContext',
151
- value: function getChildContext() {
152
- var _this2 = this;
153
-
154
- return {
155
- infoRender: this.handleInfoRender,
156
- headHook: {
157
- addClass: function addClass(id, key) {
158
- _this2.setState(function (state) {
159
- return (0, _defineProperty3.default)({}, key, [].concat((0, _toConsumableArray3.default)(state[key] || []), [id]));
160
- });
161
- },
162
- removeClass: function removeClass(id, key) {
163
- _this2.setState(function (state) {
164
- return (0, _defineProperty3.default)({}, key, state[key].filter(function (currentId) {
165
- return currentId !== id;
166
- }));
167
- });
168
- }
169
- },
170
- actionHook: {
171
- actionFrom: this.actionFrom,
172
- actionChange: function actionChange(value) {
173
- _this2.actionFrom = value;
174
- }
175
- }
176
- };
177
- }
178
-
179
- // 内置默认
180
- // keys = ['esc', 'enter', 'ctrl+f1', ...Object.keys(hotKey.hotKeyConfig)];
181
-
182
- // 解决从url地址唤醒exe,不同账号的处理问题。
183
-
184
- }, {
185
- key: 'componentWillMount',
186
- value: function componentWillMount() {
187
- this.changeLogoSubject();
188
-
189
- var _ref3 = _mutantsUtil.platform || {},
190
- isVerticalTouch = _ref3.isVerticalTouch;
191
-
192
- if (isVerticalTouch === true) {
193
- document.body.classList.add('vertical-touch-platform');
194
- }
195
- }
196
- }, {
197
- key: 'componentDidMount',
198
- value: function componentDidMount() {
199
- try {
200
- this.registerHotKey();
201
- this.addHotKeyChangeLister();
202
- } catch (error) {
203
- console.log("捕获到快捷键异常,快捷键不可用", error);
204
- }
205
- rx$.changeLogo.next();
206
- document.body.addEventListener('focus', this.blurButton, true);
207
- this.doDeeplinkingUrl();
208
-
209
- if (this.hasElectron === true) {
210
- document.body.classList.add('electron-env');
211
- } else {
212
- if (this.isAutoTest || this.isMobileEnvironment) return; //自动化测试不弹窗
213
- _tplusComponentsTouch.ModalWraper.confirm({
214
- className: 'tplus-confirm-modal',
215
- title: "温馨提示",
216
- content: 'T+新零售POS端不允许浏览器直接访问,请从T+产品中下载安装客户端程序使用!',
217
- cancelable: false,
218
- onOk: function onOk() {
219
- (0, _index.closeWebPage)();
220
- },
221
- onCancel: function onCancel() {
222
- (0, _index.closeWebPage)();
223
- }
224
- });
225
- }
226
- }
227
- }, {
228
- key: 'componentWillUnmount',
229
- value: function componentWillUnmount() {
230
- rx$.changeLogo.unsubscribe();
231
- document.body.removeEventListener('focus', this.blurButton, true);
232
- }
233
-
234
- //未使用?
235
-
236
- }, {
237
- key: 'render',
238
- value: function render() {
239
- var _state = this.state,
240
- collapsed = _state.collapsed,
241
- selectedKeys = _state.selectedKeys,
242
- solt = _state.solt,
243
- _state$portalHead = _state.portalHead,
244
- portalHead = _state$portalHead === undefined ? [] : _state$portalHead,
245
- _state$loginHead = _state.loginHead,
246
- loginHead = _state$loginHead === undefined ? [] : _state$loginHead,
247
- _state$retailOrder = _state.retailOrder,
248
- retailOrder = _state$retailOrder === undefined ? [] : _state$retailOrder,
249
- logoUrl = _state.logoUrl;
250
-
251
- var pathname = _mutantsMicrofx.history.location.pathname;
252
- var storeInfo = _mutantsMicrofx.stores.user.options.get('store');
253
- var isPortal = !!portalHead.length;
254
- var isLogin = !!loginHead.length;
255
- var isRetailOrder = !!retailOrder.length;
256
-
257
- var headProps = {
258
- logo: this.logoNode(logoUrl, isPortal),
259
- businessName: '',
260
- storeName: '',
261
- dateFormat: 'yyyy年MM月dd日 hh:mm:ss',
262
- menu: [{ title: '注销', key: 'logout', icon: 'zhuxiao' }, { title: '修改密码', key: 'modifypass', icon: 'suoping' }],
263
- onClick: this.headMenuSelect
264
- };
265
- if (storeInfo) {
266
- headProps.businessName = storeInfo.orgName;
267
- headProps.storeName = storeInfo.storeName;
268
- headProps.posCode = storeInfo.posCode;
269
- }
270
-
271
- // 如果存在商米副屏则优先加载商米副屏
272
- if (this.isHorizontalSunMi_FuPing) {
273
- return _react2.default.createElement(_reactRouter.Redirect, { to: '/vicescreen' });
274
- }
275
-
276
- // console.log('stores.user.isLogin========',stores.user);
277
- console.log('!stores.posLoginStore.posIsLogin=============', !_mutantsMicrofx.stores.posLoginStore.posIsLogin);
278
- if (!_mutantsMicrofx.stores.posLoginStore.posIsLogin && !~pathname.indexOf('login')) {
279
- _mutantsMicrofx.stores.modalRouter.hideAll && _mutantsMicrofx.stores.modalRouter.hideAll();
280
- return _react2.default.createElement(_reactRouter.Redirect, { to: '/login' });
281
- // return <Redirect to={'/login?redirect=' + pathname}/>
282
- }
283
- var classNames = ['isPortal-layout', 'isRetailOrder-layout'];
284
- var layoutClassName = [isPortal, isRetailOrder].map(function (v, i) {
285
- return v ? classNames[i] : '';
286
- }).join(' ');
287
- return _react2.default.createElement(
288
- _tplusComponentsTouch.Layout,
289
- {
290
- style: { height: '100%' },
291
- className: layoutClassName
292
- },
293
- _react2.default.createElement(
294
- _tplusComponentsTouch.Layout,
295
- null,
296
- _react2.default.createElement(_header2.default, (0, _extends3.default)({}, headProps, {
297
- solt: solt,
298
- isPortal: isPortal,
299
- className: isPortal ? 'isPortal-head' : '',
300
- isLogin: isLogin,
301
- location: this.props.location,
302
- history: this.props.history
303
- })),
304
- _react2.default.createElement(
305
- _tplusComponentsTouch.Layout.Content,
306
- null,
307
- this.props.match.isExact ? _react2.default.createElement(_Portal2.default, null) : _react2.default.createElement(
308
- _mutantsMicrofx.Switch,
309
- null,
310
- this.props.routes
311
- )
312
- )
313
- )
314
- );
315
- }
316
- }]);
317
- return MainContainer;
318
- }(_react.Component), _class2.childContextTypes = {
319
- infoRender: _propTypes2.default.func,
320
- headHook: _propTypes2.default.object,
321
- actionHook: _propTypes2.default.object
322
- }, _initialiseProps = function _initialiseProps() {
323
- var _this3 = this;
324
-
325
- this.initWebFrameZoom = function () {
326
- var webFrame = _this3.electron ? _this3.electron.webFrame : null;
327
- var value = _mutantsMicrofx.localStore.get('webFrameZoomValue') || '0.7';
328
- if (webFrame) webFrame.setZoomFactor(parseFloat(value));
329
- };
330
-
331
- this.doDeeplinkingUrl = function () {
332
- if (_this3.hasElectron === false) return;
333
-
334
- var _ref4 = _this3.electron || { ipcRenderer: null },
335
- ipcRenderer = _ref4.ipcRenderer;
336
-
337
- ipcRenderer && ipcRenderer.on("asynchronous-deeplinkingUrl", function (event, ret, params) {
338
- if (ret) {
339
- console.log('deeplinkingUrl:' + ret);
340
-
341
- var _ref5 = _mutantsMicrofx.localStore.get('user') || {},
342
- orgId = _ref5.orgId,
343
- userId = _ref5.userId;
344
-
345
- if (!orgId || !userId) return;
346
- var param = ret.split('&').reduce(function (accumulator, current) {
347
- if (!current) return accumulator;
348
-
349
- var _ref6 = current.split('=') || [],
350
- _ref7 = (0, _slicedToArray3.default)(_ref6, 2),
351
- key = _ref7[0],
352
- value = _ref7[1];
353
-
354
- accumulator[key] = value;
355
- return accumulator;
356
- }, {});
357
- console.log(orgId, userId, param);
358
- if (param.orgId !== orgId || param.cloudUserId !== userId) {
359
- _tplusApi.User.logout();
360
- }
361
- }
362
- });
363
- };
364
-
365
- this.changeLogoSubject = function () {
366
- var subject = new _rxjs.Subject();
367
- rx$.changeLogo = subject;
368
-
369
- subject.subscribe({
370
- next: function next(v) {
371
- return _this3.setLogo();
372
- }
373
- });
374
- };
375
-
376
- this.addHotKeyChangeLister = function () {
377
- document.addEventListener("RESET_USER_STORE", _this3.registerHotKey);
378
- };
379
-
380
- this.removeHotKeyChangeLister = function () {
381
- document.removeEventListener("RESET_USER_STORE", _this3.registerHotKey);
382
- };
383
-
384
- this.clearStorage = function (isFirstStartUp) {
385
- if (!isFirstStartUp) return;
386
-
387
- var cacheStorageKeys = ['i18nextLng', 'version'];
388
- var cacheStorage = cacheStorageKeys.reduce(function (prev, currentKey) {
389
- prev[currentKey] = _mutantsMicrofx.localStore.get(currentKey);
390
- return prev;
391
- }, {});
392
-
393
- localStorage.clear();
394
- cacheStorageKeys.forEach(function (key) {
395
- return _mutantsMicrofx.localStore.set(key, cacheStorage[key]);
396
- });
397
- };
398
-
399
- this.setLogo = function () {
400
- var store = _mutantsMicrofx.localStore.get('StoreKey') || {};
401
- var logoUrl = store.logo;
402
-
403
- logoUrl && _this3.setState({ logoUrl: logoUrl });
404
- };
405
-
406
- this.logoNode = function (url, isPortal) {
407
- var _ref8 = _mutantsUtil.platform || {},
408
- isVerticalTouch = _ref8.isVerticalTouch;
409
-
410
- var defualtImage = isVerticalTouch === true ? 'https://newretail.static.chanjet.com/tinified/logo.png' : 'https://newretail.static.chanjet.com/' + (isPortal ? 'protal-chanjet' : 'chanjet') + '-logo.png';
411
- return _react2.default.createElement('img', { src: url || defualtImage, className: 'example-logo' });
412
- };
413
-
414
- this.hotKeyInjectOrEject = function (type, hotKeyAction) {
415
- var registerKeys = ['esc', 'enter'];
416
- var allKeys = [].concat(registerKeys, (0, _toConsumableArray3.default)((0, _keys2.default)(_tplusComponentsTouch.hotKey.hotKeyConfig)));
417
- allKeys.forEach(function (keyboard, index) {
418
- _mutantsMicrofx.nativeMs.onIpcRendererGlobalShortcut({ type: type, keyboard: keyboard }, hotKeyActionHandle);
419
- });
420
- };
421
-
422
- this.blurButton = function (_ref9) {
423
- var target = _ref9.target;
424
- // 焦点为 button 时 移除焦点,防止触发 bee 组件enter快捷键
425
- if (target && target.nodeName === 'BUTTON') {
426
- target.blur();
427
- }
428
- };
429
-
430
- this.registerHotKey = function () {
431
- _this3.isSetHotKey = true;
432
-
433
- _this3.hotKeyCreate = (0, _tplusComponentsTouch.hotKey)({
434
- observerCallback: _this3.observerDom,
435
- log: true,
436
- pressed: _this3.hotKeyAction,
437
- clickBefore: function clickBefore() {
438
- var _document = document,
439
- activeElement = _document.activeElement;
440
-
441
- activeElement && activeElement.blur();
442
- },
443
- filter: function filter(event) {
444
- var _ref10 = event.target || event.srcElement || {},
445
- tagName = _ref10.tagName,
446
- className = _ref10.className;
447
-
448
- return !(event.key === 'Enter' && tagName === 'INPUT' && !~className.indexOf('hot-key-not-filter'));
449
- }
450
- });
451
-
452
- _this3.hotKeyCreate.observer(undefined, { attributes: false, childList: true, subtree: false });
453
- _this3.hotKeyCreate.register('esc')('.hot-key-focus-container')(_index.operationKeys.esc);
454
- _this3.hotKeyCreate.register('enter')('.hot-key-focus-container')(_index.operationKeys.enter);
455
-
456
- // 全局写入快捷键配置已经不需要单独设置
457
- // const homeKeyCode = 'ctrl+home';
458
- // this.hotKeyCreate.bind([homeKeyCode], (event, handle) => {
459
- // const { key } = handle || {};
460
- // if (key === homeKeyCode) {
461
- // history.push('/');
462
- // (stores.voucherStore || {}).clearData && stores.voucherStore.clearData();
463
- // rx$.memberNameSubject.next('');
464
- // }
465
- // });
466
- };
467
-
468
- this.observerDom = function (mutationsList) {
469
- var modals = document.querySelectorAll('.u-modal');
470
-
471
- var visibleDrawer = void 0;
472
- var drawers = document.querySelectorAll('.drawerc');
473
- var _iteratorNormalCompletion = true;
474
- var _didIteratorError = false;
475
- var _iteratorError = undefined;
476
-
477
- try {
478
- for (var _iterator = (0, _getIterator3.default)(drawers), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
479
- var drawer = _step.value;
480
-
481
- var width = parseInt(drawer.style.width, 10);
482
- if (width) {
483
- visibleDrawer = drawer;
484
- break;
485
- }
486
- }
487
- } catch (err) {
488
- _didIteratorError = true;
489
- _iteratorError = err;
490
- } finally {
491
- try {
492
- if (!_iteratorNormalCompletion && _iterator.return) {
493
- _iterator.return();
494
- }
495
- } finally {
496
- if (_didIteratorError) {
497
- throw _iteratorError;
498
- }
499
- }
500
- }
501
-
502
- if (modals.length) {
503
- $.clearFocus();
504
- return $.setFocus(modals[modals.length - 1]);
505
- }
506
-
507
- if (visibleDrawer) {
508
- $.clearFocus();
509
- return $.setFocus(visibleDrawer);
510
- }
511
-
512
- if ($.getFocusId() !== '1') {
513
- $.clearFocus();
514
- $.find('.app', true).setFocus();
515
- }
516
- };
517
-
518
- this.hotKeyAction = function (event, handle) {
519
- var _ref11 = handle || {},
520
- key = _ref11.key;
521
-
522
- var toggleKeyCode = 'ctrl+f1';
523
- if (key === toggleKeyCode) {
524
- var isSetHotKey = _this3.isSetHotKey = !_this3.isSetHotKey;
525
- var message = isSetHotKey ? '设置' : '取消';
526
- if (isSetHotKey) {
527
- $.bind(_this3.keys.filter(function (i) {
528
- return i !== toggleKeyCode;
529
- }), _this3.hotKeyAction);
530
- } else {
531
- $.unbind(_this3.keys.filter(function (i) {
532
- return i !== toggleKeyCode;
533
- }));
534
- }
535
- return _tplusComponentsTouch.Message.info('\u5DF2' + message + '\u5FEB\u6377\u952E');
536
- }
537
-
538
- $.action(key);
539
- };
540
-
541
- this.handleInfoRender = function (solt) {
542
- _this3.setState({ solt: solt });
543
- };
544
-
545
- this.onCollapse = function () {
546
- var collapsed = _this3.state.collapsed;
547
-
548
- _this3.setState({ collapsed: !collapsed });
549
- };
550
-
551
- this.menuOnClick = function (_ref12) {
552
- var key = _ref12.key;
553
-
554
- console.log(key);
555
- _this3.setState({ selectedKeys: key });
556
- };
557
-
558
- this.handleClose = function () {
559
- _tplusComponentsTouch.Keyboard.close();
560
- };
561
-
562
- this.handleOk = function (type, count) {
563
- _mutantsMicrofx.stores.modifyPassStore.modifyPassWord();
564
- };
565
-
566
- this.headMenuSelect = function (_ref13) {
567
- var key = _ref13.key;
568
-
569
- var footer = [{ text: '取消', className: 'modifypass-cancal-button', closable: true, action: _this3.handleClose }, { text: '确定', className: 'modifypass-ok-button', action: _this3.handleOk }];
570
- footer = !!footer.length && _react2.default.createElement(
571
- 'div',
572
- null,
573
- footer.map(function (btn, i) {
574
- return _react2.default.createElement(
575
- _Button3.default,
576
- {
577
- className: btn.className || '',
578
- key: i,
579
- colors: btn.type,
580
- loading: btn.loading,
581
- onClick: function onClick() {
582
- //if (btn.action){executeAction(btn.action)}
583
- var _ref14 = btn || {},
584
- action = _ref14.action;
585
-
586
- if (typeof action === 'function') action();
587
- if (btn.closable) {
588
- _mutantsMicrofx.stores.modalRouter.hide('/modifypass');
589
- }
590
- }
591
- },
592
- btn.text
593
- );
594
- })
595
- );
596
- switch (key) {
597
- case 'logout':
598
- _tplusApi.User.logout();
599
- break;
600
- case 'modifypass':
601
- _mutantsMicrofx.stores.modalRouter.show({
602
- url: '/modifypass',
603
- title: '修改密码',
604
- className: 'modify-password',
605
- width: 402,
606
- footer: footer, modalType: 'mid',
607
- onHide: function onHide() {
608
- return _mutantsMicrofx.stores.modalRouter.hide('/modifypass');
609
- }
610
- });
611
- break;
612
- default:
613
- _mutantsMicrofx.history.push('/' + key);
614
- break;
615
- }
616
- };
617
- }, _temp)) || _class;
618
-
619
- function Main(props) {
620
- var routes = props.routes,
621
- modalRouter = props.modalRouter;
622
-
623
-
624
- if (modalRouter) {
625
- return _react2.default.createElement(
626
- _mutantsMicrofx.Switch,
627
- null,
628
- routes
629
- );
630
- }
631
-
632
- return _react2.default.cloneElement(_react2.default.createElement(MainContainer, null), props);
633
- }
634
- //# sourceMappingURL=index.js.map