@pisell/private-materials 3.0.13 → 3.0.15
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 +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/components/addButton/index.d.ts +8 -8
- package/es/components/booking/components/addButton/index.js +1 -1
- package/es/components/booking/components/drawer/index.d.ts +1 -1
- package/es/components/booking/components/footer/FooterMenus/index.js +1 -1
- package/es/components/booking/components/footer/index.js +25 -23
- package/es/components/booking/components/footer/utils.js +4 -3
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/forms.js +2 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/client/index.js +0 -1
- package/es/components/booking/info/date/index.less +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/index.js +23 -9
- package/es/components/booking/info/model.d.ts +2 -1
- package/es/components/booking/info/notes/index.d.ts +3 -0
- package/es/components/booking/info/notes/index.js +83 -0
- package/es/components/booking/info/pet/index.js +5 -7
- package/es/components/booking/info/service/addService/index.js +74 -15
- package/es/components/booking/info/service/editService/index.js +8 -7
- package/es/components/booking/info/service/index.js +1 -1
- package/es/components/booking/info/service/index.less +3 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +3 -0
- package/es/components/booking/model.d.ts +13 -1
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/booking/utils.js +2 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/productExtension/card/index.d.ts +10 -0
- package/es/components/productExtension/card/index.js +20 -0
- package/es/components/productExtension/card/index.less +34 -0
- package/es/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
- package/es/components/productExtension/fields/Actor/Container/index.js +34 -0
- package/es/components/productExtension/fields/Actor/Container/index.less +19 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +94 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +5 -0
- package/es/components/productExtension/fields/Actor/index.js +23 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +10 -0
- package/es/components/productExtension/fields/Forms/index.js +184 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +30 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +4 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +39 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
- package/es/components/productExtension/fields/SelectProducts/index.js +99 -0
- package/es/components/productExtension/fields/SelectProducts/index.less +30 -0
- package/es/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
- package/es/components/productExtension/fields/SelectProducts/mock.js +0 -0
- package/es/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/server.js +29 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.js +200 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
- package/es/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
- package/es/components/productExtension/fields/SelectResourcesTable/mock.js +5072 -0
- package/es/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +49 -0
- package/es/components/productExtension/fields/index.d.ts +1 -0
- package/es/components/productExtension/fields/index.js +33 -0
- package/es/components/productExtension/index.d.ts +7 -0
- package/es/components/productExtension/index.js +78 -0
- package/es/components/productExtension/index.less +0 -0
- package/es/components/productExtension/locales.d.ts +48 -0
- package/es/components/productExtension/locales.js +47 -0
- package/es/components/productExtension/server.d.ts +1 -0
- package/es/components/productExtension/server.js +29 -0
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +21 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +20 -5
- package/es/components/selectModal/index.d.ts +24 -0
- package/es/components/selectModal/index.js +108 -0
- package/es/components/selectModal/index.less +0 -0
- package/es/components/tabProduct/card/index.d.ts +2 -2
- package/es/components/tabProduct/card/index.js +3 -4
- package/es/components/tabProduct/index.d.ts +4 -2
- package/es/components/tabProduct/index.js +10 -9
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/utils/index.d.ts +22 -0
- package/es/utils/index.js +56 -0
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/components/addButton/index.d.ts +8 -8
- package/lib/components/booking/components/addButton/index.js +1 -1
- package/lib/components/booking/components/drawer/index.d.ts +1 -1
- package/lib/components/booking/components/footer/FooterMenus/index.js +1 -1
- package/lib/components/booking/components/footer/index.js +5 -3
- package/lib/components/booking/components/footer/utils.js +4 -2
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/forms.js +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/client/index.js +0 -1
- package/lib/components/booking/info/date/index.less +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/index.js +27 -9
- package/lib/components/booking/info/model.d.ts +2 -1
- package/lib/components/booking/info/notes/index.d.ts +3 -0
- package/lib/components/booking/info/notes/index.js +111 -0
- package/lib/components/booking/info/pet/index.js +5 -7
- package/lib/components/booking/info/service/addService/index.js +65 -10
- package/lib/components/booking/info/service/editService/index.js +7 -5
- package/lib/components/booking/info/service/index.js +1 -1
- package/lib/components/booking/info/service/index.less +3 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +3 -0
- package/lib/components/booking/model.d.ts +13 -1
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/booking/utils.js +2 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/productExtension/card/index.d.ts +10 -0
- package/lib/components/productExtension/card/index.js +57 -0
- package/lib/components/productExtension/card/index.less +34 -0
- package/lib/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
- package/lib/components/productExtension/fields/Actor/Container/index.js +64 -0
- package/lib/components/productExtension/fields/Actor/Container/index.less +19 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/index.js +128 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +5 -0
- package/lib/components/productExtension/fields/Actor/index.js +56 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +10 -0
- package/lib/components/productExtension/fields/Forms/index.js +108 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +65 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +4 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +79 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
- package/lib/components/productExtension/fields/SelectProducts/index.js +126 -0
- package/lib/components/productExtension/fields/SelectProducts/index.less +30 -0
- package/lib/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
- package/lib/components/productExtension/fields/SelectProducts/mock.js +0 -0
- package/lib/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/server.js +33 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.js +178 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/mock.js +12723 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/server.js +39 -0
- package/lib/components/productExtension/fields/index.d.ts +1 -0
- package/lib/components/productExtension/fields/index.js +69 -0
- package/lib/components/productExtension/index.d.ts +7 -0
- package/lib/components/productExtension/index.js +109 -0
- package/lib/components/productExtension/index.less +0 -0
- package/lib/components/productExtension/locales.d.ts +48 -0
- package/lib/components/productExtension/locales.js +71 -0
- package/lib/components/productExtension/server.d.ts +1 -0
- package/lib/components/productExtension/server.js +33 -0
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +11 -6
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +18 -4
- package/lib/components/selectModal/index.d.ts +24 -0
- package/lib/components/selectModal/index.js +133 -0
- package/lib/components/selectModal/index.less +0 -0
- package/lib/components/tabProduct/card/index.d.ts +2 -2
- package/lib/components/tabProduct/card/index.js +1 -2
- package/lib/components/tabProduct/index.d.ts +4 -2
- package/lib/components/tabProduct/index.js +7 -8
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/utils/index.d.ts +22 -0
- package/lib/utils/index.js +59 -0
- package/lowcode/product-extension/meta.ts +120 -0
- package/package.json +3 -3
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
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,14 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import React from "react";
|
|
9
9
|
import "./index.less";
|
|
10
|
-
interface AddButtonProps {
|
|
11
|
-
onClick
|
|
12
|
-
title
|
|
13
|
-
subTitle
|
|
14
|
-
showSub
|
|
15
|
-
style
|
|
16
|
-
disabled
|
|
17
|
-
loading
|
|
10
|
+
export interface AddButtonProps {
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
title?: string;
|
|
13
|
+
subTitle?: string;
|
|
14
|
+
showSub?: boolean;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
loading?: boolean;
|
|
18
18
|
}
|
|
19
19
|
declare const AddButton: React.FC<AddButtonProps>;
|
|
20
20
|
export default AddButton;
|
|
@@ -7,7 +7,7 @@ var FooterMenus = function FooterMenus(_ref) {
|
|
|
7
7
|
dispatch = _ref.dispatch;
|
|
8
8
|
var items = useMemo(function () {
|
|
9
9
|
var list = [];
|
|
10
|
-
if (state.bookingId) {
|
|
10
|
+
if (state.bookingId && state.renderType !== 'eventBooking') {
|
|
11
11
|
list.push({
|
|
12
12
|
label: locales.getText("pisell2.text.rebook"),
|
|
13
13
|
key: "rebook"
|
|
@@ -259,7 +259,7 @@ var Footer = function Footer(props) {
|
|
|
259
259
|
*/
|
|
260
260
|
var handleSave = /*#__PURE__*/function () {
|
|
261
261
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4) {
|
|
262
|
-
var type, _setLoading, saveOtherValue, _state$onSave, callbackData, values, api;
|
|
262
|
+
var type, _setLoading, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, api;
|
|
263
263
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
264
264
|
while (1) switch (_context4.prev = _context4.next) {
|
|
265
265
|
case 0:
|
|
@@ -267,60 +267,62 @@ var Footer = function Footer(props) {
|
|
|
267
267
|
// 区分loading, 是点击的checkout 还是save
|
|
268
268
|
_setLoading = type === "checkout" ? setCheckoutLoading : setLoading;
|
|
269
269
|
_setLoading(true);
|
|
270
|
+
editApi = state.renderType === 'eventBooking' ? state.apis.editEventBooking : state.apis.editBooking;
|
|
271
|
+
createApi = state.renderType === 'eventBooking' ? state.apis.createEventBooking : state.apis.createBooking;
|
|
270
272
|
saveOtherValue = {};
|
|
271
273
|
if (!(type === "save")) {
|
|
272
|
-
_context4.next =
|
|
274
|
+
_context4.next = 13;
|
|
273
275
|
break;
|
|
274
276
|
}
|
|
275
|
-
_context4.next =
|
|
277
|
+
_context4.next = 9;
|
|
276
278
|
return state === null || state === void 0 ? void 0 : (_state$onSave = state.onSave) === null || _state$onSave === void 0 ? void 0 : _state$onSave.call(state, state.client);
|
|
277
|
-
case
|
|
279
|
+
case 9:
|
|
278
280
|
_context4.t0 = _context4.sent;
|
|
279
281
|
if (_context4.t0) {
|
|
280
|
-
_context4.next =
|
|
282
|
+
_context4.next = 12;
|
|
281
283
|
break;
|
|
282
284
|
}
|
|
283
285
|
_context4.t0 = {};
|
|
284
|
-
case
|
|
286
|
+
case 12:
|
|
285
287
|
saveOtherValue = _context4.t0;
|
|
286
|
-
case
|
|
287
|
-
_context4.prev =
|
|
288
|
+
case 13:
|
|
289
|
+
_context4.prev = 13;
|
|
288
290
|
callbackData = null; // 格式化提交的参数
|
|
289
291
|
values = formatValues(_objectSpread(_objectSpread({}, state), saveOtherValue)); // 区分是新增还是编辑
|
|
290
|
-
api = state.bookingId ?
|
|
292
|
+
api = state.bookingId ? editApi : createApi; // 如果有addons改动, 则先保存
|
|
291
293
|
if (!addonsEdit) {
|
|
292
|
-
_context4.next =
|
|
294
|
+
_context4.next = 20;
|
|
293
295
|
break;
|
|
294
296
|
}
|
|
295
|
-
_context4.next =
|
|
297
|
+
_context4.next = 20;
|
|
296
298
|
return handleSaveAddons();
|
|
297
|
-
case
|
|
299
|
+
case 20:
|
|
298
300
|
if (!infoEdit) {
|
|
299
|
-
_context4.next =
|
|
301
|
+
_context4.next = 25;
|
|
300
302
|
break;
|
|
301
303
|
}
|
|
302
|
-
_context4.next =
|
|
304
|
+
_context4.next = 23;
|
|
303
305
|
return api(values);
|
|
304
|
-
case
|
|
306
|
+
case 23:
|
|
305
307
|
callbackData = _context4.sent;
|
|
306
308
|
message.success(locales.getText(state.bookingId ? "pisell2.text.appointment-updated" : "pisell2.text.created-successfully"));
|
|
307
|
-
case
|
|
309
|
+
case 25:
|
|
308
310
|
// 回调关闭弹窗
|
|
309
311
|
state === null || state === void 0 ? void 0 : state.callback(callbackData);
|
|
310
312
|
_setLoading(false);
|
|
311
313
|
|
|
312
314
|
// return数据 checkout时需要
|
|
313
315
|
return _context4.abrupt("return", callbackData);
|
|
314
|
-
case
|
|
315
|
-
_context4.prev =
|
|
316
|
-
_context4.t1 = _context4["catch"](
|
|
316
|
+
case 30:
|
|
317
|
+
_context4.prev = 30;
|
|
318
|
+
_context4.t1 = _context4["catch"](13);
|
|
317
319
|
console.log(_context4.t1);
|
|
318
320
|
_setLoading(false);
|
|
319
|
-
case
|
|
321
|
+
case 34:
|
|
320
322
|
case "end":
|
|
321
323
|
return _context4.stop();
|
|
322
324
|
}
|
|
323
|
-
}, _callee4, null, [[
|
|
325
|
+
}, _callee4, null, [[13, 30]]);
|
|
324
326
|
}));
|
|
325
327
|
return function handleSave(_x3) {
|
|
326
328
|
return _ref5.apply(this, arguments);
|
|
@@ -636,12 +638,12 @@ var Footer = function Footer(props) {
|
|
|
636
638
|
if (!state.bookingDetail) {
|
|
637
639
|
return true;
|
|
638
640
|
}
|
|
639
|
-
if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load)) {
|
|
641
|
+
if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load) && state.renderType !== 'eventBooking') {
|
|
640
642
|
return true;
|
|
641
643
|
}
|
|
642
644
|
}
|
|
643
645
|
return false;
|
|
644
|
-
}, [state.bookingId, state.bookingDetail, (_state$addons4 = state.addons) === null || _state$addons4 === void 0 ? void 0 : _state$addons4.load]);
|
|
646
|
+
}, [state.bookingId, state.bookingDetail, (_state$addons4 = state.addons) === null || _state$addons4 === void 0 ? void 0 : _state$addons4.load, state.renderType]);
|
|
645
647
|
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
646
648
|
title: false,
|
|
647
649
|
round: true,
|
|
@@ -26,13 +26,14 @@ var formatCustomer = function formatCustomer(data) {
|
|
|
26
26
|
};
|
|
27
27
|
var formatBookings = function formatBookings(data) {
|
|
28
28
|
var list = data.service.value;
|
|
29
|
+
var eventOtherParams = data.eventOtherParams;
|
|
29
30
|
var bookings = [];
|
|
30
31
|
bookings = list.map(function (item) {
|
|
31
32
|
var start_date = item._extend.startDate.format('YYYY-MM-DD');
|
|
32
33
|
var start_time = item._extend.startDate.format("HH:mm");
|
|
33
34
|
var end_date = item._extend.endDate.format('YYYY-MM-DD');
|
|
34
35
|
var end_time = item._extend.endDate.format("HH:mm");
|
|
35
|
-
return {
|
|
36
|
+
return _objectSpread({
|
|
36
37
|
"product": {
|
|
37
38
|
"num": item._extend.quantity,
|
|
38
39
|
"price": item.price,
|
|
@@ -60,7 +61,7 @@ var formatBookings = function formatBookings(data) {
|
|
|
60
61
|
"start_date": start_date,
|
|
61
62
|
"duration": flexibleObj.getValue(item._extend.duration),
|
|
62
63
|
"number": item._extend.number || 1
|
|
63
|
-
};
|
|
64
|
+
}, eventOtherParams || {});
|
|
64
65
|
});
|
|
65
66
|
return bookings;
|
|
66
67
|
};
|
|
@@ -86,7 +87,7 @@ var formatHolder = function formatHolder(data, values) {
|
|
|
86
87
|
// https://menutech.w.eolink.com/home/api-studio/inside/K2bI3n465fe7244b3dbd6679d87caedfbb0636bf8c29eda/api/2778666/detail/53001549?spaceKey=menutech
|
|
87
88
|
export var formatValues = function formatValues(state) {
|
|
88
89
|
var values = {
|
|
89
|
-
type: "appointment_booking",
|
|
90
|
+
type: state.renderType === 'eventBooking' ? "event_booking_v2" : "appointment_booking",
|
|
90
91
|
platform: "shop",
|
|
91
92
|
sales_channel: "my_pisel",
|
|
92
93
|
bookings: [],
|
|
@@ -31,7 +31,8 @@ import "./index.less";
|
|
|
31
31
|
*/
|
|
32
32
|
var Forms = Provider(function (props) {
|
|
33
33
|
var forms = props.forms,
|
|
34
|
-
value = props.value,
|
|
34
|
+
_props$value = props.value,
|
|
35
|
+
value = _props$value === void 0 ? [] : _props$value,
|
|
35
36
|
modalOpen = props.modalOpen,
|
|
36
37
|
onChange = props.onChange,
|
|
37
38
|
action = props.action,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => any;
|
|
2
2
|
export default Booking;
|
|
@@ -141,7 +141,6 @@ var Info = function Info() {
|
|
|
141
141
|
return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || "";
|
|
142
142
|
}, [locales.localeMap]);
|
|
143
143
|
var handleSelectClient = function handleSelectClient(value) {
|
|
144
|
-
console.log("valuevalue", value);
|
|
145
144
|
var _value = (value === null || value === void 0 ? void 0 : value[value.length - 1]) || walkInData;
|
|
146
145
|
if (_value.loading) {
|
|
147
146
|
return;
|
|
@@ -18,6 +18,7 @@ import localeTexts from "../locales";
|
|
|
18
18
|
import { locales } from "@pisell/utils";
|
|
19
19
|
import { findNextDuration, flexibleObj, formatResource, getErrorList, sliceDayIntoFiveMinutes } from "../utils";
|
|
20
20
|
import { updateServiceDate } from "./date";
|
|
21
|
+
import Notes from "./notes";
|
|
21
22
|
import "./index.less";
|
|
22
23
|
var defaultModules = {
|
|
23
24
|
client: 1,
|
|
@@ -28,7 +29,7 @@ var defaultModules = {
|
|
|
28
29
|
};
|
|
29
30
|
locales.init(localeTexts, localStorage.getItem("umi_locale") || "en");
|
|
30
31
|
var Info = Provider(function (props) {
|
|
31
|
-
var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$
|
|
32
|
+
var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$state4, _modal$state4$notes, _modal$state5;
|
|
32
33
|
// return <Payments {...props} />;
|
|
33
34
|
var style = props.style,
|
|
34
35
|
globalState = props.globalState,
|
|
@@ -73,12 +74,28 @@ var Info = Provider(function (props) {
|
|
|
73
74
|
}
|
|
74
75
|
});
|
|
75
76
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
var header = useMemo(function () {
|
|
78
|
+
if ((globalState === null || globalState === void 0 ? void 0 : globalState.renderType) === "eventBooking") {
|
|
79
|
+
return locales.getText("pisell2.text.enroll");
|
|
80
|
+
}
|
|
81
|
+
return globalState !== null && globalState !== void 0 && globalState.bookingId ? /*#__PURE__*/React.createElement(Header, {
|
|
79
82
|
state: modal.state,
|
|
80
83
|
dispatch: modal.dispatch
|
|
81
|
-
}) : locales.getText("pisell2.text.new-appointment")
|
|
84
|
+
}) : locales.getText("pisell2.text.new-appointment");
|
|
85
|
+
}, [globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, modal.state, modal.dispatch, globalState === null || globalState === void 0 ? void 0 : globalState.renderType]);
|
|
86
|
+
var notes = useMemo(function () {
|
|
87
|
+
var _modal$state3, _modal$state3$notes;
|
|
88
|
+
if (!modules.note) {
|
|
89
|
+
return null;
|
|
90
|
+
}
|
|
91
|
+
return globalState !== null && globalState !== void 0 && globalState.bookingId ? globalState.renderType === "eventBooking" ? /*#__PURE__*/React.createElement(Notes, null) : null : /*#__PURE__*/React.createElement(AddNote, {
|
|
92
|
+
value: (_modal$state3 = modal.state) === null || _modal$state3 === void 0 ? void 0 : (_modal$state3$notes = _modal$state3.notes) === null || _modal$state3$notes === void 0 ? void 0 : _modal$state3$notes.orderNote,
|
|
93
|
+
onChange: addNote
|
|
94
|
+
});
|
|
95
|
+
}, [modules.note, globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, globalState.render, (_modal$state4 = modal.state) === null || _modal$state4 === void 0 ? void 0 : (_modal$state4$notes = _modal$state4.notes) === null || _modal$state4$notes === void 0 ? void 0 : _modal$state4$notes.orderNote]);
|
|
96
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, !!modal.state.setGlobalState ? /*#__PURE__*/React.createElement(TabPane, {
|
|
97
|
+
style: style,
|
|
98
|
+
header: header,
|
|
82
99
|
footer: /*#__PURE__*/React.createElement(Footer, {
|
|
83
100
|
state: modal.state,
|
|
84
101
|
dispatch: modal.dispatch,
|
|
@@ -87,9 +104,6 @@ var Info = Provider(function (props) {
|
|
|
87
104
|
bodyClassName: "booking-info-warp"
|
|
88
105
|
}, /*#__PURE__*/React.createElement("div", {
|
|
89
106
|
className: "booking-info"
|
|
90
|
-
}, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$
|
|
91
|
-
value: modal.state.notes.orderNote,
|
|
92
|
-
onChange: addNote
|
|
93
|
-
})) : null, slot ? slot : null)) : null);
|
|
107
|
+
}, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state5 = modal.state) !== null && _modal$state5 !== void 0 && _modal$state5.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === "form" ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, notes, slot ? slot : null)) : null);
|
|
94
108
|
});
|
|
95
109
|
export default Info;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
3
|
export declare const walkInData: {
|
|
3
4
|
id: number;
|
|
4
5
|
nickname: string;
|
|
5
6
|
};
|
|
6
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
7
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
7
8
|
state: FormState;
|
|
8
9
|
} & {
|
|
9
10
|
dispatch: (params: {
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread 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 _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
+
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; }
|
|
7
|
+
import React, { useContext, useMemo } from 'react';
|
|
8
|
+
import { Context } from "../model";
|
|
9
|
+
import { locales } from "@pisell/utils";
|
|
10
|
+
import NoteBlock from "../../notes/NoteBlock";
|
|
11
|
+
var Notes = function Notes() {
|
|
12
|
+
var _modal$state3, _modal$state3$notes, _modal$state5;
|
|
13
|
+
var modal = useContext(Context);
|
|
14
|
+
var orderNote = useMemo(function () {
|
|
15
|
+
var _modal$state, _modal$state$notes, _modal$state2, _modal$state2$notes;
|
|
16
|
+
if (!((_modal$state = modal.state) !== null && _modal$state !== void 0 && (_modal$state$notes = _modal$state.notes) !== null && _modal$state$notes !== void 0 && _modal$state$notes.orderNote)) {
|
|
17
|
+
return [];
|
|
18
|
+
}
|
|
19
|
+
return [{
|
|
20
|
+
id: 0,
|
|
21
|
+
content: ((_modal$state2 = modal.state) === null || _modal$state2 === void 0 ? void 0 : (_modal$state2$notes = _modal$state2.notes) === null || _modal$state2$notes === void 0 ? void 0 : _modal$state2$notes.orderNote) || ""
|
|
22
|
+
}];
|
|
23
|
+
}, [(_modal$state3 = modal.state) === null || _modal$state3 === void 0 ? void 0 : (_modal$state3$notes = _modal$state3.notes) === null || _modal$state3$notes === void 0 ? void 0 : _modal$state3$notes.orderNote]);
|
|
24
|
+
var noteChange = function noteChange(_ref) {
|
|
25
|
+
var note = _ref.note,
|
|
26
|
+
status = _ref.status,
|
|
27
|
+
noteType = _ref.noteType;
|
|
28
|
+
if (noteType === "internal") {
|
|
29
|
+
var _modal$state4;
|
|
30
|
+
var _list = _toConsumableArray((_modal$state4 = modal.state) === null || _modal$state4 === void 0 ? void 0 : _modal$state4.notes.internalNotes);
|
|
31
|
+
if (status == "add") {
|
|
32
|
+
_list.push(note);
|
|
33
|
+
}
|
|
34
|
+
if (status == "remove") {
|
|
35
|
+
_list = _list.filter(function (item) {
|
|
36
|
+
return item.id != note.id;
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (status == "edit") {
|
|
40
|
+
_list = _list.map(function (item) {
|
|
41
|
+
if (item.id == note.id) {
|
|
42
|
+
return note;
|
|
43
|
+
}
|
|
44
|
+
return item;
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
modal.dispatch({
|
|
48
|
+
type: "setNotes",
|
|
49
|
+
payload: {
|
|
50
|
+
internalNotes: _list
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (noteType === "order") {
|
|
56
|
+
modal.dispatch({
|
|
57
|
+
type: "setNotes",
|
|
58
|
+
payload: {
|
|
59
|
+
orderNote: note.content || "",
|
|
60
|
+
edit: false
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
return /*#__PURE__*/React.createElement(NoteBlock, {
|
|
66
|
+
noteType: "order",
|
|
67
|
+
maxLength: 1,
|
|
68
|
+
title: "".concat(locales.getText("pisell2.text.order-notes"), ":"),
|
|
69
|
+
describe: "",
|
|
70
|
+
notes: orderNote,
|
|
71
|
+
apis: modal === null || modal === void 0 ? void 0 : (_modal$state5 = modal.state) === null || _modal$state5 === void 0 ? void 0 : _modal$state5.apis,
|
|
72
|
+
placeholder: locales.getText("pisell2.text.add-order-notes"),
|
|
73
|
+
isEdit: true,
|
|
74
|
+
onChange: function onChange(e, type, noteType) {
|
|
75
|
+
noteChange({
|
|
76
|
+
note: e,
|
|
77
|
+
status: type,
|
|
78
|
+
noteType: noteType
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
export default Notes;
|
|
@@ -28,7 +28,7 @@ import FormsCom from "../../forms/forms";
|
|
|
28
28
|
import { changeFormValues } from "../../forms/format";
|
|
29
29
|
import { isWalkIn } from "../../utils";
|
|
30
30
|
var Pet = function Pet() {
|
|
31
|
-
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$
|
|
31
|
+
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$client$value2, _state$client8, _state$client8$value, _state$client9;
|
|
32
32
|
var _useState = useState(false),
|
|
33
33
|
_useState2 = _slicedToArray(_useState, 2),
|
|
34
34
|
loading = _useState2[0],
|
|
@@ -136,7 +136,6 @@ var Pet = function Pet() {
|
|
|
136
136
|
return _ref2.apply(this, arguments);
|
|
137
137
|
};
|
|
138
138
|
}();
|
|
139
|
-
console.log("values", (_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.value);
|
|
140
139
|
|
|
141
140
|
/**
|
|
142
141
|
* @title: 获取预约主体表单
|
|
@@ -167,7 +166,7 @@ var Pet = function Pet() {
|
|
|
167
166
|
_context2.prev = 5;
|
|
168
167
|
_context2.next = 8;
|
|
169
168
|
return state.apis.getForms({
|
|
170
|
-
relation_type: "appointment_booking",
|
|
169
|
+
relation_type: state.renderType === 'eventBooking' ? "event_booking_v2" : "appointment_booking",
|
|
171
170
|
relation_id: ((_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : (_state$bookingDetail$ = _state$bookingDetail.bookings) === null || _state$bookingDetail$ === void 0 ? void 0 : _state$bookingDetail$.id) || 0
|
|
172
171
|
// _config: { useCache: true },
|
|
173
172
|
});
|
|
@@ -300,11 +299,11 @@ var Pet = function Pet() {
|
|
|
300
299
|
|
|
301
300
|
// 当客户id 发生改变时, 检测当前表单是否是该客户的, 如果不是则移除
|
|
302
301
|
useEffect(function () {
|
|
303
|
-
var _state$
|
|
302
|
+
var _state$pet, _state$client7, _state$client7$value, _state$pet2;
|
|
304
303
|
var changeFormValuesData = changeFormValues({
|
|
305
|
-
values: ((_state$
|
|
304
|
+
values: ((_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.value) || {},
|
|
306
305
|
clientId: (_state$client7 = state.client) === null || _state$client7 === void 0 ? void 0 : (_state$client7$value = _state$client7.value) === null || _state$client7$value === void 0 ? void 0 : _state$client7$value.id,
|
|
307
|
-
forms: ((_state$
|
|
306
|
+
forms: ((_state$pet2 = state.pet) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.formData) || []
|
|
308
307
|
});
|
|
309
308
|
dispatch({
|
|
310
309
|
type: "setPet",
|
|
@@ -326,7 +325,6 @@ var Pet = function Pet() {
|
|
|
326
325
|
getForms(true);
|
|
327
326
|
}
|
|
328
327
|
}, [state.bookingId, state.bookingDetail, params.form_id, params.type, (_state$client8 = state.client) === null || _state$client8 === void 0 ? void 0 : (_state$client8$value = _state$client8.value) === null || _state$client8$value === void 0 ? void 0 : _state$client8$value.id]);
|
|
329
|
-
console.log("state.pet.formData", state.pet.formData);
|
|
330
328
|
return /*#__PURE__*/React.createElement("div", {
|
|
331
329
|
className: "pisell-lowcode__booking-pet-wraps"
|
|
332
330
|
}, /*#__PURE__*/React.createElement(FormsCom, {
|