sa2kit 1.6.47 → 1.6.49
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/dist/{chunk-Z3G3IXEF.js → chunk-7JN25DJB.js} +19 -13
- package/dist/chunk-7JN25DJB.js.map +1 -0
- package/dist/{chunk-EONPKLEJ.mjs → chunk-GFVAIT6Y.mjs} +24 -53
- package/dist/chunk-GFVAIT6Y.mjs.map +1 -0
- package/dist/{chunk-3TNR6IMC.js → chunk-IZOIVYOW.js} +23 -53
- package/dist/chunk-IZOIVYOW.js.map +1 -0
- package/dist/{chunk-VBQFVXOW.mjs → chunk-SHY424RZ.mjs} +11 -5
- package/dist/chunk-SHY424RZ.mjs.map +1 -0
- package/dist/showmasterpiece/index.d.mts +20 -5
- package/dist/showmasterpiece/index.d.ts +20 -5
- package/dist/showmasterpiece/index.js +42 -29
- package/dist/showmasterpiece/index.js.map +1 -1
- package/dist/showmasterpiece/index.mjs +33 -20
- package/dist/showmasterpiece/index.mjs.map +1 -1
- package/dist/showmasterpiece/migration/index.js +29 -29
- package/dist/showmasterpiece/migration/index.mjs +2 -2
- package/dist/showmasterpiece/server/index.d.mts +8 -2
- package/dist/showmasterpiece/server/index.d.ts +8 -2
- package/dist/showmasterpiece/server/index.js +43 -43
- package/dist/showmasterpiece/server/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-3TNR6IMC.js.map +0 -1
- package/dist/chunk-EONPKLEJ.mjs.map +0 -1
- package/dist/chunk-VBQFVXOW.mjs.map +0 -1
- package/dist/chunk-Z3G3IXEF.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeHomeTabConfig, getCategoryDisplayName,
|
|
1
|
+
import { normalizeHomeTabConfig, getCategoryDisplayName, buildDefaultHomeTabConfig } from '../chunk-GFVAIT6Y.mjs';
|
|
2
2
|
import { UniversalExportClient, UniversalExportButton } from '../chunk-TGNUEULF.mjs';
|
|
3
3
|
import '../chunk-LFB5EIIM.mjs';
|
|
4
4
|
import { Card, Badge, CardContent, Button, GenericOrderManager, Modal, CardHeader, CardTitle, CardDescription, Tabs, TabsList, TabsTrigger, TabsContent, Label, Input, Textarea, Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '../chunk-3JW4X3AC.mjs';
|
|
@@ -162,7 +162,7 @@ var init_masterpiecesService = __esm({
|
|
|
162
162
|
* 从后端API获取所有已定义的画集分类列表。
|
|
163
163
|
* 用于构建分类筛选器和下拉菜单。
|
|
164
164
|
*
|
|
165
|
-
* @returns Promise<string
|
|
165
|
+
* @returns Promise<Array<{ name: string; description?: string | null }>> 分类名称数组
|
|
166
166
|
* @throws {Error} 当API请求失败时抛出错误
|
|
167
167
|
*
|
|
168
168
|
* @example
|
|
@@ -176,7 +176,8 @@ var init_masterpiecesService = __esm({
|
|
|
176
176
|
if (!response.ok) {
|
|
177
177
|
throw new Error("\u83B7\u53D6\u5206\u7C7B\u5931\u8D25");
|
|
178
178
|
}
|
|
179
|
-
|
|
179
|
+
const payload = await response.json();
|
|
180
|
+
return Array.isArray(payload) ? payload : payload?.data ?? [];
|
|
180
181
|
}
|
|
181
182
|
/**
|
|
182
183
|
* 获取所有可用标签
|
|
@@ -8524,7 +8525,7 @@ function ShowMasterPiecesContent() {
|
|
|
8524
8525
|
const userId = user?.id || 1;
|
|
8525
8526
|
const categoryList = visibleHomeTabs.map((tab) => ({
|
|
8526
8527
|
category: tab.category,
|
|
8527
|
-
displayName: getCategoryDisplayName(tab.category)
|
|
8528
|
+
displayName: tab.description || tab.name || getCategoryDisplayName(tab.category)
|
|
8528
8529
|
}));
|
|
8529
8530
|
return /* @__PURE__ */ React30.createElement(CartProvider, { userId }, /* @__PURE__ */ React30.createElement("div", { className: "min-h-screen bg-gradient-to-br from-white to-prussian-blue-900/5 overflow-x-hidden" }, /* @__PURE__ */ React30.createElement("div", { className: "bg-white/95 backdrop-blur supports-[backdrop-filter]:bg-white/80 border-b border-prussian-blue-200/30 sticky top-0 z-50" }, /* @__PURE__ */ React30.createElement("div", { className: "max-w-7xl mx-auto px-3 sm:px-4 py-3 sm:py-4" }, /* @__PURE__ */ React30.createElement("div", { className: "flex items-center justify-between gap-2 sm:gap-4 min-h-[44px]" }, /* @__PURE__ */ React30.createElement("div", { className: "flex items-center gap-4 sm:gap-8 min-w-0 flex-1" }, selectedCollection && /* @__PURE__ */ React30.createElement(
|
|
8530
8531
|
Button,
|
|
@@ -8655,6 +8656,7 @@ function ConfigPageContent() {
|
|
|
8655
8656
|
const [showArtworkOrder, setShowArtworkOrder] = useState(false);
|
|
8656
8657
|
const [showCollectionOrder, setShowCollectionOrder] = useState(false);
|
|
8657
8658
|
const [newHomeTabCategory, setNewHomeTabCategory] = useState("");
|
|
8659
|
+
const [newHomeTabDescription, setNewHomeTabDescription] = useState("");
|
|
8658
8660
|
const [categoryOptions, setCategoryOptions] = useState([]);
|
|
8659
8661
|
const {
|
|
8660
8662
|
bookings,
|
|
@@ -8739,13 +8741,7 @@ function ConfigPageContent() {
|
|
|
8739
8741
|
}
|
|
8740
8742
|
}, [config]);
|
|
8741
8743
|
React30.useEffect(() => {
|
|
8742
|
-
|
|
8743
|
-
/* @__PURE__ */ new Set([
|
|
8744
|
-
...getAvailableCategories(),
|
|
8745
|
-
...categories
|
|
8746
|
-
])
|
|
8747
|
-
);
|
|
8748
|
-
setCategoryOptions(merged);
|
|
8744
|
+
setCategoryOptions(categories);
|
|
8749
8745
|
}, [categories]);
|
|
8750
8746
|
const handleHomeTabMove = (index, direction) => {
|
|
8751
8747
|
setConfigForm((prev) => {
|
|
@@ -8782,6 +8778,7 @@ function ConfigPageContent() {
|
|
|
8782
8778
|
homeTabConfig: buildDefaultHomeTabConfig()
|
|
8783
8779
|
}));
|
|
8784
8780
|
setNewHomeTabCategory("");
|
|
8781
|
+
setNewHomeTabDescription("");
|
|
8785
8782
|
};
|
|
8786
8783
|
const handleSetAllHomeTabsVisible = (visible) => {
|
|
8787
8784
|
setConfigForm((prev) => {
|
|
@@ -8794,6 +8791,7 @@ function ConfigPageContent() {
|
|
|
8794
8791
|
};
|
|
8795
8792
|
const handleAddHomeTab = async () => {
|
|
8796
8793
|
const trimmed = newHomeTabCategory.trim();
|
|
8794
|
+
const trimmedDescription = newHomeTabDescription.trim();
|
|
8797
8795
|
if (!trimmed) {
|
|
8798
8796
|
alert("\u5206\u7C7B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");
|
|
8799
8797
|
setNewHomeTabCategory("");
|
|
@@ -8807,18 +8805,25 @@ function ConfigPageContent() {
|
|
|
8807
8805
|
setNewHomeTabCategory("");
|
|
8808
8806
|
return;
|
|
8809
8807
|
}
|
|
8810
|
-
const
|
|
8811
|
-
(category) => category.toLowerCase() === trimmed.toLowerCase()
|
|
8808
|
+
const existingCategory = categoryOptions.find(
|
|
8809
|
+
(category) => category.name.toLowerCase() === trimmed.toLowerCase()
|
|
8812
8810
|
);
|
|
8811
|
+
const description = trimmedDescription || existingCategory?.description || "";
|
|
8812
|
+
if (!description) {
|
|
8813
|
+
alert("\u5C55\u793A\u6587\u6848\u4E0D\u80FD\u4E3A\u7A7A");
|
|
8814
|
+
return;
|
|
8815
|
+
}
|
|
8813
8816
|
try {
|
|
8814
|
-
if (!
|
|
8815
|
-
await createCategory(trimmed);
|
|
8816
|
-
setCategoryOptions((prev) => [...prev, trimmed]);
|
|
8817
|
+
if (!existingCategory) {
|
|
8818
|
+
await createCategory(trimmed, description);
|
|
8819
|
+
setCategoryOptions((prev) => [...prev, { name: trimmed, description }]);
|
|
8817
8820
|
}
|
|
8818
8821
|
setConfigForm((prev) => {
|
|
8819
8822
|
const updated = [
|
|
8820
8823
|
...prev.homeTabConfig,
|
|
8821
8824
|
{
|
|
8825
|
+
name: trimmed,
|
|
8826
|
+
description,
|
|
8822
8827
|
category: trimmed,
|
|
8823
8828
|
visible: true,
|
|
8824
8829
|
order: prev.homeTabConfig.length
|
|
@@ -8827,6 +8832,7 @@ function ConfigPageContent() {
|
|
|
8827
8832
|
return { ...prev, homeTabConfig: normalizeHomeTabConfig(updated) };
|
|
8828
8833
|
});
|
|
8829
8834
|
setNewHomeTabCategory("");
|
|
8835
|
+
setNewHomeTabDescription("");
|
|
8830
8836
|
} catch (error2) {
|
|
8831
8837
|
console.error("\u65B0\u589E\u5206\u7C7B\u5931\u8D25:", error2);
|
|
8832
8838
|
alert(error2 instanceof Error ? error2.message : "\u65B0\u589E\u5206\u7C7B\u5931\u8D25");
|
|
@@ -9131,12 +9137,19 @@ function ConfigPageContent() {
|
|
|
9131
9137
|
onChange: (e) => setConfigForm((prev) => ({ ...prev, enableCategories: e.target.checked })),
|
|
9132
9138
|
className: "h-4 w-4 rounded border-gray-300"
|
|
9133
9139
|
}
|
|
9134
|
-
), /* @__PURE__ */ React30.createElement(Label, { htmlFor: "enableCategories", className: "text-sm font-medium" }, "\u542F\u7528\u5206\u7C7B\u529F\u80FD")))))), /* @__PURE__ */ React30.createElement(TabsContent, { value: "homeTabs", className: "space-y-6" }, /* @__PURE__ */ React30.createElement(Card, null, /* @__PURE__ */ React30.createElement(CardHeader, null, /* @__PURE__ */ React30.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React30.createElement("div", null, /* @__PURE__ */ React30.createElement(CardTitle, null, "\u9996\u9875\u5206\u7C7BTab\u914D\u7F6E"), /* @__PURE__ */ React30.createElement(CardDescription, null, "\u7BA1\u7406\u9996\u9875\u5206\u7C7BTab\u7684\u663E\u793A\u987A\u5E8F\u4E0E\u663E\u793A/\u9690\u85CF")), /* @__PURE__ */ React30.createElement("div", { className: "flex gap-3" }, /* @__PURE__ */ React30.createElement(Button, { variant: "outline", onClick: () => handleSetAllHomeTabsVisible(true) }, "\u5168\u90E8\u663E\u793A"), /* @__PURE__ */ React30.createElement(Button, { variant: "outline", onClick: () => handleSetAllHomeTabsVisible(false) }, "\u5168\u90E8\u9690\u85CF"), /* @__PURE__ */ React30.createElement(Button, { variant: "outline", onClick: handleResetHomeTabs, className: "gap-2" }, /* @__PURE__ */ React30.createElement(RotateCcw, { size: 16 }), "\u91CD\u7F6E\u987A\u5E8F"), /* @__PURE__ */ React30.createElement(Button, { onClick: handleSaveConfig, className: "gap-2" }, /* @__PURE__ */ React30.createElement(Save, { size: 16 }), "\u4FDD\u5B58\u914D\u7F6E")))), /* @__PURE__ */ React30.createElement(CardContent, null, /* @__PURE__ */ React30.createElement("div", { className: "flex flex-col lg:flex-row lg:items-end gap-3 mb-4" }, /* @__PURE__ */ React30.createElement("div", { className: "flex-1 space-y-2" }, /* @__PURE__ */ React30.createElement(Label, null, "\
|
|
9140
|
+
), /* @__PURE__ */ React30.createElement(Label, { htmlFor: "enableCategories", className: "text-sm font-medium" }, "\u542F\u7528\u5206\u7C7B\u529F\u80FD")))))), /* @__PURE__ */ React30.createElement(TabsContent, { value: "homeTabs", className: "space-y-6" }, /* @__PURE__ */ React30.createElement(Card, null, /* @__PURE__ */ React30.createElement(CardHeader, null, /* @__PURE__ */ React30.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React30.createElement("div", null, /* @__PURE__ */ React30.createElement(CardTitle, null, "\u9996\u9875\u5206\u7C7BTab\u914D\u7F6E"), /* @__PURE__ */ React30.createElement(CardDescription, null, "\u7BA1\u7406\u9996\u9875\u5206\u7C7BTab\u7684\u663E\u793A\u987A\u5E8F\u4E0E\u663E\u793A/\u9690\u85CF")), /* @__PURE__ */ React30.createElement("div", { className: "flex gap-3" }, /* @__PURE__ */ React30.createElement(Button, { variant: "outline", onClick: () => handleSetAllHomeTabsVisible(true) }, "\u5168\u90E8\u663E\u793A"), /* @__PURE__ */ React30.createElement(Button, { variant: "outline", onClick: () => handleSetAllHomeTabsVisible(false) }, "\u5168\u90E8\u9690\u85CF"), /* @__PURE__ */ React30.createElement(Button, { variant: "outline", onClick: handleResetHomeTabs, className: "gap-2" }, /* @__PURE__ */ React30.createElement(RotateCcw, { size: 16 }), "\u91CD\u7F6E\u987A\u5E8F"), /* @__PURE__ */ React30.createElement(Button, { onClick: handleSaveConfig, className: "gap-2" }, /* @__PURE__ */ React30.createElement(Save, { size: 16 }), "\u4FDD\u5B58\u914D\u7F6E")))), /* @__PURE__ */ React30.createElement(CardContent, null, /* @__PURE__ */ React30.createElement("div", { className: "flex flex-col lg:flex-row lg:items-end gap-3 mb-4" }, /* @__PURE__ */ React30.createElement("div", { className: "flex-1 space-y-2" }, /* @__PURE__ */ React30.createElement(Label, null, "\u5206\u7C7B\u540D\u79F0"), /* @__PURE__ */ React30.createElement(
|
|
9135
9141
|
Input,
|
|
9136
9142
|
{
|
|
9137
9143
|
value: newHomeTabCategory,
|
|
9138
9144
|
onChange: (e) => setNewHomeTabCategory(e.target.value),
|
|
9139
|
-
placeholder: "\u8F93\u5165\
|
|
9145
|
+
placeholder: "\u8F93\u5165\u5206\u7C7B\u540D\u79F0"
|
|
9146
|
+
}
|
|
9147
|
+
), /* @__PURE__ */ React30.createElement(Label, null, "\u5C55\u793A\u6587\u6848"), /* @__PURE__ */ React30.createElement(
|
|
9148
|
+
Input,
|
|
9149
|
+
{
|
|
9150
|
+
value: newHomeTabDescription,
|
|
9151
|
+
onChange: (e) => setNewHomeTabDescription(e.target.value),
|
|
9152
|
+
placeholder: "\u8F93\u5165\u5C55\u793A\u6587\u6848"
|
|
9140
9153
|
}
|
|
9141
9154
|
)), /* @__PURE__ */ React30.createElement(Button, { onClick: handleAddHomeTab, className: "gap-2" }, /* @__PURE__ */ React30.createElement(Plus, { size: 16 }), "\u65B0\u589ETab")), /* @__PURE__ */ React30.createElement("div", { className: "space-y-2" }, configForm.homeTabConfig.map((item, index) => /* @__PURE__ */ React30.createElement(
|
|
9142
9155
|
"div",
|
|
@@ -9144,7 +9157,7 @@ function ConfigPageContent() {
|
|
|
9144
9157
|
key: item.category,
|
|
9145
9158
|
className: "flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 p-3 border border-slate-200 rounded-lg bg-white"
|
|
9146
9159
|
},
|
|
9147
|
-
/* @__PURE__ */ React30.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React30.createElement("span", { className: "text-sm font-semibold text-slate-800" }, getCategoryDisplayName(item.category)), !item.visible && /* @__PURE__ */ React30.createElement(Badge, { variant: "secondary", className: "text-xs" }, "\u5DF2\u9690\u85CF")),
|
|
9160
|
+
/* @__PURE__ */ React30.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React30.createElement("div", { className: "flex flex-col" }, /* @__PURE__ */ React30.createElement("span", { className: "text-sm font-semibold text-slate-800" }, item.description || item.name || getCategoryDisplayName(item.category)), item.description ? /* @__PURE__ */ React30.createElement("span", { className: "text-xs text-slate-500" }, item.name || item.category) : null), !item.visible && /* @__PURE__ */ React30.createElement(Badge, { variant: "secondary", className: "text-xs" }, "\u5DF2\u9690\u85CF")),
|
|
9148
9161
|
/* @__PURE__ */ React30.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React30.createElement(
|
|
9149
9162
|
Button,
|
|
9150
9163
|
{
|
|
@@ -9401,7 +9414,7 @@ function ConfigPageContent() {
|
|
|
9401
9414
|
onChange: (e) => setCollectionForm((prev) => ({ ...prev, category: e.target.value })),
|
|
9402
9415
|
className: "w-full px-3 py-2 border border-slate-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
|
9403
9416
|
},
|
|
9404
|
-
categoryOptions.map((category) => /* @__PURE__ */ React30.createElement("option", { key: category, value: category }, getCategoryDisplayName(category)))
|
|
9417
|
+
categoryOptions.map((category) => /* @__PURE__ */ React30.createElement("option", { key: category.name, value: category.name }, category.description || getCategoryDisplayName(category.name)))
|
|
9405
9418
|
)), /* @__PURE__ */ React30.createElement("div", null, /* @__PURE__ */ React30.createElement("label", { className: "block text-sm font-medium text-slate-700 mb-2" }, "\u4EF7\u683C\uFF08\u5143\uFF09"), /* @__PURE__ */ React30.createElement(
|
|
9406
9419
|
"input",
|
|
9407
9420
|
{
|