@pisell/private-materials 3.0.155 → 3.0.157-gray
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 +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/addons/index.js +10 -7
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/components/TabProduct/index.js +1 -1
- package/es/components/booking/components/customSelect/index.js +5 -1
- package/es/components/booking/components/drawer/index.d.ts +3 -3
- package/es/components/booking/components/drawer/index.js +15 -13
- package/es/components/booking/components/drawer/index.less +8 -6
- package/es/components/booking/components/footer/index.js +24 -10
- package/es/components/booking/dashboard/index.d.ts +20 -0
- package/es/components/booking/dashboard/index.js +253 -0
- package/es/components/booking/dashboard/serve.d.ts +1 -0
- package/es/components/booking/dashboard/serve.js +27 -0
- package/es/components/booking/deposit/EditDepositModal/index.less +3 -0
- package/es/components/booking/forms/forms.d.ts +1 -0
- package/es/components/booking/forms/forms.js +4 -2
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/forms/single/index.d.ts +1 -1
- package/es/components/booking/forms/single/index.js +4 -3
- package/es/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/es/components/booking/info/addServiceVariant/index.js +33 -0
- package/es/components/booking/info/client/index.js +35 -15
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +4 -4
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +59 -32
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +3 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.js +14 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +4 -3
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +41 -35
- package/es/components/booking/info/clientVariant/vertical/index.d.ts +1 -1
- package/es/components/booking/info/clientVariant/vertical/index.js +32 -14
- package/es/components/booking/info/clientVariant/vertical/index.less +37 -11
- package/es/components/booking/info/date/index.js +1 -0
- package/es/components/booking/info/date/index.less +2 -0
- package/es/components/booking/info/header/index.js +13 -12
- package/es/components/booking/info/index.less +9 -0
- package/es/components/booking/info/main.js +10 -1
- package/es/components/booking/info/pet/index.js +1 -1
- package/es/components/booking/info/service/addService/index.d.ts +8 -2
- package/es/components/booking/info/service/addService/index.js +92 -44
- package/es/components/booking/info/service/addService/index.less +27 -1
- package/es/components/booking/info/service/addTimeModal/index.js +1 -0
- package/es/components/booking/info/service/addTimeModal/index.less +1 -1
- package/es/components/booking/info/service/editService/index.js +14 -15
- package/es/components/booking/info/service/serviceList/index.js +2 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/index.js +10 -1
- package/es/components/booking/locales.d.ts +48 -0
- package/es/components/booking/locales.js +51 -3
- package/es/components/booking/model.d.ts +4 -0
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/booking/utils.d.ts +1 -1
- package/es/components/booking/utils.js +54 -51
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/components/booking/addons/index.js +2 -5
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/components/TabProduct/index.js +1 -1
- package/lib/components/booking/components/customSelect/index.js +2 -1
- package/lib/components/booking/components/drawer/index.d.ts +3 -3
- package/lib/components/booking/components/drawer/index.js +13 -11
- package/lib/components/booking/components/drawer/index.less +8 -6
- package/lib/components/booking/components/footer/index.js +19 -15
- package/lib/components/booking/dashboard/index.d.ts +20 -0
- package/lib/components/booking/dashboard/index.js +251 -0
- package/lib/components/booking/dashboard/serve.d.ts +1 -0
- package/lib/components/booking/dashboard/serve.js +33 -0
- package/lib/components/booking/deposit/EditDepositModal/index.less +3 -0
- package/lib/components/booking/forms/forms.d.ts +1 -0
- package/lib/components/booking/forms/forms.js +5 -2
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/forms/single/index.d.ts +1 -1
- package/lib/components/booking/forms/single/index.js +4 -2
- package/lib/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/lib/components/booking/info/addServiceVariant/index.js +58 -0
- package/lib/components/booking/info/client/index.js +33 -21
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +4 -4
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +33 -13
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +3 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.js +36 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +4 -3
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +43 -11
- package/lib/components/booking/info/clientVariant/vertical/index.d.ts +1 -1
- package/lib/components/booking/info/clientVariant/vertical/index.js +121 -88
- package/lib/components/booking/info/clientVariant/vertical/index.less +37 -11
- package/lib/components/booking/info/date/index.js +1 -0
- package/lib/components/booking/info/date/index.less +2 -0
- package/lib/components/booking/info/header/index.js +14 -12
- package/lib/components/booking/info/index.less +9 -0
- package/lib/components/booking/info/main.js +14 -1
- package/lib/components/booking/info/pet/index.js +2 -1
- package/lib/components/booking/info/service/addService/index.d.ts +8 -2
- package/lib/components/booking/info/service/addService/index.js +69 -30
- package/lib/components/booking/info/service/addService/index.less +27 -1
- package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.less +1 -1
- package/lib/components/booking/info/service/editService/index.js +17 -13
- package/lib/components/booking/info/service/serviceList/index.js +4 -3
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/index.js +14 -1
- package/lib/components/booking/locales.d.ts +48 -0
- package/lib/components/booking/locales.js +51 -3
- package/lib/components/booking/model.d.ts +4 -0
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/booking/utils.d.ts +1 -1
- package/lib/components/booking/utils.js +57 -22
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/booking-dashboard/meta.ts +137 -0
- package/lowcode/booking-vertical-add-service/meta.ts +124 -0
- package/lowcode/vertical-add-service/meta.ts +71 -0
- package/package.json +3 -3
|
@@ -44,6 +44,7 @@ var import_utils = require("@pisell/utils");
|
|
|
44
44
|
var import_utils2 = require("../../utils");
|
|
45
45
|
var import_serve = require("./serve");
|
|
46
46
|
var import_ahooks = require("ahooks");
|
|
47
|
+
var isLoadClient = false;
|
|
47
48
|
var Client = () => {
|
|
48
49
|
var _a, _b, _c, _d, _e, _f;
|
|
49
50
|
const modalRef = (0, import_react.useRef)();
|
|
@@ -53,9 +54,10 @@ var Client = () => {
|
|
|
53
54
|
const [franchiseeLoading, setFranchiseeLoading] = (0, import_react.useState)(0);
|
|
54
55
|
const [params, setParams] = (0, import_react.useState)({
|
|
55
56
|
skip: 1,
|
|
56
|
-
num:
|
|
57
|
+
num: 10,
|
|
57
58
|
total: 0,
|
|
58
|
-
search: ""
|
|
59
|
+
search: "",
|
|
60
|
+
sort_by: "id"
|
|
59
61
|
});
|
|
60
62
|
const menus = (0, import_react.useMemo)(() => {
|
|
61
63
|
let list = [
|
|
@@ -72,9 +74,20 @@ var Client = () => {
|
|
|
72
74
|
customer_id,
|
|
73
75
|
...resetParams
|
|
74
76
|
}) => {
|
|
75
|
-
|
|
77
|
+
var _a2, _b2;
|
|
78
|
+
let _setLoading;
|
|
79
|
+
if (resetParams.skip === 1) {
|
|
80
|
+
if (resetParams.search) {
|
|
81
|
+
_setLoading = setLoading;
|
|
82
|
+
} else {
|
|
83
|
+
_setLoading = isLoadClient || ((_b2 = (_a2 = state == null ? void 0 : state.client) == null ? void 0 : _a2.clients) == null ? void 0 : _b2.length) ? () => {
|
|
84
|
+
} : setLoading;
|
|
85
|
+
}
|
|
86
|
+
} else {
|
|
87
|
+
_setLoading = setLoadLoading;
|
|
88
|
+
}
|
|
76
89
|
_setLoading(true);
|
|
77
|
-
const api = state.isFranchisee ? import_serve.getFranchiseeCustomerList : state.apis.
|
|
90
|
+
const api = state.isFranchisee ? import_serve.getFranchiseeCustomerList : state.apis.getClientsEs;
|
|
78
91
|
const data = await api({
|
|
79
92
|
...resetParams,
|
|
80
93
|
...!state.isFranchisee ? { _config: { abort: true } } : {}
|
|
@@ -111,7 +124,9 @@ var Client = () => {
|
|
|
111
124
|
type: "setClient",
|
|
112
125
|
payload: _payload
|
|
113
126
|
});
|
|
114
|
-
|
|
127
|
+
setLoading(false);
|
|
128
|
+
setLoadLoading(false);
|
|
129
|
+
isLoadClient = true;
|
|
115
130
|
return {};
|
|
116
131
|
};
|
|
117
132
|
const handleOpenClientModal = () => {
|
|
@@ -127,7 +142,8 @@ var Client = () => {
|
|
|
127
142
|
if ((0, import_utils2.isWalkIn)(item == null ? void 0 : item.id)) {
|
|
128
143
|
return import_utils.locales.getText("pisell2.text.select-a-customer");
|
|
129
144
|
}
|
|
130
|
-
|
|
145
|
+
const firstLastName = item.first_name || item.last_name ? `${item.first_name} ${item.last_name}` : "";
|
|
146
|
+
return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || firstLastName.trim() || "";
|
|
131
147
|
},
|
|
132
148
|
[import_utils.locales.localeMap]
|
|
133
149
|
);
|
|
@@ -201,12 +217,16 @@ var Client = () => {
|
|
|
201
217
|
showReceiveAddress: false,
|
|
202
218
|
showAcceptsMarketing: false
|
|
203
219
|
},
|
|
204
|
-
callback: (customer_id) => {
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
220
|
+
callback: (customer_id, params2) => {
|
|
221
|
+
var _a2, _b2, _c2;
|
|
222
|
+
dispatch({
|
|
223
|
+
type: "setClient",
|
|
224
|
+
payload: {
|
|
225
|
+
clients: [
|
|
226
|
+
...((_a2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _a2.customer) ? [{ ...(_b2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _b2.customer, id: customer_id }] : [],
|
|
227
|
+
...((_c2 = state.client) == null ? void 0 : _c2.clients) || []
|
|
228
|
+
]
|
|
229
|
+
}
|
|
210
230
|
});
|
|
211
231
|
}
|
|
212
232
|
});
|
|
@@ -289,7 +309,6 @@ var Client = () => {
|
|
|
289
309
|
mode: "single",
|
|
290
310
|
createItemText: import_utils.locales.getText("pisell2.text.create-new-customer"),
|
|
291
311
|
closeCallback: () => {
|
|
292
|
-
searchChange("");
|
|
293
312
|
},
|
|
294
313
|
optionRender: (item) => {
|
|
295
314
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -309,14 +328,7 @@ var Client = () => {
|
|
|
309
328
|
}
|
|
310
329
|
}
|
|
311
330
|
);
|
|
312
|
-
}, [
|
|
313
|
-
state,
|
|
314
|
-
renderList,
|
|
315
|
-
loading,
|
|
316
|
-
franchiseeLoading,
|
|
317
|
-
params.search,
|
|
318
|
-
loadMore
|
|
319
|
-
]);
|
|
331
|
+
}, [state, renderList, loading, franchiseeLoading, params.search, loadMore]);
|
|
320
332
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
321
333
|
"div",
|
|
322
334
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import { FormState } from
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { FormState } from '../../../model';
|
|
3
3
|
interface useClientFnParams {
|
|
4
4
|
state: any;
|
|
5
5
|
setGlobalState: (val: any) => void;
|
|
@@ -7,7 +7,7 @@ interface useClientFnParams {
|
|
|
7
7
|
onRemoveClient?: () => void;
|
|
8
8
|
}
|
|
9
9
|
declare const useClientFn: (_params: useClientFnParams) => {
|
|
10
|
-
setClient: (client: Partial<FormState[
|
|
10
|
+
setClient: (client: Partial<FormState['client']>) => void;
|
|
11
11
|
isWalkIn: boolean;
|
|
12
12
|
handleSelectClient: (value: any) => Promise<unknown>;
|
|
13
13
|
menuChange: (e: any) => void;
|
|
@@ -16,7 +16,7 @@ declare const useClientFn: (_params: useClientFnParams) => {
|
|
|
16
16
|
key: string;
|
|
17
17
|
label: any;
|
|
18
18
|
}[];
|
|
19
|
-
handleCreateItem: () => void;
|
|
19
|
+
handleCreateItem: (cb?: () => void) => void;
|
|
20
20
|
getClients: ({ customer_id, customer_ids, ...resetParams }: {
|
|
21
21
|
customer_id?: number | undefined;
|
|
22
22
|
skip?: number | undefined;
|
|
@@ -38,15 +38,18 @@ var import_serve = require("../../client/serve");
|
|
|
38
38
|
var import_model = require("../../model");
|
|
39
39
|
var import_utils2 = require("@pisell/utils");
|
|
40
40
|
var import_antd = require("antd");
|
|
41
|
+
var import_useIsLowSpeedNetwork = __toESM(require("./useIsLowSpeedNetwork"));
|
|
42
|
+
var isLoadClient = false;
|
|
41
43
|
var useClientFn = (_params) => {
|
|
42
44
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
43
45
|
const { state, setGlobalState, modalRef, onRemoveClient } = _params;
|
|
44
46
|
const [loadLoading, setLoadLoading] = (0, import_react.useState)(false);
|
|
45
47
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
46
48
|
const [franchiseeLoading, setFranchiseeLoading] = (0, import_react.useState)(0);
|
|
49
|
+
const isLowSpeedNetwork = (0, import_useIsLowSpeedNetwork.default)();
|
|
47
50
|
const [params, setParams] = (0, import_react.useState)({
|
|
48
51
|
skip: 1,
|
|
49
|
-
num:
|
|
52
|
+
num: 5,
|
|
50
53
|
total: 0,
|
|
51
54
|
search: "",
|
|
52
55
|
with: ["formRecord"],
|
|
@@ -74,21 +77,33 @@ var useClientFn = (_params) => {
|
|
|
74
77
|
customer_ids,
|
|
75
78
|
...resetParams
|
|
76
79
|
}, returnResult) => {
|
|
77
|
-
|
|
80
|
+
var _a2, _b2;
|
|
81
|
+
let _setLoading;
|
|
82
|
+
if (resetParams.skip === 1) {
|
|
83
|
+
if (resetParams.search) {
|
|
84
|
+
_setLoading = setLoading;
|
|
85
|
+
} else {
|
|
86
|
+
_setLoading = isLoadClient || ((_b2 = (_a2 = state == null ? void 0 : state.client) == null ? void 0 : _a2.clients) == null ? void 0 : _b2.length) ? () => {
|
|
87
|
+
} : setLoading;
|
|
88
|
+
}
|
|
89
|
+
} else {
|
|
90
|
+
_setLoading = setLoadLoading;
|
|
91
|
+
}
|
|
78
92
|
_setLoading(true);
|
|
79
93
|
const api = state.isFranchisee ? import_serve.getFranchiseeCustomerList : state.apis.getClients;
|
|
80
94
|
const data = await api({
|
|
81
95
|
...resetParams,
|
|
96
|
+
...resetParams.search ? { num: 10 } : {},
|
|
82
97
|
...state.isFranchisee ? { franchisee_customer_ids: customer_ids } : { customer_ids },
|
|
83
98
|
...!state.isFranchisee && !returnResult ? { _config: { abort: true } } : {}
|
|
84
99
|
});
|
|
85
100
|
const list = ((data == null ? void 0 : data.list) || []).map((d) => {
|
|
86
|
-
var
|
|
101
|
+
var _a3;
|
|
87
102
|
return {
|
|
88
103
|
...d,
|
|
89
104
|
name: getNickname(d),
|
|
90
105
|
id: d.franchisee_customer_id || d.id,
|
|
91
|
-
form_record: ((
|
|
106
|
+
form_record: ((_a3 = d.form_record) == null ? void 0 : _a3.map((item) => ({
|
|
92
107
|
...item,
|
|
93
108
|
...item.data,
|
|
94
109
|
form_record_id: item.id
|
|
@@ -126,7 +141,9 @@ var useClientFn = (_params) => {
|
|
|
126
141
|
..._payload
|
|
127
142
|
}
|
|
128
143
|
});
|
|
129
|
-
|
|
144
|
+
isLoadClient = true;
|
|
145
|
+
setLoading(false);
|
|
146
|
+
setLoadLoading(false);
|
|
130
147
|
return {};
|
|
131
148
|
};
|
|
132
149
|
const handleOpenClientModal = (val) => {
|
|
@@ -215,7 +232,8 @@ var useClientFn = (_params) => {
|
|
|
215
232
|
if ((0, import_utils.isWalkIn)(item == null ? void 0 : item.id)) {
|
|
216
233
|
return import_utils2.locales.getText("pisell2.text.select-a-customer");
|
|
217
234
|
}
|
|
218
|
-
|
|
235
|
+
const firstLastName = item.first_name || item.last_name ? `${item.first_name} ${item.last_name}` : "";
|
|
236
|
+
return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || firstLastName.trim() || "";
|
|
219
237
|
},
|
|
220
238
|
[import_utils2.locales.localeMap]
|
|
221
239
|
);
|
|
@@ -254,19 +272,21 @@ var useClientFn = (_params) => {
|
|
|
254
272
|
resolve(0);
|
|
255
273
|
});
|
|
256
274
|
};
|
|
257
|
-
const handleCreateItem = () => {
|
|
275
|
+
const handleCreateItem = (cb) => {
|
|
258
276
|
state.action({
|
|
259
277
|
type: "pisell1.handleOpenAddCustomerModal",
|
|
260
278
|
data: {
|
|
261
279
|
showReceiveAddress: false,
|
|
262
280
|
showAcceptsMarketing: false
|
|
263
281
|
},
|
|
264
|
-
callback: (customer_id) => {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
282
|
+
callback: (customer_id, params2) => {
|
|
283
|
+
var _a2, _b2, _c2;
|
|
284
|
+
cb == null ? void 0 : cb();
|
|
285
|
+
setClient({
|
|
286
|
+
clients: [
|
|
287
|
+
...((_a2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _a2.customer) ? [{ ...(_b2 = params2 == null ? void 0 : params2[0]) == null ? void 0 : _b2.customer, id: customer_id, form_record: [] }] : [],
|
|
288
|
+
...((_c2 = state.client) == null ? void 0 : _c2.clients) || []
|
|
289
|
+
]
|
|
270
290
|
});
|
|
271
291
|
}
|
|
272
292
|
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.ts
|
|
20
|
+
var useIsLowSpeedNetwork_exports = {};
|
|
21
|
+
__export(useIsLowSpeedNetwork_exports, {
|
|
22
|
+
default: () => useIsLowSpeedNetwork_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useIsLowSpeedNetwork_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_ahooks = require("ahooks");
|
|
27
|
+
var useIsLowSpeedNetwork = () => {
|
|
28
|
+
const networkState = (0, import_ahooks.useNetwork)();
|
|
29
|
+
const isLowSpeedNetwork = (0, import_react.useRef)(false);
|
|
30
|
+
const isLowSpeedNetworkMemo = (0, import_react.useMemo)(() => {
|
|
31
|
+
return ["slow-2g", "2g", "3g"].includes((networkState == null ? void 0 : networkState.effectiveType) || "") || ((networkState == null ? void 0 : networkState.downlink) || 20) <= 1 || ((networkState == null ? void 0 : networkState.rtt) || 0) > 500;
|
|
32
|
+
}, [networkState]);
|
|
33
|
+
isLowSpeedNetwork.current = isLowSpeedNetworkMemo;
|
|
34
|
+
return isLowSpeedNetwork;
|
|
35
|
+
};
|
|
36
|
+
var useIsLowSpeedNetwork_default = useIsLowSpeedNetwork;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './SelectDrawer.less';
|
|
3
3
|
interface SelectDrawerProps {
|
|
4
4
|
autoFocus?: boolean;
|
|
5
5
|
onClose: () => void;
|
|
6
6
|
handleSelectClient: (val: any) => void;
|
|
7
|
-
handleCreateItem: () => void;
|
|
7
|
+
handleCreateItem: (cb: () => void) => void;
|
|
8
8
|
handleSelectPet: (val: any) => void;
|
|
9
9
|
childrenValue: any[];
|
|
10
10
|
formData: any;
|
|
@@ -18,6 +18,7 @@ interface SelectDrawerProps {
|
|
|
18
18
|
handleAddPet: any;
|
|
19
19
|
modalOpen: boolean;
|
|
20
20
|
franchiseeLoading?: number;
|
|
21
|
+
showHeader?: boolean;
|
|
21
22
|
}
|
|
22
23
|
declare const _default: React.ForwardRefExoticComponent<SelectDrawerProps & React.RefAttributes<unknown>>;
|
|
23
24
|
export default _default;
|
|
@@ -107,14 +107,20 @@ var SelectDrawer = (props, ref) => {
|
|
|
107
107
|
showPet,
|
|
108
108
|
handleAddPet,
|
|
109
109
|
modalOpen,
|
|
110
|
-
franchiseeLoading
|
|
110
|
+
franchiseeLoading,
|
|
111
|
+
showHeader
|
|
111
112
|
} = props;
|
|
112
113
|
const form = (formData == null ? void 0 : formData[0]) || {};
|
|
113
114
|
const valList = (childrenValue == null ? void 0 : childrenValue[form.id]) || defaultArr;
|
|
114
115
|
const [_value, setValue] = (0, import_react.useState)(valList);
|
|
115
116
|
const clientRef = (0, import_react.useRef)();
|
|
116
117
|
(0, import_react.useEffect)(() => {
|
|
117
|
-
setValue(
|
|
118
|
+
setValue(
|
|
119
|
+
valList.map((item) => ({
|
|
120
|
+
...item,
|
|
121
|
+
id: item.id || item.form_record_id
|
|
122
|
+
}))
|
|
123
|
+
);
|
|
118
124
|
}, [valList]);
|
|
119
125
|
const searchRef = (0, import_react.useRef)();
|
|
120
126
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
@@ -160,12 +166,15 @@ var SelectDrawer = (props, ref) => {
|
|
|
160
166
|
if ((0, import_utils2.isWalkIn)(item == null ? void 0 : item.id)) {
|
|
161
167
|
return import_utils.locales.getText("pisell2.text.select-a-customer");
|
|
162
168
|
}
|
|
163
|
-
|
|
169
|
+
const firstLastName = item.first_name || item.last_name ? `${item.first_name} ${item.last_name}` : "";
|
|
170
|
+
return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || firstLastName.trim() || "";
|
|
164
171
|
},
|
|
165
172
|
[import_utils.locales.localeMap]
|
|
166
173
|
);
|
|
167
174
|
const handleAddClient = () => {
|
|
168
|
-
handleCreateItem()
|
|
175
|
+
handleCreateItem(() => {
|
|
176
|
+
setSearch("");
|
|
177
|
+
});
|
|
169
178
|
};
|
|
170
179
|
const handleChildrenValueChange = async (value, item) => {
|
|
171
180
|
var _a;
|
|
@@ -250,7 +259,10 @@ var SelectDrawer = (props, ref) => {
|
|
|
250
259
|
...isHasChildren ? [] : (0, import_format.formatAddFormValues)({
|
|
251
260
|
clientId: item.id,
|
|
252
261
|
data_range: holder.data_range,
|
|
253
|
-
value: (_a = item.form_record) == null ? void 0 : _a.map((f) => ({
|
|
262
|
+
value: (_a = item.form_record) == null ? void 0 : _a.map((f) => ({
|
|
263
|
+
...f,
|
|
264
|
+
customer: item
|
|
265
|
+
}))
|
|
254
266
|
})
|
|
255
267
|
],
|
|
256
268
|
"id"
|
|
@@ -262,7 +274,8 @@ var SelectDrawer = (props, ref) => {
|
|
|
262
274
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
263
275
|
import_drawer.default,
|
|
264
276
|
{
|
|
265
|
-
|
|
277
|
+
showGoBack: showHeader,
|
|
278
|
+
title: showHeader && import_utils.locales.getText("pisell2.text.select-customer"),
|
|
266
279
|
open,
|
|
267
280
|
onClose: closeDrawer,
|
|
268
281
|
header: /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -287,9 +300,18 @@ var SelectDrawer = (props, ref) => {
|
|
|
287
300
|
getContainer: false,
|
|
288
301
|
destroyOnClose: true,
|
|
289
302
|
push: { distance: 180 },
|
|
290
|
-
footer: mode === "multiple" && /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
303
|
+
footer: mode === "multiple" && /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
304
|
+
import_antd.Button,
|
|
305
|
+
{
|
|
306
|
+
block: true,
|
|
307
|
+
type: "primary",
|
|
308
|
+
onClick: handleOk,
|
|
309
|
+
loading: !!franchiseeLoading
|
|
310
|
+
},
|
|
311
|
+
import_utils.locales.getText("pisell2.text.apply")
|
|
312
|
+
))
|
|
291
313
|
},
|
|
292
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
314
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "vertical-client-select-drawer-content-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "vertical-client-select-drawer-top" }, /* @__PURE__ */ import_react.default.createElement(
|
|
293
315
|
ActionItem,
|
|
294
316
|
{
|
|
295
317
|
title: import_utils.locales.getText("pisell2.text.create-new-customer"),
|
|
@@ -304,7 +326,7 @@ var SelectDrawer = (props, ref) => {
|
|
|
304
326
|
closeDrawer();
|
|
305
327
|
}
|
|
306
328
|
}
|
|
307
|
-
)), !!options.length ? options.map((item) => {
|
|
329
|
+
)), /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { spinning: !!loading, delay: 500 }, !!options.length ? options.map((item) => {
|
|
308
330
|
var _a;
|
|
309
331
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
310
332
|
"div",
|
|
@@ -332,7 +354,10 @@ var SelectDrawer = (props, ref) => {
|
|
|
332
354
|
"div",
|
|
333
355
|
{
|
|
334
356
|
onClick: () => {
|
|
335
|
-
handleChildrenValueChange(
|
|
357
|
+
handleChildrenValueChange(
|
|
358
|
+
{ ...f, customer: item },
|
|
359
|
+
item
|
|
360
|
+
);
|
|
336
361
|
},
|
|
337
362
|
id: `${f.id}`,
|
|
338
363
|
key: f.id,
|
|
@@ -344,7 +369,14 @@ var SelectDrawer = (props, ref) => {
|
|
|
344
369
|
)
|
|
345
370
|
},
|
|
346
371
|
mode === "multiple" && /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { checked }),
|
|
347
|
-
/* @__PURE__ */ import_react.default.createElement(
|
|
372
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
373
|
+
Item,
|
|
374
|
+
{
|
|
375
|
+
coverSize: 48,
|
|
376
|
+
title: f.main_field,
|
|
377
|
+
loading: false
|
|
378
|
+
}
|
|
379
|
+
)
|
|
348
380
|
);
|
|
349
381
|
}), /* @__PURE__ */ import_react.default.createElement(
|
|
350
382
|
"div",
|
|
@@ -4,5 +4,5 @@ interface VerticalClientProps {
|
|
|
4
4
|
globalState: any;
|
|
5
5
|
setGlobalState: any;
|
|
6
6
|
}
|
|
7
|
-
declare const VerticalClient:
|
|
7
|
+
declare const VerticalClient: React.ForwardRefExoticComponent<VerticalClientProps & React.RefAttributes<unknown>>;
|
|
8
8
|
export default VerticalClient;
|