Commit 21e3651c authored by 皮倩雯's avatar 皮倩雯

fix: '用户管理优化'

parent 0e4623e3
Pipeline #82234 failed with stages
......@@ -178,6 +178,7 @@ const UserManage = () => {
const [searchWordOrg, setSearchWordOrg] = useState('');
const [keepDataList, setKeepDataList] = useState([]);
const [siteList, setSiteList] = useState([]);
const [searchFlag, setSearchFlag] = useState(0);
const setRowClassName = record =>
record.userId === selectColor.userId ? styles.clickRowStyle : '';
......@@ -188,6 +189,7 @@ const UserManage = () => {
const [pageSize, setPageSize] = useState(20);
const [currentPage, setCurrentPage] = useState(1);
const [treeDataTotal, setTreeDataTotal] = useState();
const [totalSearch, setTotalSearch] = useState(0);
// 用户表列名
const columns = [
{
......@@ -211,9 +213,9 @@ const UserManage = () => {
key: 'groupName',
// width: 150,
ellipsis: true,
filters: orgFilters,
filteredValue,
onFilter: (value, record) => record.groupName === value,
// filters: orgFilters,
// filteredValue,
// onFilter: (value, record) => record.groupName === value,
},
{
title: '手机号码',
......@@ -835,6 +837,7 @@ const UserManage = () => {
// 点击树节点,获取当前机构下所有用户
const onSelect = (props, e, size, index) => {
setSearchFlag(0);
if (e) {
props[0] = e.node.key;
} else {
......@@ -1200,6 +1203,7 @@ const UserManage = () => {
// 查找用户
const submitSearchUser = () => {
setCurrentPage(1);
if (!searchWord || searchWord.trim(' ').length == 0) {
message.warning('请输入搜索内容');
return;
......@@ -1208,8 +1212,10 @@ const UserManage = () => {
let data = searchWord != '' ? { key: searchWord } : '';
GetUserByKeyNew(data)
.then(res => {
setSearchFlag(1);
setTableLoading(false);
if (res.code === 0) {
setTotalSearch(res.data.length);
setSelectedRowKeys([]); // 重置选中用户数
setCurrentOrgOperate(true); // 禁止当前机构操作
setMultiOperate(true); // 禁用批量操作
......@@ -1513,6 +1519,7 @@ const UserManage = () => {
if (newres.code === 0) {
let res = newres.data.list;
setTreeLoading(false);
setSearchFlag(0);
setSearchWord('');
setFilteredValue([]);
// 第一次加载,默认选择第一个组织
......@@ -1879,19 +1886,21 @@ const UserManage = () => {
marginRight: '5px',
}}
>
<Pagination
total={total}
showTotal={(totals, range) => `第${range[0]}-${range[1]} 条/共 ${totals} 条`}
defaultPageSize={pageSize}
defaultCurrent={1}
showSizeChanger
pageSizeOptions={[10, 20, 50, 100]}
current={currentPage}
onChange={paginationChange}
style={{ marginBottom: '10px' }}
size="small"
showQuickJumper
/>
{searchFlag === 0 && (
<Pagination
total={total}
showTotal={(totals, range) => `第${range[0]}-${range[1]} 条/共 ${totals} 条`}
defaultPageSize={pageSize}
defaultCurrent={1}
showSizeChanger
pageSizeOptions={[10, 20, 50, 100]}
current={currentPage}
onChange={paginationChange}
style={{ marginBottom: '10px' }}
size="small"
showQuickJumper
/>
)}
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment