@pisell/private-materials 3.0.136 → 3.0.138

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 (219) 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 +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +12 -12
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/booking/forms/single/index.js +3 -0
  12. package/es/components/eftpos/const.d.ts +26 -0
  13. package/es/components/eftpos/const.js +40 -8
  14. package/es/components/eftpos/device.d.ts +3 -2
  15. package/es/components/eftpos/device.js +6 -5
  16. package/es/components/eftpos/form/index.d.ts +5 -0
  17. package/es/components/eftpos/form/index.js +8 -0
  18. package/es/components/eftpos/hooks.d.ts +34 -0
  19. package/es/components/{eftposPay/windcave/hook.js → eftpos/hooks.js} +96 -122
  20. package/es/components/eftpos/icon/apiKey.d.ts +5 -0
  21. package/es/components/eftpos/icon/apiKey.js +17 -0
  22. package/es/components/eftpos/icon/device.d.ts +5 -0
  23. package/es/components/eftpos/icon/device.js +19 -0
  24. package/es/components/eftpos/index.d.ts +10 -0
  25. package/es/components/eftpos/index.js +329 -46
  26. package/es/components/eftpos/index.less +38 -1
  27. package/es/components/eftpos/locales.d.ts +12 -0
  28. package/es/components/eftpos/locales.js +15 -3
  29. package/es/components/eftpos/log.d.ts +8 -0
  30. package/es/components/eftpos/log.js +85 -0
  31. package/es/components/eftpos/pos.d.ts +1 -1
  32. package/es/components/eftpos/pos.js +8 -5
  33. package/es/components/eftpos/surcharge/index.d.ts +25 -2
  34. package/es/components/eftpos/surcharge/index.js +100 -16
  35. package/es/components/eftpos/table.d.ts +4 -0
  36. package/es/components/eftpos/table.js +102 -10
  37. package/es/components/eftposPay/amount.d.ts +7 -1
  38. package/es/components/eftposPay/amount.js +65 -38
  39. package/es/components/eftposPay/component/fail/failCustom.js +65 -20
  40. package/es/components/eftposPay/component/fail/index.js +60 -30
  41. package/es/components/eftposPay/component/fail/network.d.ts +5 -0
  42. package/es/components/eftposPay/component/fail/network.js +13 -0
  43. package/es/components/eftposPay/component/fail/unknow.d.ts +6 -0
  44. package/es/components/eftposPay/component/fail/unknow.js +18 -3
  45. package/es/components/eftposPay/component/header/index.d.ts +2 -1
  46. package/es/components/eftposPay/component/header/index.js +4 -1
  47. package/es/components/eftposPay/component/header/index.less +1 -10
  48. package/es/components/eftposPay/component/manual/index.d.ts +6 -1
  49. package/es/components/eftposPay/component/manual/index.js +174 -23
  50. package/es/components/eftposPay/component/manual/index.less +42 -14
  51. package/es/components/eftposPay/component/signature/index.d.ts +5 -0
  52. package/es/components/eftposPay/component/signature/index.js +20 -2
  53. package/es/components/eftposPay/component/step/index.d.ts +7 -7
  54. package/es/components/eftposPay/component/step/step.d.ts +4 -4
  55. package/es/components/eftposPay/const.d.ts +19 -4
  56. package/es/components/eftposPay/const.js +4 -2
  57. package/es/components/eftposPay/device.d.ts +7 -0
  58. package/es/components/eftposPay/device.js +22 -0
  59. package/es/components/eftposPay/helper.d.ts +54 -0
  60. package/es/components/eftposPay/helper.js +93 -1
  61. package/es/components/eftposPay/hooks.d.ts +30 -1
  62. package/es/components/eftposPay/hooks.js +181 -26
  63. package/es/components/eftposPay/index.d.ts +2 -4
  64. package/es/components/eftposPay/index.js +119 -31
  65. package/es/components/eftposPay/index.less +27 -19
  66. package/es/components/eftposPay/locales.d.ts +45 -0
  67. package/es/components/eftposPay/locales.js +348 -3
  68. package/es/components/eftposPay/manufacturer.d.ts +2 -2
  69. package/es/components/eftposPay/manufacturer.js +9 -10
  70. package/es/components/eftposPay/pay.d.ts +10 -1
  71. package/es/components/eftposPay/pay.js +112 -34
  72. package/es/components/eftposPay/payo/config.js +137 -270
  73. package/es/components/eftposPay/payo/const.d.ts +22 -2
  74. package/es/components/eftposPay/payo/const.js +83 -33
  75. package/es/components/eftposPay/payo/hooks.d.ts +5 -0
  76. package/es/components/eftposPay/payo/hooks.js +19 -2
  77. package/es/components/eftposPay/store/index.d.ts +154 -53
  78. package/es/components/eftposPay/store/index.js +112 -60
  79. package/es/components/eftposPay/tyro/const.d.ts +17 -0
  80. package/es/components/eftposPay/{eftpos → tyro}/const.js +71 -90
  81. package/es/components/eftposPay/tyro/hooks.d.ts +14 -0
  82. package/es/components/eftposPay/tyro/hooks.js +40 -0
  83. package/es/components/eftposPay/tyro/index.d.ts +9 -0
  84. package/es/components/eftposPay/tyro/index.js +575 -0
  85. package/es/components/eftposPay/windcave/const.d.ts +24 -9
  86. package/es/components/eftposPay/windcave/const.js +90 -81
  87. package/es/components/eftposPay/windcave/helper.d.ts +16 -2
  88. package/es/components/eftposPay/windcave/helper.js +175 -42
  89. package/es/components/eftposPay/windcave/receiptAction.d.ts +12 -0
  90. package/es/components/eftposPay/windcave/receiptAction.js +91 -43
  91. package/es/components/eftposPay/windcave/timer.d.ts +13 -1
  92. package/es/components/eftposPay/windcave/timer.js +18 -1
  93. package/es/components/eftposPay/windcave/windcave.d.ts +2 -1
  94. package/es/components/eftposPay/windcave/windcave.js +155 -139
  95. package/es/utils/load.d.ts +11 -0
  96. package/es/utils/load.js +85 -0
  97. package/lib/components/booking/forms/single/index.js +1 -0
  98. package/lib/components/eftpos/const.d.ts +26 -0
  99. package/lib/components/eftpos/const.js +13 -1
  100. package/lib/components/eftpos/device.d.ts +3 -2
  101. package/lib/components/eftpos/device.js +2 -2
  102. package/lib/components/eftpos/form/index.d.ts +5 -0
  103. package/lib/components/eftpos/hooks.d.ts +34 -0
  104. package/lib/components/eftpos/hooks.js +106 -0
  105. package/lib/components/eftpos/icon/apiKey.d.ts +5 -0
  106. package/lib/components/eftpos/icon/apiKey.js +57 -0
  107. package/lib/components/eftpos/icon/device.d.ts +5 -0
  108. package/lib/components/eftpos/icon/device.js +57 -0
  109. package/lib/components/eftpos/index.d.ts +10 -0
  110. package/lib/components/eftpos/index.js +262 -97
  111. package/lib/components/eftpos/index.less +38 -1
  112. package/lib/components/eftpos/locales.d.ts +12 -0
  113. package/lib/components/eftpos/locales.js +15 -3
  114. package/lib/components/eftpos/log.d.ts +8 -0
  115. package/lib/components/eftpos/log.js +87 -0
  116. package/lib/components/eftpos/pos.d.ts +1 -1
  117. package/lib/components/eftpos/pos.js +5 -4
  118. package/lib/components/eftpos/surcharge/index.d.ts +25 -2
  119. package/lib/components/eftpos/surcharge/index.js +36 -6
  120. package/lib/components/eftpos/table.d.ts +4 -0
  121. package/lib/components/eftpos/table.js +40 -8
  122. package/lib/components/eftposPay/amount.d.ts +7 -1
  123. package/lib/components/eftposPay/amount.js +10 -33
  124. package/lib/components/eftposPay/component/fail/failCustom.js +27 -6
  125. package/lib/components/eftposPay/component/fail/index.js +39 -18
  126. package/lib/components/eftposPay/component/fail/network.d.ts +5 -0
  127. package/lib/components/eftposPay/component/fail/unknow.d.ts +6 -0
  128. package/lib/components/eftposPay/component/fail/unknow.js +3 -3
  129. package/lib/components/eftposPay/component/header/index.d.ts +2 -1
  130. package/lib/components/eftposPay/component/header/index.js +2 -1
  131. package/lib/components/eftposPay/component/header/index.less +1 -10
  132. package/lib/components/eftposPay/component/manual/index.d.ts +6 -1
  133. package/lib/components/eftposPay/component/manual/index.js +122 -31
  134. package/lib/components/eftposPay/component/manual/index.less +42 -14
  135. package/lib/components/eftposPay/component/signature/index.d.ts +5 -0
  136. package/lib/components/eftposPay/component/signature/index.js +2 -2
  137. package/lib/components/eftposPay/component/step/index.d.ts +7 -7
  138. package/lib/components/eftposPay/component/step/step.d.ts +4 -4
  139. package/lib/components/eftposPay/const.d.ts +19 -4
  140. package/lib/components/eftposPay/const.js +3 -1
  141. package/lib/components/eftposPay/device.d.ts +7 -0
  142. package/lib/components/eftposPay/helper.d.ts +54 -0
  143. package/lib/components/eftposPay/helper.js +64 -0
  144. package/lib/components/eftposPay/hooks.d.ts +30 -1
  145. package/lib/components/eftposPay/hooks.js +182 -44
  146. package/lib/components/eftposPay/index.d.ts +2 -4
  147. package/lib/components/eftposPay/index.js +74 -27
  148. package/lib/components/eftposPay/index.less +27 -19
  149. package/lib/components/eftposPay/locales.d.ts +45 -0
  150. package/lib/components/eftposPay/locales.js +352 -3
  151. package/lib/components/eftposPay/manufacturer.d.ts +2 -2
  152. package/lib/components/eftposPay/manufacturer.js +13 -13
  153. package/lib/components/eftposPay/pay.d.ts +10 -1
  154. package/lib/components/eftposPay/pay.js +86 -25
  155. package/lib/components/eftposPay/payo/config.js +121 -268
  156. package/lib/components/eftposPay/payo/const.d.ts +22 -2
  157. package/lib/components/eftposPay/payo/const.js +55 -36
  158. package/lib/components/eftposPay/payo/hooks.d.ts +5 -0
  159. package/lib/components/eftposPay/payo/hooks.js +1 -1
  160. package/lib/components/eftposPay/store/index.d.ts +154 -53
  161. package/lib/components/eftposPay/store/index.js +7 -66
  162. package/lib/components/eftposPay/tyro/const.d.ts +17 -0
  163. package/lib/components/eftposPay/tyro/const.js +114 -0
  164. package/lib/components/eftposPay/tyro/hooks.d.ts +14 -0
  165. package/lib/components/eftposPay/{eftpos/index.js → tyro/hooks.js} +31 -36
  166. package/lib/components/eftposPay/tyro/index.d.ts +9 -0
  167. package/lib/components/eftposPay/tyro/index.js +558 -0
  168. package/lib/components/eftposPay/windcave/const.d.ts +24 -9
  169. package/lib/components/eftposPay/windcave/const.js +53 -104
  170. package/lib/components/eftposPay/windcave/helper.d.ts +16 -2
  171. package/lib/components/eftposPay/windcave/helper.js +163 -48
  172. package/lib/components/eftposPay/windcave/receiptAction.d.ts +12 -0
  173. package/lib/components/eftposPay/windcave/receiptAction.js +15 -47
  174. package/lib/components/eftposPay/windcave/timer.d.ts +13 -1
  175. package/lib/components/eftposPay/windcave/timer.js +5 -0
  176. package/lib/components/eftposPay/windcave/windcave.d.ts +2 -1
  177. package/lib/components/eftposPay/windcave/windcave.js +130 -130
  178. package/lib/utils/load.d.ts +11 -0
  179. package/lib/utils/load.js +100 -0
  180. package/lowcode/eftpos/meta.ts +202 -160
  181. package/lowcode/eftpos-pay/meta.ts +45 -12
  182. package/package.json +4 -4
  183. package/es/components/eftposPay/eftpos/config.d.ts +0 -11
  184. package/es/components/eftposPay/eftpos/config.js +0 -178
  185. package/es/components/eftposPay/eftpos/const.d.ts +0 -10
  186. package/es/components/eftposPay/eftpos/index.d.ts +0 -7
  187. package/es/components/eftposPay/eftpos/index.js +0 -35
  188. package/es/components/eftposPay/windcave/action.d.ts +0 -8
  189. package/es/components/eftposPay/windcave/action.js +0 -104
  190. package/es/components/eftposPay/windcave/hook.d.ts +0 -14
  191. package/es/components/eftposPay/windcave/index.d.ts +0 -8
  192. package/es/components/eftposPay/windcave/index.js +0 -49
  193. package/es/components/eftposPay/windcave/pos.d.ts +0 -8
  194. package/es/components/eftposPay/windcave/pos.js +0 -180
  195. package/es/components/eftposPay/windcave/pwd.d.ts +0 -8
  196. package/es/components/eftposPay/windcave/pwd.js +0 -124
  197. package/es/components/eftposPay/windcave/receipet.d.ts +0 -6
  198. package/es/components/eftposPay/windcave/receipet.js +0 -67
  199. package/es/components/eftposPay/windcave/wait.d.ts +0 -12
  200. package/es/components/eftposPay/windcave/wait.js +0 -139
  201. package/lib/components/eftposPay/eftpos/config.d.ts +0 -11
  202. package/lib/components/eftposPay/eftpos/config.js +0 -199
  203. package/lib/components/eftposPay/eftpos/const.d.ts +0 -10
  204. package/lib/components/eftposPay/eftpos/const.js +0 -165
  205. package/lib/components/eftposPay/eftpos/index.d.ts +0 -7
  206. package/lib/components/eftposPay/windcave/action.d.ts +0 -8
  207. package/lib/components/eftposPay/windcave/action.js +0 -143
  208. package/lib/components/eftposPay/windcave/hook.d.ts +0 -14
  209. package/lib/components/eftposPay/windcave/hook.js +0 -139
  210. package/lib/components/eftposPay/windcave/index.d.ts +0 -8
  211. package/lib/components/eftposPay/windcave/index.js +0 -78
  212. package/lib/components/eftposPay/windcave/pos.d.ts +0 -8
  213. package/lib/components/eftposPay/windcave/pos.js +0 -197
  214. package/lib/components/eftposPay/windcave/pwd.d.ts +0 -8
  215. package/lib/components/eftposPay/windcave/pwd.js +0 -143
  216. package/lib/components/eftposPay/windcave/receipet.d.ts +0 -6
  217. package/lib/components/eftposPay/windcave/receipet.js +0 -93
  218. package/lib/components/eftposPay/windcave/wait.d.ts +0 -12
  219. package/lib/components/eftposPay/windcave/wait.js +0 -163
