tplus-portaltouch 3.22.3 → 3.22.7
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 +1 -1
- package/dist/api/ModifyPassApi.js.map +1 -1
- package/dist/components/header/headContent.js +495 -38
- package/dist/components/header/headContent.js.map +1 -1
- package/dist/components/header/offlinePointDesc.js +7 -0
- package/dist/components/header/offlinePointDesc.js.map +1 -0
- package/dist/components/header/style.less +106 -1
- package/dist/components/header/uploadList.js +269 -0
- package/dist/components/header/uploadList.js.map +1 -0
- package/dist/containers/Main/index.js +20 -17
- package/dist/containers/Main/index.js.map +1 -1
- package/dist/pages/Portal/index.js +228 -127
- package/dist/pages/Portal/index.js.map +1 -1
- package/dist/pages/Portalbc/data.js +2 -2
- package/dist/pages/Portalbc/data.js.map +1 -1
- package/dist/pages/Portalbc/index.js +214 -125
- package/dist/pages/Portalbc/index.js.map +1 -1
- package/dist/pages/Portalbc/index.less +4 -0
- package/package.json +37 -37
- package/dist/pages/Portal/data.js +0 -32
- package/dist/pages/Portal/data.js.map +0 -1
- package/dist/pages/Portal/horizontalPadPortal.js +0 -129
- package/dist/pages/Portal/horizontalPadPortal.js.map +0 -1
- package/dist/pages/Portal/horizontalSunMiPortal.js +0 -130
- package/dist/pages/Portal/horizontalSunMiPortal.js.map +0 -1
- package/dist/pages/Portal/index.less +0 -612
- package/dist/pages/Portal/verticalPortal.js +0 -126
- package/dist/pages/Portal/verticalPortal.js.map +0 -1
|
@@ -82,7 +82,7 @@ var Request = exports.Request = function () {
|
|
|
82
82
|
switch (_context2.prev = _context2.next) {
|
|
83
83
|
case 0:
|
|
84
84
|
_context2.next = 2;
|
|
85
|
-
return (0, _tplusApi.
|
|
85
|
+
return (0, _tplusApi.addOperatorLog)({ title: title, code: code, description: description });
|
|
86
86
|
|
|
87
87
|
case 2:
|
|
88
88
|
return _context2.abrupt('return', _context2.sent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-portaltouch/api/ModifyPassApi.js"],"names":["ModifyPassApi","oldPass","newPass","param","Request","title","code","description"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;IAEqBA,a;;;;;;;;2GAEKC,O,EAASC,O;;;;;;AACzBC,qB,GAAQ,EAACF,gBAAD,EAAUC,gBAAV,E;;uBACD,oBAAKC,KAAL,EAAY,sCAAZ,EAAoD,KAApD,EAA2D,KAA3D,C;;;;;;;;;;;;;;;;;;;;;;;kBAJIH,a;;IASRI,O,WAAAA,O;;;;;;;;6GAEWC,K;YAAOC,I,uEAAO,E;YAAIC,W;;;;;;uBACzB,
|
|
1
|
+
{"version":3,"sources":["tplus-portaltouch/api/ModifyPassApi.js"],"names":["ModifyPassApi","oldPass","newPass","param","Request","title","code","description"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;IAEqBA,a;;;;;;;;2GAEKC,O,EAASC,O;;;;;;AACzBC,qB,GAAQ,EAACF,gBAAD,EAAUC,gBAAV,E;;uBACD,oBAAKC,KAAL,EAAY,sCAAZ,EAAoD,KAApD,EAA2D,KAA3D,C;;;;;;;;;;;;;;;;;;;;;;;kBAJIH,a;;IASRI,O,WAAAA,O;;;;;;;;6GAEWC,K;YAAOC,I,uEAAO,E;YAAIC,W;;;;;;uBACzB,8BAAe,EAACF,YAAD,EAAQC,UAAR,EAAcC,wBAAd,EAAf,C;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAIA,oBAAK,EAAL,EAAS,qCAAT,EAAgD,KAAhD,EAAuD,KAAvD,C;;;;;;;;;;;;;;;;;;;AAEf;;;;;;;;;;;uBAEe,oBAAK,EAAL,EAAS,mCAAT,EAA8C,KAA9C,EAAqD,KAArD,C","file":"ModifyPassApi.js","sourcesContent":["import {tApi,addOperatorLog} from 'tplus-api';\r\n\r\nexport default class ModifyPassApi {\r\n\r\n static async modifyPass(oldPass, newPass) {\r\n const param = {oldPass, newPass};\r\n return await tApi(param, 'chanjet.RE.NewPos.RegisterOrLoginPOS', false, false);\r\n }\r\n\r\n}\r\n\r\nexport class Request {\r\n\r\n static async saveLogo(title, code = '', description) {\r\n return await addOperatorLog({title, code, description});\r\n }\r\n\r\n static async homeOperation() {\r\n return await tApi({}, 'chanjet.RE.NewPos.GetHomeOperations', false, false);\r\n }\r\n /**获取功能权限 */\r\n static async functionData() {\r\n return await tApi({}, 'chanjet.RE.NewPos.GetFunctionData', false, false);\r\n }\r\n}\r\n"]}
|
|
@@ -50,12 +50,27 @@ var _themeModal = require('./themeModal');
|
|
|
50
50
|
|
|
51
51
|
var _themeModal2 = _interopRequireDefault(_themeModal);
|
|
52
52
|
|
|
53
|
+
var _uploadList = require('./uploadList');
|
|
54
|
+
|
|
55
|
+
var _uploadList2 = _interopRequireDefault(_uploadList);
|
|
56
|
+
|
|
57
|
+
var _mobxReact = require('mobx-react');
|
|
58
|
+
|
|
59
|
+
var _offlinePointDesc = require('./offlinePointDesc');
|
|
60
|
+
|
|
53
61
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
54
62
|
|
|
55
|
-
require('../../utils/networkCheck');
|
|
56
63
|
var Item = _antd.Menu.Item;
|
|
57
64
|
|
|
58
65
|
var defaultFromat = 'yyyy-MM-dd hh:mm:ss';
|
|
66
|
+
var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail');
|
|
67
|
+
var UPLOAD_BASE_PATH = '/login';
|
|
68
|
+
var NETWORK_THEME_PATH = "/";
|
|
69
|
+
var PLACE_ORDER_PATH = "/RE/RE01";
|
|
70
|
+
var weakRemindNum = 0; // 弱网提示初始值
|
|
71
|
+
var WEAK_STANDARD_NUM = 3; // 弱网提示的次数上限
|
|
72
|
+
//自助大屏、PAD版本、商米暂不支持离线
|
|
73
|
+
var otherOfflineStatus = _mutantsMicrofx.localStore.get('isVerticalTouch') == 'true' || _mutantsMicrofx.localStore.get('isHorizontalPad') == 'true' || _mutantsMicrofx.localStore.get('isHorizontalSunMi') == 'true';
|
|
59
74
|
|
|
60
75
|
//头部时间
|
|
61
76
|
function HeadTime(props) {
|
|
@@ -111,34 +126,453 @@ function HeadTime(props) {
|
|
|
111
126
|
}
|
|
112
127
|
|
|
113
128
|
//头部联网状态
|
|
114
|
-
|
|
129
|
+
var OnLineStatus = (0, _mobxReact.observer)(function (props) {
|
|
115
130
|
var networkStatus = props.networkStatus;
|
|
131
|
+
var networkCheckStore = _mutantsMicrofx.stores.networkCheckStore;
|
|
132
|
+
|
|
133
|
+
var networkState = networkCheckStore.networkState;
|
|
134
|
+
var networkOn = true;
|
|
135
|
+
var iconName = 'WiFi';
|
|
136
|
+
switch (networkState) {
|
|
137
|
+
case '联网':
|
|
138
|
+
iconName = 'WiFi';
|
|
139
|
+
break;
|
|
140
|
+
case '弱网':
|
|
141
|
+
iconName = 'ruowifi';
|
|
142
|
+
break;
|
|
143
|
+
case '离线':
|
|
144
|
+
networkOn = false;
|
|
145
|
+
iconName = 'wuwangluo';
|
|
146
|
+
break;
|
|
147
|
+
default:
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
var switchNetwork = function switchNetwork(checked, event) {
|
|
151
|
+
networkCheckStore.switchOnLine(checked);
|
|
152
|
+
};
|
|
153
|
+
var lineIcon = _react2.default.createElement(_tplusComponentsTouch.Ticon, {
|
|
154
|
+
icon: iconName,
|
|
155
|
+
className: 'network-state-icon'
|
|
156
|
+
});
|
|
157
|
+
return _react2.default.createElement(
|
|
158
|
+
'div',
|
|
159
|
+
null,
|
|
160
|
+
_react2.default.createElement(
|
|
161
|
+
'span',
|
|
162
|
+
{ className: 'network-status', style: { marginRight: '10px' } },
|
|
163
|
+
networkStatus || lineIcon
|
|
164
|
+
),
|
|
165
|
+
_react2.default.createElement(
|
|
166
|
+
'span',
|
|
167
|
+
null,
|
|
168
|
+
_react2.default.createElement(_antd.Switch, { checkedChildren: '\u5F00\u542F', unCheckedChildren: '\u5173\u95ED', defaultChecked: true, checked: networkOn, onChange: switchNetwork })
|
|
169
|
+
)
|
|
170
|
+
);
|
|
171
|
+
});
|
|
172
|
+
function getIsOffNetWork() {
|
|
173
|
+
var networkCheckStore = _mutantsMicrofx.stores.networkCheckStore;
|
|
116
174
|
|
|
117
|
-
|
|
175
|
+
return networkCheckStore.networkState === '离线';
|
|
176
|
+
}
|
|
177
|
+
//头部联网状态
|
|
178
|
+
var OnLineStatusToggle = (0, _mobxReact.observer)(function (props) {
|
|
179
|
+
var isShowUploadBtnsByRouter = props.isShowUploadBtnsByRouter,
|
|
180
|
+
isResetNetWorkTheme = props.isResetNetWorkTheme,
|
|
181
|
+
isOfflineCash = props.isOfflineCash,
|
|
182
|
+
isPlaceOrderPage = props.isPlaceOrderPage;
|
|
183
|
+
var networkCheckStore = _mutantsMicrofx.stores.networkCheckStore,
|
|
184
|
+
offlineSys = _mutantsMicrofx.stores.offlineSys,
|
|
185
|
+
voucherStore = _mutantsMicrofx.stores.voucherStore;
|
|
186
|
+
|
|
187
|
+
var networkState = networkCheckStore.networkState;
|
|
188
|
+
var isOnLine = networkCheckStore.isOnLine;
|
|
189
|
+
var hasUseOffline = isOfflineCash && !otherOfflineStatus; //是否允许离线
|
|
190
|
+
var iconName = 'WiFi';
|
|
191
|
+
if (hasUseOffline) {
|
|
192
|
+
var weakConfirm = function weakConfirm() {
|
|
193
|
+
if (!isOnLine) return; // 离线不提示
|
|
194
|
+
if (networkState !== '弱网') return; // 非弱网不提示
|
|
195
|
+
if (weakRemindNum >= WEAK_STANDARD_NUM) return; // 提示大于三次不再提示
|
|
196
|
+
if (!offlineSys.getDataIsOffline) return; // 数据未下载完不提示
|
|
197
|
+
if (document.querySelector('.isRetailUpLoading')) return; // 上传中不提示
|
|
198
|
+
if (document.querySelector('.isRetailDownLoading')) return; // 下载中不提示
|
|
199
|
+
if (document.querySelector('.tplus-loading')) return; // 全屏loading不提示
|
|
200
|
+
weakRemindNum++;
|
|
201
|
+
_tplusComponentsTouch.ModalWraper.confirm({
|
|
202
|
+
title: t('提示'),
|
|
203
|
+
content: t('当前网络不好,是否切换到离线?'),
|
|
204
|
+
onOk: function onOk() {
|
|
205
|
+
setOffLine(true);
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
switch (networkState) {
|
|
211
|
+
case '联网':
|
|
212
|
+
iconName = 'WiFi';
|
|
213
|
+
break;
|
|
214
|
+
case '弱网':
|
|
215
|
+
iconName = 'ruowifi';
|
|
216
|
+
break;
|
|
217
|
+
case '离线':
|
|
218
|
+
iconName = 'wuwangluo';
|
|
219
|
+
break;
|
|
220
|
+
default:
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
223
|
+
if (networkState === '离线' && isOnLine) {
|
|
224
|
+
_tplusComponentsTouch.ModalWraper.confirm({
|
|
225
|
+
title: t('提示'),
|
|
226
|
+
content: t('网络已断,是否切换到离线收银模式?'),
|
|
227
|
+
onOk: function onOk() {
|
|
228
|
+
setOffLine(true);
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
weakConfirm();
|
|
234
|
+
}
|
|
235
|
+
function switchStatus() {
|
|
236
|
+
if (networkState === '离线' && !isOnLine) {
|
|
237
|
+
_tplusComponentsTouch.Message.tip('当前无网络,无法切换为在线状态');
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
_tplusComponentsTouch.ModalWraper.confirm({
|
|
241
|
+
title: t('提示'),
|
|
242
|
+
content: t('\u786E\u5B9A\u8981\u5207\u6362\u4E3A' + (isOnLine ? '离' : '在') + '\u7EBF\u73AF\u5883\u5417\uFF1F'),
|
|
243
|
+
onOk: function onOk() {
|
|
244
|
+
setOffLine(isOnLine);
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
function setOffLine(status) {
|
|
249
|
+
if (isPlaceOrderPage) {
|
|
250
|
+
_tplusComponentsTouch.ModalWraper.confirm({
|
|
251
|
+
title: t('提示'),
|
|
252
|
+
content: t('\u5F53\u524D\u4E3A\u5F00\u5355\u754C\u9762\uFF0C\u5207\u6362\u5230' + (status ? '离' : '在') + '\u7EBF\u4F1A\u6E05\u9664\u5F53\u524D\u6570\u636E\uFF0C\u786E\u5B9A\u8981\u5207\u6362\u5417\uFF1F'),
|
|
253
|
+
onOk: function onOk() {
|
|
254
|
+
playStatus(status);
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
} else {
|
|
258
|
+
playStatus(status);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
function playStatus(status) {
|
|
262
|
+
// status 为 true 是在线切离线
|
|
263
|
+
if (status) {
|
|
264
|
+
if (!offlineSys.getDataIsOffline() || document.querySelector('.isRetailDownLoading')) {
|
|
265
|
+
_tplusComponentsTouch.Message.tip('数据还未下载完,无法切换为离线');
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
offlineSys.setIsOffline(status);
|
|
270
|
+
if (isPlaceOrderPage) {
|
|
271
|
+
voucherStore.clearVoucherData();
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return _react2.default.createElement(
|
|
275
|
+
'div',
|
|
276
|
+
{ className: 'on-off-wrap' },
|
|
277
|
+
_react2.default.createElement(
|
|
278
|
+
'div',
|
|
279
|
+
{ className: 'status-square' },
|
|
280
|
+
_react2.default.createElement(
|
|
281
|
+
'span',
|
|
282
|
+
{ className: 'status-tog-btn', style: { color: '' + (isResetNetWorkTheme ? '#fff' : '') } },
|
|
283
|
+
_react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: iconName })
|
|
284
|
+
)
|
|
285
|
+
),
|
|
286
|
+
hasUseOffline && isShowUploadBtnsByRouter && _react2.default.createElement(
|
|
287
|
+
'div',
|
|
288
|
+
{ className: 'status-square c-pointer online-status-bg ' + (isOnLine || isResetNetWorkTheme ? '' : 'off-line') },
|
|
289
|
+
_react2.default.createElement(
|
|
290
|
+
'span',
|
|
291
|
+
{ className: 'status-tog-btn', onClick: switchStatus },
|
|
292
|
+
_react2.default.createElement(
|
|
293
|
+
'span',
|
|
294
|
+
null,
|
|
295
|
+
isOnLine ? '在线' : '离线'
|
|
296
|
+
),
|
|
297
|
+
_react2.default.createElement(
|
|
298
|
+
'span',
|
|
299
|
+
null,
|
|
300
|
+
_react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: 'zaixianlixian', className: 'ts-14' })
|
|
301
|
+
)
|
|
302
|
+
),
|
|
303
|
+
_react2.default.createElement(
|
|
304
|
+
_antd.Popover,
|
|
305
|
+
{ placement: 'bottom', overlayClassName: 'offline-popver', content: _react2.default.createElement(
|
|
306
|
+
'pre',
|
|
307
|
+
null,
|
|
308
|
+
_offlinePointDesc.OFFLINE_POINT_DESC
|
|
309
|
+
), trigger: 'hover' },
|
|
310
|
+
_react2.default.createElement(
|
|
311
|
+
'span',
|
|
312
|
+
{ className: 'status-tog-btn' },
|
|
313
|
+
_react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: 'tanhao1' })
|
|
314
|
+
)
|
|
315
|
+
)
|
|
316
|
+
)
|
|
317
|
+
);
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
//零售单上传
|
|
321
|
+
function RetailUpload() {
|
|
322
|
+
var _this = this;
|
|
323
|
+
|
|
324
|
+
var _useState3 = (0, _react.useState)(false),
|
|
118
325
|
_useState4 = (0, _slicedToArray3.default)(_useState3, 2),
|
|
119
|
-
|
|
120
|
-
|
|
326
|
+
isModalVisible = _useState4[0],
|
|
327
|
+
setIsModalVisible = _useState4[1];
|
|
121
328
|
|
|
122
|
-
var
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
329
|
+
var _useState5 = (0, _react.useState)(false),
|
|
330
|
+
_useState6 = (0, _slicedToArray3.default)(_useState5, 2),
|
|
331
|
+
isUpLoading = _useState6[0],
|
|
332
|
+
setIsUpLoading = _useState6[1];
|
|
333
|
+
|
|
334
|
+
var refModal = (0, _react.useRef)(null);
|
|
335
|
+
var showModal = function () {
|
|
336
|
+
var _ref3 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee() {
|
|
337
|
+
return _regenerator2.default.wrap(function _callee$(_context) {
|
|
338
|
+
while (1) {
|
|
339
|
+
switch (_context.prev = _context.next) {
|
|
340
|
+
case 0:
|
|
341
|
+
refModal && refModal.current.fetch();
|
|
342
|
+
setIsModalVisible(true);
|
|
343
|
+
|
|
344
|
+
case 2:
|
|
345
|
+
case 'end':
|
|
346
|
+
return _context.stop();
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
}, _callee, _this);
|
|
350
|
+
}));
|
|
351
|
+
|
|
352
|
+
return function showModal() {
|
|
353
|
+
return _ref3.apply(this, arguments);
|
|
129
354
|
};
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
355
|
+
}();
|
|
356
|
+
|
|
357
|
+
var handleOk = function () {
|
|
358
|
+
var _ref4 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2() {
|
|
359
|
+
var isUpLoad = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
360
|
+
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
|
361
|
+
while (1) {
|
|
362
|
+
switch (_context2.prev = _context2.next) {
|
|
363
|
+
case 0:
|
|
364
|
+
setIsModalVisible(false);
|
|
365
|
+
|
|
366
|
+
if (!getIsOffNetWork()) {
|
|
367
|
+
_context2.next = 4;
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
_tplusComponentsTouch.Message.tip('已断网,不可以上传单据');
|
|
372
|
+
return _context2.abrupt('return');
|
|
373
|
+
|
|
374
|
+
case 4:
|
|
375
|
+
if (isUpLoad) {
|
|
376
|
+
_context2.next = 7;
|
|
377
|
+
break;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
_tplusComponentsTouch.Message.tip('暂无可以上传的单据');
|
|
381
|
+
return _context2.abrupt('return');
|
|
382
|
+
|
|
383
|
+
case 7:
|
|
384
|
+
if (!isUpLoading) {
|
|
385
|
+
_context2.next = 10;
|
|
386
|
+
break;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
_tplusComponentsTouch.Message.tip('零售单正在上传……');
|
|
390
|
+
return _context2.abrupt('return');
|
|
391
|
+
|
|
392
|
+
case 10:
|
|
393
|
+
setIsUpLoading(true);
|
|
394
|
+
_context2.prev = 11;
|
|
395
|
+
_context2.next = 14;
|
|
396
|
+
return _mutantsMicrofx.stores.offlineSys.uploadRetail();
|
|
397
|
+
|
|
398
|
+
case 14:
|
|
399
|
+
_context2.next = 19;
|
|
400
|
+
break;
|
|
401
|
+
|
|
402
|
+
case 16:
|
|
403
|
+
_context2.prev = 16;
|
|
404
|
+
_context2.t0 = _context2['catch'](11);
|
|
405
|
+
|
|
406
|
+
_tplusComponentsTouch.Message.error('上传失败');
|
|
407
|
+
|
|
408
|
+
case 19:
|
|
409
|
+
setIsUpLoading(false);
|
|
410
|
+
|
|
411
|
+
case 20:
|
|
412
|
+
case 'end':
|
|
413
|
+
return _context2.stop();
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}, _callee2, _this, [[11, 16]]);
|
|
417
|
+
}));
|
|
418
|
+
|
|
419
|
+
return function handleOk() {
|
|
420
|
+
return _ref4.apply(this, arguments);
|
|
421
|
+
};
|
|
422
|
+
}();
|
|
423
|
+
|
|
424
|
+
var handleCancel = function handleCancel() {
|
|
425
|
+
setIsModalVisible(false);
|
|
426
|
+
};
|
|
135
427
|
return _react2.default.createElement(
|
|
136
428
|
'div',
|
|
137
|
-
{ className: '
|
|
138
|
-
|
|
429
|
+
{ className: 'upload-retail' },
|
|
430
|
+
_react2.default.createElement(
|
|
431
|
+
'div',
|
|
432
|
+
{ className: 'status-square online-status-bg c-pointer', onClick: showModal },
|
|
433
|
+
_react2.default.createElement(
|
|
434
|
+
'span',
|
|
435
|
+
{ className: 'status-tog-btn' },
|
|
436
|
+
_react2.default.createElement(
|
|
437
|
+
'span',
|
|
438
|
+
{ className: '' + (isUpLoading ? 'isRetailUpLoading' : '') },
|
|
439
|
+
_react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: 'shangchuan' })
|
|
440
|
+
),
|
|
441
|
+
_react2.default.createElement(
|
|
442
|
+
'span',
|
|
443
|
+
{ className: 'fast-upload-btn' },
|
|
444
|
+
'\u4E0A\u4F20\u96F6\u552E\u5355'
|
|
445
|
+
)
|
|
446
|
+
)
|
|
447
|
+
),
|
|
448
|
+
_react2.default.createElement(UnLoadNum, null),
|
|
449
|
+
_react2.default.createElement(_uploadList2.default, { ref: refModal, visible: isModalVisible, handleOk: handleOk, handleCancel: handleCancel })
|
|
139
450
|
);
|
|
140
451
|
}
|
|
452
|
+
// 零售单未上传的数量
|
|
453
|
+
var UnLoadNum = (0, _mobxReact.observer)(function () {
|
|
454
|
+
var retailNotUploadNumber = _mutantsMicrofx.stores.offlineSys.retailNotUploadNumber;
|
|
141
455
|
|
|
456
|
+
return _react2.default.createElement(
|
|
457
|
+
'span',
|
|
458
|
+
{ style: { display: retailNotUploadNumber > 0 ? 'inherit' : 'none' }, className: 'up-count-btn' },
|
|
459
|
+
retailNotUploadNumber > 99 ? '99+' : retailNotUploadNumber
|
|
460
|
+
);
|
|
461
|
+
});
|
|
462
|
+
//零售单下载
|
|
463
|
+
function RetailDownload() {
|
|
464
|
+
var _this2 = this;
|
|
465
|
+
|
|
466
|
+
var offlineSys = _mutantsMicrofx.stores.offlineSys;
|
|
467
|
+
|
|
468
|
+
var _useState7 = (0, _react.useState)(false),
|
|
469
|
+
_useState8 = (0, _slicedToArray3.default)(_useState7, 2),
|
|
470
|
+
isDownload = _useState8[0],
|
|
471
|
+
setIsDownload = _useState8[1];
|
|
472
|
+
|
|
473
|
+
var _useState9 = (0, _react.useState)('下载数据'),
|
|
474
|
+
_useState10 = (0, _slicedToArray3.default)(_useState9, 2),
|
|
475
|
+
downStr = _useState10[0],
|
|
476
|
+
setDownStr = _useState10[1];
|
|
477
|
+
|
|
478
|
+
var handleDownLoad = function () {
|
|
479
|
+
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee3() {
|
|
480
|
+
var result;
|
|
481
|
+
return _regenerator2.default.wrap(function _callee3$(_context3) {
|
|
482
|
+
while (1) {
|
|
483
|
+
switch (_context3.prev = _context3.next) {
|
|
484
|
+
case 0:
|
|
485
|
+
if (!getIsOffNetWork()) {
|
|
486
|
+
_context3.next = 3;
|
|
487
|
+
break;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
_tplusComponentsTouch.Message.tip('已断网,不可以下载单据');
|
|
491
|
+
return _context3.abrupt('return');
|
|
492
|
+
|
|
493
|
+
case 3:
|
|
494
|
+
if (!isDownload) {
|
|
495
|
+
_context3.next = 6;
|
|
496
|
+
break;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
_tplusComponentsTouch.Message.tip('下载中');
|
|
500
|
+
return _context3.abrupt('return');
|
|
501
|
+
|
|
502
|
+
case 6:
|
|
503
|
+
setDownStr('0 %');
|
|
504
|
+
setIsDownload(true);
|
|
505
|
+
_tplusComponentsTouch.Message.tip('下载中');
|
|
506
|
+
_context3.prev = 9;
|
|
507
|
+
_context3.next = 12;
|
|
508
|
+
return offlineSys.downloadCatcherData(function (e) {
|
|
509
|
+
setDownStr(e.percent + ' %');
|
|
510
|
+
});
|
|
511
|
+
|
|
512
|
+
case 12:
|
|
513
|
+
result = _context3.sent;
|
|
514
|
+
|
|
515
|
+
if (result) {
|
|
516
|
+
_tplusComponentsTouch.Message.success('\u6570\u636E\u4E0B\u8F7D\u6210\u529F');
|
|
517
|
+
} else {
|
|
518
|
+
_tplusComponentsTouch.Message.error('\u6570\u636E\u4E0B\u8F7D\u5931\u8D25');
|
|
519
|
+
}
|
|
520
|
+
_context3.next = 19;
|
|
521
|
+
break;
|
|
522
|
+
|
|
523
|
+
case 16:
|
|
524
|
+
_context3.prev = 16;
|
|
525
|
+
_context3.t0 = _context3['catch'](9);
|
|
526
|
+
|
|
527
|
+
_tplusComponentsTouch.Message.error('数据下载失败');
|
|
528
|
+
|
|
529
|
+
case 19:
|
|
530
|
+
setDownStr('下载数据');
|
|
531
|
+
setIsDownload(false);
|
|
532
|
+
|
|
533
|
+
case 21:
|
|
534
|
+
case 'end':
|
|
535
|
+
return _context3.stop();
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}, _callee3, _this2, [[9, 16]]);
|
|
539
|
+
}));
|
|
540
|
+
|
|
541
|
+
return function handleDownLoad() {
|
|
542
|
+
return _ref5.apply(this, arguments);
|
|
543
|
+
};
|
|
544
|
+
}();
|
|
545
|
+
return _react2.default.createElement(
|
|
546
|
+
'div',
|
|
547
|
+
{ className: 'download-retail' },
|
|
548
|
+
_react2.default.createElement(DownloadBtn, { handleDownLoad: handleDownLoad, isDownload: isDownload, downStr: downStr })
|
|
549
|
+
);
|
|
550
|
+
};
|
|
551
|
+
// 下载按钮
|
|
552
|
+
var DownloadBtn = (0, _mobxReact.observer)(function (props) {
|
|
553
|
+
var downStr = props.downStr,
|
|
554
|
+
isDownload = props.isDownload,
|
|
555
|
+
handleDownLoad = props.handleDownLoad;
|
|
556
|
+
|
|
557
|
+
return _react2.default.createElement(
|
|
558
|
+
'div',
|
|
559
|
+
{ className: 'status-square online-status-bg c-pointer ' + (getIsOffNetWork() ? 'is-grey' : ''), onClick: handleDownLoad },
|
|
560
|
+
_react2.default.createElement(
|
|
561
|
+
'span',
|
|
562
|
+
{ className: 'status-tog-btn' },
|
|
563
|
+
_react2.default.createElement(
|
|
564
|
+
'span',
|
|
565
|
+
{ className: '' + (isDownload ? 'isRetailDownLoading' : '') },
|
|
566
|
+
_react2.default.createElement(_tplusComponentsTouch.Ticon, { icon: 'xiazaishuju' })
|
|
567
|
+
),
|
|
568
|
+
_react2.default.createElement(
|
|
569
|
+
'span',
|
|
570
|
+
{ className: 'fast-upload-btn' },
|
|
571
|
+
downStr
|
|
572
|
+
)
|
|
573
|
+
)
|
|
574
|
+
);
|
|
575
|
+
});
|
|
142
576
|
var releaseDate = void 0,
|
|
143
577
|
releaseVersion = void 0;
|
|
144
578
|
try {
|
|
@@ -171,11 +605,32 @@ function HeadContent(props, context) {
|
|
|
171
605
|
onClick = props.onClick,
|
|
172
606
|
location = props.location;
|
|
173
607
|
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
themeVisible =
|
|
177
|
-
setThemeVisible =
|
|
178
|
-
|
|
608
|
+
var _useState11 = (0, _react.useState)(false),
|
|
609
|
+
_useState12 = (0, _slicedToArray3.default)(_useState11, 2),
|
|
610
|
+
themeVisible = _useState12[0],
|
|
611
|
+
setThemeVisible = _useState12[1];
|
|
612
|
+
|
|
613
|
+
var _useState13 = (0, _react.useState)(window.location.href.indexOf(UPLOAD_BASE_PATH) < 0),
|
|
614
|
+
_useState14 = (0, _slicedToArray3.default)(_useState13, 2),
|
|
615
|
+
isShowUploadBtnsByRouter = _useState14[0],
|
|
616
|
+
setIsShowUploadBtnsByRouter = _useState14[1];
|
|
617
|
+
|
|
618
|
+
var _useState15 = (0, _react.useState)(window.location.pathname === NETWORK_THEME_PATH),
|
|
619
|
+
_useState16 = (0, _slicedToArray3.default)(_useState15, 2),
|
|
620
|
+
isResetNetWorkTheme = _useState16[0],
|
|
621
|
+
setIsResetNetWorkTheme = _useState16[1];
|
|
622
|
+
|
|
623
|
+
var _useState17 = (0, _react.useState)(window.location.href.indexOf(PLACE_ORDER_PATH) > 0),
|
|
624
|
+
_useState18 = (0, _slicedToArray3.default)(_useState17, 2),
|
|
625
|
+
isPlaceOrderPage = _useState18[0],
|
|
626
|
+
setIsPlaceOrderPage = _useState18[1];
|
|
627
|
+
|
|
628
|
+
props.history.listen(function (route) {
|
|
629
|
+
setIsResetNetWorkTheme(route.pathname === NETWORK_THEME_PATH);
|
|
630
|
+
setIsShowUploadBtnsByRouter(route.pathname.indexOf(UPLOAD_BASE_PATH) < 0);
|
|
631
|
+
setIsPlaceOrderPage(route.pathname.indexOf(PLACE_ORDER_PATH) > -1);
|
|
632
|
+
});
|
|
633
|
+
var hasUseOffline = (0, _tplusPoslogin.PosInitData)('IsOfflineCash') === "1" && !otherOfflineStatus; //是否允许离线
|
|
179
634
|
var menuProps = { onClick: onClick };
|
|
180
635
|
var menus = _react2.default.createElement(
|
|
181
636
|
_antd.Menu,
|
|
@@ -203,12 +658,12 @@ function HeadContent(props, context) {
|
|
|
203
658
|
title: '关闭提示',
|
|
204
659
|
content: '您确定要关闭应用吗?',
|
|
205
660
|
onOk: function onOk() {
|
|
206
|
-
var
|
|
661
|
+
var _this3 = this;
|
|
207
662
|
|
|
208
|
-
return (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function
|
|
209
|
-
return _regenerator2.default.wrap(function
|
|
663
|
+
return (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee4() {
|
|
664
|
+
return _regenerator2.default.wrap(function _callee4$(_context4) {
|
|
210
665
|
while (1) {
|
|
211
|
-
switch (
|
|
666
|
+
switch (_context4.prev = _context4.next) {
|
|
212
667
|
case 0:
|
|
213
668
|
_tplusComponentsTouch.Loading.show({
|
|
214
669
|
className: 'close-app-loading',
|
|
@@ -225,8 +680,8 @@ function HeadContent(props, context) {
|
|
|
225
680
|
delay: false
|
|
226
681
|
});
|
|
227
682
|
context.actionHook.actionChange('close-app');
|
|
228
|
-
|
|
229
|
-
|
|
683
|
+
_context4.prev = 2;
|
|
684
|
+
_context4.next = 5;
|
|
230
685
|
return _tplusApi.User.logout(function () {
|
|
231
686
|
setTimeout(function () {
|
|
232
687
|
_mutantsMicrofx.nativeMs.doWindow(item.event);
|
|
@@ -234,12 +689,12 @@ function HeadContent(props, context) {
|
|
|
234
689
|
});
|
|
235
690
|
|
|
236
691
|
case 5:
|
|
237
|
-
|
|
692
|
+
_context4.next = 12;
|
|
238
693
|
break;
|
|
239
694
|
|
|
240
695
|
case 7:
|
|
241
|
-
|
|
242
|
-
|
|
696
|
+
_context4.prev = 7;
|
|
697
|
+
_context4.t0 = _context4['catch'](2);
|
|
243
698
|
|
|
244
699
|
_tplusApi.User.clear();
|
|
245
700
|
_mutantsMicrofx.localStore.remove('user');
|
|
@@ -249,10 +704,10 @@ function HeadContent(props, context) {
|
|
|
249
704
|
|
|
250
705
|
case 12:
|
|
251
706
|
case 'end':
|
|
252
|
-
return
|
|
707
|
+
return _context4.stop();
|
|
253
708
|
}
|
|
254
709
|
}
|
|
255
|
-
},
|
|
710
|
+
}, _callee4, _this3, [[2, 7]]);
|
|
256
711
|
}))();
|
|
257
712
|
}
|
|
258
713
|
});
|
|
@@ -270,8 +725,8 @@ function HeadContent(props, context) {
|
|
|
270
725
|
};
|
|
271
726
|
|
|
272
727
|
var setInventoryFocus = function setInventoryFocus() {
|
|
273
|
-
var
|
|
274
|
-
isHorizontalPad =
|
|
728
|
+
var _ref6 = _mutantsUtil.platform || {},
|
|
729
|
+
isHorizontalPad = _ref6.isHorizontalPad;
|
|
275
730
|
|
|
276
731
|
if (!!isHorizontalPad) return;
|
|
277
732
|
var doms = document.getElementsByClassName('app hot-key-focus-container');
|
|
@@ -354,7 +809,9 @@ function HeadContent(props, context) {
|
|
|
354
809
|
_react2.default.createElement('i', { className: 'header-triangle-down' })
|
|
355
810
|
)
|
|
356
811
|
),
|
|
357
|
-
_react2.default.createElement(
|
|
812
|
+
_react2.default.createElement(OnLineStatusToggle, { isShowUploadBtnsByRouter: isShowUploadBtnsByRouter, isResetNetWorkTheme: isResetNetWorkTheme, isOfflineCash: hasUseOffline, isPlaceOrderPage: isPlaceOrderPage }),
|
|
813
|
+
hasUseOffline && isShowUploadBtnsByRouter && _react2.default.createElement(RetailUpload, null),
|
|
814
|
+
hasUseOffline && isShowUploadBtnsByRouter && _react2.default.createElement(RetailDownload, null)
|
|
358
815
|
),
|
|
359
816
|
isElectron && headControlNode,
|
|
360
817
|
_react2.default.createElement(
|