Browse Source

💄 style(roles): 调整角色管理页面代码缩进格式

- 统一调整JSX代码缩进,使结构更清晰易读
- 保持原有功能不变,仅优化代码格式
yourname 8 months ago
parent
commit
ee16e24f43
1 changed files with 45 additions and 45 deletions
  1. 45 45
      src/client/admin/pages/Roles.tsx

+ 45 - 45
src/client/admin/pages/Roles.tsx

@@ -1,6 +1,6 @@
 import React, { useState, useEffect } from 'react';
 import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
-import { Card, Table, Button, Modal, Form, Input, Space, Tag, message } from 'antd';
+import { Card, Table, Button, Modal, Form, Input, Space, Tag, message, Spin } from 'antd';
 import { EditOutlined, DeleteOutlined, PlusOutlined, KeyOutlined } from '@ant-design/icons';
 import { roleClient, rolePermissionClient } from '@/client/api';
 import PermissionConfigModal from '@/client/admin/components/PermissionConfigModal';
@@ -295,51 +295,51 @@ const Roles: React.FC = () => {
   ];
 
   return (
-  <div className="p-6">
-    <Spin spinning={rolesLoading}>
-      <Card
-        title="角色管理"
-        extra={
-          <Space>
-            <Button
-              type="primary"
-              icon={<PlusOutlined />}
-              onClick={handleAdd}
-              loading={createRoleMutation.isPending}
-            >
-              新建角色
-            </Button>
-          </Space>
-        }
-      >
-        <div className="mb-4 flex gap-4">
-          <Input.Search
-            placeholder="搜索角色名称或描述"
-            allowClear
-            value={searchKeyword}
-            onChange={(e) => setSearchKeyword(e.target.value)}
-            onSearch={handleSearch}
-            style={{ width: 300 }}
+    <div className="p-6">
+      <Spin spinning={rolesLoading}>
+        <Card
+          title="角色管理"
+          extra={
+            <Space>
+              <Button
+                type="primary"
+                icon={<PlusOutlined />}
+                onClick={handleAdd}
+                loading={createRoleMutation.isPending}
+              >
+                新建角色
+              </Button>
+            </Space>
+          }
+        >
+          <div className="mb-4 flex gap-4">
+            <Input.Search
+              placeholder="搜索角色名称或描述"
+              allowClear
+              value={searchKeyword}
+              onChange={(e) => setSearchKeyword(e.target.value)}
+              onSearch={handleSearch}
+              style={{ width: 300 }}
+            />
+            <Button onClick={handleReset}>重置</Button>
+          </div>
+          
+          <Table
+            columns={columns}
+            dataSource={roles}
+            rowKey="id"
+            scroll={{ x: 1000 }}
+            pagination={{
+              ...pagination,
+              showSizeChanger: true,
+              showQuickJumper: true,
+              showTotal: (total: number) => `共 ${total} 条记录`,
+              pageSizeOptions: [10, 20, 50, 100],
+            }}
+            onChange={handleTableChange}
           />
-          <Button onClick={handleReset}>重置</Button>
-        </div>
-        
-        <Table
-          columns={columns}
-          dataSource={roles}
-          rowKey="id"
-          scroll={{ x: 1000 }}
-          pagination={{
-            ...pagination,
-            showSizeChanger: true,
-            showQuickJumper: true,
-            showTotal: (total: number) => `共 ${total} 条记录`,
-            pageSizeOptions: [10, 20, 50, 100],
-          }}
-          onChange={handleTableChange}
-        />
-      </Card>
-    </Spin>
+        </Card>
+      </Spin>
 
       {/* 角色编辑模态框 */}
       <Modal