From 2f26828f0900b330ed525f4d456acf57773a8b06 Mon Sep 17 00:00:00 2001 From: que01 Date: Wed, 14 Oct 2026 10:54:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E4=B8=80=20Admin=20=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E8=AE=BE=E8=AE=A1=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 用中性灰底 + 单一强调色重做后台视觉,并集中到一套令牌: - 新增 apps/admin/src/lib/theme.ts,通过 ConfigProvider 注入主题令牌 - 新增 apps/admin/src/styles/admin.css 与 AdminSection、MetricCard、StatusTag 组件 - 侧栏改白底浅色并补图标,顶栏改 56px 白底,内容区最大宽 1200px - 全部页面接入状态标签,antd 原生彩色 Tag 与内联色值清零 - 登录与改密页、加载态骨架屏、错误提示条统一 - brand 页两个 Tab 统一为白卡片容器,消除双标题与宽度不一致 设计规范见 apps/admin/design.md。 --- apps/admin/design.md | 327 +++++++++ apps/admin/src/components/AdminPageHeader.tsx | 18 +- apps/admin/src/components/AdminSection.tsx | 28 + apps/admin/src/components/ImageUrlField.tsx | 26 +- apps/admin/src/components/MetricCard.tsx | 25 + apps/admin/src/components/QueryState.tsx | 74 +- .../src/components/RecordContentEditor.tsx | 8 +- apps/admin/src/components/StatusTag.tsx | 67 ++ .../src/components/TemplateFieldRenderer.tsx | 2 +- .../src/components/TemplateListField.tsx | 4 +- apps/admin/src/features/brand/BrandPage.css | 70 +- apps/admin/src/features/brand/BrandPage.tsx | 63 +- .../brand/ComponentTemplatePreview.css | 20 +- .../features/brand/InquiryPreviewEditor.tsx | 7 +- .../src/features/brand/PresentationEditor.css | 64 +- .../src/features/brand/PresentationEditor.tsx | 57 +- .../src/features/brand/TemplatePreview.css | 4 +- .../capabilities/CapabilitiesPage.tsx | 8 +- .../components/CapabilityCard.tsx | 44 +- .../components/CapabilityStatusControl.tsx | 14 +- .../src/features/inquiries/InquiriesPage.tsx | 246 ++++--- .../src/features/overview/OverviewPage.tsx | 135 ++-- .../publication/MiniAppReleaseCard.tsx | 78 +- .../features/publication/PublicationPage.tsx | 302 ++++---- .../src/features/services/OfferingsTable.tsx | 44 +- .../src/features/services/ServicesPage.css | 8 +- apps/admin/src/features/team/MembersPage.tsx | 25 +- .../trust-content/TrustContentPage.tsx | 35 +- .../components/TrustContentTable.tsx | 17 +- .../components/TrustRequirementsList.tsx | 76 +- .../src/features/workspace/WorkspacePage.tsx | 201 +++--- apps/admin/src/lib/theme.ts | 83 +++ apps/admin/src/main.tsx | 226 +++--- apps/admin/src/styles/admin.css | 675 ++++++++++++++++++ 34 files changed, 2159 insertions(+), 922 deletions(-) create mode 100644 apps/admin/design.md create mode 100644 apps/admin/src/components/AdminSection.tsx create mode 100644 apps/admin/src/components/MetricCard.tsx create mode 100644 apps/admin/src/components/StatusTag.tsx create mode 100644 apps/admin/src/lib/theme.ts create mode 100644 apps/admin/src/styles/admin.css diff --git a/apps/admin/design.md b/apps/admin/design.md new file mode 100644 index 0000000..a4a73df --- /dev/null +++ b/apps/admin/design.md @@ -0,0 +1,327 @@ +# Admin Design Language + +本文件是 `@personal-brand/admin` 管理后台的视觉与交互规范,是后台 UI 的唯一设计来源。 + +设计目标:**简洁、干净**。留白充足、层级靠排版建立、装饰最少。信息架构与业务语义不在本文件范围内,如需变更请走产品文档。 + +适用范围:`apps/admin/src` 下所有页面、组件与样式。新增 UI 前先读本文件,冲突以本文件为准。 + +- 本文件同时作为 AI 设计工具的规范输入:在 MasterGo「AI 快搭」中直接上传本文件即可,无需重复描述视觉规则。生成提示词见 `docs/design/admin-mastergo-guide.md`。 +- 技术约束:antd 6 + React 19 + React Router 7 + TanStack Query 5。不引入新的 UI 库、状态管理、校验或路由方案。 +- 主题令牌统一在根节点通过 `ConfigProvider` 注入,页面与组件内不得写零散色值。 +- 共享视觉元素放 `apps/admin/src/components/`,页面专属组件留在各自的 `features/` 目录。 +- 中文界面。桌面优先,最小可用宽度 1024px;窄屏允许侧栏折叠,不提供移动端专用布局。 + +--- + +## 1. 颜色 + +中性灰打底,只保留一个强调色。禁止渐变、彩色大面积色块、玻璃拟态。 + +### 基础色 + +| 用途 | 令牌 | 值 | +| ---------------------- | ---------------------- | --------- | +| 页面底色 | `colorBgLayout` | `#F7F8FA` | +| 卡片/容器底色 | `colorBgContainer` | `#FFFFFF` | +| 次级填充(表头、悬停) | `colorFillQuaternary` | `#FAFAFB` | +| 悬停底色 | `colorFillTertiary` | `#F7F8FA` | +| 容器边框 | `colorBorderSecondary` | `#E7E9EC` | +| 行分隔线 | `colorSplit` | `#F0F1F3` | +| 控件边框 | `colorBorder` | `#D8DBE0` | + +### 文字色 + +| 用途 | 令牌 | 值 | +| ------------- | --------------------- | --------- | +| 主文字 | `colorText` | `#1C1F23` | +| 次要文字 | `colorTextSecondary` | `#6B7280` | +| 辅助/占位文字 | `colorTextTertiary` | `#9AA1AC` | +| 禁用文字 | `colorTextQuaternary` | `#C3C7CF` | + +### 强调色 + +| 用途 | 令牌 | 值 | +| ------------- | -------------------- | --------- | +| 主色 | `colorPrimary` | `#2563EB` | +| 主色悬停 | `colorPrimaryHover` | `#1D4ED8` | +| 主色按下 | `colorPrimaryActive` | `#1E40AF` | +| 选中底色 | `colorPrimaryBg` | `#EFF4FF` | +| 选中/链接文字 | `colorLink` | `#2563EB` | + +强调色只用于:主按钮、选中态、链接、关键数字、聚焦描边。不得用于大面积背景。 + +### 状态色 + +状态一律用「浅底 + 深字」,不使用 antd 的实心鲜艳 Tag。 + +| 语义 | 底色 | 文字色 | +| ------------- | --------- | --------- | +| 成功 / 已发布 | `#ECFDF3` | `#067647` | +| 警告 / 进行中 | `#FFFAEB` | `#B54708` | +| 错误 / 失败 | `#FEF3F2` | `#B42318` | +| 中性 / 草稿 | `#F2F4F7` | `#475467` | +| 信息 / 系统态 | `#EFF4FF` | `#2563EB` | + +--- + +## 2. 排版 + +系统无衬线字体栈:`Inter`、`PingFang SC`、`Noto Sans SC`、`sans-serif`。 + +| 角色 | 字号 | 字重 | 行高 | +| ------------------ | ---- | ---- | ---- | +| 页面标题 | 24px | 600 | 1.35 | +| 区块/卡片标题 | 16px | 600 | 1.45 | +| 强调正文、品牌名 | 15px | 600 | 1.5 | +| 正文 | 14px | 400 | 1.5 | +| 表单标签、次要正文 | 13px | 400 | 1.5 | +| 辅助说明、时间戳 | 12px | 400 | 1.5 | +| 指标数值 | 28px | 600 | 1.2 | + +- 层级靠字号与字重建立,不靠颜色、下划线、边框。 +- 中文不使用斜体;英文与数字不加字距。 +- 一段说明文字最长不超过 2 行,超出应改写或省略。 +- 中英文与数字之间保留一个空格。 + +--- + +## 3. 间距与布局 + +8pt 网格。间距只使用 `4 / 8 / 12 / 16 / 24 / 32`。 + +| 场景 | 值 | +| ---------------- | ------------ | +| 页面内容区内边距 | 24px | +| 内容最大宽度 | 1200px,居中 | +| 页面头部到主体 | 24px | +| 卡片内边距 | 20px | +| 卡片之间 | 16px | +| 表单字段之间 | 16px | +| 标签与输入框之间 | 6px | +| 行内元素之间 | 8px | +| 小节标题到内容 | 12px | + +外壳尺寸: + +- 侧栏宽 232px,折叠宽 0(`breakpoint="lg"`)。 +- 顶栏高 56px,与侧栏品牌区对齐。 + +--- + +## 4. 形状与层次 + +| 元素 | 圆角 | 说明 | +| ------------------ | ---- | ------------------------------- | +| 卡片 | 10px | 默认 1px `#E7E9EC` 边框,无阴影 | +| 弹窗 | 12px | 极轻阴影 | +| 按钮、输入框、下拉 | 6px | 统一 | +| 状态标签 | 6px | 高 24px,内边距 `2px 8px` | +| 图片/头像缩略图 | 8px | 头像用圆形 | +| 进度条 | 3px | 高 6px | + +- 层次手段优先级:留白 > 字号字重 > 1px 浅边框 > 阴影。 +- 阴影仅用于浮层:`0 1px 2px rgba(16, 24, 40, 0.04)`,弹窗可加 `0 8px 24px rgba(16, 24, 40, 0.08)`。 +- 卡片不使用阴影,不叠加边框与阴影。 + +--- + +## 5. 组件规范 + +### 侧栏导航 + +- 白底,右侧 1px `#E7E9EC` 分隔线。不使用深色主题(现有 `theme="dark"` 需移除)。 +- 顶部品牌区:24x24 圆角 6px 标识 + 品牌名,高 56px。 +- 分组标题:12px `#9AA1AC`,上下留白 8px,不加图标、不做大写英文。 +- 菜单项:高 36px,圆角 6px,左侧 16px 线性图标(描边 1.5px),文字 14px。 +- 三态:默认深灰文字无底色;悬停 `#F7F8FA`;选中 `#EFF4FF` 底 + `#2563EB` 文字与图标 + 字重 500。 + +### 顶栏 + +- 高 56px,白底,底部 1px 分隔线,左右内边距 24px。 +- 左侧:品牌名 14px/600 + 灰色 13px「品牌工作区」+ 角色标签。 +- 角色标签:负责人 `#EFF4FF`/`#2563EB`,内容编辑 `#F2F4F7`/`#475467`。 +- 右侧:品牌切换下拉(尺寸 `small`、白底细边框)+ 「退出登录」文字按钮。 +- 顶栏不随机滚动,内容区独立滚动。 + +### 页面头部 + +统一通过 `AdminPageHeader` 渲染:页面标题 24px/600 + 可选副标题 14px 次要色 + 右侧操作区。底部间距 24px。页面内不得再手写标题层级。 + +### 卡片 + +- 标题 16px/600,标题区底部间距 12px,标题右侧放次要操作(文字按钮)。 +- 卡片只承载一个主题;一个页面最多两级卡片嵌套,避免再嵌套。 + +### 按钮 + +| 类型 | 场景 | +| -------------------- | ---------------------------------------- | +| 主按钮(实心强调色) | 每个页面/卡片最多一个,用于当前主流程 | +| 次按钮(白底细边框) | 并列的次要操作 | +| 文字按钮 | 表格行内操作、列表「去处理」、返回类操作 | +| 危险按钮 | 删除、撤回、卸载等不可逆操作 | + +- 高度:默认 32px,主流程按钮 40px。 +- 等待态用 `loading`,禁用态用 `disabled`,禁止用文字变形表达状态。 + +### 表单 + +- 标签在输入框上方,13px `#475467`,必填星号 `#B42318`。 +- 帮助文本 12px `#9AA1AC`,错误文本 12px `#B42318`,都显示在字段下方。 +- 输入框聚焦:1.5px `#2563EB` 描边 + `#EFF4FF` 2px 外发光。 +- 提交失败必须保留用户输入,错误提示定位到字段或表单顶部,禁止弹窗后清空。 + +### 数据表格 + +- 无竖线;表头底色 `#FAFAFB`,13px `#6B7280`。 +- 行高 52px(含头像/双行内容时 60px)。 +- 行分隔线 `#F0F1F3`;悬停行底色 `#FAFAFB`。 +- 操作列统一放最右,使用文字按钮,最多 2 个直接操作,更多收进「更多」下拉。 +- 空数据不显示空表头,改用空状态组件。 + +### 状态标签 + +- 统一组件,按语义取色,默认 `尺寸 = 24px 高 / 12px 字`。 +- 发布状态机映射:`building` 信息、`uploaded` 中性、`under_review` 警告、`approved` 成功、`rejected` 错误、`published` 成功、`failed` 错误、`superseded` 中性。 +- 同一列表内标签宽度尽量对齐,避免视觉跳动。 + +### 弹窗 + +- 宽 480px(简单表单)或 560px(多字段),圆角 12px。 +- 标题 16px/600,底部操作右对齐:次按钮在左、主按钮在右。 +- 提交中禁用关闭与重复提交。 + +### 描述列表(键值展示) + +用于咨询详情、版本信息等只读信息:字段名 13px `#6B7280`,值 14px `#1C1F23`,行间距 12px,不使用表格线。 + +### Tabs + +- 顶部 1px 分隔线,选中项底部 2px 强调色下划线 + 深色文字,未选中 14px `#6B7280`。 +- 不超过 5 个 Tab,超出改用左侧分段导航。 + +### 进度 + +- 高 6px,圆角 3px,轨道 `#F0F1F3`,进度条强调色;完成态用成功色。 +- 进度条上方 14px 文案说明当前含义,不允许只有一根进度条。 + +--- + +## 6. 状态设计 + +每个远程数据页面必须显式实现四种状态,不得出现无反馈的白屏。 + +| 状态 | 规范 | +| -------- | ----------------------------------------------------------------------------------- | +| 加载中 | 骨架屏,形状与最终内容一致;不用居中转圈 | +| 空数据 | 居中:极简线性图形 + 15px/600 标题 + 13px 灰色说明 + 主操作按钮 | +| 请求失败 | 卡片内错误条:`#FEF3F2` 底 + 1px 浅红边框 + 圆角 8px + 文案 14px + 「重试」文字按钮 | +| 成功反馈 | 右上角轻量 toast,白底圆角 8px,280–320px 宽 | + +- 行内操作使用按钮 `loading` 表达进行中,不用全局遮罩。 +- 提交成功后:关闭弹窗、重置表单、刷新受影响列表;提交失败保持原状。 +- 幂等写操作要防止重复点击(提交中禁用)。 + +--- + +## 7. 页面结构 + +以下为各页面的视觉结构约定,业务逻辑不变。 + +| 页面 | 结构要点 | +| -------------- | ------------------------------------------------------------------------------ | +| 登录 | 居中 400px 卡片,标识 + 说明 + 表单 + 通栏主按钮;错误态展示在字段下方 | +| 首次改密 | 同登录卡片形态,说明文案 + 三个密码字段 + 「保存新密码」 | +| 品牌概览 | 品牌卡 + 三张指标卡(等宽一行)+ 两栏(发布准备度 / 品牌内容检查) | +| 配置与发布 | 三 Tab(内容发布 / 小程序发布 / 小程序配置);发布状态卡 + 草稿卡 + 历史版本表 | +| 小程序页面 | 左右两栏:左 380px 编辑面板,右预览画布;预览内选中区域虚线高亮 + 区域名气泡 | +| 信任内容 | 列表卡片(缩略图 + 标题 + 两行摘要 + 状态标签 + 行内操作),不用表格 | +| 业务提供项 | 表格(名称 / 价格 / 状态开关 / 排序 / 操作)+ 新增弹窗 | +| 咨询记录 | 顶部三指标 + 左 380px 列表 + 右详情的主从布局 | +| 模板与表单设置 | 行业模板网格(三列)+ 咨询表单字段编辑器 + 底部危险操作区 | +| 能力插件 | 插件卡片列表(图标 + 名称 + 说明 + 开关),停用态降低对比度 | +| 团队成员 | 表格(成员 / 角色 / 状态 / 最近登录 / 操作)+ 邀请弹窗 | + +两栏页面在小屏下折叠为单列,编辑/预览改为上下排列。 + +--- + +## 8. 无障碍与细节 + +- 正文与背景对比度不低于 4.5:1;标签文字与标签底色不低于 4.5:1。 +- 可点击元素最小热区 32x32px;纯图标按钮必须带 `aria-label`。 +- 焦点可见:所有可交互元素保留 1.5px 强调色聚焦描边。 +- 状态不能只靠颜色区分,需同时有文字。 +- 数字使用等宽数字排版(`font-variant-numeric: tabular-nums`),避免指标和价格跳动。 + +--- + +## 9. 禁止项 + +- 渐变、玻璃拟态、拟物纹理、装饰性插画铺满界面。 +- 深色侧栏、彩色大面积色块、实心鲜艳 Tag。 +- 重阴影、多重边框、卡片再套卡片超过两级。 +- emoji 作为图标;图标与文字混排时不对齐基线。 +- 页面内写死色值、圆角、间距魔法数字。 +- 一个页面出现多个主按钮竞争视觉焦点。 + +--- + +## 10. antd 令牌映射 + +落地时在 Admin 根节点用 `ConfigProvider` 注入,不逐页覆盖。 + +```ts +const theme = { + token: { + colorPrimary: "#2563EB", + colorLink: "#2563EB", + colorText: "#1C1F23", + colorTextSecondary: "#6B7280", + colorTextTertiary: "#9AA1AC", + colorBgLayout: "#F7F8FA", + colorBgContainer: "#FFFFFF", + colorBorder: "#D8DBE0", + colorBorderSecondary: "#E7E9EC", + colorSplit: "#F0F1F3", + borderRadius: 6, + borderRadiusLG: 10, + borderRadiusSM: 4, + fontSize: 14, + fontFamily: + "Inter, 'PingFang SC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif", + controlHeight: 32, + controlHeightLG: 40, + boxShadow: "0 1px 2px rgba(16, 24, 40, 0.04)", + boxShadowSecondary: "0 8px 24px rgba(16, 24, 40, 0.08)", + wireframe: false, + }, + components: { + Layout: { headerHeight: 56, siderBg: "#FFFFFF", bodyBg: "#F7F8FA" }, + Menu: { + itemHeight: 36, + itemBorderRadius: 6, + itemSelectedBg: "#EFF4FF", + itemSelectedColor: "#2563EB", + itemHoverBg: "#F7F8FA", + itemMarginInline: 8, + itemMarginBlock: 2, + groupTitleFontSize: 12, + }, + Card: { paddingLG: 20, headerFontSize: 16 }, + Table: { + headerBg: "#FAFAFB", + headerColor: "#6B7280", + rowHoverBg: "#FAFAFB", + cellPaddingBlock: 16, + }, + Button: { primaryShadow: "none", defaultShadow: "none", fontWeight: 500 }, + Progress: { defaultColor: "#2563EB", lineBorderRadius: 3 }, + Tag: { defaultBg: "#F2F4F7", defaultColor: "#475467" }, + }, +}; +``` + +- 新增页面优先使用令牌与共享组件,禁止在 JSX 内写内联色值(现有顶栏/侧栏的内联样式需迁移)。 +- 共享视觉组件清单:`AdminPageHeader`、`QueryState`,以及后续新增的状态标签、空状态、卡片区块、指标卡。 diff --git a/apps/admin/src/components/AdminPageHeader.tsx b/apps/admin/src/components/AdminPageHeader.tsx index df78326..73a06cd 100644 --- a/apps/admin/src/components/AdminPageHeader.tsx +++ b/apps/admin/src/components/AdminPageHeader.tsx @@ -1,4 +1,3 @@ -import { Space, Typography } from "antd"; import type { ReactNode } from "react"; export function AdminPageHeader({ @@ -11,21 +10,12 @@ export function AdminPageHeader({ extra?: ReactNode; }) { return ( - +
- - {title} - - {description && ( - - {description} - - )} +

