@pisell/private-materials 3.0.148 → 3.0.150-gray
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +12 -12
- package/es/components/booking/addons/index.js +1 -0
- package/es/components/booking/components/footer/index.js +3 -3
- package/es/components/booking/dashboard/index.d.ts +9 -0
- package/es/components/booking/dashboard/index.js +241 -0
- package/es/components/booking/dashboard/serve.d.ts +1 -0
- package/es/components/booking/dashboard/serve.js +27 -0
- package/es/components/booking/forms/forms.d.ts +1 -0
- package/es/components/booking/forms/forms.js +4 -2
- package/es/components/booking/forms/single/index.d.ts +1 -1
- package/es/components/booking/forms/single/index.js +4 -3
- package/es/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/es/components/booking/info/addServiceVariant/index.js +33 -0
- package/es/components/booking/info/index.js +2 -1
- package/es/components/booking/info/index.less +9 -0
- package/es/components/booking/info/pet/index.js +1 -1
- package/es/components/booking/info/service/addService/index.d.ts +8 -2
- package/es/components/booking/info/service/addService/index.js +82 -35
- package/es/components/booking/info/service/addService/index.less +27 -1
- package/es/components/booking/info/service/addTimeModal/index.js +3 -2
- package/es/components/booking/info/service/editService/index.js +7 -9
- package/es/components/booking/locales.d.ts +48 -0
- package/es/components/booking/locales.js +51 -3
- package/es/components/booking/model.d.ts +2 -0
- package/es/components/booking/utils.d.ts +1 -1
- package/es/components/booking/utils.js +54 -51
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +2 -2
- package/es/components/productExtension/fields/SelectProducts/index.js +12 -11
- package/es/components/schedules/products/index.d.ts +2 -2
- package/es/components/schedules/products/index.js +8 -7
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/components/booking/addons/index.js +1 -0
- package/lib/components/booking/components/footer/index.js +3 -3
- package/lib/components/booking/dashboard/index.d.ts +9 -0
- package/lib/components/booking/dashboard/index.js +224 -0
- package/lib/components/booking/dashboard/serve.d.ts +1 -0
- package/lib/components/booking/dashboard/serve.js +33 -0
- package/lib/components/booking/forms/forms.d.ts +1 -0
- package/lib/components/booking/forms/forms.js +5 -2
- package/lib/components/booking/forms/single/index.d.ts +1 -1
- package/lib/components/booking/forms/single/index.js +4 -2
- package/lib/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/lib/components/booking/info/addServiceVariant/index.js +58 -0
- package/lib/components/booking/info/client/index.js +1 -8
- package/lib/components/booking/info/index.js +4 -1
- package/lib/components/booking/info/index.less +9 -0
- package/lib/components/booking/info/pet/index.js +2 -1
- package/lib/components/booking/info/service/addService/index.d.ts +8 -2
- package/lib/components/booking/info/service/addService/index.js +68 -29
- package/lib/components/booking/info/service/addService/index.less +27 -1
- package/lib/components/booking/info/service/addTimeModal/index.js +2 -1
- package/lib/components/booking/info/service/editService/index.js +6 -3
- package/lib/components/booking/locales.d.ts +48 -0
- package/lib/components/booking/locales.js +51 -3
- package/lib/components/booking/model.d.ts +2 -0
- package/lib/components/booking/utils.d.ts +1 -1
- package/lib/components/booking/utils.js +57 -22
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +2 -2
- package/lib/components/productExtension/fields/SelectProducts/index.js +2 -1
- package/lib/components/schedules/products/index.d.ts +2 -2
- package/lib/components/schedules/products/index.js +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/booking-dashboard/meta.ts +123 -0
- package/lowcode/booking-vertical-add-service/meta.ts +124 -0
- package/lowcode/vertical-add-service/meta.ts +71 -0
- package/package.json +2 -2
|
@@ -0,0 +1,224 @@
|
|
|
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
|
+
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
44
|
+
var BookingDashboard = (props) => {
|
|
45
|
+
const {
|
|
46
|
+
otherParams = {},
|
|
47
|
+
backgroundColors,
|
|
48
|
+
labelColor,
|
|
49
|
+
valueColor,
|
|
50
|
+
...others
|
|
51
|
+
} = props;
|
|
52
|
+
const context = (0, import_useEngineContext.default)();
|
|
53
|
+
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
54
|
+
const [data, setData] = (0, import_react.useState)([
|
|
55
|
+
// 当前在场团体
|
|
56
|
+
{
|
|
57
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now"),
|
|
58
|
+
value: "-",
|
|
59
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now-tip")
|
|
60
|
+
},
|
|
61
|
+
// 当前在场人数
|
|
62
|
+
{
|
|
63
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now"),
|
|
64
|
+
value: "-",
|
|
65
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now-tip")
|
|
66
|
+
},
|
|
67
|
+
// 今日游客总数
|
|
68
|
+
{
|
|
69
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today"),
|
|
70
|
+
value: "-",
|
|
71
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today-tip")
|
|
72
|
+
},
|
|
73
|
+
// 正在进行中的游客
|
|
74
|
+
{
|
|
75
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors"),
|
|
76
|
+
value: "-",
|
|
77
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors-tip")
|
|
78
|
+
},
|
|
79
|
+
// 即将到达的游客
|
|
80
|
+
{
|
|
81
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors"),
|
|
82
|
+
value: "-",
|
|
83
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors-tip")
|
|
84
|
+
},
|
|
85
|
+
// 超时的游客
|
|
86
|
+
{
|
|
87
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors"),
|
|
88
|
+
value: "-",
|
|
89
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors-tip")
|
|
90
|
+
},
|
|
91
|
+
// 已完成的游客
|
|
92
|
+
{
|
|
93
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors"),
|
|
94
|
+
value: "-",
|
|
95
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors-tip")
|
|
96
|
+
},
|
|
97
|
+
// 已离场的游客
|
|
98
|
+
{
|
|
99
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors"),
|
|
100
|
+
value: "-",
|
|
101
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors-tip")
|
|
102
|
+
}
|
|
103
|
+
]);
|
|
104
|
+
const [bookingData, setBookingData] = (0, import_react.useState)([]);
|
|
105
|
+
const getData = async () => {
|
|
106
|
+
const data2 = await (0, import_serve.getBookingList)({
|
|
107
|
+
...otherParams,
|
|
108
|
+
item_type: "appointment_booking",
|
|
109
|
+
parent_id: 0,
|
|
110
|
+
with: ["children"],
|
|
111
|
+
child_booking: 0,
|
|
112
|
+
skip: 1,
|
|
113
|
+
num: 1e3
|
|
114
|
+
});
|
|
115
|
+
setBookingData(data2.list);
|
|
116
|
+
};
|
|
117
|
+
const calcBookingDataCount = (data2) => {
|
|
118
|
+
let groupsOnSiteNow = "-";
|
|
119
|
+
let peopleOnSiteNow = "-";
|
|
120
|
+
let totalVisitorsToday = 0;
|
|
121
|
+
let ongoing = 0;
|
|
122
|
+
let upcoming = 0;
|
|
123
|
+
let overdue = "-";
|
|
124
|
+
let completed = 0;
|
|
125
|
+
let departed = "-";
|
|
126
|
+
data2.forEach((item) => {
|
|
127
|
+
if ((0, import_utils.isArr)(item.children)) {
|
|
128
|
+
item.children.forEach((child) => {
|
|
129
|
+
const start = (0, import_dayjs.default)(`${child.start_date} ${child.start_time}`);
|
|
130
|
+
const end = (0, import_dayjs.default)(`${child.end_date} ${child.end_time}`);
|
|
131
|
+
totalVisitorsToday += child.number;
|
|
132
|
+
if (start < (0, import_dayjs.default)() && end > (0, import_dayjs.default)()) {
|
|
133
|
+
ongoing += child.number || 1;
|
|
134
|
+
}
|
|
135
|
+
if ((0, import_dayjs.default)() < start) {
|
|
136
|
+
upcoming += child.number || 1;
|
|
137
|
+
}
|
|
138
|
+
if ((0, import_dayjs.default)() > end) {
|
|
139
|
+
completed += child.number || 1;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
setData([
|
|
145
|
+
// 当前在场团体
|
|
146
|
+
{
|
|
147
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now"),
|
|
148
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.groups-on-site-now-tip"),
|
|
149
|
+
value: `${groupsOnSiteNow}`
|
|
150
|
+
},
|
|
151
|
+
// 当前在场人数
|
|
152
|
+
{
|
|
153
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now"),
|
|
154
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.people-on-site-now-tip"),
|
|
155
|
+
value: `${peopleOnSiteNow}`
|
|
156
|
+
},
|
|
157
|
+
// 今日游客总数
|
|
158
|
+
{
|
|
159
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today"),
|
|
160
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.total-visitors-today-tip"),
|
|
161
|
+
value: `${totalVisitorsToday}`
|
|
162
|
+
},
|
|
163
|
+
// 正在进行中的游客
|
|
164
|
+
{
|
|
165
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors"),
|
|
166
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.ongoing-visitors-tip"),
|
|
167
|
+
value: `${ongoing}`
|
|
168
|
+
},
|
|
169
|
+
// 即将到达的游客
|
|
170
|
+
{
|
|
171
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors"),
|
|
172
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.upcoming-visitors-tip"),
|
|
173
|
+
value: `${upcoming}`
|
|
174
|
+
},
|
|
175
|
+
// 超时的游客
|
|
176
|
+
{
|
|
177
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors"),
|
|
178
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.overdue-visitors-tip"),
|
|
179
|
+
value: `${overdue}`
|
|
180
|
+
},
|
|
181
|
+
// 已完成的游客
|
|
182
|
+
{
|
|
183
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors"),
|
|
184
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.completed-visitors-tip"),
|
|
185
|
+
value: `${completed}`
|
|
186
|
+
},
|
|
187
|
+
// 已离场的游客
|
|
188
|
+
{
|
|
189
|
+
label: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors"),
|
|
190
|
+
tip: import_utils.locales.getText("pisell2.booking.dashboard.departed-visitors-tip"),
|
|
191
|
+
value: `${departed}`
|
|
192
|
+
}
|
|
193
|
+
]);
|
|
194
|
+
};
|
|
195
|
+
(0, import_react.useEffect)(() => {
|
|
196
|
+
calcBookingDataCount(bookingData);
|
|
197
|
+
const timer = setInterval(() => {
|
|
198
|
+
calcBookingDataCount(bookingData);
|
|
199
|
+
}, 60 * 1e3);
|
|
200
|
+
return () => {
|
|
201
|
+
clearInterval(timer);
|
|
202
|
+
};
|
|
203
|
+
}, [bookingData]);
|
|
204
|
+
(0, import_react.useEffect)(() => {
|
|
205
|
+
getData();
|
|
206
|
+
const timer = setInterval(() => {
|
|
207
|
+
getData();
|
|
208
|
+
}, 10 * 60 * 1e3);
|
|
209
|
+
return () => {
|
|
210
|
+
clearInterval(timer);
|
|
211
|
+
};
|
|
212
|
+
}, [JSON.stringify(otherParams)]);
|
|
213
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
214
|
+
import_materials.PisellStatisticList,
|
|
215
|
+
{
|
|
216
|
+
...others,
|
|
217
|
+
data,
|
|
218
|
+
backgroundColors,
|
|
219
|
+
labelColor,
|
|
220
|
+
valueColor
|
|
221
|
+
}
|
|
222
|
+
);
|
|
223
|
+
};
|
|
224
|
+
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
|
+
});
|
|
@@ -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;
|
|
@@ -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)({
|
|
@@ -177,7 +178,8 @@ var Single = ({
|
|
|
177
178
|
addButtonProps: _addButtonProps,
|
|
178
179
|
drawerProps: {
|
|
179
180
|
title: `${import_utils.locales.getText("pisell2.text.select")} ${((_b = form.form) == null ? void 0 : _b.title) || "-"}`,
|
|
180
|
-
destroyOnClose: true
|
|
181
|
+
destroyOnClose: true,
|
|
182
|
+
...drawerProps || {}
|
|
181
183
|
},
|
|
182
184
|
optionRender: _optionRender,
|
|
183
185
|
rowKey: "form_record_id",
|
|
@@ -0,0 +1,58 @@
|
|
|
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/info/addServiceVariant/index.tsx
|
|
30
|
+
var addServiceVariant_exports = {};
|
|
31
|
+
__export(addServiceVariant_exports, {
|
|
32
|
+
default: () => addServiceVariant_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(addServiceVariant_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_addService = __toESM(require("../service/addService"));
|
|
37
|
+
var AddServiceVariant = (props) => {
|
|
38
|
+
const { globalState, setGlobalState } = props;
|
|
39
|
+
const stateRef = (0, import_react.useRef)(globalState);
|
|
40
|
+
stateRef.current = globalState;
|
|
41
|
+
const dispatch = ({ type, payload }) => {
|
|
42
|
+
if (type === "setService") {
|
|
43
|
+
setGlobalState({
|
|
44
|
+
service: { ...stateRef.current.service, ...payload }
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
49
|
+
import_addService.default,
|
|
50
|
+
{
|
|
51
|
+
renderMode: "current",
|
|
52
|
+
dispatch,
|
|
53
|
+
state: globalState,
|
|
54
|
+
drawerProps: { open: true, getContainer: false }
|
|
55
|
+
}
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
var addServiceVariant_default = AddServiceVariant;
|
|
@@ -309,14 +309,7 @@ var Client = () => {
|
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
);
|
|
312
|
-
}, [
|
|
313
|
-
state,
|
|
314
|
-
renderList,
|
|
315
|
-
loading,
|
|
316
|
-
franchiseeLoading,
|
|
317
|
-
params.search,
|
|
318
|
-
loadMore
|
|
319
|
-
]);
|
|
312
|
+
}, [state, renderList, loading, franchiseeLoading, params.search, loadMore]);
|
|
320
313
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
321
314
|
"div",
|
|
322
315
|
{
|
|
@@ -49,6 +49,7 @@ var import_date2 = require("./date");
|
|
|
49
49
|
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
50
50
|
var import_notes = __toESM(require("./notes"));
|
|
51
51
|
var import_index = require("./index.less");
|
|
52
|
+
var import_classnames = __toESM(require("classnames"));
|
|
52
53
|
var defaultModules = {
|
|
53
54
|
client: 1,
|
|
54
55
|
date: 1,
|
|
@@ -144,7 +145,9 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
144
145
|
style: {
|
|
145
146
|
height: ((_h = (_g = context == null ? void 0 : context.appHelper) == null ? void 0 : _g.utils) == null ? void 0 : _h.isMobile) ? "100%" : "100vh"
|
|
146
147
|
},
|
|
147
|
-
bodyClassName: "booking-info-warp"
|
|
148
|
+
bodyClassName: (0, import_classnames.default)("booking-info-warp", {
|
|
149
|
+
["create-booking-page-info-wrap"]: modal.state.isBookingCreatePage
|
|
150
|
+
})
|
|
148
151
|
},
|
|
149
152
|
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_i = modal.state) == null ? void 0 : _i.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, modules.service ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, modal.state.date.value ? /* @__PURE__ */ import_react.default.createElement(import_service.default, null) : null) : null, notes, slot ? slot : null)
|
|
150
153
|
) : null);
|
|
@@ -15,4 +15,13 @@
|
|
|
15
15
|
// height: 42px;
|
|
16
16
|
// background: #069456;
|
|
17
17
|
// }
|
|
18
|
+
}
|
|
19
|
+
#create-booking-page-info-wrap {
|
|
20
|
+
.pisell-lowcode__booking-tab-pane-footer {
|
|
21
|
+
padding: 12px 16px !important;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
.create-booking-page-info-wrap {
|
|
25
|
+
position: initial !important;
|
|
26
|
+
padding: 0 16px !important;
|
|
18
27
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PisellDrawerProps } from '../../../components/drawer';
|
|
2
3
|
import './index.less';
|
|
3
|
-
|
|
4
|
+
interface AddServiceProps {
|
|
4
5
|
onEdit: any;
|
|
5
|
-
|
|
6
|
+
dispatch?: any;
|
|
7
|
+
state?: any;
|
|
8
|
+
drawerProps?: PisellDrawerProps;
|
|
9
|
+
renderMode?: 'current' | 'drawer';
|
|
10
|
+
}
|
|
11
|
+
declare const Info: (props: AddServiceProps) => React.JSX.Element;
|
|
6
12
|
export default Info;
|
|
@@ -63,13 +63,16 @@ var shopList = [
|
|
|
63
63
|
6848,
|
|
64
64
|
6305
|
|
65
65
|
];
|
|
66
|
-
var Info = (
|
|
66
|
+
var Info = (props) => {
|
|
67
67
|
var _a, _b, _c, _d;
|
|
68
|
+
const { onEdit, drawerProps, renderMode } = props;
|
|
68
69
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
69
|
-
|
|
70
|
+
let { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
70
71
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
71
72
|
const searchRef = (0, import_react.useRef)();
|
|
72
73
|
const context = (0, import_useEngineContext.default)();
|
|
74
|
+
state = state || (props == null ? void 0 : props.state);
|
|
75
|
+
dispatch = dispatch || (props == null ? void 0 : props.dispatch);
|
|
73
76
|
import_utils3.request.setRequest(context.appHelper.utils.request);
|
|
74
77
|
const setDefaultService = async (list) => {
|
|
75
78
|
if (state.renderType !== "eventBooking") {
|
|
@@ -120,7 +123,7 @@ var Info = ({ onEdit }) => {
|
|
|
120
123
|
}
|
|
121
124
|
});
|
|
122
125
|
};
|
|
123
|
-
const getServices = async () => {
|
|
126
|
+
const getServices = async (params) => {
|
|
124
127
|
var _a2;
|
|
125
128
|
setLoading(true);
|
|
126
129
|
let data = await state.apis.getServices({
|
|
@@ -133,8 +136,11 @@ var Info = ({ onEdit }) => {
|
|
|
133
136
|
with_schedule: 1,
|
|
134
137
|
with_count: ["bundleGroup", "optionGroup"],
|
|
135
138
|
order_by_string: "sort:desc",
|
|
136
|
-
|
|
137
|
-
|
|
139
|
+
status: "published",
|
|
140
|
+
...state.isBookingCreatePage ? { schedule_date: params == null ? void 0 : params.schedule_date } : {
|
|
141
|
+
_config: {
|
|
142
|
+
useCache: true
|
|
143
|
+
}
|
|
138
144
|
}
|
|
139
145
|
});
|
|
140
146
|
setLoading(false);
|
|
@@ -210,6 +216,10 @@ var Info = ({ onEdit }) => {
|
|
|
210
216
|
cacheItem._id = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._id;
|
|
211
217
|
cacheItem.new = 0;
|
|
212
218
|
}
|
|
219
|
+
if (renderMode === "current") {
|
|
220
|
+
cacheItem._extend.resource = 0;
|
|
221
|
+
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
|
222
|
+
}
|
|
213
223
|
cacheItem._extend = (0, import_utils2.getProductExtend)({ cacheItem, state });
|
|
214
224
|
if (state.renderType === "eventBooking") {
|
|
215
225
|
cacheItem.autoClose = false;
|
|
@@ -267,12 +277,24 @@ var Info = ({ onEdit }) => {
|
|
|
267
277
|
setSearch("");
|
|
268
278
|
}
|
|
269
279
|
}, [state.service.addModal]);
|
|
280
|
+
const currentDate = (0, import_react.useMemo)(() => {
|
|
281
|
+
return state.date.value.format("YYYY-MM-DD");
|
|
282
|
+
}, [state.date.value]);
|
|
283
|
+
console.log(currentDate, "currentDate");
|
|
284
|
+
(0, import_react.useEffect)(() => {
|
|
285
|
+
if (renderMode === "current") {
|
|
286
|
+
getServices({ schedule_date: currentDate });
|
|
287
|
+
}
|
|
288
|
+
}, [renderMode, currentDate]);
|
|
270
289
|
(0, import_react.useEffect)(() => {
|
|
271
290
|
if (state.renderType === "eventBooking" && state.modalOpen) {
|
|
272
291
|
getServices();
|
|
273
292
|
}
|
|
274
293
|
}, [state.renderType, state.modalOpen]);
|
|
275
294
|
const addButton = (0, import_react.useMemo)(() => {
|
|
295
|
+
if (state.isBookingCreatePage) {
|
|
296
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
|
|
297
|
+
}
|
|
276
298
|
if (state.renderType === "eventBooking") {
|
|
277
299
|
return isService ? /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } }) : /* @__PURE__ */ import_react.default.createElement(
|
|
278
300
|
import_addButton.default,
|
|
@@ -301,12 +323,49 @@ var Info = ({ onEdit }) => {
|
|
|
301
323
|
state.service.value,
|
|
302
324
|
loading
|
|
303
325
|
]);
|
|
326
|
+
const isRenderCurrent = (0, import_react.useMemo)(() => {
|
|
327
|
+
return renderMode === "current";
|
|
328
|
+
}, [renderMode]);
|
|
304
329
|
return (0, import_react.useMemo)(() => {
|
|
305
330
|
var _a2, _b2;
|
|
331
|
+
const header = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
|
|
332
|
+
import_antd.Input,
|
|
333
|
+
{
|
|
334
|
+
ref: searchRef,
|
|
335
|
+
prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
|
|
336
|
+
style: { marginTop: 16, height: 44 },
|
|
337
|
+
placeholder: import_utils4.locales.getText("pisell2.text.search"),
|
|
338
|
+
allowClear: true,
|
|
339
|
+
value: search,
|
|
340
|
+
onChange: (e) => {
|
|
341
|
+
setSearch(e.target.value);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
));
|
|
345
|
+
const content = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body" }, /* @__PURE__ */ import_react.default.createElement(
|
|
346
|
+
import_TabProduct.default,
|
|
347
|
+
{
|
|
348
|
+
list: renderList,
|
|
349
|
+
amountSymbol: state.amountSymbol,
|
|
350
|
+
onChange: handleSelectProduct,
|
|
351
|
+
scrollDom: isRenderCurrent ? ".pisell-lowcode__booking-vertical-add-service-wrap" : ".booking-server-wrap .pisell-lowcode-drawer-body "
|
|
352
|
+
}
|
|
353
|
+
));
|
|
354
|
+
if (renderMode === "current") {
|
|
355
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
356
|
+
"div",
|
|
357
|
+
{
|
|
358
|
+
className: "pisell-lowcode__booking-vertical-add-service-wrap",
|
|
359
|
+
style: { width: "100%", height: "100%", overflow: "auto" }
|
|
360
|
+
},
|
|
361
|
+
header,
|
|
362
|
+
content
|
|
363
|
+
);
|
|
364
|
+
}
|
|
306
365
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2.autoClose) && /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true, round: true }), addButton, /* @__PURE__ */ import_react.default.createElement(
|
|
307
366
|
import_drawer.default,
|
|
308
367
|
{
|
|
309
|
-
open: state.service.addModal,
|
|
368
|
+
open: state.service.addModal && !state.isBookingCreatePage,
|
|
310
369
|
title: import_utils4.locales.getText("pisell2.text.select-service"),
|
|
311
370
|
rootClassName: "booking-server-wrap",
|
|
312
371
|
onClose: () => {
|
|
@@ -318,30 +377,10 @@ var Info = ({ onEdit }) => {
|
|
|
318
377
|
}
|
|
319
378
|
});
|
|
320
379
|
},
|
|
321
|
-
header
|
|
322
|
-
|
|
323
|
-
{
|
|
324
|
-
ref: searchRef,
|
|
325
|
-
prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
|
|
326
|
-
style: { marginTop: 16, height: 44 },
|
|
327
|
-
placeholder: import_utils4.locales.getText("pisell2.text.search"),
|
|
328
|
-
allowClear: true,
|
|
329
|
-
value: search,
|
|
330
|
-
onChange: (e) => {
|
|
331
|
-
setSearch(e.target.value);
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
))
|
|
380
|
+
header,
|
|
381
|
+
...drawerProps || {}
|
|
335
382
|
},
|
|
336
|
-
|
|
337
|
-
import_TabProduct.default,
|
|
338
|
-
{
|
|
339
|
-
list: renderList,
|
|
340
|
-
amountSymbol: state.amountSymbol,
|
|
341
|
-
onChange: handleSelectProduct,
|
|
342
|
-
scrollDom: ".booking-server-wrap .pisell-lowcode-drawer-body"
|
|
343
|
-
}
|
|
344
|
-
))
|
|
383
|
+
content
|
|
345
384
|
));
|
|
346
385
|
}, [
|
|
347
386
|
(_d = (_c = state.service) == null ? void 0 : _c.cacheItem) == null ? void 0 : _d.autoClose,
|
|
@@ -3,7 +3,33 @@
|
|
|
3
3
|
// border-bottom: 1px solid var(--gray-300, #D0D5DD);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
|
|
7
6
|
.pisell-lowcode__booking-service-body {
|
|
8
7
|
background: var(--gray-50, #F9FAFB);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.pisell-lowcode__booking-vertical-add-service-wrap {
|
|
11
|
+
&::-webkit-scrollbar {
|
|
12
|
+
display: none !important;
|
|
13
|
+
}
|
|
14
|
+
.pisell-lowcode__booking-service-header {
|
|
15
|
+
background-color: #fff;
|
|
16
|
+
top: 0;
|
|
17
|
+
position: sticky;
|
|
18
|
+
z-index: 2;
|
|
19
|
+
padding: 16px !important;
|
|
20
|
+
margin: 0;
|
|
21
|
+
.pisell-lowcode-input-affix-wrapper {
|
|
22
|
+
margin: 0 !important;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.booking-category-list {
|
|
26
|
+
padding: 0 16px !important;
|
|
27
|
+
}
|
|
28
|
+
.pisell-lowcode__booking-service-body {
|
|
29
|
+
.booking-tab-product {
|
|
30
|
+
.booking-tabs-wrap {
|
|
31
|
+
top: 76px !important;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
9
35
|
}
|