@pisell/private-materials 3.0.120 → 3.0.121
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/es/components/booking/locales.d.ts +21 -0
- package/es/components/booking/locales.js +24 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +12 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.js +40 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.less +38 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +5 -4
- package/es/components/schedules/components/ScheduleList/index.js +53 -43
- package/es/components/schedules/hooks/useSchedulesDataSource.js +5 -3
- package/es/components/schedules/products/list/index.d.ts +2 -2
- package/es/components/schedules/products/list/index.js +8 -8
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +3 -3
- package/es/components/schedules/schedules/AllSchedules/index.js +9 -6
- package/es/components/schedules/schedules/AllSchedules/index.less +11 -3
- package/es/components/schedules/schedules/serve.d.ts +7 -0
- package/es/components/schedules/schedules/serve.js +24 -3
- package/es/components/schedules/schedules/utils.d.ts +22 -0
- package/es/components/schedules/schedules/utils.js +143 -1
- package/es/components/schedules/type.d.ts +7 -0
- package/es/components/tabProduct/index.d.ts +3 -2
- package/es/components/tabProduct/index.js +27 -18
- package/es/components/tabProduct/tabs/index.d.ts +3 -3
- package/es/components/tabProduct/tabs/index.js +34 -21
- package/lib/components/booking/locales.d.ts +21 -0
- package/lib/components/booking/locales.js +24 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +12 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.js +77 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.less +38 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +5 -4
- package/lib/components/schedules/components/ScheduleList/index.js +38 -31
- package/lib/components/schedules/hooks/useSchedulesDataSource.js +8 -2
- package/lib/components/schedules/products/list/index.d.ts +2 -2
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +3 -3
- package/lib/components/schedules/schedules/AllSchedules/index.js +3 -2
- package/lib/components/schedules/schedules/AllSchedules/index.less +11 -3
- package/lib/components/schedules/schedules/serve.d.ts +7 -0
- package/lib/components/schedules/schedules/serve.js +5 -2
- package/lib/components/schedules/schedules/utils.d.ts +22 -0
- package/lib/components/schedules/schedules/utils.js +98 -0
- package/lib/components/schedules/type.d.ts +7 -0
- package/lib/components/tabProduct/index.d.ts +3 -2
- package/lib/components/tabProduct/index.js +15 -6
- package/lib/components/tabProduct/tabs/index.d.ts +3 -3
- package/lib/components/tabProduct/tabs/index.js +10 -6
- package/package.json +2 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
.pisell-lowcode__schedule-list {
|
|
2
|
+
&-item {
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
padding: 10px 16px;
|
|
6
|
+
border-radius: 8px;
|
|
7
|
+
border: 1px solid var(--Gray-true-100, #F5F5F5);
|
|
8
|
+
margin-bottom: 16px;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
|
|
11
|
+
&-color {
|
|
12
|
+
width: 12px;
|
|
13
|
+
height: 12px;
|
|
14
|
+
margin: 8px;
|
|
15
|
+
border-radius: 50%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&-content {
|
|
19
|
+
color: var(--Gray-true-900, #141414);
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
font-style: normal;
|
|
22
|
+
font-weight: 600;
|
|
23
|
+
line-height: 20px;
|
|
24
|
+
flex: 1;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&-conflict {
|
|
28
|
+
color: #D92D20;
|
|
29
|
+
font-size: 16px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&-delete {
|
|
33
|
+
margin-left: 8px;
|
|
34
|
+
font-size: 16px;
|
|
35
|
+
color: #141414;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ButtonProps } from
|
|
3
|
-
import { ScheduleItem } from
|
|
4
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ButtonProps } from 'antd';
|
|
3
|
+
import { ScheduleItem } from '../../type';
|
|
4
|
+
import './index.less';
|
|
5
5
|
declare type ScheduleListType = {
|
|
6
6
|
dataSource: ScheduleItem[];
|
|
7
7
|
onItemClick?: (item: ScheduleItem) => void;
|
|
@@ -10,6 +10,7 @@ declare type ScheduleListType = {
|
|
|
10
10
|
loading?: boolean;
|
|
11
11
|
className?: string;
|
|
12
12
|
addButtonProps?: ButtonProps;
|
|
13
|
+
showTabs?: boolean;
|
|
13
14
|
};
|
|
14
15
|
/**
|
|
15
16
|
* 日程列表 展示日程简略信息
|
|
@@ -35,10 +35,10 @@ module.exports = __toCommonJS(ScheduleList_exports);
|
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_classnames = __toESM(require("classnames"));
|
|
37
37
|
var import_antd = require("antd");
|
|
38
|
-
var
|
|
39
|
-
var import_XClose = __toESM(require("@pisell/icon/es/XClose"));
|
|
38
|
+
var import_tabProduct = __toESM(require("../../../tabProduct"));
|
|
40
39
|
var import_utils = require("@pisell/utils");
|
|
41
|
-
var
|
|
40
|
+
var import_utils2 = require("../../schedules/utils");
|
|
41
|
+
var import_RenderScheduleItem = __toESM(require("./RenderScheduleItem"));
|
|
42
42
|
var import_index = require("./index.less");
|
|
43
43
|
var ScheduleList = (props) => {
|
|
44
44
|
const {
|
|
@@ -48,9 +48,12 @@ var ScheduleList = (props) => {
|
|
|
48
48
|
onDelete,
|
|
49
49
|
loading,
|
|
50
50
|
className,
|
|
51
|
-
addButtonProps
|
|
51
|
+
addButtonProps,
|
|
52
|
+
showTabs
|
|
52
53
|
} = props;
|
|
53
|
-
const
|
|
54
|
+
const renderList = (0, import_react.useMemo)(() => {
|
|
55
|
+
return (0, import_utils2.formatScheduleListByTabs)(dataSource);
|
|
56
|
+
}, [dataSource]);
|
|
54
57
|
const content = (0, import_react.useMemo)(() => {
|
|
55
58
|
if (dataSource.length === 0) {
|
|
56
59
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -61,37 +64,41 @@ var ScheduleList = (props) => {
|
|
|
61
64
|
}
|
|
62
65
|
);
|
|
63
66
|
}
|
|
64
|
-
|
|
65
|
-
var _a;
|
|
67
|
+
if (showTabs) {
|
|
66
68
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
-
|
|
69
|
+
import_tabProduct.default,
|
|
68
70
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
scrollDom: ".pisell-lowcode__schedules-module-content-wrap",
|
|
72
|
+
list: renderList,
|
|
73
|
+
name: "schedule",
|
|
74
|
+
renderItem: (item) => {
|
|
75
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
76
|
+
import_RenderScheduleItem.default,
|
|
77
|
+
{
|
|
78
|
+
item,
|
|
79
|
+
key: item.id,
|
|
80
|
+
showDeleteIcon,
|
|
81
|
+
onItemClick: () => onItemClick == null ? void 0 : onItemClick(item),
|
|
82
|
+
onDelete: () => onDelete == null ? void 0 : onDelete(item)
|
|
83
|
+
}
|
|
84
|
+
);
|
|
78
85
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
86
|
+
}
|
|
87
|
+
);
|
|
88
|
+
} else {
|
|
89
|
+
return dataSource.map((item) => {
|
|
90
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
91
|
+
import_RenderScheduleItem.default,
|
|
84
92
|
{
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
93
|
+
item,
|
|
94
|
+
showDeleteIcon,
|
|
95
|
+
onItemClick: () => onItemClick == null ? void 0 : onItemClick(item),
|
|
96
|
+
onDelete: () => onDelete == null ? void 0 : onDelete(item)
|
|
90
97
|
}
|
|
91
|
-
)
|
|
92
|
-
);
|
|
93
|
-
}
|
|
94
|
-
}, [dataSource, showDeleteIcon]);
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}, [dataSource, showDeleteIcon, showTabs]);
|
|
95
102
|
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-lowcode__schedule-list", className) }, /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { active: true, round: true, loading }, content, addButtonProps ? /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { ...addButtonProps }) : null));
|
|
96
103
|
};
|
|
97
104
|
var ScheduleList_default = ScheduleList;
|
|
@@ -28,7 +28,7 @@ var import_serve = require("../schedules/serve");
|
|
|
28
28
|
var useSchedulesDataSource = (params) => {
|
|
29
29
|
const { scheduleIds } = params || {};
|
|
30
30
|
const [dataSource, setDataSource] = (0, import_react.useState)([]);
|
|
31
|
-
const { loading, run, refresh } = (0, import_ahooks.useRequest)(import_serve.
|
|
31
|
+
const { loading, run, refresh } = (0, import_ahooks.useRequest)(import_serve.postScheduleList, {
|
|
32
32
|
manual: true,
|
|
33
33
|
onSuccess: (result, params2) => {
|
|
34
34
|
if (result.status) {
|
|
@@ -37,7 +37,13 @@ var useSchedulesDataSource = (params) => {
|
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
(0, import_react.useEffect)(() => {
|
|
40
|
-
run({
|
|
40
|
+
run({
|
|
41
|
+
ids: scheduleIds,
|
|
42
|
+
skip: 1,
|
|
43
|
+
num: 500,
|
|
44
|
+
with: ["relation", "timeSlot"],
|
|
45
|
+
with_count: ["relation", "order"]
|
|
46
|
+
});
|
|
41
47
|
}, [scheduleIds]);
|
|
42
48
|
return {
|
|
43
49
|
loading,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { ScheduleItem } from
|
|
3
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ScheduleItem } from '../../type';
|
|
3
|
+
import './index.less';
|
|
4
4
|
declare type AllSchedulesPropsType = {
|
|
5
5
|
onOpenDetail?: (id?: number) => void;
|
|
6
6
|
dataSource: ScheduleItem[];
|
|
@@ -51,9 +51,10 @@ var AllSchedules = (props) => {
|
|
|
51
51
|
{
|
|
52
52
|
loading,
|
|
53
53
|
dataSource: showDataSource,
|
|
54
|
-
onItemClick: (item) => onOpenDetail == null ? void 0 : onOpenDetail(item.id)
|
|
54
|
+
onItemClick: (item) => onOpenDetail == null ? void 0 : onOpenDetail(item.id),
|
|
55
|
+
showTabs: true
|
|
55
56
|
}
|
|
56
|
-
)), /* @__PURE__ */ import_react.default.createElement("div",
|
|
57
|
+
)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__schedules-module-add-button-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
57
58
|
import_antd.Button,
|
|
58
59
|
{
|
|
59
60
|
className: "pisell-lowcode__schedules-module-add-button",
|
|
@@ -2,13 +2,21 @@
|
|
|
2
2
|
height: 100%;
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
|
+
overflow-y: auto;
|
|
6
|
+
padding: 0 32px;
|
|
5
7
|
.pisell-lowcode__schedules-module-header {
|
|
6
|
-
padding: 16px
|
|
8
|
+
padding: 16px 0 0;
|
|
7
9
|
}
|
|
8
10
|
.pisell-lowcode__schedules-module-content {
|
|
9
|
-
padding:
|
|
11
|
+
padding: 0;
|
|
10
12
|
flex: 1;
|
|
11
|
-
overflow:
|
|
13
|
+
overflow:initial;
|
|
14
|
+
}
|
|
15
|
+
.pisell-lowcode__schedules-module-add-button-wrap{
|
|
16
|
+
position: sticky;
|
|
17
|
+
bottom: 0;
|
|
18
|
+
z-index: 1;
|
|
19
|
+
background: #fff
|
|
12
20
|
}
|
|
13
21
|
.pisell-lowcode__schedules-module-add-button {
|
|
14
22
|
margin: 24px 32px;
|
|
@@ -4,6 +4,13 @@ export declare const getScheduleList: (params: {
|
|
|
4
4
|
num: number;
|
|
5
5
|
ids?: number[];
|
|
6
6
|
}) => Promise<ResponseListData<ScheduleItem[]>>;
|
|
7
|
+
export declare const postScheduleList: (params: {
|
|
8
|
+
skip: number;
|
|
9
|
+
num: number;
|
|
10
|
+
ids?: number[];
|
|
11
|
+
with?: Array<string>;
|
|
12
|
+
with_count?: Array<string>;
|
|
13
|
+
}) => Promise<ResponseListData<ScheduleItem[]>>;
|
|
7
14
|
export declare const deleteSchedule: (params: {
|
|
8
15
|
id: number;
|
|
9
16
|
}) => Promise<ResponseListData<ScheduleItem[]>>;
|
|
@@ -20,14 +20,17 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
var serve_exports = {};
|
|
21
21
|
__export(serve_exports, {
|
|
22
22
|
deleteSchedule: () => deleteSchedule,
|
|
23
|
-
getScheduleList: () => getScheduleList
|
|
23
|
+
getScheduleList: () => getScheduleList,
|
|
24
|
+
postScheduleList: () => postScheduleList
|
|
24
25
|
});
|
|
25
26
|
module.exports = __toCommonJS(serve_exports);
|
|
26
27
|
var import_utils = require("../utils");
|
|
27
28
|
var getScheduleList = async (params) => await import_utils.request.getRequest().get("/shop/schedule", params);
|
|
29
|
+
var postScheduleList = async (params) => await import_utils.request.getRequest().post("/shop/schedule/v2", params);
|
|
28
30
|
var deleteSchedule = async (params) => await import_utils.request.getRequest().remove(`/shop/schedule/${params.id}`);
|
|
29
31
|
// Annotate the CommonJS export names for ESM import in node:
|
|
30
32
|
0 && (module.exports = {
|
|
31
33
|
deleteSchedule,
|
|
32
|
-
getScheduleList
|
|
34
|
+
getScheduleList,
|
|
35
|
+
postScheduleList
|
|
33
36
|
});
|
|
@@ -48,3 +48,25 @@ export declare const formatScheduleResult: (schedule: ScheduleItem) => {
|
|
|
48
48
|
export declare const calcScheduleDateRange: (schedule: ScheduleItem) => any[];
|
|
49
49
|
export declare const calcCalendarDataBySchedules: (schedules: ScheduleItem[]) => unknown[];
|
|
50
50
|
export declare const calcMinTimeMaxTimeBySchedules: (schedules: ScheduleItem[], scheduleAllMap: FormState["schedules"]["scheduleAllMap"], selectDate?: string) => {};
|
|
51
|
+
/**
|
|
52
|
+
* @title: 格式化日程数据
|
|
53
|
+
* @description:
|
|
54
|
+
* @param {Array} relation 资源列表
|
|
55
|
+
* @param {string} table_type 关联表类型
|
|
56
|
+
* @param {string} item_type 资源类型
|
|
57
|
+
* @param {boolean} isExcluded 是否排除
|
|
58
|
+
* @return {*}
|
|
59
|
+
* @Author: WangHan
|
|
60
|
+
* @Date: 2024-09-04 11:54
|
|
61
|
+
*/
|
|
62
|
+
export declare const formatScheduleData: (relation: Array<any>, table_type?: string, item_type?: string, isExcluded?: boolean) => any;
|
|
63
|
+
/**
|
|
64
|
+
* @title: 格式化日程为二维结构
|
|
65
|
+
* @description:
|
|
66
|
+
* @param {any} list
|
|
67
|
+
* @param {any} filterItem
|
|
68
|
+
* @return {*}
|
|
69
|
+
* @Author: WangHan
|
|
70
|
+
* @Date: 2024-07-29 19:28
|
|
71
|
+
*/
|
|
72
|
+
export declare const formatScheduleListByTabs: (list: any, filterItem?: any) => unknown[];
|
|
@@ -37,6 +37,8 @@ __export(utils_exports, {
|
|
|
37
37
|
calcCalendarDataByTimeSlots: () => calcCalendarDataByTimeSlots,
|
|
38
38
|
calcMinTimeMaxTimeBySchedules: () => calcMinTimeMaxTimeBySchedules,
|
|
39
39
|
calcScheduleDateRange: () => calcScheduleDateRange,
|
|
40
|
+
formatScheduleData: () => formatScheduleData,
|
|
41
|
+
formatScheduleListByTabs: () => formatScheduleListByTabs,
|
|
40
42
|
formatScheduleResult: () => formatScheduleResult,
|
|
41
43
|
getDaysByStartEnd: () => getDaysByStartEnd,
|
|
42
44
|
isAllDay: () => isAllDay
|
|
@@ -540,6 +542,100 @@ var calcMinTimeMaxTimeBySchedules = (schedules, scheduleAllMap, selectDate) => {
|
|
|
540
542
|
};
|
|
541
543
|
}, {});
|
|
542
544
|
};
|
|
545
|
+
var formatScheduleData = (relation, table_type, item_type, isExcluded) => {
|
|
546
|
+
const _relation = relation || [];
|
|
547
|
+
if (table_type && item_type && isExcluded) {
|
|
548
|
+
return _relation.find((item) => (item == null ? void 0 : item.relation_table_type) === table_type && (item == null ? void 0 : item.item_type) !== item_type);
|
|
549
|
+
}
|
|
550
|
+
if (table_type && item_type) {
|
|
551
|
+
return _relation.find((item) => (item == null ? void 0 : item.relation_table_type) === table_type && (item == null ? void 0 : item.item_type) === item_type);
|
|
552
|
+
}
|
|
553
|
+
if (table_type) {
|
|
554
|
+
return _relation.some((item) => (item == null ? void 0 : item.relation_table_type) === table_type);
|
|
555
|
+
}
|
|
556
|
+
if (item_type) {
|
|
557
|
+
return _relation.find((item) => (item == null ? void 0 : item.item_type) === item_type);
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
var formatScheduleListByTabs = (list, filterItem) => {
|
|
561
|
+
let _list = list || [];
|
|
562
|
+
if (filterItem) {
|
|
563
|
+
_list = _list.filter(filterItem);
|
|
564
|
+
}
|
|
565
|
+
let categoryObject = {
|
|
566
|
+
// 全部
|
|
567
|
+
all: {
|
|
568
|
+
id: 0,
|
|
569
|
+
name: import_utils.locales.getText("pisell2.schedule.tab.all"),
|
|
570
|
+
products: _list
|
|
571
|
+
},
|
|
572
|
+
// 附加费
|
|
573
|
+
surcharge: {
|
|
574
|
+
id: 1,
|
|
575
|
+
name: import_utils.locales.getText("pisell2.schedule.tab.surcharge"),
|
|
576
|
+
products: []
|
|
577
|
+
},
|
|
578
|
+
// 资源
|
|
579
|
+
resources: {
|
|
580
|
+
id: 2,
|
|
581
|
+
name: import_utils.locales.getText("pisell2.schedule.tab.resources"),
|
|
582
|
+
products: []
|
|
583
|
+
},
|
|
584
|
+
// 商品
|
|
585
|
+
products: {
|
|
586
|
+
id: 3,
|
|
587
|
+
name: import_utils.locales.getText("pisell2.schedule.tab.products"),
|
|
588
|
+
products: []
|
|
589
|
+
},
|
|
590
|
+
// 活动
|
|
591
|
+
events: {
|
|
592
|
+
id: 4,
|
|
593
|
+
name: import_utils.locales.getText("pisell2.schedule.tab.events"),
|
|
594
|
+
products: []
|
|
595
|
+
},
|
|
596
|
+
// 报价单
|
|
597
|
+
quotation: {
|
|
598
|
+
id: 5,
|
|
599
|
+
name: import_utils.locales.getText("pisell2.schedule.tab.quotation"),
|
|
600
|
+
products: []
|
|
601
|
+
},
|
|
602
|
+
// 营业时间
|
|
603
|
+
"open-hours": {
|
|
604
|
+
id: 6,
|
|
605
|
+
name: import_utils.locales.getText("pisell2.schedule.tab.open-hours"),
|
|
606
|
+
products: []
|
|
607
|
+
}
|
|
608
|
+
};
|
|
609
|
+
for (let i = 0; i < _list.length; i++) {
|
|
610
|
+
const productItem = _list[i];
|
|
611
|
+
const _relation = productItem.relation || [];
|
|
612
|
+
if (formatScheduleData(_relation, "custom_surcharge")) {
|
|
613
|
+
categoryObject.surcharge.products.push(productItem);
|
|
614
|
+
}
|
|
615
|
+
if (formatScheduleData(_relation, "form", "opening_hours", true)) {
|
|
616
|
+
categoryObject.resources.products.push(productItem);
|
|
617
|
+
}
|
|
618
|
+
if (formatScheduleData(_relation, "product")) {
|
|
619
|
+
categoryObject.products.products.push(productItem);
|
|
620
|
+
}
|
|
621
|
+
if (formatScheduleData(_relation, "product", "event_item")) {
|
|
622
|
+
categoryObject.events.products.push(productItem);
|
|
623
|
+
}
|
|
624
|
+
if (formatScheduleData(_relation, "shelf", "quotation")) {
|
|
625
|
+
categoryObject.quotation.products.push(productItem);
|
|
626
|
+
}
|
|
627
|
+
if (formatScheduleData(_relation, "", "opening_hours")) {
|
|
628
|
+
categoryObject["open-hours"].products.push(productItem);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
Object.keys(categoryObject).forEach((cur) => {
|
|
632
|
+
var _a, _b;
|
|
633
|
+
if (((_b = (_a = categoryObject == null ? void 0 : categoryObject[cur]) == null ? void 0 : _a.products) == null ? void 0 : _b.length) === 0) {
|
|
634
|
+
delete categoryObject[cur];
|
|
635
|
+
}
|
|
636
|
+
});
|
|
637
|
+
return Object.values(categoryObject);
|
|
638
|
+
};
|
|
543
639
|
// Annotate the CommonJS export names for ESM import in node:
|
|
544
640
|
0 && (module.exports = {
|
|
545
641
|
calcCalendarDataByDesignation,
|
|
@@ -550,6 +646,8 @@ var calcMinTimeMaxTimeBySchedules = (schedules, scheduleAllMap, selectDate) => {
|
|
|
550
646
|
calcCalendarDataByTimeSlots,
|
|
551
647
|
calcMinTimeMaxTimeBySchedules,
|
|
552
648
|
calcScheduleDateRange,
|
|
649
|
+
formatScheduleData,
|
|
650
|
+
formatScheduleListByTabs,
|
|
553
651
|
formatScheduleResult,
|
|
554
652
|
getDaysByStartEnd,
|
|
555
653
|
isAllDay
|
|
@@ -57,6 +57,13 @@ export declare type ScheduleItem = {
|
|
|
57
57
|
/** 是否全天 */
|
|
58
58
|
is_all: 1 | 0;
|
|
59
59
|
[key: string]: any;
|
|
60
|
+
relation?: {
|
|
61
|
+
id: number;
|
|
62
|
+
item_id: number;
|
|
63
|
+
item_type: string;
|
|
64
|
+
relation_table_type: string;
|
|
65
|
+
schedule_id: number;
|
|
66
|
+
}[];
|
|
60
67
|
};
|
|
61
68
|
export declare type ScheduleFormOtherValue = {
|
|
62
69
|
/** 截止模式
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
3
|
export interface TabProductProps {
|
|
4
4
|
list?: any[];
|
|
5
5
|
scrollDom?: string;
|
|
@@ -10,6 +10,7 @@ export interface TabProductProps {
|
|
|
10
10
|
listWrapClassName?: string;
|
|
11
11
|
warpClassName?: string;
|
|
12
12
|
stickyTop?: number;
|
|
13
|
+
name?: string | number;
|
|
13
14
|
}
|
|
14
15
|
declare const TabProduct: (props: TabProductProps) => React.JSX.Element;
|
|
15
16
|
export default TabProduct;
|
|
@@ -38,6 +38,7 @@ var import_card = __toESM(require("./card"));
|
|
|
38
38
|
var import_classnames = __toESM(require("classnames"));
|
|
39
39
|
var import_index = require("./index.less");
|
|
40
40
|
var io = null;
|
|
41
|
+
var tabsHeight = 92;
|
|
41
42
|
var TabProduct = (props) => {
|
|
42
43
|
const {
|
|
43
44
|
list = [],
|
|
@@ -48,7 +49,8 @@ var TabProduct = (props) => {
|
|
|
48
49
|
listWrapClassName,
|
|
49
50
|
renderItem,
|
|
50
51
|
warpClassName,
|
|
51
|
-
stickyTop = 0
|
|
52
|
+
stickyTop = 0,
|
|
53
|
+
name
|
|
52
54
|
} = props;
|
|
53
55
|
const tabsRef = (0, import_react.useRef)();
|
|
54
56
|
const [current, setCurrent] = (0, import_react.useState)(1);
|
|
@@ -59,18 +61,24 @@ var TabProduct = (props) => {
|
|
|
59
61
|
}
|
|
60
62
|
}, [list]);
|
|
61
63
|
const handleObserver = () => {
|
|
64
|
+
var _a;
|
|
65
|
+
const domHeight = scrollDom ? ((_a = document.querySelector(scrollDom)) == null ? void 0 : _a.clientHeight) || window.innerHeight : window.innerHeight;
|
|
66
|
+
const marginTop = `-${tabsHeight}px`;
|
|
67
|
+
const marginBottom = `-${domHeight - tabsHeight - 10}px`;
|
|
62
68
|
io = new IntersectionObserver(
|
|
63
69
|
(entries) => {
|
|
64
|
-
var
|
|
70
|
+
var _a2, _b, _c, _d;
|
|
65
71
|
console.log(entries);
|
|
66
72
|
if (entries[0].isIntersecting) {
|
|
67
|
-
const [
|
|
73
|
+
const [name2, id] = (_c = (_b = (_a2 = entries[0]) == null ? void 0 : _a2.target) == null ? void 0 : _b.id) == null ? void 0 : _c.split("-");
|
|
68
74
|
setCurrent(Number(id));
|
|
69
75
|
(_d = tabsRef == null ? void 0 : tabsRef.current) == null ? void 0 : _d.scroll(id);
|
|
70
76
|
}
|
|
71
77
|
},
|
|
72
78
|
{
|
|
73
|
-
root: scrollDom ? document.querySelector(scrollDom) : null
|
|
79
|
+
root: scrollDom ? document.querySelector(scrollDom) : null,
|
|
80
|
+
rootMargin: `${marginTop} 0px ${marginBottom}`
|
|
81
|
+
// threshold: 0.5,
|
|
74
82
|
// rootMargin: ,
|
|
75
83
|
}
|
|
76
84
|
);
|
|
@@ -105,7 +113,7 @@ var TabProduct = (props) => {
|
|
|
105
113
|
import_card.default,
|
|
106
114
|
{
|
|
107
115
|
className: (0, import_classnames.default)("tabs", tabsWrapClassName),
|
|
108
|
-
id: "product-category
|
|
116
|
+
id: `${name || "product"}-category`
|
|
109
117
|
},
|
|
110
118
|
/* @__PURE__ */ import_react.default.createElement(
|
|
111
119
|
import_tabs.default,
|
|
@@ -114,11 +122,12 @@ var TabProduct = (props) => {
|
|
|
114
122
|
options: list,
|
|
115
123
|
rowKey,
|
|
116
124
|
tab: current,
|
|
125
|
+
name,
|
|
117
126
|
onChange: (e) => {
|
|
118
127
|
const dom = document == null ? void 0 : document.querySelector("#list-" + e);
|
|
119
128
|
const main = document == null ? void 0 : document.querySelector(scrollDom || "");
|
|
120
129
|
if (dom && main) {
|
|
121
|
-
main.scrollTop = dom.offsetTop -
|
|
130
|
+
main.scrollTop = dom.offsetTop - 42;
|
|
122
131
|
}
|
|
123
132
|
handleUnObserver();
|
|
124
133
|
setCurrent(e);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
3
|
export interface Com<T> extends React.FC<T> {
|
|
4
4
|
}
|
|
5
5
|
export declare type RowKey = string | number;
|
|
@@ -7,7 +7,7 @@ export interface Option {
|
|
|
7
7
|
id: number | string;
|
|
8
8
|
name: React.ReactNode;
|
|
9
9
|
}
|
|
10
|
-
export interface TabsProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>,
|
|
10
|
+
export interface TabsProps extends Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, 'onChange'> {
|
|
11
11
|
renderTab: (item: any) => React.ReactNode;
|
|
12
12
|
rowKey: RowKey;
|
|
13
13
|
name: RowKey;
|
|
@@ -63,9 +63,13 @@ var Tabs = ({ renderTab, rowKey, name = "tabs-", onChange, tab, className, optio
|
|
|
63
63
|
calculateWidth();
|
|
64
64
|
}
|
|
65
65
|
}, [options]);
|
|
66
|
+
const _id = (0, import_react.useMemo)(() => {
|
|
67
|
+
const _id2 = name ? `pisell-${name}-tabs` : "pisell-tabs";
|
|
68
|
+
return _id2;
|
|
69
|
+
}, [name]);
|
|
66
70
|
const calculateWidth = () => {
|
|
67
|
-
const content2 = document.querySelector(
|
|
68
|
-
const itemList = document.querySelector(
|
|
71
|
+
const content2 = document.querySelector(`#${_id}`);
|
|
72
|
+
const itemList = document.querySelector(`#${_id}-content`);
|
|
69
73
|
if ((itemList == null ? void 0 : itemList.offsetWidth) + 60 < (content2 == null ? void 0 : content2.offsetWidth)) {
|
|
70
74
|
setIsShowButton(false);
|
|
71
75
|
}
|
|
@@ -98,7 +102,7 @@ var Tabs = ({ renderTab, rowKey, name = "tabs-", onChange, tab, className, optio
|
|
|
98
102
|
debounceChange.run({ current, total });
|
|
99
103
|
};
|
|
100
104
|
const setTabScroll = (val) => {
|
|
101
|
-
let dom = document.querySelector(
|
|
105
|
+
let dom = document.querySelector(`#${_id}-content`);
|
|
102
106
|
console.log("domdom", dom);
|
|
103
107
|
if (!dom) {
|
|
104
108
|
return;
|
|
@@ -106,7 +110,7 @@ var Tabs = ({ renderTab, rowKey, name = "tabs-", onChange, tab, className, optio
|
|
|
106
110
|
dom.scrollLeft = val;
|
|
107
111
|
};
|
|
108
112
|
const onPageChange = (type) => {
|
|
109
|
-
let dom = document.querySelector(
|
|
113
|
+
let dom = document.querySelector(`#${_id}-content`);
|
|
110
114
|
if (!dom) {
|
|
111
115
|
return;
|
|
112
116
|
}
|
|
@@ -150,7 +154,7 @@ var Tabs = ({ renderTab, rowKey, name = "tabs-", onChange, tab, className, optio
|
|
|
150
154
|
"div",
|
|
151
155
|
{
|
|
152
156
|
className: "pisell-tabs-content",
|
|
153
|
-
id:
|
|
157
|
+
id: `${_id}-content`,
|
|
154
158
|
onScroll
|
|
155
159
|
},
|
|
156
160
|
_options.map((d, i) => {
|
|
@@ -172,6 +176,6 @@ var Tabs = ({ renderTab, rowKey, name = "tabs-", onChange, tab, className, optio
|
|
|
172
176
|
})
|
|
173
177
|
);
|
|
174
178
|
}, [_options, rowKey, name, tab]);
|
|
175
|
-
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-tabs", className), id:
|
|
179
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: (0, import_classnames.default)("pisell-tabs", className), id: _id }, isShowButton && leftBtn, content, isShowButton && rightBtn);
|
|
176
180
|
};
|
|
177
181
|
var tabs_default = (0, import_react.forwardRef)(Tabs);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.121",
|
|
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/utils": "1.0.28",
|
|
62
63
|
"@pisell/icon": "0.0.11",
|
|
63
64
|
"@pisell/materials": "3.0.38",
|
|
64
|
-
"@pisell/utils": "1.0.28",
|
|
65
65
|
"@pisell/date-picker": "1.0.97"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|