{title}

+ {description ?

{description}

: null}
{extra} - +
); } diff --git a/apps/admin/src/components/AdminSection.tsx b/apps/admin/src/components/AdminSection.tsx new file mode 100644 index 0000000..1d12809 --- /dev/null +++ b/apps/admin/src/components/AdminSection.tsx @@ -0,0 +1,28 @@ +import type { ReactNode } from "react"; + +export function AdminSection({ + title, + description, + extra, + children, +}: { + title?: ReactNode; + description?: ReactNode; + extra?: ReactNode; + children: ReactNode; +}) { + return ( +
+ {title ? ( +
+
+

{title}

+ {description ?

{description}

: null} +
+ {extra} +
+ ) : null} + {children} +
+ ); +} diff --git a/apps/admin/src/components/ImageUrlField.tsx b/apps/admin/src/components/ImageUrlField.tsx index 4d4f0db..49e2030 100644 --- a/apps/admin/src/components/ImageUrlField.tsx +++ b/apps/admin/src/components/ImageUrlField.tsx @@ -1,5 +1,5 @@ import { CloudUploadOutlined, DeleteOutlined, PictureOutlined } from "@ant-design/icons"; -import { Alert, Button, Image, Popconfirm, Space, Spin, Upload, message } from "antd"; +import { Alert, Button, Image, Popconfirm, Spin, Upload, message } from "antd"; import { useEffect, useMemo, useState } from "react"; import { createApiClient } from "../lib/api.js"; @@ -71,7 +71,7 @@ export function ImageUrlField({ id, value, onChange, placeholder, scope }: Image } return ( - +
{storageStatus !== "ok" ? ( ) : null} {imageUrl ? ( -
+
{placeholder onChange?.("")}> - @@ -150,6 +134,6 @@ export function ImageUrlField({ id, value, onChange, placeholder, scope }: Image ) : null} - +
); } diff --git a/apps/admin/src/components/MetricCard.tsx b/apps/admin/src/components/MetricCard.tsx new file mode 100644 index 0000000..b2bd055 --- /dev/null +++ b/apps/admin/src/components/MetricCard.tsx @@ -0,0 +1,25 @@ +import { Card } from "antd"; +import type { ReactNode } from "react"; + +export function MetricCard({ + label, + value, + suffix, + extra, +}: { + label: ReactNode; + value: ReactNode; + suffix?: ReactNode; + extra?: ReactNode; +}) { + return ( + +
{label}
+
+ {value} + {suffix ? {suffix} : null} +
+ {extra} +
+ ); +} diff --git a/apps/admin/src/components/QueryState.tsx b/apps/admin/src/components/QueryState.tsx index 75ba499..c44381e 100644 --- a/apps/admin/src/components/QueryState.tsx +++ b/apps/admin/src/components/QueryState.tsx @@ -1,6 +1,10 @@ -import { Alert, Button, Card, Empty, Result, Spin } from "antd"; +import { Button, Card, Empty, Skeleton } from "antd"; import type { ReactNode } from "react"; +function errorMessage(error: unknown, fallback: string) { + return error instanceof Error ? error.message : fallback; +} + export function QueryState({ loading, error, @@ -12,36 +16,50 @@ export function QueryState({ onRetry?: () => void; children?: ReactNode; }) { - if (loading) - return ( - - - - ); - if (error) { - return ( - 重新加载 : undefined} - /> - ); - } + if (loading) return ; + if (error) return ; return <>{children}; } +export function LoadingStack({ rows = 3 }: { rows?: number }) { + return ( +
+ + + + {Array.from({ length: rows }).map((_, index) => ( + + + + ))} +
+ ); +} + +export function ErrorNote({ + error, + onRetry, +}: { + error?: unknown; + onRetry?: (() => void) | undefined; +}) { + if (!error) return null; + return ( +
+ {errorMessage(error, "操作失败,请重试")} + {onRetry ? ( + + ) : null} +
+ ); +} + +export function MutationError({ error }: { error?: unknown }) { + return ; +} + export function EmptyState({ description }: { description: string }) { return ; } - -export function MutationError({ error }: { error?: unknown }) { - if (!error) return null; - return ( - - ); -} diff --git a/apps/admin/src/components/RecordContentEditor.tsx b/apps/admin/src/components/RecordContentEditor.tsx index 4361947..d3f41e3 100644 --- a/apps/admin/src/components/RecordContentEditor.tsx +++ b/apps/admin/src/components/RecordContentEditor.tsx @@ -71,7 +71,7 @@ export function RecordContentEditor({ initialValues={initialValues} onValuesChange={handleValuesChange} onFinish={submit} - style={{ minHeight: 0, display: "flex", flexDirection: "column" }} + className="admin-form-column" > {save.isPending ? 正在保存内容… : null} {section.description} -
+
- +
) : null} - +
); } diff --git a/apps/admin/src/components/StatusTag.tsx b/apps/admin/src/components/StatusTag.tsx new file mode 100644 index 0000000..d07dac3 --- /dev/null +++ b/apps/admin/src/components/StatusTag.tsx @@ -0,0 +1,67 @@ +export type StatusTone = "success" | "warning" | "error" | "info" | "neutral"; + +const TONE_BY_STATUS: Record = { + published: "success", + approved: "success", + completed: "success", + active: "success", + enabled: "success", + building: "info", + built: "neutral", + uploaded: "info", + pending: "neutral", + draft: "neutral", + superseded: "neutral", + disabled: "neutral", + review: "warning", + reviewing: "warning", + under_review: "warning", + processing: "warning", + rejected: "error", + failed: "error", + error: "error", +}; + +const LABELS: Record = { + published: "已发布", + approved: "已通过", + completed: "已完成", + active: "已启用", + enabled: "已公开", + building: "构建中", + built: "待上传", + uploaded: "已上传微信", + pending: "待处理", + draft: "草稿", + superseded: "已过期", + disabled: "已停用", + review: "审核中", + reviewing: "审核中", + under_review: "审核中", + processing: "处理中", + rejected: "已拒绝", + failed: "失败", + error: "异常", +}; + +export function statusLabel(status: string | null | undefined, fallback = "未知"): string { + if (!status) return fallback; + return LABELS[status] ?? status; +} + +export function StatusTag({ + status, + label, + tone, +}: { + status?: string | null; + label?: string; + tone?: StatusTone; +}) { + const resolvedTone = tone ?? (status ? TONE_BY_STATUS[status] : undefined) ?? "neutral"; + return ( + + {label ?? statusLabel(status)} + + ); +} diff --git a/apps/admin/src/components/TemplateFieldRenderer.tsx b/apps/admin/src/components/TemplateFieldRenderer.tsx index 3169778..cca3e66 100644 --- a/apps/admin/src/components/TemplateFieldRenderer.tsx +++ b/apps/admin/src/components/TemplateFieldRenderer.tsx @@ -51,7 +51,7 @@ export function TemplateFieldRenderer({ value={typeof value === "number" ? value : null} onChange={(input) => onChange?.(input ?? undefined)} min={0} - style={{ width: "100%" }} + className="admin-block" placeholder={field.placeholder} /> ); diff --git a/apps/admin/src/components/TemplateListField.tsx b/apps/admin/src/components/TemplateListField.tsx index 55c72fa..f45f619 100644 --- a/apps/admin/src/components/TemplateListField.tsx +++ b/apps/admin/src/components/TemplateListField.tsx @@ -28,7 +28,7 @@ export function TemplateListField({ ]} > {(rows, { add, remove, move }, { errors }) => ( - +
{rows.length === 0 ? ( } onClick={() => add()}> 新增{field.label} - +
)} diff --git a/apps/admin/src/features/brand/BrandPage.css b/apps/admin/src/features/brand/BrandPage.css index 0ba5d4c..a585e82 100644 --- a/apps/admin/src/features/brand/BrandPage.css +++ b/apps/admin/src/features/brand/BrandPage.css @@ -1,19 +1,29 @@ -.brand-page__content { - max-width: 960px; -} - .brand-page__content[hidden] { display: none; } + .brand-page__toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; - padding: 16px 0; - border-bottom: 1px solid #e5e7eb; - margin-bottom: 20px; + padding: 8px 12px; + border: 1px solid var(--admin-border); + border-radius: 10px; + background: var(--admin-fill-quiet); + margin-bottom: 16px; } + +.brand-page__toolbar .ant-segmented { + background: var(--admin-surface); +} + +.brand-page__toolbar-actions { + display: flex; + align-items: center; + gap: 12px; +} + @media (max-width: 575px) { .brand-page__toolbar { flex-wrap: wrap; @@ -25,54 +35,22 @@ } .brand-settings-section { - padding: 24px 0; - border-top: 1px solid #f0f0f0; + padding: 20px; + border: 1px solid var(--admin-border); + border-radius: 10px; + background: var(--admin-surface); } -.brand-settings-section:first-child { - padding-top: 8px; - border-top: 0; -} - -.brand-settings-section__header { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 16px; - margin-bottom: 20px; -} - -.brand-settings-section__header .ant-typography { - margin: 0; -} - -.brand-settings-section__header .ant-typography + .ant-typography { - display: block; - margin-top: 4px; +.brand-settings-section + .brand-settings-section { + margin-top: 16px; } .brand-page__template-note { - margin-top: 24px; + margin-top: 16px; } @media (max-width: 1199px) { - .brand-page__content { - display: block; - } - .brand-page__template-note { position: static; - margin-top: 24px; - } -} - -@media (max-width: 575px) { - .brand-settings-section__header { - display: block; - } - - .brand-settings-section__header .ant-tag { - display: inline-block; - margin-top: 10px; } } diff --git a/apps/admin/src/features/brand/BrandPage.tsx b/apps/admin/src/features/brand/BrandPage.tsx index 0255455..f30d23d 100644 --- a/apps/admin/src/features/brand/BrandPage.tsx +++ b/apps/admin/src/features/brand/BrandPage.tsx @@ -1,17 +1,4 @@ -import { - Alert, - Button, - Col, - Form, - Input, - Row, - Select, - Segmented, - Space, - Tag, - Typography, - message, -} from "antd"; +import { Alert, Button, Col, Form, Input, Row, Select, Segmented, message } from "antd"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { useState } from "react"; import { Link, useLocation } from "react-router-dom"; @@ -20,6 +7,7 @@ import { createApiClient } from "../../lib/api.js"; import { AdminPageHeader } from "../../components/AdminPageHeader.js"; import { ImageUrlField } from "../../components/ImageUrlField.js"; import { MutationError, QueryState } from "../../components/QueryState.js"; +import { StatusTag } from "../../components/StatusTag.js"; import { PresentationEditor } from "./PresentationEditor.js"; import type { PreviewSelection } from "./preview-selection.js"; import "./BrandPage.css"; @@ -72,7 +60,7 @@ export function BrandPage() { ? `先让访客理解你是谁、服务谁,以及为什么值得信任。${template.data.description}` : "先让访客理解你是谁、服务谁,以及为什么值得信任。" } - extra={{template.data?.name ?? "当前模板"}} + extra={} />
- - - {dirty ? "品牌资料有未保存修改" : "草稿工作区"} - +
+ 检查与发布 → - +
- +
- +
)}
diff --git a/apps/admin/src/features/brand/TemplatePreview.css b/apps/admin/src/features/brand/TemplatePreview.css index b1ed3ea..a42fb68 100644 --- a/apps/admin/src/features/brand/TemplatePreview.css +++ b/apps/admin/src/features/brand/TemplatePreview.css @@ -4,8 +4,8 @@ height: min(72vh, 760px); min-height: 560px; overflow: hidden; - border: 1px solid #e8e8e8; - background: #f3f4f6; + border: 1px solid var(--admin-border); + background: var(--admin-fill); } .template-preview iframe { diff --git a/apps/admin/src/features/capabilities/CapabilitiesPage.tsx b/apps/admin/src/features/capabilities/CapabilitiesPage.tsx index 2c16813..3b3c4cf 100644 --- a/apps/admin/src/features/capabilities/CapabilitiesPage.tsx +++ b/apps/admin/src/features/capabilities/CapabilitiesPage.tsx @@ -1,4 +1,4 @@ -import { Card, Col, Empty, Row, Typography } from "antd"; +import { Card, Col, Empty, Row } from "antd"; import { AdminPageHeader } from "../../components/AdminPageHeader.js"; import { QueryState } from "../../components/QueryState.js"; import { CapabilityCard } from "./components/CapabilityCard.js"; @@ -14,7 +14,7 @@ export function CapabilitiesPage() { description="以经营者视角调整模板能力的开关与展示设置;保存后进入草稿,发布后生效。" /> {query.data?.length ? ( - + {query.data.map((capability) => ( @@ -26,9 +26,9 @@ export function CapabilitiesPage() { )} - +

