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

fix: '用户管理优化'

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