@pisell/private-materials 3.0.80 → 3.0.81
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 +1 -2
- package/es/components/booking/components/addButton/index.js +3 -3
- package/es/components/booking/components/customSelect/index.d.ts +0 -2
- package/es/components/booking/components/customSelect/index.js +1 -6
- package/es/components/booking/components/drawer/index.d.ts +0 -1
- package/es/components/booking/components/drawer/index.js +2 -4
- package/es/components/booking/components/footer/index.js +1 -0
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/client/index.js +0 -3
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/index.js +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/info/pet/index.d.ts +1 -10
- package/es/components/booking/info/pet/index.js +14 -22
- package/es/components/booking/info/service/addService/index.d.ts +2 -2
- package/es/components/booking/info/service/addService/index.js +35 -35
- package/es/components/booking/info/utils.d.ts +0 -1
- package/es/components/booking/info/utils.js +0 -12
- package/es/components/booking/locales.d.ts +0 -6
- package/es/components/booking/locales.js +3 -9
- package/es/components/booking/model.d.ts +1 -4
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/es/index.d.ts +0 -1
- package/es/index.js +0 -1
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/addButton/index.js +2 -2
- package/lib/components/booking/components/customSelect/index.d.ts +0 -2
- package/lib/components/booking/components/customSelect/index.js +1 -6
- package/lib/components/booking/components/drawer/index.d.ts +0 -1
- package/lib/components/booking/components/drawer/index.js +2 -2
- package/lib/components/booking/components/footer/index.js +1 -0
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/client/index.js +1 -2
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/index.js +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/info/pet/index.d.ts +1 -10
- package/lib/components/booking/info/pet/index.js +8 -15
- package/lib/components/booking/info/service/addService/index.d.ts +2 -2
- package/lib/components/booking/info/service/addService/index.js +3 -2
- package/lib/components/booking/info/utils.d.ts +0 -1
- package/lib/components/booking/info/utils.js +2 -16
- package/lib/components/booking/locales.d.ts +0 -6
- package/lib/components/booking/locales.js +3 -9
- package/lib/components/booking/model.d.ts +1 -4
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/lib/index.d.ts +0 -1
- package/lib/index.js +2 -5
- package/package.json +2 -2
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -39
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +0 -378
- package/es/components/booking/info/clientVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/index.js +0 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -22
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +0 -321
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.less +0 -66
- package/es/components/booking/info/clientVariant/vertical/index.d.ts +0 -8
- package/es/components/booking/info/clientVariant/vertical/index.js +0 -205
- package/es/components/booking/info/clientVariant/vertical/index.less +0 -61
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -39
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +0 -308
- package/lib/components/booking/info/clientVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/index.js +0 -39
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -22
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +0 -344
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.less +0 -66
- package/lib/components/booking/info/clientVariant/vertical/index.d.ts +0 -8
- package/lib/components/booking/info/clientVariant/vertical/index.js +0 -230
- package/lib/components/booking/info/clientVariant/vertical/index.less +0 -61
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -12,7 +12,7 @@ import PlusCircle from "@pisell/icon/es/PlusCircle";
|
|
|
12
12
|
import "./index.less";
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
import { message, Skeleton } from "antd";
|
|
15
|
-
import {
|
|
15
|
+
import { locales } from "@pisell/utils";
|
|
16
16
|
var AddButton = function AddButton(_ref) {
|
|
17
17
|
var onClick = _ref.onClick,
|
|
18
18
|
showSub = _ref.showSub,
|
|
@@ -48,7 +48,7 @@ var AddButton = function AddButton(_ref) {
|
|
|
48
48
|
return /*#__PURE__*/React.createElement(React.Fragment, null, showSub ? /*#__PURE__*/React.createElement("div", {
|
|
49
49
|
className: "pisell-lowcode__booking-add-button-add-row",
|
|
50
50
|
onClick: _onClick,
|
|
51
|
-
style:
|
|
51
|
+
style: style
|
|
52
52
|
}, /*#__PURE__*/React.createElement(PlusCircle, {
|
|
53
53
|
className: "pisell-lowcode__booking-add-button-add-row-icon"
|
|
54
54
|
}), /*#__PURE__*/React.createElement("span", {
|
|
@@ -58,7 +58,7 @@ var AddButton = function AddButton(_ref) {
|
|
|
58
58
|
"pisell-lowcode__booking-add-button-add-disabled": disabled
|
|
59
59
|
}),
|
|
60
60
|
onClick: _onClick,
|
|
61
|
-
style:
|
|
61
|
+
style: style
|
|
62
62
|
}, /*#__PURE__*/React.createElement("span", {
|
|
63
63
|
className: "pisell-lowcode__booking-add-button-add-label"
|
|
64
64
|
}, title), /*#__PURE__*/React.createElement(ChevronRight, {
|
|
@@ -29,8 +29,6 @@ interface CustomSelectProps {
|
|
|
29
29
|
modalOpen?: boolean;
|
|
30
30
|
closeCallback?: () => any;
|
|
31
31
|
autoFocus?: boolean;
|
|
32
|
-
showDropDown?: boolean;
|
|
33
|
-
handleOpenModal: () => void;
|
|
34
32
|
}
|
|
35
33
|
declare const _default: React.ForwardRefExoticComponent<CustomSelectProps & React.RefAttributes<unknown>>;
|
|
36
34
|
export default _default;
|
|
@@ -70,8 +70,7 @@ var CustomSelect = function CustomSelect(props, ref) {
|
|
|
70
70
|
closeCallback = props.closeCallback,
|
|
71
71
|
autoFocus = props.autoFocus,
|
|
72
72
|
_props$showDropDown = props.showDropDown,
|
|
73
|
-
showDropDown = _props$showDropDown === void 0 ? true : _props$showDropDown
|
|
74
|
-
propsHandleOpenModal = props.handleOpenModal;
|
|
73
|
+
showDropDown = _props$showDropDown === void 0 ? true : _props$showDropDown;
|
|
75
74
|
var searchRef = useRef();
|
|
76
75
|
|
|
77
76
|
// 当前选择的值
|
|
@@ -153,10 +152,6 @@ var CustomSelect = function CustomSelect(props, ref) {
|
|
|
153
152
|
if (disabled) {
|
|
154
153
|
return;
|
|
155
154
|
}
|
|
156
|
-
if (propsHandleOpenModal) {
|
|
157
|
-
propsHandleOpenModal();
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
155
|
if (addButtonProps !== null && addButtonProps !== void 0 && addButtonProps.addCallback) {
|
|
161
156
|
addButtonProps === null || addButtonProps === void 0 ? void 0 : addButtonProps.addCallback();
|
|
162
157
|
}
|
|
@@ -14,9 +14,7 @@ import classNames from "classnames";
|
|
|
14
14
|
*/
|
|
15
15
|
var Drawer = function Drawer(props) {
|
|
16
16
|
var _props$hideScrollBar = props.hideScrollBar,
|
|
17
|
-
hideScrollBar = _props$hideScrollBar === void 0 ? true : _props$hideScrollBar
|
|
18
|
-
_props$showGoBack = props.showGoBack,
|
|
19
|
-
showGoBack = _props$showGoBack === void 0 ? true : _props$showGoBack;
|
|
17
|
+
hideScrollBar = _props$hideScrollBar === void 0 ? true : _props$hideScrollBar;
|
|
20
18
|
return /*#__PURE__*/React.createElement(OriginDrawer, _extends({
|
|
21
19
|
width: "600px",
|
|
22
20
|
closable: false,
|
|
@@ -33,7 +31,7 @@ var Drawer = function Drawer(props) {
|
|
|
33
31
|
mask: false
|
|
34
32
|
}), /*#__PURE__*/React.createElement("div", {
|
|
35
33
|
className: classNames("pisell-lowcode__booking-drawer-title-wrap")
|
|
36
|
-
},
|
|
34
|
+
}, /*#__PURE__*/React.createElement(ArrowLeft, {
|
|
37
35
|
className: "pisell-lowcode__booking-drawer-back",
|
|
38
36
|
onClick: function onClick(e) {
|
|
39
37
|
var _props$onClose;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => JSX.Element;
|
|
2
2
|
export default Booking;
|
|
@@ -371,9 +371,6 @@ var Info = function Info() {
|
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
373
|
handleOpenClientModal();
|
|
374
|
-
},
|
|
375
|
-
style: state.bookingId ? {} : {
|
|
376
|
-
marginTop: 16
|
|
377
374
|
}
|
|
378
375
|
}, /*#__PURE__*/React.createElement(Avatar, {
|
|
379
376
|
className: "pisell-lowcode__booking-client-list-item-avatar",
|
|
@@ -93,7 +93,7 @@ var Info = Provider(function (props) {
|
|
|
93
93
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
94
94
|
className: "",
|
|
95
95
|
style: {
|
|
96
|
-
height:
|
|
96
|
+
height: 20
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
}, [globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, modal.state, modal.dispatch, globalState === null || globalState === void 0 ? void 0 : globalState.renderType]);
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
2
|
export declare const walkInData: {
|
|
4
3
|
id: number;
|
|
5
4
|
nickname: string;
|
|
6
5
|
};
|
|
7
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
8
7
|
state: FormState;
|
|
9
8
|
} & {
|
|
10
9
|
dispatch: (params: {
|
|
@@ -1,13 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import "./index.less";
|
|
3
|
-
|
|
4
|
-
interface PetProps {
|
|
5
|
-
state?: any;
|
|
6
|
-
dispatch?: any;
|
|
7
|
-
hideTitle?: boolean;
|
|
8
|
-
addButtonProps?: InfoProps['addButtonProps'];
|
|
9
|
-
handleOpenModal?: () => void;
|
|
10
|
-
clientChangeNotSetPet?: boolean;
|
|
11
|
-
}
|
|
12
|
-
declare const Pet: (props: PetProps) => React.JSX.Element;
|
|
3
|
+
declare const Pet: () => React.JSX.Element;
|
|
13
4
|
export default Pet;
|
|
@@ -34,12 +34,8 @@ var defaultParams = {
|
|
|
34
34
|
total: 0,
|
|
35
35
|
keyword: ""
|
|
36
36
|
};
|
|
37
|
-
var Pet = function Pet(
|
|
38
|
-
var _context$appHelper,
|
|
39
|
-
var hideTitle = props.hideTitle,
|
|
40
|
-
addButtonProps = props.addButtonProps,
|
|
41
|
-
handleOpenModal = props.handleOpenModal,
|
|
42
|
-
clientChangeNotSetPet = props.clientChangeNotSetPet;
|
|
37
|
+
var Pet = function Pet() {
|
|
38
|
+
var _context$appHelper, _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$bookingConfig6, _state$client$value2, _state$client8, _state$client8$value, _state$pet5, _state$pet5$formData, _state$pet5$formData$, _state$pet5$formData$2, _state$client9;
|
|
43
39
|
var _useState = useState(false),
|
|
44
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
45
41
|
loadLoading = _useState2[0],
|
|
@@ -62,13 +58,11 @@ var Pet = function Pet(props) {
|
|
|
62
58
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
63
59
|
params = _useState8[0],
|
|
64
60
|
setParams = _useState8[1];
|
|
65
|
-
state = state || (props === null || props === void 0 ? void 0 : props.state);
|
|
66
|
-
dispatch = dispatch || (props === null || props === void 0 ? void 0 : props.dispatch);
|
|
67
61
|
// board设置, 获取预约主体
|
|
68
62
|
var boardParams = useMemo(function () {
|
|
69
|
-
var _state
|
|
70
|
-
return (
|
|
71
|
-
}, [
|
|
63
|
+
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2;
|
|
64
|
+
return (state === null || state === void 0 ? void 0 : (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : (_state$bookingConfig$ = _state$bookingConfig.config) === null || _state$bookingConfig$ === void 0 ? void 0 : (_state$bookingConfig$2 = _state$bookingConfig$.basic) === null || _state$bookingConfig$2 === void 0 ? void 0 : _state$bookingConfig$2.appointment_subject) || {};
|
|
65
|
+
}, [state === null || state === void 0 ? void 0 : (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 ? void 0 : (_state$bookingConfig3 = _state$bookingConfig2.config) === null || _state$bookingConfig3 === void 0 ? void 0 : (_state$bookingConfig4 = _state$bookingConfig3.basic) === null || _state$bookingConfig4 === void 0 ? void 0 : _state$bookingConfig4.appointment_subject]);
|
|
72
66
|
|
|
73
67
|
/**
|
|
74
68
|
* @title: 预约主体
|
|
@@ -79,8 +73,8 @@ var Pet = function Pet(props) {
|
|
|
79
73
|
* @Date: 2024-01-27 14:22
|
|
80
74
|
*/
|
|
81
75
|
var petForm = useMemo(function () {
|
|
82
|
-
var _state$
|
|
83
|
-
var _holder = (_state$
|
|
76
|
+
var _state$bookingConfig5;
|
|
77
|
+
var _holder = (_state$bookingConfig5 = state.bookingConfig) === null || _state$bookingConfig5 === void 0 ? void 0 : _state$bookingConfig5.holder;
|
|
84
78
|
if (!_holder) {
|
|
85
79
|
return null;
|
|
86
80
|
}
|
|
@@ -91,7 +85,7 @@ var Pet = function Pet(props) {
|
|
|
91
85
|
relation_type: "appointment_booking",
|
|
92
86
|
form_record: []
|
|
93
87
|
});
|
|
94
|
-
}, [(_state$
|
|
88
|
+
}, [(_state$bookingConfig6 = state.bookingConfig) === null || _state$bookingConfig6 === void 0 ? void 0 : _state$bookingConfig6.holder]);
|
|
95
89
|
|
|
96
90
|
/**
|
|
97
91
|
* @title: 获取表单数据
|
|
@@ -351,7 +345,6 @@ var Pet = function Pet(props) {
|
|
|
351
345
|
// 当客户id 发生改变时, 检测当前表单是否是该客户的, 如果不是则移除
|
|
352
346
|
useEffect(function () {
|
|
353
347
|
var _state$pet, _state$client7, _state$client7$value, _state$pet2;
|
|
354
|
-
if (clientChangeNotSetPet) return;
|
|
355
348
|
var changeFormValuesData = changeFormValues({
|
|
356
349
|
values: ((_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.value) || {},
|
|
357
350
|
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,
|
|
@@ -365,7 +358,7 @@ var Pet = function Pet(props) {
|
|
|
365
358
|
}
|
|
366
359
|
});
|
|
367
360
|
});
|
|
368
|
-
}, [(_state$client$value2 = state.client.value) === null || _state$client$value2 === void 0 ? void 0 : _state$client$value2.id
|
|
361
|
+
}, [(_state$client$value2 = state.client.value) === null || _state$client$value2 === void 0 ? void 0 : _state$client$value2.id]);
|
|
369
362
|
var handleUpdateForm = function handleUpdateForm() {
|
|
370
363
|
if (state.bookingId) {
|
|
371
364
|
// 编辑时 必须获取详情后在获取预约主体信息
|
|
@@ -383,7 +376,7 @@ var Pet = function Pet(props) {
|
|
|
383
376
|
setTimeout(function () {
|
|
384
377
|
handleUpdateForm();
|
|
385
378
|
}, 10);
|
|
386
|
-
}, [state.bookingId, state.bookingDetail, boardParams.form_id, boardParams.type,
|
|
379
|
+
}, [state.bookingId, state.bookingDetail, boardParams.form_id, boardParams.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, state.renderType, petForm]);
|
|
387
380
|
var _addCallback = function addCallback(_params) {
|
|
388
381
|
var _state$pet3, _state$pet3$formData;
|
|
389
382
|
var _formData = (_state$pet3 = state.pet) === null || _state$pet3 === void 0 ? void 0 : (_state$pet3$formData = _state$pet3.formData) === null || _state$pet3$formData === void 0 ? void 0 : _state$pet3$formData[0];
|
|
@@ -427,7 +420,7 @@ var Pet = function Pet(props) {
|
|
|
427
420
|
active: true,
|
|
428
421
|
round: true
|
|
429
422
|
}, /*#__PURE__*/React.createElement(FormsCom, {
|
|
430
|
-
hideTitle:
|
|
423
|
+
hideTitle: true,
|
|
431
424
|
watch: {
|
|
432
425
|
value: state.pet.value
|
|
433
426
|
},
|
|
@@ -456,8 +449,7 @@ var Pet = function Pet(props) {
|
|
|
456
449
|
loadMore: loadMore,
|
|
457
450
|
filterItem: function filterItem() {
|
|
458
451
|
return true;
|
|
459
|
-
}
|
|
460
|
-
handleOpenModal: handleOpenModal
|
|
452
|
+
}
|
|
461
453
|
},
|
|
462
454
|
optionRender: function optionRender(item) {
|
|
463
455
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
@@ -492,7 +484,7 @@ var Pet = function Pet(props) {
|
|
|
492
484
|
}
|
|
493
485
|
}, locales.getText("pisell2.text.edit"))));
|
|
494
486
|
},
|
|
495
|
-
addButtonProps:
|
|
487
|
+
addButtonProps: {
|
|
496
488
|
style: {
|
|
497
489
|
margin: 0
|
|
498
490
|
},
|
|
@@ -515,7 +507,7 @@ var Pet = function Pet(props) {
|
|
|
515
507
|
}
|
|
516
508
|
return addCallback;
|
|
517
509
|
}()
|
|
518
|
-
}
|
|
510
|
+
}
|
|
519
511
|
})));
|
|
520
512
|
};
|
|
521
513
|
export default Pet;
|
|
@@ -17,25 +17,25 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
17
17
|
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; }
|
|
18
18
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
|
-
import React, { useContext, useEffect, useMemo, useState, useRef } from
|
|
21
|
-
import SearchLg from
|
|
20
|
+
import React, { useContext, useEffect, useMemo, useState, useRef } from 'react';
|
|
21
|
+
import SearchLg from '@pisell/icon/es/SearchLg';
|
|
22
22
|
import Drawer from "../../../components/drawer";
|
|
23
23
|
import TabProduct from "../../../components/TabProduct";
|
|
24
24
|
import { Context } from "../../model";
|
|
25
25
|
import AddButton from "../../../components/addButton";
|
|
26
|
-
import { Input, Skeleton } from
|
|
26
|
+
import { Input, Skeleton } from 'antd';
|
|
27
27
|
import "./index.less";
|
|
28
28
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
29
29
|
import { getProductDetail } from "../serve";
|
|
30
30
|
import { getIsBundleOrCombination } from "../../utils";
|
|
31
31
|
import { getProductExtend } from "./utils";
|
|
32
32
|
import { formatProductListByCategory, getProductTotalPrice, request } from "../../../utils";
|
|
33
|
-
import { locales, getUniqueId } from
|
|
34
|
-
import { useUpdateEffect } from
|
|
35
|
-
var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978];
|
|
33
|
+
import { locales, getUniqueId } from '@pisell/utils';
|
|
34
|
+
import { useUpdateEffect } from 'ahooks';
|
|
35
|
+
var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386];
|
|
36
36
|
var Info = function Info() {
|
|
37
37
|
var _state$service3, _state$service5, _state$service6, _state$service6$cache;
|
|
38
|
-
var _useState = useState(
|
|
38
|
+
var _useState = useState(''),
|
|
39
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
40
40
|
search = _useState2[0],
|
|
41
41
|
setSearch = _useState2[1];
|
|
@@ -64,7 +64,7 @@ var Info = function Info() {
|
|
|
64
64
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
65
65
|
while (1) switch (_context.prev = _context.next) {
|
|
66
66
|
case 0:
|
|
67
|
-
if (!(state.renderType !==
|
|
67
|
+
if (!(state.renderType !== 'eventBooking')) {
|
|
68
68
|
_context.next = 2;
|
|
69
69
|
break;
|
|
70
70
|
}
|
|
@@ -93,7 +93,7 @@ var Info = function Info() {
|
|
|
93
93
|
product = list[0];
|
|
94
94
|
_context.next = 13;
|
|
95
95
|
return getProductDetail(product.id, {
|
|
96
|
-
schedule_date: state.date.value.format(
|
|
96
|
+
schedule_date: state.date.value.format('YYYY-MM-DD')
|
|
97
97
|
});
|
|
98
98
|
case 13:
|
|
99
99
|
detail = _context.sent;
|
|
@@ -115,7 +115,7 @@ var Info = function Info() {
|
|
|
115
115
|
start_date: state.date.value,
|
|
116
116
|
startDate: state.date.value,
|
|
117
117
|
endDate: state.date.value,
|
|
118
|
-
start_time:
|
|
118
|
+
start_time: '00:00:00',
|
|
119
119
|
duration: 10,
|
|
120
120
|
quantity: 1,
|
|
121
121
|
price: product.price,
|
|
@@ -126,7 +126,7 @@ var Info = function Info() {
|
|
|
126
126
|
});
|
|
127
127
|
_list.push(_item);
|
|
128
128
|
dispatch({
|
|
129
|
-
type:
|
|
129
|
+
type: 'setService',
|
|
130
130
|
payload: {
|
|
131
131
|
value: _list,
|
|
132
132
|
edit: true
|
|
@@ -154,12 +154,12 @@ var Info = function Info() {
|
|
|
154
154
|
return state.apis.getServices({
|
|
155
155
|
skip: 1,
|
|
156
156
|
num: 500,
|
|
157
|
-
extension_type: state.renderType ===
|
|
158
|
-
with: [
|
|
159
|
-
ids: state.renderType ===
|
|
157
|
+
extension_type: state.renderType === 'eventBooking' ? undefined : ['product_appointment', 'appointment_ticket'],
|
|
158
|
+
with: ['category'],
|
|
159
|
+
ids: state.renderType === 'eventBooking' ? (_state$eventOtherPara = state.eventOtherParams) === null || _state$eventOtherPara === void 0 ? void 0 : _state$eventOtherPara.productIds : undefined,
|
|
160
160
|
open_quotation: 1,
|
|
161
161
|
with_schedule: 1,
|
|
162
|
-
with_count: [
|
|
162
|
+
with_count: ['bundleGroup', 'optionGroup'],
|
|
163
163
|
_config: {
|
|
164
164
|
useCache: true
|
|
165
165
|
}
|
|
@@ -173,7 +173,7 @@ var Info = function Info() {
|
|
|
173
173
|
setDefaultService(data === null || data === void 0 ? void 0 : data.list);
|
|
174
174
|
}
|
|
175
175
|
dispatch({
|
|
176
|
-
type:
|
|
176
|
+
type: 'setService',
|
|
177
177
|
payload: {
|
|
178
178
|
services: (data === null || data === void 0 ? void 0 : data.list) || []
|
|
179
179
|
}
|
|
@@ -190,7 +190,7 @@ var Info = function Info() {
|
|
|
190
190
|
}();
|
|
191
191
|
var handleSelectService = function handleSelectService() {
|
|
192
192
|
dispatch({
|
|
193
|
-
type:
|
|
193
|
+
type: 'setService',
|
|
194
194
|
payload: {
|
|
195
195
|
addModal: true
|
|
196
196
|
}
|
|
@@ -204,12 +204,12 @@ var Info = function Info() {
|
|
|
204
204
|
};
|
|
205
205
|
var handleSelectProduct = function handleSelectProduct(item, type) {
|
|
206
206
|
// 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
|
|
207
|
-
var isEject = type ===
|
|
207
|
+
var isEject = type === 'detail' || item.bundle_group_count > 0;
|
|
208
208
|
state.action({
|
|
209
|
-
type:
|
|
209
|
+
type: 'pisell1.handleOpenProductModal',
|
|
210
210
|
data: {
|
|
211
211
|
id: item.id,
|
|
212
|
-
date: state.date.value.format(
|
|
212
|
+
date: state.date.value.format('YYYY-MM-DD'),
|
|
213
213
|
showConfig: {
|
|
214
214
|
option: false,
|
|
215
215
|
session: false,
|
|
@@ -247,14 +247,14 @@ var Info = function Info() {
|
|
|
247
247
|
cacheItem: cacheItem,
|
|
248
248
|
state: state
|
|
249
249
|
});
|
|
250
|
-
if (state.renderType ===
|
|
250
|
+
if (state.renderType === 'eventBooking') {
|
|
251
251
|
cacheItem.autoClose = false;
|
|
252
252
|
} else {
|
|
253
253
|
var _state$service;
|
|
254
254
|
cacheItem.autoClose = !_isEdit && (cacheItem._extend.resource || cacheItem._extend.resource === 0 || (((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.resourcesOrigin) || []).length === 1);
|
|
255
255
|
}
|
|
256
256
|
dispatch({
|
|
257
|
-
type:
|
|
257
|
+
type: 'setService',
|
|
258
258
|
payload: {
|
|
259
259
|
editModal: true,
|
|
260
260
|
cacheItem: cacheItem,
|
|
@@ -264,7 +264,7 @@ var Info = function Info() {
|
|
|
264
264
|
}
|
|
265
265
|
});
|
|
266
266
|
};
|
|
267
|
-
console.log(
|
|
267
|
+
console.log('state.service.cacheItem', state.service.cacheItem);
|
|
268
268
|
var renderList = useMemo(function () {
|
|
269
269
|
var _state$service2;
|
|
270
270
|
var _list = ((_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.services) || [];
|
|
@@ -282,12 +282,12 @@ var Info = function Info() {
|
|
|
282
282
|
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _state$service4, _state$service4$value;
|
|
283
283
|
// Salonip 不要这个
|
|
284
284
|
|
|
285
|
-
if (shopList.includes((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut3 === void 0 ? void 0 : (_context$appHelper$ut4 = _context$appHelper$ut3.global) === null || _context$appHelper$ut4 === void 0 ? void 0 : (_context$appHelper$ut5 = _context$appHelper$ut4.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id)
|
|
285
|
+
if (shopList.includes((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut3 === void 0 ? void 0 : (_context$appHelper$ut4 = _context$appHelper$ut3.global) === null || _context$appHelper$ut4 === void 0 ? void 0 : (_context$appHelper$ut5 = _context$appHelper$ut4.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id)) {
|
|
286
286
|
return;
|
|
287
287
|
}
|
|
288
288
|
|
|
289
289
|
// 如果弹窗打开,并且是创建, 则自动打开选择服务的弹窗
|
|
290
|
-
if (state.modalOpen && !state.bookingId && state.renderType !==
|
|
290
|
+
if (state.modalOpen && !state.bookingId && state.renderType !== 'eventBooking' && ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : (_state$service4$value = _state$service4.value) === null || _state$service4$value === void 0 ? void 0 : _state$service4$value.length) === 0) {
|
|
291
291
|
handleSelectService();
|
|
292
292
|
}
|
|
293
293
|
}, [state.modalOpen, state.bookingId, (_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.value]);
|
|
@@ -297,16 +297,16 @@ var Info = function Info() {
|
|
|
297
297
|
useUpdateEffect(function () {
|
|
298
298
|
if (state.service.addModal) {
|
|
299
299
|
getServices();
|
|
300
|
-
setSearch(
|
|
300
|
+
setSearch('');
|
|
301
301
|
}
|
|
302
302
|
}, [state.service.addModal]);
|
|
303
303
|
useEffect(function () {
|
|
304
|
-
if (state.renderType ===
|
|
304
|
+
if (state.renderType === 'eventBooking' && state.modalOpen) {
|
|
305
305
|
getServices();
|
|
306
306
|
}
|
|
307
307
|
}, [state.renderType, state.modalOpen]);
|
|
308
308
|
var addButton = useMemo(function () {
|
|
309
|
-
if (state.renderType ===
|
|
309
|
+
if (state.renderType === 'eventBooking') {
|
|
310
310
|
return isService ? /*#__PURE__*/React.createElement("div", {
|
|
311
311
|
style: {
|
|
312
312
|
height: 20
|
|
@@ -314,15 +314,15 @@ var Info = function Info() {
|
|
|
314
314
|
}) : /*#__PURE__*/React.createElement(AddButton, {
|
|
315
315
|
loading: loading,
|
|
316
316
|
showSub: false,
|
|
317
|
-
title: locales.getText(
|
|
318
|
-
subTitle: locales.getText(
|
|
317
|
+
title: locales.getText('pisell2.text.add-a-service'),
|
|
318
|
+
subTitle: locales.getText('pisell2.text.add-another-service'),
|
|
319
319
|
onClick: handleSelectService
|
|
320
320
|
});
|
|
321
321
|
}
|
|
322
322
|
return showAddButton ? /*#__PURE__*/React.createElement(AddButton, {
|
|
323
323
|
showSub: isService,
|
|
324
|
-
title: locales.getText(
|
|
325
|
-
subTitle: locales.getText(
|
|
324
|
+
title: locales.getText('pisell2.text.add-a-service'),
|
|
325
|
+
subTitle: locales.getText('pisell2.text.add-another-service'),
|
|
326
326
|
onClick: handleSelectService
|
|
327
327
|
}) : /*#__PURE__*/React.createElement("div", {
|
|
328
328
|
style: {
|
|
@@ -336,11 +336,11 @@ var Info = function Info() {
|
|
|
336
336
|
round: true
|
|
337
337
|
}), addButton, /*#__PURE__*/React.createElement(Drawer, {
|
|
338
338
|
open: state.service.addModal,
|
|
339
|
-
title: locales.getText(
|
|
339
|
+
title: locales.getText('pisell2.text.select-service'),
|
|
340
340
|
rootClassName: "booking-server-wrap",
|
|
341
341
|
onClose: function onClose() {
|
|
342
342
|
dispatch({
|
|
343
|
-
type:
|
|
343
|
+
type: 'setService',
|
|
344
344
|
payload: {
|
|
345
345
|
addModal: false
|
|
346
346
|
}
|
|
@@ -355,7 +355,7 @@ var Info = function Info() {
|
|
|
355
355
|
marginTop: 16,
|
|
356
356
|
height: 44
|
|
357
357
|
},
|
|
358
|
-
placeholder: locales.getText(
|
|
358
|
+
placeholder: locales.getText('pisell2.text.search'),
|
|
359
359
|
allowClear: true,
|
|
360
360
|
value: search,
|
|
361
361
|
onChange: function onChange(e) {
|
|
@@ -5,16 +5,4 @@ export var getIsBundleOrCombination = function getIsBundleOrCombination(productD
|
|
|
5
5
|
return true;
|
|
6
6
|
}
|
|
7
7
|
return false;
|
|
8
|
-
};
|
|
9
|
-
export var uniqueByField = function uniqueByField(arr, field) {
|
|
10
|
-
var seen = new Set();
|
|
11
|
-
return arr.filter(function (item) {
|
|
12
|
-
var fieldValue = item[field];
|
|
13
|
-
if (seen.has(fieldValue)) {
|
|
14
|
-
return false;
|
|
15
|
-
} else {
|
|
16
|
-
seen.add(fieldValue);
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
8
|
};
|
|
@@ -157,8 +157,6 @@ declare const _default: {
|
|
|
157
157
|
'page.booking.text.fully-booked': string;
|
|
158
158
|
'page.booking.text.unlimited': string;
|
|
159
159
|
'pisell2.text.terminal-edit-message': string;
|
|
160
|
-
"pisell2.text.actions": string;
|
|
161
|
-
"pisell2.text.add-client": string;
|
|
162
160
|
};
|
|
163
161
|
'zh-CN': {
|
|
164
162
|
'pisell2.text.refunded-amount': string;
|
|
@@ -318,8 +316,6 @@ declare const _default: {
|
|
|
318
316
|
'page.booking.text.available': string;
|
|
319
317
|
'page.booking.text.fully-booked': string;
|
|
320
318
|
'page.booking.text.unlimited': string;
|
|
321
|
-
"pisell2.text.actions": string;
|
|
322
|
-
"pisell2.text.add-client": string;
|
|
323
319
|
};
|
|
324
320
|
'zh-HK': {
|
|
325
321
|
'pisell2.text.refunded-amount': string;
|
|
@@ -479,8 +475,6 @@ declare const _default: {
|
|
|
479
475
|
'page.booking.text.available': string;
|
|
480
476
|
'page.booking.text.fully-booked': string;
|
|
481
477
|
'page.booking.text.unlimited': string;
|
|
482
|
-
"pisell2.text.actions": string;
|
|
483
|
-
"pisell2.text.add-client": string;
|
|
484
478
|
};
|
|
485
479
|
};
|
|
486
480
|
export default _default;
|
|
@@ -171,9 +171,7 @@ export default {
|
|
|
171
171
|
'page.booking.text.available': 'Available',
|
|
172
172
|
'page.booking.text.fully-booked': 'Fully booked',
|
|
173
173
|
'page.booking.text.unlimited': 'Unlimited',
|
|
174
|
-
'pisell2.text.terminal-edit-message': "This operation cannot be performed. To proceed, please use the Pisell Terminal."
|
|
175
|
-
"pisell2.text.actions": "Actions",
|
|
176
|
-
"pisell2.text.add-client": "Add customer"
|
|
174
|
+
'pisell2.text.terminal-edit-message': "This operation cannot be performed. To proceed, please use the Pisell Terminal."
|
|
177
175
|
},
|
|
178
176
|
'zh-CN': {
|
|
179
177
|
'pisell2.text.refunded-amount': '已退金额',
|
|
@@ -352,9 +350,7 @@ export default {
|
|
|
352
350
|
'page.booking.text.unavailable': '不可用',
|
|
353
351
|
'page.booking.text.available': '可用',
|
|
354
352
|
'page.booking.text.fully-booked': '已约满',
|
|
355
|
-
'page.booking.text.unlimited': '无限制'
|
|
356
|
-
"pisell2.text.actions": "操作选项",
|
|
357
|
-
"pisell2.text.add-client": "添加客户"
|
|
353
|
+
'page.booking.text.unlimited': '无限制'
|
|
358
354
|
},
|
|
359
355
|
'zh-HK': {
|
|
360
356
|
'pisell2.text.refunded-amount': '已退金額',
|
|
@@ -533,8 +529,6 @@ export default {
|
|
|
533
529
|
'page.booking.text.unavailable': '不可用',
|
|
534
530
|
'page.booking.text.available': '可用',
|
|
535
531
|
'page.booking.text.fully-booked': '已約滿',
|
|
536
|
-
'page.booking.text.unlimited': '無限制'
|
|
537
|
-
"pisell2.text.actions": "操作選項",
|
|
538
|
-
"pisell2.text.add-client": "添加客戶"
|
|
532
|
+
'page.booking.text.unlimited': '無限制'
|
|
539
533
|
}
|
|
540
534
|
};
|