@@ -0,0 +1,85 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ 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."); }
3
+ 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); }
4
+ 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; }
5
+ 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; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import React, { useEffect, useRef, useState } from 'react';
8
+ import { useTyro } from "./hooks";
9
+ export default function Log(_ref) {
10
+ var device = _ref.device,
11
+ type = _ref.type,
12
+ tyroUrl = _ref.tyroUrl,
13
+ tyroVersion = _ref.tyroVersion;
14
+ var _useTyro = useTyro({
15
+ url: tyroUrl,
16
+ version: tyroVersion
17
+ }),
18
+ _useTyro2 = _slicedToArray(_useTyro, 2),
19
+ TyroRef = _useTyro2[0],
20
+ load = _useTyro2[1];
21
+ var iClientRef = useRef();
22
+ var _useState = useState(''),
23
+ _useState2 = _slicedToArray(_useState, 2),
24
+ src = _useState2[0],
25
+ setSrc = _useState2[1];
26
+ useEffect(function () {
27
+ if (load && TyroRef.current) {
28
+ var _IClient = TyroRef.current.IClient;
29
+ var _device$config = device.config,
30
+ apiKey = _device$config.apiKey,
31
+ posProductData = _device$config.posProductData;
32
+ var iclient = new _IClient(apiKey, posProductData);
33
+ iClientRef.current = iclient;
34
+ getTerminalInfo(function () {
35
+ var src = (tyroUrl || 'https://iclientsimulator.test.tyro.com') + '/logs.html';
36
+ setSrc(src);
37
+ });
38
+ }
39
+ }, [load]);
40
+
41
+ /**
42
+ * @title: 获取设备信息
43
+ * @description: 获取设备信息
44
+ * @param {function} cb
45
+ * @Author: hongbing.wang
46
+ * @Date: 2024-08-19 11:32
47
+ */
48
+ var getTerminalInfo = function getTerminalInfo(cb) {
49
+ var iClient = iClientRef.current;
50
+ if (!iClient) {
51
+ return;
52
+ }
53
+ var integrationKey = device.integrationKey,
54
+ tid = device.tid,
55
+ mid = device.mid;
56
+ iClient.terminalInfo(function (_ref2) {
57
+ var status = _ref2.status,
58
+ message = _ref2.message,
59
+ terminalInfo = _ref2.terminalInfo;
60
+ if (status === 'success') {
61
+ cb(status, message, terminalInfo);
62
+ }
63
+ }, {
64
+ mid: mid,
65
+ tid: tid,
66
+ integrationKey: integrationKey
67
+ });
68
+ };
69
+ useEffect(function () {
70
+ console.log(device);
71
+ }, [device]);
72
+ return /*#__PURE__*/React.createElement("div", {
73
+ style: {
74
+ flex: 1,
75
+ height: '100%'
76
+ }
77
+ }, src ? /*#__PURE__*/React.createElement("iframe", {
78
+ src: src,
79
+ style: {
80
+ width: '100%',
81
+ height: '100%',
82
+ border: 'none'
83
+ }
84
+ }) : null);
85
+ }
@@ -5,5 +5,5 @@ interface PosProps {
5
5
  formItemList: any[];
6
6
  onSave: (device: DeviceProp) => void;
7
7
  }
