@pisell/private-materials 3.0.105 → 3.0.107
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 +5 -5
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.js +5 -5
- package/es/components/booking/info/service/editService/index.js +6 -1
- package/es/components/booking/info/utils.d.ts +10 -0
- package/es/components/booking/info/utils.js +25 -0
- package/es/components/booking/utils.js +1 -1
- package/lib/components/booking/info/service/editService/index.js +5 -1
- package/lib/components/booking/info/utils.d.ts +10 -0
- package/lib/components/booking/info/utils.js +17 -0
- package/lib/components/booking/utils.js +1 -1
- package/package.json +3 -3
|
@@ -34,6 +34,7 @@ import { getErrorList, getServiceTimes, deleteCacheParams } from "../../../utils
|
|
|
34
34
|
import Like from "../like";
|
|
35
35
|
import { getNoResource } from "../../../mock";
|
|
36
36
|
import { formatResources, getDurationProps, getFlexibleOption, getTimeObj } from "../addService/utils";
|
|
37
|
+
import { checkProductByTime } from "../../utils";
|
|
37
38
|
var submitLock = false;
|
|
38
39
|
var Info = function Info() {
|
|
39
40
|
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI6, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _window$BaseMaterials, _state$service$cacheI7, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI8, _state$service$cacheI9, _state$service$cacheI10, _state$service$cacheI11, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8;
|
|
@@ -370,13 +371,17 @@ var Info = function Info() {
|
|
|
370
371
|
_extend.bundle_edit = 1;
|
|
371
372
|
}
|
|
372
373
|
_item._extend = _extend;
|
|
374
|
+
_item._time = new Date().getTime();
|
|
373
375
|
var _id = _item === null || _item === void 0 ? void 0 : _item._id;
|
|
374
376
|
|
|
375
377
|
// 判断是新增还是编辑
|
|
376
378
|
if (!_list.some(function (d) {
|
|
377
379
|
return d._id === _id;
|
|
378
380
|
})) {
|
|
379
|
-
|
|
381
|
+
// 检查列表最后的商品添加时间是否在指定间隔内 如果在 则不添加新商品
|
|
382
|
+
if (checkProductByTime(_list)) {
|
|
383
|
+
_list.push(_item);
|
|
384
|
+
}
|
|
380
385
|
} else {
|
|
381
386
|
_list = _list.map(function (d) {
|
|
382
387
|
return d._id === _id ? _objectSpread(_objectSpread({}, _item), {}, {
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
export declare const getIsBundleOrCombination: (productDetail: any) => boolean;
|
|
2
2
|
export declare const uniqueByField: (arr: any[], field: string) => any[];
|
|
3
3
|
export declare const moveItemToFront: (arr: any[], targetId: string | number) => any[];
|
|
4
|
+
/**
|
|
5
|
+
* @title: 检查列表最后的商品添加时间是否在指定间隔内
|
|
6
|
+
* @description:
|
|
7
|
+
* @param {any} list
|
|
8
|
+
* @param {number} interval
|
|
9
|
+
* @return {*}
|
|
10
|
+
* @Author: zhiwei.Wang
|
|
11
|
+
* @Date: 2024-08-13 18:35
|
|
12
|
+
*/
|
|
13
|
+
export declare const checkProductByTime: (list: any[], interval?: number) => boolean;
|
|
@@ -28,4 +28,29 @@ export var moveItemToFront = function moveItemToFront(arr, targetId) {
|
|
|
28
28
|
arr.unshift(targetItem);
|
|
29
29
|
}
|
|
30
30
|
return arr;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* @title: 检查列表最后的商品添加时间是否在指定间隔内
|
|
35
|
+
* @description:
|
|
36
|
+
* @param {any} list
|
|
37
|
+
* @param {number} interval
|
|
38
|
+
* @return {*}
|
|
39
|
+
* @Author: zhiwei.Wang
|
|
40
|
+
* @Date: 2024-08-13 18:35
|
|
41
|
+
*/
|
|
42
|
+
export var checkProductByTime = function checkProductByTime(list) {
|
|
43
|
+
var interval = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
44
|
+
var bol = true;
|
|
45
|
+
try {
|
|
46
|
+
if (list.length) {
|
|
47
|
+
var _list;
|
|
48
|
+
var last = (_list = list[list.length - 1]) === null || _list === void 0 ? void 0 : _list._time;
|
|
49
|
+
var currentTime = new Date().getTime();
|
|
50
|
+
if (last && currentTime - last < interval) {
|
|
51
|
+
bol = false;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
} catch (err) {}
|
|
55
|
+
return bol;
|
|
31
56
|
};
|
|
@@ -149,7 +149,7 @@ export var getServiceTime = function getServiceTime(item, currentDate) {
|
|
|
149
149
|
var startTime = startDate.format("HH:mm");
|
|
150
150
|
var endTime = startDate.add(flexibleObj.getValue(item._extend.duration), "minute").format("HH:mm");
|
|
151
151
|
var duration = getDiscountTime(flexibleObj.getValue(item._extend.duration));
|
|
152
|
-
return "".concat(startTime, " - ").concat(endTime, " (").concat(duration, ")");
|
|
152
|
+
return "".concat(startTime, " - ").concat(endTime, " ( ").concat(duration, " )");
|
|
153
153
|
};
|
|
154
154
|
export var findNextSlice = function findNextSlice(_ref) {
|
|
155
155
|
var _ref$timeSlices = _ref.timeSlices,
|
|
@@ -47,6 +47,7 @@ var import_utils3 = require("../../../utils");
|
|
|
47
47
|
var import_like = __toESM(require("../like"));
|
|
48
48
|
var import_mock = require("../../../mock");
|
|
49
49
|
var import_utils4 = require("../addService/utils");
|
|
50
|
+
var import_utils5 = require("../../utils");
|
|
50
51
|
var submitLock = false;
|
|
51
52
|
var Info = () => {
|
|
52
53
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
@@ -243,9 +244,12 @@ var Info = () => {
|
|
|
243
244
|
_extend.bundle_edit = 1;
|
|
244
245
|
}
|
|
245
246
|
_item._extend = _extend;
|
|
247
|
+
_item._time = (/* @__PURE__ */ new Date()).getTime();
|
|
246
248
|
let _id = _item == null ? void 0 : _item._id;
|
|
247
249
|
if (!_list.some((d) => d._id === _id)) {
|
|
248
|
-
|
|
250
|
+
if ((0, import_utils5.checkProductByTime)(_list)) {
|
|
251
|
+
_list.push(_item);
|
|
252
|
+
}
|
|
249
253
|
} else {
|
|
250
254
|
_list = _list.map((d) => d._id === _id ? { ..._item, new: 0 } : d);
|
|
251
255
|
}
|
|
@@ -1,3 +1,13 @@
|
|
|
1
1
|
export declare const getIsBundleOrCombination: (productDetail: any) => boolean;
|
|
2
2
|
export declare const uniqueByField: (arr: any[], field: string) => any[];
|
|
3
3
|
export declare const moveItemToFront: (arr: any[], targetId: string | number) => any[];
|
|
4
|
+
/**
|
|
5
|
+
* @title: 检查列表最后的商品添加时间是否在指定间隔内
|
|
6
|
+
* @description:
|
|
7
|
+
* @param {any} list
|
|
8
|
+
* @param {number} interval
|
|
9
|
+
* @return {*}
|
|
10
|
+
* @Author: zhiwei.Wang
|
|
11
|
+
* @Date: 2024-08-13 18:35
|
|
12
|
+
*/
|
|
13
|
+
export declare const checkProductByTime: (list: any[], interval?: number) => boolean;
|
|
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/components/booking/info/utils.ts
|
|
20
20
|
var utils_exports = {};
|
|
21
21
|
__export(utils_exports, {
|
|
22
|
+
checkProductByTime: () => checkProductByTime,
|
|
22
23
|
getIsBundleOrCombination: () => getIsBundleOrCombination,
|
|
23
24
|
moveItemToFront: () => moveItemToFront,
|
|
24
25
|
uniqueByField: () => uniqueByField
|
|
@@ -52,8 +53,24 @@ var moveItemToFront = (arr, targetId) => {
|
|
|
52
53
|
}
|
|
53
54
|
return arr;
|
|
54
55
|
};
|
|
56
|
+
var checkProductByTime = (list, interval = 1e3) => {
|
|
57
|
+
var _a;
|
|
58
|
+
let bol = true;
|
|
59
|
+
try {
|
|
60
|
+
if (list.length) {
|
|
61
|
+
let last = (_a = list[list.length - 1]) == null ? void 0 : _a._time;
|
|
62
|
+
let currentTime = (/* @__PURE__ */ new Date()).getTime();
|
|
63
|
+
if (last && currentTime - last < interval) {
|
|
64
|
+
bol = false;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
} catch (err) {
|
|
68
|
+
}
|
|
69
|
+
return bol;
|
|
70
|
+
};
|
|
55
71
|
// Annotate the CommonJS export names for ESM import in node:
|
|
56
72
|
0 && (module.exports = {
|
|
73
|
+
checkProductByTime,
|
|
57
74
|
getIsBundleOrCombination,
|
|
58
75
|
moveItemToFront,
|
|
59
76
|
uniqueByField
|
|
@@ -139,7 +139,7 @@ var getServiceTime = (item, currentDate) => {
|
|
|
139
139
|
const startTime = startDate.format("HH:mm");
|
|
140
140
|
const endTime = startDate.add(flexibleObj.getValue(item._extend.duration), "minute").format("HH:mm");
|
|
141
141
|
const duration = getDiscountTime(flexibleObj.getValue(item._extend.duration));
|
|
142
|
-
return `${startTime} - ${endTime} (${duration})`;
|
|
142
|
+
return `${startTime} - ${endTime} ( ${duration} )`;
|
|
143
143
|
};
|
|
144
144
|
var findNextSlice = ({
|
|
145
145
|
timeSlices = [],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.107",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -59,9 +59,9 @@
|
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
|
-
"@pisell/
|
|
62
|
+
"@pisell/utils": "1.0.27",
|
|
63
63
|
"@pisell/date-picker": "1.0.91",
|
|
64
|
-
"@pisell/
|
|
64
|
+
"@pisell/icon": "0.0.11"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"react": "^18.0.0",
|