Skip to content

Commit 541c7cf

Browse files
authored
优化页面显示布局 (#54)
优化页面显示布局
1 parent dba9d57 commit 541c7cf

File tree

16 files changed

+72
-60
lines changed

16 files changed

+72
-60
lines changed

src/components/index.jsx

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -163,41 +163,50 @@ export const ComponentsContent = (props) => {
163163
alignItems: 'center',
164164
}}>
165165

166-
<div style={{marginTop: '25px', marginLeft: '-30px'}}>
166+
<div style={{display: 'flex', marginTop: '25px', marginLeft: '-25px', gap: '5px'}}>
167167
<div className="footer">
168168
<a target="_blank" title="Logo">
169169
<img src={logoIcon} alt="Logo" className="icon"
170-
style={{width: '40%', height: '40%'}}/>
170+
style={{width: '40px', height: '40px'}}/>
171171
</a>
172172
</div>
173-
</div>
174173

175-
<div style={{fontSize: 15, fontWeight: 'bold'}}>
176-
<div style={{position: 'absolute', left: '100px', top: '12px'}}>
177-
<Dropdown overlay={menu} trigger={['click']}>
178-
<Typography.Link style={{fontSize: 15, color: 'black'}}>
179-
<Space>
180-
多租户
181-
<DownOutlined/>
182-
</Space>
183-
</Typography.Link>
184-
</Dropdown>
174+
<div style={{fontSize: 15, fontWeight: 'bold', marginTop: '-12px'}}>
175+
<span>监控云平台</span>
185176
</div>
186177
</div>
187178

188-
<div style={{position: 'absolute', top: '12px', right: '35px', bottom: '10px'}}>
179+
<div style={{
180+
display: 'flex',
181+
position: 'absolute',
182+
top: '12px',
183+
right: '35px',
184+
bottom: '10px'}}>
185+
<div style={{ marginRight: '20px', marginTop: '5px'}}>
186+
<Dropdown overlay={menu} trigger={['click']} overlayStyle={{marginRight:'100px'}}>
187+
<Typography.Link style={{fontSize: 15, color: '#404142'}}>
188+
<Space>
189+
切换租户
190+
<DownOutlined/>
191+
</Space>
192+
</Typography.Link>
193+
</Dropdown>
194+
</div>
195+
189196
{userInfo !== null ? (
190-
<Popover content={content} trigger="hover" placement="bottom">
191-
<Avatar
192-
style={{
193-
backgroundColor: '#7265e6',
194-
verticalAlign: 'middle',
195-
}}
196-
size="large"
197-
>
198-
{userInfo.username}
199-
</Avatar>
200-
</Popover>
197+
<div style={{marginTop:'2px'}}>
198+
<Popover content={content} trigger="hover" placement="bottom">
199+
<Avatar
200+
style={{
201+
backgroundColor: '#7265e6',
202+
verticalAlign: 'middle',
203+
}}
204+
size="large"
205+
>
206+
{userInfo.username}
207+
</Avatar>
208+
</Popover>
209+
</div>
201210
) : null}
202211
</div>
203212
</Header>

