From 24a2218430d29394aced2c0d3898af5f763a17c8 Mon Sep 17 00:00:00 2001 From: Vectorune Date: Sat, 13 Sep 2025 18:17:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/global.css | 22 +++++++++++++++++++ src/page/Dashboard/DataPrint/index.jsx | 2 +- .../UserManagement/AccountInfoDrawer.jsx | 2 +- .../UserManagement/AddUserDrawer.jsx | 2 +- .../UserManagement/DeleteTeacherModal.jsx | 2 +- .../UserManagement/QueryConditionForm.jsx | 2 +- .../UserManagement/UserInfoTable.jsx | 3 ++- src/page/Dashboard/index.jsx | 15 ++----------- 8 files changed, 31 insertions(+), 19 deletions(-) create mode 100644 src/global.css diff --git a/src/global.css b/src/global.css new file mode 100644 index 0000000..9441b2c --- /dev/null +++ b/src/global.css @@ -0,0 +1,22 @@ +/* 自定义滚动条样式(WebKit 内核:Chrome、Safari) */ +.custom-scrollbar::-webkit-scrollbar { + width: 8px; /* 滚动条宽度 */ +} + +.custom-scrollbar::-webkit-scrollbar-track { + background: #f5f5f5; /* 滚动条轨道背景色 */ +} + +.custom-scrollbar::-webkit-scrollbar-thumb { + background: #888; /* 滚动条滑块颜色 */ + border-radius: 4px; /* 滑块圆角 */ +} + +.custom-scrollbar::-webkit-scrollbar-thumb:hover { + background: #555; /* 滑块 hover 后颜色 */ +} +.custom-scrollbar { + /* Firefox 滚动条配置(可选,若内联样式已加则可省略) */ + scrollbar-width: thin; /* 滚动条宽度:thin/auto/none */ + scrollbar-color: #888 #f5f5f5; /* 滑块颜色 轨道颜色 */ +} \ No newline at end of file diff --git a/src/page/Dashboard/DataPrint/index.jsx b/src/page/Dashboard/DataPrint/index.jsx index bb84a45..e76ca1a 100644 --- a/src/page/Dashboard/DataPrint/index.jsx +++ b/src/page/Dashboard/DataPrint/index.jsx @@ -90,7 +90,7 @@ const DataPrint = props => { { records.map((record, index) => { - return ( + return ( ) diff --git a/src/page/Dashboard/UserManagement/AccountInfoDrawer.jsx b/src/page/Dashboard/UserManagement/AccountInfoDrawer.jsx index 937a3f7..1dd1532 100644 --- a/src/page/Dashboard/UserManagement/AccountInfoDrawer.jsx +++ b/src/page/Dashboard/UserManagement/AccountInfoDrawer.jsx @@ -259,7 +259,7 @@ AccountInfoDrawer.propTypes = { open: PropTypes.bool.isRequired, setOpen: PropTypes.func.isRequired, userInfoDetails: PropTypes.object.isRequired, - commonAxios: PropTypes.object.isRequired, + commonAxios: PropTypes.func.isRequired, messageApi: PropTypes.object.isRequired, fetchUserInfoList: PropTypes.func.isRequired, }; diff --git a/src/page/Dashboard/UserManagement/AddUserDrawer.jsx b/src/page/Dashboard/UserManagement/AddUserDrawer.jsx index b4e6132..db8e59b 100644 --- a/src/page/Dashboard/UserManagement/AddUserDrawer.jsx +++ b/src/page/Dashboard/UserManagement/AddUserDrawer.jsx @@ -145,7 +145,7 @@ const AddUserDrawer = props => { AddUserDrawer.propTypes = { open: PropTypes.bool.isRequired, setOpen: PropTypes.func.isRequired, - commonAxios: PropTypes.object.isRequired, + commonAxios: PropTypes.func.isRequired, fetchUserInfoList: PropTypes.func.isRequired, messageApi: PropTypes.object.isRequired }; diff --git a/src/page/Dashboard/UserManagement/DeleteTeacherModal.jsx b/src/page/Dashboard/UserManagement/DeleteTeacherModal.jsx index 823c759..1ee2a5f 100644 --- a/src/page/Dashboard/UserManagement/DeleteTeacherModal.jsx +++ b/src/page/Dashboard/UserManagement/DeleteTeacherModal.jsx @@ -59,7 +59,7 @@ const DeleteTeacherModal = props => { DeleteTeacherModal.propTypes = { open: PropTypes.bool.isRequired, setOpen: PropTypes.func.isRequired, - commonAxios: PropTypes.object.isRequired, + commonAxios: PropTypes.func.isRequired, userInfo: PropTypes.object.isRequired, fetchUserInfo: PropTypes.func.isRequired, setDrawerOpen: PropTypes.func.isRequired, diff --git a/src/page/Dashboard/UserManagement/QueryConditionForm.jsx b/src/page/Dashboard/UserManagement/QueryConditionForm.jsx index 4a2bf91..f9c05be 100644 --- a/src/page/Dashboard/UserManagement/QueryConditionForm.jsx +++ b/src/page/Dashboard/UserManagement/QueryConditionForm.jsx @@ -104,7 +104,7 @@ const QueryConditionForm = props => { QueryConditionForm.propTypes = { queryRequest: PropTypes.object.isRequired, setQueryRequest: PropTypes.func.isRequired, - commonAxios: PropTypes.object.isRequired, + commonAxios: PropTypes.func.isRequired, }; export default QueryConditionForm; \ No newline at end of file diff --git a/src/page/Dashboard/UserManagement/UserInfoTable.jsx b/src/page/Dashboard/UserManagement/UserInfoTable.jsx index 547e9e1..3267104 100644 --- a/src/page/Dashboard/UserManagement/UserInfoTable.jsx +++ b/src/page/Dashboard/UserManagement/UserInfoTable.jsx @@ -35,6 +35,7 @@ const UserInfoTable = props => { columns={UserInfoTableColumn(openUserInfoDetails)} dataSource={queryResponse.list} pagination={false} + rowKey="id" /> { overflow: 'auto', scrollbarWidth: 'thin', scrollbarColor: '#888 #f5f5f5', - '&::-webkit-scrollbar': { - width: '8px', - }, - '&::-webkit-scrollbar-track': { - background: '#f5f5f5', - }, - '&::-webkit-scrollbar-thumb': { - background: '#888', - borderRadius: '4px', - }, - '&::-webkit-scrollbar-thumb:hover': { - background: '#555', - }, }} + // 关键:添加 CSS 类,绑定 WebKit 滚动条样式 + className="custom-scrollbar" >