@pisell/private-materials 3.0.192 → 3.0.194

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 (43) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +150 -142
  7. package/build/lowcode/render/default/view.js +10 -10
  8. package/build/lowcode/view.js +9 -9
  9. package/es/components/booking/addons/model.d.ts +2 -1
  10. package/es/components/booking/forms/model.d.ts +2 -1
  11. package/es/components/booking/notes/index.d.ts +1 -1
  12. package/es/components/booking/notes/model.d.ts +2 -1
  13. package/es/components/booking/payments/model.d.ts +2 -1
  14. package/es/components/eftpos/form/index.js +12 -6
  15. package/es/components/eftpos/group/index.d.ts +1 -2
  16. package/es/components/eftpos/group/index.js +1 -2
  17. package/es/components/eftpos/index.js +2 -2
  18. package/es/components/eftpos/receipt/index.d.ts +24 -0
  19. package/es/components/eftpos/receipt/index.js +96 -0
  20. package/es/components/eftposPay/hooks.d.ts +1 -1
  21. package/es/components/eftposPay/store/index.d.ts +1 -1
  22. package/es/components/eftposPay/tyro/index.js +40 -17
  23. package/es/components/ruleSetting/server.js +11 -4
  24. package/es/components/schedules/index.d.ts +1 -1
  25. package/es/components/schedules/model.d.ts +2 -1
  26. package/lib/components/booking/addons/model.d.ts +2 -1
  27. package/lib/components/booking/forms/model.d.ts +2 -1
  28. package/lib/components/booking/notes/index.d.ts +1 -1
  29. package/lib/components/booking/notes/model.d.ts +2 -1
  30. package/lib/components/booking/payments/model.d.ts +2 -1
  31. package/lib/components/eftpos/form/index.js +12 -6
  32. package/lib/components/eftpos/group/index.d.ts +1 -2
  33. package/lib/components/eftpos/group/index.js +0 -1
  34. package/lib/components/eftpos/index.js +2 -2
  35. package/lib/components/eftpos/receipt/index.d.ts +24 -0
  36. package/lib/components/eftpos/receipt/index.js +88 -0
  37. package/lib/components/eftposPay/hooks.d.ts +1 -1
  38. package/lib/components/eftposPay/store/index.d.ts +1 -1
  39. package/lib/components/eftposPay/tyro/index.js +26 -5
  40. package/lib/components/ruleSetting/server.js +5 -4
  41. package/lib/components/schedules/index.d.ts +1 -1
  42. package/lib/components/schedules/model.d.ts +2 -1
  43. package/package.json +3 -3
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: any;
7
+ declare const Notes: (props: any) => any;
8
8
  export default Notes;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -9,6 +9,7 @@ import React from 'react';
9
9
  import { Input, InputNumber, Checkbox, Radio, Cascader, DatePicker, Select, Slider, Switch, TimePicker, Transfer, TreeSelect, Upload, Form } from 'antd';
10
10
  import { CheckboxGroup, RadioGroup } from "../group";
11
11
  import Surcharge, { getCommName, getCommDefaultVal } from "../surcharge";
12
+ import Receipt, { getCommName as getCommNameReceipt, getCommDefaultVal as getCommDefaultValReceipt } from "../receipt";
12
13
  import DeviceList from "../deviceList";
13
14
 
14
15
  // 通用表单配置
@@ -32,7 +33,8 @@ var Mapping = {
32
33
  };
33
34
  var CustomMapping = {
34
35
  Surcharge: Surcharge,
35
- DeviceList: DeviceList
36
+ DeviceList: DeviceList,
37
+ Receipt: Receipt
36
38
  };
37
39
 
38
40
  /**
@@ -53,13 +55,13 @@ var CustomFormItem = function CustomFormItem(_ref) {
53
55
  return /*#__PURE__*/React.createElement(CustomFormItem, {
54
56
  formItemList: item.children,
55
57
  onChange: onChange,
56
- key: item.name ? item.name + level : Component + index + level,
58
+ key: item.name ? "".concat(item.name).concat(level) : "".concat(Component).concat(index).concat(level),
57
59
  level: level + 1
58
60
  });