8
- declare const PosForm: ({ eftposName, onSave, formItemList }: PosProps) => React.JSX.Element;
8
+ declare const PosForm: ({ onSave, formItemList }: PosProps) => React.JSX.Element;
9
9
  export default PosForm;
@@ -5,8 +5,7 @@ import { locales } from "@pisell/utils";
5
5
  import FormItem from "./form";
6
6
  var Title = Typography.Title;
7
7
  var PosForm = function PosForm(_ref) {
8
- var eftposName = _ref.eftposName,
9
- onSave = _ref.onSave,
8
+ var onSave = _ref.onSave,
10
9
  formItemList = _ref.formItemList;
11
10
  var initialValues = getDefaultValue(formItemList);
12
11
  return /*#__PURE__*/React.createElement("div", {
@@ -14,11 +13,12 @@ var PosForm = function PosForm(_ref) {
14
13
  }, /*#__PURE__*/React.createElement(Title, {
15
14
  level: 4,
16
15
  className: "pisell-lowcode__pos-title"
17
- }, eftposName, " Apikey"), /*#__PURE__*/React.createElement(Form, {
16
+ }, locales.getText('page.eftpos.text.setting')), /*#__PURE__*/React.createElement(Form, {
18
17
  layout: "vertical",
19
18
  onFinish: onSave,
20
19
  initialValues: initialValues,
21
- className: "pisell-lowcode__pos-form"
20
+ className: "pisell-lowcode__pos-form",
21
+ key: formItemList
22
22
  }, /*#__PURE__*/React.createElement("div", {
23
23
  className: "pisell-lowcode__pos-form-content"
24
24
  }, /*#__PURE__*/React.createElement(FormItem, {
@@ -27,7 +27,10 @@ var PosForm = function PosForm(_ref) {
27
27
  className: "pisell-lowcode__pos-form-btn"
28
28
  }, /*#__PURE__*/React.createElement(Form.Item, null, /*#__PURE__*/React.createElement(Button, {
29
29
  htmlType: "submit",
30
- block: true
30
+ block: true,
31
+ style: {
32
+ height: '48px'
33
+ }
31
34
  }, locales.getText("page.eftpos.text.save"))))));
32
35
  };
33
36
  export default PosForm;
@@ -1,8 +1,31 @@
1
- import React from "react";
2
- import "./index.css";
1
+ import React from 'react';
2
+ import './index.css';
3
+ /**
4
+ * @title: 自定义组件设置
5
+ * @description: 自定义组件设置
6
+ * @param {any} commConfig 当前组件配置
7
+ * @param {string} name 上游name(用于嵌套 xxx:{yyy:''})
8
+ * @return {*}
9
+ * @Author: hongbing.wang
10
+ * @Date: 2024-08-20 11:10
11
+ */
3
12
  export declare const getCommName: (commConfig: any, name: string[]) => any;
13
+ /**
14
+ * @title: 自定义组件结果设置
15
+ * @description: 自定义组件结果设置
16
+ * @param {any} commConfig 当前组件配置
17
+ * @return {*}
18
+ * @Author: hongbing.wang
19
+ * @Date: 2024-08-20 11:11
20
+ */
4
21
  export declare const getCommDefaultVal: (commConfig: any) => {
5
22
  [x: number]: any;
6
23
  };
24
+ /**
25
+ * @title: 自定义表单
26
+ * @description: 若干 antd 组件不能满足需求 则可以创建自定义组件
27
+ * @Author: hongbing.wang
28
+ * @Date: 2024-08-20 13:22
29
+ */
7
30
  declare const _default: (props: any) => React.JSX.Element;
8
31
  export default _default;
@@ -1,4 +1,5 @@
1
- var _excluded = ["label", "value"];
1
+ var _excluded = ["label", "value"],
2
+ _excluded2 = ["label", "value"];
2
3
  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); }
3
4
  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; }
