@pisell/private-materials 3.0.14 → 3.0.15
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/components/footer/index.js +2 -2
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/index.js +14 -6
- package/es/components/booking/info/model.d.ts +2 -1
- package/es/components/booking/info/notes/index.d.ts +3 -0
- package/es/components/booking/info/notes/index.js +83 -0
- package/es/components/booking/info/service/addService/index.js +47 -4
- package/es/components/booking/model.d.ts +2 -1
- 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/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +4 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +39 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
- package/es/components/productExtension/fields/SelectProducts/index.js +11 -3
- package/es/components/productExtension/fields/SelectResourcesTable/index.js +21 -19
- package/es/components/productExtension/index.js +2 -1
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/components/footer/index.js +2 -2
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/index.js +21 -9
- package/lib/components/booking/info/model.d.ts +2 -1
- package/lib/components/booking/info/notes/index.d.ts +3 -0
- package/lib/components/booking/info/notes/index.js +111 -0
- package/lib/components/booking/info/service/addService/index.js +40 -0
- package/lib/components/booking/model.d.ts +2 -1
- 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/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +4 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +79 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.less +62 -0
- package/lib/components/productExtension/fields/SelectProducts/index.js +17 -2
- package/lib/components/productExtension/fields/SelectResourcesTable/index.js +18 -19
- package/lib/components/productExtension/index.js +2 -1
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/package.json +3 -3
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
2
3
|
import dayjs from "dayjs";
|
|
3
4
|
export interface FormState {
|
|
@@ -68,7 +69,7 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
72
73
|
state: FormState;
|
|
73
74
|
} & {
|
|
74
75
|
dispatch: (params: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -384,12 +384,12 @@ var Footer = (props) => {
|
|
|
384
384
|
if (!state.bookingDetail) {
|
|
385
385
|
return true;
|
|
386
386
|
}
|
|
387
|
-
if (!((_a2 = state.addons) == null ? void 0 : _a2.load)) {
|
|
387
|
+
if (!((_a2 = state.addons) == null ? void 0 : _a2.load) && state.renderType !== "eventBooking") {
|
|
388
388
|
return true;
|
|
389
389
|
}
|
|
390
390
|
}
|
|
391
391
|
return false;
|
|
392
|
-
}, [state.bookingId, state.bookingDetail, (_e = state.addons) == null ? void 0 : _e.load]);
|
|
392
|
+
}, [state.bookingId, state.bookingDetail, (_e = state.addons) == null ? void 0 : _e.load, state.renderType]);
|
|
393
393
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { title: false, round: true, loading: showFooter, active: true }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-total" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-total" }, totalText), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-arrears" }, arrearsText)), /* @__PURE__ */ import_react.default.createElement(
|
|
394
394
|
"span",
|
|
395
395
|
{
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => any;
|
|
2
2
|
export default Booking;
|
|
@@ -46,6 +46,7 @@ var import_locales = __toESM(require("../locales"));
|
|
|
46
46
|
var import_utils = require("@pisell/utils");
|
|
47
47
|
var import_utils2 = require("../utils");
|
|
48
48
|
var import_date2 = require("./date");
|
|
49
|
+
var import_notes = __toESM(require("./notes"));
|
|
49
50
|
var import_index = require("./index.less");
|
|
50
51
|
var defaultModules = {
|
|
51
52
|
client: 1,
|
|
@@ -56,7 +57,7 @@ var defaultModules = {
|
|
|
56
57
|
};
|
|
57
58
|
import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
|
|
58
59
|
var Info = (0, import_model.Provider)((props) => {
|
|
59
|
-
var _a, _b, _c, _d, _e;
|
|
60
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
60
61
|
const { style, globalState, modules = defaultModules, slot } = props;
|
|
61
62
|
const modal = (0, import_react.useContext)(import_model.Context);
|
|
62
63
|
const params = (0, import_react.useMemo)(() => {
|
|
@@ -101,7 +102,24 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
101
102
|
return import_utils.locales.getText("pisell2.text.enroll");
|
|
102
103
|
}
|
|
103
104
|
return (globalState == null ? void 0 : globalState.bookingId) ? /* @__PURE__ */ import_react.default.createElement(import_header.default, { state: modal.state, dispatch: modal.dispatch }) : import_utils.locales.getText("pisell2.text.new-appointment");
|
|
104
|
-
}, [
|
|
105
|
+
}, [
|
|
106
|
+
globalState == null ? void 0 : globalState.bookingId,
|
|
107
|
+
modal.state,
|
|
108
|
+
modal.dispatch,
|
|
109
|
+
globalState == null ? void 0 : globalState.renderType
|
|
110
|
+
]);
|
|
111
|
+
const notes = (0, import_react.useMemo)(() => {
|
|
112
|
+
var _a2, _b2;
|
|
113
|
+
if (!modules.note) {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
return (globalState == null ? void 0 : globalState.bookingId) ? globalState.renderType === "eventBooking" ? /* @__PURE__ */ import_react.default.createElement(import_notes.default, null) : null : /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote, onChange: addNote });
|
|
117
|
+
}, [
|
|
118
|
+
modules.note,
|
|
119
|
+
globalState == null ? void 0 : globalState.bookingId,
|
|
120
|
+
globalState.render,
|
|
121
|
+
(_f = (_e = modal.state) == null ? void 0 : _e.notes) == null ? void 0 : _f.orderNote
|
|
122
|
+
]);
|
|
105
123
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !!modal.state.setGlobalState ? /* @__PURE__ */ import_react.default.createElement(
|
|
106
124
|
import_tabPane.default,
|
|
107
125
|
{
|
|
@@ -117,13 +135,7 @@ var Info = (0, import_model.Provider)((props) => {
|
|
|
117
135
|
),
|
|
118
136
|
bodyClassName: "booking-info-warp"
|
|
119
137
|
},
|
|
120
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((
|
|
121
|
-
import_addNote.default,
|
|
122
|
-
{
|
|
123
|
-
value: modal.state.notes.orderNote,
|
|
124
|
-
onChange: addNote
|
|
125
|
-
}
|
|
126
|
-
)) : null, slot ? slot : null)
|
|
138
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_g = modal.state) == null ? void 0 : _g.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, modules.service ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, modal.state.date.value ? /* @__PURE__ */ import_react.default.createElement(import_service.default, null) : null) : null, notes, slot ? slot : null)
|
|
127
139
|
) : null);
|
|
128
140
|
});
|
|
129
141
|
var info_default = Info;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
3
|
export declare const walkInData: {
|
|
3
4
|
id: number;
|
|
4
5
|
nickname: string;
|
|
5
6
|
};
|
|
6
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
7
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
7
8
|
state: FormState;
|
|
8
9
|
} & {
|
|
9
10
|
dispatch: (params: {
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/booking/info/notes/index.tsx
|
|
30
|
+
var notes_exports = {};
|
|
31
|
+
__export(notes_exports, {
|
|
32
|
+
default: () => notes_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(notes_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_model = require("../model");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_NoteBlock = __toESM(require("../../notes/NoteBlock"));
|
|
39
|
+
var Notes = () => {
|
|
40
|
+
var _a, _b, _c;
|
|
41
|
+
const modal = (0, import_react.useContext)(import_model.Context);
|
|
42
|
+
const orderNote = (0, import_react.useMemo)(() => {
|
|
43
|
+
var _a2, _b2, _c2, _d;
|
|
44
|
+
if (!((_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote)) {
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
return [
|
|
48
|
+
{
|
|
49
|
+
id: 0,
|
|
50
|
+
content: ((_d = (_c2 = modal.state) == null ? void 0 : _c2.notes) == null ? void 0 : _d.orderNote) || ""
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
}, [(_b = (_a = modal.state) == null ? void 0 : _a.notes) == null ? void 0 : _b.orderNote]);
|
|
54
|
+
const noteChange = ({ note, status, noteType }) => {
|
|
55
|
+
var _a2;
|
|
56
|
+
if (noteType === "internal") {
|
|
57
|
+
let _list = [...(_a2 = modal.state) == null ? void 0 : _a2.notes.internalNotes];
|
|
58
|
+
if (status == "add") {
|
|
59
|
+
_list.push(note);
|
|
60
|
+
}
|
|
61
|
+
if (status == "remove") {
|
|
62
|
+
_list = _list.filter((item) => item.id != note.id);
|
|
63
|
+
}
|
|
64
|
+
if (status == "edit") {
|
|
65
|
+
_list = _list.map((item) => {
|
|
66
|
+
if (item.id == note.id) {
|
|
67
|
+
return note;
|
|
68
|
+
}
|
|
69
|
+
return item;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
modal.dispatch({
|
|
73
|
+
type: "setNotes",
|
|
74
|
+
payload: {
|
|
75
|
+
internalNotes: _list
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
if (noteType === "order") {
|
|
81
|
+
modal.dispatch({
|
|
82
|
+
type: "setNotes",
|
|
83
|
+
payload: {
|
|
84
|
+
orderNote: note.content || "",
|
|
85
|
+
edit: false
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
91
|
+
import_NoteBlock.default,
|
|
92
|
+
{
|
|
93
|
+
noteType: "order",
|
|
94
|
+
maxLength: 1,
|
|
95
|
+
title: `${import_utils.locales.getText("pisell2.text.order-notes")}:`,
|
|
96
|
+
describe: "",
|
|
97
|
+
notes: orderNote,
|
|
98
|
+
apis: (_c = modal == null ? void 0 : modal.state) == null ? void 0 : _c.apis,
|
|
99
|
+
placeholder: import_utils.locales.getText("pisell2.text.add-order-notes"),
|
|
100
|
+
isEdit: true,
|
|
101
|
+
onChange: (e, type, noteType) => {
|
|
102
|
+
noteChange({
|
|
103
|
+
note: e,
|
|
104
|
+
status: type,
|
|
105
|
+
noteType
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
};
|
|
111
|
+
var notes_default = Notes;
|
|
@@ -46,6 +46,45 @@ var Info = () => {
|
|
|
46
46
|
var _a;
|
|
47
47
|
const [search, setSearch] = (0, import_react.useState)("");
|
|
48
48
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
49
|
+
const setDefaultService = (list) => {
|
|
50
|
+
if (state.renderType !== "eventBooking") {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
if (state.bookingId) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
if (list.length !== 1) {
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
let _list = [...state.service.value];
|
|
60
|
+
if (_list.length !== 0) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
let product = list[0];
|
|
64
|
+
let _item = {
|
|
65
|
+
...product,
|
|
66
|
+
product_id: product.id,
|
|
67
|
+
_id: (0, import_utils2.getUniqueId)(),
|
|
68
|
+
_extend: {
|
|
69
|
+
start_date: state.date.value,
|
|
70
|
+
startDate: state.date.value,
|
|
71
|
+
endDate: state.date.value,
|
|
72
|
+
start_time: "00:00:00",
|
|
73
|
+
duration: 10,
|
|
74
|
+
quantity: 1,
|
|
75
|
+
price: product.price,
|
|
76
|
+
product_name: product.title
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
_list.push(_item);
|
|
80
|
+
dispatch({
|
|
81
|
+
type: "setService",
|
|
82
|
+
payload: {
|
|
83
|
+
value: _list,
|
|
84
|
+
edit: true
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
};
|
|
49
88
|
const getServices = async () => {
|
|
50
89
|
var _a2;
|
|
51
90
|
let data = await state.apis.getServices({
|
|
@@ -61,6 +100,7 @@ var Info = () => {
|
|
|
61
100
|
open_quotation: 1,
|
|
62
101
|
with_schedule: 0
|
|
63
102
|
});
|
|
103
|
+
setDefaultService(data == null ? void 0 : data.list);
|
|
64
104
|
dispatch({
|
|
65
105
|
type: "setService",
|
|
66
106
|
payload: {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export interface FormState {
|
|
2
3
|
amountSymbol: string;
|
|
3
4
|
apis: {
|
|
@@ -86,7 +87,7 @@ export declare const walkInData: {
|
|
|
86
87
|
id: number;
|
|
87
88
|
nickname: string;
|
|
88
89
|
};
|
|
89
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
90
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
90
91
|
state: FormState;
|
|
91
92
|
} & {
|
|
92
93
|
dispatch: (params: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { FormState } from "../model";
|
|
2
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
3
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
3
4
|
state: FormState;
|
|
4
5
|
} & {
|
|
5
6
|
dispatch: (params: {
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/productExtension/fields/SelectProducts/ProductItemPreview/index.tsx
|
|
30
|
+
var ProductItemPreview_exports = {};
|
|
31
|
+
__export(ProductItemPreview_exports, {
|
|
32
|
+
default: () => ProductItemPreview_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(ProductItemPreview_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_XClose = __toESM(require("@pisell/icon/es/XClose"));
|
|
38
|
+
var import_classnames = __toESM(require("classnames"));
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var ProductItemPreview = ({
|
|
41
|
+
item = {},
|
|
42
|
+
onClick,
|
|
43
|
+
onRemove,
|
|
44
|
+
amountSymbol = "$",
|
|
45
|
+
style,
|
|
46
|
+
className
|
|
47
|
+
}) => {
|
|
48
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
style,
|
|
52
|
+
className: (0, import_classnames.default)("product-item-card-preview", className),
|
|
53
|
+
onClick: () => {
|
|
54
|
+
onClick(item);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
item.cover ? /* @__PURE__ */ import_react.default.createElement(
|
|
58
|
+
"img",
|
|
59
|
+
{
|
|
60
|
+
src: import_utils.image.ali(item.cover, 100),
|
|
61
|
+
className: "product-item-card-preview-cover"
|
|
62
|
+
}
|
|
63
|
+
) : null,
|
|
64
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "product-item-card-preview-content" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "product-item-card-preview-title" }, item.title)),
|
|
65
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
66
|
+
"div",
|
|
67
|
+
{
|
|
68
|
+
className: "product-item-card-preview-close-wrap",
|
|
69
|
+
onClick: (e) => {
|
|
70
|
+
e.preventDefault();
|
|
71
|
+
e.stopPropagation();
|
|
72
|
+
onRemove == null ? void 0 : onRemove(item);
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
/* @__PURE__ */ import_react.default.createElement(import_XClose.default, { className: "product-item-card-preview-close" })
|
|
76
|
+
)
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
var ProductItemPreview_default = ProductItemPreview;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
.product-item-card-preview {
|
|
2
|
+
padding: 16px;
|
|
3
|
+
position: relative;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
gap: 12px;
|
|
7
|
+
|
|
8
|
+
&::before {
|
|
9
|
+
content: "";
|
|
10
|
+
position: absolute;
|
|
11
|
+
bottom: 0;
|
|
12
|
+
left: 50%;
|
|
13
|
+
transform: translate(-50%, -50%);
|
|
14
|
+
width: calc(100% - 40px);
|
|
15
|
+
height: 1px;
|
|
16
|
+
background: #F1F1F1;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&:last-child {
|
|
20
|
+
&::before {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.product-item-card-preview-cover {
|
|
26
|
+
width: 40px;
|
|
27
|
+
height: 40px;
|
|
28
|
+
border-radius: 8px;
|
|
29
|
+
object-fit: cover;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.product-item-card-preview-content {
|
|
33
|
+
flex: 1;
|
|
34
|
+
|
|
35
|
+
.product-item-card-preview-title {
|
|
36
|
+
color: var(--text-text-1, #1B1B1B);
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 600;
|
|
42
|
+
line-height: 20px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.product-item-card-preview-close-wrap {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: center;
|
|
51
|
+
width: 40px;
|
|
52
|
+
height: 40px;
|
|
53
|
+
cursor: pointer;
|
|
54
|
+
|
|
55
|
+
.product-item-card-close {
|
|
56
|
+
font-size: 30px;
|
|
57
|
+
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
}
|
|
@@ -37,6 +37,7 @@ var import_ahooks = require("ahooks");
|
|
|
37
37
|
var import_selectModal = __toESM(require("../../../selectModal"));
|
|
38
38
|
var import_server = require("./server");
|
|
39
39
|
var import_ProductItem = __toESM(require("./ProductItem"));
|
|
40
|
+
var import_ProductItemPreview = __toESM(require("./ProductItemPreview"));
|
|
40
41
|
var import_index = require("./index.less");
|
|
41
42
|
var import_utils = require("@pisell/utils");
|
|
42
43
|
var SelectProducts = ({ value, onChange }) => {
|
|
@@ -62,9 +63,15 @@ var SelectProducts = ({ value, onChange }) => {
|
|
|
62
63
|
skip: 1,
|
|
63
64
|
num: 500,
|
|
64
65
|
with: ["category"],
|
|
65
|
-
open_quotation: 1
|
|
66
|
+
open_quotation: 1,
|
|
67
|
+
exclude_extension_type: ["event_item"]
|
|
66
68
|
});
|
|
67
69
|
}, []);
|
|
70
|
+
const onRemove = (item) => {
|
|
71
|
+
onChange == null ? void 0 : onChange(
|
|
72
|
+
(value || []).filter((d) => (d.id || d.product_id) !== item.id)
|
|
73
|
+
);
|
|
74
|
+
};
|
|
68
75
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
69
76
|
import_selectModal.default,
|
|
70
77
|
{
|
|
@@ -83,7 +90,15 @@ var SelectProducts = ({ value, onChange }) => {
|
|
|
83
90
|
},
|
|
84
91
|
dataSource: _getProductList.data,
|
|
85
92
|
renderValueItem: (item, onSelect) => {
|
|
86
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
93
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
94
|
+
import_ProductItemPreview.default,
|
|
95
|
+
{
|
|
96
|
+
key: item == null ? void 0 : item.id,
|
|
97
|
+
item,
|
|
98
|
+
onClick: onSelect,
|
|
99
|
+
onRemove
|
|
100
|
+
}
|
|
101
|
+
);
|
|
87
102
|
},
|
|
88
103
|
renderOptionItem: (item, onSelect) => {
|
|
89
104
|
return /* @__PURE__ */ import_react.default.createElement(import_ProductItem.default, { key: item == null ? void 0 : item.id, item, onClick: onSelect });
|
|
@@ -111,25 +111,24 @@ var SelectResourcesTable = ({ value, onChange }) => {
|
|
|
111
111
|
data,
|
|
112
112
|
width: 100
|
|
113
113
|
},
|
|
114
|
-
{
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
},
|
|
114
|
+
// {
|
|
115
|
+
// title: locales.getText("pisell2.text.product-extension.open"),
|
|
116
|
+
// dataIndex: "open",
|
|
117
|
+
// width: 80,
|
|
118
|
+
// render: (text: any, record: any, index: number) => {
|
|
119
|
+
// let cur = value?.find((d: any) => d.form_id === record.form_id);
|
|
120
|
+
// let bol = !!(cur?.form_record_ids || []).length;
|
|
121
|
+
// return (
|
|
122
|
+
// <Switch
|
|
123
|
+
// disabled={!bol}
|
|
124
|
+
// checked={bol}
|
|
125
|
+
// onChange={(e) => {
|
|
126
|
+
// _onChange([], record.id);
|
|
127
|
+
// }}
|
|
128
|
+
// />
|
|
129
|
+
// );
|
|
130
|
+
// },
|
|
131
|
+
// },
|
|
133
132
|
{
|
|
134
133
|
title: import_utils.locales.getText("pisell2.text.product-extension.options"),
|
|
135
134
|
dataIndex: "form_id",
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
2
3
|
import dayjs from "dayjs";
|
|
3
4
|
export interface FormState {
|
|
@@ -68,7 +69,7 @@ export interface FormState {
|
|
|
68
69
|
};
|
|
69
70
|
setGlobalState: Function | null;
|
|
70
71
|
}
|
|
71
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
72
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
|
|
72
73
|
state: FormState;
|
|
73
74
|
} & {
|
|
74
75
|
dispatch: (params: {
|