tplus-components-touch 3.27.1 → 3.28.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/components/billSearch/api.js +13 -74
- package/dist/components/billSearch/api.js.map +1 -1
- package/dist/components/billSearch/index.js +141 -3
- package/dist/components/billSearch/index.js.map +1 -1
- package/dist/components/billSearch/index.less +6 -3
- package/dist/components/cloudPrint/api.js +85 -43
- package/dist/components/cloudPrint/api.js.map +1 -1
- package/dist/components/cloudPrint/printDispatch.js +209 -108
- package/dist/components/cloudPrint/printDispatch.js.map +1 -1
- package/dist/components/hotKey/localConfig.js +0 -52
- package/dist/components/hotKey/localConfig.js.map +1 -1
- package/dist/components/inventorySearch/tab.js +80 -63
- package/dist/components/inventorySearch/tab.js.map +1 -1
- package/dist/components/settlement/settlement.js +69 -208
- package/dist/components/settlement/settlement.js.map +1 -1
- package/dist/components/settlement/settlementStore.js +154 -193
- package/dist/components/settlement/settlementStore.js.map +1 -1
- package/dist/components/ticon/iconfont/demo.css +539 -539
- package/dist/components/ticon/iconfont/demo_index.html +3 -26
- package/dist/components/ticon/iconfont/iconfont.css +3 -7
- package/dist/components/ticon/iconfont/iconfont.js +1 -1
- package/dist/components/ticon/iconfont/iconfont.js.map +1 -1
- package/dist/components/ticon/iconfont/iconfont.json +0 -7
- package/dist/components/ticon/iconfont/iconfont.ttf +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff +0 -0
- package/dist/components/ticon/iconfont/iconfont.woff2 +0 -0
- package/dist/components/touchTable/index.js +0 -4
- package/dist/components/touchTable/index.js.map +1 -1
- package/dist/index.js +16 -9
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/components/presale/pickup.js +0 -419
- package/dist/components/presale/pickup.js.map +0 -1
- package/dist/components/presale/style.less +0 -48
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.printDispatch = exports.DoNameList = undefined;
|
|
6
|
+
exports.getCheckedPrintTypeDefaults = exports.isOldOpen = exports.printDispatch = exports.DoNameList = undefined;
|
|
7
7
|
|
|
8
8
|
var _regenerator = require('babel-runtime/regenerator');
|
|
9
9
|
|
|
@@ -21,6 +21,8 @@ var _mutantsUtil = require('mutants-util');
|
|
|
21
21
|
|
|
22
22
|
var _mutantsMicrofx = require('mutants-microfx');
|
|
23
23
|
|
|
24
|
+
var _tplusPoslogin = require('tplus-poslogin');
|
|
25
|
+
|
|
24
26
|
var _index = require('./index');
|
|
25
27
|
|
|
26
28
|
var _index2 = _interopRequireDefault(_index);
|
|
@@ -29,21 +31,27 @@ var _message = require('../message');
|
|
|
29
31
|
|
|
30
32
|
var _message2 = _interopRequireDefault(_message);
|
|
31
33
|
|
|
34
|
+
var _api = require('./api');
|
|
35
|
+
|
|
36
|
+
var _api2 = _interopRequireDefault(_api);
|
|
37
|
+
|
|
32
38
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
33
39
|
|
|
34
|
-
var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail');
|
|
40
|
+
var t = _mutantsMicrofx.i18n.getFixedT(null, 'newretail'); /*
|
|
41
|
+
* @Descripttion:
|
|
42
|
+
* @version:
|
|
43
|
+
* @Author: chenlongad
|
|
44
|
+
* @Date: 2020-11-17 10:02:02
|
|
45
|
+
* @LastEditors: chenlongad
|
|
46
|
+
* @LastEditTime: 2021-11-15 10:57:22
|
|
47
|
+
*/
|
|
48
|
+
|
|
35
49
|
|
|
36
50
|
// 打印调用方法对照
|
|
37
|
-
/*
|
|
38
|
-
* @Descripttion:
|
|
39
|
-
* @version:
|
|
40
|
-
* @Author: chenlongad
|
|
41
|
-
* @Date: 2020-11-17 10:02:02
|
|
42
|
-
* @LastEditors: chenlongad
|
|
43
|
-
* @LastEditTime: 2021-02-21 10:18:28
|
|
44
|
-
*/
|
|
45
51
|
var DoNameList = exports.DoNameList = {
|
|
46
52
|
DO_PRINT: "doPrint",
|
|
53
|
+
DO_ONLY_PRINT: "doOnlyRetail",
|
|
54
|
+
DO_MT_RETAIL: "doMtRetail",
|
|
47
55
|
DO_DUTY_PRINT: "doDutyPrint",
|
|
48
56
|
DO_DIALY_PRINT: "doDialyPrint",
|
|
49
57
|
DO_STORAGE_PRINT: "doStoragePrint",
|
|
@@ -52,162 +60,151 @@ var DoNameList = exports.DoNameList = {
|
|
|
52
60
|
|
|
53
61
|
// 打印调用方法名字对照
|
|
54
62
|
};var DoDesName = {
|
|
55
|
-
doPrint: "",
|
|
63
|
+
doPrint: "小票",
|
|
64
|
+
doMtRetail: "美团",
|
|
65
|
+
doOnlyRetail: "小票",
|
|
56
66
|
doDutyPrint: "交班",
|
|
57
67
|
doDialyPrint: "日结",
|
|
58
68
|
doStoragePrint: "储值",
|
|
59
|
-
doProjectStoragePrint: "
|
|
69
|
+
doProjectStoragePrint: "项目储值",
|
|
60
70
|
doProjectConsumePrint: "扣次"
|
|
61
71
|
|
|
62
72
|
// window打印调用方法对照
|
|
63
73
|
};var DoPrintGlobalFunction = {
|
|
64
|
-
doPrint: "",
|
|
65
|
-
|
|
66
|
-
|
|
74
|
+
doPrint: "RetailPrintProcessBlock",
|
|
75
|
+
doOnlyRetail: "OnlyRetailPrintProcess",
|
|
76
|
+
doMtRetail: "MeiTuanPrintProcessBlock",
|
|
77
|
+
doDutyPrint: "printShiftVoucher",
|
|
78
|
+
doDialyPrint: "printDailyVoucher",
|
|
67
79
|
doStoragePrint: "StoragePrintProcessBlock",
|
|
68
80
|
doProjectStoragePrint: "ProjectStoragePrintProcessBlock",
|
|
69
81
|
doProjectConsumePrint: "ProjectConsumePrintProcessBlock"
|
|
82
|
+
};
|
|
70
83
|
|
|
71
|
-
|
|
72
|
-
};var printDispatch = exports.printDispatch = function printDispatch(doName, ID, otherParams) {
|
|
84
|
+
var printDispatch = exports.printDispatch = function printDispatch(doName, ID, otherParams) {
|
|
73
85
|
return new _promise2.default(function () {
|
|
74
|
-
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(res
|
|
75
|
-
var
|
|
86
|
+
var _ref = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee(res) {
|
|
87
|
+
var _getLoginInfo, Idstore, POSCode, printEntity, isOpenPrint, checkedPrintType, cloudPrintArguments, _ref2, electronPrint, openCashBox, dto, _dto, _ref3, isHorizontalSunMi, result;
|
|
76
88
|
|
|
77
89
|
return _regenerator2.default.wrap(function _callee$(_context) {
|
|
78
90
|
while (1) {
|
|
79
91
|
switch (_context.prev = _context.next) {
|
|
80
92
|
case 0:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
93
|
+
_getLoginInfo = getLoginInfo(), Idstore = _getLoginInfo.IdStore, POSCode = _getLoginInfo.posCode;
|
|
94
|
+
_context.next = 3;
|
|
95
|
+
return _api2.default.GetPrintInfomation({
|
|
96
|
+
Idstore: Idstore,
|
|
97
|
+
POSCode: POSCode
|
|
98
|
+
});
|
|
85
99
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
_ref3 = cloudPrintArguments || {}, Open = _ref3.Open, Key = _ref3.Key, Sign = _ref3.Sign, Name = _ref3.Name, Card = _ref3.Card;
|
|
100
|
+
case 3:
|
|
101
|
+
printEntity = _context.sent;
|
|
89
102
|
|
|
90
|
-
if (!(
|
|
91
|
-
_context.next =
|
|
103
|
+
if (!(!printEntity.AutoPrintTicket && doName == DoNameList.DO_PRINT)) {
|
|
104
|
+
_context.next = 6;
|
|
92
105
|
break;
|
|
93
106
|
}
|
|
94
107
|
|
|
95
|
-
|
|
96
|
-
_context.next = 13;
|
|
97
|
-
break;
|
|
98
|
-
}
|
|
108
|
+
return _context.abrupt('return', res());
|
|
99
109
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
110
|
+
case 6:
|
|
111
|
+
// 是否开启打印机
|
|
112
|
+
isOpenPrint = isOldOpen(printEntity.PrintDetailEntitys);
|
|
104
113
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
case 10:
|
|
110
|
-
printUtil[doName]({ Open: Open, Key: Key, Sign: Sign, Name: Name, Card: Card }, ID, function (s) {
|
|
111
|
-
var msg = s.msg,
|
|
112
|
-
ret = s.ret;
|
|
113
|
-
|
|
114
|
-
if (ret === 0) {
|
|
115
|
-
_message2.default.success(t('\u6253\u5370' + DoDesName[doName] + '\u5C0F\u7968\u6210\u529F\u3002'));
|
|
116
|
-
} else if (ret === -1) {
|
|
117
|
-
_message2.default.error(t(msg));
|
|
118
|
-
} else {
|
|
119
|
-
_message2.default.error(t('\u6253\u5370' + DoDesName[doName] + '\u5C0F\u7968\u5931\u8D25\u3002'));
|
|
120
|
-
}
|
|
121
|
-
res();
|
|
122
|
-
});
|
|
123
|
-
_context.next = 15;
|
|
124
|
-
break;
|
|
114
|
+
// 获取打印机开启的类型
|
|
115
|
+
|
|
116
|
+
checkedPrintType = getCheckedPrintTypeDefaults();
|
|
125
117
|
|
|
126
|
-
case 13:
|
|
127
|
-
_message2.default.warn(t('云打印未启用,请设置。'));
|
|
128
|
-
res();
|
|
129
118
|
|
|
130
|
-
|
|
131
|
-
|
|
119
|
+
if (!isOpenPrint) checkedPrintType = null;
|
|
120
|
+
|
|
121
|
+
// 获取云打印参数
|
|
122
|
+
cloudPrintArguments = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
|
|
123
|
+
_ref2 = otherParams || {}, electronPrint = _ref2.electronPrint, openCashBox = _ref2.openCashBox, dto = _ref2.dto;
|
|
124
|
+
|
|
125
|
+
if (!dto) {
|
|
126
|
+
_dto = {};
|
|
127
|
+
|
|
128
|
+
_dto.Idstore = (0, _tplusPoslogin.PosInitData)('storeID');
|
|
129
|
+
_dto.POSCode = (0, _tplusPoslogin.PosInitData)('posCode');
|
|
130
|
+
}
|
|
132
131
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
132
|
+
_ref3 = _mutantsUtil.platform || {}, isHorizontalSunMi = _ref3.isHorizontalSunMi;
|
|
133
|
+
|
|
134
|
+
if (!(isOpenPrint && checkedPrintType === "3" || !checkedPrintType && !!isHorizontalSunMi)) {
|
|
135
|
+
_context.next = 21;
|
|
136
136
|
break;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
}
|
|
150
|
-
res();
|
|
151
|
-
});
|
|
152
|
-
return _context.abrupt('return');
|
|
139
|
+
// 1.如果未开启打印并且是商米平台 使用自带的打印机 2如果开启打印并且使用飞蛾打印机
|
|
140
|
+
if (!!isHorizontalSunMi && openCashBox) {
|
|
141
|
+
// 开启商米的钱箱
|
|
142
|
+
syncOpenCashBox(printEntity);
|
|
143
|
+
}
|
|
144
|
+
_context.next = 17;
|
|
145
|
+
return cloudPrintNoTemplate(doName, ID, cloudPrintArguments || {});
|
|
146
|
+
|
|
147
|
+
case 17:
|
|
148
|
+
result = _context.sent;
|
|
153
149
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
150
|
+
res(result);
|
|
151
|
+
_context.next = 43;
|
|
152
|
+
break;
|
|
153
|
+
|
|
154
|
+
case 21:
|
|
155
|
+
if (!(isOpenPrint && (checkedPrintType === "2" || checkedPrintType === "1"))) {
|
|
156
|
+
_context.next = 42;
|
|
157
157
|
break;
|
|
158
158
|
}
|
|
159
159
|
|
|
160
|
-
if (!(_mutantsMicrofx.env.platform !== _mutantsMicrofx.env.constant.platform.electron)) {
|
|
161
|
-
_context.next =
|
|
160
|
+
if (!(_mutantsMicrofx.env.platform !== _mutantsMicrofx.env.constant.platform.electron && checkedPrintType === "1")) {
|
|
161
|
+
_context.next = 25;
|
|
162
162
|
break;
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
//获取当前是否处于Electron环境中
|
|
166
166
|
_message2.default.warn(t('打印小票只能在客户端中执行'));
|
|
167
|
-
res();
|
|
168
|
-
return _context.abrupt('return');
|
|
167
|
+
return _context.abrupt('return', res());
|
|
169
168
|
|
|
170
|
-
case
|
|
169
|
+
case 25:
|
|
171
170
|
_context.t0 = doName;
|
|
172
|
-
_context.next = _context.t0 === DoNameList.DO_PRINT ?
|
|
171
|
+
_context.next = _context.t0 === DoNameList.DO_PRINT ? 28 : _context.t0 === DoNameList.DO_MT_RETAIL ? 28 : _context.t0 === DoNameList.DO_ONLY_PRINT ? 28 : _context.t0 === DoNameList.DO_DUTY_PRINT ? 28 : _context.t0 === DoNameList.DO_DIALY_PRINT ? 28 : _context.t0 === DoNameList.DO_STORAGE_PRINT ? 28 : _context.t0 === DoNameList.DO_PROJECT_STORAGE_PRINT ? 28 : _context.t0 === DoNameList.DO_PROJECT_CONSUME_PRINT ? 28 : 36;
|
|
173
172
|
break;
|
|
174
173
|
|
|
175
|
-
case
|
|
176
|
-
return _context.abrupt('break', 42);
|
|
177
|
-
|
|
178
|
-
case 32:
|
|
174
|
+
case 28:
|
|
179
175
|
if (!global[DoPrintGlobalFunction[doName]]) {
|
|
180
|
-
_context.next =
|
|
176
|
+
_context.next = 34;
|
|
181
177
|
break;
|
|
182
178
|
}
|
|
183
179
|
|
|
184
|
-
_context.next =
|
|
185
|
-
return global[DoPrintGlobalFunction[doName]].execute(ID);
|
|
180
|
+
_context.next = 31;
|
|
181
|
+
return global[DoPrintGlobalFunction[doName]].execute(ID, dto, openCashBox);
|
|
186
182
|
|
|
187
|
-
case
|
|
188
|
-
res();
|
|
189
|
-
return _context.abrupt('break', 42);
|
|
183
|
+
case 31:
|
|
184
|
+
return _context.abrupt('return', res());
|
|
190
185
|
|
|
191
|
-
case
|
|
186
|
+
case 34:
|
|
192
187
|
_message2.default.warn(t('打印小票只能在客户端中执行'));
|
|
193
|
-
res();
|
|
194
|
-
return _context.abrupt('break', 42);
|
|
195
|
-
|
|
196
|
-
case 42:
|
|
197
|
-
_ref4 = otherParams || {}, electronPrint = _ref4.electronPrint;
|
|
188
|
+
return _context.abrupt('return', res());
|
|
198
189
|
|
|
190
|
+
case 36:
|
|
199
191
|
if (!electronPrint) {
|
|
200
|
-
_context.next =
|
|
192
|
+
_context.next = 39;
|
|
201
193
|
break;
|
|
202
194
|
}
|
|
203
195
|
|
|
204
|
-
_context.next =
|
|
196
|
+
_context.next = 39;
|
|
205
197
|
return electronPrint();
|
|
206
198
|
|
|
207
|
-
case
|
|
199
|
+
case 39:
|
|
200
|
+
res();
|
|
201
|
+
_context.next = 43;
|
|
202
|
+
break;
|
|
203
|
+
|
|
204
|
+
case 42:
|
|
208
205
|
res();
|
|
209
206
|
|
|
210
|
-
case
|
|
207
|
+
case 43:
|
|
211
208
|
case 'end':
|
|
212
209
|
return _context.stop();
|
|
213
210
|
}
|
|
@@ -215,9 +212,113 @@ var DoNameList = exports.DoNameList = {
|
|
|
215
212
|
}, _callee, undefined);
|
|
216
213
|
}));
|
|
217
214
|
|
|
218
|
-
return function (_x
|
|
215
|
+
return function (_x) {
|
|
219
216
|
return _ref.apply(this, arguments);
|
|
220
217
|
};
|
|
221
218
|
}());
|
|
222
219
|
};
|
|
220
|
+
|
|
221
|
+
var cloudPrintNoTemplate = function cloudPrintNoTemplate(doName, ID, _ref4) {
|
|
222
|
+
var Open = _ref4.Open,
|
|
223
|
+
Key = _ref4.Key,
|
|
224
|
+
Sign = _ref4.Sign,
|
|
225
|
+
Name = _ref4.Name,
|
|
226
|
+
Card = _ref4.Card;
|
|
227
|
+
|
|
228
|
+
return new _promise2.default(function (resolve) {
|
|
229
|
+
var printUtil = new _index2.default();
|
|
230
|
+
printUtil[doName]({ Open: Open, Key: Key, Sign: Sign, Name: Name, Card: Card }, ID, function (s) {
|
|
231
|
+
var msg = s.msg,
|
|
232
|
+
ret = s.ret;
|
|
233
|
+
|
|
234
|
+
if (ret === 0) {
|
|
235
|
+
_message2.default.success(t('\u6253\u5370' + DoDesName[doName] + '\u5C0F\u7968\u6210\u529F\u3002'));
|
|
236
|
+
} else if (ret === -1) {
|
|
237
|
+
_message2.default.error(t(msg));
|
|
238
|
+
} else {
|
|
239
|
+
_message2.default.error(t('\u6253\u5370' + DoDesName[doName] + '\u5C0F\u7968\u5931\u8D25\u3002'));
|
|
240
|
+
}
|
|
241
|
+
resolve();
|
|
242
|
+
});
|
|
243
|
+
});
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
var syncOpenCashBox = function () {
|
|
247
|
+
var _ref5 = (0, _asyncToGenerator3.default)( /*#__PURE__*/_regenerator2.default.mark(function _callee2(printEntity) {
|
|
248
|
+
var _ref6, CashBoxCmd;
|
|
249
|
+
|
|
250
|
+
return _regenerator2.default.wrap(function _callee2$(_context2) {
|
|
251
|
+
while (1) {
|
|
252
|
+
switch (_context2.prev = _context2.next) {
|
|
253
|
+
case 0:
|
|
254
|
+
_ref6 = printEntity || {}, CashBoxCmd = _ref6.CashBoxCmd;
|
|
255
|
+
return _context2.abrupt('return', window.sunMi_OperatingCashier && window.sunMi_OperatingCashier.OpenDrawer(CashBoxCmd));
|
|
256
|
+
|
|
257
|
+
case 2:
|
|
258
|
+
case 'end':
|
|
259
|
+
return _context2.stop();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}, _callee2, undefined);
|
|
263
|
+
}));
|
|
264
|
+
|
|
265
|
+
return function syncOpenCashBox(_x2) {
|
|
266
|
+
return _ref5.apply(this, arguments);
|
|
267
|
+
};
|
|
268
|
+
}();
|
|
269
|
+
|
|
270
|
+
var getLoginInfo = function getLoginInfo() {
|
|
271
|
+
var _ref7 = _mutantsMicrofx.localStore.get('user') || {},
|
|
272
|
+
_ref7$loginInfo = _ref7.loginInfo,
|
|
273
|
+
loginInfo = _ref7$loginInfo === undefined ? {} : _ref7$loginInfo;
|
|
274
|
+
|
|
275
|
+
return loginInfo;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
var isOldOpen = exports.isOldOpen = function isOldOpen(printDetailEntitys) {
|
|
279
|
+
var _ref8 = _mutantsUtil.platform || {},
|
|
280
|
+
isVerticalTouch = _ref8.isVerticalTouch;
|
|
281
|
+
|
|
282
|
+
if (isVerticalTouch) return true;
|
|
283
|
+
var isOpenPrintValue = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('isOpenPrint');
|
|
284
|
+
if (isOpenPrintValue !== null) {
|
|
285
|
+
return isOpenPrintValue === "true";
|
|
286
|
+
}
|
|
287
|
+
var localOrYinMeiOpen = printDetailEntitys && printDetailEntitys.filter(function (item) {
|
|
288
|
+
return item.IsEnablePrinter === true;
|
|
289
|
+
}).length > 0;
|
|
290
|
+
var cloudPrintArguments = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
|
|
291
|
+
|
|
292
|
+
var _ref9 = cloudPrintArguments || {},
|
|
293
|
+
cloudOpen = _ref9.Open;
|
|
294
|
+
|
|
295
|
+
return localOrYinMeiOpen || cloudOpen;
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
var getCheckedPrintTypeDefaults = exports.getCheckedPrintTypeDefaults = function getCheckedPrintTypeDefaults() {
|
|
299
|
+
var hasElectron = _mutantsMicrofx.env.platform === _mutantsMicrofx.env.constant.platform.electron;
|
|
300
|
+
|
|
301
|
+
var _ref10 = _mutantsUtil.platform || {},
|
|
302
|
+
isVerticalTouch = _ref10.isVerticalTouch;
|
|
303
|
+
// 打印机选择的类型
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
var checkedPrintType = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('checkedPrintType');
|
|
307
|
+
var cloudPrintArguments = _mutantsMicrofx.localStore && _mutantsMicrofx.localStore.get('cloudPrintArguments');
|
|
308
|
+
if (checkedPrintType === null) {
|
|
309
|
+
if (hasElectron || !!isVerticalTouch) {
|
|
310
|
+
checkedPrintType = '1';
|
|
311
|
+
} else {
|
|
312
|
+
var _ref11 = cloudPrintArguments || {},
|
|
313
|
+
Open = _ref11.Open;
|
|
314
|
+
|
|
315
|
+
if (Open) {
|
|
316
|
+
checkedPrintType = '3';
|
|
317
|
+
} else {
|
|
318
|
+
checkedPrintType = '2';
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
return checkedPrintType;
|
|
323
|
+
};
|
|
223
324
|
//# sourceMappingURL=printDispatch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["tplus-components-touch/components/cloudPrint/printDispatch.js"],"names":["t","i18n","getFixedT","DoNameList","DO_PRINT","DO_DUTY_PRINT","DO_DIALY_PRINT","DO_STORAGE_PRINT","DO_PROJECT_STORAGE_PRINT","DO_PROJECT_CONSUME_PRINT","DoDesName","doPrint","doDutyPrint","doDialyPrint","doStoragePrint","doProjectStoragePrint","doProjectConsumePrint","DoPrintGlobalFunction","printDispatch","doName","ID","otherParams","res","rej","cloudPrintArguments","localStore","get","platform","isHorizontalPad","isHorizontalSunMi","printUtil","PrintUtil","Open","Key","Sign","Name","Card","Message","warn","msg","s","ret","success","error","env","constant","electron","global","execute","electronPrint"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA;;AACA;;AACA;;;;AACA;;;;;;AAEA,IAAMA,IAAIC,qBAAKC,SAAL,CAAe,IAAf,EAAqB,WAArB,CAAV;;AAEA;AAfA;;;;;;;;AAgBO,IAAMC,kCAAa;AACtBC,cAAS,SADa;AAEtBC,mBAAc,aAFQ;AAGtBC,oBAAe,cAHO;AAItBC,sBAAiB,gBAJK;AAKtBC,8BAAyB,uBALH;AAMtBC,8BAAyB;;AAG7B;AAT0B,CAAnB,CAUP,IAAMC,YAAY;AACdC,aAAQ,EADM;AAEdC,iBAAY,IAFE;AAGdC,kBAAa,IAHC;AAIdC,oBAAe,IAJD;AAKdC,2BAAsB,IALR;AAMdC,2BAAsB;;AAG1B;AATkB,CAAlB,CAUA,IAAMC,wBAAwB;AA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WK,wBAxDZ,wBAyDCL,WAAWM,wBAzDZ;AAAA;;AAAA;AAAA;;AAAA;AAAA,iCA0DIsC,OAAO9B,sBAAsBE,MAAtB,CAAP,CA1DJ;AAAA;AAAA;AAAA;;AAAA;AAAA,mCA2DU4B,OAAO9B,sBAAsBE,MAAtB,CAAP,EAAsC6B,OAAtC,CAA8C5B,EAA9C,CA3DV;;AAAA;AA4DIE;AA5DJ;;AAAA;AA+DIe,8CAAQC,IAAR,CAAatC,EAAE,eAAF,CAAb;AACAsB;AAhEJ;;AAAA;AAAA,oCAqEgBD,eAAe,EArE/B,EAqED4B,aArEC,SAqEDA,aArEC;;AAAA,iCAsELA,aAtEK;AAAA;AAAA;AAAA;;AAAA;AAAA,mCAsEgBA,eAtEhB;;AAAA;AAuER3B;;AAvEQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,SAAb;;AAAA;AAAA;AAAA;AAAA,QAAP;AA2EH,CA5EM","file":"printDispatch.js","sourcesContent":["/*\r\n * @Descripttion: \r\n * @version: \r\n * @Author: chenlongad\r\n * @Date: 2020-11-17 10:02:02\r\n * @LastEditors: chenlongad\r\n * @LastEditTime: 2021-02-21 10:18:28\r\n */\r\nimport { platform } from 'mutants-util';\r\nimport {localStore,env} from 'mutants-microfx';\r\nimport PrintUtil from './index'\r\nimport Message from '../message';\r\nimport {i18n} from 'mutants-microfx';\r\nconst t = i18n.getFixedT(null, 'newretail');\r\n\r\n// 打印调用方法对照\r\nexport const DoNameList = {\r\n DO_PRINT:\"doPrint\",\r\n DO_DUTY_PRINT:\"doDutyPrint\",\r\n DO_DIALY_PRINT:\"doDialyPrint\",\r\n DO_STORAGE_PRINT:\"doStoragePrint\",\r\n DO_PROJECT_STORAGE_PRINT:\"doProjectStoragePrint\",\r\n DO_PROJECT_CONSUME_PRINT:\"doProjectConsumePrint\"\r\n}\r\n\r\n// 打印调用方法名字对照\r\nconst DoDesName = {\r\n doPrint:\"\",\r\n doDutyPrint:\"交班\",\r\n doDialyPrint:\"日结\",\r\n doStoragePrint:\"储值\",\r\n doProjectStoragePrint:\"储值\",\r\n doProjectConsumePrint:\"扣次\"\r\n}\r\n\r\n// window打印调用方法对照\r\nconst DoPrintGlobalFunction = {\r\n doPrint:\"\",\r\n doDutyPrint:\"交班\",\r\n doDialyPrint:\"日结\",\r\n doStoragePrint:\"StoragePrintProcessBlock\",\r\n doProjectStoragePrint:\"ProjectStoragePrintProcessBlock\",\r\n doProjectConsumePrint:\"ProjectConsumePrintProcessBlock\"\r\n}\r\n\r\n\r\n// TODO: 日结交班还没有处理 等下个版本处理 \r\nexport const printDispatch = (doName,ID,otherParams) => {\r\n return new Promise( async (res,rej)=>{\r\n // 获取云打印参数\r\n const cloudPrintArguments = localStore && localStore.get('cloudPrintArguments');\r\n \r\n // \r\n const { isHorizontalPad ,isHorizontalSunMi } = platform || {};\r\n const printUtil = new PrintUtil();\r\n\r\n const { Open, Key, Sign, Name, Card } = cloudPrintArguments || {};\r\n if (isHorizontalPad === true) { // pad打印\r\n //执行移动端云打印\r\n if (cloudPrintArguments) {\r\n if (!Open) {\r\n Message.warn(t('云打印未启用,请设置。'))\r\n res();\r\n return;\r\n }\r\n printUtil[doName]({Open, Key, Sign, Name, Card }, ID, s => {\r\n const { msg, ret } = s;\r\n if (ret === 0) {\r\n Message.success(t(`打印${DoDesName[doName]}小票成功。`))\r\n }else if(ret === -1){\r\n Message.error(t(msg))\r\n } else {\r\n Message.error(t(`打印${DoDesName[doName]}小票失败。`))\r\n }\r\n res();\r\n })\r\n } else {\r\n Message.warn(t('云打印未启用,请设置。'))\r\n res();\r\n }\r\n return;\r\n } else if (isHorizontalSunMi === true) {\r\n printUtil[doName]({Open , Key, Sign, Name, Card }, ID, s => {\r\n const { msg, ret } = s;\r\n if (ret === 0) {\r\n Message.success(t(`打印${DoDesName[doName]}小票成功。`))\r\n } else if (ret === -1) {\r\n Message.error(t(msg))\r\n } else {\r\n Message.error(t(`打印${DoDesName[doName]}小票失败。`))\r\n }\r\n res();\r\n })\r\n return;\r\n }else{\r\n if(env){\r\n if (env.platform !== env.constant.platform.electron) {//获取当前是否处于Electron环境中\r\n Message.warn(t('打印小票只能在客户端中执行'))\r\n res();\r\n return;\r\n }\r\n switch(doName){\r\n case DoNameList.DO_PRINT: break;\r\n case DoNameList.DO_STORAGE_PRINT: \r\n case DoNameList.DO_PROJECT_STORAGE_PRINT:\r\n case DoNameList.DO_PROJECT_CONSUME_PRINT:{\r\n if (global[DoPrintGlobalFunction[doName]]) {\r\n await global[DoPrintGlobalFunction[doName]].execute(ID);\r\n res();\r\n break;\r\n } else{\r\n Message.warn(t('打印小票只能在客户端中执行'))\r\n res();\r\n break;\r\n }\r\n }\r\n } \r\n const {electronPrint} = otherParams || {}\r\n if(electronPrint) await electronPrint()\r\n res();\r\n }\r\n }\r\n })\r\n}"]}
|
|
1
|
+
{"version":3,"sources":["tplus-components-touch/components/cloudPrint/printDispatch.js"],"names":["t","i18n","getFixedT","DoNameList","DO_PRINT","DO_ONLY_PRINT","DO_MT_RETAIL","DO_DUTY_PRINT","DO_DIALY_PRINT","DO_STORAGE_PRINT","DO_PROJECT_STORAGE_PRINT","DO_PROJECT_CONSUME_PRINT","DoDesName","doPrint","doMtRetail","doOnlyRetail","doDutyPrint","doDialyPrint","doStoragePrint","doProjectStoragePrint","doProjectConsumePrint","DoPrintGlobalFunction","printDispatch","doName","ID","otherParams","res","getLoginInfo","Idstore","IdStore","POSCode","posCode","API","GetPrintInfomation","printEntity","AutoPrintTicket","isOpenPrint","isOldOpen","PrintDetailEntitys","checkedPrintType","getCheckedPrintTypeDefaults","cloudPrintArguments","localStore","get","electronPrint","openCashBox","dto","platform","isHorizontalSunMi","syncOpenCashBox","cloudPrintNoTemplate","result","env","constant","electron","Message","warn","global","execute","Open","Key","Sign","Name","Card","resolve","printUtil","PrintUtil","msg","s","ret","success","error","CashBoxCmd","window","sunMi_OperatingCashier","OpenDrawer","loginInfo","printDetailEntitys","isVerticalTouch","isOpenPrintValue","localOrYinM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,CAAe,aAAf,CAAvC;AACA,QAAGoC,qBAAoB,IAAvB,EAA4B;AACxB,eAAOA,qBAAqB,MAA5B;AACH;AACD,QAAMC,oBAAoBH,sBAAsBA,mBAAmBI,MAAnB,CAA0B,UAACC,IAAD,EAAQ;AAC9E,eAAOA,KAAKC,eAAL,KAAyB,IAAhC;AACH,KAF+C,EAE7CC,MAF6C,GAEpC,CAFZ;AAGA,QAAM3C,sBAAsBC,8BAAcA,2BAAWC,GAAX,CAAe,qBAAf,CAA1C;;AAV6C,gBAWlBF,uBAAuB,EAXL;AAAA,QAWhC4C,SAXgC,SAWrC1B,IAXqC;;AAY7C,WAAOqB,qBAAqBK,SAA5B;AACH,CAbM;;AAeA,IAAM7C,oEAA8B,SAA9BA,2BAA8B,GAAM;AAC7C,QAAM8C,cAAelC,oBAAIL,QAAJ,KAAiBK,oBAAIC,QAAJ,CAAaN,QAAb,CAAsBO,QAA5D;;AAD6C,iBAEjBP,yBAAY,EAFK;AAAA,QAErC+B,eAFqC,UAErCA,eAFqC;AAG7C;;;AACA,QAAIvC,mBAAoBG,8BAAcA,2BAAWC,GAAX,CAAe,kBAAf,CAAtC;AACA,QAAMF,sBAAsBC,8BAAcA,2BAAWC,GAAX,CAAe,qBAAf,CAA1C;AACA,QAAGJ,qBAAqB,IAAxB,EAA8B;AAC1B,YAAG+C,eAAe,CAAC,CAACR,eAApB,EAAoC;AAChCvC,+BAAmB,GAAnB;AACH,SAFD,MAEM;AAAA,yBACeE,uBAAuB,EADtC;AAAA,gBACMkB,IADN,UACMA,IADN;;AAEF,gBAAGA,IAAH,EAAQ;AACJpB,mCAAmB,GAAnB;AACH,aAFD,MAEK;AACDA,mCAAmB,GAAnB;AACH;AACJ;AACJ;AACD,WAAOA,gBAAP;AACH,CAnBM","file":"printDispatch.js","sourcesContent":["/*\r\n * @Descripttion: \r\n * @version: \r\n * @Author: chenlongad\r\n * @Date: 2020-11-17 10:02:02\r\n * @LastEditors: chenlongad\r\n * @LastEditTime: 2021-11-15 10:57:22\r\n */\r\nimport { platform } from 'mutants-util';\r\nimport {localStore,env,i18n} from 'mutants-microfx';\r\nimport { PosInitData } from 'tplus-poslogin';\r\nimport PrintUtil from './index'\r\nimport Message from '../message';\r\nconst t = i18n.getFixedT(null, 'newretail');\r\nimport API from './api';\r\n\r\n// 打印调用方法对照\r\nexport const DoNameList = {\r\n DO_PRINT:\"doPrint\",\r\n DO_ONLY_PRINT:\"doOnlyRetail\",\r\n DO_MT_RETAIL:\"doMtRetail\",\r\n DO_DUTY_PRINT:\"doDutyPrint\",\r\n DO_DIALY_PRINT:\"doDialyPrint\",\r\n DO_STORAGE_PRINT:\"doStoragePrint\",\r\n DO_PROJECT_STORAGE_PRINT:\"doProjectStoragePrint\",\r\n DO_PROJECT_CONSUME_PRINT:\"doProjectConsumePrint\"\r\n}\r\n\r\n// 打印调用方法名字对照\r\nconst DoDesName = {\r\n doPrint:\"小票\",\r\n doMtRetail:\"美团\",\r\n doOnlyRetail:\"小票\",\r\n doDutyPrint:\"交班\",\r\n doDialyPrint:\"日结\",\r\n doStoragePrint:\"储值\",\r\n doProjectStoragePrint:\"项目储值\",\r\n doProjectConsumePrint:\"扣次\"\r\n}\r\n\r\n// window打印调用方法对照\r\nconst DoPrintGlobalFunction = {\r\n doPrint:\"RetailPrintProcessBlock\",\r\n doOnlyRetail:\"OnlyRetailPrintProcess\",\r\n doMtRetail:\"MeiTuanPrintProcessBlock\",\r\n doDutyPrint:\"printShiftVoucher\",\r\n doDialyPrint:\"printDailyVoucher\",\r\n doStoragePrint:\"StoragePrintProcessBlock\",\r\n doProjectStoragePrint:\"ProjectStoragePrintProcessBlock\",\r\n doProjectConsumePrint:\"ProjectConsumePrintProcessBlock\"\r\n}\r\n\r\n\r\nexport const printDispatch = (doName,ID,otherParams) => {\r\n return new Promise(async (res) => {\r\n\r\n const { IdStore:Idstore,posCode:POSCode} = getLoginInfo();\r\n const printEntity = await API.GetPrintInfomation({\r\n Idstore,\r\n POSCode\r\n });\r\n // 开启结算完自动打印小票的选项 只判断是结算小票打印 其他的打印方式继续打印\r\n if (!printEntity.AutoPrintTicket && doName == DoNameList.DO_PRINT) {\r\n return res();\r\n }\r\n // 是否开启打印机\r\n const isOpenPrint = isOldOpen(printEntity.PrintDetailEntitys);\r\n\r\n // 获取打印机开启的类型\r\n let checkedPrintType = getCheckedPrintTypeDefaults()\r\n\r\n if(!isOpenPrint) checkedPrintType = null;\r\n\r\n // 获取云打印参数\r\n const cloudPrintArguments = localStore && localStore.get('cloudPrintArguments');\r\n\r\n const { electronPrint,openCashBox,dto} = otherParams || {};\r\n if(!dto){\r\n let dto={};\r\n dto.Idstore = PosInitData('storeID');\r\n dto.POSCode = PosInitData('posCode');\r\n }\r\n\r\n const { isHorizontalSunMi } = platform || {};\r\n if (isOpenPrint && checkedPrintType === \"3\" || !checkedPrintType && !!isHorizontalSunMi) {\r\n // 1.如果未开启打印并且是商米平台 使用自带的打印机 2如果开启打印并且使用飞蛾打印机\r\n if(!!isHorizontalSunMi && openCashBox){\r\n // 开启商米的钱箱\r\n syncOpenCashBox(printEntity) \r\n }\r\n let result = await cloudPrintNoTemplate(doName, ID, cloudPrintArguments || {});\r\n res(result);\r\n } else if (isOpenPrint && (checkedPrintType === \"2\" || checkedPrintType === \"1\")) {\r\n if (env.platform !== env.constant.platform.electron && checkedPrintType === \"1\") {//获取当前是否处于Electron环境中\r\n Message.warn(t('打印小票只能在客户端中执行'))\r\n return res();\r\n }\r\n switch (doName) {\r\n case DoNameList.DO_PRINT:\r\n case DoNameList.DO_MT_RETAIL:\r\n case DoNameList.DO_ONLY_PRINT:\r\n case DoNameList.DO_DUTY_PRINT:\r\n case DoNameList.DO_DIALY_PRINT:\r\n case DoNameList.DO_STORAGE_PRINT:\r\n case DoNameList.DO_PROJECT_STORAGE_PRINT:\r\n case DoNameList.DO_PROJECT_CONSUME_PRINT: {\r\n if (global[DoPrintGlobalFunction[doName]]) {\r\n await global[DoPrintGlobalFunction[doName]].execute(ID,dto, openCashBox);\r\n return res();\r\n } else {\r\n Message.warn(t('打印小票只能在客户端中执行'))\r\n return res();\r\n }\r\n }\r\n }\r\n \r\n if (electronPrint) await electronPrint()\r\n res();\r\n }else {\r\n res();\r\n }\r\n })\r\n}\r\n\r\nconst cloudPrintNoTemplate = (doName,ID,{Open, Key, Sign, Name, Card }) => {\r\n return new Promise((resolve) => {\r\n const printUtil = new PrintUtil();\r\n printUtil[doName]({Open, Key, Sign, Name, Card }, ID, s => {\r\n const { msg, ret } = s;\r\n if (ret === 0) {\r\n Message.success(t(`打印${DoDesName[doName]}小票成功。`))\r\n }else if(ret === -1){\r\n Message.error(t(msg))\r\n } else {\r\n Message.error(t(`打印${DoDesName[doName]}小票失败。`))\r\n }\r\n resolve();\r\n })\r\n })\r\n}\r\n\r\nconst syncOpenCashBox = async(printEntity) =>{\r\n const { CashBoxCmd } = printEntity || {}\r\n return window.sunMi_OperatingCashier && window.sunMi_OperatingCashier.OpenDrawer(CashBoxCmd);\r\n}\r\n\r\nconst getLoginInfo = () => {\r\n const { loginInfo = {} } = localStore.get('user') || {};\r\n return loginInfo;\r\n}\r\n\r\nexport const isOldOpen = (printDetailEntitys) => {\r\n const { isVerticalTouch } = platform || {}\r\n if(isVerticalTouch) return true;\r\n const isOpenPrintValue = localStore && localStore.get('isOpenPrint');\r\n if(isOpenPrintValue !==null){\r\n return isOpenPrintValue === \"true\";\r\n }\r\n const localOrYinMeiOpen = printDetailEntitys && printDetailEntitys.filter((item)=>{\r\n return item.IsEnablePrinter === true\r\n }).length > 0;\r\n const cloudPrintArguments = localStore && localStore.get('cloudPrintArguments');\r\n const { Open:cloudOpen } = cloudPrintArguments || {};\r\n return localOrYinMeiOpen || cloudOpen;\r\n}\r\n\r\nexport const getCheckedPrintTypeDefaults = () => {\r\n const hasElectron = (env.platform === env.constant.platform.electron);\r\n const { isVerticalTouch } = platform || {}\r\n // 打印机选择的类型\r\n let checkedPrintType = localStore && localStore.get('checkedPrintType');\r\n const cloudPrintArguments = localStore && localStore.get('cloudPrintArguments');\r\n if(checkedPrintType === null) {\r\n if(hasElectron || !!isVerticalTouch){\r\n checkedPrintType = '1'\r\n }else {\r\n const { Open } = cloudPrintArguments || {};\r\n if(Open){\r\n checkedPrintType = '3'\r\n }else{\r\n checkedPrintType = '2'\r\n }\r\n }\r\n }\r\n return checkedPrintType\r\n}"]}
|
|
@@ -549,32 +549,6 @@ exports.default = [{
|
|
|
549
549
|
"ParamType": "SHORTCUT_KEY",
|
|
550
550
|
"Name": "AllMemo",
|
|
551
551
|
"TabIndex": 400
|
|
552
|
-
}, {
|
|
553
|
-
"DefaultValue": "ctrl+o",
|
|
554
|
-
"IsEnable": true,
|
|
555
|
-
"IsRequired": false,
|
|
556
|
-
"ExtField": "{\"isdisplay\":1,\"dynamic\":0,\"operationType\":1,\"enableEdit\":1,\"classification\":\"2\",\"operation\":[\".hide-dom-tokey .action-btn=收货人\"]}",
|
|
557
|
-
"Value": "ctrl+o",
|
|
558
|
-
"Title": "收货人",
|
|
559
|
-
"ID": 1398167653056666,
|
|
560
|
-
"IdRef": "",
|
|
561
|
-
"IsVisible": true,
|
|
562
|
-
"ParamType": "SHORTCUT_KEY",
|
|
563
|
-
"Name": "Buyers",
|
|
564
|
-
"TabIndex": 405
|
|
565
|
-
}, {
|
|
566
|
-
"DefaultValue": "ctrl+7",
|
|
567
|
-
"IsEnable": true,
|
|
568
|
-
"IsRequired": false,
|
|
569
|
-
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":1,\"enableEdit\":1,\"classification\":\"2\",\"operation\":[\".hide-dom-tokey .action-btn=配送方式\"]}",
|
|
570
|
-
"Value": "ctrl+7",
|
|
571
|
-
"Title": "配送方式",
|
|
572
|
-
"ID": 1398167653056777,
|
|
573
|
-
"IdRef": "",
|
|
574
|
-
"IsVisible": true,
|
|
575
|
-
"ParamType": "SHORTCUT_KEY",
|
|
576
|
-
"Name": "DeliveryType",
|
|
577
|
-
"TabIndex": 406
|
|
578
552
|
}, {
|
|
579
553
|
"DefaultValue": "ctrl+home",
|
|
580
554
|
"IsEnable": true,
|
|
@@ -731,32 +705,6 @@ exports.default = [{
|
|
|
731
705
|
"ParamType": "SHORTCUT_KEY",
|
|
732
706
|
"Name": "Lock",
|
|
733
707
|
"TabIndex": 580
|
|
734
|
-
}, {
|
|
735
|
-
"DefaultValue": "ctrl+4",
|
|
736
|
-
"IsEnable": true,
|
|
737
|
-
"IsRequired": false,
|
|
738
|
-
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":1,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".pos-side-bar .sider-bar-menu-item .sub-menu-item span=预订\"]}",
|
|
739
|
-
"Value": "ctrl+4",
|
|
740
|
-
"Title": "预订",
|
|
741
|
-
"ID": 1398167653056555,
|
|
742
|
-
"IdRef": "",
|
|
743
|
-
"IsVisible": true,
|
|
744
|
-
"ParamType": "SHORTCUT_KEY",
|
|
745
|
-
"Name": "PreSale",
|
|
746
|
-
"TabIndex": 585
|
|
747
|
-
}, {
|
|
748
|
-
"DefaultValue": "ctrl+6",
|
|
749
|
-
"IsEnable": true,
|
|
750
|
-
"IsRequired": false,
|
|
751
|
-
"ExtField": "{\"isdisplay\":1,\"dynamic\":1,\"operationType\":1,\"enableEdit\":1,\"classification\":\"3\",\"operation\":[\".pos-side-bar .sider-bar-menu-item .sub-menu-item span=取货\"]}",
|
|
752
|
-
"Value": "ctrl+6",
|
|
753
|
-
"Title": "取货",
|
|
754
|
-
"ID": 1398167653056525,
|
|
755
|
-
"IdRef": "",
|
|
756
|
-
"IsVisible": true,
|
|
757
|
-
"ParamType": "SHORTCUT_KEY",
|
|
758
|
-
"Name": "PickUp",
|
|
759
|
-
"TabIndex": 587
|
|
760
708
|
}, {
|
|
761
709
|
"DefaultValue": "f5",
|
|
762
710
|
"IsEnable": true,
|