4
5
  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; }
@@ -16,64 +17,145 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
16
17
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
17
18
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
18
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; }
19
- import { Form, Space, Radio, InputNumber } from "antd";
20
- import React, { useState, useRef } from "react";
20
+ import { Form, Space, Radio, InputNumber } from 'antd';
21
+ import React, { useState, useRef } from 'react';
21
22
  import useEngineContext from "../../../hooks/useEngineContext";
22
23
  import "./index.css";
24
+
25
+ /**
26
+ * @title: 自定义组件设置
27
+ * @description: 自定义组件设置
28
+ * @param {any} commConfig 当前组件配置
29
+ * @param {string} name 上游name(用于嵌套 xxx:{yyy:''})
30
+ * @return {*}
31
+ * @Author: hongbing.wang
32
+ * @Date: 2024-08-20 11:10
33
+ */
23
34
  export var getCommName = function getCommName(commConfig, name) {
35
+ commConfig.origin.__sourceName = commConfig.origin.name;
24
36
  commConfig.top.__sourceName = commConfig.top.name;
25
37
  commConfig.left.__sourceName = commConfig.left.name;
26
38
  commConfig.right.__sourceName = commConfig.right.name;
39
+ commConfig.origin.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.origin.name]) : commConfig.origin.name;
27
40
  commConfig.top.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.top.name]) : commConfig.top.name;
