@pisell/private-materials 3.0.14 → 3.0.16
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- 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/TabProduct/tabs/index.less +4 -1
- package/es/components/booking/components/footer/index.js +6 -3
- 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 +2 -1
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/index.js +14 -6
- 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/service/addService/index.js +101 -11
- package/es/components/booking/info/service/serve.d.ts +1 -0
- package/es/components/booking/info/service/serve.js +21 -0
- package/es/components/booking/info/utils.d.ts +1 -0
- package/es/components/booking/info/utils.js +8 -0
- package/es/components/booking/model.d.ts +2 -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.d.ts +15 -0
- package/es/components/booking/utils.js +22 -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.js +11 -3
- package/es/components/productExtension/fields/SelectResourcesTable/index.js +23 -20
- package/es/components/productExtension/index.js +2 -1
- package/es/components/productExtension/locales.js +5 -5
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- 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/TabProduct/tabs/index.less +4 -1
- package/lib/components/booking/components/footer/index.js +5 -2
- 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 +2 -1
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/index.js +21 -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/service/addService/index.js +53 -0
- package/lib/components/booking/info/service/serve.d.ts +1 -0
- package/lib/components/booking/info/service/serve.js +30 -0
- package/lib/components/booking/info/utils.d.ts +1 -0
- package/lib/components/booking/info/utils.js +35 -0
- package/lib/components/booking/model.d.ts +2 -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.d.ts +15 -0
- package/lib/components/booking/utils.js +14 -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.js +17 -2
- package/lib/components/productExtension/fields/SelectResourcesTable/index.js +19 -20
- package/lib/components/productExtension/index.js +2 -1
- package/lib/components/productExtension/locales.js +5 -5
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/package.json +3 -3
|
@@ -7,12 +7,34 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
7
7
|
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; }
|
|
8
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
9
9
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
11
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
12
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
10
13
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
14
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
15
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
16
|
import dayjs from 'dayjs';
|
|
14
17
|
import { locales } from "@pisell/utils";
|
|
15
18
|
import { intersectionBy } from 'lodash';
|
|
19
|
+
var Request = /*#__PURE__*/function () {
|
|
20
|
+
function Request() {
|
|
21
|
+
_classCallCheck(this, Request);
|
|
22
|
+
_defineProperty(this, "request", {});
|
|
23
|
+
}
|
|
24
|
+
_createClass(Request, [{
|
|
25
|
+
key: "setRequest",
|
|
26
|
+
value: function setRequest(val) {
|
|
27
|
+
this.request = val;
|
|
28
|
+
}
|
|
29
|
+
}, {
|
|
30
|
+
key: "getRequest",
|
|
31
|
+
value: function getRequest() {
|
|
32
|
+
return this.request;
|
|
33
|
+
}
|
|
34
|
+
}]);
|
|
35
|
+
return Request;
|
|
36
|
+
}();
|
|
37
|
+
export var request = new Request();
|
|
16
38
|
export var getDiscountTime = function getDiscountTime(service_times) {
|
|
17
39
|
if (!service_times) {
|
|
18
40
|
return "";
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { image } from "@pisell/utils";
|
|
3
|
+
import XClose from "@pisell/icon/es/XClose";
|
|
4
|
+
import classNames from "classnames";
|
|
5
|
+
import "./index.less";
|
|
6
|
+
var ProductItemPreview = function ProductItemPreview(_ref) {
|
|
7
|
+
var _ref$item = _ref.item,
|
|
8
|
+
item = _ref$item === void 0 ? {} : _ref$item,
|
|
9
|
+
_onClick = _ref.onClick,
|
|
10
|
+
onRemove = _ref.onRemove,
|
|
11
|
+
_ref$amountSymbol = _ref.amountSymbol,
|
|
12
|
+
amountSymbol = _ref$amountSymbol === void 0 ? "$" : _ref$amountSymbol,
|
|
13
|
+
style = _ref.style,
|
|
14
|
+
className = _ref.className;
|
|
15
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
style: style,
|
|
17
|
+
className: classNames("product-item-card-preview", className),
|
|
18
|
+
onClick: function onClick() {
|
|
19
|
+
_onClick(item);
|
|
20
|
+
}
|
|
21
|
+
}, item.cover ? /*#__PURE__*/React.createElement("img", {
|
|
22
|
+
src: image.ali(item.cover, 100),
|
|
23
|
+
className: "product-item-card-preview-cover"
|
|
24
|
+
}) : null, /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
className: "product-item-card-preview-content"
|
|
26
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
className: "product-item-card-preview-title"
|
|
28
|
+
}, item.title)), /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: "product-item-card-preview-close-wrap",
|
|
30
|
+
onClick: function onClick(e) {
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
e.stopPropagation();
|
|
33
|
+
onRemove === null || onRemove === void 0 ? void 0 : onRemove(item);
|
|
34
|
+
}
|
|
35
|
+
}, /*#__PURE__*/React.createElement(XClose, {
|
|
36
|
+
className: "product-item-card-preview-close"
|
|
37
|
+
})));
|
|
38
|
+
};
|
|
39
|
+
export default ProductItemPreview;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.product-item-card-preview {
|
|
2
|
+
padding: 16px;
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 12px;
|
|
7
|
+
|
|
8
|
+
&::before {
|
|
9
|
+
content: "";
|
|
10
|
+
position: absolute;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
left: 50%;
|
|
13
|
+
transform: translate(-50%, -50%);
|
|
14
|
+
width: calc(100% - 40px);
|
|
15
|
+
height: 1px;
|
|
16
|
+
background: #F1F1F1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:last-child {
|
|
20
|
+
&::before {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.product-item-card-preview-cover {
|
|
26
|
+
width: 40px;
|
|
27
|
+
height: 40px;
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
object-fit: cover;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.product-item-card-preview-content {
|
|
33
|
+
flex: 1;
|
|
34
|
+
|
|
35
|
+
.product-item-card-preview-title {
|
|
36
|
+
color: var(--text-text-1, #1B1B1B);
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
line-height: 20px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.product-item-card-preview-close-wrap {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
width: 40px;
|
|
52
|
+
height: 40px;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
|
|
55
|
+
.product-item-card-close {
|
|
56
|
+
font-size: 30px;
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
}
|
|
@@ -9,6 +9,7 @@ import { useRequest } from "ahooks";
|
|
|
9
9
|
import SelectModal from "../../../selectModal";
|
|
10
10
|
import { getProductList } from "./server";
|
|
11
11
|
import ProductItem from "./ProductItem";
|
|
12
|
+
import ProductItemPreview from "./ProductItemPreview";
|
|
12
13
|
import "./index.less";
|
|
13
14
|
import { locales } from "@pisell/utils";
|
|
14
15
|
var SelectProducts = function SelectProducts(_ref) {
|
|
@@ -41,9 +42,15 @@ var SelectProducts = function SelectProducts(_ref) {
|
|
|
41
42
|
skip: 1,
|
|
42
43
|
num: 500,
|
|
43
44
|
with: ["category"],
|
|
44
|
-
open_quotation: 1
|
|
45
|
+
open_quotation: 1,
|
|
46
|
+
exclude_extension_type: ["event_item"]
|
|
45
47
|
});
|
|
46
48
|
}, []);
|
|
49
|
+
var onRemove = function onRemove(item) {
|
|
50
|
+
_onChange === null || _onChange === void 0 ? void 0 : _onChange((value || []).filter(function (d) {
|
|
51
|
+
return (d.id || d.product_id) !== item.id;
|
|
52
|
+
}));
|
|
53
|
+
};
|
|
47
54
|
return /*#__PURE__*/React.createElement(SelectModal, {
|
|
48
55
|
value: _value,
|
|
49
56
|
loading: _getProductList.loading,
|
|
@@ -58,10 +65,11 @@ var SelectProducts = function SelectProducts(_ref) {
|
|
|
58
65
|
},
|
|
59
66
|
dataSource: _getProductList.data,
|
|
60
67
|
renderValueItem: function renderValueItem(item, onSelect) {
|
|
61
|
-
return /*#__PURE__*/React.createElement(
|
|
68
|
+
return /*#__PURE__*/React.createElement(ProductItemPreview, {
|
|
62
69
|
key: item === null || item === void 0 ? void 0 : item.id,
|
|
63
70
|
item: item,
|
|
64
|
-
onClick: onSelect
|
|
71
|
+
onClick: onSelect,
|
|
72
|
+
onRemove: onRemove
|
|
65
73
|
});
|
|
66
74
|
},
|
|
67
75
|
renderOptionItem: function renderOptionItem(item, onSelect) {
|
|
@@ -14,7 +14,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
14
14
|
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; } }
|
|
15
15
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
16
|
import React, { useState, useMemo, useEffect } from "react";
|
|
17
|
-
import {
|
|
17
|
+
import { Select } from "antd";
|
|
18
18
|
// import {} from '@pisell/materials'
|
|
19
19
|
import { locales } from "@pisell/utils";
|
|
20
20
|
import { getFormTypes, getAllResource } from "./server";
|
|
@@ -47,7 +47,8 @@ var SelectResourcesTable = function SelectResourcesTable(_ref) {
|
|
|
47
47
|
_getFormTypes = getFormTypes({
|
|
48
48
|
type: "manual",
|
|
49
49
|
num: 500,
|
|
50
|
-
skip: 1
|
|
50
|
+
skip: 1,
|
|
51
|
+
status: "published"
|
|
51
52
|
}, {
|
|
52
53
|
useCache: true
|
|
53
54
|
});
|
|
@@ -130,24 +131,26 @@ var SelectResourcesTable = function SelectResourcesTable(_ref) {
|
|
|
130
131
|
value: value,
|
|
131
132
|
data: data,
|
|
132
133
|
width: 100
|
|
133
|
-
},
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
},
|
|
134
|
+
},
|
|
135
|
+
// {
|
|
136
|
+
// title: locales.getText("pisell2.text.product-extension.open"),
|
|
137
|
+
// dataIndex: "open",
|
|
138
|
+
// width: 80,
|
|
139
|
+
// render: (text: any, record: any, index: number) => {
|
|
140
|
+
// let cur = value?.find((d: any) => d.form_id === record.form_id);
|
|
141
|
+
// let bol = !!(cur?.form_record_ids || []).length;
|
|
142
|
+
// return (
|
|
143
|
+
// <Switch
|
|
144
|
+
// disabled={!bol}
|
|
145
|
+
// checked={bol}
|
|
146
|
+
// onChange={(e) => {
|
|
147
|
+
// _onChange([], record.id);
|
|
148
|
+
// }}
|
|
149
|
+
// />
|
|
150
|
+
// );
|
|
151
|
+
// },
|
|
152
|
+
// },
|
|
153
|
+
{
|
|
151
154
|
title: locales.getText("pisell2.text.product-extension.options"),
|
|
152
155
|
dataIndex: "form_id",
|
|
153
156
|
render: function render(form_id, record, index) {
|
|
@@ -69,7 +69,8 @@ var ProductExtension = function ProductExtension(_ref) {
|
|
|
69
69
|
message: locales.getText("pisell2.text.product-extension.please-select")
|
|
70
70
|
}] : [],
|
|
71
71
|
key: childIndex,
|
|
72
|
-
noStyle: true
|
|
72
|
+
noStyle: true,
|
|
73
|
+
initialValue: child.key === "event_item_capacity" ? 1 : undefined
|
|
73
74
|
}, renderItem(child, name));
|
|
74
75
|
}));
|
|
75
76
|
}));
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
"en": {
|
|
3
3
|
'pisell2.text.product-extension.please-select': "Please select",
|
|
4
|
-
'pisell2.text.product-extension.cut-off-time': 'Cut-off
|
|
5
|
-
'pisell2.text.product-extension.cut-off-time.desc': '
|
|
4
|
+
'pisell2.text.product-extension.cut-off-time': 'Cut-off Time',
|
|
5
|
+
'pisell2.text.product-extension.cut-off-time.desc': 'Use this setting to prevent last minute events. For example: you can prevent same day booking (set 1 day) or prevent events less than 6 hours away.',
|
|
6
6
|
'pisell2.text.product-extension.future-day': 'Future Day',
|
|
7
7
|
'pisell2.text.product-extension.future-day.hint': 'The maximum number of days in the future that customers can book',
|
|
8
8
|
'pisell2.text.product-extension.days': 'Days',
|
|
@@ -12,12 +12,12 @@ export default {
|
|
|
12
12
|
'pisell2.text.product-extension.add-other-product': 'Add Other Product',
|
|
13
13
|
'pisell2.text.product-extension.resource-type': 'Resource Type',
|
|
14
14
|
'pisell2.text.product-extension.open': 'Open',
|
|
15
|
-
'pisell2.text.product-extension.options': '
|
|
15
|
+
'pisell2.text.product-extension.options': 'Items'
|
|
16
16
|
},
|
|
17
17
|
'zh-CN': {
|
|
18
18
|
'pisell2.text.product-extension.please-select': "请选择",
|
|
19
19
|
'pisell2.text.product-extension.cut-off-time': '截止时间',
|
|
20
|
-
'pisell2.text.product-extension.cut-off-time.desc': '
|
|
20
|
+
'pisell2.text.product-extension.cut-off-time.desc': '使用此设置可防止最后一分钟的事件。 例如:您可以阻止当天预订(设置为 1 天)或阻止距离不到 6 小时的活动。',
|
|
21
21
|
'pisell2.text.product-extension.future-day': '预定天数',
|
|
22
22
|
'pisell2.text.product-extension.future-day.hint': '客户未来最多可预订天数',
|
|
23
23
|
'pisell2.text.product-extension.days': '天',
|
|
@@ -32,7 +32,7 @@ export default {
|
|
|
32
32
|
'zh-HK': {
|
|
33
33
|
'pisell2.text.product-extension.please-select': "請選擇",
|
|
34
34
|
'pisell2.text.product-extension.cut-off-time': '截止时间',
|
|
35
|
-
'pisell2.text.product-extension.cut-off-time.desc': '
|
|
35
|
+
'pisell2.text.product-extension.cut-off-time.desc': '使用此設置可防止最後一分鐘的事件。例如:您可以阻止當天預訂(設置為 1 天)或阻止距離不到 6 小時的活動。',
|
|
36
36
|
'pisell2.text.product-extension.future-day': '預定天數',
|
|
37
37
|
'pisell2.text.product-extension.future-day.hint': '客戶未來最多可預訂天數',
|
|
38
38
|
'pisell2.text.product-extension.days': '天',
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
2
3
|
import dayjs from "dayjs";
|
|
3
4
|
export interface FormState {
|
|
@@ -68,7 +69,7 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
72
73
|
state: FormState;
|
|
73
74
|
} & {
|
|
74
75
|
dispatch: (params: {
|
|
@@ -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: {
|
|
@@ -171,6 +171,9 @@ var Footer = (props) => {
|
|
|
171
171
|
return callbackData;
|
|
172
172
|
} catch (err) {
|
|
173
173
|
console.log(err);
|
|
174
|
+
if ((err == null ? void 0 : err.code) === 70101) {
|
|
175
|
+
import_antd.message.error(err == null ? void 0 : err.message);
|
|
176
|
+
}
|
|
174
177
|
_setLoading(false);
|
|
175
178
|
}
|
|
176
179
|
};
|
|
@@ -384,12 +387,12 @@ var Footer = (props) => {
|
|
|
384
387
|
if (!state.bookingDetail) {
|
|
385
388
|
return true;
|
|
386
389
|
}
|
|
387
|
-
if (!((_a2 = state.addons) == null ? void 0 : _a2.load)) {
|
|
390
|
+
if (!((_a2 = state.addons) == null ? void 0 : _a2.load) && state.renderType !== "eventBooking") {
|
|
388
391
|
return true;
|
|
389
392
|
}
|
|
390
393
|
}
|
|
391
394
|
return false;
|
|
392
|
-
}, [state.bookingId, state.bookingDetail, (_e = state.addons) == null ? void 0 : _e.load]);
|
|
395
|
+
}, [state.bookingId, state.bookingDetail, (_e = state.addons) == null ? void 0 : _e.load, state.renderType]);
|
|
393
396
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { title: false, round: true, loading: showFooter, active: true }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-total" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-total" }, totalText), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-arrears" }, arrearsText)), /* @__PURE__ */ import_react.default.createElement(
|
|
394
397
|
"span",
|
|
395
398
|
{
|
|
@@ -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;
|
|
@@ -46,6 +46,7 @@ var import_locales = __toESM(require("../locales"));
|
|
|
46
46
|
var import_utils = require("@pisell/utils");
|
|
47
47
|
var import_utils2 = require("../utils");
|
|
48
48
|
var import_date2 = require("./date");
|
|
49
|
+
var import_notes = __toESM(require("./notes"));
|
|
49
50
|
var import_index = require("./index.less");
|
|
50
51
|
var defaultModules = {
|
|
51
52
|
client: 1,
|
|
@@ -56,7 +57,7 @@ var defaultModules = {
|
|
|
56
57
|
};
|
|
57
58
|
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
58
59
|
var Info = (0, import_model.Provider)((props) => {
|
|
59
|
-
var _a, _b, _c, _d, _e;
|
|
60
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
60
61
|
const { style, globalState, modules = defaultModules, slot } = props;
|
|
61
62
|
const modal = (0, import_react.useContext)(import_model.Context);
|
|
62
63
|
const params = (0, import_react.useMemo)(() => {
|
|
@@ -101,7 +102,24 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
101
102
|
return import_utils.locales.getText("pisell2.text.enroll");
|
|
102
103
|
}
|
|
103
104
|
return (globalState == null ? void 0 : globalState.bookingId) ? /* @__PURE__ */ import_react.default.createElement(import_header.default, { state: modal.state, dispatch: modal.dispatch }) : import_utils.locales.getText("pisell2.text.new-appointment");
|
|
104
|
-
}, [
|
|
105
|
+
}, [
|
|
106
|
+
globalState == null ? void 0 : globalState.bookingId,
|
|
107
|
+
modal.state,
|
|
108
|
+
modal.dispatch,
|
|
109
|
+
globalState == null ? void 0 : globalState.renderType
|
|
110
|
+
]);
|
|
111
|
+
const notes = (0, import_react.useMemo)(() => {
|
|
112
|
+
var _a2, _b2;
|
|
113
|
+
if (!modules.note) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
return (globalState == null ? void 0 : globalState.bookingId) ? globalState.renderType === "eventBooking" ? /* @__PURE__ */ import_react.default.createElement(import_notes.default, null) : null : /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote, onChange: addNote });
|
|
117
|
+
}, [
|
|
118
|
+
modules.note,
|
|
119
|
+
globalState == null ? void 0 : globalState.bookingId,
|
|
120
|
+
globalState.render,
|
|
121
|
+
(_f = (_e = modal.state) == null ? void 0 : _e.notes) == null ? void 0 : _f.orderNote
|
|
122
|
+
]);
|
|
105
123
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !!modal.state.setGlobalState ? /* @__PURE__ */ import_react.default.createElement(
|
|
106
124
|
import_tabPane.default,
|
|
107
125
|
{
|
|
@@ -117,13 +135,7 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
117
135
|
),
|
|
118
136
|
bodyClassName: "booking-info-warp"
|
|
119
137
|
},
|
|
120
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((
|
|
121
|
-
import_addNote.default,
|
|
122
|
-
{
|
|
123
|
-
value: modal.state.notes.orderNote,
|
|
124
|
-
onChange: addNote
|
|
125
|
-
}
|
|
126
|
-
)) : null, slot ? slot : null)
|
|
138
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_g = modal.state) == null ? void 0 : _g.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)
|
|
127
139
|
) : null);
|
|
128
140
|
});
|
|
129
141
|
var info_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,111 @@
|
|
|
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/notes/index.tsx
|
|
30
|
+
var notes_exports = {};
|
|
31
|
+
__export(notes_exports, {
|
|
32
|
+
default: () => notes_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(notes_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_model = require("../model");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_NoteBlock = __toESM(require("../../notes/NoteBlock"));
|
|
39
|
+
var Notes = () => {
|
|
40
|
+
var _a, _b, _c;
|
|
41
|
+
const modal = (0, import_react.useContext)(import_model.Context);
|
|
42
|
+
const orderNote = (0, import_react.useMemo)(() => {
|
|
43
|
+
var _a2, _b2, _c2, _d;
|
|
44
|
+
if (!((_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote)) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
id: 0,
|
|
50
|
+
content: ((_d = (_c2 = modal.state) == null ? void 0 : _c2.notes) == null ? void 0 : _d.orderNote) || ""
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
}, [(_b = (_a = modal.state) == null ? void 0 : _a.notes) == null ? void 0 : _b.orderNote]);
|
|
54
|
+
const noteChange = ({ note, status, noteType }) => {
|
|
55
|
+
var _a2;
|
|
56
|
+
if (noteType === "internal") {
|
|
57
|
+
let _list = [...(_a2 = modal.state) == null ? void 0 : _a2.notes.internalNotes];
|
|
58
|
+
if (status == "add") {
|
|
59
|
+
_list.push(note);
|
|
60
|
+
}
|
|
61
|
+
if (status == "remove") {
|
|
62
|
+
_list = _list.filter((item) => item.id != note.id);
|
|
63
|
+
}
|
|
64
|
+
if (status == "edit") {
|
|
65
|
+
_list = _list.map((item) => {
|
|
66
|
+
if (item.id == note.id) {
|
|
67
|
+
return note;
|
|
68
|
+
}
|
|
69
|
+
return item;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
modal.dispatch({
|
|
73
|
+
type: "setNotes",
|
|
74
|
+
payload: {
|
|
75
|
+
internalNotes: _list
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (noteType === "order") {
|
|
81
|
+
modal.dispatch({
|
|
82
|
+
type: "setNotes",
|
|
83
|
+
payload: {
|
|
84
|
+
orderNote: note.content || "",
|
|
85
|
+
edit: false
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
91
|
+
import_NoteBlock.default,
|
|
92
|
+
{
|
|
93
|
+
noteType: "order",
|
|
94
|
+
maxLength: 1,
|
|
95
|
+
title: `${import_utils.locales.getText("pisell2.text.order-notes")}:`,
|
|
96
|
+
describe: "",
|
|
97
|
+
notes: orderNote,
|
|
98
|
+
apis: (_c = modal == null ? void 0 : modal.state) == null ? void 0 : _c.apis,
|
|
99
|
+
placeholder: import_utils.locales.getText("pisell2.text.add-order-notes"),
|
|
100
|
+
isEdit: true,
|
|
101
|
+
onChange: (e, type, noteType) => {
|
|
102
|
+
noteChange({
|
|
103
|
+
note: e,
|
|
104
|
+
status: type,
|
|
105
|
+
noteType
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
var notes_default = Notes;
|