@pisell/private-materials 6.2.1 → 6.2.3

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 (37) 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 +13 -13
  7. package/build/lowcode/render/default/view.js +1 -1
  8. package/build/lowcode/view.js +8 -8
  9. package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
  10. package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  11. package/es/components/booking/info/index.d.ts +1 -0
  12. package/es/components/booking/info/service/Lists.d.ts +1 -0
  13. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  14. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  15. package/es/components/booking/info/service2/utils.d.ts +1 -1
  16. package/es/components/booking/info2/index.js +31 -5
  17. package/es/components/booking/materiels/holder/index.d.ts +1 -0
  18. package/es/components/eftposPay/hooks.d.ts +2 -2
  19. package/es/components/eftposPay/store/index.d.ts +4 -4
  20. package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
  21. package/es/components/schedules/utils.d.ts +1 -1
  22. package/es/utils/index.d.ts +1 -1
  23. package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
  24. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
  25. package/lib/components/booking/info/index.d.ts +1 -0
  26. package/lib/components/booking/info/service/Lists.d.ts +1 -0
  27. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  28. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  29. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  30. package/lib/components/booking/info2/index.js +37 -7
  31. package/lib/components/booking/materiels/holder/index.d.ts +1 -0
  32. package/lib/components/eftposPay/hooks.d.ts +2 -2
  33. package/lib/components/eftposPay/store/index.d.ts +4 -4
  34. package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
  35. package/lib/components/schedules/utils.d.ts +1 -1
  36. package/lib/utils/index.d.ts +1 -1
  37. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface AddServiceVariantProps {
2
3
  globalState: any;
3
4
  setGlobalState: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { EditServiceRef } from "../service/editService";
2
3
  declare const useInfoHolder: (state: any, dispatch: any) => {
3
4
  detailRef: import("react").MutableRefObject<EditServiceRef | undefined>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { InfoProps } from './main';
2
3
  declare const APP: (props: InfoProps) => JSX.Element;
3
4
  export default APP;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
2
3
  export default Lists;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const BookingList: ({ items }: {
2
3
  items: any[];
3
4
  }) => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
2
3
  export default Lists;
@@ -244,4 +244,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
244
244
  * @Author: WangHan
245
245
  * @Date: 2024-12-24 11:32
246
246
  */
247
- export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
247
+ export declare const updateServicePrice: (state: any) => Promise<any> | never[];
@@ -20,6 +20,7 @@ import Header from "../info/header";
20
20
  import localeTexts from "../locales";
21
21
  import { locales } from '@pisell/utils';
22
22
  import ReloadResourceModal from "../components/reloadResourceModal";
23
+ import { sendWarningLog } from '@pisell/utils';
23
24
  import { findNextDuration, flexibleObj, sliceDayIntoFiveMinutes, request } from "../utils";
24
25
  import { formatResource } from "./utilsByBooking";
25
26
  import { getErrorList } from "./utilsByBooking";
@@ -179,8 +180,22 @@ var Info = Provider(function (props) {
179
180
  }));
180
181
  case 3:
181
182
  data = _context.sent;
182
- data.date = currentDate;
183
- localStorage.setItem('bookingResourceList', JSON.stringify(data));
183
+ try {
184
+ data.date = currentDate;
185
+ localStorage.setItem('bookingResourceList', JSON.stringify(data));
186
+ } catch (error) {
187
+ sendWarningLog({
188
+ title: "\u8BBE\u7F6E\u8D44\u6E90\u5931\u8D25",
189
+ content: [{
190
+ key: 'error',
191
+ value: JSON.stringify({
192
+ message: error === null || error === void 0 ? void 0 : error.message,
193
+ stack: error === null || error === void 0 ? void 0 : error.stack,
194
+ name: error === null || error === void 0 ? void 0 : error.name
195
+ })
196
+ }]
197
+ });
198
+ }
184
199
  modal.dispatch({
185
200
  type: 'setService',
186
201
  payload: _objectSpread(_objectSpread({}, stateRef.current.service), {}, {
@@ -192,9 +207,20 @@ var Info = Provider(function (props) {
192
207
  resolve(data);
193
208
  _context.next = 14;
194
209
  break;
195
- case 10:
196
- _context.prev = 10;
210
+ case 9:
211
+ _context.prev = 9;
197
212
  _context.t0 = _context["catch"](0);
213
+ sendWarningLog({
214
+ title: "\u83B7\u53D6\u8D44\u6E90\u5931\u8D25",
215
+ content: [{
216
+ key: 'error',
217
+ value: JSON.stringify({
218
+ message: _context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message,
219
+ stack: _context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.stack,
220
+ name: _context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.name
221
+ })
222
+ }]
223
+ });
198
224
  modal.dispatch({
199
225
  type: 'setService',
200
226
  payload: _objectSpread(_objectSpread({}, stateRef.current.service), {}, {
@@ -206,7 +232,7 @@ var Info = Provider(function (props) {
206
232
  case "end":
207
233
  return _context.stop();
208
234
  }
209
- }, _callee, null, [[0, 10]]);
235
+ }, _callee, null, [[0, 9]]);
210
236
  })), timeoutNumber);
211
237
  }));
212
238
  case 4:
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SelectProps } from 'antd';
2
3
  interface HolderProps extends SelectProps {
3
4
  selectProps?: SelectProps;
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
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<"stripe" | "tyro" | "windcave" | "payo" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
174
174
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
175
175
  type: EActionTypes;
176
176
  payload: {
177
- status: "loading" | "success" | "warn" | "fail" | "question";
177
+ status: "success" | "loading" | "warn" | "fail" | "question";
178
178
  };
179
179
  };
