Commit f8637263 by 胡悦

refactor: 重构独立页面布局,优化详情抽屉样式

为 Agent、Skill、渠道活码的详情抽屉添加统一左右20px内边距,提升页面视觉一致性
新增IndependentPageLayout通用布局组件,替换原有sticky页头方案,将独立页面改为主体内容内部滚动以解决视觉错位问题
更新所有关联的独立页面代码与测试用例,适配新布局规范
更新admin-shell开放规范,明确独立页面滚动规则与页头布局要求
清理已废弃的openspec变更提案与归档文件
1 parent 95942b28
Showing 23 changed files with 82 additions and 292 deletions
# Design: 修复独立页面页头吸顶错位
## 方案
独立页面继续渲染在 `BusinessAdminShell` 的内容区内。页面自身不创建新的全屏 `fixed` header,也不通过 `margin-top`、`padding-top` 或 `height: calc(100vh - xx)` 为 fixed header 手动补位。
独立页面的页头操作区使用 sticky 吸顶:
- sticky 元素位于页面内容结构顶部。
- sticky 的 `top` 相对于后台内容滚动容器,默认为 `0`。
- sticky 页头必须具备不透明背景、边框和足够 `z-index`,避免内容滚动时视觉穿透。
- 页头右侧操作区必须 `shrink-0`,避免标题过长时挤压 `返回`、`保存` 等按钮。
## 实现策略
优先收敛独立页面页头的通用 class 或组件样式,减少各页面复制 `sticky top-0` 时出现细节漂移。若短期先改页面 class,也必须保持同一套布局规则。
需要重点检查以下页面类型:
- Agent 新增/编辑页。
- 岗位标签新增/编辑页。
- 员工渠道活码新增/编辑页。
- 官网岗位展示新增/编辑页。
- 官网 Agent 展示配置页。
## 风险与处理
- 风险:sticky 元素被外层异常 `overflow`、`transform` 或额外滚动容器影响。处理:验证 sticky 参照为后台内容滚动容器,并避免在独立页根节点再创建不必要的全屏滚动。
- 风险:页头吸顶后覆盖首段内容。处理:保持页头仍占据文档流位置,不使用 fixed,因此内容自然从页头后开始。
- 风险:长标题挤压操作按钮。处理:标题区域 `min-width: 0`,操作区 `shrink-0`。
## 验证
- 运行相关单元测试或组件测试。
- 运行类型检查。
- 使用浏览器打开一个长表单独立页,滚动页面,确认页头吸顶、操作按钮可点击、内容不穿透且无双滚动条。
# Proposal: 修复独立页面页头吸顶错位
## 背景
管理后台独立新增、编辑和配置页面已经要求页头操作区在滚动时保持可见,但当前实现和规范没有明确页头吸顶必须以内容滚动容器为参照,也没有明确禁止使用 `fixed` 加手动补位。页面滚动时容易出现页头、内容卡片和全局 header 的视觉错位。
## 目标
- 独立页面页头使用 `position: sticky` 在页面内容滚动容器内吸顶。
- 独立页面页头不得使用 `position: fixed` 脱离后台 shell 布局。
- 页面内容滚动时,页头背景、边框和层级保持稳定,滚动内容不得穿透或覆盖页头。
- 保持现有页面的返回、保存、校验、请求和路由行为不变。
## 非目标
- 不调整全局后台 shell 的菜单、面包屑、用户区和退出登录行为。
- 不改变列表页滚动模型、表格分页、筛选或虚拟滚动规则。
- 不改变独立页面字段、保存 payload、权限和业务状态。
## 影响范围
- 影响项目 OpenSpec:`openspec/specs/admin-shell/spec.md`。
- 影响前端实现:独立新增、编辑、配置页面的页头吸顶样式和必要的共享样式收敛。
- 影响验证:需要覆盖至少一个长表单独立页滚动时页头吸顶且不遮挡操作按钮。
# admin-shell Delta
## MODIFIED Requirements
### Requirement: 独立页面页头操作区
岗位 Agent 管理后台 SHALL 为新增、编辑、配置等独立页面提供一致且滚动可见的页头操作区。页头左侧只展示页面标题、说明和状态摘要等页面识别信息;页头右侧 MUST 展示 `返回` 和其他页面级操作按钮。独立页面页头 MUST 使用内容滚动容器内的 sticky 吸顶实现,不得使用 `position: fixed` 脱离后台 shell 布局。
#### Scenario: 独立页面右侧集中展示操作按钮
- **WHEN** 已登录用户打开新增、编辑、配置等独立页面
- **THEN** 独立页面页头左侧展示页面标题和必要说明
- **AND** 独立页面页头左侧不展示 `返回` 入口或其他按钮
- **AND** 独立页面页头右侧展示 `返回` 入口
- **AND** 独立页面页头右侧展示 `保存` 等主操作
- **AND** 独立页面页头右侧不展示 `取消` 按钮
#### Scenario: 右侧操作区按钮排序
- **WHEN** 独立页面页头右侧同时存在 `返回`、主操作和其他页面级操作
- **THEN** `返回` 位于右侧操作区内靠左位置
- **AND** 主操作位于右侧操作区内靠右位置
- **AND** 其他次级页面级操作位于 `返回` 和主操作之间,或收敛到更多操作菜单
#### Scenario: 滚动时保持页头操作区可见
- **WHEN** 已登录用户在新增、编辑、配置等独立页面向下滚动表单内容
- **THEN** 独立页面页头操作区使用 sticky 方式保持在内容滚动容器顶部可见
- **AND** 独立页面页头不得使用 fixed 定位或依赖页面级手动补位保持可见
- **AND** `返回` 和 `保存` 等页面级操作入口保持可点击
- **AND** 滚动内容不得覆盖页头操作区
- **AND** 页头右侧操作区不得被页面标题或说明挤压到不可见
# Tasks
## 1. OpenSpec
- [x] 1.1 新增 `admin-shell` 规范 delta,明确独立页面页头必须在内容滚动容器内 sticky 吸顶。
- [x] 1.2 明确独立页面页头不得使用 fixed 和手动补位。
- [x] 1.3 运行 `openspec validate fix-independent-page-sticky-header --strict`。
## 2. 实现
- [ ] 2.1 检查独立页面页头实现,识别导致 sticky 错位的外层滚动或样式问题。
- [ ] 2.2 收敛独立页面页头吸顶样式,保持 `返回`、`保存` 等操作在右侧可见。
- [ ] 2.3 清理独立页面中与 fixed header 补位相关的样式,如 `margin-top`、`padding-top` 或不必要的 `height: calc(...)`。
## 3. 验证
- [ ] 3.1 运行相关测试。
- [ ] 3.2 运行类型检查。
- [ ] 3.3 浏览器验证长表单独立页滚动时页头吸顶、无错位、无双滚动条、按钮可点击。
## Context
`migrate-admin-ui-to-global-tdesign` 已归档,后台运行时代码的 UI 依赖边界已经收敛:基础控件直接来自 `tdesign-react`,图标来自 `tdesign-icons-react`,业务组合能力来自 `@gl/business-components`。当前剩余问题是旧目录 `workspace/agent-admin/web/packages/ui` 仍存在,且 `tsconfig.app.json` 仍 include `packages/ui/src`。
## Goals / Non-Goals
**Goals:**
- 删除旧本地 UI 包源码目录,消除新的误用入口。
- 让后台 TypeScript 配置不再纳入旧包源码。
- 更新当前协作文档和稳定规范,使当前组件来源与实际实现一致。
- 保留运行时 import 扫描门禁,防止后续重新引入旧路径。
**Non-Goals:**
- 不修改页面交互、业务逻辑、接口契约或路由结构。
- 不迁移或重构 `@gl/business-components`。
- 不批量改写历史 archive 中的迁移记录。
- 不处理 `workspace/agent-admin/single-page`。
## Decisions
1. 删除旧目录,而不是仅标记废弃。
旧目录已经不再被 `web/src` 运行时代码引用,保留源码只会让搜索、IDE 补全和人工维护继续暴露过时入口。删除目录后,误用会直接变成路径不存在,边界更清楚。
2. 保留 `check:local-ui-runtime-deps` 和 `scan:local-ui-runtime-deps`。
即使旧目录删除,扫描脚本仍能防止运行时代码重新引入 `packages/ui` 风格的路径或相对旧路径引用。该门禁成本低,且与迁移验收目标一致。
3. 当前文档只更新活跃协作口径,历史 archive 不改写。
archive 是迁移过程记录,保留旧描述有助于追溯;当前 README、基础文档和稳定 spec 才代表最新工程约束。
## Risks / Trade-offs
- 历史迁移测试或文档如果仍假设旧目录存在,删除后可能暴露陈旧断言。缓解方式:先搜索当前引用,再只更新活跃配置、文档和必要测试。
- 删除旧组件测试会减少旧组件自身的测试覆盖,但这些组件已不是当前产品运行时能力。缓解方式:当前页面、全局业务组件和 TDesign 迁移后的测试继续覆盖实际用户路径。
- 若第三方或本地脚本仍手动读取 `web/packages/ui`,删除会使脚本失败。缓解方式:用 `rg` 和现有扫描命令确认当前仓库无运行时依赖,并在最终说明中标出删除范围。
## Migration Plan
1. 删除 `workspace/agent-admin/web/packages/ui`。
2. 更新 `tsconfig.app.json`,移除 `packages/ui/src`。
3. 更新当前 README、前端基础文档和 `admin-ui-runtime-dependency` 稳定规范。
4. 运行 `npm run scan:local-ui-runtime-deps`、`npm run typecheck`、`npm test` 和 `openspec validate remove-local-ui-package --strict`。
## Open Questions
无。
## Why
后台页面已经完成 TDesign 与全局业务组件迁移,`workspace/agent-admin/web/src` 对本地 `packages/ui` 的运行时 import 为 0。继续保留 `workspace/agent-admin/web/packages/ui` 会制造误用入口,并让当前构建配置和规范仍背负旧组件包。
## What Changes
- 删除 `workspace/agent-admin/web/packages/ui` 旧本地 UI 组件源码目录。
- 从后台应用 TypeScript 配置中移除 `packages/ui/src`。
- 更新当前后台 README、前端基础文档和稳定规范,把当前组件来源明确为 `tdesign-react`、`tdesign-icons-react` 和 `@gl/business-components`。
- 保留本地 UI 运行时依赖扫描脚本,继续作为防止 `web/src` 重新引入旧路径的门禁。
- 不修改后台页面业务逻辑、路由、接口契约和 `@gl/business-components`。
## Capabilities
### New Capabilities
- 无。
### Modified Capabilities
- `admin-ui-runtime-dependency`: 将旧本地 UI 包的策略从“迁移后暂时保留”调整为“清理删除,并从当前类型检查范围移除”。
## Impact
- 受影响目录:`workspace/agent-admin/web/packages/ui`。
- 受影响配置:`workspace/agent-admin/web/tsconfig.app.json`。
- 受影响文档:`workspace/agent-admin/web/README.md`、`workspace/agent-admin/web/docs/frontend-foundation.md`、`workspace/agent-admin/web/openspec/specs/admin-ui-runtime-dependency/spec.md`。
- 不影响后端 API、页面行为、根目录 `packages/business-components` 和历史 OpenSpec archive。
## MODIFIED Requirements
### Requirement: 后台运行时代码不再依赖本地 UI 包
系统 MUST 让 `workspace/agent-admin/web/src` 中的运行时代码不再从 `workspace/agent-admin/web/packages/ui` 或其子路径引入组件、类型或工具,并且后台应用类型检查范围 MUST 不再纳入旧本地 UI 包源码目录。
#### Scenario: 扫描后台运行时 import
- **WHEN** 对 `workspace/agent-admin/web/src` 执行本地 UI 包依赖扫描
- **THEN** 扫描结果不包含指向 `packages/ui` 或 `packages/ui/src` 的运行时 import
#### Scenario: 类型检查不纳入旧本地 UI 包
- **WHEN** 查看 `workspace/agent-admin/web/tsconfig.app.json`
- **THEN** `include` 不包含 `packages/ui/src`
## REMOVED Requirements
### Requirement: 旧本地 UI 包目录暂时保留
系统 MUST 在本轮迁移中保留 `workspace/agent-admin/web/packages/ui` 目录,不把旧源码删除作为零运行时依赖验收条件。
#### Scenario: 完成运行时依赖迁移
- **WHEN** `workspace/agent-admin/web/src` 已达到零本地 UI 包运行时依赖
- **THEN** `workspace/agent-admin/web/packages/ui` 目录仍可保留,等待后续独立清理
## ADDED Requirements
### Requirement: 旧本地 UI 包源码已删除
系统 MUST 删除 `workspace/agent-admin/web/packages/ui` 遗留源码目录,并且当前后台协作文档 MUST 不再把该目录描述为当前组件入口或保留目标。
#### Scenario: 旧本地 UI 包目录不存在
- **WHEN** 检查 `workspace/agent-admin/web/packages/ui`
- **THEN** 该路径不存在
#### Scenario: 当前文档说明新的组件来源
- **WHEN** 查看当前后台 README 和前端基础文档
- **THEN** 文档将基础控件来源描述为 `tdesign-react` / `tdesign-icons-react`
- **AND** 文档将业务组合组件来源描述为 `@gl/business-components`
- **AND** 文档不要求保留 `workspace/agent-admin/web/packages/ui`
## 1. 建立清理基线
- [x] 1.1 扫描 `workspace/agent-admin/web/src`,确认当前运行时代码对 `packages/ui` 为 0 import
- [x] 1.2 搜索当前配置、文档和测试中仍引用 `workspace/agent-admin/web/packages/ui` 或 `packages/ui/src` 的位置
## 2. 清理旧本地 UI 包
- [x] 2.1 删除 `workspace/agent-admin/web/packages/ui` 旧源码目录
- [x] 2.2 从 `workspace/agent-admin/web/tsconfig.app.json` 移除 `packages/ui/src`
- [x] 2.3 更新当前后台 README 和前端基础文档的组件来源说明
- [x] 2.4 更新 `admin-ui-runtime-dependency` 稳定规范,移除“旧本地 UI 包目录暂时保留”要求
## 3. 验证
- [x] 3.1 运行 `npm run scan:local-ui-runtime-deps`
- [x] 3.2 运行 `npm run typecheck`
- [x] 3.3 运行 `npm test`
- [x] 3.4 运行 `openspec validate remove-local-ui-package --strict`
...@@ -97,7 +97,7 @@ TBD - created by archiving change add-admin-login-agent-list-mock. Update Purpos ...@@ -97,7 +97,7 @@ TBD - created by archiving change add-admin-login-agent-list-mock. Update Purpos
- **AND** 点击二级菜单面包屑项返回该二级菜单页面 - **AND** 点击二级菜单面包屑项返回该二级菜单页面
### Requirement: 独立页面页头操作区 ### Requirement: 独立页面页头操作区
岗位 Agent 管理后台 SHALL 为新增、编辑、配置等独立页面提供一致且滚动可见的页头操作区。页头左侧只展示页面标题、说明和状态摘要等页面识别信息;页头右侧 MUST 展示 `返回` 和其他页面级操作按钮。 岗位 Agent 管理后台 SHALL 为新增、编辑、配置等独立页面提供一致且滚动稳定的页头操作区。页头左侧只展示页面标题、说明和状态摘要等页面识别信息;页头右侧 MUST 展示 `返回` 和其他页面级操作按钮。独立页面 MUST 避免浏览器窗口或后台 shell 外层整屏滚动;长内容 SHALL 在独立页面主体内容区内部滚动。独立页面页头 MUST 使用普通文档流布局,不得使用 `position: sticky` 或 `position: fixed`。
#### Scenario: 独立页面右侧集中展示操作按钮 #### Scenario: 独立页面右侧集中展示操作按钮
- **WHEN** 已登录用户打开新增、编辑、配置等独立页面 - **WHEN** 已登录用户打开新增、编辑、配置等独立页面
...@@ -113,10 +113,13 @@ TBD - created by archiving change add-admin-login-agent-list-mock. Update Purpos ...@@ -113,10 +113,13 @@ TBD - created by archiving change add-admin-login-agent-list-mock. Update Purpos
- **AND** 主操作位于右侧操作区内靠右位置 - **AND** 主操作位于右侧操作区内靠右位置
- **AND** 其他次级页面级操作位于 `返回` 和主操作之间,或收敛到更多操作菜单 - **AND** 其他次级页面级操作位于 `返回` 和主操作之间,或收敛到更多操作菜单
#### Scenario: 滚动时保持页头操作区可见 #### Scenario: 独立页面主体内容内部滚动
- **WHEN** 已登录用户在新增、编辑、配置等独立页面向下滚动表单内容 - **WHEN** 已登录用户在新增、编辑、配置等独立页面查看长表单内容
- **THEN** 独立页面页头操作区保持在内容滚动容器顶部可见 - **THEN** 浏览器窗口和后台 shell 外层不得发生整屏滚动
- **AND** 独立页面页头操作区保持在独立页面可视区域顶部
- **AND** 独立页面页头不得使用 sticky 或 fixed 定位
- **AND** 长表单内容在独立页面主体内容区内部滚动
- **AND** `返回` 和 `保存` 等页面级操作入口保持可点击 - **AND** `返回` 和 `保存` 等页面级操作入口保持可点击
- **AND** 滚动内容不得覆盖页头操作区 - **AND** 页面不得出现互相竞争的双滚动条
- **AND** 页头右侧操作区不得被页面标题或说明挤压到不可见 - **AND** 页头右侧操作区不得被页面标题或说明挤压到不可见
...@@ -18,6 +18,7 @@ import { ...@@ -18,6 +18,7 @@ import {
} from '../../api/positionTag'; } from '../../api/positionTag';
import { trackCustomEvent } from '../../api/tracking'; import { trackCustomEvent } from '../../api/tracking';
import { useDeferredEffect } from '../../hooks/useDeferredEffect'; import { useDeferredEffect } from '../../hooks/useDeferredEffect';
import { IndependentPageBody, IndependentPageHeader, IndependentPageLayout } from '../components/IndependentPageLayout';
import { buildAgentTagListSearch, readAgentTagListRouteState } from './agentTagRouteState'; import { buildAgentTagListSearch, readAgentTagListRouteState } from './agentTagRouteState';
interface TagFormState extends BusinessFormValues { interface TagFormState extends BusinessFormValues {
...@@ -162,8 +163,8 @@ export function AgentTagEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -162,8 +163,8 @@ export function AgentTagEditorPage({ mode }: { mode: 'create' | 'edit' }) {
}; };
return ( return (
<section className="grid gap-6"> <IndependentPageLayout>
<header className="sticky top-0 z-10 flex items-start justify-between gap-6 rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-6"> <IndependentPageHeader>
<div aria-label="页面标题" className="min-w-0 flex-1"> <div aria-label="页面标题" className="min-w-0 flex-1">
<h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]">{mode === 'create' ? '新建岗位标签' : '编辑岗位标签'}</h2> <h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]">{mode === 'create' ? '新建岗位标签' : '编辑岗位标签'}</h2>
<p className="m-0 mt-1 text-sm text-[var(--gl-color-text-secondary)]"> <p className="m-0 mt-1 text-sm text-[var(--gl-color-text-secondary)]">
...@@ -174,7 +175,7 @@ export function AgentTagEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -174,7 +175,7 @@ export function AgentTagEditorPage({ mode }: { mode: 'create' | 'edit' }) {
<Button variant="outline" onClick={goBackToList}>返回</Button> <Button variant="outline" onClick={goBackToList}>返回</Button>
<Button theme="primary" loading={saving} onClick={handleSave}>保存</Button> <Button theme="primary" loading={saving} onClick={handleSave}>保存</Button>
</div> </div>
</header> </IndependentPageHeader>
{notice ? ( {notice ? (
<div <div
...@@ -186,7 +187,7 @@ export function AgentTagEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -186,7 +187,7 @@ export function AgentTagEditorPage({ mode }: { mode: 'create' | 'edit' }) {
</div> </div>
) : null} ) : null}
<div className="rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-10"> <IndependentPageBody className="rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-10">
<div className="mx-auto grid max-w-[760px] gap-6"> <div className="mx-auto grid max-w-[760px] gap-6">
<BusinessForm <BusinessForm
fields={fields} fields={fields}
...@@ -197,7 +198,7 @@ export function AgentTagEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -197,7 +198,7 @@ export function AgentTagEditorPage({ mode }: { mode: 'create' | 'edit' }) {
onChange={(nextValues) => setForm(nextValues as TagFormState)} onChange={(nextValues) => setForm(nextValues as TagFormState)}
/> />
</div> </div>
</div> </IndependentPageBody>
</section> </IndependentPageLayout>
); );
} }
...@@ -279,7 +279,11 @@ describe('Agent tag create and edit pages', () => { ...@@ -279,7 +279,11 @@ describe('Agent tag create and edit pages', () => {
await screen.findByRole('heading', { name: '新建岗位标签' }); await screen.findByRole('heading', { name: '新建岗位标签' });
const pageHeader = screen.getByRole('heading', { name: '新建岗位标签' }).closest('header') as HTMLElement; const pageHeader = screen.getByRole('heading', { name: '新建岗位标签' }).closest('header') as HTMLElement;
expect(pageHeader).toHaveClass('sticky', 'top-0', 'z-10'); const pageRoot = pageHeader.closest('section') as HTMLElement;
expect(pageRoot).toHaveClass('h-full', 'min-h-0', 'overflow-hidden');
expect(pageHeader).toHaveClass('shrink-0', 'bg-[var(--gl-color-bg-container)]');
expect(pageHeader).not.toHaveClass('sticky', 'top-0', 'z-10');
expect(pageRoot.querySelector('.flex-1.overflow-y-auto')).toBeInTheDocument();
expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument(); expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument();
const pageActions = screen.getByLabelText('页面操作'); const pageActions = screen.getByLabelText('页面操作');
expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument(); expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument();
......
...@@ -48,6 +48,7 @@ export function AgentDetailDrawer({ agentId, routeState }: { agentId?: string; r ...@@ -48,6 +48,7 @@ export function AgentDetailDrawer({ agentId, routeState }: { agentId?: string; r
visible visible
header="Agent详情" header="Agent详情"
size="520px" size="520px"
className="detail-drawer"
destroyOnClose destroyOnClose
closeBtn={<Button aria-label="关闭Agent详情" icon={<CloseIcon />} shape="square" variant="text" />} closeBtn={<Button aria-label="关闭Agent详情" icon={<CloseIcon />} shape="square" variant="text" />}
onClose={closeDrawer} onClose={closeDrawer}
......
...@@ -169,15 +169,19 @@ describe('Agent editor routes and detail drawer', () => { ...@@ -169,15 +169,19 @@ describe('Agent editor routes and detail drawer', () => {
vi.mocked(reportAnalyticsEvents).mockResolvedValue({ success: true }); vi.mocked(reportAnalyticsEvents).mockResolvedValue({ success: true });
}); });
it('renders the new page with sticky header actions and returns to the list context from the header return', async () => { it('renders the new page with contained body scrolling and returns to the list context from the header return', async () => {
renderAgents('/agents/new?keyword=复盘&page=2&pageSize=20'); renderAgents('/agents/new?keyword=复盘&page=2&pageSize=20');
await waitFor(() => { await waitFor(() => {
expect(screen.getByRole('heading', { name: '新建Agent' })).toBeInTheDocument(); expect(screen.getByRole('heading', { name: '新建Agent' })).toBeInTheDocument();
}); });
const pageHeader = screen.getByRole('heading', { name: '新建Agent' }).closest('header') as HTMLElement; const pageHeader = screen.getByRole('heading', { name: '新建Agent' }).closest('header') as HTMLElement;
const pageRoot = pageHeader.closest('section') as HTMLElement;
expect(within(screen.getByLabelText('左侧导航')).getByText('Agent列表').closest('li')).toHaveClass('t-is-active'); expect(within(screen.getByLabelText('左侧导航')).getByText('Agent列表').closest('li')).toHaveClass('t-is-active');
expect(pageHeader).toHaveClass('sticky', 'top-0', 'z-10'); expect(pageRoot).toHaveClass('h-full', 'min-h-0', 'overflow-hidden');
expect(pageHeader).toHaveClass('shrink-0', 'bg-[var(--gl-color-bg-container)]');
expect(pageHeader).not.toHaveClass('sticky', 'top-0', 'z-10');
expect(pageRoot.querySelector('.flex-1.overflow-y-auto')).toBeInTheDocument();
expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument(); expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument();
const pageActions = screen.getByLabelText('页面操作'); const pageActions = screen.getByLabelText('页面操作');
expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument(); expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument();
......
...@@ -15,6 +15,7 @@ import { getEmployeeMounts, getAgentDetail, getAgentList, createAgent, updateAge ...@@ -15,6 +15,7 @@ import { getEmployeeMounts, getAgentDetail, getAgentList, createAgent, updateAge
import { getSkillList, type SkillSummary } from '../../api/skill'; import { getSkillList, type SkillSummary } from '../../api/skill';
import { trackCustomEvent } from '../../api/tracking'; import { trackCustomEvent } from '../../api/tracking';
import { useDeferredEffect } from '../../hooks/useDeferredEffect'; import { useDeferredEffect } from '../../hooks/useDeferredEffect';
import { IndependentPageBody, IndependentPageHeader, IndependentPageLayout } from '../components/IndependentPageLayout';
import { upsertSavedAgent } from './agentLocalStore'; import { upsertSavedAgent } from './agentLocalStore';
import { buildAgentListSearch, readAgentListRouteState } from './agentRouteState'; import { buildAgentListSearch, readAgentListRouteState } from './agentRouteState';
import { isApiError } from '../../api/client'; import { isApiError } from '../../api/client';
...@@ -576,8 +577,8 @@ export function AgentEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -576,8 +577,8 @@ export function AgentEditorPage({ mode }: { mode: 'create' | 'edit' }) {
}; };
return ( return (
<section className="grid gap-6"> <IndependentPageLayout>
<header className="sticky top-0 z-10 flex items-start justify-between gap-6 rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-6"> <IndependentPageHeader>
<div aria-label="页面标题" className="min-w-0 flex-1"> <div aria-label="页面标题" className="min-w-0 flex-1">
<h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]">{title}</h2> <h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]">{title}</h2>
<p className="m-0 mt-1 text-sm text-[var(--gl-color-text-secondary)]"> <p className="m-0 mt-1 text-sm text-[var(--gl-color-text-secondary)]">
...@@ -588,7 +589,7 @@ export function AgentEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -588,7 +589,7 @@ export function AgentEditorPage({ mode }: { mode: 'create' | 'edit' }) {
<Button variant="outline" onClick={() => goBackToList(Boolean(routeState.detail && mode === 'edit'))}>返回</Button> <Button variant="outline" onClick={() => goBackToList(Boolean(routeState.detail && mode === 'edit'))}>返回</Button>
<Button theme="primary" loading={saveLoading} onClick={handleSave}>保存</Button> <Button theme="primary" loading={saveLoading} onClick={handleSave}>保存</Button>
</div> </div>
</header> </IndependentPageHeader>
{saveError ? ( {saveError ? (
<StatePlaceholder <StatePlaceholder
...@@ -599,7 +600,7 @@ export function AgentEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -599,7 +600,7 @@ export function AgentEditorPage({ mode }: { mode: 'create' | 'edit' }) {
/> />
) : null} ) : null}
<div className="rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-10"> <IndependentPageBody className="rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-10">
<BusinessForm <BusinessForm
fields={fields} fields={fields}
values={form} values={form}
...@@ -610,7 +611,7 @@ export function AgentEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -610,7 +611,7 @@ export function AgentEditorPage({ mode }: { mode: 'create' | 'edit' }) {
setForm((current) => ({ ...current, ...nextValues } as AgentFormState)); setForm((current) => ({ ...current, ...nextValues } as AgentFormState));
}} }}
/> />
</div> </IndependentPageBody>
</section> </IndependentPageLayout>
); );
} }
...@@ -224,7 +224,11 @@ describe('Channel code create page', () => { ...@@ -224,7 +224,11 @@ describe('Channel code create page', () => {
expect(screen.getByRole('heading', { name: '新增员工渠道活码' })).toBeInTheDocument(); expect(screen.getByRole('heading', { name: '新增员工渠道活码' })).toBeInTheDocument();
}); });
const pageHeader = screen.getByRole('heading', { name: '新增员工渠道活码' }).closest('header') as HTMLElement; const pageHeader = screen.getByRole('heading', { name: '新增员工渠道活码' }).closest('header') as HTMLElement;
expect(pageHeader).toHaveClass('sticky', 'top-0', 'z-10'); const pageRoot = pageHeader.closest('section') as HTMLElement;
expect(pageRoot).toHaveClass('h-full', 'min-h-0', 'overflow-hidden');
expect(pageHeader).toHaveClass('shrink-0', 'items-center', 'bg-[var(--gl-color-bg-container)]');
expect(pageHeader).not.toHaveClass('sticky', 'top-0', 'z-10');
expect(pageRoot.querySelector('.flex-1.overflow-y-auto')).toBeInTheDocument();
expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument(); expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument();
const pageActions = screen.getByLabelText('页面操作'); const pageActions = screen.getByLabelText('页面操作');
expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument(); expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument();
......
...@@ -25,6 +25,7 @@ import { ...@@ -25,6 +25,7 @@ import {
type PositionTagListItem, type PositionTagListItem,
} from '../../api/positionTag'; } from '../../api/positionTag';
import { useDeferredEffect } from '../../hooks/useDeferredEffect'; import { useDeferredEffect } from '../../hooks/useDeferredEffect';
import { IndependentPageBody, IndependentPageHeader, IndependentPageLayout } from '../components/IndependentPageLayout';
interface ChannelCodeFormState extends BusinessFormValues { interface ChannelCodeFormState extends BusinessFormValues {
qrcode_name: string; qrcode_name: string;
...@@ -413,8 +414,8 @@ export function ChannelCodeEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -413,8 +414,8 @@ export function ChannelCodeEditorPage({ mode }: { mode: 'create' | 'edit' }) {
}; };
return ( return (
<section className="grid gap-6"> <IndependentPageLayout>
<header className="sticky top-0 z-10 flex items-start justify-between gap-6 rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-6"> <IndependentPageHeader>
<div aria-label="页面标题" className="min-w-0 flex-1"> <div aria-label="页面标题" className="min-w-0 flex-1">
<h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]"> <h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]">
{mode === 'create' ? '新增员工渠道活码' : '编辑员工渠道活码'} {mode === 'create' ? '新增员工渠道活码' : '编辑员工渠道活码'}
...@@ -427,7 +428,7 @@ export function ChannelCodeEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -427,7 +428,7 @@ export function ChannelCodeEditorPage({ mode }: { mode: 'create' | 'edit' }) {
<Button variant="outline" onClick={goBackToList}>返回</Button> <Button variant="outline" onClick={goBackToList}>返回</Button>
<Button theme="primary" loading={saving} onClick={handleSave}>保存</Button> <Button theme="primary" loading={saving} onClick={handleSave}>保存</Button>
</div> </div>
</header> </IndependentPageHeader>
{notice ? ( {notice ? (
<div <div
...@@ -443,7 +444,7 @@ export function ChannelCodeEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -443,7 +444,7 @@ export function ChannelCodeEditorPage({ mode }: { mode: 'create' | 'edit' }) {
</div> </div>
) : null} ) : null}
<div className="rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-10"> <IndependentPageBody className="rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-10">
<div className="mx-auto grid max-w-[760px] gap-6"> <div className="mx-auto grid max-w-[760px] gap-6">
<BusinessForm <BusinessForm
fields={fields} fields={fields}
...@@ -454,7 +455,7 @@ export function ChannelCodeEditorPage({ mode }: { mode: 'create' | 'edit' }) { ...@@ -454,7 +455,7 @@ export function ChannelCodeEditorPage({ mode }: { mode: 'create' | 'edit' }) {
onChange={(nextValues) => setForm(nextValues as ChannelCodeFormState)} onChange={(nextValues) => setForm(nextValues as ChannelCodeFormState)}
/> />
</div> </div>
</div> </IndependentPageBody>
</section> </IndependentPageLayout>
); );
} }
...@@ -74,6 +74,7 @@ export function ChannelCodeViewDrawer({ open, qrcodeId, onClose }: ChannelCodeVi ...@@ -74,6 +74,7 @@ export function ChannelCodeViewDrawer({ open, qrcodeId, onClose }: ChannelCodeVi
visible={open} visible={open}
header={detail?.qrcode_name ?? '渠道活码详情'} header={detail?.qrcode_name ?? '渠道活码详情'}
closeBtn={<Button aria-label={`关闭${detail?.qrcode_name ?? '渠道活码详情'}`} icon={<CloseIcon />} shape="square" variant="text" />} closeBtn={<Button aria-label={`关闭${detail?.qrcode_name ?? '渠道活码详情'}`} icon={<CloseIcon />} shape="square" variant="text" />}
className="detail-drawer"
destroyOnClose destroyOnClose
onClose={onClose} onClose={onClose}
size="480px" size="480px"
......
import type { HTMLAttributes, ReactNode } from 'react'; import type { ReactNode } from 'react';
const rootClassName = 'flex h-full min-h-0 flex-col gap-6 overflow-hidden'; const rootClassName = 'flex h-full min-h-0 flex-col gap-6 overflow-hidden';
const headerClassName = const headerClassName =
...@@ -13,10 +13,6 @@ export function IndependentPageHeader({ children }: { children: ReactNode }) { ...@@ -13,10 +13,6 @@ export function IndependentPageHeader({ children }: { children: ReactNode }) {
return <header className={headerClassName}>{children}</header>; return <header className={headerClassName}>{children}</header>;
} }
export function IndependentPageBody({ export function IndependentPageBody({ children, className = '' }: { children: ReactNode; className?: string }) {
children, return <div className={`${bodyClassName} ${className}`.trim()}>{children}</div>;
className = '',
...restProps
}: { children: ReactNode; className?: string } & HTMLAttributes<HTMLDivElement>) {
return <div className={`${bodyClassName} ${className}`.trim()} {...restProps}>{children}</div>;
} }
...@@ -12,6 +12,7 @@ import { ...@@ -12,6 +12,7 @@ import {
import { getOfficialSiteTabDetail, type OfficialSiteTabDetail } from '../../api/officialSiteTab'; import { getOfficialSiteTabDetail, type OfficialSiteTabDetail } from '../../api/officialSiteTab';
import { useTrackPageView } from '../../api/tracking'; import { useTrackPageView } from '../../api/tracking';
import { useDeferredEffect } from '../../hooks/useDeferredEffect'; import { useDeferredEffect } from '../../hooks/useDeferredEffect';
import { IndependentPageBody, IndependentPageHeader, IndependentPageLayout } from '../components/IndependentPageLayout';
import { AgentDisplayConfigEditModal } from './AgentDisplayConfigEditModal'; import { AgentDisplayConfigEditModal } from './AgentDisplayConfigEditModal';
function mapAgentStatusToText(status: AgentStatus): string { function mapAgentStatusToText(status: AgentStatus): string {
...@@ -72,19 +73,19 @@ export function OfficialSiteAgentDisplayConfigPage() { ...@@ -72,19 +73,19 @@ export function OfficialSiteAgentDisplayConfigPage() {
// Loading state // Loading state
if (loading) { if (loading) {
return ( return (
<section className="grid gap-6"> <IndependentPageLayout>
<header className="sticky top-0 z-10 flex items-start justify-between gap-6 rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-6"> <IndependentPageHeader>
<div aria-label="页面标题" className="min-w-0 flex-1"> <div aria-label="页面标题" className="min-w-0 flex-1">
<h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]">Agent展示配置页</h2> <h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]">Agent展示配置页</h2>
</div> </div>
<div aria-label="页面操作" className="flex shrink-0 items-center gap-2"> <div aria-label="页面操作" className="flex shrink-0 items-center gap-2">
<Button variant="outline" onClick={goBackToList}>返回</Button> <Button variant="outline" onClick={goBackToList}>返回</Button>
</div> </div>
</header> </IndependentPageHeader>
<div className="grid gap-4 rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] p-6"> <IndependentPageBody className="grid gap-4 rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] p-6">
<p className="text-sm text-[var(--gl-color-text-secondary)]">加载中...</p> <p className="text-sm text-[var(--gl-color-text-secondary)]">加载中...</p>
</div> </IndependentPageBody>
</section> </IndependentPageLayout>
); );
} }
...@@ -168,8 +169,8 @@ export function OfficialSiteAgentDisplayConfigPage() { ...@@ -168,8 +169,8 @@ export function OfficialSiteAgentDisplayConfigPage() {
]; ];
return ( return (
<section className="grid gap-6"> <IndependentPageLayout>
<header className="sticky top-0 z-10 flex items-start justify-between gap-6 rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-6"> <IndependentPageHeader>
<div aria-label="页面标题" className="min-w-0 flex-1"> <div aria-label="页面标题" className="min-w-0 flex-1">
<h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]"> <h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]">
{tabDetail?.position_name ?? '-'} Agent展示配置页 {tabDetail?.position_name ?? '-'} Agent展示配置页
...@@ -181,8 +182,9 @@ export function OfficialSiteAgentDisplayConfigPage() { ...@@ -181,8 +182,9 @@ export function OfficialSiteAgentDisplayConfigPage() {
<div aria-label="页面操作" className="flex shrink-0 items-center gap-2"> <div aria-label="页面操作" className="flex shrink-0 items-center gap-2">
<Button variant="outline" onClick={goBackToList}>返回</Button> <Button variant="outline" onClick={goBackToList}>返回</Button>
</div> </div>
</header> </IndependentPageHeader>
<IndependentPageBody className="grid gap-6">
{notice ? ( {notice ? (
<div <div
className={`rounded-[var(--gl-radius-sm)] border px-4 py-3 text-sm ${ className={`rounded-[var(--gl-radius-sm)] border px-4 py-3 text-sm ${
...@@ -245,6 +247,7 @@ export function OfficialSiteAgentDisplayConfigPage() { ...@@ -245,6 +247,7 @@ export function OfficialSiteAgentDisplayConfigPage() {
/> />
)} )}
</div> </div>
</IndependentPageBody>
{/* Edit modal */} {/* Edit modal */}
<AgentDisplayConfigEditModal <AgentDisplayConfigEditModal
...@@ -257,6 +260,6 @@ export function OfficialSiteAgentDisplayConfigPage() { ...@@ -257,6 +260,6 @@ export function OfficialSiteAgentDisplayConfigPage() {
fetchData(); fetchData();
}} }}
/> />
</section> </IndependentPageLayout>
); );
} }
...@@ -143,7 +143,11 @@ describe('official site agent display config routes and navigation', () => { ...@@ -143,7 +143,11 @@ describe('official site agent display config routes and navigation', () => {
expect(screen.getByRole('heading', { name: '店销顾问 Agent展示配置页' })).toBeInTheDocument(); expect(screen.getByRole('heading', { name: '店销顾问 Agent展示配置页' })).toBeInTheDocument();
}); });
const pageHeader = screen.getByRole('heading', { name: '店销顾问 Agent展示配置页' }).closest('header') as HTMLElement; const pageHeader = screen.getByRole('heading', { name: '店销顾问 Agent展示配置页' }).closest('header') as HTMLElement;
expect(pageHeader).toHaveClass('sticky', 'top-0', 'z-10'); const pageRoot = pageHeader.closest('section') as HTMLElement;
expect(pageRoot).toHaveClass('h-full', 'min-h-0', 'overflow-hidden');
expect(pageHeader).toHaveClass('shrink-0', 'bg-[var(--gl-color-bg-container)]');
expect(pageHeader).not.toHaveClass('sticky', 'top-0', 'z-10');
expect(pageRoot.querySelector('.flex-1.overflow-y-auto')).toBeInTheDocument();
expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument(); expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument();
const pageActions = screen.getByLabelText('页面操作'); const pageActions = screen.getByLabelText('页面操作');
expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument(); expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument();
......
...@@ -106,7 +106,11 @@ describe('OfficialSiteJobTabEditorPage', () => { ...@@ -106,7 +106,11 @@ describe('OfficialSiteJobTabEditorPage', () => {
renderApp('/official-site/job-tabs/new'); renderApp('/official-site/job-tabs/new');
expect(await screen.findByRole('heading', { name: '新建岗位展示' })).toBeInTheDocument(); expect(await screen.findByRole('heading', { name: '新建岗位展示' })).toBeInTheDocument();
const pageHeader = screen.getByRole('heading', { name: '新建岗位展示' }).closest('header') as HTMLElement; const pageHeader = screen.getByRole('heading', { name: '新建岗位展示' }).closest('header') as HTMLElement;
expect(pageHeader).toHaveClass('sticky', 'top-0', 'z-10'); const pageRoot = pageHeader.closest('section') as HTMLElement;
expect(pageRoot).toHaveClass('h-full', 'min-h-0', 'overflow-hidden');
expect(pageHeader).toHaveClass('shrink-0', 'bg-[var(--gl-color-bg-container)]');
expect(pageHeader).not.toHaveClass('sticky', 'top-0', 'z-10');
expect(pageRoot.querySelector('.flex-1.overflow-y-auto')).toBeInTheDocument();
expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument(); expect(within(screen.getByLabelText('页面标题')).queryByRole('button')).not.toBeInTheDocument();
const pageActions = screen.getByLabelText('页面操作'); const pageActions = screen.getByLabelText('页面操作');
expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument(); expect(within(pageActions).getByRole('button', { name: '返回' })).toBeInTheDocument();
...@@ -208,7 +212,7 @@ describe('OfficialSiteJobTabEditorPage', () => { ...@@ -208,7 +212,7 @@ describe('OfficialSiteJobTabEditorPage', () => {
}); });
}); });
it('returns from the sticky page header back to list', async () => { it('returns from the page header back to list', async () => {
renderApp('/official-site/job-tabs/new'); renderApp('/official-site/job-tabs/new');
const pageHeader = (await screen.findByRole('heading', { name: '新建岗位展示' })).closest('header') as HTMLElement; const pageHeader = (await screen.findByRole('heading', { name: '新建岗位展示' })).closest('header') as HTMLElement;
fireEvent.click(within(pageHeader).getByRole('button', { name: '返回' })); fireEvent.click(within(pageHeader).getByRole('button', { name: '返回' }));
......
...@@ -22,6 +22,7 @@ import { ...@@ -22,6 +22,7 @@ import {
type OfficialSiteTabStatus, type OfficialSiteTabStatus,
} from '../../api/officialSiteTab'; } from '../../api/officialSiteTab';
import { useDeferredEffect } from '../../hooks/useDeferredEffect'; import { useDeferredEffect } from '../../hooks/useDeferredEffect';
import { IndependentPageBody, IndependentPageHeader, IndependentPageLayout } from '../components/IndependentPageLayout';
import { buildOfficialSiteJobTabListSearch, readOfficialSiteJobTabListRouteState } from './officialSiteJobTabRouteState'; import { buildOfficialSiteJobTabListSearch, readOfficialSiteJobTabListRouteState } from './officialSiteJobTabRouteState';
interface TabFormState extends BusinessFormValues { interface TabFormState extends BusinessFormValues {
...@@ -379,8 +380,8 @@ export function OfficialSiteJobTabEditorPage({ mode }: { mode: 'create' | 'edit' ...@@ -379,8 +380,8 @@ export function OfficialSiteJobTabEditorPage({ mode }: { mode: 'create' | 'edit'
}; };
return ( return (
<section className="grid gap-6"> <IndependentPageLayout>
<header className="sticky top-0 z-10 flex items-start justify-between gap-6 rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-6"> <IndependentPageHeader>
<div aria-label="页面标题" className="min-w-0 flex-1"> <div aria-label="页面标题" className="min-w-0 flex-1">
<h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]"> <h2 className="m-0 text-2xl leading-[var(--gl-line-height-xl)]">
{mode === 'create' ? '新建岗位展示' : '编辑岗位展示'} {mode === 'create' ? '新建岗位展示' : '编辑岗位展示'}
...@@ -393,7 +394,7 @@ export function OfficialSiteJobTabEditorPage({ mode }: { mode: 'create' | 'edit' ...@@ -393,7 +394,7 @@ export function OfficialSiteJobTabEditorPage({ mode }: { mode: 'create' | 'edit'
<Button variant="outline" onClick={goBackToList}>返回</Button> <Button variant="outline" onClick={goBackToList}>返回</Button>
<Button theme="primary" loading={saving} onClick={handleSave}>保存</Button> <Button theme="primary" loading={saving} onClick={handleSave}>保存</Button>
</div> </div>
</header> </IndependentPageHeader>
{notice ? ( {notice ? (
<div <div
...@@ -409,7 +410,7 @@ export function OfficialSiteJobTabEditorPage({ mode }: { mode: 'create' | 'edit' ...@@ -409,7 +410,7 @@ export function OfficialSiteJobTabEditorPage({ mode }: { mode: 'create' | 'edit'
</div> </div>
) : null} ) : null}
<div className="rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-10"> <IndependentPageBody className="rounded-[var(--gl-radius-md)] border border-[var(--gl-color-border-secondary)] bg-[var(--gl-color-bg-container)] px-8 py-10">
<div className="mx-auto grid max-w-[760px] gap-6"> <div className="mx-auto grid max-w-[760px] gap-6">
<h3 className="m-0 text-base font-medium leading-[var(--gl-line-height-lg)]">{sectionTitle}</h3> <h3 className="m-0 text-base font-medium leading-[var(--gl-line-height-lg)]">{sectionTitle}</h3>
<BusinessForm <BusinessForm
...@@ -421,7 +422,7 @@ export function OfficialSiteJobTabEditorPage({ mode }: { mode: 'create' | 'edit' ...@@ -421,7 +422,7 @@ export function OfficialSiteJobTabEditorPage({ mode }: { mode: 'create' | 'edit'
onChange={(nextValues) => setForm(nextValues as TabFormState)} onChange={(nextValues) => setForm(nextValues as TabFormState)}
/> />
</div> </div>
</div> </IndependentPageBody>
</section> </IndependentPageLayout>
); );
} }
...@@ -44,6 +44,7 @@ export function SkillDetailDrawer({ routeState, skillCode }: { routeState: Skill ...@@ -44,6 +44,7 @@ export function SkillDetailDrawer({ routeState, skillCode }: { routeState: Skill
visible visible
header="Skill详情" header="Skill详情"
size="560px" size="560px"
className="detail-drawer"
destroyOnClose destroyOnClose
closeBtn={<Button aria-label="关闭Skill详情" icon={<CloseIcon />} shape="square" variant="text" />} closeBtn={<Button aria-label="关闭Skill详情" icon={<CloseIcon />} shape="square" variant="text" />}
onClose={closeDrawer} onClose={closeDrawer}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!