@pisell/private-materials 3.0.151 → 3.0.152
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +12 -12
- package/es/components/booking/components/footer/index.js +48 -33
- package/es/components/booking/components/footer/utils.js +35 -4
- package/es/components/booking/index.js +1 -1
- package/es/components/booking/info/index.d.ts +4 -12
- package/es/components/booking/info/index.js +12 -122
- package/es/components/booking/info/main.d.ts +12 -0
- package/es/components/booking/info/main.js +124 -0
- package/es/components/booking/info/model.js +0 -1
- package/es/components/booking/info/service/addTimeModal/index.js +4 -4
- package/es/components/booking/info/utils.d.ts +1 -0
- package/es/components/booking/info/utils.js +7 -0
- package/es/components/booking/info2/index.d.ts +12 -0
- package/es/components/booking/info2/index.js +216 -0
- package/es/components/booking/info2/serve.d.ts +6 -0
- package/es/components/booking/info2/serve.js +79 -0
- package/es/components/booking/info2/service/actions/index.d.ts +6 -0
- package/es/components/booking/info2/service/actions/index.js +86 -0
- package/es/components/booking/info2/service/addService/index.d.ts +6 -0
- package/es/components/booking/info2/service/addService/index.js +404 -0
- package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/es/components/booking/info2/service/addService/mock.js +332 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/es/components/booking/info2/service/addService/utils.js +510 -0
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
- package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/es/components/booking/info2/service/addTimeModal/serve.js +73 -0
- package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
- package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
- package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
- package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
- package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/es/components/booking/info2/service/editService/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/index.js +617 -0
- package/es/components/booking/info2/service/editService/index.less +99 -0
- package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/es/components/booking/info2/service/editService/utils.js +37 -0
- package/es/components/booking/info2/service/index.d.ts +4 -0
- package/es/components/booking/info2/service/index.js +55 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/es/components/booking/info2/service/serviceItem/index.js +176 -0
- package/es/components/booking/info2/service/serviceItem/index.less +125 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/es/components/booking/info2/service/serviceList/index.js +106 -0
- package/es/components/booking/info2/service/serviceList/index.less +0 -0
- package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/es/components/booking/info2/utilsByBooking.js +349 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +12 -3
- package/es/components/booking/materiels/resources/index.d.ts +2 -2
- package/es/components/booking/materiels/resources/index.js +11 -11
- package/es/components/booking/mock.d.ts +1 -0
- package/es/components/booking/mock.js +66 -0
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/index.d.ts +1 -1
- package/es/components/index.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/components/booking/components/footer/index.js +28 -5
- package/lib/components/booking/components/footer/utils.js +29 -4
- package/lib/components/booking/index.js +2 -2
- package/lib/components/booking/info/index.d.ts +4 -12
- package/lib/components/booking/info/index.js +14 -115
- package/lib/components/booking/info/main.d.ts +12 -0
- package/lib/components/booking/info/main.js +152 -0
- package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
- package/lib/components/booking/info/utils.d.ts +1 -0
- package/lib/components/booking/info/utils.js +9 -0
- package/lib/components/booking/info2/index.d.ts +12 -0
- package/lib/components/booking/info2/index.js +202 -0
- package/lib/components/booking/info2/serve.d.ts +6 -0
- package/lib/components/booking/info2/serve.js +53 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
- package/lib/components/booking/info2/service/actions/index.js +102 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
- package/lib/components/booking/info2/service/addService/index.js +356 -0
- package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/lib/components/booking/info2/service/addService/mock.js +398 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/lib/components/booking/info2/service/addService/utils.js +377 -0
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
- package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
- package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/index.js +483 -0
- package/lib/components/booking/info2/service/editService/index.less +99 -0
- package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/lib/components/booking/info2/service/editService/utils.js +0 -0
- package/lib/components/booking/info2/service/index.d.ts +4 -0
- package/lib/components/booking/info2/service/index.js +75 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
- package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/lib/components/booking/info2/service/serviceList/index.js +130 -0
- package/lib/components/booking/info2/service/serviceList/index.less +0 -0
- package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/lib/components/booking/info2/utilsByBooking.js +257 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +6 -3
- package/lib/components/booking/materiels/resources/index.d.ts +2 -2
- package/lib/components/booking/mock.d.ts +1 -0
- package/lib/components/booking/mock.js +67 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/index.js +3 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
.pisell-lowcode__booking-service-body-edit {
|
|
2
|
+
padding: 24px 32px 100px !important;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
.pisell-lowcode__booking-service-body-edit-footer {
|
|
7
|
+
position: absolute;
|
|
8
|
+
bottom: 0;
|
|
9
|
+
left: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
border-top: 1px solid #E7E8E9;
|
|
12
|
+
padding: 20px 32px;
|
|
13
|
+
display: flex;
|
|
14
|
+
align-items: center;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
gap: 12px;
|
|
17
|
+
background-color: #fff;
|
|
18
|
+
|
|
19
|
+
.pisell-lowcode__booking-service-delete-wrap {
|
|
20
|
+
height: 48px;
|
|
21
|
+
width: 48px;
|
|
22
|
+
border-radius: 8px;
|
|
23
|
+
border: 1px solid var(--gray-300, #D0D5DD);
|
|
24
|
+
background: var(--base-white, #FFF);
|
|
25
|
+
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
|
|
31
|
+
.pisell-lowcode__booking-service-delete-icon {
|
|
32
|
+
color: #B42318;
|
|
33
|
+
font-size: 20px;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.pisell-lowcode__booking-service-body-edit-footer-apple {
|
|
38
|
+
flex: 1;
|
|
39
|
+
height: 48px;
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
justify-content: center;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pisell-lowcode-select-selection-item {
|
|
47
|
+
.resource-option {
|
|
48
|
+
padding-left: 0;
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.pisell-lowcode-select-item-option-content {
|
|
54
|
+
.resource-option {
|
|
55
|
+
padding-left: 0;
|
|
56
|
+
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.resource-option {
|
|
61
|
+
display: flex;
|
|
62
|
+
align-items: center;
|
|
63
|
+
gap: 8px;
|
|
64
|
+
|
|
65
|
+
.resource-option-alert-icon {
|
|
66
|
+
color: #B42318;
|
|
67
|
+
cursor: pointer;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.current-service-info {
|
|
72
|
+
min-height: 40px;
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
background-color: #ffffff;
|
|
75
|
+
border: 1px solid #D0D5DD;
|
|
76
|
+
border-radius: 10px;
|
|
77
|
+
transition: all 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
|
|
78
|
+
overflow: hidden;
|
|
79
|
+
padding: 11px;
|
|
80
|
+
|
|
81
|
+
.current-service-info-name-wrap {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
gap: 12px;
|
|
85
|
+
|
|
86
|
+
.current-service-info-name {
|
|
87
|
+
font-size: 16px;
|
|
88
|
+
color: #101828;
|
|
89
|
+
font-weight: 650;
|
|
90
|
+
flex: 1;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.current-service-info-change-btn {}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
&:hover {
|
|
97
|
+
border-color: #7f56d9;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
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; }
|
|
3
|
+
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; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
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); }
|
|
7
|
+
/**
|
|
8
|
+
1. 在进入编辑服务前
|
|
9
|
+
|
|
10
|
+
计算出各种需要的列表
|
|
11
|
+
|
|
12
|
+
设置默认值
|
|
13
|
+
|
|
14
|
+
判断是否需要进入编辑服务页
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
var isNewService = function isNewService(service) {
|
|
18
|
+
return !service.new && service._extend.endDate;
|
|
19
|
+
};
|
|
20
|
+
var init = function init(_ref) {
|
|
21
|
+
var cacheItem = _ref.cacheItem,
|
|
22
|
+
state = _ref.state;
|
|
23
|
+
var _cacheItem = _objectSpread({}, cacheItem);
|
|
24
|
+
var renderData = {};
|
|
25
|
+
var _extend = {};
|
|
26
|
+
|
|
27
|
+
// 时间切片
|
|
28
|
+
var timeObj = getTimeObj({
|
|
29
|
+
cacheItem: cacheItem,
|
|
30
|
+
currentResource: null,
|
|
31
|
+
state: state
|
|
32
|
+
});
|
|
33
|
+
var isAutoClose = true;
|
|
34
|
+
var _isNewService = isNewService(cacheItem);
|
|
35
|
+
if (!_isNewService) {}
|
|
36
|
+
return _objectSpread({}, cacheItem);
|
|
37
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React, { useEffect, useContext, useMemo, useRef } from 'react';
|
|
2
|
+
import AddService from "./addService";
|
|
3
|
+
import { Context } from "../../info/model";
|
|
4
|
+
import EditService from "./editService";
|
|
5
|
+
import "../../info/service/index.less";
|
|
6
|
+
import ServiceList from "./serviceList";
|
|
7
|
+
import AddTimeModal from "./addTimeModal";
|
|
8
|
+
var Service = function Service() {
|
|
9
|
+
var _state$bookingConfig2, _state$bookingConfig3;
|
|
10
|
+
var _useContext = useContext(Context),
|
|
11
|
+
state = _useContext.state;
|
|
12
|
+
var detailRef = useRef();
|
|
13
|
+
useEffect(function () {
|
|
14
|
+
document.body.id = 'body';
|
|
15
|
+
}, []);
|
|
16
|
+
var appointment_card = useMemo(function () {
|
|
17
|
+
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2;
|
|
18
|
+
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$.information_tab) === null || _state$bookingConfig$2 === void 0 ? void 0 : _state$bookingConfig$2.appointment_card) || {
|
|
19
|
+
quick_time: 1
|
|
20
|
+
};
|
|
21
|
+
}, [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$bookingConfig3.information_tab]);
|
|
22
|
+
var showAddTimeModal = useMemo(function () {
|
|
23
|
+
// event预约不需要
|
|
24
|
+
if ((state === null || state === void 0 ? void 0 : state.renderType) === 'eventBooking') {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// 禁止编辑
|
|
29
|
+
if (state !== null && state !== void 0 && state.disabledEdit) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
// 未开启加时
|
|
34
|
+
if (appointment_card.quick_time !== 1) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}, [state, appointment_card.quick_time]);
|
|
39
|
+
var handleEdit = function handleEdit(cacheItem) {
|
|
40
|
+
setTimeout(function () {
|
|
41
|
+
var _detailRef$current, _detailRef$current$in;
|
|
42
|
+
(_detailRef$current = detailRef.current) === null || _detailRef$current === void 0 ? void 0 : (_detailRef$current$in = _detailRef$current.init) === null || _detailRef$current$in === void 0 ? void 0 : _detailRef$current$in.call(_detailRef$current, cacheItem);
|
|
43
|
+
}, 100);
|
|
44
|
+
};
|
|
45
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
46
|
+
className: "pisell-lowcode__booking-service-wrap"
|
|
47
|
+
}, /*#__PURE__*/React.createElement(ServiceList, {
|
|
48
|
+
onEdit: handleEdit
|
|
49
|
+
}), /*#__PURE__*/React.createElement(AddService, {
|
|
50
|
+
onEdit: handleEdit
|
|
51
|
+
})), /*#__PURE__*/React.createElement(EditService, {
|
|
52
|
+
ref: detailRef
|
|
53
|
+
}), showAddTimeModal && /*#__PURE__*/React.createElement(AddTimeModal, null));
|
|
54
|
+
};
|
|
55
|
+
export default /*#__PURE__*/React.memo(Service);
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import Like from "../../../info/service/like";
|
|
3
|
+
import { getServiceTime } from "../../../utils";
|
|
4
|
+
import { formatAmount, locales } from '@pisell/utils';
|
|
5
|
+
import CollapsibleList from "../../../components/collapsibleList";
|
|
6
|
+
import { renderBundles } from "../../../components/collapsibleList/utils";
|
|
7
|
+
import { Alert } from 'antd';
|
|
8
|
+
import Actions from "../actions";
|
|
9
|
+
import "./index.less";
|
|
10
|
+
var getName = function getName(name, locale) {
|
|
11
|
+
return name[locale] || name['original'] || name['en'] || '';
|
|
12
|
+
};
|
|
13
|
+
var sortResources = function sortResources(service) {
|
|
14
|
+
var _service$product_reso, _service$_extend;
|
|
15
|
+
var origin = ((_service$product_reso = service.product_resource) === null || _service$product_reso === void 0 ? void 0 : _service$product_reso.resources) || [];
|
|
16
|
+
var list = ((_service$_extend = service._extend) === null || _service$_extend === void 0 ? void 0 : _service$_extend.resource) || {};
|
|
17
|
+
|
|
18
|
+
// 先按照 b 的顺序遍历并填充 c
|
|
19
|
+
var processedKeys = new Set();
|
|
20
|
+
var res = [];
|
|
21
|
+
origin.forEach(function (item) {
|
|
22
|
+
var key = item.id;
|
|
23
|
+
if (list[key]) {
|
|
24
|
+
res.push(list[key]);
|
|
25
|
+
processedKeys.add(key); // 记录已经处理过的 key
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// 将 a 中未出现在 b 中的项追加到 c 的最后
|
|
30
|
+
Object.keys(list).forEach(function (key) {
|
|
31
|
+
var keyNum = Number(key);
|
|
32
|
+
if (!processedKeys.has(keyNum)) {
|
|
33
|
+
res.push(list[keyNum]); // 添加未处理过的项
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return res;
|
|
38
|
+
};
|
|
39
|
+
var ServiceItem = function ServiceItem(_ref) {
|
|
40
|
+
var _d$_extend3, _d$_extend4, _d$_extend6, _d$_extend6$other, _d$_extend7, _d$_extend7$other, _d$_extend8, _d$_extend9, _d$_extend10, _d$_extend$relation_d;
|
|
41
|
+
var d = _ref.d,
|
|
42
|
+
handleEditService = _ref.handleEditService,
|
|
43
|
+
state = _ref.state,
|
|
44
|
+
handleLike = _ref.handleLike,
|
|
45
|
+
errorMessage = _ref.errorMessage;
|
|
46
|
+
var isDiscount = useMemo(function () {
|
|
47
|
+
var _d$_extend, _d$_extend2;
|
|
48
|
+
return Number((_d$_extend = d._extend) === null || _d$_extend === void 0 ? void 0 : _d$_extend.total) != Number((_d$_extend2 = d._extend) === null || _d$_extend2 === void 0 ? void 0 : _d$_extend2.origin_total);
|
|
49
|
+
}, [(_d$_extend3 = d._extend) === null || _d$_extend3 === void 0 ? void 0 : _d$_extend3.total, (_d$_extend4 = d._extend) === null || _d$_extend4 === void 0 ? void 0 : _d$_extend4.origin_total]);
|
|
50
|
+
var renderResources = useMemo(function () {
|
|
51
|
+
if (state.renderType == 'eventBooking') {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
var resourcesOriginMap = state.service.resourcesOriginMap || {};
|
|
55
|
+
var list = sortResources(d);
|
|
56
|
+
return list
|
|
57
|
+
// 过滤掉没有选择的
|
|
58
|
+
.filter(function (item) {
|
|
59
|
+
return item.length;
|
|
60
|
+
}).map(function (item) {
|
|
61
|
+
var _d$product_resource, _d$product_resource$r, _first$metadata;
|
|
62
|
+
var resourceGroupName = '';
|
|
63
|
+
var resourceNames = '';
|
|
64
|
+
var first = item === null || item === void 0 ? void 0 : item[0];
|
|
65
|
+
// 资源分类
|
|
66
|
+
var resourceGroup = (_d$product_resource = d.product_resource) === null || _d$product_resource === void 0 ? void 0 : (_d$product_resource$r = _d$product_resource.resources) === null || _d$product_resource$r === void 0 ? void 0 : _d$product_resource$r.find(function (t) {
|
|
67
|
+
return t.id === (first === null || first === void 0 ? void 0 : first.form_id);
|
|
68
|
+
});
|
|
69
|
+
var showLike = (resourceGroup === null || resourceGroup === void 0 ? void 0 : resourceGroup.select_type.min) === 1 && (resourceGroup === null || resourceGroup === void 0 ? void 0 : resourceGroup.select_type.max) === 1 && (resourceGroup === null || resourceGroup === void 0 ? void 0 : resourceGroup.type) === 'single';
|
|
70
|
+
if (first !== null && first !== void 0 && (_first$metadata = first.metadata) !== null && _first$metadata !== void 0 && _first$metadata.form_name) {
|
|
71
|
+
var _first$metadata2;
|
|
72
|
+
resourceGroupName = first === null || first === void 0 ? void 0 : (_first$metadata2 = first.metadata) === null || _first$metadata2 === void 0 ? void 0 : _first$metadata2.form_name;
|
|
73
|
+
// 所选资源的名称
|
|
74
|
+
resourceNames = item.map(function (v) {
|
|
75
|
+
var _v$metadata;
|
|
76
|
+
return v === null || v === void 0 ? void 0 : (_v$metadata = v.metadata) === null || _v$metadata === void 0 ? void 0 : _v$metadata.resource_name;
|
|
77
|
+
}).join(', ');
|
|
78
|
+
} else {
|
|
79
|
+
resourceGroupName = resourceGroup === null || resourceGroup === void 0 ? void 0 : resourceGroup.title;
|
|
80
|
+
|
|
81
|
+
// 所选资源的名称
|
|
82
|
+
resourceNames = item.map(function (v) {
|
|
83
|
+
var _resourcesOriginMap$v;
|
|
84
|
+
return (_resourcesOriginMap$v = resourcesOriginMap[v.relation_id]) === null || _resourcesOriginMap$v === void 0 ? void 0 : _resourcesOriginMap$v.main_field;
|
|
85
|
+
}).join(', ');
|
|
86
|
+
}
|
|
87
|
+
var showGroupName = (list === null || list === void 0 ? void 0 : list.length) > 1;
|
|
88
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
89
|
+
className: "pisell-lowcode__booking-service-item-technician"
|
|
90
|
+
}, showGroupName ? /*#__PURE__*/React.createElement("span", {
|
|
91
|
+
style: {
|
|
92
|
+
marginRight: '4px'
|
|
93
|
+
}
|
|
94
|
+
}, resourceGroupName, ":") : null, showLike ? /*#__PURE__*/React.createElement(Like, {
|
|
95
|
+
style: {
|
|
96
|
+
margin: '0 4px 0 0'
|
|
97
|
+
},
|
|
98
|
+
status: item[0].like_status,
|
|
99
|
+
onChange: function onChange(e) {
|
|
100
|
+
handleLike(e, d, item[0]);
|
|
101
|
+
}
|
|
102
|
+
}) : null, resourceNames);
|
|
103
|
+
});
|
|
104
|
+
}, [d, state.service.resourcesOriginMap, state.renderType]);
|
|
105
|
+
var renderUser = useMemo(function () {
|
|
106
|
+
var _d$_extend5, _d$capacity;
|
|
107
|
+
var list = ((_d$_extend5 = d._extend) === null || _d$_extend5 === void 0 ? void 0 : _d$_extend5.capacity) || [];
|
|
108
|
+
if (((_d$capacity = d.capacity) === null || _d$capacity === void 0 ? void 0 : _d$capacity.type) === 'custom') {
|
|
109
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: ""
|
|
111
|
+
}, list.map(function (user) {
|
|
112
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
113
|
+
className: "pisell-lowcode__booking-service-item-technician",
|
|
114
|
+
key: user.id
|
|
115
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
116
|
+
style: {
|
|
117
|
+
marginRight: '4px'
|
|
118
|
+
}
|
|
119
|
+
}, getName(user.name, state.locale), ":"), /*#__PURE__*/React.createElement("span", null, user.value || 0));
|
|
120
|
+
}));
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}, [d, state.locale]);
|
|
124
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
125
|
+
key: d._id,
|
|
126
|
+
className: "pisell-lowcode__booking-service-item",
|
|
127
|
+
onClick: function onClick() {
|
|
128
|
+
handleEditService(d);
|
|
129
|
+
}
|
|
130
|
+
}, d.id ? /*#__PURE__*/React.createElement("div", {
|
|
131
|
+
className: "pisell-lowcode__booking-service-item-title"
|
|
132
|
+
}, d.title) : null, d._extend && state.renderType !== 'eventBooking' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
className: "pisell-lowcode__booking-service-item-date"
|
|
134
|
+
}, getServiceTime(d, state.date.value)), renderResources) : null, (((_d$_extend6 = d._extend) === null || _d$_extend6 === void 0 ? void 0 : (_d$_extend6$other = _d$_extend6.other) === null || _d$_extend6$other === void 0 ? void 0 : _d$_extend6$other.bundle) || []).length ? /*#__PURE__*/React.createElement(CollapsibleList, {
|
|
135
|
+
border: true,
|
|
136
|
+
list: ((_d$_extend7 = d._extend) === null || _d$_extend7 === void 0 ? void 0 : (_d$_extend7$other = _d$_extend7.other) === null || _d$_extend7$other === void 0 ? void 0 : _d$_extend7$other.bundle) || [],
|
|
137
|
+
renderItem: function renderItem(item) {
|
|
138
|
+
return renderBundles(item, state.amountSymbol);
|
|
139
|
+
}
|
|
140
|
+
}) : null, d.id ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
141
|
+
className: "pisell-lowcode__booking-service-item-price-wrap"
|
|
142
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
143
|
+
className: "pisell-lowcode__booking-service-item-price"
|
|
144
|
+
}, formatAmount((_d$_extend8 = d._extend) === null || _d$_extend8 === void 0 ? void 0 : _d$_extend8.total, 2, state.amountSymbol)), isDiscount ? /*#__PURE__*/React.createElement("span", {
|
|
145
|
+
className: "pisell-lowcode__booking-service-item-original-price"
|
|
146
|
+
}, formatAmount(d._extend.origin_total, 2, state.amountSymbol)) : null)) : null, isDiscount && (_d$_extend9 = d._extend) !== null && _d$_extend9 !== void 0 && _d$_extend9.discount_reason ? /*#__PURE__*/React.createElement("div", {
|
|
147
|
+
className: "pisell-lowcode__booking-service-item-discount-reason"
|
|
148
|
+
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.discount-reason'), ":"), ' ', (_d$_extend10 = d._extend) === null || _d$_extend10 === void 0 ? void 0 : _d$_extend10.discount_reason) : null, renderUser, (_d$_extend$relation_d = d._extend.relation_details) !== null && _d$_extend$relation_d !== void 0 && _d$_extend$relation_d.length ? /*#__PURE__*/React.createElement("div", {
|
|
149
|
+
className: "pisell-lowcode__booking-service-item-relation-details"
|
|
150
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
151
|
+
className: "pisell-lowcode__booking-service-item-title"
|
|
152
|
+
}, locales.getText('page.booking.text.sales')), d._extend.relation_details.map(function (item, index) {
|
|
153
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
154
|
+
className: "pisell-lowcode__booking-service-item-relation-detail",
|
|
155
|
+
key: item.id
|
|
156
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
className: "pisell-lowcode__booking-service-item-relation-detail-title"
|
|
158
|
+
}, item.product_title), /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
className: "pisell-lowcode__booking-service-item-relation-detail-info"
|
|
160
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
161
|
+
className: "pisell-lowcode__booking-service-item-relation-detail-info-price"
|
|
162
|
+
}, formatAmount(item.payment_price, 2, state.amountSymbol)), /*#__PURE__*/React.createElement("span", {
|
|
163
|
+
className: "pisell-lowcode__booking-service-item-relation-detail-info-unit"
|
|
164
|
+
}, "x"), /*#__PURE__*/React.createElement("span", {
|
|
165
|
+
className: "pisell-lowcode__booking-service-item-relation-detail-info-quantity"
|
|
166
|
+
}, item.product_quantity)));
|
|
167
|
+
})) : null, /*#__PURE__*/React.createElement(Actions, {
|
|
168
|
+
currentService: d
|
|
169
|
+
}), errorMessage ? /*#__PURE__*/React.createElement(Alert, {
|
|
170
|
+
message: errorMessage,
|
|
171
|
+
type: "warning",
|
|
172
|
+
showIcon: true,
|
|
173
|
+
className: "pisell-lowcode__booking-service-item-error"
|
|
174
|
+
}) : null);
|
|
175
|
+
};
|
|
176
|
+
export default ServiceItem;
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
.pisell-lowcode__booking-service-item {
|
|
2
|
+
width: 100%;
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
border: 1px solid #D5D7DA;
|
|
5
|
+
margin-bottom: 16px;
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
padding: 16px 20px;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
gap: 4px;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
background-color: #fff;
|
|
15
|
+
|
|
16
|
+
&:last-child {
|
|
17
|
+
margin-bottom: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&::before {
|
|
21
|
+
content: '';
|
|
22
|
+
position: absolute;
|
|
23
|
+
left: 0;
|
|
24
|
+
top: 0;
|
|
25
|
+
width: 6px;
|
|
26
|
+
height: 100%;
|
|
27
|
+
background: #80BCFE;
|
|
28
|
+
z-index: 2;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pisell-lowcode__booking-service-item-title {
|
|
32
|
+
color: var(--gray-900, #101828);
|
|
33
|
+
|
|
34
|
+
font-size: 16px;
|
|
35
|
+
font-style: normal;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
line-height: 24px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pisell-lowcode__booking-service-item-date {
|
|
41
|
+
color: var(--gray-500, #667085);
|
|
42
|
+
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
line-height: 20px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.pisell-lowcode__booking-service-item-technician {
|
|
50
|
+
color: var(--gray-500, #667085);
|
|
51
|
+
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
font-style: normal;
|
|
54
|
+
font-weight: 400;
|
|
55
|
+
line-height: 20px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.pisell-lowcode__booking-service-item-price-wrap {
|
|
59
|
+
.pisell-lowcode__booking-service-item-price {
|
|
60
|
+
color: var(--gray-500, #667085);
|
|
61
|
+
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
font-style: normal;
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
line-height: 20px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.pisell-lowcode__booking-service-item-original-price {
|
|
69
|
+
color: var(--gray-500, #667085);
|
|
70
|
+
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
font-style: normal;
|
|
73
|
+
font-weight: 400;
|
|
74
|
+
line-height: 20px;
|
|
75
|
+
margin-left: 8px;
|
|
76
|
+
text-decoration: line-through;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.pisell-lowcode__booking-service-item-discount-reason {
|
|
83
|
+
color: var(--gray-500, #667085);
|
|
84
|
+
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
font-style: normal;
|
|
87
|
+
font-weight: 400;
|
|
88
|
+
line-height: 20px;
|
|
89
|
+
white-space: break-spaces;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pisell-lowcode__booking-service-item-error {
|
|
93
|
+
border: none;
|
|
94
|
+
margin: 0 -20px -16px;
|
|
95
|
+
border-radius: 0 0 8px 8px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.pisell-lowcode__booking-service-item-relation-details {
|
|
100
|
+
padding-top: 6px;
|
|
101
|
+
margin-top: 6px;
|
|
102
|
+
border-top: 1px solid #d5d7da;
|
|
103
|
+
margin-bottom: 6px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.pisell-lowcode__booking-service-item-relation-detail {
|
|
107
|
+
display: flex;
|
|
108
|
+
align-items: flex-start;
|
|
109
|
+
justify-content: space-between;
|
|
110
|
+
margin-top: 4px;
|
|
111
|
+
overflow: hidden;
|
|
112
|
+
|
|
113
|
+
.pisell-lowcode__booking-service-item-relation-detail-title {}
|
|
114
|
+
|
|
115
|
+
.pisell-lowcode__booking-service-item-relation-detail-info {
|
|
116
|
+
.pisell-lowcode__booking-service-item-relation-detail-info-quantity {}
|
|
117
|
+
|
|
118
|
+
.pisell-lowcode__booking-service-item-relation-detail-info-unit {
|
|
119
|
+
padding: 0 4px;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.pisell-lowcode__booking-service-item-relation-detail-info-price {}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
+
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."); }
|
|
4
|
+
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); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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
|
+
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
|
+
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 _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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
|
+
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
|
+
import React, { useCallback, useContext } from 'react';
|
|
14
|
+
import { locales } from '@pisell/utils';
|
|
15
|
+
import "./index.less";
|
|
16
|
+
import { Context } from "../../../info/model";
|
|
17
|
+
import { getProductExtend } from "../addService/utils";
|
|
18
|
+
import ServiceItem from "../serviceItem";
|
|
19
|
+
var ServiceList = function ServiceList(_ref) {
|
|
20
|
+
var onEdit = _ref.onEdit;
|
|
21
|
+
var _useContext = useContext(Context),
|
|
22
|
+
state = _useContext.state,
|
|
23
|
+
dispatch = _useContext.dispatch;
|
|
24
|
+
// const errorTypes = {
|
|
25
|
+
// product: locales.getText('pisell2.text.status.service-error-1'),
|
|
26
|
+
// time: locales.getText('pisell2.text.status.service-error-2'),
|
|
27
|
+
// maxLimit: locales.getText('pisell2.text.status.service-error-3'),
|
|
28
|
+
// };
|
|
29
|
+
var handleEditService = function handleEditService(item) {
|
|
30
|
+
if (state.disabledEdit || state.disableEventBookingEdit) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
var cacheItem = getProductExtend({
|
|
34
|
+
cacheItem: _objectSpread(_objectSpread({}, item), {}, {
|
|
35
|
+
new: 0
|
|
36
|
+
}),
|
|
37
|
+
state: state
|
|
38
|
+
});
|
|
39
|
+
dispatch({
|
|
40
|
+
type: 'setService',
|
|
41
|
+
payload: {
|
|
42
|
+
editModal: true,
|
|
43
|
+
cacheItem: cacheItem
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
onEdit === null || onEdit === void 0 ? void 0 : onEdit(cacheItem);
|
|
47
|
+
};
|
|
48
|
+
var getErrorMessage = useCallback(function (service) {
|
|
49
|
+
var _errorList;
|
|
50
|
+
var errorList = [];
|
|
51
|
+
var list = Object.values(service._extend.resource || []);
|
|
52
|
+
errorList = list.reduce(function (pre, cur) {
|
|
53
|
+
return pre.concat((cur || []).reduce(function (preItem, curItem) {
|
|
54
|
+
return preItem.concat(curItem.errors || []);
|
|
55
|
+
}, []));
|
|
56
|
+
}, []);
|
|
57
|
+
var errorMessage = '';
|
|
58
|
+
console.log(errorList, list, 'cur.errors');
|
|
59
|
+
if ((_errorList = errorList) !== null && _errorList !== void 0 && _errorList.length) {
|
|
60
|
+
errorMessage = "".concat(errorList.length, " ").concat(locales.getText('pisell2.text.warnings'));
|
|
61
|
+
}
|
|
62
|
+
return errorMessage;
|
|
63
|
+
}, []);
|
|
64
|
+
var handleLike = function handleLike(status, item, resource) {
|
|
65
|
+
if (state.disabledEdit) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
var _list = _toConsumableArray(state.service.value);
|
|
69
|
+
var _id = item === null || item === void 0 ? void 0 : item._id;
|
|
70
|
+
_list = _list.map(function (d) {
|
|
71
|
+
return d._id === _id ? _objectSpread(_objectSpread({}, d), {}, {
|
|
72
|
+
_extend: _objectSpread(_objectSpread({}, d._extend), {}, {
|
|
73
|
+
resource: _objectSpread(_objectSpread({}, d._extend.resource), {}, _defineProperty({}, resource.form_id, d._extend.resource[resource.form_id].map(function (d, i) {
|
|
74
|
+
if (d.relation_id === resource.relation_id) {
|
|
75
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
|
76
|
+
like_status: status
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
return d;
|
|
80
|
+
})))
|
|
81
|
+
})
|
|
82
|
+
}) : d;
|
|
83
|
+
});
|
|
84
|
+
dispatch({
|
|
85
|
+
type: 'setService',
|
|
86
|
+
payload: {
|
|
87
|
+
value: _list,
|
|
88
|
+
edit: true
|
|
89
|
+
}
|
|
90
|
+
});
|
|
91
|
+
};
|
|
92
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: ""
|
|
94
|
+
}, state.service.value.map(function (d) {
|
|
95
|
+
var errorMessage = getErrorMessage(d);
|
|
96
|
+
return /*#__PURE__*/React.createElement(ServiceItem, {
|
|
97
|
+
key: d._id,
|
|
98
|
+
errorMessage: errorMessage,
|
|
99
|
+
d: d,
|
|
100
|
+
handleEditService: handleEditService,
|
|
101
|
+
state: state,
|
|
102
|
+
handleLike: handleLike
|
|
103
|
+
});
|
|
104
|
+
}));
|
|
105
|
+
};
|
|
106
|
+
export default ServiceList;
|
|
File without changes
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export declare const getResourceTimeIsUsable: (item: any, cacheItem: any, resourceItem: any) => any;
|
|
2
|
+
export declare const getSumCapacity: ({ cacheItem }: any) => number;
|
|
3
|
+
/**
|
|
4
|
+
* @title: 查找是否有可用的time
|
|
5
|
+
* @description:
|
|
6
|
+
* @param {any} resourceItem
|
|
7
|
+
* @return {*}
|
|
8
|
+
* @Author: zhiwei.Wang
|
|
9
|
+
* @Date: 2024-01-09 13:57
|
|
10
|
+
*/
|
|
11
|
+
export declare const formatTimes: (resourceItem: any, cacheItem: any) => any;
|
|
12
|
+
export declare const getErrorList: (resource: any, cacheItem: any) => {
|
|
13
|
+
label: any;
|
|
14
|
+
type: string;
|
|
15
|
+
}[];
|
|
16
|
+
/**
|
|
17
|
+
* @title: 格式化资源, 添加自定义参数
|
|
18
|
+
* @description:
|
|
19
|
+
* @param {any} resourceItem
|
|
20
|
+
* @return {*}
|
|
21
|
+
* @Author: zhiwei.Wang
|
|
22
|
+
* @Date: 2024-01-09 13:40
|
|
23
|
+
*/
|
|
24
|
+
export declare const formatResource: (resourceItem: any, cacheItem?: any, formatLabel?: any) => any;
|
|
25
|
+
/**
|
|
26
|
+
* @title: 创建服务的开始时间和结束时间
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {any} state
|
|
29
|
+
* @param {any} item
|
|
30
|
+
* @return {*}
|
|
31
|
+
* @Author: zhiwei.Wang
|
|
32
|
+
* @Date: 2024-01-26 14:09
|
|
33
|
+
*/
|
|
34
|
+
export declare const getServiceStartTimeAndEndTime: (state: any, cacheItem: any, timeObj: any) => any;
|