@pisell/private-materials 3.0.163 → 3.0.165

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 (128) 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 +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/booking/addons/model.d.ts +2 -1
  12. package/es/components/booking/components/footer/index.js +34 -5
  13. package/es/components/booking/dashboard/index.d.ts +20 -0
  14. package/es/components/booking/dashboard/index.js +298 -0
  15. package/es/components/booking/dashboard/serve.d.ts +1 -0
  16. package/es/components/booking/dashboard/serve.js +27 -0
  17. package/es/components/booking/forms/forms.d.ts +1 -0
  18. package/es/components/booking/forms/forms.js +4 -2
  19. package/es/components/booking/forms/model.d.ts +2 -1
  20. package/es/components/booking/forms/single/index.d.ts +1 -1
  21. package/es/components/booking/forms/single/index.js +4 -3
  22. package/es/components/booking/hooks/useClearCart.d.ts +3 -0
  23. package/es/components/booking/hooks/useClearCart.js +27 -0
  24. package/es/components/booking/hooks/useCreateBookingPageHeader.d.ts +6 -0
  25. package/es/components/booking/hooks/useCreateBookingPageHeader.js +21 -0
  26. package/es/components/booking/info/addServiceVariant/index.d.ts +7 -0
  27. package/es/components/booking/info/addServiceVariant/index.js +42 -0
  28. package/es/components/booking/info/client/index.js +1 -1
  29. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  30. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +4 -2
  31. package/es/components/booking/info/clientVariant/vertical/index.js +6 -5
  32. package/es/components/booking/info/clientVariant/vertical/index.less +8 -0
  33. package/es/components/booking/info/index.less +19 -0
  34. package/es/components/booking/info/main.js +11 -5
  35. package/es/components/booking/info/pet/index.js +1 -1
  36. package/es/components/booking/info/service/addService/index.d.ts +9 -3
  37. package/es/components/booking/info/service/addService/index.js +82 -36
  38. package/es/components/booking/info/service/addService/index.less +27 -1
  39. package/es/components/booking/info/service/editService/index.js +11 -13
  40. package/es/components/booking/info/service/index.js +5 -2
  41. package/es/components/booking/info/service/index.less +18 -0
  42. package/es/components/booking/info/service/serviceItem/index.d.ts +3 -3
  43. package/es/components/booking/info/service/serviceItem/index.js +21 -8
  44. package/es/components/booking/info/service/serviceItem/index.less +8 -0
  45. package/es/components/booking/info/service/serviceList/index.js +20 -1
  46. package/es/components/booking/info2/index.js +9 -3
  47. package/es/components/booking/info2/service/addService/index.d.ts +8 -2
  48. package/es/components/booking/info2/service/addService/index.js +82 -36
  49. package/es/components/booking/info2/service/addTimeModal/index.js +1 -0
  50. package/es/components/booking/info2/service/editService/index.js +11 -4
  51. package/es/components/booking/info2/service/index.js +5 -2
  52. package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -1
  53. package/es/components/booking/info2/service/serviceItem/index.js +16 -3
  54. package/es/components/booking/info2/service/serviceList/index.js +20 -1
  55. package/es/components/booking/info2/utilsByBooking.js +6 -2
  56. package/es/components/booking/locales.d.ts +60 -0
  57. package/es/components/booking/locales.js +63 -3
  58. package/es/components/booking/model.d.ts +2 -0
  59. package/es/components/booking/notes/index.d.ts +1 -1
  60. package/es/components/booking/notes/model.d.ts +2 -1
  61. package/es/components/booking/payments/model.d.ts +2 -1
  62. package/es/components/booking/utils.d.ts +1 -1
  63. package/es/components/booking/utils.js +54 -51
  64. package/es/components/schedules/index.d.ts +1 -1
  65. package/es/components/schedules/model.d.ts +2 -1
  66. package/es/index.d.ts +2 -0
  67. package/es/index.js +3 -1
  68. package/lib/components/booking/addons/model.d.ts +2 -1
  69. package/lib/components/booking/components/footer/index.js +30 -5
  70. package/lib/components/booking/dashboard/index.d.ts +20 -0
  71. package/lib/components/booking/dashboard/index.js +279 -0
  72. package/lib/components/booking/dashboard/serve.d.ts +1 -0
  73. package/lib/components/booking/dashboard/serve.js +33 -0
  74. package/lib/components/booking/forms/forms.d.ts +1 -0
  75. package/lib/components/booking/forms/forms.js +5 -2
  76. package/lib/components/booking/forms/model.d.ts +2 -1
  77. package/lib/components/booking/forms/single/index.d.ts +1 -1
  78. package/lib/components/booking/forms/single/index.js +4 -2
  79. package/lib/components/booking/hooks/useClearCart.d.ts +3 -0
  80. package/lib/components/booking/hooks/useClearCart.js +62 -0
  81. package/lib/components/booking/hooks/useCreateBookingPageHeader.d.ts +6 -0
  82. package/lib/components/booking/hooks/useCreateBookingPageHeader.js +53 -0
  83. package/lib/components/booking/info/addServiceVariant/index.d.ts +7 -0
  84. package/lib/components/booking/info/addServiceVariant/index.js +70 -0
  85. package/lib/components/booking/info/client/index.js +1 -1
  86. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  87. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +4 -2
  88. package/lib/components/booking/info/clientVariant/vertical/index.js +88 -76
  89. package/lib/components/booking/info/clientVariant/vertical/index.less +8 -0
  90. package/lib/components/booking/info/index.less +19 -0
  91. package/lib/components/booking/info/main.js +9 -3
  92. package/lib/components/booking/info/pet/index.js +2 -1
  93. package/lib/components/booking/info/service/addService/index.d.ts +9 -3
  94. package/lib/components/booking/info/service/addService/index.js +66 -29
  95. package/lib/components/booking/info/service/addService/index.less +27 -1
  96. package/lib/components/booking/info/service/editService/index.js +9 -6
  97. package/lib/components/booking/info/service/index.js +4 -2
  98. package/lib/components/booking/info/service/index.less +18 -0
  99. package/lib/components/booking/info/service/serviceItem/index.d.ts +3 -3
  100. package/lib/components/booking/info/service/serviceItem/index.js +14 -1
  101. package/lib/components/booking/info/service/serviceItem/index.less +8 -0
  102. package/lib/components/booking/info/service/serviceList/index.js +18 -1
  103. package/lib/components/booking/info2/index.js +8 -2
  104. package/lib/components/booking/info2/service/addService/index.d.ts +8 -2
  105. package/lib/components/booking/info2/service/addService/index.js +66 -29
  106. package/lib/components/booking/info2/service/addTimeModal/index.js +1 -0
  107. package/lib/components/booking/info2/service/editService/index.js +7 -1
  108. package/lib/components/booking/info2/service/index.js +4 -2
  109. package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -1
  110. package/lib/components/booking/info2/service/serviceItem/index.js +14 -1
  111. package/lib/components/booking/info2/service/serviceList/index.js +18 -1
  112. package/lib/components/booking/info2/utilsByBooking.js +5 -1
  113. package/lib/components/booking/locales.d.ts +60 -0
  114. package/lib/components/booking/locales.js +63 -3
  115. package/lib/components/booking/model.d.ts +2 -0
  116. package/lib/components/booking/notes/index.d.ts +1 -1
  117. package/lib/components/booking/notes/model.d.ts +2 -1
  118. package/lib/components/booking/payments/model.d.ts +2 -1
  119. package/lib/components/booking/utils.d.ts +1 -1
  120. package/lib/components/booking/utils.js +57 -22
  121. package/lib/components/schedules/index.d.ts +1 -1
  122. package/lib/components/schedules/model.d.ts +2 -1
  123. package/lib/index.d.ts +2 -0
  124. package/lib/index.js +6 -0
  125. package/lowcode/booking-dashboard/meta.ts +137 -0
  126. package/lowcode/booking-vertical-add-service/meta.ts +124 -0
  127. package/lowcode/vertical-add-service/meta.ts +71 -0
  128. package/package.json +3 -3
