Skip to content

Commit fd91f82

Browse files
committed
fix: 更新用户角色显示和优化分类页面样式
- 将用户角色名称更改为“超级管理员”以提升可读性。 - 在分类页面中,调整样式以确保树节点和内容的宽度为100%,并优化布局以增强用户体验。
1 parent 842b86d commit fd91f82

File tree

5 files changed

+35
-5
lines changed

5 files changed

+35
-5
lines changed

src/components/Header/DropdownUser.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const DropdownUser = () => {
1313
<Link onClick={() => setDropdownOpen(!dropdownOpen)} className="flex items-center gap-4" to="#">
1414
<span className="hidden text-right lg:block">
1515
<span className="block text-sm font-medium text-black dark:text-white">{store.user?.name}</span>
16-
<span className="block text-xs">{store.role.name}</span>
16+
<span className="block text-xs">超级管理员</span>
1717
</span>
1818

1919
<span className="overflow-hidden h-8 w-8 rounded-full border border-stroke">

src/pages/Cate/index.scss

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
.CatePage {
2-
.ant-tree-treenode,
2+
.ant-tree-treenode {
3+
width: 100% !important;
4+
}
5+
36
.ant-tree-node-content-wrapper {
7+
display: flex !important;
48
width: 100% !important;
9+
flex: 1 !important;
10+
}
11+
12+
.ant-tree-title {
13+
width: 100% !important;
14+
display: block !important;
15+
flex: 1 !important;
16+
}
17+
18+
.ant-tree-switcher {
19+
flex-shrink: 0 !important;
520
}
621
}

src/pages/Cate/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export default () => {
183183

184184
<Card className={`border-stroke [&>.ant-card-body]:!p-[30px_20px] [&>.ant-card-body]:!pb-6 mt-2 min-h-[calc(100vh-160px)]`}>
185185
<Spin spinning={loading}>
186-
<Tree defaultExpandAll={true} treeData={toTreeData(list)} />
186+
<Tree className="CatePage" defaultExpandAll={true} treeData={toTreeData(list)} />
187187
</Spin>
188188

189189
<Modal loading={editLoading} title={isMethod === 'edit' ? '编辑分类' : '新增分类'} open={isModelOpen} onCancel={closeModel} destroyOnClose footer={null}>

src/pages/cate/index.scss

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
.CatePage {
2-
.ant-tree-treenode,
2+
.ant-tree-treenode {
3+
width: 100% !important;
4+
}
5+
36
.ant-tree-node-content-wrapper {
7+
display: flex !important;
48
width: 100% !important;
9+
flex: 1 !important;
10+
}
11+
12+
.ant-tree-title {
13+
width: 100% !important;
14+
display: block !important;
15+
flex: 1 !important;
16+
}
17+
18+
.ant-tree-switcher {
19+
flex-shrink: 0 !important;
520
}
621
}

src/pages/cate/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export default () => {
183183

184184
<Card className={`border-stroke [&>.ant-card-body]:!p-[30px_20px] [&>.ant-card-body]:!pb-6 mt-2 min-h-[calc(100vh-160px)]`}>
185185
<Spin spinning={loading}>
186-
<Tree defaultExpandAll={true} treeData={toTreeData(list)} />
186+
<Tree className="CatePage" defaultExpandAll={true} treeData={toTreeData(list)} />
187187
</Spin>
188188

189189
<Modal loading={editLoading} title={isMethod === 'edit' ? '编辑分类' : '新增分类'} open={isModelOpen} onCancel={closeModel} destroyOnClose footer={null}>

0 commit comments

Comments
 (0)