tplus-portaltouch 1.27.1 → 1.27.2

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/dist/api/ModifyPassApi.js +165 -0
  2. package/dist/api/ModifyPassApi.js.map +1 -0
  3. package/dist/components/dutyandsettle/dutysettlebill.js +897 -0
  4. package/dist/components/dutyandsettle/dutysettlebill.js.map +1 -0
  5. package/dist/components/dutyandsettle/dutysettlehistory.js +228 -0
  6. package/dist/components/dutyandsettle/dutysettlehistory.js.map +1 -0
  7. package/dist/components/dutyandsettle/index.js +25 -0
  8. package/dist/components/dutyandsettle/index.js.map +1 -0
  9. package/dist/components/dutyandsettle/tipContent.js +105 -0
  10. package/dist/components/dutyandsettle/tipContent.js.map +1 -0
  11. package/dist/components/header/customUse.js +79 -0
  12. package/dist/components/header/customUse.js.map +1 -0
  13. package/dist/components/header/headContent.js +439 -0
  14. package/dist/components/header/headContent.js.map +1 -0
  15. package/dist/components/header/index.js +102 -0
  16. package/dist/components/header/index.js.map +1 -0
  17. package/dist/components/header/style.less +331 -0
  18. package/dist/components/header/vertical-touch.js +273 -0
  19. package/dist/components/header/vertical-touch.js.map +1 -0
  20. package/dist/components/header/vertical-touch.less +213 -0
  21. package/dist/containers/Main/index.js +634 -0
  22. package/dist/containers/Main/index.js.map +1 -0
  23. package/dist/dutyService/index.js +277 -0
  24. package/dist/dutyService/index.js.map +1 -0
  25. package/dist/index.js +40 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/middleWare/index.js +75 -0
  28. package/dist/middleWare/index.js.map +1 -0
  29. package/dist/modalRouter/StaticRouter.js +134 -0
  30. package/dist/modalRouter/StaticRouter.js.map +1 -0
  31. package/dist/modalRouter/index.js +144 -0
  32. package/dist/modalRouter/index.js.map +1 -0
  33. package/dist/pages/Modal/index.js +71 -0
  34. package/dist/pages/Modal/index.js.map +1 -0
  35. package/dist/pages/Modal/style.less +5 -0
  36. package/dist/pages/Portal/PortalPage.less +662 -0
  37. package/dist/pages/Portal/data.js +42 -0
  38. package/dist/pages/Portal/data.js.map +1 -0
  39. package/dist/pages/Portal/horizontalPadPortal.js +130 -0
  40. package/dist/pages/Portal/horizontalPadPortal.js.map +1 -0
  41. package/dist/pages/Portal/horizontalSunMiPortal.js +140 -0
  42. package/dist/pages/Portal/horizontalSunMiPortal.js.map +1 -0
  43. package/dist/pages/Portal/index.js +830 -0
  44. package/dist/pages/Portal/index.js.map +1 -0
  45. package/dist/pages/Portal/verticalPortal.js +136 -0
  46. package/dist/pages/Portal/verticalPortal.js.map +1 -0
  47. package/dist/pages/dutyandsettle/AuthProcess.js +42 -0
  48. package/dist/pages/dutyandsettle/AuthProcess.js.map +1 -0
  49. package/dist/pages/dutyandsettle/index.js +37 -0
  50. package/dist/pages/dutyandsettle/index.js.map +1 -0
  51. package/dist/pages/dutyandsettle/index.less +576 -0
  52. package/dist/pages/dutyandsettle/offDuty.js +608 -0
  53. package/dist/pages/dutyandsettle/offDuty.js.map +1 -0
  54. package/dist/pages/dutyandsettle/onDialy.js +196 -0
  55. package/dist/pages/dutyandsettle/onDialy.js.map +1 -0
  56. package/dist/pages/dutyandsettle/onDuty.js +256 -0
  57. package/dist/pages/dutyandsettle/onDuty.js.map +1 -0
  58. package/dist/pages/dutyandsettle/onUnDaily.js +149 -0
  59. package/dist/pages/dutyandsettle/onUnDaily.js.map +1 -0
  60. package/dist/pages/dutyandsettle/settleDialy.js +132 -0
  61. package/dist/pages/dutyandsettle/settleDialy.js.map +1 -0
  62. package/dist/pages/index.js +57 -0
  63. package/dist/pages/index.js.map +1 -0
  64. package/dist/pages/modifyPass/index.js +174 -0
  65. package/dist/pages/modifyPass/index.js.map +1 -0
  66. package/dist/pages/modifyPass/style.less +75 -0
  67. package/dist/pages/notFound/index.js +95 -0
  68. package/dist/pages/notFound/index.js.map +1 -0
  69. package/dist/pages/notFound/style.less +4 -0
  70. package/dist/stores/ModalRouter.js +182 -0
  71. package/dist/stores/ModalRouter.js.map +1 -0
  72. package/dist/stores/ModifyPassStore.js +205 -0
  73. package/dist/stores/ModifyPassStore.js.map +1 -0
  74. package/dist/stores/PortalStore.js +214 -0
  75. package/dist/stores/PortalStore.js.map +1 -0
  76. package/dist/stores/PosLoginStore.js +111 -0
  77. package/dist/stores/PosLoginStore.js.map +1 -0
  78. package/dist/stores/billHistoryStore.js +114 -0
  79. package/dist/stores/billHistoryStore.js.map +1 -0
  80. package/dist/stores/dutySettleStore.js +115 -0
  81. package/dist/stores/dutySettleStore.js.map +1 -0
  82. package/dist/stores/index.js +36 -0
  83. package/dist/stores/index.js.map +1 -0
  84. package/dist/utils/PrintProcess.js +112 -0
  85. package/dist/utils/PrintProcess.js.map +1 -0
  86. package/dist/utils/index.js +93 -0
  87. package/dist/utils/index.js.map +1 -0
  88. package/dist/utils/networkCheck.js +78 -0
  89. package/dist/utils/networkCheck.js.map +1 -0
  90. package/package.json +1 -1