技术信息仅用于排查问题,不作为运营判断依据。 - +

); } diff --git a/apps/admin/src/features/capabilities/components/CapabilityCard.tsx b/apps/admin/src/features/capabilities/components/CapabilityCard.tsx index 3bfa196..1653af4 100644 --- a/apps/admin/src/features/capabilities/components/CapabilityCard.tsx +++ b/apps/admin/src/features/capabilities/components/CapabilityCard.tsx @@ -1,5 +1,7 @@ -import { Alert, Button, Card, Input, Switch, Tag, Typography } from "antd"; +import { Button, Card, Input, Switch, Typography } from "antd"; import { useState } from "react"; +import { ErrorNote } from "../../../components/QueryState.js"; +import { StatusTag } from "../../../components/StatusTag.js"; import { useCapabilityMutation } from "../hooks/useCapabilityQueries.js"; import type { AdminCapability, CapabilityStatus } from "../types.js"; import { CapabilityStatusControl, CapabilityStatusTag } from "./CapabilityStatusControl.js"; @@ -46,10 +48,10 @@ export function CapabilityCard({ capability }: { capability: AdminCapability }) return ( + {capability.displayName ?? "未命名能力"} - {sourceLabels[capability.source]} + } extra={ @@ -59,48 +61,40 @@ export function CapabilityCard({ capability }: { capability: AdminCapability }) } > {mutation.isError ? ( - +
+ +
) : null} {capability.description ? ( - {capability.description} +

{capability.description}

) : null} {capability.impact ? ( - 影响:{capability.impact} +

影响:{capability.impact}

) : null} -
+
- 运行状态 -
+ 运行状态 +
- - 保存后进入草稿,发布后生效。 - +