59
61
  }
60
62
  if (_typeof(Component) === 'object') {
61
63
  return /*#__PURE__*/React.createElement(Component, _extends({}, item, {
62
- key: item.name + level
64
+ key: "".concat(item.name).concat(level)
63
65
  }));
64
66
  }
65
67
  if (Mapping[Component]) {
@@ -67,7 +69,7 @@ var CustomFormItem = function CustomFormItem(_ref) {
67
69
  var input = item.input,
68
70
  formItemProps = _objectWithoutProperties(item, _excluded2);
69
71
  return /*#__PURE__*/React.createElement(Form.Item, _extends({}, formItemProps, {
70
- key: item.name + level
72
+ key: "".concat(item.name).concat(level)
71
73
  }), /*#__PURE__*/React.createElement(Comm, input));
72
74
  }
73
75
  if (Mapping[Component]) {
@@ -75,13 +77,13 @@ var CustomFormItem = function CustomFormItem(_ref) {
75
77
  var _input = item.input,
76
78
  _formItemProps = _objectWithoutProperties(item, _excluded3);
77
79
  return /*#__PURE__*/React.createElement(Form.Item, _extends({}, _formItemProps, {
78
- key: item.name + level
80
+ key: "".concat(item.name).concat(level)
79
81
  }), /*#__PURE__*/React.createElement(_Comm, _input));
80
82
  }
81
83
  if (CustomMapping[Component]) {
82
84
  var _Comm2 = CustomMapping[Component];
83
85
  return /*#__PURE__*/React.createElement(_Comm2, _extends({}, item, {
84
- key: item.name + level
86
+ key: "".concat(item.name).concat(level)
85
87
  }));
86
88
  }
87
89
  throw TypeError("pos\u7269\u6599\u5E93 \u8F93\u5165\u7EC4\u4EF6\u7C7B\u578B ".concat(Component, " \u65E0\u6CD5\u6620\u5C04,\u8BF7\u6B63\u786E\u4F20\u5165\u7EC4\u4EF6\u7C7B\u578B"));
@@ -92,5 +94,9 @@ export var helpMapping = {
92
94
  Surcharge: {
93
95
  getCommName: getCommName,
94
96
  getCommDefaultVal: getCommDefaultVal
97
+ },
98
+ Receipt: {
99
+ getCommName: getCommNameReceipt,
100
+ getCommDefaultVal: getCommDefaultValReceipt
95
101
  }
96
102
  };
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { RadioGroupProps } from 'antd';
3
3
  export declare const CheckboxGroup: ({ direction, options, ...props }: any) => React.JSX.Element;
4
- export declare const RadioGroup: ({ direction, options, component, ...props }: RadioGroupProps & {
4
+ export declare const RadioGroup: ({ direction, options, ...props }: RadioGroupProps & {
5
5
  direction?: "vertical" | undefined;
6
- component: string;
7
6
  }) => React.JSX.Element;
@@ -1,6 +1,6 @@
1
1
  var _excluded = ["direction", "options"],
2
2
  _excluded2 = ["label", "value"],
3
- _excluded3 = ["direction", "options", "component"],
3
+ _excluded3 = ["direction", "options"],
4
4
  _excluded4 = ["label", "value"];
5
5
  function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
6
6
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
@@ -38,7 +38,6 @@ export var CheckboxGroup = function CheckboxGroup(_ref) {
38
38
  export var RadioGroup = function RadioGroup(_ref2) {
39
39
  var direction = _ref2.direction,
40
40
  options = _ref2.options,
41
- component = _ref2.component,
42
41
  props = _objectWithoutProperties(_ref2, _excluded3);
43
42
  if (direction === 'vertical') {
44
43
  return /*#__PURE__*/React.createElement(Radio.Group, props, /*#__PURE__*/React.createElement(Space, {
@@ -24,8 +24,8 @@ import Drawer from "../booking/components/drawer";
24
24
  import Log from "./log";
25
25
  import localeTexts from "./locales";
26
26
  import { usePairTerminalo } from "./hooks";
27
- import ApiKeyIcon from "./icon/apiKey";
28
- import DeviceIcon from "./icon/device";
27
+ import DeviceIcon from "./icon/apiKey";
28
+ import ApiKeyIcon from "./icon/device";
29
29
  import { Eftpos, getCommByFields, DeviceEnum, getDefaultValue } from "./const";
30
30
  import "./index.less";
31
31
  locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
@@ -0,0 +1,24 @@
1
+ import React from 'react';
2
+ /**
3
+ * @title: 自定义组件设置
4
+ * @description: 自定义组件设置
5
+ * @param {any} commConfig 当前组件配置
6
+ * @param {string} name 上游name(用于嵌套 xxx:{yyy:''})
7
+ * @return {*}
8
+ * @Author: hongbing.wang
9
+ * @Date: 2024-08-20 11:10
10
+ */
11
+ export declare const getCommName: (commConfig: any, name: string[]) => any;
12
+ /**
13
+ * @title: 自定义组件结果设置
14
+ * @description: 自定义组件结果设置
15
+ * @param {any} commConfig 当前组件配置
16
+ * @return {*}
17
+ * @Author: hongbing.wang
18
+ * @Date: 2024-08-20 11:11
19
+ */
20
+ export declare const getCommDefaultVal: (commConfig: any) => {
21
+ [x: number]: any;
22
+ };
23
+ declare const _default: (props: any) => React.JSX.Element;
24
+ export default _default;
@@ -0,0 +1,96 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _excluded = ["input"],
3
+ _excluded2 = ["input"];
4
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
5
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
6
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
10
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
13
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
15
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
17
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
18
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
19
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
20
+ import React, { useMemo, useState } from 'react';
21
+ import { Form } from 'antd';
22
+ import { CheckboxGroup, RadioGroup } from "../group";
23
+
24
+ /**
25
+ * @title: 自定义组件设置
26
+ * @description: 自定义组件设置
27
+ * @param {any} commConfig 当前组件配置
28
+ * @param {string} name 上游name(用于嵌套 xxx:{yyy:''})
29
+ * @return {*}
30
+ * @Author: hongbing.wang
31
+ * @Date: 2024-08-20 11:10
32
+ */
33
+ export var getCommName = function getCommName(commConfig, name) {
34
+ commConfig.receipts.__sourceName = commConfig.receipts.name;
35
+ commConfig.receiptList.__sourceName = commConfig.receiptList.name;
36
+ commConfig.receipts.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.receipts.name]) : commConfig.receipts.name;
37
+ commConfig.receiptList.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.receiptList.name]) : commConfig.receiptList.name;
38
+ return commConfig;
39
+ };
40
+
41
+ /**
42
+ * @title: 自定义组件结果设置
43
+ * @description: 自定义组件结果设置
44
+ * @param {any} commConfig 当前组件配置
45
+ * @return {*}
46
+ * @Author: hongbing.wang
47
+ * @Date: 2024-08-20 11:11
48
+ */
49
+ export var getCommDefaultVal = function getCommDefaultVal(commConfig) {
50
+ var _ref;
51
+ var receipts = commConfig.receipts.input.defaultValue;
52
+ var receiptList = commConfig.receiptList.input.defaultValue;
53
+ console.log('receipts = ', receipts);
54
+ return _ref = {}, _defineProperty(_ref, commConfig.receipts.__sourceName, typeof receipts === 'undefined' ? true : receipts), _defineProperty(_ref, commConfig.receiptList.__sourceName, typeof receiptList === 'undefined' ? ['merchant', 'customer'] : receiptList), _ref;
55
+ };
56
+ export default (function (props) {
57
+ var receipts = props.receipts,
58
+ receiptList = props.receiptList;
59
+ // const {input:receiptsInput,...receiptsOther} = receipts
60
+ var _useMemo = useMemo(function () {
61
+ var input = receipts.input,
62
+ other = _objectWithoutProperties(receipts, _excluded);
63
+ return [input, other];
64
+ }, [receipts]),
65
+ _useMemo2 = _slicedToArray(_useMemo, 2),
66
+ receiptsInput = _useMemo2[0],
67
+ receiptsOther = _useMemo2[1];
68
+ var _useMemo3 = useMemo(function () {
69
+ var input = receiptList.input,
70
+ other = _objectWithoutProperties(receiptList, _excluded2);
71
+ return [input, other];
72
+ }, [receipts]),
73
+ _useMemo4 = _slicedToArray(_useMemo3, 2),
74
+ receiptListInput = _useMemo4[0],
75
+ receiptListOther = _useMemo4[1];
76
+ var _useState = useState(receiptsInput.defaultValue),
77
+ _useState2 = _slicedToArray(_useState, 2),
78
+ type = _useState2[0],
79
+ setType = _useState2[1];
80
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Form.Item, _extends({
81
+ style: {
82
+ marginBottom: '12px'
83
+ }
84
+ }, receiptsOther), /*#__PURE__*/React.createElement(RadioGroup, _extends({}, receiptsInput, {
85
+ onChange: function onChange(event) {
86
+ setType(event.target.value);
87
+ }
88
+ }))), /*#__PURE__*/React.createElement(Form.Item, _extends({}, receiptListOther, {
89
+ style: type ? {
90
+ marginLeft: '24px',
91
+ display: 'none'
92
+ } : {
93
+ marginLeft: '24px'
94
+ }
95
+ }), /*#__PURE__*/React.createElement(CheckboxGroup, receiptListInput)));
96
+ });
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "payo" | "stripe">;
22
+ readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  };
25
25
  /**
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  amount?: string | number | undefined;
298
298
  mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "tyro" | "windcave" | "payo" | "stripe" | undefined;
300
+ eftpos?: "payo" | "tyro" | "windcave" | "stripe" | undefined;
301
301
  action?: "amount" | "deviceList" | "pay" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
@@ -68,6 +68,22 @@ export default (function (_ref) {
68
68
  var requestIdRef = useRef((custom === null || custom === void 0 ? void 0 : custom.requestId) || '');
69
69
  var unloadRef = useRef(false);
70
70
  var clearRef = useRef();
71
+ var isPrint = function isPrint(key) {
72
+ var _deviceRef$current, _deviceRef$current$se, _deviceRef$current2, _deviceRef$current2$s;
73
+ if ((_deviceRef$current = deviceRef.current) !== null && _deviceRef$current !== void 0 && (_deviceRef$current$se = _deviceRef$current.setting) !== null && _deviceRef$current$se !== void 0 && _deviceRef$current$se.receipts) {
74
+ return false;
75
+ }
76
+ var receiptList = (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : (_deviceRef$current2$s = _deviceRef$current2.setting) === null || _deviceRef$current2$s === void 0 ? void 0 : _deviceRef$current2$s.receiptList;
77
+ if (!Array.isArray(receiptList)) {
78
+ return true;
79
+ }
80
+ if (Array.isArray(receiptList) && receiptList.some(function (item) {
81
+ return item === key;
82
+ })) {
83
+ return true;
84
+ }
85
+ return false;
86
+ };
71
87
  useEffect(function () {
72
88
  listRef.current = (custom === null || custom === void 0 ? void 0 : custom.list) || [];
73
89
  }, [custom === null || custom === void 0 ? void 0 : custom.list]);
@@ -117,7 +133,7 @@ export default (function (_ref) {
117
133
  * @Date: 2024-08-19 11:32
118
134
  */
119
135
  var refundOrder = function refundOrder() {
120
- var _deviceRef$current, _deviceRef$current$se, _deviceRef$current2;
136
+ var _deviceRef$current3, _deviceRef$current3$s, _deviceRef$current4;
121
137
  var iClient = iClientRef.current;
122
138
  if (!iClient) {
123
139
  return;
@@ -135,8 +151,8 @@ export default (function (_ref) {
135
151
  }));
136
152
  requestParams.current = {
137
153
  amount: new Decimal(amountRef.current || 0).mul(100).toFixed(0, Decimal.ROUND_HALF_UP),
138
- // 打印小票 true 打印到系统上 false 打印到pos机上
139
- integratedReceipt: !((_deviceRef$current = deviceRef.current) !== null && _deviceRef$current !== void 0 && (_deviceRef$current$se = _deviceRef$current.setting) !== null && _deviceRef$current$se !== void 0 && _deviceRef$current$se.receipts),
154
+ // 打印小票 true 打印到Pisell系统上 false 打印到pos机上
155
+ integratedReceipt: !((_deviceRef$current3 = deviceRef.current) !== null && _deviceRef$current3 !== void 0 && (_deviceRef$current3$s = _deviceRef$current3.setting) !== null && _deviceRef$current3$s !== void 0 && _deviceRef$current3$s.receipts),
140
156
  integrationKey: integrationKey,
141
157
  transactionId: numRef.current,
142
158
  mid: mid,
@@ -151,7 +167,7 @@ export default (function (_ref) {
151
167
  api.addTransaction({
152
168
  order_id: orderIdRef.current,
153
169
  number: numRef.current,
154
- card_reader_id: (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.id,
170
+ card_reader_id: (_deviceRef$current4 = deviceRef.current) === null || _deviceRef$current4 === void 0 ? void 0 : _deviceRef$current4.id,
155
171
  card_reader_type: eftpos,
156
172
  amount: requestParams.current.amount,
157
173
  action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
@@ -183,7 +199,7 @@ export default (function (_ref) {
183
199
  * @Date: 2024-08-19 11:33
184
200
  */
185
201
  var payOrder = function payOrder() {
186
- var _deviceRef$current3, _deviceRef$current3$s, _payRef$current, _deviceRef$current4, _deviceRef$current4$s, _deviceRef$current5, _deviceRef$current5$s, _deviceRef$current6;
202
+ var _deviceRef$current5, _deviceRef$current5$s, _payRef$current, _deviceRef$current6, _deviceRef$current6$s, _deviceRef$current7, _deviceRef$current7$s, _deviceRef$current8;
187
203
  var iClient = iClientRef.current;
188
204
  if (!iClient) {
189
205
  return;
@@ -199,14 +215,14 @@ export default (function (_ref) {
199
215
  dispatch(updateState({
200
216
  number: numRef.current
201
217
  }));
202
- console.log('deviceRef.current?.settings?.useOriginSurcharge = ', (_deviceRef$current3 = deviceRef.current) === null || _deviceRef$current3 === void 0 ? void 0 : (_deviceRef$current3$s = _deviceRef$current3.setting) === null || _deviceRef$current3$s === void 0 ? void 0 : _deviceRef$current3$s.useOriginSurcharge);
218
+ console.log('deviceRef.current?.settings?.useOriginSurcharge = ', (_deviceRef$current5 = deviceRef.current) === null || _deviceRef$current5 === void 0 ? void 0 : (_deviceRef$current5$s = _deviceRef$current5.setting) === null || _deviceRef$current5$s === void 0 ? void 0 : _deviceRef$current5$s.useOriginSurcharge);
203
219
  // (deviceRef.current?.setting as { receipts?: boolean })
204
220
  requestParams.current = {
205
221
  amount: new Decimal((_payRef$current = payRef.current) === null || _payRef$current === void 0 ? void 0 : _payRef$current.total).mul(100).toFixed(0, Decimal.ROUND_HALF_UP),
206
222
  // 手续费 true tyro 手续费, false 系统手续费
207
- enableSurcharge: ((_deviceRef$current4 = deviceRef.current) === null || _deviceRef$current4 === void 0 ? void 0 : (_deviceRef$current4$s = _deviceRef$current4.setting) === null || _deviceRef$current4$s === void 0 ? void 0 : _deviceRef$current4$s.useOriginSurcharge) || false,
223
+ enableSurcharge: ((_deviceRef$current6 = deviceRef.current) === null || _deviceRef$current6 === void 0 ? void 0 : (_deviceRef$current6$s = _deviceRef$current6.setting) === null || _deviceRef$current6$s === void 0 ? void 0 : _deviceRef$current6$s.useOriginSurcharge) || false,
208
224
  // 打印小票 true 打印到系统上 false 打印到pos机上
209
- integratedReceipt: !((_deviceRef$current5 = deviceRef.current) !== null && _deviceRef$current5 !== void 0 && (_deviceRef$current5$s = _deviceRef$current5.setting) !== null && _deviceRef$current5$s !== void 0 && _deviceRef$current5$s.receipts),
225
+ integratedReceipt: !((_deviceRef$current7 = deviceRef.current) !== null && _deviceRef$current7 !== void 0 && (_deviceRef$current7$s = _deviceRef$current7.setting) !== null && _deviceRef$current7$s !== void 0 && _deviceRef$current7$s.receipts),
210
226
  integrationKey: integrationKey,
211
227
  transactionId: numRef.current,
212
228
  mid: mid,
@@ -221,7 +237,7 @@ export default (function (_ref) {
221
237
  api.addTransaction({
222
238
  order_id: orderIdRef.current,
223
239
  number: numRef.current,
224
- card_reader_id: (_deviceRef$current6 = deviceRef.current) === null || _deviceRef$current6 === void 0 ? void 0 : _deviceRef$current6.id,
240
+ card_reader_id: (_deviceRef$current8 = deviceRef.current) === null || _deviceRef$current8 === void 0 ? void 0 : _deviceRef$current8.id,
225
241
  card_reader_type: eftpos,
226
242
  amount: requestParams.current.amount,
227
243
  action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
@@ -284,11 +300,17 @@ export default (function (_ref) {
284
300
  var receipt = [merchantReceipt].filter(function (item) {
285
301
  return typeof item === 'string';
286
302
  }).filter(Boolean);
287
- onChange('print', receipt);
288
303
  merchantReceiptRef.current = {
289
304
  signatureRequired: signatureRequired,
290
305
  merchantReceipt: merchantReceipt
291
306
  };
307
+ if (signatureRequired) {
308
+ onChange('print', receipt);
309
+ return;
310
+ }
311
+ if (isPrint('merchant')) {
312
+ onChange('print', receipt);
313
+ }
292
314
  };
293
315
 
294
316
  /**
@@ -373,7 +395,7 @@ export default (function (_ref) {
373
395
  * @Date: 2024-08-19 11:35
374
396
  */
375
397
  var transactionCompleteCallbackImpl = function transactionCompleteCallbackImpl(response) {
376
- var _deviceRef$current7;
398
+ var _deviceRef$current9;
377
399
  setStatus(-1);
378
400
  setManually(false);
379
401
  console.log('Response = ' + JSON.stringify(response), ', Request = ', JSON.stringify(requestParams.current));
@@ -385,7 +407,7 @@ export default (function (_ref) {
385
407
  api.editTransaction(requestIdRef.current, {
386
408
  order_id: orderIdRef.current,
387
409
  number: numRef.current,
388
- card_reader_id: (_deviceRef$current7 = deviceRef.current) === null || _deviceRef$current7 === void 0 ? void 0 : _deviceRef$current7.id,
410
+ card_reader_id: (_deviceRef$current9 = deviceRef.current) === null || _deviceRef$current9 === void 0 ? void 0 : _deviceRef$current9.id,
389
411
  card_reader_type: eftpos,
390
412
  amount: requestParams.current.amount,
391
413
  action: modeRef.current === ModeEnum.FullPay ? ModeEnum.Pay : modeRef.current,
@@ -413,7 +435,6 @@ export default (function (_ref) {
413
435
  card_reader_surcharge: response.surchargeAmount || 0
414
436
  }));
415
437
  clearRef.current = setTimeout(function () {
416
- var _deviceRef$current8;
417
438
  var params = getPayParams({
418
439
  mode: modeRef.current,
419
440
  amount: amountRef.current,
@@ -426,15 +447,17 @@ export default (function (_ref) {
426
447
  }
427
448
  }, 'success');
428
449
  onChange('success', _objectSpread(_objectSpread({}, params), {}, {
429
- receipt: (_deviceRef$current8 = deviceRef.current) !== null && _deviceRef$current8 !== void 0 && _deviceRef$current8.setting.receipts ? [] : receipt
450
+ receipt: isPrint('customer') ? receipt : []
430
451
  }));
431
452
  }, 1000);
432
453
  return;
433
454
  } else {
434
- var _deviceRef$current9;
435
- var current = (_deviceRef$current9 = deviceRef.current) !== null && _deviceRef$current9 !== void 0 && _deviceRef$current9.setting.receipts ? [] : receipt;
455
+ var _deviceRef$current10;
456
+ var current = (_deviceRef$current10 = deviceRef.current) !== null && _deviceRef$current10 !== void 0 && _deviceRef$current10.setting.receipts ? [] : receipt;
436
457
  if (current.length > 0) {
437
- onChange('print', current);
458
+ if (isPrint('customer')) {
459
+ onChange('print', receipt);
460
+ }
438
461
  }
439
462
  }
440
463
  if (response.result === 'UNKNOWN') {
@@ -17,7 +17,8 @@ export var getStaffList = /*#__PURE__*/function () {
17
17
  case 0:
18
18
  _context.next = 2;
19
19
  return request.getRequest().get('/shop/shop/setting/staff', {}, {
20
- useCache: true
20
+ useCache: true,
21
+ fullResult: true
21
22
  });
22
23
  case 2:
23
24
  _yield$request$getReq = _context.sent;
@@ -54,7 +55,9 @@ export var getProductChannel = /*#__PURE__*/function () {
54
55
  while (1) switch (_context2.prev = _context2.next) {
55
56
  case 0:
56
57
  _context2.next = 2;
57
- return request.getRequest().get('/shop/order/platform-list');
58
+ return request.getRequest().get('/shop/order/platform-list', {}, {
59
+ fullResult: true
60
+ });
58
61
  case 2:
59
62
  _yield$request$getReq2 = _context2.sent;
60
63
  data = _yield$request$getReq2.data;
@@ -87,7 +90,9 @@ export var getOrderTypes = /*#__PURE__*/function () {
87
90
  while (1) switch (_context3.prev = _context3.next) {
88
91
  case 0:
89
92
  _context3.next = 2;
90
- return request.getRequest().get('/shop/order/aggregation-type');
93
+ return request.getRequest().get('/shop/order/aggregation-type', {}, {
94
+ fullResult: true
95
+ });
91
96
  case 2:
92
97
  _yield$request$getReq3 = _context3.sent;
93
98
  data = _yield$request$getReq3.data;
@@ -120,7 +125,9 @@ export var getPaymentTypes = /*#__PURE__*/function () {
120
125
  while (1) switch (_context4.prev = _context4.next) {
121
126
  case 0:
122
127
  _context4.next = 2;
123
- return request.getRequest().get('/shop/till/opened-payment-method');
128
+ return request.getRequest().get('/shop/till/opened-payment-method', {}, {
129
+ fullResult: true
130
+ });
124
131
  case 2:
125
132
  _yield$request$getReq4 = _context4.sent;
126
133
  data = _yield$request$getReq4.data;
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: (props: any) => JSX.Element;
2
+ declare const Schedules: (props: any) => any;
3
3
  export default Schedules;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { CalendarDataItem, ScheduleItem } from "./type";
2
3
  import dayjs from "dayjs";
3
4
  export interface FormState {
@@ -68,7 +69,7 @@ export interface FormState {
68
69
  };
69
70
  setGlobalState: Function | null;
70
71
  }
71
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
72
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
72
73
  state: FormState;
73
74
  } & {
74
75
  dispatch: (params: {
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -4,5 +4,5 @@ export interface InfoProps {
4
4
  globalState: any;
5
5
  setGlobalState: any;
6
6
  }
7
- declare const Notes: any;
7
+ declare const Notes: (props: any) => any;
8
8
  export default Notes;
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -1,5 +1,6 @@
1
+ /// <reference types="react" />
1
2
  import { FormState } from "../model";
2
- export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
3
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
3
4
  state: FormState;
4
5
  } & {
5
6
  dispatch: (params: {
@@ -37,6 +37,7 @@ var import_react = __toESM(require("react"));
37
37
  var import_antd = require("antd");
38
38
  var import_group = require("../group");
39
39
  var import_surcharge = __toESM(require("../surcharge"));
40
+ var import_receipt = __toESM(require("../receipt"));
40
41
  var import_deviceList = __toESM(require("../deviceList"));
41
42
  var Mapping = {
42
43
  Input: import_antd.Input,
@@ -58,7 +59,8 @@ var Mapping = {
58
59
  };
59
60
  var CustomMapping = {
60
61
  Surcharge: import_surcharge.default,
61
- DeviceList: import_deviceList.default
62
+ DeviceList: import_deviceList.default,
63
+ Receipt: import_receipt.default
62
64
  };
63
65
  var CustomFormItem = ({
64
66
  formItemList,
@@ -72,27 +74,27 @@ var CustomFormItem = ({
72
74
  {
73
75
  formItemList: item.children,
74
76
  onChange,
75
- key: item.name ? item.name + level : Component + index + level,
77
+ key: item.name ? `${item.name}${level}` : `${Component}${index}${level}`,
76
78
  level: level + 1
77
79
  }
78
80
  );
79
81
  }
80
82
  if (typeof Component === "object") {
81
- return /* @__PURE__ */ import_react.default.createElement(Component, { ...item, key: item.name + level });
83
+ return /* @__PURE__ */ import_react.default.createElement(Component, { ...item, key: `${item.name}${level}` });
82
84
  }
83
85
  if (Mapping[Component]) {
84
86
  const Comm = Mapping[Component];
85
87
  const { input, ...formItemProps } = item;
86
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps, key: item.name + level }, /* @__PURE__ */ import_react.default.createElement(Comm, { ...input }));
88
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps, key: `${item.name}${level}` }, /* @__PURE__ */ import_react.default.createElement(Comm, { ...input }));
87
89
  }
88
90
  if (Mapping[Component]) {
89
91
  const Comm = Mapping[Component];
90
92
  const { input, ...formItemProps } = item;
91
- return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps, key: item.name + level }, /* @__PURE__ */ import_react.default.createElement(Comm, { ...input }));
93
+ return /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { ...formItemProps, key: `${item.name}${level}` }, /* @__PURE__ */ import_react.default.createElement(Comm, { ...input }));
92
94
  }
93
95
  if (CustomMapping[Component]) {
94
96
  const Comm = CustomMapping[Component];
95
- return /* @__PURE__ */ import_react.default.createElement(Comm, { ...item, key: item.name + level });
97
+ return /* @__PURE__ */ import_react.default.createElement(Comm, { ...item, key: `${item.name}${level}` });
96
98
  }
97
99
  throw TypeError(
98
100
  `pos物料库 输入组件类型 ${Component} 无法映射,请正确传入组件类型`
@@ -104,6 +106,10 @@ var helpMapping = {
104
106
  Surcharge: {
105
107
  getCommName: import_surcharge.getCommName,
106
108
  getCommDefaultVal: import_surcharge.getCommDefaultVal
109
+ },
110
+ Receipt: {
111
+ getCommName: import_receipt.getCommName,
112
+ getCommDefaultVal: import_receipt.getCommDefaultVal
107
113
  }
108
114
  };
109
115
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
  import { RadioGroupProps } from 'antd';
3
3
  export declare const CheckboxGroup: ({ direction, options, ...props }: any) => React.JSX.Element;
4
- export declare const RadioGroup: ({ direction, options, component, ...props }: RadioGroupProps & {
4
+ export declare const RadioGroup: ({ direction, options, ...props }: RadioGroupProps & {
5
5
  direction?: "vertical" | undefined;
6
- component: string;
7
6
  }) => React.JSX.Element;