@@ -0,0 +1,830 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = undefined;
7
+
8
+ var _Modal4 = require('tinper-bee/dist/Modal');
9
+
10
+ var _Modal5 = _interopRequireDefault(_Modal4);
11
+
12
+ var _Row2 = require('tinper-bee/dist/Row');
13
+
14
+ var _Row3 = _interopRequireDefault(_Row2);
15
+
16
+ var _Col4 = require('tinper-bee/dist/Col');
17
+
18
+ var _Col5 = _interopRequireDefault(_Col4);
19
+
20
+ var _stringify = require('babel-runtime/core-js/json/stringify');
21
+
22
+ var _stringify2 = _interopRequireDefault(_stringify);
23
+
24
+ var _regenerator = require('babel-runtime/regenerator');
25
+
26
+ var _regenerator2 = _interopRequireDefault(_regenerator);
27
+
28
+ var _asyncToGenerator2 = require('babel-runtime/helpers/asyncToGenerator');
29
+
30
+ var _asyncToGenerator3 = _interopRequireDefault(_asyncToGenerator2);
31
+
32
+ var _promise = require('babel-runtime/core-js/promise');
33
+
34
+ var _promise2 = _interopRequireDefault(_promise);
35
+
36
+ var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of');
37
+
38
+ var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf);
39
+
40
+ var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');
41
+
42
+ var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
43
+
44
+ var _createClass2 = require('babel-runtime/helpers/createClass');
45
+
46
+ var _createClass3 = _interopRequireDefault(_createClass2);
47
+
48
+ var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');
49
+
50
+ var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);
51
+
52
+ var _inherits2 = require('babel-runtime/helpers/inherits');
53
+
54
+ var _inherits3 = _interopRequireDefault(_inherits2);
55
+
56
+ var _class, _class2, _temp; /*
57
+ * @Description:
58
+ * @Date: 2019-08-13 08:42:18
59
+ * @LastEditTime: 2021-08-13 14:08:51
60
+ * @LastEditors: chenlongad
61
+ * @modify:修改跳转到T+的查询方案方式
62
+ */
63
+
64
+
65
+ require('tinper-bee/dist/Modal/index.css');
66
+
67
+ require('tinper-bee/dist/Row/index.css');
68
+
69
+ require('tinper-bee/dist/Col/index.css');
70
+
71
+ var _react = require('react');
72
+
73
+ var _react2 = _interopRequireDefault(_react);
74
+
75
+ var _mutantsMicrofx = require('mutants-microfx');
76
+
77
+ var _tplusApi = require('tplus-api');
78
+
79
+ var _tplusComponentsTouch = require('tplus-components-touch');
80
+
81
+ var _mobxReact = require('mobx-react');
82
+
83
+ var _propTypes = require('prop-types');
84
+
85
+ var _propTypes2 = _interopRequireDefault(_propTypes);
86
+
87
+ var _tplusPoslogin = require('tplus-poslogin');
88
+
89
+ require('./PortalPage.less');
90
+
91
+ var _mutantsUtil = require('mutants-util');
92
+
93
+ var _ModifyPassApi = require('../../api/ModifyPassApi');
94
+
95
+ var _data = require('./data');
96
+
97
+ var _middleWare = require('../../middleWare');
98
+
99
+ var _middleWare2 = _interopRequireDefault(_middleWare);
100
+
101
+ var _verticalPortal = require('./verticalPortal');
102
+
103
+ var _verticalPortal2 = _interopRequireDefault(_verticalPortal);
104
+
105
+ var _horizontalPadPortal = require('./horizontalPadPortal');
106
+
107
+ var _horizontalPadPortal2 = _interopRequireDefault(_horizontalPadPortal);
108
+
109
+ var _horizontalSunMiPortal = require('./horizontalSunMiPortal');
110
+
111
+ var _horizontalSunMiPortal2 = _interopRequireDefault(_horizontalSunMiPortal);
112
+
113
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
114
+
115
+ var Content = _tplusComponentsTouch.Layout.Content,
116
+ Footer = _tplusComponentsTouch.Layout.Footer;
117
+
118
+ var tplusWindow = null;
119
+
120
+ var _default = (0, _mobxReact.observer)(_class = (_temp = _class2 = function (_Component) {
121
+ (0, _inherits3.default)(_default, _Component);
122
+
123
+ function _default(props) {
124
+ var _this2 = this;
125
+
126
+ (0, _classCallCheck3.default)(this, _default);
127
+
128
+ var _this = (0, _possibleConstructorReturn3.default)(this, (_default.__proto__ || (0, _getPrototypeOf2.default)(_default)).call(this, props));
129
+
130
+ _this.sunMiPresentationInit = function (result) {
131
+ //SunMi初始化参数设置。
132
+ //副屏幕交互。硬件改动20200428 需要在商米页面加载成功后才能发送 初始化命令
133
+ // 进行主副屏数据交互 初始化
134
+ var _ref = _mutantsMicrofx.localStore.get('user') || {},
135
+ _ref$store = _ref.store;
136
+
137
+ _ref$store = _ref$store === undefined ? {} : _ref$store;
138
+ var _ref$store$storeName = _ref$store.storeName,
139
+ storeName = _ref$store$storeName === undefined ? '' : _ref$store$storeName;
140
+
141
+ console.log(result);
142
+ var filterResult = result && result.filter ? result.filter(function (settingItem) {
143
+ return settingItem.ParamType.Id === "56181";
144
+ }) : [];
145
+ window.sunMi_PresentationManager && window.sunMi_PresentationManager.sharedPreferencesSet("setting_setData", filterResult).then(function () {
146
+ console.log("缓存数据成功");
147
+ window.sunMi_PresentationManager && window.sunMi_PresentationManager.sendMessageToSecondScreen({ step: 0, storeName: storeName });
148
+ });
149
+ };
150
+
151
+ _this.getScreenType = function () {
152
+ var flag = false;
153
+ if (_this.hasElectron === true || _this.isHorizontalSunMi) {
154
+ var data = _mutantsMicrofx.localStore.get('setting_setData') || [];
155
+ data = data.filter(function (item) {
156
+ return item.Name === 'EnableDoubleScreen';
157
+ });
158
+ data = data && data.length > 0 ? data.shift() : null;
159
+ if (data && data.Value === '1') {
160
+ flag = true;
161
+ }
162
+ }
163
+ return flag;
164
+ };
165
+
166
+ _this.saveLog = function (name) {
167
+ var saveLogo = _ModifyPassApi.Request.saveLogo;
168
+
169
+ name = "进入模块:" + name;
170
+ saveLogo('进入模块', undefined, name);
171
+ };
172
+
173
+ _this.handelClick = function () {
174
+ var values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
175
+ var type = values.key,
176
+ isModal = values.isModal,
177
+ title = values.title,
178
+ Name = values.Name,
179
+ search = values.search;
180
+ var tmenuCode = values.tmenuCode;
181
+ var operations = _this.state.operations;
182
+
183
+ var controllable = operations.find(function (vv) {
184
+ return vv.Name === Name;
185
+ });
186
+
187
+ var _ref2 = controllable || {},
188
+ Visibility = _ref2.Visibility,
189
+ HoldFunctionAuth = _ref2.HoldFunctionAuth,
190
+ Title = _ref2.Title,
191
+ MenuCode = _ref2.MenuCode;
192
+
193
+ var errorTip = void 0;
194
+ if (!Title) {
195
+ return _tplusComponentsTouch.ModalWraper.warning({
196
+ title: '提示',
197
+ content: '您的权限配置请求失败,请重新登录',
198
+ onOk: function onOk() {
199
+ _tplusApi.User.logout();
200
+ }
201
+ });
202
+ }
203
+ if (!Visibility) {
204
+ errorTip = '\u60A8\u7684 ' + Title + ' \u6A21\u5757\u6CA1\u6709\u542F\u7528';
205
+ } else if (!HoldFunctionAuth) {
206
+ errorTip = '\u60A8\u6CA1\u6709\u64CD\u4F5C ' + Title + ' \u7684\u6743\u9650';
207
+ }
208
+ var portalStore = _this.context.stores.portalStore;
209
+
210
+ if (errorTip) {
211
+ return _tplusComponentsTouch.Message.warn(errorTip);
212
+ }
213
+ if (isModal) {
214
+ return _mutantsMicrofx.stores.modalRouter.show({ url: '/' + type, width: 800, title: title });
215
+ }
216
+ switch (type) {
217
+ case 'cashier':
218
+ portalStore.checkDuty().then(function (onDutyMessage) {
219
+ if (!!onDutyMessage) {
220
+ var Code = onDutyMessage.Code,
221
+ IdShiftVoucher = onDutyMessage.IdShiftVoucher,
222
+ Shift = onDutyMessage.Shift,
223
+ IdDailyVoucher = onDutyMessage.IdDailyVoucher,
224
+ DailyCode = onDutyMessage.DailyCode;
225
+
226
+ (0, _tplusPoslogin.PosSetData)({ ShiftCode: Code, IdShiftVoucher: IdShiftVoucher, Shift: Shift, IdDailyVoucher: IdDailyVoucher, DailyCode: DailyCode });
227
+ console.log('onDutyMessage======', onDutyMessage);
228
+ _this.saveLog(title);
229
+ _mutantsMicrofx.history.push('/RE/RE01');
230
+ }
231
+ }).catch(function (data) {
232
+ console.log("进入前台收银检查是否当班返回错误");
233
+ console.log(data);
234
+ });
235
+ break;
236
+ case 'onDuty':
237
+ portalStore.onDuty().then(function (onDutyMessage) {
238
+ if (onDutyMessage && onDutyMessage.shift) {
239
+ _middleWare2.default.execute('onDuty');
240
+ }
241
+ });
242
+ break;
243
+ case 'offDuty':
244
+ _mutantsMicrofx.history.push('/offDuty?type=offDuty');
245
+ break;
246
+ case 'settleDialy':
247
+ if (portalStore.bPosDaily()) {
248
+ _mutantsMicrofx.history.push('/offDuty?type=settleDaily');
249
+ } else {
250
+ portalStore.onMakerDaily();
251
+ }
252
+ break;
253
+ default:
254
+ if (tmenuCode || MenuCode) {
255
+ _this.saveLog(title);
256
+ if (MenuCode) {
257
+ _this.toTplusPage(type, MenuCode, search);
258
+ } else {
259
+ _this.toTplusPage(type, tmenuCode, search);
260
+ }
261
+ } else {
262
+ _mutantsMicrofx.history.push('/' + type);
263
+ }
264
+ break;
265
+ }
266
+ };
267
+
268
+ _this.getTplusUrlFromCloudServer = function () {
269
+ //获取T+服务器配置地址。
270
+ var userStore = _tplusApi.User.restore();
271
+ var cloudUrl = 'http://tfproxy.chanjet.com/?url=';
272
+ var data = 'accesstoken=' + ('' + userStore.accessToken) + '&cloudOrgId=' + ('' + userStore.orgId);
273
+ var url = '' + cloudUrl + encodeURIComponent('http://mns.chanapp.chanjet.com/web/WebServer/get?' + ('' + data));
274
+ console.log(url);
275
+ var fetchHeader = {
276
+ headers: {
277
+ 'Content-Type': 'application/x-www-form-urlencoded'
278
+ }
279
+ };
280
+ return new _promise2.default(function (resolve, reject) {
281
+ fetch(url, fetchHeader).then(function (response) {
282
+ return response.json();
283
+ }).then(function (json) {
284
+ console.log(json);
285
+ resolve(json);
286
+ }).catch(function (ex) {
287
+ console.log(ex);
288
+ reject(err);
289
+ });
290
+ });
291
+ };
292
+
293
+ _this.toTplusPage = function () {
294
+ var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(type, tmenuCode, search) {
295
+ var userStore, sid, tplusUrl, tplusinnersite, msg, dsearchPlanID, portalStore, baseUrl, ossjumpUrl, user, loginInfo, pwd, userName, accNum, menu, posCode, storeID, fromUrl;
296
+ return _regenerator2.default.wrap(function _callee$(_context) {
297
+ while (1) {
298
+ switch (_context.prev = _context.next) {
299
+ case 0:
300
+ userStore = _tplusApi.User.restore();
301
+ sid = userStore.sid;
302
+ tplusUrl = (0, _tplusPoslogin.PosInitData)("TplusSite");
303
+ tplusinnersite = (0, _tplusPoslogin.PosInitData)("tplusinnersite");
304
+
305
+ tplusUrl = tplusUrl ? tplusUrl : tplusinnersite;
306
+ if (!tplusUrl && !sid && (_this.hasElectron === true || _this.isHorizontalSunMi)) {
307
+ //软件包,并且electron读取electron配置的地址
308
+ tplusUrl = location.origin + "/tplus";
309
+ }
310
+
311
+ if (tplusUrl) {
312
+ _context.next = 10;
313
+ break;
314
+ }
315
+
316
+ msg = "请用admin登录,在服务器配置–地址配置处,设置“内部或外部网络访问T+服务器的地址”!";
317
+
318
+ _tplusComponentsTouch.ModalWraper.warning({
319
+ title: '温馨提示',
320
+ content: msg,
321
+ okText: '确定',
322
+ okType: 'warning'
323
+ });
324
+ return _context.abrupt('return');
325
+
326
+ case 10:
327
+ dsearchPlanID = void 0;
328
+
329
+ if (!(search && search.id)) {
330
+ _context.next = 16;
331
+ break;
332
+ }
333
+
334
+ portalStore = _this.context.stores.portalStore;
335
+ _context.next = 15;
336
+ return portalStore.getSearchPlanId(search);
337
+
338
+ case 15:
339
+ dsearchPlanID = _context.sent;
340
+
341
+ case 16:
342
+ if (tplusUrl.substring(tplusUrl.length - 1) !== '/') tplusUrl += '/';
343
+ baseUrl = tplusUrl;
344
+ // if(!isProxy){
345
+ // tplusUrl = targetUrl;
346
+ // }
347
+
348
+ ossjumpUrl = tplusUrl + 'view/portal/portal.html?t=' + new Date().getTime();
349
+
350
+ if (sid) {
351
+ ossjumpUrl = tplusUrl + 'view/ossjump.html?t=' + new Date().getTime() + '&sid=' + sid;
352
+ }
353
+ user = _this.context.stores.user;
354
+ loginInfo = user.options.get('loginInfo');
355
+ pwd = user.options.get("password");
356
+ userName = _this.tplusEncode(loginInfo.UserCode);
357
+ accNum = _this.tplusEncode(loginInfo.AccountNum);
358
+ menu = _this.tplusEncode(tmenuCode);
359
+ posCode = _this.tplusEncode(loginInfo.posCode);
360
+ storeID = _this.tplusEncode(loginInfo.storeID + "");
361
+
362
+ pwd = _this.tplusEncode(pwd);
363
+ fromUrl = _this.tplusEncode(location.origin);
364
+
365
+ ossjumpUrl += '&fromApp=nretail&user=' + userName + '&pwd=' + pwd + '&accNum=' + accNum + '&menu=' + menu + '&posCode=' + posCode + '&storeID=' + storeID + '&fromUrl=' + fromUrl;
366
+ if (dsearchPlanID) {
367
+ ossjumpUrl += '&searchPlanID=' + _this.tplusEncode(dsearchPlanID);
368
+ }
369
+ if (_this.isHorizontalSunMi) {
370
+ window.android_CommonFun.openWebUrlByOutBrowser(ossjumpUrl);
371
+ } else if (_this.hasElectron === true) {
372
+ _mutantsMicrofx.nativeMs.useDefaultBrowser(ossjumpUrl);
373
+ } else if (_this.isMobileEnvironment) {
374
+ _this.setState({ showModal: true, frameUrl: ossjumpUrl });
375
+ } else {
376
+ if (!tplusWindow || tplusWindow.closed) {
377
+ tplusWindow = window.open(ossjumpUrl, "tplus", "location=no");
378
+ } else {
379
+ tplusWindow.postMessage({ tmenuCode: tmenuCode, searchPlanID: dsearchPlanID, ossjumpUrl: ossjumpUrl }, baseUrl);
380
+ window.open("", "tplus", "location=no");
381
+ }
382
+ }
383
+
384
+ case 33:
385
+ case 'end':
386
+ return _context.stop();
387
+ }
388
+ }
389
+ }, _callee, _this2);
390
+ }));
391
+
392
+ return function (_x2, _x3, _x4) {
393
+ return _ref3.apply(this, arguments);
394
+ };
395
+ }();
396
+
397
+ _this.closeFrameModal = function () {
398
+ _this.setState({ showModal: false });
399
+ };
400
+
401
+ _this.tplusEncode = function (code) {
402
+ var c = String.fromCharCode(code.charCodeAt(0) + code.length);
403
+ for (var i = 1; i < code.length; i++) {
404
+ c += String.fromCharCode(code.charCodeAt(i) + code.charCodeAt(i - 1));
405
+ }
406
+ var ret = _this.TplusBase64Encode(c);
407
+ return ret;
408
+ };
409
+
410
+ _this.TplusBase64Encode = function (input) {
411
+ var _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
412
+ var output = "";
413
+ var chr1 = void 0,
414
+ chr2 = void 0,
415
+ chr3 = void 0,
416
+ enc1 = void 0,
417
+ enc2 = void 0,
418
+ enc3 = void 0,
419
+ enc4 = void 0;
420
+ var i = 0;
421
+ input = _this._utf8_encode(input);
422
+ while (i < input.length) {
423
+ chr1 = input.charCodeAt(i++);
424
+ chr2 = input.charCodeAt(i++);
425
+ chr3 = input.charCodeAt(i++);
426
+ enc1 = chr1 >> 2;
427
+ enc2 = (chr1 & 3) << 4 | chr2 >> 4;
428
+ enc3 = (chr2 & 15) << 2 | chr3 >> 6;
429
+ enc4 = chr3 & 63;
430
+ if (isNaN(chr2)) {
431
+ enc3 = enc4 = 64;
432
+ } else if (isNaN(chr3)) {
433
+ enc4 = 64;
434
+ }
435
+ output = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2) + _keyStr.charAt(enc3) + _keyStr.charAt(enc4);
436
+ }
437
+ return output;
438
+ };
439
+
440
+ _this._utf8_encode = function (string) {
441
+ string = string.replace(/\r\n/g, "\n");
442
+ var utftext = "";
443
+ for (var n = 0; n < string.length; n++) {
444
+ var c = string.charCodeAt(n);
445
+ if (c < 128) {
446
+ utftext += String.fromCharCode(c);
447
+ } else if (c > 127 && c < 2048) {
448
+ utftext += String.fromCharCode(c >> 6 | 192);
449
+ utftext += String.fromCharCode(c & 63 | 128);
450
+ } else {
451
+ utftext += String.fromCharCode(c >> 12 | 224);
452
+ utftext += String.fromCharCode(c >> 6 & 63 | 128);
453
+ utftext += String.fromCharCode(c & 63 | 128);
454
+ }
455
+ }
456
+ return utftext;
457
+ };
458
+
459
+ _this.operationControl = function () {
460
+ var menu = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
461
+ var operations = _this.state.operations;
462
+
463
+ console.log(operations, 11111);
464
+ menu.forEach(function (v) {
465
+ if (v.sub) {
466
+ return _this.operationControl(v.sub);
467
+ }
468
+ var controllable = operations.find(function (vv) {
469
+ return vv.Name === v.Name;
470
+ });
471
+
472
+ var _ref4 = controllable || {},
473
+ Visibility = _ref4.Visibility,
474
+ HoldFunctionAuth = _ref4.HoldFunctionAuth,
475
+ Title = _ref4.Title;
476
+
477
+ var errorTip = void 0;
478
+ if (!Visibility) {
479
+ errorTip = '\u60A8\u7684 ' + Title + ' \u6A21\u5757\u6CA1\u6709\u542F\u7528';
480
+ } else if (!HoldFunctionAuth) {
481
+ errorTip = '\u60A8\u6CA1\u6709\u64CD\u4F5C ' + Title + ' \u7684\u6743\u9650';
482
+ }
483
+ v.errorTip = errorTip;
484
+ });
485
+ return menu;
486
+ };
487
+
488
+ _this.createLeftNode = function () {
489
+ var menu = _data.leftMenu;
490
+ var menuNode = menu.map(function (v) {
491
+ return v.container ? _react2.default.createElement(
492
+ 'div',
493
+ { style: v.container.style, className: v.container.className, key: v.container.className },
494
+ v.sub.map(function (vv) {
495
+ return _react2.default.createElement(
496
+ 'div',
497
+ {
498
+ className: 'member-item ' + vv.className + ' ' + (vv.disabled ? 'menu-item-disabled' : ''),
499
+ key: vv.className,
500
+ onClick: _this.handelClick.bind(_this, vv)
501
+ },
502
+ !!vv.title && _react2.default.createElement(
503
+ 'h1',
504
+ null,
505
+ vv.title
506
+ ),
507
+ !!vv.label && _react2.default.createElement(
508
+ 'p',
509
+ null,
510
+ vv.label
511
+ ),
512
+ !!vv.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: vv.icon })
513
+ );
514
+ })
515
+ ) : _react2.default.createElement(
516
+ 'div',
517
+ {
518
+ className: 'member-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
519
+ key: v.className,
520
+ onClick: _this.handelClick.bind(_this, v)
521
+ },
522
+ v.title && _react2.default.createElement(
523
+ 'h1',
524
+ null,
525
+ v.title
526
+ ),
527
+ v.label && _react2.default.createElement(
528
+ 'p',
529
+ null,
530
+ v.label
531
+ ),
532
+ v.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: v.icon })
533
+ );
534
+ });
535
+ return menuNode;
536
+ };
537
+
538
+ _this.createCenterNode = function () {
539
+ var leftMenu = _data.centerLeftMenu;
540
+ var rightMenu = _data.centerRightMenu;
541
+ var menuLeftNode = leftMenu.map(function (v) {
542
+ return _react2.default.createElement(
543
+ 'div',
544
+ {
545
+ className: 'worktop-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
546
+ style: v.style,
547
+ key: v.className,
548
+ onClick: _this.handelClick.bind(_this, v)
549
+ },
550
+ v.title && _react2.default.createElement(
551
+ 'h1',
552
+ null,
553
+ v.title
554
+ ),
555
+ v.label && _react2.default.createElement(
556
+ 'p',
557
+ null,
558
+ v.label
559
+ ),
560
+ v.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: v.icon }),
561
+ v.disabled && _react2.default.createElement('div', { className: 'item-disabled-placeholder' })
562
+ );
563
+ });
564
+ var menuRightNode = rightMenu.map(function (v) {
565
+ return v.container ? _react2.default.createElement(
566
+ 'div',
567
+ { style: v.container.style, className: v.container.className, key: v.container.className },
568
+ v.sub.map(function (vv) {
569
+ return _react2.default.createElement(
570
+ 'div',
571
+ {
572
+ className: 'worktop-item ' + vv.className + ' ' + (vv.disabled ? 'menu-item-disabled' : ''),
573
+ key: vv.className,
574
+ onClick: _this.handelClick.bind(_this, vv)
575
+ },
576
+ vv.title && _react2.default.createElement(
577
+ 'h1',
578
+ null,
579
+ vv.title
580
+ ),
581
+ vv.label && _react2.default.createElement(
582
+ 'p',
583
+ null,
584
+ vv.label
585
+ ),
586
+ vv.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: vv.icon })
587
+ );
588
+ })
589
+ ) : _react2.default.createElement(
590
+ 'div',
591
+ {
592
+ className: 'worktop-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
593
+ key: v.className,
594
+ onClick: _this.handelClick.bind(_this, v)
595
+ },
596
+ v.title && _react2.default.createElement(
597
+ 'h1',
598
+ null,
599
+ v.title
600
+ ),
601
+ v.label && _react2.default.createElement(
602
+ 'p',
603
+ null,
604
+ v.label
605
+ ),
606
+ v.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: v.icon })
607
+ );
608
+ });
609
+ return _react2.default.createElement(
610
+ 'div',
611
+ null,
612
+ _react2.default.createElement(
613
+ 'div',
614
+ { className: 'worktop-container-left' },
615
+ menuLeftNode
616
+ ),
617
+ _react2.default.createElement(
618
+ 'div',
619
+ { className: 'worktop-container-right' },
620
+ menuRightNode
621
+ )
622
+ );
623
+ };
624
+
625
+ _this.createRightNode = function () {
626
+ var menu = _data.rightMenu;
627
+ var node = menu.map(function (v, i) {
628
+ return _react2.default.createElement(
629
+ 'div',
630
+ {
631
+ className: 'stock-item ' + v.className + ' ' + (v.disabled ? 'menu-item-disabled' : ''),
632
+ style: v.style,
633
+ key: v.className,
634
+ onClick: _this.handelClick.bind(_this, v)
635
+ },
636
+ !!v.title && _react2.default.createElement(
637
+ 'h1',
638
+ null,
639
+ v.title
640
+ ),
641
+ !!v.icon && _react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: v.icon })
642
+ );
643
+ });
644
+ return node;
645
+ };
646
+
647
+ _this.state = {
648
+ id: Date.now(),
649
+ operations: [],
650
+ showModal: false,
651
+ frameUrl: ''
652
+ };
653
+ _this.hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
654
+
655
+ var _ref5 = _mutantsUtil.platform || {},
656
+ isVerticalTouch = _ref5.isVerticalTouch,
657
+ isHorizontalPad = _ref5.isHorizontalPad,
658
+ isHorizontalSunMi = _ref5.isHorizontalSunMi;
659
+
660
+ _this.isVerticalTouch = !!isVerticalTouch;
661
+ _this.isHorizontalPad = !!isHorizontalPad;
662
+ _this.isHorizontalSunMi = !!isHorizontalSunMi;
663
+ _this.isMobileEnvironment = !!isHorizontalPad || !!isHorizontalSunMi;
664
+ return _this;
665
+ }
666
+
667
+ (0, _createClass3.default)(_default, [{
668
+ key: 'componentWillMount',
669
+ value: function componentWillMount() {
670
+ var _this3 = this;
671
+
672
+ var _context2 = this.context,
673
+ _context2$stores = _context2.stores;
674
+ _context2$stores = _context2$stores === undefined ? {} : _context2$stores;
675
+ var portalStore = _context2$stores.portalStore,
676
+ _context2$headHook = _context2.headHook;
677
+ _context2$headHook = _context2$headHook === undefined ? {} : _context2$headHook;
678
+ var addClass = _context2$headHook.addClass;
679
+ var homeOperation = _ModifyPassApi.Request.homeOperation,
680
+ functionData = _ModifyPassApi.Request.functionData;
681
+
682
+ _tplusComponentsTouch.Loading.show({
683
+ text: '首页权限加载中...',
684
+ delay: 2500
685
+ });
686
+ homeOperation().then(function (operations) {
687
+ _mutantsMicrofx.localStore.set('operationsAuth', (0, _stringify2.default)(operations));
688
+ _this3.setState({ operations: operations });
689
+ _tplusComponentsTouch.Loading.hide();
690
+ }).catch(function (err) {
691
+ console.log('homeOperation.error======', err);
692
+ _tplusComponentsTouch.Loading.hide();
693
+ });
694
+ functionData().then(function (data) {
695
+ // 加载权限数据 DR-29735 by majian
696
+ (0, _tplusPoslogin.PosSetData)(data);
697
+ });
698
+ // portalStore && portalStore.getPortalMenu();
699
+ addClass && addClass(this.state.id, 'portalHead');
700
+ // 初始化参数设置。
701
+ _mutantsMicrofx.stores.setStore.initSetParams().then(function (ret) {
702
+ // 在客户端中,如果开启了副屏设置,尝试这打开副屏。
703
+ if (_this3.getScreenType() === true) {
704
+ if (_this3.isHorizontalSunMi) {
705
+ _this3.sunMiPresentationInit(ret);
706
+ return;
707
+ }
708
+ window.open('vicescreen?ts=' + new Date().getTime(), 'screen');
709
+ }
710
+ });
711
+ }
712
+ // 初始化商米副屏
713
+
714
+ }, {
715
+ key: 'componentWillUnmount',
716
+ value: function componentWillUnmount() {
717
+ var _context$headHook = this.context.headHook;
718
+ _context$headHook = _context$headHook === undefined ? {} : _context$headHook;
719
+ var removeClass = _context$headHook.removeClass;
720
+
721
+ removeClass && removeClass(this.state.id, 'portalHead');
722
+ }
723
+ }, {
724
+ key: 'componentWillReceiveProps',
725
+ value: function componentWillReceiveProps() {
726
+ if (this.getScreenType() === true) {
727
+ //副屏幕交互。硬件改动20200428
728
+ if (this.isHorizontalSunMi) {
729
+ window.sunMi_PresentationManager && window.sunMi_PresentationManager.sendMessageToSecondScreen({ step: 1 });
730
+ } else {
731
+ _mutantsMicrofx.nativeMs && _mutantsMicrofx.nativeMs.setIpcRendererMethod('ReplyScreen', { step: 1 });
732
+ }
733
+ }
734
+ }
735
+
736
+ // 获取副屏的状态
737
+
738
+ }, {
739
+ key: 'menuClick',
740
+ value: function menuClick(item, e) {
741
+ _mutantsMicrofx.history.push(item.path);
742
+ }
743
+ //跳转到T+
744
+
745
+ }, {
746
+ key: 'render',
747
+ value: function render() {
748
+ var _state = this.state,
749
+ showModal = _state.showModal,
750
+ frameUrl = _state.frameUrl;
751
+
752
+ var screenHeight = window.screen.availHeight - 100;
753
+ var htmlContent = null;
754
+ if (this.isVerticalTouch) {
755
+ htmlContent = _react2.default.createElement(_verticalPortal2.default, { handelClick: this.handelClick });
756
+ } else if (this.isHorizontalPad) {
757
+ htmlContent = _react2.default.createElement(_horizontalPadPortal2.default, { handelClick: this.handelClick });
758
+ }
759
+ // else if (this.isHorizontalSunMi) {
760
+ // htmlContent = <HorizontalSunMiPortal handelClick={this.handelClick} />
761
+ // }
762
+ else {
763
+ htmlContent = _react2.default.createElement(
764
+ _tplusComponentsTouch.Layout,
765
+ { style: { height: '100%' }, className: 'portal-content' },
766
+ _react2.default.createElement(
767
+ Content,
768
+ { style: { paddingLeft: '50px', paddingRight: '50px' }, className: 'portal-container' },
769
+ _react2.default.createElement(
770
+ _Row3.default,
771
+ null,
772
+ _react2.default.createElement(
773
+ _Col5.default,
774
+ { lg: 3, sm: 3, className: 'portal-left-col', key: 'left' },
775
+ _react2.default.createElement(
776
+ 'div',
777
+ { className: 'portal-left-content' },
778
+ this.createLeftNode()
779
+ )
780
+ ),
781
+ _react2.default.createElement(
782
+ _Col5.default,
783
+ { lg: 6, sm: 6, className: 'portal-center-col', key: 'center' },
784
+ _react2.default.createElement(
785
+ 'div',
786
+ { className: 'portal-center-content' },
787
+ this.createCenterNode()
788
+ )
789
+ ),
790
+ _react2.default.createElement(
791
+ _Col5.default,
792
+ { lg: 3, sm: 3, className: 'portal-right-col', key: 'right' },
793
+ _react2.default.createElement(
794
+ 'div',
795
+ { className: 'portal-right-content' },
796
+ this.createRightNode()
797
+ )
798
+ )
799
+ )
800
+ ),
801
+ this.isMobileEnvironment && _react2.default.createElement(
802
+ _Modal5.default,
803
+ { show: showModal,
804
+ onHide: this.closeFrameModal,
805
+ width: '99%',
806
+ height: '99%'
807
+ },
808
+ _react2.default.createElement(_Modal5.default.Header, { closeButton: true }),
809
+ _react2.default.createElement(
810
+ _Modal5.default.Body,
811
+ null,
812
+ _react2.default.createElement('iframe', { src: frameUrl, width: '100%', height: screenHeight, frameborder: 'no', border: '0', marginwidth: '0', marginheight: '0', scrolling: 'yes', allowtransparency: 'true' })
813
+ )
814
+ )
815
+ );
816
+ }
817
+ return htmlContent;
818
+ }
819
+ }]);
820
+ return _default;
821
+ }(_react.Component), _class2.propTypes = {
822
+ routes: _propTypes2.default.array
823
+ }, _class2.contextTypes = {
824
+ stores: _propTypes2.default.object,
825
+ infoRender: _propTypes2.default.func,
826
+ headHook: _propTypes2.default.object
827
+ }, _temp)) || _class;
828
+
829
+ exports.default = _default;
830
+ //# sourceMappingURL=index.js.map