@pisell/private-materials 3.0.127 → 3.0.128
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/meta.js +1 -1
- package/build/lowcode/preview.js +2 -2
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.js +4 -4
- package/es/components/booking/components/TabProduct/index.js +63 -60
- package/es/components/booking/components/customSelect/index.d.ts +1 -1
- package/es/components/booking/forms/forms.d.ts +2 -2
- package/es/components/booking/forms/forms.js +61 -58
- package/es/components/booking/info/client/index.d.ts +4 -4
- package/es/components/booking/info/client/index.js +94 -90
- package/es/components/booking/info/clientVariant/vertical/index.js +5 -4
- package/es/components/booking/info/index.js +1 -1
- package/es/components/booking/info/pet/index.d.ts +3 -3
- package/es/components/booking/info/pet/index.js +135 -131
- package/es/components/booking/info/service/addService/index.js +47 -45
- package/es/components/booking/info/service/addTimeModal/index.d.ts +2 -2
- package/es/components/booking/info/service/addTimeModal/index.js +218 -225
- package/es/components/booking/info/service/editService/index.js +194 -192
- package/es/components/booking/info/service/index.d.ts +2 -2
- package/es/components/booking/info/service/index.js +1 -1
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/booking/components/TabProduct/index.js +61 -58
- package/lib/components/booking/components/customSelect/index.d.ts +1 -1
- package/lib/components/booking/forms/forms.d.ts +2 -2
- package/lib/components/booking/forms/forms.js +90 -75
- package/lib/components/booking/info/client/index.d.ts +4 -4
- package/lib/components/booking/info/client/index.js +59 -48
- package/lib/components/booking/info/clientVariant/vertical/index.js +5 -4
- package/lib/components/booking/info/index.js +1 -1
- package/lib/components/booking/info/pet/index.d.ts +3 -3
- package/lib/components/booking/info/pet/index.js +113 -84
- package/lib/components/booking/info/service/addService/index.js +112 -99
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +2 -2
- package/lib/components/booking/info/service/addTimeModal/index.js +154 -127
- package/lib/components/booking/info/service/editService/index.js +196 -171
- package/lib/components/booking/info/service/index.d.ts +2 -2
- package/lib/components/booking/info/service/index.js +1 -1
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/package.json +4 -4
|
@@ -18,24 +18,25 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
18
18
|
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; }
|
|
19
19
|
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; } }
|
|
20
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
import React, { useContext, useEffect, useMemo, useState } from
|
|
22
|
-
import User01 from
|
|
21
|
+
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
22
|
+
import User01 from '@pisell/icon/es/User01';
|
|
23
23
|
import { Context } from "../model";
|
|
24
|
-
import { Avatar, Skeleton, Button } from
|
|
24
|
+
import { Avatar, Skeleton, Button } from 'antd';
|
|
25
25
|
import "./index.less";
|
|
26
|
-
import { locales } from
|
|
26
|
+
import { locales } from '@pisell/utils';
|
|
27
27
|
import FormsCom from "../../forms/forms";
|
|
28
28
|
import { changeFormValues, sortFormValues } from "../../forms/format";
|
|
29
29
|
import { isWalkIn } from "../../utils";
|
|
30
30
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
31
|
+
import { useMemoizedFn } from "ahooks";
|
|
31
32
|
var defaultParams = {
|
|
32
33
|
skip: 1,
|
|
33
34
|
num: 20,
|
|
34
35
|
total: 0,
|
|
35
|
-
keyword:
|
|
36
|
+
keyword: ''
|
|
36
37
|
};
|
|
37
38
|
var Pet = function Pet(props) {
|
|
38
|
-
var _context$appHelper, _state2, _state2$bookingConfig, _state2$bookingConfig2, _state2$bookingConfig3, _state$bookingConfig3, _state$client$value2, _state$client9, _state$client9$value, _state$pet5, _state$pet5$formData, _state$pet5$formData$, _state$pet5$formData$2, _state$
|
|
39
|
+
var _context$appHelper, _state2, _state2$bookingConfig, _state2$bookingConfig2, _state2$bookingConfig3, _state$bookingConfig3, _state$client$value2, _state$client9, _state$client9$value, _state$pet5, _state$pet5$formData, _state$pet5$formData$, _state$pet5$formData$2, _state$client11;
|
|
39
40
|
var hideTitle = props.hideTitle,
|
|
40
41
|
addButtonProps = props.addButtonProps,
|
|
41
42
|
handleOpenModal = props.handleOpenModal,
|
|
@@ -89,7 +90,7 @@ var Pet = function Pet(props) {
|
|
|
89
90
|
options: [],
|
|
90
91
|
form_id: _holder.form.id,
|
|
91
92
|
field: _holder.form.form_field,
|
|
92
|
-
relation_type:
|
|
93
|
+
relation_type: 'appointment_booking',
|
|
93
94
|
form_record: []
|
|
94
95
|
});
|
|
95
96
|
}, [(_state$bookingConfig3 = state.bookingConfig) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.holder]);
|
|
@@ -121,7 +122,7 @@ var Pet = function Pet(props) {
|
|
|
121
122
|
_params = _args.length > 1 && _args[1] !== undefined ? _args[1] : defaultParams;
|
|
122
123
|
setLoading(true);
|
|
123
124
|
_list = []; // 只要不是 客户表单并且没选择客户, 都获取数据
|
|
124
|
-
noClient = formData.data_range ===
|
|
125
|
+
noClient = formData.data_range === 'customer' && isWalkIn((_state$client = state.client) === null || _state$client === void 0 ? void 0 : (_state$client$value = _state$client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id);
|
|
125
126
|
if (noClient) {
|
|
126
127
|
_context.next = 14;
|
|
127
128
|
break;
|
|
@@ -131,7 +132,7 @@ var Pet = function Pet(props) {
|
|
|
131
132
|
}, _params), {}, {
|
|
132
133
|
source_shop_customer: petForm === null || petForm === void 0 ? void 0 : petForm.is_franchisor
|
|
133
134
|
});
|
|
134
|
-
if (formData.data_range ===
|
|
135
|
+
if (formData.data_range === 'customer') {
|
|
135
136
|
_values.customer_id = (_state$client2 = state.client) === null || _state$client2 === void 0 ? void 0 : (_state$client2$value = _state$client2.value) === null || _state$client2$value === void 0 ? void 0 : _state$client2$value.id;
|
|
136
137
|
}
|
|
137
138
|
_context.next = 10;
|
|
@@ -149,7 +150,7 @@ var Pet = function Pet(props) {
|
|
|
149
150
|
}));
|
|
150
151
|
case 14:
|
|
151
152
|
dispatch({
|
|
152
|
-
type:
|
|
153
|
+
type: 'setPet',
|
|
153
154
|
payload: {
|
|
154
155
|
formData: [_objectSpread(_objectSpread({}, formData), {}, {
|
|
155
156
|
options: _list
|
|
@@ -204,13 +205,13 @@ var Pet = function Pet(props) {
|
|
|
204
205
|
}
|
|
205
206
|
_context2.prev = 4;
|
|
206
207
|
formData = petForm;
|
|
207
|
-
if (!(state.renderType ===
|
|
208
|
+
if (!(state.renderType === 'eventBooking')) {
|
|
208
209
|
_context2.next = 12;
|
|
209
210
|
break;
|
|
210
211
|
}
|
|
211
212
|
_context2.next = 9;
|
|
212
213
|
return state.apis.getForms({
|
|
213
|
-
relation_type:
|
|
214
|
+
relation_type: 'event_booking_v2',
|
|
214
215
|
relation_id: ((_state$bookingDetail2 = state.bookingDetail) === null || _state$bookingDetail2 === void 0 ? void 0 : (_state$bookingDetail3 = _state$bookingDetail2.bookings) === null || _state$bookingDetail3 === void 0 ? void 0 : _state$bookingDetail3.id) || 0
|
|
215
216
|
// _config: { useCache: true },
|
|
216
217
|
});
|
|
@@ -241,13 +242,13 @@ var Pet = function Pet(props) {
|
|
|
241
242
|
});
|
|
242
243
|
case 16:
|
|
243
244
|
records = _context2.sent;
|
|
244
|
-
console.log(
|
|
245
|
+
console.log('records', records);
|
|
245
246
|
values[boardParams === null || boardParams === void 0 ? void 0 : boardParams.form_id] = sortFormValues(records, (_state$client3 = state.client) === null || _state$client3 === void 0 ? void 0 : (_state$client3$value = _state$client3.value) === null || _state$client3$value === void 0 ? void 0 : _state$client3$value.id);
|
|
246
247
|
payload.value = values;
|
|
247
248
|
setValueLoading(false);
|
|
248
249
|
case 21:
|
|
249
250
|
dispatch({
|
|
250
|
-
type:
|
|
251
|
+
type: 'setPet',
|
|
251
252
|
payload: payload
|
|
252
253
|
});
|
|
253
254
|
_context2.next = 29;
|
|
@@ -257,7 +258,7 @@ var Pet = function Pet(props) {
|
|
|
257
258
|
_context2.t0 = _context2["catch"](4);
|
|
258
259
|
setValueLoading(false);
|
|
259
260
|
setLoading(false);
|
|
260
|
-
console.log(
|
|
261
|
+
console.log('form_error', _context2.t0);
|
|
261
262
|
case 29:
|
|
262
263
|
case "end":
|
|
263
264
|
return _context2.stop();
|
|
@@ -268,22 +269,22 @@ var Pet = function Pet(props) {
|
|
|
268
269
|
return _ref4.apply(this, arguments);
|
|
269
270
|
};
|
|
270
271
|
}();
|
|
271
|
-
var handleViewItem = function
|
|
272
|
+
var handleViewItem = useMemoizedFn(function (item) {
|
|
272
273
|
var _state$client4, _state$client4$value;
|
|
273
274
|
var _data = {
|
|
274
275
|
formDataConfig: _objectSpread({}, petForm),
|
|
275
276
|
record: item
|
|
276
277
|
};
|
|
277
|
-
if (petForm.data_range ===
|
|
278
|
+
if (petForm.data_range === 'customer' && !isWalkIn((_state$client4 = state.client) === null || _state$client4 === void 0 ? void 0 : (_state$client4$value = _state$client4.value) === null || _state$client4$value === void 0 ? void 0 : _state$client4$value.id)) {
|
|
278
279
|
var _state$client5, _state$client5$value;
|
|
279
280
|
_data.customerId = (_state$client5 = state.client) === null || _state$client5 === void 0 ? void 0 : (_state$client5$value = _state$client5.value) === null || _state$client5$value === void 0 ? void 0 : _state$client5$value.id;
|
|
280
281
|
}
|
|
281
282
|
state.action({
|
|
282
|
-
type:
|
|
283
|
+
type: 'pisell1.goCustomFormDetail',
|
|
283
284
|
data: _data,
|
|
284
285
|
callback: function callback(res) {
|
|
285
286
|
var cur = _toConsumableArray(state.pet.value[petForm.form_id] || []);
|
|
286
|
-
if (res.type ===
|
|
287
|
+
if (res.type === 'delete') {
|
|
287
288
|
cur = cur.filter(function (d) {
|
|
288
289
|
return d.form_record_id !== item.form_record_id;
|
|
289
290
|
});
|
|
@@ -313,25 +314,25 @@ var Pet = function Pet(props) {
|
|
|
313
314
|
_addCallback();
|
|
314
315
|
}
|
|
315
316
|
});
|
|
316
|
-
};
|
|
317
|
-
var handleEditItem = function
|
|
317
|
+
});
|
|
318
|
+
var handleEditItem = useMemoizedFn(function (item) {
|
|
318
319
|
var _state$client6, _state$client6$value;
|
|
319
320
|
var _data = {
|
|
320
321
|
formDataConfig: _objectSpread({}, petForm),
|
|
321
322
|
record: item
|
|
322
323
|
};
|
|
323
|
-
if (petForm.data_range ===
|
|
324
|
+
if (petForm.data_range === 'customer' && !isWalkIn((_state$client6 = state.client) === null || _state$client6 === void 0 ? void 0 : (_state$client6$value = _state$client6.value) === null || _state$client6$value === void 0 ? void 0 : _state$client6$value.id)) {
|
|
324
325
|
var _state$client7, _state$client7$value;
|
|
325
326
|
_data.customerId = (_state$client7 = state.client) === null || _state$client7 === void 0 ? void 0 : (_state$client7$value = _state$client7.value) === null || _state$client7$value === void 0 ? void 0 : _state$client7$value.id;
|
|
326
327
|
}
|
|
327
328
|
state.action({
|
|
328
|
-
type:
|
|
329
|
+
type: 'pisell1.editCustomFormRecord',
|
|
329
330
|
data: _data,
|
|
330
331
|
callback: function callback() {
|
|
331
332
|
_addCallback();
|
|
332
333
|
}
|
|
333
334
|
});
|
|
334
|
-
};
|
|
335
|
+
});
|
|
335
336
|
|
|
336
337
|
/**
|
|
337
338
|
* @title: 修改数据
|
|
@@ -341,18 +342,18 @@ var Pet = function Pet(props) {
|
|
|
341
342
|
* @Author: zhiwei.Wang
|
|
342
343
|
* @Date: 2024-01-27 14:16
|
|
343
344
|
*/
|
|
344
|
-
var onValueChange = function
|
|
345
|
+
var onValueChange = useMemoizedFn(function (_ref5) {
|
|
345
346
|
var values = _ref5.values,
|
|
346
347
|
_ref5$edit = _ref5.edit,
|
|
347
348
|
edit = _ref5$edit === void 0 ? true : _ref5$edit;
|
|
348
349
|
dispatch({
|
|
349
|
-
type:
|
|
350
|
+
type: 'setPet',
|
|
350
351
|
payload: {
|
|
351
352
|
edit: edit,
|
|
352
353
|
value: values
|
|
353
354
|
}
|
|
354
355
|
});
|
|
355
|
-
};
|
|
356
|
+
});
|
|
356
357
|
|
|
357
358
|
// 当客户id 发生改变时, 检测当前表单是否是该客户的, 如果不是则移除
|
|
358
359
|
useEffect(function () {
|
|
@@ -365,7 +366,7 @@ var Pet = function Pet(props) {
|
|
|
365
366
|
});
|
|
366
367
|
setTimeout(function () {
|
|
367
368
|
dispatch({
|
|
368
|
-
type:
|
|
369
|
+
type: 'setPet',
|
|
369
370
|
payload: {
|
|
370
371
|
value: changeFormValuesData
|
|
371
372
|
}
|
|
@@ -379,7 +380,7 @@ var Pet = function Pet(props) {
|
|
|
379
380
|
return;
|
|
380
381
|
}
|
|
381
382
|
}
|
|
382
|
-
if (boardParams.form_id && boardParams.type ===
|
|
383
|
+
if (boardParams.form_id && boardParams.type === 'form') {
|
|
383
384
|
getForms(true);
|
|
384
385
|
}
|
|
385
386
|
};
|
|
@@ -390,7 +391,7 @@ var Pet = function Pet(props) {
|
|
|
390
391
|
handleUpdateForm();
|
|
391
392
|
}, 10);
|
|
392
393
|
}, [state.bookingId, state.bookingDetail, boardParams.form_id, boardParams.type, state.renderType, petForm, clientChangeNotSetPet ? (_state$client9 = state.client) === null || _state$client9 === void 0 ? void 0 : (_state$client9$value = _state$client9.value) === null || _state$client9$value === void 0 ? void 0 : _state$client9$value.id : undefined]);
|
|
393
|
-
var _addCallback = function
|
|
394
|
+
var _addCallback = useMemoizedFn(function (_params) {
|
|
394
395
|
var _state$pet3, _state$pet3$formData;
|
|
395
396
|
var _formData = (_state$pet3 = state.pet) === null || _state$pet3 === void 0 ? void 0 : (_state$pet3$formData = _state$pet3.formData) === null || _state$pet3$formData === void 0 ? void 0 : _state$pet3$formData[0];
|
|
396
397
|
// if (_formData?.type === "multiple" || _formData?.type === "single") {
|
|
@@ -398,23 +399,23 @@ var Pet = function Pet(props) {
|
|
|
398
399
|
formData: _formData
|
|
399
400
|
}, _params);
|
|
400
401
|
// }
|
|
401
|
-
};
|
|
402
|
+
});
|
|
402
403
|
|
|
403
|
-
var searchChange = function
|
|
404
|
+
var searchChange = useMemoizedFn(function (keyword) {
|
|
404
405
|
var _params = _objectSpread(_objectSpread({}, params), {}, {
|
|
405
406
|
skip: 1,
|
|
406
407
|
keyword: keyword
|
|
407
408
|
});
|
|
408
409
|
_addCallback(_params);
|
|
409
|
-
};
|
|
410
|
+
});
|
|
410
411
|
var loadMore = useMemo(function () {
|
|
411
412
|
var _state$pet4, _state$pet4$formData, _state$pet4$formData$, _state$pet4$formData$2;
|
|
412
413
|
var show = ((_state$pet4 = state.pet) === null || _state$pet4 === void 0 ? void 0 : (_state$pet4$formData = _state$pet4.formData) === null || _state$pet4$formData === void 0 ? void 0 : (_state$pet4$formData$ = _state$pet4$formData[0]) === null || _state$pet4$formData$ === void 0 ? void 0 : (_state$pet4$formData$2 = _state$pet4$formData$.options) === null || _state$pet4$formData$2 === void 0 ? void 0 : _state$pet4$formData$2.length) < params.total || 0;
|
|
413
414
|
return show ? /*#__PURE__*/React.createElement("div", {
|
|
414
415
|
className: "",
|
|
415
416
|
style: {
|
|
416
|
-
textAlign:
|
|
417
|
-
padding:
|
|
417
|
+
textAlign: 'center',
|
|
418
|
+
padding: '16px 0'
|
|
418
419
|
}
|
|
419
420
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
420
421
|
loading: loadLoading,
|
|
@@ -424,105 +425,108 @@ var Pet = function Pet(props) {
|
|
|
424
425
|
});
|
|
425
426
|
_addCallback(_params);
|
|
426
427
|
}
|
|
427
|
-
}, locales.getText(
|
|
428
|
+
}, locales.getText('pisell2.text.load-more'))) : null;
|
|
428
429
|
}, [loadLoading, params, (_state$pet5 = state.pet) === null || _state$pet5 === void 0 ? void 0 : (_state$pet5$formData = _state$pet5.formData) === null || _state$pet5$formData === void 0 ? void 0 : (_state$pet5$formData$ = _state$pet5$formData[0]) === null || _state$pet5$formData$ === void 0 ? void 0 : (_state$pet5$formData$2 = _state$pet5$formData$.options) === null || _state$pet5$formData$2 === void 0 ? void 0 : _state$pet5$formData$2.length]);
|
|
429
|
-
return
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
_addCallback();
|
|
442
|
-
},
|
|
443
|
-
loading: valueLoading,
|
|
444
|
-
forms: state.pet.formData,
|
|
445
|
-
action: state.action,
|
|
446
|
-
modalOpen: state.modalOpen,
|
|
447
|
-
value: state.pet.value,
|
|
448
|
-
onChange: onValueChange,
|
|
449
|
-
client: (_state$client10 = state.client) === null || _state$client10 === void 0 ? void 0 : _state$client10.value,
|
|
450
|
-
customSelectProps: {
|
|
451
|
-
loading: loading,
|
|
452
|
-
handleViewItem: handleViewItem,
|
|
453
|
-
virtualListHeight: window.innerHeight - 213 - 57 - 16,
|
|
454
|
-
disabled: state.disabledEdit,
|
|
455
|
-
autoFocus: !state.isTerminal,
|
|
456
|
-
closeCallback: function closeCallback() {
|
|
457
|
-
searchChange("");
|
|
430
|
+
return useMemo(function () {
|
|
431
|
+
var _state$client10;
|
|
432
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
433
|
+
className: "pisell-lowcode__booking-pet-wraps"
|
|
434
|
+
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
435
|
+
loading: valueLoading,
|
|
436
|
+
active: true,
|
|
437
|
+
round: true
|
|
438
|
+
}, /*#__PURE__*/React.createElement(FormsCom, {
|
|
439
|
+
hideTitle: hideTitle,
|
|
440
|
+
watch: {
|
|
441
|
+
value: state.pet.value
|
|
458
442
|
},
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
searchValue: params.search,
|
|
462
|
-
loadMore: loadMore,
|
|
463
|
-
filterItem: function filterItem() {
|
|
464
|
-
return true;
|
|
443
|
+
addCallback: function addCallback() {
|
|
444
|
+
_addCallback();
|
|
465
445
|
},
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
handleViewItem(item);
|
|
492
|
-
}
|
|
493
|
-
}, locales.getText("pisell2.text.view")), /*#__PURE__*/React.createElement("div", {
|
|
494
|
-
className: "pisell-lowcode__booking-pet-list-item-actions-edit",
|
|
495
|
-
onClick: function onClick(e) {
|
|
496
|
-
e.preventDefault();
|
|
497
|
-
e.stopPropagation();
|
|
498
|
-
handleEditItem(item);
|
|
499
|
-
}
|
|
500
|
-
}, locales.getText("pisell2.text.edit"))));
|
|
501
|
-
},
|
|
502
|
-
addButtonProps: _objectSpread({
|
|
503
|
-
style: {
|
|
504
|
-
margin: 0
|
|
446
|
+
loading: valueLoading,
|
|
447
|
+
forms: state.pet.formData,
|
|
448
|
+
action: state.action,
|
|
449
|
+
modalOpen: state.modalOpen,
|
|
450
|
+
value: state.pet.value,
|
|
451
|
+
onChange: onValueChange,
|
|
452
|
+
client: (_state$client10 = state.client) === null || _state$client10 === void 0 ? void 0 : _state$client10.value,
|
|
453
|
+
customSelectProps: {
|
|
454
|
+
loading: loading,
|
|
455
|
+
handleViewItem: handleViewItem,
|
|
456
|
+
virtualListHeight: window.innerHeight - 213 - 57 - 16,
|
|
457
|
+
disabled: state.disabledEdit,
|
|
458
|
+
autoFocus: !state.isTerminal,
|
|
459
|
+
closeCallback: function closeCallback() {
|
|
460
|
+
searchChange('');
|
|
461
|
+
},
|
|
462
|
+
showDropDown: !state.disableEventBookingEdit,
|
|
463
|
+
searchChange: searchChange,
|
|
464
|
+
searchValue: params.search,
|
|
465
|
+
loadMore: loadMore,
|
|
466
|
+
filterItem: function filterItem() {
|
|
467
|
+
return true;
|
|
468
|
+
},
|
|
469
|
+
handleOpenModal: handleOpenModal,
|
|
470
|
+
previewItemTitleRender: previewItemTitleRender
|
|
505
471
|
},
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
472
|
+
optionRender: function optionRender(item) {
|
|
473
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
474
|
+
className: "pisell-lowcode__booking-pet-list-item-avatar",
|
|
475
|
+
src: item.cover,
|
|
476
|
+
icon: /*#__PURE__*/React.createElement(User01, {
|
|
477
|
+
className: "pisell-lowcode__booking-pet-list-item-avatar-icon"
|
|
478
|
+
})
|
|
479
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
480
|
+
className: "pisell-lowcode__booking-pet-list-item-info"
|
|
481
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
482
|
+
className: "pisell-lowcode__booking-pet-list-item-info-name"
|
|
483
|
+
}, item.main_field), /*#__PURE__*/React.createElement("div", {
|
|
484
|
+
className: "pisell-lowcode__booking-pet-list-item-info-desc"
|
|
485
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
486
|
+
className: ""
|
|
487
|
+
}, item.key_age))), /*#__PURE__*/React.createElement("div", {
|
|
488
|
+
className: "pisell-lowcode__booking-pet-list-item-actions"
|
|
489
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
490
|
+
className: "pisell-lowcode__booking-pet-list-item-actions-view",
|
|
491
|
+
onClick: function onClick(e) {
|
|
492
|
+
e.preventDefault();
|
|
493
|
+
e.stopPropagation();
|
|
494
|
+
handleViewItem(item);
|
|
495
|
+
}
|
|
496
|
+
}, locales.getText('pisell2.text.view')), /*#__PURE__*/React.createElement("div", {
|
|
497
|
+
className: "pisell-lowcode__booking-pet-list-item-actions-edit",
|
|
498
|
+
onClick: function onClick(e) {
|
|
499
|
+
e.preventDefault();
|
|
500
|
+
e.stopPropagation();
|
|
501
|
+
handleEditItem(item);
|
|
502
|
+
}
|
|
503
|
+
}, locales.getText('pisell2.text.edit'))));
|
|
504
|
+
},
|
|
505
|
+
addButtonProps: _objectSpread({
|
|
506
|
+
style: {
|
|
507
|
+
margin: 0
|
|
508
|
+
},
|
|
509
|
+
disabled: state.disableEventBookingEdit,
|
|
510
|
+
showDisabledMessage: !state.disableEventBookingEdit,
|
|
511
|
+
addCallback: function () {
|
|
512
|
+
var _addCallback2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
513
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
514
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
515
|
+
case 0:
|
|
516
|
+
_addCallback();
|
|
517
|
+
case 1:
|
|
518
|
+
case "end":
|
|
519
|
+
return _context3.stop();
|
|
520
|
+
}
|
|
521
|
+
}, _callee3);
|
|
522
|
+
}));
|
|
523
|
+
function addCallback() {
|
|
524
|
+
return _addCallback2.apply(this, arguments);
|
|
525
|
+
}
|
|
526
|
+
return addCallback;
|
|
527
|
+
}()
|
|
528
|
+
}, addButtonProps)
|
|
529
|
+
})));
|
|
530
|
+
}, [valueLoading, hideTitle, state.pet.value, state.pet.formData, state.action, state.modalOpen, state.pet.value, (_state$client11 = state.client) === null || _state$client11 === void 0 ? void 0 : _state$client11.value, loading, state.disabledEdit, state.isTerminal, state.disableEventBookingEdit, params.search, loadMore, addButtonProps]);
|
|
527
531
|
};
|
|
528
532
|
export default Pet;
|
|
@@ -31,10 +31,10 @@ import { getIsBundleOrCombination } from "../../utils";
|
|
|
31
31
|
import { getProductExtend } from "./utils";
|
|
32
32
|
import { formatProductListByCategory, getProductTotalPrice, request } from "../../../utils";
|
|
33
33
|
import { locales, getUniqueId } from '@pisell/utils';
|
|
34
|
-
import { useUpdateEffect } from 'ahooks';
|
|
34
|
+
import { useMemoizedFn, useUpdateEffect } from 'ahooks';
|
|
35
35
|
var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386, 6848, 6305];
|
|
36
36
|
var Info = function Info(_ref) {
|
|
37
|
-
var _state$service3, _state$service5, _state$
|
|
37
|
+
var _state$service3, _state$service5, _state$service7, _state$service7$cache;
|
|
38
38
|
var onEdit = _ref.onEdit;
|
|
39
39
|
var _useState = useState(''),
|
|
40
40
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -204,7 +204,7 @@ var Info = function Info(_ref) {
|
|
|
204
204
|
}, 100);
|
|
205
205
|
}
|
|
206
206
|
};
|
|
207
|
-
var handleSelectProduct = function
|
|
207
|
+
var handleSelectProduct = useMemoizedFn(function (item, type) {
|
|
208
208
|
// 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
|
|
209
209
|
var isEject = type === 'detail' || item.bundle_group_count > 0;
|
|
210
210
|
var lock = false;
|
|
@@ -278,7 +278,7 @@ var Info = function Info(_ref) {
|
|
|
278
278
|
onEdit === null || onEdit === void 0 ? void 0 : onEdit(cacheItem);
|
|
279
279
|
}
|
|
280
280
|
});
|
|
281
|
-
};
|
|
281
|
+
});
|
|
282
282
|
var renderList = useMemo(function () {
|
|
283
283
|
var _state$service2;
|
|
284
284
|
var _list = ((_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.services) || [];
|
|
@@ -296,7 +296,6 @@ var Info = function Info(_ref) {
|
|
|
296
296
|
useEffect(function () {
|
|
297
297
|
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _state$service4, _state$service4$value;
|
|
298
298
|
// Salonip 不要这个
|
|
299
|
-
|
|
300
299
|
if (shopList.includes((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut3 === void 0 ? void 0 : (_context$appHelper$ut4 = _context$appHelper$ut3.global) === null || _context$appHelper$ut4 === void 0 ? void 0 : (_context$appHelper$ut5 = _context$appHelper$ut4.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) || state.closeAutoOpenService) {
|
|
301
300
|
return;
|
|
302
301
|
}
|
|
@@ -347,46 +346,49 @@ var Info = function Info(_ref) {
|
|
|
347
346
|
}
|
|
348
347
|
});
|
|
349
348
|
}, [state.renderType, showAddButton, isService, state.service.value, loading]);
|
|
350
|
-
return
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
className: "pisell-lowcode__booking-service-header"
|
|
369
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
370
|
-
ref: searchRef,
|
|
371
|
-
prefix: /*#__PURE__*/React.createElement(SearchLg, null),
|
|
372
|
-
style: {
|
|
373
|
-
marginTop: 16,
|
|
374
|
-
height: 44
|
|
349
|
+
return useMemo(function () {
|
|
350
|
+
var _state$service6, _state$service6$cache;
|
|
351
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : (_state$service6$cache = _state$service6.cacheItem) === null || _state$service6$cache === void 0 ? void 0 : _state$service6$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
|
|
352
|
+
loading: true,
|
|
353
|
+
active: true,
|
|
354
|
+
round: true
|
|
355
|
+
}), addButton, /*#__PURE__*/React.createElement(Drawer, {
|
|
356
|
+
open: state.service.addModal,
|
|
357
|
+
title: locales.getText('pisell2.text.select-service'),
|
|
358
|
+
rootClassName: "booking-server-wrap",
|
|
359
|
+
onClose: function onClose() {
|
|
360
|
+
dispatch({
|
|
361
|
+
type: 'setService',
|
|
362
|
+
payload: {
|
|
363
|
+
addModal: false,
|
|
364
|
+
changeService: false
|
|
365
|
+
}
|
|
366
|
+
});
|
|
375
367
|
},
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
368
|
+
header: /*#__PURE__*/React.createElement("div", {
|
|
369
|
+
className: "pisell-lowcode__booking-service-header"
|
|
370
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
371
|
+
ref: searchRef,
|
|
372
|
+
prefix: /*#__PURE__*/React.createElement(SearchLg, null),
|
|
373
|
+
style: {
|
|
374
|
+
marginTop: 16,
|
|
375
|
+
height: 44
|
|
376
|
+
},
|
|
377
|
+
placeholder: locales.getText('pisell2.text.search'),
|
|
378
|
+
allowClear: true,
|
|
379
|
+
value: search,
|
|
380
|
+
onChange: function onChange(e) {
|
|
381
|
+
setSearch(e.target.value);
|
|
382
|
+
}
|
|
383
|
+
}))
|
|
384
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
385
|
+
className: "pisell-lowcode__booking-service-body"
|
|
386
|
+
}, /*#__PURE__*/React.createElement(TabProduct, {
|
|
387
|
+
list: renderList,
|
|
388
|
+
amountSymbol: state.amountSymbol,
|
|
389
|
+
onChange: handleSelectProduct,
|
|
390
|
+
scrollDom: ".booking-server-wrap .pisell-lowcode-drawer-body"
|
|
391
|
+
}))));
|
|
392
|
+
}, [(_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : (_state$service7$cache = _state$service7.cacheItem) === null || _state$service7$cache === void 0 ? void 0 : _state$service7$cache.autoClose, addButton, state.service.addModal, locales, search, renderList, state.amountSymbol]);
|
|
391
393
|
};
|
|
392
394
|
export default Info;
|