180
180
  /**
@@ -297,18 +297,18 @@ 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?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
300
+ eftpos?: "tyro" | "windcave" | "stripe" | "payo" | "linkly" | undefined;
301
301
  action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
305
305
  subTitle?: string | undefined;
306
- type?: "step" | "unset" | undefined;
306
+ type?: "unset" | "step" | undefined;
307
307
  render?: boolean | undefined;
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
310
310
  form?: string | undefined;
311
- status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
311
+ status?: "success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
312
312
  warn?: string | undefined;
313
313
  steps?: {
314
314
  /** 用于重置当前步骤 */
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface InfoProps {
2
3
  relation_id: any;
3
4
  action: any;
@@ -17,6 +17,6 @@ declare let modal: Omit<ModalStaticFunctions, "warn">;
17
17
  export declare const setModal: (m: Omit<ModalStaticFunctions, "warn">) => void;
18
18
  export declare const saveConfirm: () => Promise<{
19
19
  destroy: () => void;
20
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
20
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
21
21
  }>;
22
22
  export { modal };
@@ -18,6 +18,6 @@ declare let modal: Omit<ModalStaticFunctions, 'warn'>;
18
18
  export declare const setModal: (m: Omit<ModalStaticFunctions, 'warn'>) => void;
19
19
  export declare const saveConfirm: () => Promise<{
20
20
  destroy: () => void;
21
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
21
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
22
22
  }>;
23
23
  export { modal };
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  interface AddServiceVariantProps {
2
3
  globalState: any;
3
4
  setGlobalState: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { EditServiceRef } from "../service/editService";
2
3
  declare const useInfoHolder: (state: any, dispatch: any) => {
3
4
  detailRef: import("react").MutableRefObject<EditServiceRef | undefined>;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { InfoProps } from './main';
2
3
  declare const APP: (props: InfoProps) => JSX.Element;
3
4
  export default APP;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange, onAction, isParallelResource }: any) => JSX.Element;
2
3
  export default Lists;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const BookingList: ({ items }: {
2
3
  items: any[];
3
4
  }) => JSX.Element;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Lists: ({ onEdit, onChange }: any) => JSX.Element;
2
3
  export default Lists;
@@ -244,4 +244,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
244
244
  * @Author: WangHan
245
245
  * @Date: 2024-12-24 11:32
246
246
  */
247
- export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
247
+ export declare const updateServicePrice: (state: any) => Promise<any> | never[];
@@ -45,7 +45,8 @@ var import_header = __toESM(require("../info/header"));
45
45
  var import_locales = __toESM(require("../locales"));
46
46
  var import_utils = require("@pisell/utils");
47
47
  var import_reloadResourceModal = __toESM(require("../components/reloadResourceModal"));
48
- var import_utils2 = require("../utils");
48
+ var import_utils2 = require("@pisell/utils");
49
+ var import_utils3 = require("../utils");
49
50
  var import_utilsByBooking = require("./utilsByBooking");
50
51
  var import_utilsByBooking2 = require("./utilsByBooking");
51
52
  var import_serve = require("./serve");
@@ -71,7 +72,7 @@ var Info = (0, import_model.Provider)((props) => {
71
72
  const { style, globalState, modules = defaultModules, slot } = props;
72
73
  const modal = (0, import_react.useContext)(import_model.Context);
73
74
  const context = (0, import_useEngineContext.default)();
74
- import_utils2.request.setRequest(context.appHelper.utils.request);
75
+ import_utils3.request.setRequest(context.appHelper.utils.request);
75
76
  const params = (0, import_react.useMemo)(() => {
76
77
  var _a2, _b2, _c2, _d2;
77
78
  return ((_d2 = (_c2 = (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.bookingConfig) == null ? void 0 : _b2.config) == null ? void 0 : _c2.basic) == null ? void 0 : _d2.appointment_subject) || {};
@@ -86,9 +87,9 @@ var Info = (0, import_model.Provider)((props) => {
86
87
  bookingFunctions: {
87
88
  formatResource: import_utilsByBooking.formatResource,
88
89
  getErrorList: import_utilsByBooking2.getErrorList,
89
- sliceDayIntoFiveMinutes: import_utils2.sliceDayIntoFiveMinutes,
90
- findNextDuration: import_utils2.findNextDuration,
91
- flexibleObj: import_utils2.flexibleObj,
90
+ sliceDayIntoFiveMinutes: import_utils3.sliceDayIntoFiveMinutes,
91
+ findNextDuration: import_utils3.findNextDuration,
92
+ flexibleObj: import_utils3.flexibleObj,
92
93
  updateServiceDate: import_date2.updateServiceDate
93
94
  }
94
95
  });
@@ -174,8 +175,24 @@ var Info = (0, import_model.Provider)((props) => {
174
175
  },
175
176
  (_d2 = (_c2 = (_b2 = (_a2 = stateRef == null ? void 0 : stateRef.current) == null ? void 0 : _a2.service) == null ? void 0 : _b2.value) == null ? void 0 : _c2.map) == null ? void 0 : _d2.call(_c2, (item) => item == null ? void 0 : item.booking_id)
176
177
  );
177
- data.date = currentDate;
178
- localStorage.setItem("bookingResourceList", JSON.stringify(data));
178
+ try {
179
+ data.date = currentDate;
180
+ localStorage.setItem("bookingResourceList", JSON.stringify(data));
181
+ } catch (error) {
182
+ (0, import_utils2.sendWarningLog)({
183
+ title: `设置资源失败`,
184
+ content: [
185
+ {
186
+ key: "error",
187
+ value: JSON.stringify({
188
+ message: error == null ? void 0 : error.message,
189
+ stack: error == null ? void 0 : error.stack,
190
+ name: error == null ? void 0 : error.name
191
+ })
192
+ }
193
+ ]
194
+ });
195
+ }
179
196
  modal.dispatch({
180
197
  type: "setService",
181
198
  payload: {
@@ -187,6 +204,19 @@ var Info = (0, import_model.Provider)((props) => {
187
204
  });
188
205
  resolve(data);
189
206
  } catch (error) {
207
+ (0, import_utils2.sendWarningLog)({
208
+ title: `获取资源失败`,
209
+ content: [
210
+ {
211
+ key: "error",
212
+ value: JSON.stringify({
213
+ message: error == null ? void 0 : error.message,
214
+ stack: error == null ? void 0 : error.stack,
215
+ name: error == null ? void 0 : error.name
216
+ })
217
+ }
218
+ ]
219
+ });
190
220
  modal.dispatch({
191
221
  type: "setService",
192
222
  payload: {
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { SelectProps } from 'antd';
2
3
  interface HolderProps extends SelectProps {
3
4
  selectProps?: SelectProps;
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
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<"stripe" | "tyro" | "windcave" | "payo" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
174
174
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
175
175
  type: EActionTypes;
176
176
  payload: {
177
- status: "loading" | "success" | "warn" | "fail" | "question";
177
+ status: "success" | "loading" | "warn" | "fail" | "question";
178
178
  };
179
179
  };
180
180
  /**
@@ -297,18 +297,18 @@ 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?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
300
+ eftpos?: "tyro" | "windcave" | "stripe" | "payo" | "linkly" | undefined;
301
301
  action?: "amount" | "pay" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;
305
305
  subTitle?: string | undefined;
306
- type?: "step" | "unset" | undefined;
306
+ type?: "unset" | "step" | undefined;
307
307
  render?: boolean | undefined;
308
308
  net?: boolean | undefined;
309
309
  component?: string | undefined;
310
310
  form?: string | undefined;
311
- status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
311
+ status?: "success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
312
312
  warn?: string | undefined;
313
313
  steps?: {
314
314
  /** 用于重置当前步骤 */
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  export interface InfoProps {
2
3
  relation_id: any;
3
4
  action: any;
@@ -17,6 +17,6 @@ declare let modal: Omit<ModalStaticFunctions, "warn">;
17
17
  export declare const setModal: (m: Omit<ModalStaticFunctions, "warn">) => void;
18
18
  export declare const saveConfirm: () => Promise<{
19
19
  destroy: () => void;
20
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
20
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
21
21
  }>;
22
22
  export { modal };
@@ -18,6 +18,6 @@ declare let modal: Omit<ModalStaticFunctions, 'warn'>;
18
18
  export declare const setModal: (m: Omit<ModalStaticFunctions, 'warn'>) => void;
19
19
  export declare const saveConfirm: () => Promise<{
20
20
  destroy: () => void;
21
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
21
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
22
22
  }>;
23
23
  export { modal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.2.1",
3
+ "version": "6.2.3",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",