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