@pisell/private-materials 6.11.185 → 6.11.186

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.
@@ -26,9 +26,11 @@ import "./index.less";
26
26
  import CompensatedPisellContainer from "../../../pro/compensatedPisellContainer";
27
27
  import { withResponsive } from "../../../responsive";
28
28
  var AddClient = /*#__PURE__*/forwardRef(function (props, ref) {
29
- var _context$appHelper;
29
+ var _context$appHelper, _context$appHelper2;
30
30
  var context = useEngineContext();
31
- request.setRequest((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.request);
31
+ var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
32
+ sendWarningLog = _ref.sendWarningLog;
33
+ request.setRequest((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.utils) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.request);
32
34
  var onChange = props.onChange,
33
35
  phone = props.phone,
34
36
  containerProps = props.containerProps,
@@ -55,6 +57,22 @@ var AddClient = /*#__PURE__*/forwardRef(function (props, ref) {
55
57
  });
56
58
  var _addClient = useRequest(addCustomer, {
57
59
  manual: true,
60
+ onBefore: function onBefore(params) {
61
+ try {
62
+ sendWarningLog === null || sendWarningLog === void 0 || sendWarningLog({
63
+ title: 'Add Client',
64
+ content: [{
65
+ key: 'time',
66
+ value: Date.now()
67
+ }, {
68
+ key: 'data',
69
+ value: JSON.stringify(params)
70
+ }]
71
+ });
72
+ } catch (error) {
73
+ console.error(error);
74
+ }
75
+ },
58
76
  onSuccess: function onSuccess(res, param) {
59
77
  var _param$;
60
78
  onChange(_objectSpread(_objectSpread({}, (_param$ = param[0]) === null || _param$ === void 0 ? void 0 : _param$.customer), {}, {
@@ -45,9 +45,12 @@ var import_index = require("./index.less");
45
45
  var import_compensatedPisellContainer = __toESM(require("../../../pro/compensatedPisellContainer"));
46
46
  var import_responsive = require("../../../responsive");
47
47
  var AddClient = (0, import_react.forwardRef)((props, ref) => {
48
- var _a, _b;
48
+ var _a, _b, _c;
49
49
  const context = (0, import_useEngineContext.default)();
50
- import_utils2.request.setRequest((_b = (_a = context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.request);
50
+ const {
51
+ sendWarningLog
52
+ } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
53
+ import_utils2.request.setRequest((_c = (_b = context.appHelper) == null ? void 0 : _b.utils) == null ? void 0 : _c.request);
51
54
  const { onChange, phone, containerProps, variant } = props;
52
55
  const isPhoneVariant = variant === "phone";
53
56
  const [form] = import_antd.Form.useForm();
@@ -62,6 +65,19 @@ var AddClient = (0, import_react.forwardRef)((props, ref) => {
62
65
  }));
63
66
  const _addClient = (0, import_ahooks.useRequest)(import_serve.addCustomer, {
64
67
  manual: true,
68
+ onBefore: (params) => {
69
+ try {
70
+ sendWarningLog == null ? void 0 : sendWarningLog({
71
+ title: "Add Client",
72
+ content: [
73
+ { key: "time", value: Date.now() },
74
+ { key: "data", value: JSON.stringify(params) }
75
+ ]
76
+ });
77
+ } catch (error) {
78
+ console.error(error);
79
+ }
80
+ },
65
81
  onSuccess: (res, param) => {
66
82
  var _a2;
67
83
  onChange({ ...(_a2 = param[0]) == null ? void 0 : _a2.customer, id: res.customer_id }, useIsChecked);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.11.185",
3
+ "version": "6.11.186",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -67,8 +67,8 @@
67
67
  "react-infinite-scroll-component": "^6.1.0",
68
68
  "react-resizable": "^3.0.5",
69
69
  "styled-components": "^6.0.0-rc.3",
70
- "@pisell/utils": "3.0.2",
71
70
  "@pisell/materials": "6.11.58",
71
+ "@pisell/utils": "3.0.2",
72
72
  "@pisell/date-picker": "3.0.8",
73
73
  "@pisell/icon": "0.0.11"
74
74
  },