sa2kit 1.6.48 → 1.6.50
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-J6KKMP7V.js → chunk-7JN25DJB.js} +19 -13
- package/dist/chunk-7JN25DJB.js.map +1 -0
- package/dist/{chunk-6ZREZAGB.mjs → chunk-GFVAIT6Y.mjs} +20 -7
- package/dist/chunk-GFVAIT6Y.mjs.map +1 -0
- package/dist/{chunk-ERNZE5CJ.js → chunk-IZOIVYOW.js} +20 -7
- package/dist/chunk-IZOIVYOW.js.map +1 -0
- package/dist/{chunk-RZCEWMOR.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 +41 -22
- package/dist/showmasterpiece/index.js.map +1 -1
- package/dist/showmasterpiece/index.mjs +32 -13
- 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-6ZREZAGB.mjs.map +0 -1
- package/dist/chunk-ERNZE5CJ.js.map +0 -1
- package/dist/chunk-J6KKMP7V.js.map +0 -1
- package/dist/chunk-RZCEWMOR.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { normalizeHomeTabConfig, getCategoryDisplayName, buildDefaultHomeTabConfig } from '../chunk-
|
|
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,
|
|
@@ -8776,6 +8778,7 @@ function ConfigPageContent() {
|
|
|
8776
8778
|
homeTabConfig: buildDefaultHomeTabConfig()
|
|
8777
8779
|
}));
|
|
8778
8780
|
setNewHomeTabCategory("");
|
|
8781
|
+
setNewHomeTabDescription("");
|
|
8779
8782
|
};
|
|
8780
8783
|
const handleSetAllHomeTabsVisible = (visible) => {
|
|
8781
8784
|
setConfigForm((prev) => {
|
|
@@ -8788,6 +8791,7 @@ function ConfigPageContent() {
|
|
|
8788
8791
|
};
|
|
8789
8792
|
const handleAddHomeTab = async () => {
|
|
8790
8793
|
const trimmed = newHomeTabCategory.trim();
|
|
8794
|
+
const trimmedDescription = newHomeTabDescription.trim();
|
|
8791
8795
|
if (!trimmed) {
|
|
8792
8796
|
alert("\u5206\u7C7B\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A");
|
|
8793
8797
|
setNewHomeTabCategory("");
|
|
@@ -8801,18 +8805,25 @@ function ConfigPageContent() {
|
|
|
8801
8805
|
setNewHomeTabCategory("");
|
|
8802
8806
|
return;
|
|
8803
8807
|
}
|
|
8804
|
-
const
|
|
8805
|
-
(category) => category.toLowerCase() === trimmed.toLowerCase()
|
|
8808
|
+
const existingCategory = categoryOptions.find(
|
|
8809
|
+
(category) => category.name.toLowerCase() === trimmed.toLowerCase()
|
|
8806
8810
|
);
|
|
8811
|
+
const description = trimmedDescription || existingCategory?.description || "";
|
|
8812
|
+
if (!description) {
|
|
8813
|
+
alert("\u5C55\u793A\u6587\u6848\u4E0D\u80FD\u4E3A\u7A7A");
|
|
8814
|
+
return;
|
|
8815
|
+
}
|
|
8807
8816
|
try {
|
|
8808
|
-
if (!
|
|
8809
|
-
await createCategory(trimmed);
|
|
8810
|
-
setCategoryOptions((prev) => [...prev, trimmed]);
|
|
8817
|
+
if (!existingCategory) {
|
|
8818
|
+
await createCategory(trimmed, description);
|
|
8819
|
+
setCategoryOptions((prev) => [...prev, { name: trimmed, description }]);
|
|
8811
8820
|
}
|
|
8812
8821
|
setConfigForm((prev) => {
|
|
8813
8822
|
const updated = [
|
|
8814
8823
|
...prev.homeTabConfig,
|
|
8815
8824
|
{
|
|
8825
|
+
name: trimmed,
|
|
8826
|
+
description,
|
|
8816
8827
|
category: trimmed,
|
|
8817
8828
|
visible: true,
|
|
8818
8829
|
order: prev.homeTabConfig.length
|
|
@@ -8821,6 +8832,7 @@ function ConfigPageContent() {
|
|
|
8821
8832
|
return { ...prev, homeTabConfig: normalizeHomeTabConfig(updated) };
|
|
8822
8833
|
});
|
|
8823
8834
|
setNewHomeTabCategory("");
|
|
8835
|
+
setNewHomeTabDescription("");
|
|
8824
8836
|
} catch (error2) {
|
|
8825
8837
|
console.error("\u65B0\u589E\u5206\u7C7B\u5931\u8D25:", error2);
|
|
8826
8838
|
alert(error2 instanceof Error ? error2.message : "\u65B0\u589E\u5206\u7C7B\u5931\u8D25");
|
|
@@ -9125,12 +9137,19 @@ function ConfigPageContent() {
|
|
|
9125
9137
|
onChange: (e) => setConfigForm((prev) => ({ ...prev, enableCategories: e.target.checked })),
|
|
9126
9138
|
className: "h-4 w-4 rounded border-gray-300"
|
|
9127
9139
|
}
|
|
9128
|
-
), /* @__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(
|
|
9129
9141
|
Input,
|
|
9130
9142
|
{
|
|
9131
9143
|
value: newHomeTabCategory,
|
|
9132
9144
|
onChange: (e) => setNewHomeTabCategory(e.target.value),
|
|
9133
|
-
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"
|
|
9134
9153
|
}
|
|
9135
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(
|
|
9136
9155
|
"div",
|
|
@@ -9138,7 +9157,7 @@ function ConfigPageContent() {
|
|
|
9138
9157
|
key: item.category,
|
|
9139
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"
|
|
9140
9159
|
},
|
|
9141
|
-
/* @__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")),
|
|
9142
9161
|
/* @__PURE__ */ React30.createElement("div", { className: "flex items-center gap-2" }, /* @__PURE__ */ React30.createElement(
|
|
9143
9162
|
Button,
|
|
9144
9163
|
{
|
|
@@ -9395,7 +9414,7 @@ function ConfigPageContent() {
|
|
|
9395
9414
|
onChange: (e) => setCollectionForm((prev) => ({ ...prev, category: e.target.value })),
|
|
9396
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"
|
|
9397
9416
|
},
|
|
9398
|
-
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)))
|
|
9399
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(
|
|
9400
9419
|
"input",
|
|
9401
9420
|
{
|