保存后进入草稿,发布后生效。

{status === "disabled" && capability.disablePolicy ? ( - +

{disablePolicyLabels[capability.disablePolicy]} - +

) : null}
{capability.configFields?.length ? (
- 能力设置 -
+ 能力设置 +
{capability.configFields.map((field) => (
- {field.label} + {field.label} {field.input === "switch" ? (
= { enabled: "启用", @@ -7,14 +9,14 @@ const statusLabels: Record = { degraded: "降级", }; -const statusColors: Record = { - enabled: "green", - disabled: "default", - degraded: "orange", +const statusTones: Record = { + enabled: "success", + disabled: "neutral", + degraded: "warning", }; export function CapabilityStatusTag({ status }: { status: CapabilityStatus }) { - return {statusLabels[status]}; + return ; } export function CapabilityStatusControl({ diff --git a/apps/admin/src/features/inquiries/InquiriesPage.tsx b/apps/admin/src/features/inquiries/InquiriesPage.tsx index 79f7e0e..b2dc1a2 100644 --- a/apps/admin/src/features/inquiries/InquiriesPage.tsx +++ b/apps/admin/src/features/inquiries/InquiriesPage.tsx @@ -1,20 +1,13 @@ -import { - Badge, - Button, - Card, - Descriptions, - Drawer, - Select, - Space, - Table, - Tag, - message, - Input, -} from "antd"; +import { Badge, Button, Descriptions, Drawer, Select, Space, Table, message, Input } from "antd"; import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import type { AdminBooking, InquirySubmission } from "@personal-brand/api-client"; import { createApiClient } from "../../lib/api.js"; import { useState } from "react"; +import { AdminPageHeader } from "../../components/AdminPageHeader.js"; +import { AdminSection } from "../../components/AdminSection.js"; +import { ErrorNote } from "../../components/QueryState.js"; +import { StatusTag } from "../../components/StatusTag.js"; +import type { StatusTone } from "../../components/StatusTag.js"; const statuses = ["received", "contacting", "confirmed", "completed", "cancelled"] as const; const labels: Record = { @@ -41,6 +34,20 @@ const inquiryLabels: Record = { closed: "已关闭", }; +const statusTones: Record = { + received: "info", + new: "info", + contacting: "warning", + reviewing: "warning", + confirmed: "success", + replied: "success", + qualified: "success", + converted: "success", + completed: "success", + cancelled: "error", + closed: "neutral", +}; + export function InquiriesPage() { const client = createApiClient(); const queryClient = useQueryClient(); @@ -94,117 +101,119 @@ export function InquiriesPage() { onError: (error) => message.error(error instanceof Error ? error.message : "更新失败,请重试"), }); return ( - - update.mutate({ id: item.id, value: value as never })} - options={statuses.map((value) => ({ value, label: labels[value] }))} - /> - - - ), - }, - ]} - /> - setSelectedId(undefined)} - loading={detail.isLoading} - width={520} + <> + + + update.mutate({ id: item.id, value: value as never })} + options={statuses.map((value) => ({ value, label: labels[value] }))} + /> + + + ), + }, + ]} + /> + setSelectedId(undefined)} + loading={detail.isLoading} + width={520} + > + {detail.data && ( + + {detail.data.bookingNo} + {detail.data.customerName} + + {labels[detail.data.status] ?? detail.data.status} + + + {new Date(detail.data.createdAt).toLocaleString("zh-CN")} + + + {detail.data.adminNote || "暂无"} + + + )} + + + void submissions.refetch()} loading={submissions.isFetching}> 刷新提交记录 } > - {submissions.isError && ( - - 动态咨询提交加载失败: - {submissions.error instanceof Error ? submissions.error.message : "未知错误"} - - - )} - + {submissions.isError ? ( + void submissions.refetch()} /> + ) : null} + )} - - + + ); } diff --git a/apps/admin/src/features/overview/OverviewPage.tsx b/apps/admin/src/features/overview/OverviewPage.tsx index 8c8bd6f..6f31946 100644 --- a/apps/admin/src/features/overview/OverviewPage.tsx +++ b/apps/admin/src/features/overview/OverviewPage.tsx @@ -1,9 +1,11 @@ -import { Button, Card, Col, List, Progress, Row, Space, Statistic, Tag, Typography } from "antd"; +import { Button, Card, Col, Progress, Row, Typography } from "antd"; import { useQueries, useQuery } from "@tanstack/react-query"; import { useNavigate } from "react-router-dom"; import { createApiClient } from "../../lib/api.js"; import { AdminPageHeader } from "../../components/AdminPageHeader.js"; import { QueryState } from "../../components/QueryState.js"; +import { MetricCard } from "../../components/MetricCard.js"; +import { StatusTag } from "../../components/StatusTag.js"; export function OverviewPage() { const navigate = useNavigate(); @@ -82,41 +84,32 @@ export function OverviewPage() { title="品牌概览" description="从这里检查品牌表达、信任内容和业务承接是否完整。" /> - +
- - {brand?.name || "未命名品牌"} - - - {brand?.tagline || "还没有设置一句话定位"} - - - 当前模板:{workspace?.templateContent?.displayName ?? "尚未安装模板"} - +

{brand?.name || "未命名品牌"}

+

{brand?.tagline || "还没有设置一句话定位"}

+
- - - item.isPublished).length ?? 0} - suffix="条已发布" - /> - + + item.isPublished).length ?? 0} + suffix="条已发布" + /> - - - item.isEnabled).length ?? 0} - suffix="项公开" - /> - + + item.isEnabled).length ?? 0} + suffix="项公开" + /> - - - - + + @@ -139,57 +132,51 @@ export function OverviewPage() { : `还有 ${incompleteChecks.length} 项需要完善,完成后才能发布。`} {incompleteChecks.length > 0 && ( - ( - navigate(item.destination ?? "/admin/publication")} - > - 去处理 - , - ]} - > - {item.label} - - )} - /> +
    + {incompleteChecks.slice(0, 4).map((item) => ( +
  • + {item.label} + +
  • + ))} +
)} - ( - - - - {item.passed ? "已完成" : "待完善"} - - {item.label} - {!item.passed && ( - - )} - - - )} - /> +
    + {checks.map((item) => ( +
  • +
    + + {item.label} +
    + {!item.passed ? ( + + ) : null} +
  • + ))} +