@@ -517,14 +517,35 @@ var Footer = (props) => {
517
517
  import_utils.locales.getText("pisell2.text.refund")
518
518
  );
519
519
  }, []);
520
+ const handleClearAll = () => {
521
+ var _a2;
522
+ (_a2 = state == null ? void 0 : state.clearAllValue) == null ? void 0 : _a2.call(state);
523
+ };
524
+ const clearAllButton = (0, import_react.useMemo)(() => {
525
+ return /* @__PURE__ */ import_react.default.createElement(
526
+ import_antd2.Button,
527
+ {
528
+ className: "pisell-lowcode__booking-footer-buttons-item",
529
+ type: "default",
530
+ onClick: handleClearAll
531
+ },
532
+ import_utils.locales.getText("pisell2.booking.info.text.clear-all")
533
+ );
534
+ }, []);
520
535
  let buttonMap = {
521
536
  checkout: checkoutButton,
522
537
  save: saveButton,
523
538
  complete: completeButton,
524
539
  refund: refundButton,
525
540
  paymentLink: paymentLinkButton,
526
- rebook: rebookButton
541
+ rebook: rebookButton,
542
+ clearAll: clearAllButton
527
543
  };
544
+ const isShowClearAll = (0, import_react.useMemo)(() => {
545
+ if (!state.bookingId) {
546
+ return true;
547
+ }
548
+ }, [state.bookingId]);
528
549
  const isCheckout = (0, import_react.useMemo)(() => {
529
550
  var _a2, _b2, _c2;
530
551
  let list = [
@@ -571,6 +592,9 @@ var Footer = (props) => {
571
592
  }
572
593
  if (source === "info") {
573
594
  let arr = [];
595
+ if (isShowClearAll) {
596
+ arr.push(buttonMap.clearAll);
597
+ }
574
598
  if (isCheckout) {
575
599
  if (!isTeam) {
576
600
  arr.push(buttonMap.checkout);
@@ -602,7 +626,8 @@ var Footer = (props) => {
602
626
  loading,
603
627
  isCheckout,
604
628
  state,
605
- isTeam
629
+ isTeam,
630
+ isShowClearAll
606
631
  ]);
607
632
  const moreButton = (0, import_react.useMemo)(() => {
608
633
  let arr = [];
@@ -622,7 +647,7 @@ var Footer = (props) => {
622
647
  }
623
648
  if (transaction_habit_selection.button_rows == 1) {
624
649
  if (state.appointment_status !== "cancelled") {
625
- if (!state.disabledEdit) {
650
+ if (!state.disabledEdit && !state.isBookingCreatePage) {
626
651
  arr.push(actionMap.sale);
627
652
  }
628
653
  }
@@ -722,7 +747,7 @@ var Footer = (props) => {
722
747
  if (!state.bookingDetail) {
723
748
  return true;
724
749
  }
725
- if (!((_a2 = state.addons) == null ? void 0 : _a2.load) && state.renderType !== "eventBooking") {
750
+ if (!((_a2 = state.addons) == null ? void 0 : _a2.load) && state.renderType !== "eventBooking" && !state.isBookingCreatePage) {
726
751
  return true;
727
752
  }
728
753
  }
@@ -836,7 +861,7 @@ var Footer = (props) => {
836
861
  className: "pisell-lowcode__booking-footer-buttons",
837
862
  style: { marginTop: 12 }
838
863
  },
839
- state.appointment_status !== "cancelled" ? /* @__PURE__ */ import_react.default.createElement(
864
+ state.appointment_status !== "cancelled" && !state.isBookingCreatePage ? /* @__PURE__ */ import_react.default.createElement(
840
865
  import_antd2.Button,
841
866
  {
842
867
  onClick: () => handleSale(),
@@ -0,0 +1,20 @@
1
+ import React from 'react';
2
+ export interface BookingDashboardProps extends React.HTMLAttributes<HTMLDivElement> {
3
+ backgroundColors?: string[];
4
+ labelColor?: string;
5
+ valueColor?: string;
6
+ otherParams?: Record<string, any>;
7
+ refreshKey?: string;
8
+ onDataChange?: (data: {
9
+ groupsOnSiteNow: string | number;
10
+ peopleOnSiteNow: string | number;
11
+ totalVisitorsToday: string | number;
12
+ ongoing: string | number;
13
+ upcoming: string | number;
14
+ overdue: string | number;
15
+ completed: string | number;
16
+ departed: string | number;
17
+ }, dataList: string[]) => void;
18
+ }
19
+ declare const BookingDashboard: (props: BookingDashboardProps) => React.JSX.Element;
20
+ export default BookingDashboard;
@@ -0,0 +1,279 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/booking/dashboard/index.tsx
30
+ var dashboard_exports = {};
31
+ __export(dashboard_exports, {
32
+ default: () => dashboard_default
33
+ });
34
+ module.exports = __toCommonJS(dashboard_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_materials = require("@pisell/materials");
37
+ var import_utils = require("@pisell/utils");
38
+ var import_dayjs = __toESM(require("dayjs"));
39
+ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
40
+ var import_utils2 = require("../utils");
41
+ var import_serve = require("./serve");
42
+ var import_locales = __toESM(require("../locales"));
43
+ var translationOriginal = (text) => "";
44
+ var formatCapacityToChildrenData = (data) => {
45
+ const map = {};
46
+ data.forEach((item) => {
47
+ if (!map[item.id]) {
48
+ map[item.id] = {
49
+ label: !item.id ? import_utils.locales.getText("pisell2.booking.dashboard.default") : translationOriginal(item.name) || "",
50
+ value: 0
51
+ };
52
+ }
53
+ map[item.id].value = (map[item.id].value || 0) + (item.value || 0);
54
+ });
55
+ return Object.values(map).sort((a, b) => b.label.localeCompare(a.label));
56
+ };
57
+ import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
58
+ var BookingDashboard = (props) => {
59
+ const {
60
+ otherParams = {},
61
+ backgroundColors,
62
+ labelColor,
63
+ valueColor,
64
+ refreshKey,
65
+ onDataChange,
66
+ ...others
67
+ } = props;
68
+ const context = (0, import_useEngineContext.default)();
69
+ import_utils2.request.setRequest(context.appHelper.utils.request);
70
+ translationOriginal = context.appHelper.utils.translationOriginal;
71
+ const [data, setData] = (0, import_react.useState)([
72
+ // 当前在场团体
73
+ {
74
+ label: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now"),
75
+ value: "-",
76
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now-tip")
77
+ },
78
+ // 当前在场人数
79
+ {
80
+ label: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now"),
81
+ value: "-",
82
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now-tip")
83
+ },
84
+ // 今日游客总数
85
+ {
86
+ label: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today"),
87
+ value: "-",
88
+ tip: import_utils.locales.getText(
89
+ "pisell2.booking.dashboard.total-visitors-today-tip"
90
+ )
91
+ },
92
+ // 正在进行中的游客
93
+ {
94
+ label: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors"),
95
+ value: "-",
96
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors-tip")
97
+ },
98
+ // 即将到达的游客
99
+ {
100
+ label: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors"),
101
+ value: "-",
102
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors-tip")
103
+ },
104
+ // 超时的游客
105
+ {
106
+ label: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors"),
107
+ value: "-",
108
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors-tip")
109
+ },
110
+ // 已完成的游客
111
+ {
112
+ label: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors"),
113
+ value: "-",
114
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors-tip")
115
+ },
116
+ // 已离场的游客
117
+ {
118
+ label: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors"),
119
+ value: "-",
120
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors-tip")
121
+ }
122
+ ]);
123
+ const [bookingData, setBookingData] = (0, import_react.useState)([]);
124
+ const getData = async () => {
125
+ const data2 = await (0, import_serve.getBookingList)({
126
+ ...otherParams,
127
+ item_type: "appointment_booking",
128
+ parent_id: 0,
129
+ with: ["children"],
130
+ child_booking: 0,
131
+ skip: 1,
132
+ num: 1e3
133
+ });
134
+ setBookingData(data2.list);
135
+ };
136
+ const calcBookingDataCount = (data2) => {
137
+ let groupsOnSiteNow = "-";
138
+ let peopleOnSiteNow = "-";
139
+ let totalVisitorsToday = 0;
140
+ let totalVisitorsTodayChildren = [];
141
+ let ongoing = 0;
142
+ let ongoingChildren = [];
143
+ let upcoming = 0;
144
+ let upcomingChildren = [];
145
+ let overdue = "-";
146
+ let completed = 0;
147
+ let completedChildren = [];
148
+ let departed = "-";
149
+ data2.forEach((item) => {
150
+ if ((0, import_utils.isArr)(item.children)) {
151
+ item.children.forEach((child) => {
152
+ var _a, _b, _c, _d;
153
+ const start = (0, import_dayjs.default)(`${child.start_date} ${child.start_time}`);
154
+ const end = (0, import_dayjs.default)(`${child.end_date} ${child.end_time}`);
155
+ totalVisitorsToday += child.number;
156
+ totalVisitorsTodayChildren.push(...((_a = child.metadata) == null ? void 0 : _a.capacity) || []);
157
+ if (start < (0, import_dayjs.default)() && end > (0, import_dayjs.default)()) {
158
+ ongoing += child.number || 1;
159
+ ongoingChildren.push(...((_b = child.metadata) == null ? void 0 : _b.capacity) || []);
160
+ }
161
+ if ((0, import_dayjs.default)() < start) {
162
+ upcoming += child.number || 1;
163
+ upcomingChildren.push(...((_c = child.metadata) == null ? void 0 : _c.capacity) || []);
164
+ }
165
+ if ((0, import_dayjs.default)() > end) {
166
+ completed += child.number || 1;
167
+ completedChildren.push(...((_d = child.metadata) == null ? void 0 : _d.capacity) || []);
168
+ }
169
+ });
170
+ }
171
+ });
172
+ onDataChange == null ? void 0 : onDataChange(
173
+ {
174
+ groupsOnSiteNow,
175
+ peopleOnSiteNow,
176
+ totalVisitorsToday,
177
+ ongoing,
178
+ upcoming,
179
+ overdue,
180
+ completed,
181
+ departed
182
+ },
183
+ data2
184
+ );
185
+ setData([
186
+ // 当前在场团体
187
+ {
188
+ label: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now"),
189
+ tip: import_utils.locales.getText(
190
+ "pisell2.booking.dashboard.groups-on-site-now-tip"
191
+ ),
192
+ value: `${groupsOnSiteNow}`
193
+ },
194
+ // 当前在场人数
195
+ {
196
+ label: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now"),
197
+ tip: import_utils.locales.getText(
198
+ "pisell2.booking.dashboard.people-on-site-now-tip"
199
+ ),
200
+ value: `${peopleOnSiteNow}`
201
+ },
202
+ // 今日游客总数
203
+ {
204
+ label: import_utils.locales.getText(
205
+ "pisell2.booking.dashboard.total-visitors-today"
206
+ ),
207
+ tip: import_utils.locales.getText(
208
+ "pisell2.booking.dashboard.total-visitors-today-tip"
209
+ ),
210
+ value: `${totalVisitorsToday}`,
211
+ children: formatCapacityToChildrenData(totalVisitorsTodayChildren)
212
+ },
213
+ // 正在进行中的游客
214
+ {
215
+ label: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors"),
216
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors-tip"),
217
+ value: `${ongoing}`,
218
+ children: formatCapacityToChildrenData(ongoingChildren)
219
+ },
220
+ // 即将到达的游客
221
+ {
222
+ label: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors"),
223
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors-tip"),
224
+ value: `${upcoming}`,
225
+ children: formatCapacityToChildrenData(upcomingChildren)
226
+ },
227
+ // 超时的游客
228
+ {
229
+ label: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors"),
230
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors-tip"),
231
+ value: `${overdue}`
232
+ },
233
+ // 已完成的游客
234
+ {
235
+ label: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors"),
236
+ tip: import_utils.locales.getText(
237
+ "pisell2.booking.dashboard.completed-visitors-tip"
238
+ ),
239
+ value: `${completed}`,
240
+ children: formatCapacityToChildrenData(completedChildren)
241
+ },
242
+ // 已离场的游客
243
+ {
244
+ label: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors"),
245
+ tip: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors-tip"),
246
+ value: `${departed}`
247
+ }
248
+ ]);
249
+ };
250
+ (0, import_react.useEffect)(() => {
251
+ calcBookingDataCount(bookingData);
252
+ const timer = setInterval(() => {
253
+ calcBookingDataCount(bookingData);
254
+ }, 60 * 1e3);
255
+ return () => {
256
+ clearInterval(timer);
257
+ };
258
+ }, [bookingData]);
259
+ (0, import_react.useEffect)(() => {
260
+ getData();
261
+ const timer = setInterval(() => {
262
+ getData();
263
+ }, 10 * 60 * 1e3);
264
+ return () => {
265
+ clearInterval(timer);
266
+ };
267
+ }, [JSON.stringify(otherParams), refreshKey]);
268
+ return /* @__PURE__ */ import_react.default.createElement(
269
+ import_materials.PisellStatisticList,
270
+ {
271
+ ...others,
272
+ data,
273
+ backgroundColors,
274
+ labelColor,
275
+ valueColor
276
+ }
277
+ );
278
+ };
279
+ var dashboard_default = BookingDashboard;
@@ -0,0 +1 @@
1
+ export declare const getBookingList: (params: any) => Promise<any>;
@@ -0,0 +1,33 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/booking/dashboard/serve.ts
20
+ var serve_exports = {};
21
+ __export(serve_exports, {
22
+ getBookingList: () => getBookingList
23
+ });
24
+ module.exports = __toCommonJS(serve_exports);
25
+ var import_utils = require("../utils");
26
+ var getBookingList = async (params) => {
27
+ let { data } = await import_utils.request.getRequest().get(`/shop/schedule/booking`, params);
28
+ return data;
29
+ };
30
+ // Annotate the CommonJS export names for ESM import in node:
31
+ 0 && (module.exports = {
32
+ getBookingList
33
+ });
@@ -12,6 +12,7 @@ export interface InfoProps {
12
12
  client: any;
13
13
  loading?: boolean;
14
14
  addButtonProps?: any;
15
+ drawerProps?: any;
15
16
  }
16
17
  /**
17
18
  * @title: 表单模块
@@ -53,7 +53,8 @@ var Forms = (0, import_model.Provider)((props) => {
53
53
  addCallback,
54
54
  client,
55
55
  loading,
56
- addButtonProps
56
+ addButtonProps,
57
+ drawerProps
57
58
  } = props;
58
59
  const onAction = (0, import_ahooks.useMemoizedFn)(
59
60
  async (formDataConfig, isAdd) => {
@@ -150,6 +151,7 @@ var Forms = (0, import_model.Provider)((props) => {
150
151
  onChange: (val) => {
151
152
  onValueChange(d, val);
152
153
  },
154
+ drawerProps,
153
155
  onAdd: () => {
154
156
  onAction(d, true);
155
157
  },
@@ -190,7 +192,8 @@ var Forms = (0, import_model.Provider)((props) => {
190
192
  client == null ? void 0 : client.id,
191
193
  addButtonProps,
192
194
  customSelectProps,
193
- optionRender
195
+ optionRender,
196
+ drawerProps
194
197
  ]);
195
198
  });
196
199
  var forms_default = Forms;
@@ -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: {
@@ -7,5 +7,5 @@ import "./index.less";
7
7
  * @Author: zhiwei.Wang
8
8
  * @Date: 2024-01-30 17:06
9
9
  */
10
- declare const Single: ({ value, onChange, form, mode, optionRender, loading, customSelectProps, onAdd, addButtonProps, modalOpen, watch, }: any) => React.JSX.Element;
10
+ declare const Single: ({ value, onChange, form, mode, optionRender, loading, customSelectProps, onAdd, addButtonProps, modalOpen, watch, drawerProps, }: any) => React.JSX.Element;
11
11
  export default Single;
@@ -53,7 +53,8 @@ var Single = ({
53
53
  onAdd,
54
54
  addButtonProps,
55
55
  modalOpen,
56
- watch
56
+ watch,
57
+ drawerProps
57
58
  }) => {
58
59
  var _a, _b;
59
60
  const [HumanBodySelector] = (0, import_useComponents.default)({
@@ -180,7 +181,8 @@ var Single = ({
180
181
  addButtonProps: _addButtonProps,
181
182
  drawerProps: {
182
183
  title: `${import_utils.locales.getText("pisell2.text.select")} ${((_b = form.form) == null ? void 0 : _b.title) || "-"}`,
183
- destroyOnClose: true
184
+ destroyOnClose: true,
185
+ ...drawerProps || {}
184
186
  },
185
187
  optionRender: _optionRender,
186
188
  rowKey: "form_record_id",
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const useClearCart: (state: any, dispatch: any) => false | React.JSX.Element;
3
+ export default useClearCart;
@@ -0,0 +1,62 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/booking/hooks/useClearCart.tsx
30
+ var useClearCart_exports = {};
31
+ __export(useClearCart_exports, {
32
+ default: () => useClearCart_default
33
+ });
34
+ module.exports = __toCommonJS(useClearCart_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_classnames = __toESM(require("classnames"));
37
+ var import_materials = require("@pisell/materials");
38
+ var import_utils = require("@pisell/utils");
39
+ var useClearCart = (state, dispatch) => {
40
+ var _a, _b, _c, _d;
41
+ const handleClear = () => {
42
+ dispatch({
43
+ type: "setService",
44
+ payload: {
45
+ value: []
46
+ }
47
+ });
48
+ };
49
+ return !!((_b = (_a = state.service) == null ? void 0 : _a.value) == null ? void 0 : _b.length) && !state.channelDisabledEdit && /* @__PURE__ */ import_react.default.createElement(
50
+ "span",
51
+ {
52
+ className: (0, import_classnames.default)("pisell-lowcode__booking-service-clear-btn", {
53
+ ["pisell-lowcode__booking-service-clear-btn-disabled"]: !((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length)
54
+ }),
55
+ onClick: handleClear
56
+ },
57
+ /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-trash-01" }),
58
+ " ",
59
+ /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.booking.info.text.clear-cart"))
60
+ );
61
+ };
62
+ var useClearCart_default = useClearCart;
@@ -0,0 +1,6 @@
1
+ declare const useCreateBookingPageHeader: (state: any) => {
2
+ createHeader: any;
3
+ isBookingCreatePage: any;
4
+ isBookingCreatePageCreateMode: any;
5
+ };
6
+ export default useCreateBookingPageHeader;
@@ -0,0 +1,53 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/booking/hooks/useCreateBookingPageHeader.tsx
30
+ var useCreateBookingPageHeader_exports = {};
31
+ __export(useCreateBookingPageHeader_exports, {
32
+ default: () => useCreateBookingPageHeader_default
33
+ });
34
+ module.exports = __toCommonJS(useCreateBookingPageHeader_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_utils = require("@pisell/utils");
37
+ var useCreateBookingPageHeader = (state) => {
38
+ const createHeader = (0, import_react.useMemo)(() => {
39
+ return state.isBookingCreatePage && !state.bookingId && /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info-create-new" }, import_utils.locales.getText("pisell2.booking.info.text.create-new"));
40
+ }, [state.isBookingCreatePage, state.bookingId]);
41
+ const isBookingCreatePage = (0, import_react.useMemo)(() => {
42
+ return state.isBookingCreatePage;
43
+ }, [state.isBookingCreatePage]);
44
+ const isBookingCreatePageCreateMode = (0, import_react.useMemo)(() => {
45
+ return state.isBookingCreatePage && !state.bookingId;
46
+ }, [state.isBookingCreatePage, state.bookingId]);
47
+ return {
48
+ createHeader,
49
+ isBookingCreatePage,
50
+ isBookingCreatePageCreateMode
51
+ };
52
+ };
53
+ var useCreateBookingPageHeader_default = useCreateBookingPageHeader;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface AddServiceVariantProps {
3
+ globalState: any;
4
+ setGlobalState: any;
5
+ }
6
+ declare const AddServiceVariant: (props: AddServiceVariantProps) => React.JSX.Element;
7
+ export default AddServiceVariant;