@pisell/private-materials 3.0.199 → 3.0.201
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 +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/booking/addons/model.d.ts +1 -1
- package/es/components/booking/components/customSelect/index.d.ts +1 -0
- package/es/components/booking/components/customSelect/index.js +6 -2
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +38 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/components/footer/amount.js +45 -22
- package/es/components/booking/components/footer/index.js +84 -40
- package/es/components/booking/components/footer/utils.js +243 -32
- package/es/components/booking/info/addServiceVariant/index.js +8 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +14 -13
- package/es/components/booking/info/clientVariant/vertical/index.js +33 -4
- package/es/components/booking/info/dateRange/index.d.ts +5 -0
- package/es/components/booking/info/dateRange/index.js +98 -0
- package/es/components/booking/info/dateRange/index.less +21 -0
- package/es/components/booking/info/main.js +20 -8
- package/es/components/booking/info/model.js +3 -0
- package/es/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/es/components/booking/info/pet/ChangePetModal/index.js +119 -0
- package/es/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/es/components/booking/info/pet/index.js +54 -5
- package/es/components/booking/info/service/addService/index.js +142 -22
- package/es/components/booking/info/service/addService/index.less +13 -3
- package/es/components/booking/info/service/addService/utils.d.ts +11 -2
- package/es/components/booking/info/service/addService/utils.js +49 -24
- package/es/components/booking/info/service/editService/index.js +255 -44
- package/es/components/booking/info/service/editService/index.less +18 -13
- package/es/components/booking/info/service2/Lists.d.ts +3 -0
- package/es/components/booking/info/service2/Lists.js +158 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.js +54 -0
- package/es/components/booking/info/service2/index.d.ts +3 -0
- package/es/components/booking/info/service2/index.js +58 -0
- package/es/components/booking/info/service2/status.d.ts +31 -0
- package/es/components/booking/info/service2/status.js +78 -0
- package/es/components/booking/info/service2/utils.d.ts +145 -0
- package/es/components/booking/info/service2/utils.js +438 -0
- package/es/components/booking/info/utils.d.ts +9 -0
- package/es/components/booking/info/utils.js +13 -0
- package/es/components/booking/locales.d.ts +60 -0
- package/es/components/booking/locales.js +75 -3
- package/es/components/booking/materiels/holder/index.d.ts +7 -0
- package/es/components/booking/materiels/holder/index.js +51 -0
- package/es/components/booking/model.d.ts +4 -1
- package/es/components/booking/model.js +4 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/utils.d.ts +12 -3
- package/es/components/booking/utils.js +139 -23
- package/es/components/eftpos/form/index.js +6 -12
- package/es/components/eftpos/group/index.d.ts +2 -1
- package/es/components/eftpos/group/index.js +2 -1
- package/es/components/eftpos/index.js +2 -2
- package/es/components/eftposPay/helper.d.ts +0 -1
- package/es/components/eftposPay/helper.js +0 -14
- package/es/components/eftposPay/tyro/index.js +20 -51
- package/es/components/shoppingCart/Provider.d.ts +3 -0
- package/es/components/shoppingCart/Provider.js +86 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/Product.js +96 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/index.js +72 -0
- package/es/components/shoppingCart/components/Cart/index.less +68 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Empty/index.js +14 -0
- package/es/components/shoppingCart/components/Empty/index.less +19 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Render/index.js +68 -0
- package/es/components/shoppingCart/components/Render/index.less +2 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.js +124 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useAddService.js +23 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +54 -0
- package/es/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useContext.js +5 -0
- package/es/components/shoppingCart/index.d.ts +4 -0
- package/es/components/shoppingCart/index.js +24 -0
- package/es/components/shoppingCart/locales.d.ts +33 -0
- package/es/components/shoppingCart/locales.js +38 -0
- package/es/components/shoppingCart/mock.d.ts +40 -0
- package/es/components/shoppingCart/mock.js +40 -0
- package/es/components/shoppingCart/status.d.ts +2 -0
- package/es/components/shoppingCart/status.js +22 -0
- package/es/components/shoppingCart/type.d.ts +39 -0
- package/es/components/shoppingCart/type.js +1 -0
- package/es/components/shoppingCart/utils.d.ts +63 -0
- package/es/components/shoppingCart/utils.js +119 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/booking/addons/model.d.ts +1 -1
- package/lib/components/booking/components/customSelect/index.d.ts +1 -0
- package/lib/components/booking/components/customSelect/index.js +6 -2
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +60 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/components/footer/amount.js +26 -8
- package/lib/components/booking/components/footer/index.js +25 -4
- package/lib/components/booking/components/footer/utils.js +157 -31
- package/lib/components/booking/info/addServiceVariant/index.js +5 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +8 -7
- package/lib/components/booking/info/clientVariant/vertical/index.js +36 -10
- package/lib/components/booking/info/dateRange/index.d.ts +5 -0
- package/lib/components/booking/info/dateRange/index.js +111 -0
- package/lib/components/booking/info/dateRange/index.less +21 -0
- package/lib/components/booking/info/main.js +11 -4
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.js +111 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/lib/components/booking/info/pet/index.js +61 -25
- package/lib/components/booking/info/service/addService/index.js +107 -34
- package/lib/components/booking/info/service/addService/index.less +13 -3
- package/lib/components/booking/info/service/addService/utils.d.ts +11 -2
- package/lib/components/booking/info/service/addService/utils.js +31 -10
- package/lib/components/booking/info/service/editService/index.js +293 -125
- package/lib/components/booking/info/service/editService/index.less +18 -13
- package/lib/components/booking/info/service2/Lists.d.ts +3 -0
- package/lib/components/booking/info/service2/Lists.js +113 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.js +50 -0
- package/lib/components/booking/info/service2/index.d.ts +3 -0
- package/lib/components/booking/info/service2/index.js +75 -0
- package/lib/components/booking/info/service2/status.d.ts +31 -0
- package/lib/components/booking/info/service2/status.js +81 -0
- package/lib/components/booking/info/service2/utils.d.ts +145 -0
- package/lib/components/booking/info/service2/utils.js +322 -0
- package/lib/components/booking/info/utils.d.ts +9 -0
- package/lib/components/booking/info/utils.js +6 -0
- package/lib/components/booking/locales.d.ts +60 -0
- package/lib/components/booking/locales.js +63 -3
- package/lib/components/booking/materiels/holder/index.d.ts +7 -0
- package/lib/components/booking/materiels/holder/index.js +65 -0
- package/lib/components/booking/model.d.ts +4 -1
- package/lib/components/booking/model.js +4 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +12 -3
- package/lib/components/booking/utils.js +87 -15
- package/lib/components/eftpos/form/index.js +6 -12
- package/lib/components/eftpos/group/index.d.ts +2 -1
- package/lib/components/eftpos/group/index.js +1 -0
- package/lib/components/eftpos/index.js +2 -2
- package/lib/components/eftposPay/helper.d.ts +0 -1
- package/lib/components/eftposPay/helper.js +0 -21
- package/lib/components/eftposPay/tyro/index.js +7 -36
- package/lib/components/shoppingCart/Provider.d.ts +3 -0
- package/lib/components/shoppingCart/Provider.js +110 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/Product.js +89 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/index.js +77 -0
- package/lib/components/shoppingCart/components/Cart/index.less +68 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Empty/index.js +43 -0
- package/lib/components/shoppingCart/components/Empty/index.less +19 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Render/index.js +79 -0
- package/lib/components/shoppingCart/components/Render/index.less +2 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.js +116 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useAddService.js +55 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +71 -0
- package/lib/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useContext.js +31 -0
- package/lib/components/shoppingCart/index.d.ts +4 -0
- package/lib/components/shoppingCart/index.js +60 -0
- package/lib/components/shoppingCart/locales.d.ts +33 -0
- package/lib/components/shoppingCart/locales.js +56 -0
- package/lib/components/shoppingCart/mock.d.ts +40 -0
- package/lib/components/shoppingCart/mock.js +76 -0
- package/lib/components/shoppingCart/status.d.ts +2 -0
- package/lib/components/shoppingCart/status.js +60 -0
- package/lib/components/shoppingCart/type.d.ts +39 -0
- package/lib/components/shoppingCart/type.js +17 -0
- package/lib/components/shoppingCart/utils.d.ts +63 -0
- package/lib/components/shoppingCart/utils.js +92 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/shopping-cart/meta.ts +98 -0
- package/package.json +4 -4
- package/es/components/eftpos/receipt/index.d.ts +0 -24
- package/es/components/eftpos/receipt/index.js +0 -96
- package/lib/components/eftpos/receipt/index.d.ts +0 -24
- package/lib/components/eftpos/receipt/index.js +0 -88
|
@@ -24,18 +24,22 @@ import Drawer from "../../../components/drawer";
|
|
|
24
24
|
import TabProduct from "../../../components/TabProduct";
|
|
25
25
|
import { Context } from "../../model";
|
|
26
26
|
import AddButton from "../../../components/addButton";
|
|
27
|
-
import { Input, Skeleton } from 'antd';
|
|
27
|
+
import { Input, Skeleton, Row, Col } from 'antd';
|
|
28
28
|
import "./index.less";
|
|
29
29
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
30
30
|
import { getProductDetail } from "../serve";
|
|
31
31
|
import { getIsBundleOrCombination } from "../../utils";
|
|
32
|
+
import DateRange from "../../dateRange";
|
|
32
33
|
import { getProductExtend } from "./utils";
|
|
33
34
|
import { formatProductListByCategory, getProductTotalPrice, request } from "../../../utils";
|
|
35
|
+
import { isDayBooking, isAppointment, getDayProducts, holderId } from "../../service2/utils";
|
|
36
|
+
import { inputDateCol, appointmentTypes } from "../../service2/status";
|
|
34
37
|
import { locales, getUniqueId } from '@pisell/utils';
|
|
35
38
|
import { useMemoizedFn, useUpdateEffect } from 'ahooks';
|
|
39
|
+
import debounce from 'lodash/debounce';
|
|
36
40
|
var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386, 6848, 6305];
|
|
37
41
|
var Info = function Info(props) {
|
|
38
|
-
var _state$service3, _state$service6, _state$service8, _state$service8$cache;
|
|
42
|
+
var _state$service3, _state2, _state$service6, _state$service8, _state$service8$cache, _state3;
|
|
39
43
|
var onEdit = props.onEdit,
|
|
40
44
|
drawerProps = props.drawerProps,
|
|
41
45
|
renderMode = props.renderMode;
|
|
@@ -51,11 +55,60 @@ var Info = function Info(props) {
|
|
|
51
55
|
loading = _useState4[0],
|
|
52
56
|
setLoading = _useState4[1];
|
|
53
57
|
var searchRef = useRef();
|
|
58
|
+
// 头部高度
|
|
59
|
+
var headerRef = useRef(null);
|
|
60
|
+
var _useState5 = useState(0),
|
|
61
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
62
|
+
headerHeight = _useState6[0],
|
|
63
|
+
setHeaderHeight = _useState6[1];
|
|
54
64
|
var context = useEngineContext();
|
|
55
65
|
state = state || (props === null || props === void 0 ? void 0 : props.state);
|
|
56
66
|
dispatch = dispatch || (props === null || props === void 0 ? void 0 : props.dispatch);
|
|
57
67
|
request.setRequest(context.appHelper.utils.request);
|
|
58
68
|
|
|
69
|
+
/**
|
|
70
|
+
* @title: 是否是跨日预约
|
|
71
|
+
* @description:
|
|
72
|
+
* @param {*} useMemo
|
|
73
|
+
* @return {*}
|
|
74
|
+
* @Author: WangHan
|
|
75
|
+
* @Date: 2024-12-09 15:46
|
|
76
|
+
*/
|
|
77
|
+
var isDay = useMemo(function () {
|
|
78
|
+
return isDayBooking(state);
|
|
79
|
+
}, [state.renderType]);
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @title: 监听元素高度变化的函数
|
|
83
|
+
* @description:
|
|
84
|
+
* @return {*}
|
|
85
|
+
* @Author: WangHan
|
|
86
|
+
* @Date: 2024-12-10 17:13
|
|
87
|
+
*/
|
|
88
|
+
var handleResize = function handleResize() {
|
|
89
|
+
if (headerRef !== null && headerRef !== void 0 && headerRef.current) {
|
|
90
|
+
var _headerRef$current;
|
|
91
|
+
setHeaderHeight((_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.offsetHeight);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
// 使用防抖的监听函数
|
|
96
|
+
var debouncedHandleResize = debounce(handleResize, 100);
|
|
97
|
+
useEffect(function () {
|
|
98
|
+
if (isDay && state.isTerminalDayBookingPage) {
|
|
99
|
+
// 初始化时设置一次高度
|
|
100
|
+
handleResize();
|
|
101
|
+
|
|
102
|
+
// 添加窗口大小变化的监听器
|
|
103
|
+
window.addEventListener('resize', debouncedHandleResize);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
// 清理函数
|
|
107
|
+
return function () {
|
|
108
|
+
window.removeEventListener('resize', debouncedHandleResize);
|
|
109
|
+
};
|
|
110
|
+
}, [debouncedHandleResize]);
|
|
111
|
+
|
|
59
112
|
/**
|
|
60
113
|
* @title: 如果商品只有一个, 则自动设置默认商品
|
|
61
114
|
* @description:
|
|
@@ -120,7 +173,7 @@ var Info = function Info(props) {
|
|
|
120
173
|
_extend: {
|
|
121
174
|
start_date: state.date.value,
|
|
122
175
|
startDate: state.date.value,
|
|
123
|
-
endDate: state.date.value,
|
|
176
|
+
endDate: isDay ? state.date.end_date : state.date.value,
|
|
124
177
|
start_time: '00:00:00',
|
|
125
178
|
duration: 10,
|
|
126
179
|
quantity: 1,
|
|
@@ -151,7 +204,7 @@ var Info = function Info(props) {
|
|
|
151
204
|
var getServices = /*#__PURE__*/function () {
|
|
152
205
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
153
206
|
var _state$eventOtherPara, _state$eventOtherPara2, _state$eventOtherPara3;
|
|
154
|
-
var data;
|
|
207
|
+
var dayParams, data, lists, _state, id;
|
|
155
208
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
156
209
|
while (1) switch (_context2.prev = _context2.next) {
|
|
157
210
|
case 0:
|
|
@@ -170,8 +223,12 @@ var Info = function Info(props) {
|
|
|
170
223
|
setLoading(false);
|
|
171
224
|
return _context2.abrupt("return");
|
|
172
225
|
case 5:
|
|
173
|
-
|
|
174
|
-
|
|
226
|
+
dayParams = {}; // 跨日预约
|
|
227
|
+
if (isDay) {
|
|
228
|
+
dayParams.extension_type = ['normal', 'product_appointment'];
|
|
229
|
+
}
|
|
230
|
+
_context2.next = 9;
|
|
231
|
+
return state.apis.getServices(_objectSpread(_objectSpread({
|
|
175
232
|
skip: 1,
|
|
176
233
|
num: 500,
|
|
177
234
|
extension_type: state.renderType === 'eventBooking' ? undefined : ['product_appointment', 'appointment_ticket'],
|
|
@@ -188,22 +245,27 @@ var Info = function Info(props) {
|
|
|
188
245
|
_config: {
|
|
189
246
|
useCache: true
|
|
190
247
|
}
|
|
191
|
-
}));
|
|
192
|
-
case
|
|
248
|
+
}), dayParams));
|
|
249
|
+
case 9:
|
|
193
250
|
data = _context2.sent;
|
|
194
251
|
setLoading(false);
|
|
252
|
+
lists = (data === null || data === void 0 ? void 0 : data.list) || []; // 跨日预约过滤商品列表
|
|
253
|
+
if (isDay) {
|
|
254
|
+
id = holderId(state);
|
|
255
|
+
lists = getDayProducts(id, lists, (_state = state) === null || _state === void 0 ? void 0 : _state.isTerminalDayBookingPage);
|
|
256
|
+
}
|
|
195
257
|
|
|
196
258
|
// 只有自动获取列表的时候才设置商品, 手动点击添加按钮的时候不设置
|
|
197
259
|
if (!state.service.addModal) {
|
|
198
|
-
setDefaultService(
|
|
260
|
+
setDefaultService(lists);
|
|
199
261
|
}
|
|
200
262
|
dispatch({
|
|
201
263
|
type: 'setService',
|
|
202
264
|
payload: {
|
|
203
|
-
services:
|
|
265
|
+
services: lists
|
|
204
266
|
}
|
|
205
267
|
});
|
|
206
|
-
case
|
|
268
|
+
case 15:
|
|
207
269
|
case "end":
|
|
208
270
|
return _context2.stop();
|
|
209
271
|
}
|
|
@@ -230,6 +292,11 @@ var Info = function Info(props) {
|
|
|
230
292
|
var handleSelectProduct = useMemoizedFn(function (item, type) {
|
|
231
293
|
// 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
|
|
232
294
|
var isEject = type === 'detail' || item.bundle_group_count > 0;
|
|
295
|
+
|
|
296
|
+
// 跨日预约开启单规格 组合规格 套餐
|
|
297
|
+
if (isDay) {
|
|
298
|
+
isEject = type === 'detail' || item.bundle_group_count > 0 || item.option_group_count > 0 || item.is_variant > 0;
|
|
299
|
+
}
|
|
233
300
|
var lock = false;
|
|
234
301
|
state.action({
|
|
235
302
|
type: 'pisell1.handleOpenProductModal',
|
|
@@ -237,14 +304,15 @@ var Info = function Info(props) {
|
|
|
237
304
|
id: item.id,
|
|
238
305
|
date: state.date.value.format('YYYY-MM-DD'),
|
|
239
306
|
showConfig: {
|
|
240
|
-
option: false,
|
|
307
|
+
option: isDay ? true : false,
|
|
241
308
|
session: false,
|
|
242
|
-
variant: false,
|
|
309
|
+
variant: isDay ? true : false,
|
|
243
310
|
package: true
|
|
244
311
|
},
|
|
245
312
|
is_eject: isEject ? 1 : 0
|
|
246
313
|
},
|
|
247
314
|
callback: function callback(e) {
|
|
315
|
+
var _cacheItem$_extend, _cacheItem$_extend$ot;
|
|
248
316
|
// 防止选择商品弹窗多次触发callback
|
|
249
317
|
if (lock) {
|
|
250
318
|
return;
|
|
@@ -268,7 +336,21 @@ var Info = function Info(props) {
|
|
|
268
336
|
},
|
|
269
337
|
new: 1
|
|
270
338
|
});
|
|
339
|
+
|
|
340
|
+
// 跨日预约
|
|
341
|
+
if (isDay) {
|
|
342
|
+
cacheItem._extend.holder_id = holderId(state);
|
|
343
|
+
cacheItem._extend.end_date = state.date.end_date;
|
|
344
|
+
cacheItem._extend.sub_type = 'days';
|
|
345
|
+
}
|
|
271
346
|
var _total = getProductTotalPrice(cacheItem);
|
|
347
|
+
|
|
348
|
+
// 如果有多规格,则更新商品的单价
|
|
349
|
+
if (cacheItem !== null && cacheItem !== void 0 && (_cacheItem$_extend = cacheItem._extend) !== null && _cacheItem$_extend !== void 0 && (_cacheItem$_extend$ot = _cacheItem$_extend.other) !== null && _cacheItem$_extend$ot !== void 0 && _cacheItem$_extend$ot.product_variant_id) {
|
|
350
|
+
var _cacheItem$_extend2, _cacheItem$_extend2$o;
|
|
351
|
+
cacheItem._extend.price = Number((_cacheItem$_extend2 = cacheItem._extend) === null || _cacheItem$_extend2 === void 0 ? void 0 : (_cacheItem$_extend2$o = _cacheItem$_extend2.other) === null || _cacheItem$_extend2$o === void 0 ? void 0 : _cacheItem$_extend2$o.price);
|
|
352
|
+
}
|
|
353
|
+
|
|
272
354
|
// 用于折扣 可修改
|
|
273
355
|
cacheItem._extend.total = _total;
|
|
274
356
|
// 用于储存原价
|
|
@@ -288,7 +370,11 @@ var Info = function Info(props) {
|
|
|
288
370
|
cacheItem: cacheItem,
|
|
289
371
|
state: state
|
|
290
372
|
});
|
|
291
|
-
|
|
373
|
+
|
|
374
|
+
// 普通商品
|
|
375
|
+
if (isDay && !isAppointment(item, state)) {
|
|
376
|
+
cacheItem.autoClose = !_isEdit;
|
|
377
|
+
} else if (state.renderType === 'eventBooking') {
|
|
292
378
|
cacheItem.autoClose = false;
|
|
293
379
|
} else {
|
|
294
380
|
var _state$service;
|
|
@@ -310,13 +396,23 @@ var Info = function Info(props) {
|
|
|
310
396
|
var renderList = useMemo(function () {
|
|
311
397
|
var _state$service2;
|
|
312
398
|
var _list = ((_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.services) || [];
|
|
399
|
+
|
|
400
|
+
// 跨日预约
|
|
401
|
+
if (isDay) {
|
|
402
|
+
// 公共购物车下过滤掉预约商品
|
|
403
|
+
if (!holderId(state)) {
|
|
404
|
+
_list = _list.filter(function (item) {
|
|
405
|
+
return !appointmentTypes.includes(item.extension_type);
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
}
|
|
313
409
|
var isIncludes = function isIncludes(str) {
|
|
314
410
|
return str.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
|
315
411
|
};
|
|
316
412
|
return formatProductListByCategory(_list, search ? function (item) {
|
|
317
413
|
return isIncludes(item.title);
|
|
318
414
|
} : undefined);
|
|
319
|
-
}, [search, (_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.services]);
|
|
415
|
+
}, [search, (_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.services, (_state2 = state) === null || _state2 === void 0 ? void 0 : _state2.activeCartId]);
|
|
320
416
|
console.log('state.service.renderList', renderList);
|
|
321
417
|
var isService = useMemo(function () {
|
|
322
418
|
var _state$service4, _state$service4$value;
|
|
@@ -362,6 +458,10 @@ var Info = function Info(props) {
|
|
|
362
458
|
}
|
|
363
459
|
}, [state.renderType, state.modalOpen]);
|
|
364
460
|
var addButton = useMemo(function () {
|
|
461
|
+
// 跨日预约不显示添加服务按钮
|
|
462
|
+
if (isDay) {
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
365
465
|
if (state.isBookingCreatePage) {
|
|
366
466
|
return /*#__PURE__*/React.createElement("div", {
|
|
367
467
|
style: {
|
|
@@ -396,11 +496,31 @@ var Info = function Info(props) {
|
|
|
396
496
|
var isRenderCurrent = useMemo(function () {
|
|
397
497
|
return renderMode === 'current';
|
|
398
498
|
}, [renderMode]);
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* @title: 日期宽度
|
|
502
|
+
* @description:
|
|
503
|
+
* @param {*} useMemo
|
|
504
|
+
* @return {*}
|
|
505
|
+
* @Author: WangHan
|
|
506
|
+
* @Date: 2024-12-09 15:46
|
|
507
|
+
*/
|
|
508
|
+
var colSpan = useMemo(function () {
|
|
509
|
+
var isTerminal = state.isTerminalDayBookingPage;
|
|
510
|
+
var showDate = !!(isDay && holderId(state));
|
|
511
|
+
return inputDateCol(showDate, isTerminal);
|
|
512
|
+
}, [state.isTerminalDayBookingPage, isDay, holderId(state)]);
|
|
399
513
|
return useMemo(function () {
|
|
400
514
|
var _state$service7, _state$service7$cache;
|
|
401
515
|
var header = /*#__PURE__*/React.createElement("div", {
|
|
402
|
-
className: 'pisell-lowcode__booking-service-header'
|
|
403
|
-
|
|
516
|
+
className: 'pisell-lowcode__booking-service-header',
|
|
517
|
+
ref: headerRef
|
|
518
|
+
}, /*#__PURE__*/React.createElement(Row, {
|
|
519
|
+
gutter: [16, 16]
|
|
520
|
+
}, isDay && holderId(state) ? /*#__PURE__*/React.createElement(Col, colSpan.date, /*#__PURE__*/React.createElement(DateRange, {
|
|
521
|
+
state: state,
|
|
522
|
+
dispatch: dispatch
|
|
523
|
+
})) : null, /*#__PURE__*/React.createElement(Col, colSpan.input, /*#__PURE__*/React.createElement(Input, {
|
|
404
524
|
ref: searchRef,
|
|
405
525
|
prefix: /*#__PURE__*/React.createElement(SearchLg, null),
|
|
406
526
|
style: {
|
|
@@ -413,9 +533,9 @@ var Info = function Info(props) {
|
|
|
413
533
|
onChange: function onChange(e) {
|
|
414
534
|
setSearch(e.target.value);
|
|
415
535
|
}
|
|
416
|
-
}));
|
|
536
|
+
}))));
|
|
417
537
|
var content = /*#__PURE__*/React.createElement("div", {
|
|
418
|
-
className: 'pisell-lowcode__booking-service-body'
|
|
538
|
+
className: isDay && headerHeight > 76 ? 'pisell-lowcode__booking-service-date-body' : 'pisell-lowcode__booking-service-body'
|
|
419
539
|
}, /*#__PURE__*/React.createElement(TabProduct, {
|
|
420
540
|
list: renderList,
|
|
421
541
|
amountSymbol: state.amountSymbol,
|
|
@@ -438,8 +558,8 @@ var Info = function Info(props) {
|
|
|
438
558
|
round: true
|
|
439
559
|
}), addButton, /*#__PURE__*/React.createElement(Drawer, _extends({
|
|
440
560
|
titleNoWrap: true,
|
|
441
|
-
open: state.service.addModal && !state.isBookingCreatePage,
|
|
442
|
-
title: locales.getText('pisell2.text.select-service'),
|
|
561
|
+
open: state.service.addModal && !state.isBookingCreatePage && !state.isTerminalDayBookingPage,
|
|
562
|
+
title: isDay ? locales.getText('pisell2.text.select.items') : locales.getText('pisell2.text.select-service'),
|
|
443
563
|
rootClassName: "booking-server-wrap",
|
|
444
564
|
onClose: function onClose() {
|
|
445
565
|
dispatch({
|
|
@@ -452,6 +572,6 @@ var Info = function Info(props) {
|
|
|
452
572
|
},
|
|
453
573
|
header: header
|
|
454
574
|
}, drawerProps || {}), content));
|
|
455
|
-
}, [(_state$service8 = state.service) === null || _state$service8 === void 0 ? void 0 : (_state$service8$cache = _state$service8.cacheItem) === null || _state$service8$cache === void 0 ? void 0 : _state$service8$cache.autoClose, addButton, state.service.addModal, locales, search, renderList, state.amountSymbol]);
|
|
575
|
+
}, [(_state$service8 = state.service) === null || _state$service8 === void 0 ? void 0 : (_state$service8$cache = _state$service8.cacheItem) === null || _state$service8$cache === void 0 ? void 0 : _state$service8$cache.autoClose, addButton, state.service.addModal, locales, search, renderList, state.amountSymbol, state.renderType, (_state3 = state) === null || _state3 === void 0 ? void 0 : _state3.activeCartId, headerHeight, holderId(state)]);
|
|
456
576
|
};
|
|
457
577
|
export default Info;
|
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
// border-bottom: 1px solid var(--gray-300, #D0D5DD);
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.pisell-lowcode__booking-service-body
|
|
7
|
-
|
|
6
|
+
.pisell-lowcode__booking-service-body,
|
|
7
|
+
.pisell-lowcode__booking-service-date-body {
|
|
8
|
+
background: var(--gray-50, #f9fafb);
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.pisell-lowcode__booking-vertical-add-service-wrap {
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
.booking-category-list {
|
|
26
27
|
padding: 0 16px !important;
|
|
27
28
|
}
|
|
29
|
+
|
|
28
30
|
.pisell-lowcode__booking-service-body {
|
|
29
31
|
.booking-tab-product {
|
|
30
32
|
.booking-tabs-wrap {
|
|
@@ -32,4 +34,12 @@
|
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
}
|
|
35
|
-
|
|
37
|
+
|
|
38
|
+
.pisell-lowcode__booking-service-date-body {
|
|
39
|
+
.booking-tab-product {
|
|
40
|
+
.booking-tabs-wrap {
|
|
41
|
+
top: 136px !important;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import dayjs from
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
2
|
export declare const getDurationProps: ({ cacheItem, useStartTime, currentResource, slice, }: any) => {
|
|
3
3
|
startDate: dayjs.Dayjs;
|
|
4
4
|
usableTime: any;
|
|
@@ -48,7 +48,7 @@ export declare const getTimeObj: ({ cacheItem, useStartTime, currentResource, st
|
|
|
48
48
|
* @Author: zhiwei.Wang
|
|
49
49
|
* @Date: 2024-01-09 13:38
|
|
50
50
|
*/
|
|
51
|
-
export declare const formatResources: ({ cacheItem, resourcesOrigin }: any) => any[];
|
|
51
|
+
export declare const formatResources: ({ cacheItem, resourcesOrigin, isDay }: any) => any[];
|
|
52
52
|
export declare const checkCacheItemResource: ({ cacheItem, resources }: any) => any;
|
|
53
53
|
/**
|
|
54
54
|
* @title: 预生成服务的 extend
|
|
@@ -59,3 +59,12 @@ export declare const checkCacheItemResource: ({ cacheItem, resources }: any) =>
|
|
|
59
59
|
* @Date: 2024-06-01 13:25
|
|
60
60
|
*/
|
|
61
61
|
export declare const getProductExtend: ({ cacheItem, state }: any) => any;
|
|
62
|
+
/**
|
|
63
|
+
* @title: 获取资源标题
|
|
64
|
+
* @description:
|
|
65
|
+
* @param {any} param1
|
|
66
|
+
* @return {*}
|
|
67
|
+
* @Author: WangHan
|
|
68
|
+
* @Date: 2024-12-09 15:53
|
|
69
|
+
*/
|
|
70
|
+
export declare const getResourceTitle: ({ state, id }: any) => any;
|
|
@@ -10,11 +10,12 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
10
10
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
11
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
12
|
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; }
|
|
13
|
-
import React from
|
|
13
|
+
import React from 'react';
|
|
14
14
|
import { getServeStartTime, getDuration, getEndDate, flexibleObj, sliceDayIntoFiveMinutes, getDiscountTime, getServerItemExtend, formatResource } from "../../../utils";
|
|
15
|
-
import dayjs from
|
|
16
|
-
import { locales } from
|
|
17
|
-
import AlertTriangle from
|
|
15
|
+
import dayjs from 'dayjs';
|
|
16
|
+
import { locales } from '@pisell/utils';
|
|
17
|
+
import AlertTriangle from '@pisell/icon/es/AlertTriangle';
|
|
18
|
+
import { isDayBooking } from "../../service2/utils";
|
|
18
19
|
export var getDurationProps = function getDurationProps(_ref) {
|
|
19
20
|
var _currentResource$_ext;
|
|
20
21
|
var cacheItem = _ref.cacheItem,
|
|
@@ -23,13 +24,13 @@ export var getDurationProps = function getDurationProps(_ref) {
|
|
|
23
24
|
slice = _ref.slice;
|
|
24
25
|
var _cacheItem = cacheItem;
|
|
25
26
|
return {
|
|
26
|
-
startDate: dayjs(dayjs(_cacheItem._extend.start_date).format(
|
|
27
|
+
startDate: dayjs(dayjs(_cacheItem._extend.start_date).format('YYYY-MM-DD ') + (getServeStartTime(useStartTime) || '00:00')),
|
|
27
28
|
usableTime: currentResource === null || currentResource === void 0 ? void 0 : (_currentResource$_ext = currentResource._extend) === null || _currentResource$_ext === void 0 ? void 0 : _currentResource$_ext.usableTime,
|
|
28
29
|
duration: getDuration(_cacheItem === null || _cacheItem === void 0 ? void 0 : _cacheItem.duration),
|
|
29
30
|
locale: locales.locale,
|
|
30
31
|
slice: slice,
|
|
31
32
|
selectProps: {
|
|
32
|
-
size:
|
|
33
|
+
size: 'large'
|
|
33
34
|
}
|
|
34
35
|
};
|
|
35
36
|
};
|
|
@@ -55,14 +56,14 @@ export var getFlexibleOption = function getFlexibleOption(_ref2) {
|
|
|
55
56
|
slice: slice
|
|
56
57
|
});
|
|
57
58
|
var _duration = _durationProps.duration;
|
|
58
|
-
if (_duration ===
|
|
59
|
+
if (_duration === 'flexible') {
|
|
59
60
|
var _durationProps$usable, _durationProps$usable2;
|
|
60
61
|
// 获取结束时间
|
|
61
62
|
var endDate = getEndDate(_durationProps.startDate, _duration, (_durationProps$usable = _durationProps.usableTime) !== null && _durationProps$usable !== void 0 && _durationProps$usable.end_at ? dayjs((_durationProps$usable2 = _durationProps.usableTime) === null || _durationProps$usable2 === void 0 ? void 0 : _durationProps$usable2.end_at) : null);
|
|
62
63
|
// 转换为分钟
|
|
63
|
-
var timeValue = endDate.diff(_durationProps.startDate,
|
|
64
|
+
var timeValue = endDate.diff(_durationProps.startDate, 'minute');
|
|
64
65
|
return {
|
|
65
|
-
label: locales.getText(
|
|
66
|
+
label: locales.getText('pisell2.text.flexible'),
|
|
66
67
|
value: flexibleObj.create(timeValue)
|
|
67
68
|
};
|
|
68
69
|
}
|
|
@@ -91,7 +92,7 @@ export var getTimeObj = function getTimeObj(_ref3) {
|
|
|
91
92
|
state: state,
|
|
92
93
|
durationProps: durationProps
|
|
93
94
|
});
|
|
94
|
-
var obj = sliceDayIntoFiveMinutes((_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.service_time, locales.locale);
|
|
95
|
+
var obj = sliceDayIntoFiveMinutes((_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.service_time, locales.locale, isDayBooking(state));
|
|
95
96
|
var timeSlices = _toConsumableArray(obj.timeSlices);
|
|
96
97
|
var durationSlicesBasedOnTime = _toConsumableArray(obj.durationSlicesBasedOnTime);
|
|
97
98
|
|
|
@@ -105,26 +106,26 @@ export var getTimeObj = function getTimeObj(_ref3) {
|
|
|
105
106
|
return d.value === useDuration;
|
|
106
107
|
})) {
|
|
107
108
|
durationSlicesBasedOnTime.unshift({
|
|
108
|
-
label: getDiscountTime(useDuration),
|
|
109
|
+
label: getDiscountTime(useDuration, isDayBooking(state)),
|
|
109
110
|
value: useDuration,
|
|
110
111
|
//@ts-ignore
|
|
111
112
|
disabled: true
|
|
112
113
|
});
|
|
113
114
|
}
|
|
114
115
|
// 如果有选择时间, 但是不在列表内 则需要在列表内添加上此值
|
|
115
|
-
if (useStartTime && useStartTime !==
|
|
116
|
+
if (useStartTime && useStartTime !== 'now' && !timeSlices.some(function (d) {
|
|
116
117
|
return d.value === useStartTime;
|
|
117
118
|
})) {
|
|
118
119
|
timeSlices.unshift({
|
|
119
|
-
label: dayjs(useStartTime,
|
|
120
|
+
label: dayjs(useStartTime, 'HH:mm').format('hh:mm A'),
|
|
120
121
|
value: useStartTime
|
|
121
122
|
});
|
|
122
123
|
}
|
|
123
124
|
|
|
124
125
|
// 增加当前
|
|
125
126
|
timeSlices.unshift({
|
|
126
|
-
label: locales.getText(
|
|
127
|
-
value:
|
|
127
|
+
label: locales.getText('pisell2.text.now'),
|
|
128
|
+
value: 'now'
|
|
128
129
|
});
|
|
129
130
|
return _objectSpread(_objectSpread({}, obj), {}, {
|
|
130
131
|
timeSlices: timeSlices,
|
|
@@ -141,7 +142,8 @@ export var getTimeObj = function getTimeObj(_ref3) {
|
|
|
141
142
|
*/
|
|
142
143
|
export var formatResources = function formatResources(_ref4) {
|
|
143
144
|
var cacheItem = _ref4.cacheItem,
|
|
144
|
-
resourcesOrigin = _ref4.resourcesOrigin
|
|
145
|
+
resourcesOrigin = _ref4.resourcesOrigin,
|
|
146
|
+
isDay = _ref4.isDay;
|
|
145
147
|
try {
|
|
146
148
|
// 合并无资源
|
|
147
149
|
var _list = _toConsumableArray(resourcesOrigin);
|
|
@@ -156,7 +158,7 @@ export var formatResources = function formatResources(_ref4) {
|
|
|
156
158
|
}), item.labelText, !item.usable && /*#__PURE__*/React.createElement(AlertTriangle, {
|
|
157
159
|
className: "resource-option-alert-icon"
|
|
158
160
|
}));
|
|
159
|
-
});
|
|
161
|
+
}, isDay);
|
|
160
162
|
});
|
|
161
163
|
// 排序, 将可用资源放在最前面
|
|
162
164
|
_list = _list.sort(function (a, b) {
|
|
@@ -164,7 +166,7 @@ export var formatResources = function formatResources(_ref4) {
|
|
|
164
166
|
});
|
|
165
167
|
return _list;
|
|
166
168
|
} catch (err) {
|
|
167
|
-
console.log(
|
|
169
|
+
console.log('formatResourcesErr', err);
|
|
168
170
|
}
|
|
169
171
|
return [];
|
|
170
172
|
};
|
|
@@ -175,21 +177,23 @@ export var checkCacheItemResource = function checkCacheItemResource(_ref5) {
|
|
|
175
177
|
if (resourceId || resourceId === 0) {
|
|
176
178
|
// 校验, 如果当前选择的资源 在列表里没找到, 则恢复成无资源, 防止数据错乱
|
|
177
179
|
if (!resources.find(function (d) {
|
|
178
|
-
return d.form_record_id === resourceId;
|
|
180
|
+
return (d === null || d === void 0 ? void 0 : d.form_record_id) === resourceId;
|
|
179
181
|
})) {
|
|
180
182
|
resourceId = undefined;
|
|
181
183
|
}
|
|
182
184
|
} else {
|
|
183
185
|
if (cacheItem.new) {
|
|
184
186
|
if (resources.length <= 2) {
|
|
185
|
-
|
|
187
|
+
var _resources;
|
|
188
|
+
resourceId = resources === null || resources === void 0 ? void 0 : (_resources = resources[(resources === null || resources === void 0 ? void 0 : resources.length) - 1]) === null || _resources === void 0 ? void 0 : _resources.form_record_id;
|
|
186
189
|
}
|
|
187
190
|
if (resources.length > 2) {
|
|
188
191
|
var usableList = resources.filter(function (d) {
|
|
189
192
|
return d.usable && d.form_id !== 0;
|
|
190
193
|
});
|
|
191
194
|
if (usableList.length === 1) {
|
|
192
|
-
|
|
195
|
+
var _usableList$;
|
|
196
|
+
resourceId = usableList === null || usableList === void 0 ? void 0 : (_usableList$ = usableList[0]) === null || _usableList$ === void 0 ? void 0 : _usableList$.form_record_id;
|
|
193
197
|
}
|
|
194
198
|
}
|
|
195
199
|
}
|
|
@@ -219,12 +223,13 @@ export var getProductExtend = function getProductExtend(_ref6) {
|
|
|
219
223
|
// 编辑时,找到当前选择的资源
|
|
220
224
|
if (!cacheItem.new) {
|
|
221
225
|
// 格式化资源列表
|
|
222
|
-
var
|
|
226
|
+
var _resources2 = formatResources({
|
|
223
227
|
cacheItem: cacheItem,
|
|
224
228
|
resourcesOrigin: resourcesOrigin
|
|
225
229
|
});
|
|
226
|
-
var item =
|
|
227
|
-
|
|
230
|
+
var item = _resources2.find(function (d) {
|
|
231
|
+
var _cacheItem$_extend;
|
|
232
|
+
return (d === null || d === void 0 ? void 0 : d.form_record_id) == ((_cacheItem$_extend = cacheItem._extend) === null || _cacheItem$_extend === void 0 ? void 0 : _cacheItem$_extend.resource);
|
|
228
233
|
}) || {};
|
|
229
234
|
if (item) {
|
|
230
235
|
currentResource = item;
|
|
@@ -257,4 +262,24 @@ export var getProductExtend = function getProductExtend(_ref6) {
|
|
|
257
262
|
resources: resources
|
|
258
263
|
});
|
|
259
264
|
return _extend;
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* @title: 获取资源标题
|
|
269
|
+
* @description:
|
|
270
|
+
* @param {any} param1
|
|
271
|
+
* @return {*}
|
|
272
|
+
* @Author: WangHan
|
|
273
|
+
* @Date: 2024-12-09 15:53
|
|
274
|
+
*/
|
|
275
|
+
export var getResourceTitle = function getResourceTitle(_ref7) {
|
|
276
|
+
var _state$client;
|
|
277
|
+
var state = _ref7.state,
|
|
278
|
+
id = _ref7.id;
|
|
279
|
+
var resources = (state === null || state === void 0 ? void 0 : (_state$client = state.client) === null || _state$client === void 0 ? void 0 : _state$client.value) || [];
|
|
280
|
+
if (!resources.length) return '';
|
|
281
|
+
var resource = resources.find(function (d) {
|
|
282
|
+
return d.id === id;
|
|
283
|
+
});
|
|
284
|
+
return (resource === null || resource === void 0 ? void 0 : resource.main_field) || '-';
|
|
260
285
|
};
|