- +
); } diff --git a/apps/admin/src/features/publication/MiniAppReleaseCard.tsx b/apps/admin/src/features/publication/MiniAppReleaseCard.tsx index 4ba26b9..7e4c958 100644 --- a/apps/admin/src/features/publication/MiniAppReleaseCard.tsx +++ b/apps/admin/src/features/publication/MiniAppReleaseCard.tsx @@ -1,7 +1,9 @@ import { useEffect, useRef } from "react"; -import { Alert, Button, Card, Collapse, Flex, Space, Tag, Tooltip, Typography, theme } from "antd"; -import { LoadingOutlined } from "@ant-design/icons"; +import { Button, Card, Collapse, Flex, Space, Tooltip, Typography } from "antd"; import type { MiniAppReleaseTask } from "@personal-brand/api-client"; +import { ErrorNote } from "../../components/QueryState.js"; +import { StatusTag } from "../../components/StatusTag.js"; +import type { StatusTone } from "../../components/StatusTag.js"; type ReleaseStatus = MiniAppReleaseTask["status"]; @@ -13,18 +15,18 @@ function isStaleBuilding(task: MiniAppReleaseTask): boolean { return !Number.isNaN(updatedAt) && Date.now() - updatedAt >= STALE_BUILDING_MS; } -const statusView: Record = { - built: { label: "待上传", color: "default", hint: "代码已构建,可上传到微信。" }, - uploaded: { label: "已上传微信", color: "blue", hint: "请在微信后台上传体验版并提交审核。" }, +const statusView: Record = { + built: { label: "待上传", tone: "neutral", hint: "代码已构建,可上传到微信。" }, + uploaded: { label: "已上传微信", tone: "info", hint: "请在微信后台上传体验版并提交审核。" }, under_review: { label: "审核中", - color: "processing", + tone: "warning", hint: "等待微信审核结果,通过后回到本页标记。", }, - approved: { label: "审核通过", color: "cyan", hint: "审核已通过,确认无误后标记为已发布。" }, - published: { label: "已发布", color: "green", hint: "该版本已发布,可继续编辑内容后再次上传。" }, - rejected: { label: "已驳回", color: "volcano", hint: "微信驳回后需修改内容并重新构建上传。" }, - failed: { label: "失败", color: "red", hint: "上次构建或上传失败,可直接重试。" }, + approved: { label: "审核通过", tone: "success", hint: "审核已通过,确认无误后标记为已发布。" }, + published: { label: "已发布", tone: "success", hint: "该版本已发布,可继续编辑内容后再次上传。" }, + rejected: { label: "已驳回", tone: "error", hint: "微信驳回后需修改内容并重新构建上传。" }, + failed: { label: "失败", tone: "error", hint: "上次构建或上传失败,可直接重试。" }, }; function formatTime(value: string): string { @@ -50,7 +52,6 @@ export function MiniAppReleaseCard({ onUpload: () => void; onStatusChange: (status: ReleaseStatus) => void; }) { - const { token } = theme.useToken(); const logRef = useRef(null); const logs = task.buildLogs ?? []; const status = statusView[task.status]; @@ -104,72 +105,49 @@ export function MiniAppReleaseCard({ 品牌内容 v{task.version} - {status.label} + {building && ( - } color="orange"> - {staleBuilding ? "构建已中断" : "构建中"} - + )} {task.weappUploadId && ( 微信版本 {task.weappUploadId} )} - + {staleBuilding ? "超过 15 分钟没有新的构建输出,可能已中断;可直接重试。" : status.hint} - + - - 更新于 {formatTime(task.updatedAt)} - + 更新于 {formatTime(task.updatedAt)} {actions} - {task.error && } + {task.error && ( +
+ +
+ )} {logs.length > 0 && ( - 构建日志({logs.length} 行) - - ), + label: 构建日志({logs.length} 行), children: ( -
+                
                   {logs.map((log, index) => (
                     
- - {formatLogTime(log.at)} - + {formatLogTime(log.at)} {" "} {log.message}
diff --git a/apps/admin/src/features/publication/PublicationPage.tsx b/apps/admin/src/features/publication/PublicationPage.tsx index 2da4e36..0dfbf98 100644 --- a/apps/admin/src/features/publication/PublicationPage.tsx +++ b/apps/admin/src/features/publication/PublicationPage.tsx @@ -4,7 +4,6 @@ import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query"; import { Alert, Button, - Card, Divider, Empty, Input, @@ -13,7 +12,6 @@ import { Select, Space, Spin, - Tag, Tabs, Typography, message, @@ -21,7 +19,9 @@ import { import type { BrandTemplateKey } from "@personal-brand/api-client"; import { createApiClient } from "../../lib/api.js"; import { AdminPageHeader } from "../../components/AdminPageHeader.js"; -import { MutationError, QueryState } from "../../components/QueryState.js"; +import { AdminSection } from "../../components/AdminSection.js"; +import { ErrorNote, MutationError, QueryState } from "../../components/QueryState.js"; +import { StatusTag, statusLabel } from "../../components/StatusTag.js"; import { MiniAppReleaseCard } from "./MiniAppReleaseCard.js"; const client = createApiClient(); @@ -268,17 +268,16 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool const contentTab = null; const miniAppSettingsTab = ( - - - - AppID 用于服务端调用微信官方上传工具;上传私钥保存前会使用 AES-256-GCM - 加密。小程序产物目录由系统构建流程决定,不需要手动修改。 - +
+ {miniAppSettings.data?.buildError ? ( @@ -286,7 +285,7 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool @@ -337,7 +336,7 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool autoComplete="off" spellCheck={false} placeholder={"-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----"} - style={{ fontFamily: "monospace", fontSize: 12 }} + className="admin-code-input" /> @@ -345,15 +344,15 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool 保存上传配置 {miniAppSettings.data?.hasStoredCredentials ? ( - 已加密保存上传凭据 + ) : ( - 未配置上传私钥 + )} - - + +
); return ( @@ -380,13 +379,15 @@ export function PublicationPage({ canManageTemplate }: { canManageTemplate: bool ]} /> {activeTab === "content" && ( - -
- 1. 选择表达方式 +
+ {workspace.data?.installations.length ? ( - +

当前品牌已安装主模板。模板版本与升级在高级设置中管理。 - +

) : null} - + 示例内容 {sample.isLoading && } {sample.data && ( - - {sample.data.alreadyImported ? "已导入" : "可导入"} - + )} } {sample.isError && ( - +
+ void sample.refetch()} /> +
)} {sample.data && !sample.data.alreadyImported && ( - +

将向草稿添加{" "} {Object.entries(sample.data.counts) .map(([key, count]) => `${key} ${count} 项`) .join("、")} ;发布前请替换示例文案和图片。 - +

)} -
-
- )} - {activeTab === "content" && ( - -
- 3. 检查并发布 - - - {currentRelease ? `已发布 v${currentRelease.version}` : "尚未发布"} - - + + +
    +
  • +
    +
    + {brand.data?.name || "未命名品牌"} + + {brand.data?.tagline || "尚未填写品牌定位"} + +
    +
    +
  • +
  • +
    +
    + 已启用业务项 + + {draftOfferings.map((item) => item.name).join("、") || "无"} + +
    +
    +
  • +
  • +
    +
    + 已启用咨询表单 + + {draftForms + .filter((item) => item.isEnabled) + .map((item) => item.name) + .join("、") || "无"} + +
    +
    +
  • +
+ + + + - +
+ + + +
+ } + > +
    {(readiness.data?.checks ?? []).map((check) => ( - - - {check.passed ? "已完成" : "待完善"} - - {check.label} - {check.help ? ( - {check.help} - ) : null} - {!check.passed && ( +
  • +
    +
    + + {check.label} + {check.help ? {check.help} : null} +
    +
    + {!check.passed ? ( - )} - + ) : null} +
  • ))} -
    - +
+ - )} - + ) : null} + ))} - + ) : ( - + )} -
-
- 2. 核对草稿内容 - - 此处核对的是待发布内容,不是小程序视觉预览。 - - - {brand.data?.name || "未命名品牌"} - {brand.data?.tagline || "尚未填写品牌定位"} - - 已启用业务项:{draftOfferings.map((item) => item.name).join("、") || "无"} - - - 已启用咨询表单: - {draftForms - .filter((item) => item.isEnabled) - .map((item) => item.name) - .join("、") || "无"} - - - - - - - -
-
+ +
)} {activeTab === "miniapp" && ( - -
- 小程序代码发布 - - 使用微信官方 miniprogram-ci 上传代码;审核与发布状态需按微信平台结果人工确认。 - - - - {miniAppSettings.data?.hasStoredCredentials ? ( - 已配置上传凭据 - ) : ( - 未配置上传凭据 - )} - - +
+ + + {miniAppSettings.data?.hasStoredCredentials ? ( + + ) : ( + + )} + + } + > {miniAppReleases.data?.length ? ( - +
{miniAppReleases.data.map((task) => ( updateMiniAppStatus.mutate({ id: task.id, status })} /> ))} - +
) : ( - + )} -
-
+ +
)} ) : ( - +
当前草稿将成为品牌新的公开版本。 - +
)}
{offeringKindLabels[String(value)] ?? String(value)}, + render: (value: unknown) => ( + + ), }, { title: "价格", dataIndex: "priceText" }, { title: "状态", dataIndex: "isEnabled", - render: (value: boolean) => (value ? "已启用" : "已停用"), + render: (value: boolean) => ( + + ), }, { title: "操作", render: (_: unknown, item: Offering) => ( -