refactor(structure): remove workbench header
- remove top action bar with refresh, publish and reset content buttons - delete all associated CSS styling for the structure header - remove unused lucide icon and API function imports - simplify the structure workbench grid layout
This commit is contained in:
@@ -4,9 +4,7 @@ import {
|
|||||||
ArrowUp,
|
ArrowUp,
|
||||||
ChevronRight,
|
ChevronRight,
|
||||||
Plus,
|
Plus,
|
||||||
RefreshCcw,
|
|
||||||
Save,
|
Save,
|
||||||
Send,
|
|
||||||
Trash2,
|
Trash2,
|
||||||
X,
|
X,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
@@ -16,9 +14,7 @@ import {
|
|||||||
deleteSiteConfigItem,
|
deleteSiteConfigItem,
|
||||||
getProducts,
|
getProducts,
|
||||||
getSiteConfig,
|
getSiteConfig,
|
||||||
publishSite,
|
|
||||||
reorderSiteConfigItems,
|
reorderSiteConfigItems,
|
||||||
resetGuizhouContent,
|
|
||||||
updateSiteConfigItem,
|
updateSiteConfigItem,
|
||||||
} from "@/api";
|
} from "@/api";
|
||||||
import type { Product, SiteConfig, SiteItemPatch, SiteModule } from "@/api";
|
import type { Product, SiteConfig, SiteItemPatch, SiteModule } from "@/api";
|
||||||
@@ -598,54 +594,10 @@ export function StructurePage({
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const publish = async () => {
|
|
||||||
const result = await publishSite();
|
|
||||||
setMessage("");
|
|
||||||
notify({ tone: "success", title: "已生成发布版本", message: result.title });
|
|
||||||
};
|
|
||||||
|
|
||||||
const resetToGuizhou = async () => {
|
|
||||||
const result = await resetGuizhouContent();
|
|
||||||
setMessage("");
|
|
||||||
notify({
|
|
||||||
tone: "success",
|
|
||||||
title: "贵州内容已重置",
|
|
||||||
message: "后台配置、商品库和素材引用已切换为贵州省内定制游。",
|
|
||||||
});
|
|
||||||
setSelectedId("");
|
|
||||||
setDraft({});
|
|
||||||
onDirtyChange(false);
|
|
||||||
await load();
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!config) return <EmptyState text={message || "正在读取小程序结构"} />;
|
if (!config) return <EmptyState text={message || "正在读取小程序结构"} />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="work-area structure-workbench">
|
<section className="work-area structure-workbench">
|
||||||
<header className="section-head">
|
|
||||||
<div>
|
|
||||||
<h2>{fixedPage ? activePage.title : "小程序维护地图"}</h2>
|
|
||||||
<p>
|
|
||||||
{fixedPage
|
|
||||||
? activePage.subtitle
|
|
||||||
: "按用户看到的前台页面组织后台,逐层展开到可维护内容。"}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div className="action-row">
|
|
||||||
<Button variant="outline" onClick={load}>
|
|
||||||
<RefreshCcw size={17} />
|
|
||||||
刷新
|
|
||||||
</Button>
|
|
||||||
<Button className="primary-action compact" onClick={publish}>
|
|
||||||
<Send size={17} />
|
|
||||||
发布快照
|
|
||||||
</Button>
|
|
||||||
<Button variant="outline" onClick={resetToGuizhou}>
|
|
||||||
<RefreshCcw size={17} />
|
|
||||||
重置贵州内容
|
|
||||||
</Button>
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
<div className={gridClassName}>
|
<div className={gridClassName}>
|
||||||
{!fixedPage ? (
|
{!fixedPage ? (
|
||||||
<aside className="page-rail">
|
<aside className="page-rail">
|
||||||
|
|||||||
@@ -457,11 +457,11 @@ textarea {
|
|||||||
.structure-workbench {
|
.structure-workbench {
|
||||||
height: calc(100vh - 56px);
|
height: calc(100vh - 56px);
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-rows: auto auto minmax(0, 1fr);
|
grid-template-rows: minmax(0, 1fr);
|
||||||
}
|
}
|
||||||
|
|
||||||
.maintenance-grid {
|
.maintenance-grid {
|
||||||
grid-row: 3;
|
grid-row: 1;
|
||||||
min-height: 0;
|
min-height: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
display: grid;
|
display: grid;
|
||||||
@@ -3624,53 +3624,3 @@ section.work-area:has(> .lead-toolbar) .lead-row:hover {
|
|||||||
padding: 12px;
|
padding: 12px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Structure header action polish */
|
|
||||||
.structure-workbench > .section-head {
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.structure-workbench > .section-head .action-row {
|
|
||||||
align-items: center;
|
|
||||||
justify-content: flex-end;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.structure-workbench > .section-head .action-row button {
|
|
||||||
width: 136px;
|
|
||||||
min-width: 136px;
|
|
||||||
height: 44px;
|
|
||||||
min-height: 44px;
|
|
||||||
padding: 0 14px !important;
|
|
||||||
border-radius: 12px !important;
|
|
||||||
font-weight: 800;
|
|
||||||
line-height: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.structure-workbench > .section-head .action-row button svg {
|
|
||||||
width: 16px;
|
|
||||||
height: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.structure-workbench > .section-head .action-row .primary-action {
|
|
||||||
box-shadow: 0 10px 20px rgba(15, 118, 110, 0.14);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 980px) {
|
|
||||||
.structure-workbench > .section-head {
|
|
||||||
align-items: stretch;
|
|
||||||
}
|
|
||||||
|
|
||||||
.structure-workbench > .section-head .action-row {
|
|
||||||
justify-content: flex-start;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 720px) {
|
|
||||||
.structure-workbench > .section-head .action-row button {
|
|
||||||
width: 100%;
|
|
||||||
min-width: 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
Reference in New Issue
Block a user