@pisell/private-materials 3.0.18 → 3.0.20
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/render/default/view.js +2 -2
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/info/client/index.js +4 -1
- package/es/components/booking/info/service/addService/index.js +21 -10
- package/es/components/productExtension/index.d.ts +2 -1
- package/es/components/productExtension/index.js +8 -3
- package/lib/components/booking/info/client/index.js +4 -1
- package/lib/components/booking/info/service/addService/index.js +7 -1
- package/lib/components/productExtension/index.d.ts +2 -1
- package/lib/components/productExtension/index.js +6 -3
- package/lowcode/product-extension/meta.ts +11 -0
- package/package.json +3 -3
|
@@ -179,7 +179,10 @@ var Info = function Info() {
|
|
|
179
179
|
var handleCreateItem = function handleCreateItem() {
|
|
180
180
|
state.action({
|
|
181
181
|
type: "pisell1.handleOpenAddCustomerModal",
|
|
182
|
-
data: {
|
|
182
|
+
data: {
|
|
183
|
+
showReceiveAddress: false,
|
|
184
|
+
showAcceptsMarketing: false
|
|
185
|
+
},
|
|
183
186
|
callback: function callback(customer_id) {
|
|
184
187
|
getClients(_objectSpread(_objectSpread({}, state.client.clientsParams), {}, {
|
|
185
188
|
search: "",
|
|
@@ -39,6 +39,10 @@ var Info = function Info() {
|
|
|
39
39
|
var _useContext = useContext(Context),
|
|
40
40
|
state = _useContext.state,
|
|
41
41
|
dispatch = _useContext.dispatch;
|
|
42
|
+
var _useState3 = useState(false),
|
|
43
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
44
|
+
loading = _useState4[0],
|
|
45
|
+
setLoading = _useState4[1];
|
|
42
46
|
var context = useEngineContext();
|
|
43
47
|
request.setRequest(context.appHelper.utils.request);
|
|
44
48
|
var setDefaultService = /*#__PURE__*/function () {
|
|
@@ -72,21 +76,25 @@ var Info = function Info() {
|
|
|
72
76
|
}
|
|
73
77
|
return _context.abrupt("return");
|
|
74
78
|
case 9:
|
|
79
|
+
setLoading(true);
|
|
75
80
|
product = list[0];
|
|
76
|
-
_context.next =
|
|
81
|
+
_context.next = 13;
|
|
77
82
|
return getProductDetail(product.id, {
|
|
78
83
|
schedule_date: state.date.value.format("YYYY-MM-DD")
|
|
79
84
|
});
|
|
80
|
-
case
|
|
85
|
+
case 13:
|
|
81
86
|
detail = _context.sent;
|
|
82
87
|
// 商品是套餐或单规格多规格
|
|
83
|
-
isBundleOrCombination = getIsBundleOrCombination(detail.data);
|
|
88
|
+
isBundleOrCombination = getIsBundleOrCombination(detail.data);
|
|
89
|
+
setLoading(false);
|
|
90
|
+
|
|
91
|
+
// 套餐商品单规格多规格不设置默认
|
|
84
92
|
if (!isBundleOrCombination) {
|
|
85
|
-
_context.next =
|
|
93
|
+
_context.next = 18;
|
|
86
94
|
break;
|
|
87
95
|
}
|
|
88
96
|
return _context.abrupt("return");
|
|
89
|
-
case
|
|
97
|
+
case 18:
|
|
90
98
|
_item = _objectSpread(_objectSpread({}, product), {}, {
|
|
91
99
|
product_id: product.id,
|
|
92
100
|
_id: getUniqueId(),
|
|
@@ -111,7 +119,7 @@ var Info = function Info() {
|
|
|
111
119
|
edit: true
|
|
112
120
|
}
|
|
113
121
|
});
|
|
114
|
-
case
|
|
122
|
+
case 21:
|
|
115
123
|
case "end":
|
|
116
124
|
return _context.stop();
|
|
117
125
|
}
|
|
@@ -128,7 +136,8 @@ var Info = function Info() {
|
|
|
128
136
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
129
137
|
while (1) switch (_context2.prev = _context2.next) {
|
|
130
138
|
case 0:
|
|
131
|
-
|
|
139
|
+
setLoading(true);
|
|
140
|
+
_context2.next = 3;
|
|
132
141
|
return state.apis.getServices({
|
|
133
142
|
skip: 1,
|
|
134
143
|
num: 500,
|
|
@@ -142,8 +151,9 @@ var Info = function Info() {
|
|
|
142
151
|
open_quotation: 1,
|
|
143
152
|
with_schedule: 1
|
|
144
153
|
});
|
|
145
|
-
case
|
|
154
|
+
case 3:
|
|
146
155
|
data = _context2.sent;
|
|
156
|
+
setLoading(false);
|
|
147
157
|
setDefaultService(data === null || data === void 0 ? void 0 : data.list);
|
|
148
158
|
dispatch({
|
|
149
159
|
type: "setService",
|
|
@@ -151,7 +161,7 @@ var Info = function Info() {
|
|
|
151
161
|
services: (data === null || data === void 0 ? void 0 : data.list) || []
|
|
152
162
|
}
|
|
153
163
|
});
|
|
154
|
-
case
|
|
164
|
+
case 7:
|
|
155
165
|
case "end":
|
|
156
166
|
return _context2.stop();
|
|
157
167
|
}
|
|
@@ -254,6 +264,7 @@ var Info = function Info() {
|
|
|
254
264
|
height: 20
|
|
255
265
|
}
|
|
256
266
|
}) : /*#__PURE__*/React.createElement(AddButton, {
|
|
267
|
+
loading: loading,
|
|
257
268
|
showSub: false,
|
|
258
269
|
title: locales.getText("pisell2.text.add-a-service"),
|
|
259
270
|
subTitle: locales.getText("pisell2.text.add-another-service"),
|
|
@@ -270,7 +281,7 @@ var Info = function Info() {
|
|
|
270
281
|
height: 20
|
|
271
282
|
}
|
|
272
283
|
});
|
|
273
|
-
}, [state.renderType, showAddButton, isService, state.service.value]);
|
|
284
|
+
}, [state.renderType, showAddButton, isService, state.service.value, loading]);
|
|
274
285
|
return /*#__PURE__*/React.createElement(React.Fragment, null, addButton, /*#__PURE__*/React.createElement(Drawer, {
|
|
275
286
|
open: state.service.addModal,
|
|
276
287
|
title: locales.getText("pisell2.text.select-service"),
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import "./index.less";
|
|
3
3
|
interface ProductExtensionProps {
|
|
4
4
|
onDataChange: any;
|
|
5
|
+
type: "all" | "once" | "batch";
|
|
5
6
|
}
|
|
6
|
-
declare const ProductExtension: ({ onDataChange }: ProductExtensionProps) => React.JSX.Element;
|
|
7
|
+
declare const ProductExtension: ({ onDataChange, type }: ProductExtensionProps) => React.JSX.Element;
|
|
7
8
|
export default ProductExtension;
|
|
@@ -18,7 +18,8 @@ import localeTexts from "./locales";
|
|
|
18
18
|
locales.init(localeTexts, localStorage.getItem("umi_locale") || "en");
|
|
19
19
|
var ProductExtension = function ProductExtension(_ref) {
|
|
20
20
|
var _extension$filed;
|
|
21
|
-
var onDataChange = _ref.onDataChange
|
|
21
|
+
var onDataChange = _ref.onDataChange,
|
|
22
|
+
type = _ref.type;
|
|
22
23
|
var context = useEngineContext();
|
|
23
24
|
request.setRequest(context.appHelper.utils.request);
|
|
24
25
|
var _getProductExtensionFields = useRequest(getProductExtensionFields, {
|
|
@@ -50,14 +51,18 @@ var ProductExtension = function ProductExtension(_ref) {
|
|
|
50
51
|
round: true,
|
|
51
52
|
loading: _getProductExtensionFields.loading
|
|
52
53
|
}, (_extension$filed = extension.filed) === null || _extension$filed === void 0 ? void 0 : _extension$filed.map(function (item, index) {
|
|
53
|
-
var _item$, _item$2, _extension$extension;
|
|
54
|
+
var _item$, _item$2, _item$3, _extension$extension;
|
|
54
55
|
var isHidden = ((_item$ = item[0]) === null || _item$ === void 0 ? void 0 : _item$.key) === "event_item_type";
|
|
56
|
+
// 编辑单个活动, 不展示schedule组件
|
|
57
|
+
if (type !== "all" && ((_item$2 = item[0]) === null || _item$2 === void 0 ? void 0 : _item$2.key) === "schedule.ids") {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
55
60
|
return /*#__PURE__*/React.createElement(Card, {
|
|
56
61
|
hidden: isHidden,
|
|
57
62
|
key: index
|
|
58
63
|
// style={{ overflow: "inherit" }}
|
|
59
64
|
,
|
|
60
|
-
header: item.length === 1 ? (_item$
|
|
65
|
+
header: item.length === 1 ? (_item$3 = item[0]) === null || _item$3 === void 0 ? void 0 : _item$3.name : extension === null || extension === void 0 ? void 0 : (_extension$extension = extension.extension) === null || _extension$extension === void 0 ? void 0 : _extension$extension.name
|
|
61
66
|
}, item.map(function (child, childIndex) {
|
|
62
67
|
var name = "".concat(child.id, "|").concat(child.key);
|
|
63
68
|
return /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -160,7 +160,10 @@ var Info = () => {
|
|
|
160
160
|
const handleCreateItem = () => {
|
|
161
161
|
state.action({
|
|
162
162
|
type: "pisell1.handleOpenAddCustomerModal",
|
|
163
|
-
data: {
|
|
163
|
+
data: {
|
|
164
|
+
showReceiveAddress: false,
|
|
165
|
+
showAcceptsMarketing: false
|
|
166
|
+
},
|
|
164
167
|
callback: (customer_id) => {
|
|
165
168
|
getClients({
|
|
166
169
|
...state.client.clientsParams,
|
|
@@ -49,6 +49,7 @@ var Info = () => {
|
|
|
49
49
|
var _a;
|
|
50
50
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
51
51
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
52
|
+
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
52
53
|
const context = (0, import_useEngineContext.default)();
|
|
53
54
|
import_utils2.request.setRequest(context.appHelper.utils.request);
|
|
54
55
|
const setDefaultService = async (list) => {
|
|
@@ -65,11 +66,13 @@ var Info = () => {
|
|
|
65
66
|
if (_list.length !== 0) {
|
|
66
67
|
return;
|
|
67
68
|
}
|
|
69
|
+
setLoading(true);
|
|
68
70
|
let product = list[0];
|
|
69
71
|
const detail = await (0, import_serve.getProductDetail)(product.id, {
|
|
70
72
|
schedule_date: state.date.value.format("YYYY-MM-DD")
|
|
71
73
|
});
|
|
72
74
|
const isBundleOrCombination = (0, import_utils.getIsBundleOrCombination)(detail.data);
|
|
75
|
+
setLoading(false);
|
|
73
76
|
if (isBundleOrCombination)
|
|
74
77
|
return;
|
|
75
78
|
let _item = {
|
|
@@ -100,6 +103,7 @@ var Info = () => {
|
|
|
100
103
|
};
|
|
101
104
|
const getServices = async () => {
|
|
102
105
|
var _a2;
|
|
106
|
+
setLoading(true);
|
|
103
107
|
let data = await state.apis.getServices({
|
|
104
108
|
skip: 1,
|
|
105
109
|
num: 500,
|
|
@@ -113,6 +117,7 @@ var Info = () => {
|
|
|
113
117
|
open_quotation: 1,
|
|
114
118
|
with_schedule: 1
|
|
115
119
|
});
|
|
120
|
+
setLoading(false);
|
|
116
121
|
setDefaultService(data == null ? void 0 : data.list);
|
|
117
122
|
dispatch({
|
|
118
123
|
type: "setService",
|
|
@@ -208,6 +213,7 @@ var Info = () => {
|
|
|
208
213
|
return isService ? /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } }) : /* @__PURE__ */ import_react.default.createElement(
|
|
209
214
|
import_addButton.default,
|
|
210
215
|
{
|
|
216
|
+
loading,
|
|
211
217
|
showSub: false,
|
|
212
218
|
title: import_utils3.locales.getText("pisell2.text.add-a-service"),
|
|
213
219
|
subTitle: import_utils3.locales.getText("pisell2.text.add-another-service"),
|
|
@@ -224,7 +230,7 @@ var Info = () => {
|
|
|
224
230
|
onClick: handleSelectService
|
|
225
231
|
}
|
|
226
232
|
) : /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
|
|
227
|
-
}, [state.renderType, showAddButton, isService, state.service.value]);
|
|
233
|
+
}, [state.renderType, showAddButton, isService, state.service.value, loading]);
|
|
228
234
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, addButton, /* @__PURE__ */ import_react.default.createElement(
|
|
229
235
|
import_drawer.default,
|
|
230
236
|
{
|
|
@@ -2,6 +2,7 @@ import React from "react";
|
|
|
2
2
|
import "./index.less";
|
|
3
3
|
interface ProductExtensionProps {
|
|
4
4
|
onDataChange: any;
|
|
5
|
+
type: "all" | "once" | "batch";
|
|
5
6
|
}
|
|
6
|
-
declare const ProductExtension: ({ onDataChange }: ProductExtensionProps) => React.JSX.Element;
|
|
7
|
+
declare const ProductExtension: ({ onDataChange, type }: ProductExtensionProps) => React.JSX.Element;
|
|
7
8
|
export default ProductExtension;
|
|
@@ -44,7 +44,7 @@ var import_index = require("./index.less");
|
|
|
44
44
|
var import_utils2 = require("@pisell/utils");
|
|
45
45
|
var import_locales = __toESM(require("./locales"));
|
|
46
46
|
import_utils2.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
47
|
-
var ProductExtension = ({ onDataChange }) => {
|
|
47
|
+
var ProductExtension = ({ onDataChange, type }) => {
|
|
48
48
|
var _a;
|
|
49
49
|
const context = (0, import_useEngineContext.default)();
|
|
50
50
|
import_utils.request.setRequest(context.appHelper.utils.request);
|
|
@@ -71,14 +71,17 @@ var ProductExtension = ({ onDataChange }) => {
|
|
|
71
71
|
return Component ? /* @__PURE__ */ import_react.default.createElement(Component, { ..._props }) : null;
|
|
72
72
|
};
|
|
73
73
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { active: true, round: true, loading: _getProductExtensionFields.loading }, (_a = extension.filed) == null ? void 0 : _a.map((item, index) => {
|
|
74
|
-
var _a2, _b, _c;
|
|
74
|
+
var _a2, _b, _c, _d;
|
|
75
75
|
const isHidden = ((_a2 = item[0]) == null ? void 0 : _a2.key) === "event_item_type";
|
|
76
|
+
if (type !== "all" && ((_b = item[0]) == null ? void 0 : _b.key) === "schedule.ids") {
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
76
79
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
77
80
|
import_card.default,
|
|
78
81
|
{
|
|
79
82
|
hidden: isHidden,
|
|
80
83
|
key: index,
|
|
81
|
-
header: item.length === 1 ? (
|
|
84
|
+
header: item.length === 1 ? (_c = item[0]) == null ? void 0 : _c.name : (_d = extension == null ? void 0 : extension.extension) == null ? void 0 : _d.name
|
|
82
85
|
},
|
|
83
86
|
item.map((child, childIndex) => {
|
|
84
87
|
const name = `${child.id}|${child.key}`;
|
|
@@ -98,6 +98,17 @@ const ProductExtensionMeta: ComponentMetadata = {
|
|
|
98
98
|
"name": "onDataChange",
|
|
99
99
|
"setter": ["JsonSetter", "VariableSetter"],
|
|
100
100
|
},
|
|
101
|
+
{
|
|
102
|
+
"title": {
|
|
103
|
+
"label": {
|
|
104
|
+
"type": "i18n",
|
|
105
|
+
"en-US": "type",
|
|
106
|
+
"zh-CN": "type"
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"name": "type",
|
|
110
|
+
"setter": ["VariableSetter"],
|
|
111
|
+
},
|
|
101
112
|
],
|
|
102
113
|
"supports": {},
|
|
103
114
|
"component": {}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.20",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -58,9 +58,9 @@
|
|
|
58
58
|
"ahooks": "^3.7.6",
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
|
-
"@pisell/icon": "0.0.8",
|
|
62
61
|
"@pisell/utils": "1.0.23",
|
|
63
|
-
"@pisell/date-picker": "1.0.68"
|
|
62
|
+
"@pisell/date-picker": "1.0.68",
|
|
63
|
+
"@pisell/icon": "0.0.8"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"react": "^18.0.0",
|