28
41
  commConfig.left.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.left.name]) : commConfig.left.name;
29
42
  commConfig.right.name = name.length > 0 ? [].concat(_toConsumableArray(name), [commConfig.right.name]) : commConfig.right.name;
30
43
  return commConfig;
31
44
  };
45
+
46
+ /**
47
+ * @title: 自定义组件结果设置
48
+ * @description: 自定义组件结果设置
49
+ * @param {any} commConfig 当前组件配置
50
+ * @return {*}
51
+ * @Author: hongbing.wang
52
+ * @Date: 2024-08-20 11:11
53
+ */
32
54
  export var getCommDefaultVal = function getCommDefaultVal(commConfig) {
33
55
  var _ref;
34
56
  var top = commConfig.top.input.defaultValue;
35
- return _ref = {}, _defineProperty(_ref, commConfig.top.__sourceName, typeof top === "undefined" ? true : top), _defineProperty(_ref, commConfig.left.__sourceName, commConfig.left.input.defaultValue || 0), _defineProperty(_ref, commConfig.right.__sourceName, commConfig.right.input.defaultValue || 0), _ref;
57
+ var origin = commConfig.origin.input.defaultValue;
58
+ return _ref = {}, _defineProperty(_ref, commConfig.origin.__sourceName, typeof origin === 'undefined' ? true : origin), _defineProperty(_ref, commConfig.top.__sourceName, typeof top === 'undefined' ? true : top), _defineProperty(_ref, commConfig.left.__sourceName, commConfig.left.input.defaultValue || 0), _defineProperty(_ref, commConfig.right.__sourceName, commConfig.right.input.defaultValue || 0), _ref;
36
59
  };