src/pages/alert/rule/index.jsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ export const AlertRuleList = () => {
3333
title: '规则名称',
3434
dataIndex: 'ruleName',
3535
key: 'ruleName',
36-
width: 200,
36+
width: 'auto',
3737
},
3838
{
3939
title: '数据源类型',
4040
dataIndex: 'datasourceType',
4141
key: 'datasourceType',
42-
width: 200,
42+
width: 'auto',
4343
render: (text, record) => {
4444
return (
4545
<div style={{display: 'flex'}}>
@@ -76,7 +76,7 @@ export const AlertRuleList = () => {
7676
title: '数据源',
7777
dataIndex: 'datasourceId',
7878
key: 'datasourceId',
79-
width: 200,
79+
width: 'auto',
8080
render: (text, record) => (
8181
<span>
8282
{getDatasourceNamesByIds(record.datasourceId).split(', ').map((name, index) => (
@@ -89,7 +89,7 @@ export const AlertRuleList = () => {
8989
title: '描述',
9090
dataIndex: 'description',
9191
key: 'description',
92-
width: 300,
92+
width: 'auto',
9393
render: (text, record, index) => {
9494
if (!text) {
9595
return '没有留下任何描述~';
@@ -101,7 +101,7 @@ export const AlertRuleList = () => {
101101
title: '状态',
102102
dataIndex: 'enabled',
103103
key: 'enabled',
104-
width: 90,
104+
width: 'auto',
105105
render: enabled => (
106106
enabled ?
107107
<Tag color="success">启用</Tag> :
@@ -112,7 +112,7 @@ export const AlertRuleList = () => {
112112
title: '操作',
113113
dataIndex: 'operation',
114114
fixed: 'right', // 设置操作列固定
115-
width: 150,
115+
width: 120,
116116
render: (_, record) => (
117117
<div>
118118
<Popconfirm

src/pages/alert/ruleGroup/index.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const AlertRuleGroup = ({ }) => {
2121
title: 'ID',
2222
dataIndex: 'id',
2323
key: 'id',
24-
width: 250,
24+
width: 'auto',
2525
render: (text, record) => (
2626
<div>
2727
<div style={{ display: 'flex', alignItems: 'center' }}>
@@ -38,13 +38,13 @@ export const AlertRuleGroup = ({ }) => {
3838
title: '规则组名称',
3939
dataIndex: 'name',
4040
key: 'name',
41-
width: 200,
41+
width: 'auto',
4242
},
4343
{
4444
title: '规则数',
4545
dataIndex: 'number',
4646
key: 'number',
47-
width: 200,
47+
width: 'auto',
4848
},
4949
{
5050
title: '描述',
@@ -60,7 +60,7 @@ export const AlertRuleGroup = ({ }) => {
6060
{
6161
title: '操作',
6262
dataIndex: 'operation',
63-
width: 150,
63+
width: 120,
6464
fixed: 'right',
6565
render: (_, record) =>
6666
list.length >= 1 ? (

src/pages/alert/tmplGroup/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const RuleTemplateGroup = () => {
4040
{
4141
title: '操作',
4242
dataIndex: 'operation',
43+
width: 120,
4344
render: (_, record) =>
4445
list.length >= 1 ? (
4546
<div>

src/pages/audit/index.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const AuditLog = () => {
2222
title: '时间',
2323
dataIndex: 'createdAt',
2424
key: 'createdAt',
25-
width: 200,
25+
width: 'auto',
2626
render: (text) => {
2727
const dateInMilliseconds = text * 1000;
2828
return moment(dateInMilliseconds).format('YYYY-MM-DD HH:mm:ss');
@@ -72,7 +72,7 @@ export const AuditLog = () => {
7272
title: '事件Body详情',
7373
dataIndex: 'body',
7474
key: 'body',
75-
width: 150,
75+
width: 120,
7676
render: (text, record) => (
7777
<span>
7878
{record.body && (

src/pages/dashboards/folder/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const DashboardFolder = () => {
3333
{
3434
title: '操作',
3535
dataIndex: 'operation',
36-
width: 150,
36+
width: 120,
3737
fixed: 'right',
3838
render: (_, record) =>
3939
list.length >= 1 ? (

src/pages/datasources/index.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export const Datasources = () => {
8484
title: '操作',
8585
dataIndex: 'operation',
8686
fixed: 'right', // 设置操作列固定
87+
width: 120,
8788
render: (_, record) => (
8889
<div>
8990
<Popconfirm

src/pages/duty/index.jsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export const DutyManage = () => {
2121
title: 'ID',
2222
dataIndex: 'id',
2323
key: 'id',
24-
width: 60,
24+
width: 'auto',
2525
render: (text, record) => (
2626
<div>
2727

@@ -52,13 +52,13 @@ export const DutyManage = () => {
5252
title: '名称',
5353
dataIndex: 'name',
5454
key: 'name',
55-
width: 50,
55+
width: 'auto',
5656
},
5757
{
5858
title: '负责人',
5959
dataIndex: 'manager',
6060
key: 'manager',
61-
width: 30,
61+
width: 'auto',
6262
render: (text) => {
6363
return <span>{text.username}</span>;
6464
},
@@ -67,7 +67,7 @@ export const DutyManage = () => {
6767
title: '今日值班',
6868
dataIndex: 'curDutyUser',
6969
key: 'curDutyUser',
70-
width: 30,
70+
width: 'auto',
7171
render: (text) => {
7272
if (!text) {
7373
return '-';
@@ -79,7 +79,7 @@ export const DutyManage = () => {
7979
title: '描述',
8080
dataIndex: 'description',
8181
key: 'description',
82-
width: 100,
82+
width: 'auto',
8383
render: (text) => {
8484
if (!text) {
8585
return '没有留下任何描述~';
@@ -91,7 +91,7 @@ export const DutyManage = () => {
9191
title: '创建时间',
9292
dataIndex: 'create_at',
9393
key: 'create_at',
94-
width: 50,
94+
width: 'auto',
9595
render: (text) => {
9696
const date = new Date(text * 1000)
9797
return date.toLocaleString()
@@ -101,7 +101,7 @@ export const DutyManage = () => {
101101
title: '操作',
102102
dataIndex: 'operation',
103103
fixed: 'right',
104-
width: 50,
104+
width: 120,
105105
render: (_, record) =>
106106
<>
107107
<div>

src/pages/members/role/UserRoleCreateModal.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ const UserRoleCreateModal = ({ visible, onClose, selectedRow, type, handleList }
134134
}
135135

136136
return (
137-
<Modal visible={visible} onCancel={onClose} footer={null}>
137+
<Modal visible={visible} onCancel={onClose} footer={null} width={690}>
138138
<Form form={form} name="form_item_path" layout="vertical" onFinish={handleFormSubmit}>
139139

140140
<MyFormItem name="name" label="角色名称"

src/pages/members/role/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const UserRole = () => {
4040
title: '操作',
4141
dataIndex: 'operation',
4242
fixed: 'right',
43-
width: 150,
43+
width: 120,
4444
render: (_, record) =>
4545
list.length >= 1 ? (
4646
<div>

0 commit comments

Comments
 (0)