@pisell/private-materials 3.0.13 → 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 +8 -8
- 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/addButton/index.d.ts +8 -8
- package/es/components/booking/components/addButton/index.js +1 -1
- package/es/components/booking/components/drawer/index.d.ts +1 -1
- package/es/components/booking/components/footer/FooterMenus/index.js +1 -1
- package/es/components/booking/components/footer/index.js +25 -23
- package/es/components/booking/components/footer/utils.js +4 -3
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/forms.js +2 -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/client/index.js +0 -1
- package/es/components/booking/info/date/index.less +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/index.js +23 -9
- 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/pet/index.js +5 -7
- package/es/components/booking/info/service/addService/index.js +74 -15
- package/es/components/booking/info/service/editService/index.js +8 -7
- package/es/components/booking/info/service/index.js +1 -1
- package/es/components/booking/info/service/index.less +3 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +3 -0
- package/es/components/booking/model.d.ts +13 -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/booking/utils.js +2 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/productExtension/card/index.d.ts +10 -0
- package/es/components/productExtension/card/index.js +20 -0
- package/es/components/productExtension/card/index.less +34 -0
- package/es/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
- package/es/components/productExtension/fields/Actor/Container/index.js +34 -0
- package/es/components/productExtension/fields/Actor/Container/index.less +19 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +94 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
- package/es/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +5 -0
- package/es/components/productExtension/fields/Actor/index.js +23 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +10 -0
- package/es/components/productExtension/fields/Forms/index.js +184 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +30 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
- 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.d.ts +10 -0
- package/es/components/productExtension/fields/SelectProducts/index.js +99 -0
- package/es/components/productExtension/fields/SelectProducts/index.less +30 -0
- package/es/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
- package/es/components/productExtension/fields/SelectProducts/mock.js +0 -0
- package/es/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/server.js +29 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.js +200 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
- package/es/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
- package/es/components/productExtension/fields/SelectResourcesTable/mock.js +5072 -0
- package/es/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +49 -0
- package/es/components/productExtension/fields/index.d.ts +1 -0
- package/es/components/productExtension/fields/index.js +33 -0
- package/es/components/productExtension/index.d.ts +7 -0
- package/es/components/productExtension/index.js +78 -0
- package/es/components/productExtension/index.less +0 -0
- package/es/components/productExtension/locales.d.ts +48 -0
- package/es/components/productExtension/locales.js +47 -0
- package/es/components/productExtension/server.d.ts +1 -0
- package/es/components/productExtension/server.js +29 -0
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +21 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +20 -5
- package/es/components/selectModal/index.d.ts +24 -0
- package/es/components/selectModal/index.js +108 -0
- package/es/components/selectModal/index.less +0 -0
- package/es/components/tabProduct/card/index.d.ts +2 -2
- package/es/components/tabProduct/card/index.js +3 -4
- package/es/components/tabProduct/index.d.ts +4 -2
- package/es/components/tabProduct/index.js +10 -9
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/utils/index.d.ts +22 -0
- package/es/utils/index.js +56 -0
- 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/addButton/index.d.ts +8 -8
- package/lib/components/booking/components/addButton/index.js +1 -1
- package/lib/components/booking/components/drawer/index.d.ts +1 -1
- package/lib/components/booking/components/footer/FooterMenus/index.js +1 -1
- package/lib/components/booking/components/footer/index.js +5 -3
- package/lib/components/booking/components/footer/utils.js +4 -2
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/forms.js +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/client/index.js +0 -1
- package/lib/components/booking/info/date/index.less +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/index.js +27 -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/pet/index.js +5 -7
- package/lib/components/booking/info/service/addService/index.js +65 -10
- package/lib/components/booking/info/service/editService/index.js +7 -5
- package/lib/components/booking/info/service/index.js +1 -1
- package/lib/components/booking/info/service/index.less +3 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +3 -0
- package/lib/components/booking/model.d.ts +13 -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/booking/utils.js +2 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/productExtension/card/index.d.ts +10 -0
- package/lib/components/productExtension/card/index.js +57 -0
- package/lib/components/productExtension/card/index.less +34 -0
- package/lib/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
- package/lib/components/productExtension/fields/Actor/Container/index.js +64 -0
- package/lib/components/productExtension/fields/Actor/Container/index.less +19 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/index.js +128 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
- package/lib/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +5 -0
- package/lib/components/productExtension/fields/Actor/index.js +56 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +10 -0
- package/lib/components/productExtension/fields/Forms/index.js +108 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +65 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
- 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.d.ts +10 -0
- package/lib/components/productExtension/fields/SelectProducts/index.js +126 -0
- package/lib/components/productExtension/fields/SelectProducts/index.less +30 -0
- package/lib/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
- package/lib/components/productExtension/fields/SelectProducts/mock.js +0 -0
- package/lib/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/server.js +33 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.js +178 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/mock.js +12723 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/server.js +39 -0
- package/lib/components/productExtension/fields/index.d.ts +1 -0
- package/lib/components/productExtension/fields/index.js +69 -0
- package/lib/components/productExtension/index.d.ts +7 -0
- package/lib/components/productExtension/index.js +109 -0
- package/lib/components/productExtension/index.less +0 -0
- package/lib/components/productExtension/locales.d.ts +48 -0
- package/lib/components/productExtension/locales.js +71 -0
- package/lib/components/productExtension/server.d.ts +1 -0
- package/lib/components/productExtension/server.js +33 -0
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +11 -6
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +18 -4
- package/lib/components/selectModal/index.d.ts +24 -0
- package/lib/components/selectModal/index.js +133 -0
- package/lib/components/selectModal/index.less +0 -0
- package/lib/components/tabProduct/card/index.d.ts +2 -2
- package/lib/components/tabProduct/card/index.js +1 -2
- package/lib/components/tabProduct/index.d.ts +4 -2
- package/lib/components/tabProduct/index.js +7 -8
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/utils/index.d.ts +22 -0
- package/lib/utils/index.js +59 -0
- package/lowcode/product-extension/meta.ts +120 -0
- package/package.json +3 -3
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "./index.less";
|
|
3
|
+
interface valueType {
|
|
4
|
+
}
|
|
5
|
+
interface SelectProductsProps {
|
|
6
|
+
value?: valueType[];
|
|
7
|
+
onChange?: (value: valueType[]) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const SelectProducts: ({ value, onChange }: SelectProductsProps) => React.JSX.Element;
|
|
10
|
+
export default SelectProducts;
|
|
@@ -0,0 +1,126 @@
|
|
|
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/index.tsx
|
|
30
|
+
var SelectProducts_exports = {};
|
|
31
|
+
__export(SelectProducts_exports, {
|
|
32
|
+
default: () => SelectProducts_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SelectProducts_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_ahooks = require("ahooks");
|
|
37
|
+
var import_selectModal = __toESM(require("../../../selectModal"));
|
|
38
|
+
var import_server = require("./server");
|
|
39
|
+
var import_ProductItem = __toESM(require("./ProductItem"));
|
|
40
|
+
var import_ProductItemPreview = __toESM(require("./ProductItemPreview"));
|
|
41
|
+
var import_index = require("./index.less");
|
|
42
|
+
var import_utils = require("@pisell/utils");
|
|
43
|
+
var SelectProducts = ({ value, onChange }) => {
|
|
44
|
+
const [listMap, setListMap] = (0, import_react.useState)({});
|
|
45
|
+
const _getProductList = (0, import_ahooks.useRequest)(import_server.getProductList, {
|
|
46
|
+
manual: true,
|
|
47
|
+
onSuccess: (res) => {
|
|
48
|
+
let obj = {};
|
|
49
|
+
res.forEach((d) => {
|
|
50
|
+
obj[d.id] = d;
|
|
51
|
+
});
|
|
52
|
+
setListMap(obj);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
const _value = (0, import_react.useMemo)(() => {
|
|
56
|
+
if (value && value.length) {
|
|
57
|
+
return value.map((d) => listMap[d.product_id] || d);
|
|
58
|
+
}
|
|
59
|
+
return value;
|
|
60
|
+
}, [value, listMap]);
|
|
61
|
+
(0, import_react.useEffect)(() => {
|
|
62
|
+
_getProductList.run({
|
|
63
|
+
skip: 1,
|
|
64
|
+
num: 500,
|
|
65
|
+
with: ["category"],
|
|
66
|
+
open_quotation: 1,
|
|
67
|
+
exclude_extension_type: ["event_item"]
|
|
68
|
+
});
|
|
69
|
+
}, []);
|
|
70
|
+
const onRemove = (item) => {
|
|
71
|
+
onChange == null ? void 0 : onChange(
|
|
72
|
+
(value || []).filter((d) => (d.id || d.product_id) !== item.id)
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
76
|
+
import_selectModal.default,
|
|
77
|
+
{
|
|
78
|
+
value: _value,
|
|
79
|
+
loading: _getProductList.loading,
|
|
80
|
+
onChange: (arr) => {
|
|
81
|
+
onChange == null ? void 0 : onChange(
|
|
82
|
+
arr.map((d) => {
|
|
83
|
+
return {
|
|
84
|
+
product_collection_id: 0,
|
|
85
|
+
product_id: d.id || d.product_id,
|
|
86
|
+
product_variant_id: 0
|
|
87
|
+
};
|
|
88
|
+
})
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
dataSource: _getProductList.data,
|
|
92
|
+
renderValueItem: (item, onSelect) => {
|
|
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
|
+
);
|
|
102
|
+
},
|
|
103
|
+
renderOptionItem: (item, onSelect) => {
|
|
104
|
+
return /* @__PURE__ */ import_react.default.createElement(import_ProductItem.default, { key: item == null ? void 0 : item.id, item, onClick: onSelect });
|
|
105
|
+
},
|
|
106
|
+
buttonProps: {
|
|
107
|
+
showSub: !!(value == null ? void 0 : value.length),
|
|
108
|
+
title: import_utils.locales.getText("pisell2.text.product-extension.add-product"),
|
|
109
|
+
subTitle: import_utils.locales.getText(
|
|
110
|
+
"pisell2.text.product-extension.add-other-product"
|
|
111
|
+
)
|
|
112
|
+
},
|
|
113
|
+
drawerProps: {
|
|
114
|
+
width: 500,
|
|
115
|
+
title: import_utils.locales.getText("pisell2.text.product-extension.add-product"),
|
|
116
|
+
rootClassName: "select-product-drawer"
|
|
117
|
+
},
|
|
118
|
+
tabProductProps: {
|
|
119
|
+
warpClassName: "select-product-warp",
|
|
120
|
+
stickyTop: 188,
|
|
121
|
+
scrollDom: ".select-product-drawer .pisell-lowcode-drawer-body"
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
};
|
|
126
|
+
var SelectProducts_default = SelectProducts;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
.select-product-warp {
|
|
2
|
+
.category-list {
|
|
3
|
+
width: 100%;
|
|
4
|
+
height: 100%;
|
|
5
|
+
padding: 0 32px;
|
|
6
|
+
|
|
7
|
+
.category-title {
|
|
8
|
+
margin: 16px 0;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
font-size: 18px;
|
|
12
|
+
line-height: 24px;
|
|
13
|
+
color: #1b1b1b;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.product-list {
|
|
17
|
+
width: 100%;
|
|
18
|
+
background: #ffffff;
|
|
19
|
+
border-radius: 4px;
|
|
20
|
+
padding: 20px;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
margin-bottom: 20px;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
background: #ffffff;
|
|
25
|
+
/* shadow-sm */
|
|
26
|
+
box-shadow: 0px 1px 3px rgba(0, 0, 0, 0.1), 0px 1px 2px rgba(0, 0, 0, 0.06);
|
|
27
|
+
border-radius: 12px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getProductList: (params: any) => Promise<any>;
|
|
@@ -0,0 +1,33 @@
|
|
|
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/productExtension/fields/SelectProducts/server.ts
|
|
20
|
+
var server_exports = {};
|
|
21
|
+
__export(server_exports, {
|
|
22
|
+
getProductList: () => getProductList
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(server_exports);
|
|
25
|
+
var import_utils = require("../../../../utils/index");
|
|
26
|
+
var getProductList = async (params) => {
|
|
27
|
+
let { data } = await import_utils.request.getRequest().post("/shop/product/query", params, { abort: true });
|
|
28
|
+
return (data == null ? void 0 : data.list) || [];
|
|
29
|
+
};
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
getProductList
|
|
33
|
+
});
|
|
@@ -0,0 +1,178 @@
|
|
|
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/SelectResourcesTable/index.tsx
|
|
30
|
+
var SelectResourcesTable_exports = {};
|
|
31
|
+
__export(SelectResourcesTable_exports, {
|
|
32
|
+
default: () => SelectResourcesTable_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SelectResourcesTable_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_server = require("./server");
|
|
39
|
+
var import_index = require("./index.less");
|
|
40
|
+
var sortArrayByOrder = (arr1, arr2, reverse) => {
|
|
41
|
+
return (arr1 || []).sort((a, b) => {
|
|
42
|
+
let _a = arr2.findIndex((item) => item.form_id === a.form_id);
|
|
43
|
+
let _b = arr2.findIndex((item) => item.form_id === b.form_id);
|
|
44
|
+
return reverse ? _a - _b : _b - _a;
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
var SelectResourcesTable = ({ value, onChange }) => {
|
|
48
|
+
const Dom = window.BaseMaterials.Table;
|
|
49
|
+
const [data, setData] = (0, import_react.useState)([]);
|
|
50
|
+
const _getData = async () => {
|
|
51
|
+
let _getFormTypes = (0, import_server.getFormTypes)(
|
|
52
|
+
{ type: "manual", num: 500, skip: 1 },
|
|
53
|
+
{ useCache: true }
|
|
54
|
+
);
|
|
55
|
+
let _getAllResource = (0, import_server.getAllResource)(
|
|
56
|
+
{ num: 500, skip: 1 },
|
|
57
|
+
{ useCache: true }
|
|
58
|
+
);
|
|
59
|
+
const [forms, resources] = await Promise.all([
|
|
60
|
+
_getFormTypes,
|
|
61
|
+
_getAllResource
|
|
62
|
+
]);
|
|
63
|
+
let _data = (forms || []).reduce((arr, item) => {
|
|
64
|
+
const currentResource = (resources || []).filter(
|
|
65
|
+
(relation) => relation.form_id === item.id
|
|
66
|
+
);
|
|
67
|
+
if (currentResource.length > 0) {
|
|
68
|
+
arr.push({
|
|
69
|
+
label: item.title,
|
|
70
|
+
key: item.id,
|
|
71
|
+
value: item.id,
|
|
72
|
+
options: currentResource,
|
|
73
|
+
// 统一字段,方便后面处理
|
|
74
|
+
...item,
|
|
75
|
+
form_id: item.id
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return arr;
|
|
79
|
+
}, []);
|
|
80
|
+
setData(_data);
|
|
81
|
+
};
|
|
82
|
+
const _dataSource = (0, import_react.useMemo)(() => {
|
|
83
|
+
if (value) {
|
|
84
|
+
return (data || []).sort((a, b) => {
|
|
85
|
+
let _a = value.findIndex((item) => item.form_id === a.form_id);
|
|
86
|
+
let _b = value.findIndex((item) => item.form_id === b.form_id);
|
|
87
|
+
if (_a === -1 || _b === -1) {
|
|
88
|
+
return 999;
|
|
89
|
+
}
|
|
90
|
+
return _a - _b;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
return data;
|
|
94
|
+
}, [data, value]);
|
|
95
|
+
const _onChange = (val, form_id) => {
|
|
96
|
+
let _value = JSON.parse(JSON.stringify(value || []));
|
|
97
|
+
let cur = _value.find((d) => d.form_id === form_id);
|
|
98
|
+
if (cur) {
|
|
99
|
+
cur.form_record_ids = val;
|
|
100
|
+
} else {
|
|
101
|
+
_value.push({ form_id, form_record_ids: val });
|
|
102
|
+
}
|
|
103
|
+
onChange == null ? void 0 : onChange(_value);
|
|
104
|
+
};
|
|
105
|
+
const columns = (0, import_react.useMemo)(() => {
|
|
106
|
+
return [
|
|
107
|
+
{
|
|
108
|
+
title: import_utils.locales.getText("pisell2.text.product-extension.resource-type"),
|
|
109
|
+
dataIndex: "title",
|
|
110
|
+
value,
|
|
111
|
+
data,
|
|
112
|
+
width: 100
|
|
113
|
+
},
|
|
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
|
+
// },
|
|
132
|
+
{
|
|
133
|
+
title: import_utils.locales.getText("pisell2.text.product-extension.options"),
|
|
134
|
+
dataIndex: "form_id",
|
|
135
|
+
render: (form_id, record, index) => {
|
|
136
|
+
let cur = value == null ? void 0 : value.find((d) => d.form_id === form_id);
|
|
137
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
138
|
+
import_antd.Select,
|
|
139
|
+
{
|
|
140
|
+
style: { width: "100%" },
|
|
141
|
+
mode: "multiple",
|
|
142
|
+
value: (cur == null ? void 0 : cur.form_record_ids) || [],
|
|
143
|
+
options: record.options,
|
|
144
|
+
popupMatchSelectWidth: false,
|
|
145
|
+
fieldNames: { label: "title", value: "id" },
|
|
146
|
+
onChange: (val) => {
|
|
147
|
+
_onChange(val, form_id);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
];
|
|
154
|
+
}, [value, _dataSource]);
|
|
155
|
+
const sortChange = (detail) => {
|
|
156
|
+
if (value && value.length) {
|
|
157
|
+
onChange == null ? void 0 : onChange(sortArrayByOrder(value, detail.dataSource));
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
(0, import_react.useEffect)(() => {
|
|
161
|
+
_getData();
|
|
162
|
+
}, []);
|
|
163
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
164
|
+
Dom,
|
|
165
|
+
{
|
|
166
|
+
className: "",
|
|
167
|
+
dragSort: true,
|
|
168
|
+
onSortChange: sortChange,
|
|
169
|
+
rowKey: "form_id",
|
|
170
|
+
columns,
|
|
171
|
+
dataSource: _dataSource,
|
|
172
|
+
pagination: false,
|
|
173
|
+
virtual: false,
|
|
174
|
+
scroll: { x: "auto" }
|
|
175
|
+
}
|
|
176
|
+
);
|
|
177
|
+
};
|
|
178
|
+
var SelectResourcesTable_default = SelectResourcesTable;
|
|
File without changes
|