60
+
61
+ /**
62
+ * @title: 自定义表单
63
+ * @description: 若干 antd 组件不能满足需求 则可以创建自定义组件
64
+ * @Author: hongbing.wang
65
+ * @Date: 2024-08-20 13:22
66
+ */
37
67
  export default (function (props) {
38
68
  var _context$appHelper, _store$getState, _store$getState$call, _store$getState$call$;
39
- var top = props.top,
69
+ var origin = props.origin,
70
+ top = props.top,
40
71
  left = props.left,
41
72
  right = props.right;
42
73
  var leftRef = useRef(left.input.default || 0);
43
74
  var rightRef = useRef(right.input.default || 0);
44
- var _useState = useState(top.input.defaultValue),
75
+ var _useState = useState(origin.input.defaultValue),
45
76
  _useState2 = _slicedToArray(_useState, 2),
46
- status = _useState2[0],
47
- setStatus = _useState2[1];
77
+ statusOrigin = _useState2[0],
78
+ setStatusOrigin = _useState2[1];
79
+ var _useState3 = useState(top.input.defaultValue),
80
+ _useState4 = _slicedToArray(_useState3, 2),
81
+ status = _useState4[0],
82
+ setStatus = _useState4[1];
48
83
  var context = useEngineContext();
49
84
  var _ref2 = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
50
85
  store = _ref2.store;
51
- var symbol = (store === null || store === void 0 ? void 0 : (_store$getState = store.getState) === null || _store$getState === void 0 ? void 0 : (_store$getState$call = _store$getState.call(store)) === null || _store$getState$call === void 0 ? void 0 : (_store$getState$call$ = _store$getState$call.global) === null || _store$getState$call$ === void 0 ? void 0 : _store$getState$call$.symbol) || "$";
86
+ var symbol = (store === null || store === void 0 ? void 0 : (_store$getState = store.getState) === null || _store$getState === void 0 ? void 0 : (_store$getState$call = _store$getState.call(store)) === null || _store$getState$call === void 0 ? void 0 : (_store$getState$call$ = _store$getState$call.global) === null || _store$getState$call$ === void 0 ? void 0 : _store$getState$call$.symbol) || '$';
87
+
88
+ /**
89
+ * @title: 是否设置手续费
90
+ * @Author: hongbing.wang
91
+ * @Date: 2024-08-20 11:12
92
+ */
52
93
  var onValueChange = function onValueChange(e) {
53
94
  setStatus(e.target.value);
54
95
  };
96
+
97
+ /**
98
+ * @title: 设置比例手续费
99
+ * @Author: hongbing.wang
100
+ * @Date: 2024-08-20 11:13
101
+ */
55
102
  var onChangeRate = function onChangeRate(val) {
56
103
  leftRef.current = val;
57
104
  };
105
+
106
+ /**
107
+ * @title: 设置固定金额手续费
108
+ * @Author: hongbing.wang
109
+ * @Date: 2024-08-20 11:13
110
+ */
58
111
  var onChangeMoney = function onChangeMoney(val) {
59
112
  rightRef.current = val;
60
113
  };
114
+
115
+ // status : true 使用手续费 展示 手续费 组件; false 不是用手续费 不是展示 手续费 组件
61
116
  return /*#__PURE__*/React.createElement("div", {
62
117
  className: "pisell-lowcode__pos_sur_box"
118
+ }, /*#__PURE__*/React.createElement(Form.Item, {
119
+ label: origin.label,
120
+ name: origin.name,
121
+ rules: origin.rules || [],
122
+ style: origin.style || {}
123
+ }, /*#__PURE__*/React.createElement(Radio.Group, {
124
+ value: origin.input.defaultValue,
125
+ onChange: function onChange(e) {
126
+ setStatusOrigin(e.target.value);
127
+ }
128
+ }, /*#__PURE__*/React.createElement(Space, {
129
+ direction: "vertical"
130
+ }, origin.input.options.map(function (item) {
131
+ if (_typeof(item) === 'object') {
132
+ var label = item.label,
133
+ value = item.value,
134
+ other = _objectWithoutProperties(item, _excluded);
135
+ return /*#__PURE__*/React.createElement(Radio, _extends({}, other, {
136
+ value: value,
137
+ key: "".concat(item.value)
138
+ }), label);
139
+ }
140
+ })))), /*#__PURE__*/React.createElement("div", {
141
+ style: {
142
+ display: statusOrigin ? 'none' : 'contents'
143
+ }
63
144
  }, /*#__PURE__*/React.createElement(Form.Item, {
64
145
  label: top.label,
65
146
  name: top.name,
66
- rules: top.rules || []
147
+ rules: top.rules || [],
148
+ style: top.style || {}
67
149
  }, /*#__PURE__*/React.createElement(Radio.Group, {
68
150
  value: top.input.defaultValue,
69
151
  onChange: onValueChange
70
152
  }, /*#__PURE__*/React.createElement(Space, {
71
153
  direction: "vertical"
72
154
  }, top.input.options.map(function (item) {
73
- if (_typeof(item) === "object") {
155
+ if (_typeof(item) === 'object') {
74
156
  var label = item.label,
75
157
  value = item.value,
76
- other = _objectWithoutProperties(item, _excluded);
158
+ other = _objectWithoutProperties(item, _excluded2);
77
159
  return /*#__PURE__*/React.createElement(Radio, _extends({}, other, {
78
160
  value: value,
79
161
  key: "".concat(item.value)
@@ -84,12 +166,13 @@ export default (function (props) {
84
166
  }, /*#__PURE__*/React.createElement(Form.Item, {
85
167
  label: left.label,
86
168
  name: left.name,
87
- rules: left.rules || []
169
+ rules: left.rules || [],
170
+ style: left.style || {}
88
171
  }, /*#__PURE__*/React.createElement(InputNumber, {
89
172
  min: 0,
90
173
  max: 100,
91
174
  precision: 2,
92
- addonAfter: "%",
175
+ addonAfter: '%',
93
176
  controls: false,
94
177
  defaultValue: leftRef.current,
95
178
  onChange: onChangeRate
@@ -98,7 +181,8 @@ export default (function (props) {
98
181
  }, /*#__PURE__*/React.createElement(Form.Item, {
99
182
  label: right.label,
100
183
  name: right.name,
101
- rules: right.rules || []
184
+ rules: right.rules || [],
185
+ style: right.style || {}
102
186
  }, /*#__PURE__*/React.createElement(InputNumber, {
103
187
  min: 0,
104
188
  max: 100000,
@@ -107,5 +191,5 @@ export default (function (props) {
107
191
  controls: false,
108
192
  defaultValue: rightRef.current,
109
193
  onChange: onChangeMoney
110
- })))) : null);
194
+ })))) : null));
111
195
  });
@@ -13,5 +13,9 @@ declare const _default: React.ForwardRefExoticComponent<{
13
13
  onEdit: (device?: DeviceProp | undefined) => void;
14
14
  onDel: (id: string | number) => Promise<any>;
15
15
  onRepair: (device: DeviceProp) => void;
16
+ onLog: (device: DeviceProp) => void;
17
+ useTyroLog?: boolean | undefined;
18
+ systemConfigStatus?: boolean | undefined;
19
+ onClickByTip: () => void;
16
20
  } & React.RefAttributes<unknown>>;
17
21
  export default _default;
@@ -1,6 +1,7 @@
1
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
2
  var _excluded = ["connection", "setting"],
3
- _excluded2 = ["connection", "setting"];
3
+ _excluded2 = ["connection", "setting"],
4
+ _excluded3 = ["connection", "setting"];
4
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; }
5
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; }
6
7
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
@@ -18,7 +19,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
18
19
  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; } }
19
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
20
21
  import React, { useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
21
- import { Space, Typography, Table, Modal, Button, Pagination } from 'antd';
22
+ import { Space, Typography, Table, Modal, Button, Pagination, Alert } from 'antd';
22
23
  import XClose from '@pisell/icon/es/XClose';
23
24
  import { locales } from '@pisell/utils';
24
25
  var Column = Table.Column;
@@ -32,12 +33,21 @@ var App = function App(_ref, ref) {
32
33
  onEdit = _ref.onEdit,
33
34
  onDel = _ref.onDel,
34
35
  onRepair = _ref.onRepair,
35
- style = _ref.style;
36
+ onLog = _ref.onLog,
37
+ style = _ref.style,
38
+ useTyroLog = _ref.useTyroLog,
39
+ systemConfigStatus = _ref.systemConfigStatus,
40
+ onClickByTip = _ref.onClickByTip;
41
+ /**
42
+ * @title: 设置table 列宽
43
+ * @Author: hongbing.wang
44
+ * @Date: 2024-08-20 11:26
45
+ */
36
46
  var size = useMemo(function () {
37
47
  if (Array.isArray(tableSize)) {
38
- return [tableSize[0] || 200, tableSize[1] || 120, tableSize[2] || 120, tableSize[3] || 240];
48
+ return [tableSize[0] || 200, tableSize[1] || 120, tableSize[2] || 120, tableSize[3] || 260];
39
49
  }
40
- return [200, 120, 120, 240];
50
+ return [200, 120, 120, 260];
41
51
  }, [tableSize]);
42
52
  var totalSize = useMemo(function () {
43
53
  return size.reduce(function (accumulator, currentValue) {
@@ -65,6 +75,14 @@ var App = function App(_ref, ref) {
65
75
  _useState8 = _slicedToArray(_useState7, 2),
66
76
  data = _useState8[0],
67
77
  setData = _useState8[1];
78
+
79
+ /**
80
+ * @title: 加载列表数据
81
+ * @param {number} current 加载页数
82
+ * @return {*}
83
+ * @Author: hongbing.wang
84
+ * @Date: 2024-08-20 11:25
85
+ */
68
86
  var loadData = /*#__PURE__*/function () {
69
87
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(current) {
70
88
  var res;
@@ -106,31 +124,86 @@ var App = function App(_ref, ref) {
106
124
  return _ref2.apply(this, arguments);
107
125
  };
108
126
  }();
127
+
128
+ /**
129
+ * @title: 初始化加载页面
130
+ * @Author: hongbing.wang
131
+ * @Date: 2024-08-20 11:25
132
+ */
109
133
  useEffect(function () {
110
134
  loadData(1);
111
135
  }, []);
112
136
  var onAddDevice = function onAddDevice() {
113
137
  onEdit();
114
138
  };
139
+
140
+ /**
141
+ * @title: 编辑设备
142
+ * @param {any} device 设备信息
143
+ * @Author: hongbing.wang
144
+ * @Date: 2024-08-20 11:26
145
+ */
115
146
  var onEditDevice = function onEditDevice(device) {
116
147
  var connection = device.connection,
117
148
  setting = device.setting,
118
149
  other = _objectWithoutProperties(device, _excluded);
119
150
  onEdit(_objectSpread(_objectSpread(_objectSpread({}, other), connection || {}), setting || {}));
120
151
  };
152
+
153
+ /**
154
+ * @title: 重连设备
155
+ * @param {any} device 设备信息
156
+ * @Author: hongbing.wang
157
+ * @Date: 2024-08-20 11:26
158
+ */
121
159
  var onRepairDevice = function onRepairDevice(device) {
122
160
  var connection = device.connection,
123
161
  setting = device.setting,
124
162
  other = _objectWithoutProperties(device, _excluded2);
125
163
  onRepair(_objectSpread(_objectSpread(_objectSpread({}, other), connection || {}), setting || {}));
126
164
  };
127
- var onDelDevice = function onDelDevice(record) {
128
- deviceRef.current = record.id;
165
+
166
+ /**
167
+ * @title: 重连设备
168
+ * @param {any} device 设备信息
169
+ * @Author: hongbing.wang
170
+ * @Date: 2024-08-20 11:26
171
+ */
172
+ var onLogDevice = function onLogDevice(device) {
173
+ var connection = device.connection,
174
+ setting = device.setting,
175
+ other = _objectWithoutProperties(device, _excluded3);
176
+ onLog(_objectSpread(_objectSpread(_objectSpread({}, other), connection || {}), setting || {}));
177
+ };
178
+
179
+ /**
180
+ * @title: 删除设备信息
181
+ * @param {any} device 设备信息
182
+ * @Author: hongbing.wang
183
+ * @Date: 2024-08-20 11:27
184
+ */
185
+ var onDelDevice = function onDelDevice(device) {
186
+ deviceRef.current = device.id;
129
187
  setModalOpen(true);
130
188
  };
189
+
190
+ /**
191
+ * @title: 分页加载
192
+ * @param {number} num 加载页数
193
+ * @return {*}
194
+ * @Author: hongbing.wang
195
+ * @Date: 2024-08-20 11:27
196
+ */
131
197
  var onChangeSize = function onChangeSize(num) {
132
198
  loadData(num);
133
199
  };
200
+
201
+ /**
202
+ * @title: 删除确认按钮
203
+ * @description: 删除完成重新加载数据
204
+ * @Author: hongbing.wang
205
+ * @Date: 2024-08-20 11:28
206
+ */
134
207
  var onOk = function onOk() {
135
208
  setModalOpen(false);
136
209
  if (deviceRef.current) {
@@ -147,7 +220,18 @@ var App = function App(_ref, ref) {
147
220
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
148
221
  className: "pisell-lowcode__pos-table",
149
222
  style: _objectSpread({}, style || {})
150
- }, /*#__PURE__*/React.createElement(Title, {
223
+ }, type === 'windcave' && !systemConfigStatus ? /*#__PURE__*/React.createElement(Alert, {
224
+ message: locales.getText('page.eftpos.text.setting.tip'),
225
+ type: "error",
226
+ style: {
227
+ margin: '10px 0 0 0'
228
+ },
229
+ action: /*#__PURE__*/React.createElement(Button, {
230
+ size: "small",
231
+ type: "text",
232
+ onClick: onClickByTip
233
+ }, locales.getText('page.eftpos.text.setting.btn'))
234
+ }) : null, /*#__PURE__*/React.createElement(Title, {
151
235
  level: 4,
152
236
  className: "pisell-lowcode__pos-title"
153
237
  }, eftposName, " ", locales.getText('page.eftpos.text.device')), /*#__PURE__*/React.createElement("div", {
@@ -166,7 +250,7 @@ var App = function App(_ref, ref) {
166
250
  bordered: true,
167
251
  scroll: {
168
252
  y: '600px',
169
- x: totalSize + 'px'
253
+ x: '100%'
170
254
  },
171
255
  tableLayout: "fixed"
172
256
  }, /*#__PURE__*/React.createElement(Column, {
@@ -193,6 +277,9 @@ var App = function App(_ref, ref) {
193
277
  if (!setting) {
194
278
  return /*#__PURE__*/React.createElement(Text, null, "-");
195
279
  }
280
+ if (setting.useOriginSurcharge) {
281
+ return /*#__PURE__*/React.createElement(Text, null, "-");
282
+ }
196
283
  var array = [setting.constant_rate ? setting.constant_rate + '%' : '', setting.constant_money].filter(Boolean);
197
284
  if (array.length === 0) {
198
285
  return /*#__PURE__*/React.createElement(Text, null, "-");
@@ -213,7 +300,12 @@ var App = function App(_ref, ref) {
213
300
  onClick: function onClick() {
214
301
  return onRepairDevice(record);
215
302
  }
216
- }, locales.getText('page.eftpos.text.repair')), /*#__PURE__*/React.createElement(Button, {
303
+ }, locales.getText('page.eftpos.text.repair')), useTyroLog && type === 'tyro' ? /*#__PURE__*/React.createElement(Button, {
304
+ type: "link",
305
+ onClick: function onClick() {
306
+ return onLogDevice(record);
307
+ }
308
+ }, locales.getText('page.eftpos.text.log')) : null, /*#__PURE__*/React.createElement(Button, {
217
309
  type: "link",
218
310
  onClick: function onClick() {
219
311
  return onEditDevice(record);
@@ -1,5 +1,12 @@
1
1
  import React from 'react';
2
2
  import { PosProps } from './const';
3
+ /**
4
+ * @title: 支付金额信息配置页
5
+ * @description: 配置支付金额与手续费
6
+ * @return React.Element
7
+ * @Author: hongbing.wang
8
+ * @Date: 2024-08-12 11:35
9
+ */
3
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isIpad, net, }: {
4
11
  className?: string | undefined;
5
12
  onChange?: ((status: "page" | "success" | "fail", params?: string | {
@@ -11,4 +18,3 @@ declare const _default: ({ className, onChange, onClose, formatAmount, isIpad, n
11
18
  net: boolean;
12
19
  }) => React.JSX.Element;
13
20
  export default _default;
14
- export declare const limitDecimals: (value: any) => any;