Commit 4c9250a7 authored by 张烨's avatar 张烨
parents 064d5298 31ba5eed
...@@ -11,30 +11,22 @@ import { ...@@ -11,30 +11,22 @@ import {
Tooltip, Tooltip,
Row, Row,
Col, Col,
Divider,
Tabs, Tabs,
Checkbox,
Button, Button,
Spin, Spin,
} from 'antd'; } from 'antd';
import { import {
UsergroupAddOutlined, UsergroupAddOutlined,
FolderAddTwoTone,
EditTwoTone, EditTwoTone,
DeleteTwoTone, DeleteTwoTone,
ShareAltOutlined, ShareAltOutlined,
UnlockOutlined, UnlockOutlined,
ApartmentOutlined, ApartmentOutlined,
SearchOutlined,
StopOutlined, StopOutlined,
FolderOpenOutlined,
FileOutlined,
DoubleLeftOutlined, DoubleLeftOutlined,
DoubleRightOutlined, DoubleRightOutlined,
} from '@ant-design/icons'; } from '@ant-design/icons';
import PageContainer from '@/components/BasePageContainer'; import PageContainer from '@/components/BasePageContainer';
// import classnames from 'classnames';
// import { get } from '../../services';
import voca from 'voca'; import voca from 'voca';
import zhCN from 'antd/es/locale/zh_CN'; import zhCN from 'antd/es/locale/zh_CN';
import { import {
...@@ -53,7 +45,6 @@ import { ...@@ -53,7 +45,6 @@ import {
updateUserPassword, updateUserPassword,
setUserRelation, setUserRelation,
} from '@/services/userCenter/userManage/api'; } from '@/services/userCenter/userManage/api';
import { string } from 'prop-types';
import ListCardItem from '../orgnazation/listCardItem'; import ListCardItem from '../orgnazation/listCardItem';
import styles from './UserManage.less'; import styles from './UserManage.less';
...@@ -66,10 +57,9 @@ const UserManage = () => { ...@@ -66,10 +57,9 @@ const UserManage = () => {
const [expandedKeys, setExpandedKeys] = useState(['']); const [expandedKeys, setExpandedKeys] = useState(['']);
const [treeDataCopy, setTreeDataCopy] = useState([]); // 机构树数据备份,用于更改机构 const [treeDataCopy, setTreeDataCopy] = useState([]); // 机构树数据备份,用于更改机构
const [treeState, setTreeState] = useState(true); // 树第一次加载 const [treeState, setTreeState] = useState(true); // 树第一次加载
// const [treeDispaly, setTreeDispaly] = useState(''); // 1
const [treeVisible, setTreeVisible] = useState(true); // 树是否可见 const [treeVisible, setTreeVisible] = useState(true); // 树是否可见
const [tableData, setTableData] = useState([]); // 用户表 const [tableData, setTableData] = useState([]); // 用户表
const [pageSize, setPageSize] = useState(10); // 用户表-分页大小
const [pageNum, setPageNum] = useState(1); // 用户表-当前页码
const [orgFilters, setOrgFilters] = useState([]); // 用户列筛选 const [orgFilters, setOrgFilters] = useState([]); // 用户列筛选
const [searchWord, setSearchWord] = useState(''); // 关键字 const [searchWord, setSearchWord] = useState(''); // 关键字
const [currentSelectOrg, setCurrentSelectOrg] = useState([]); // 左侧机构数-选中组织 const [currentSelectOrg, setCurrentSelectOrg] = useState([]); // 左侧机构数-选中组织
...@@ -88,7 +78,7 @@ const UserManage = () => { ...@@ -88,7 +78,7 @@ const UserManage = () => {
const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 删除用户 const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 删除用户
const [orgTitle, setOrgTitle] = useState('机构'); // 弹框标题 const [orgTitle, setOrgTitle] = useState('机构'); // 弹框标题
const [tableTitle, setTableTitle] = useState(0); // 表格标题 const [tableLength, setTableLength] = useState(0); // 表格标题
const [orgID, setOrgID] = useState(); // 机构ID const [orgID, setOrgID] = useState(); // 机构ID
const [newOrgID, setNewOrgID] = useState(); // 更改机构新选择的ID const [newOrgID, setNewOrgID] = useState(); // 更改机构新选择的ID
const [currentUser, setCurrentUser] = useState({}); // 当前用户 const [currentUser, setCurrentUser] = useState({}); // 当前用户
...@@ -110,7 +100,6 @@ const UserManage = () => { ...@@ -110,7 +100,6 @@ const UserManage = () => {
// 获取搜索框的值 // 获取搜索框的值
const handleSearch = e => { const handleSearch = e => {
setSearchWord(e.target.value); setSearchWord(e.target.value);
console.log(e.target.value);
}; };
const getRoleValueCallback = useCallback((value, index) => { const getRoleValueCallback = useCallback((value, index) => {
...@@ -330,7 +319,7 @@ const UserManage = () => { ...@@ -330,7 +319,7 @@ const UserManage = () => {
arr = arr.filter((value, index) => arr.indexOf(value) === index); arr = arr.filter((value, index) => arr.indexOf(value) === index);
setOrgFilters(arr.map(item => ({ text: item, value: item }))); setOrgFilters(arr.map(item => ({ text: item, value: item })));
console.log(temp); console.log(temp);
setTableTitle(temp.length); setTableLength(temp.length);
const table = temp.map((item, index) => { const table = temp.map((item, index) => {
item.key = index; item.key = index;
item.phone = item.phone || '-'; item.phone = item.phone || '-';
...@@ -456,7 +445,7 @@ const UserManage = () => { ...@@ -456,7 +445,7 @@ const UserManage = () => {
.then(res => { .then(res => {
if (res.success) { if (res.success) {
setTableData(res.root); setTableData(res.root);
setTableTitle(res.root.length); setTableLength(res.root.length);
} else { } else {
notification.error({ notification.error({
message: '提交失败', message: '提交失败',
...@@ -772,20 +761,25 @@ const UserManage = () => { ...@@ -772,20 +761,25 @@ const UserManage = () => {
{/* 左侧机构树 */} {/* 左侧机构树 */}
<Spin spinning={treeLoading} tip="loading..."> <Spin spinning={treeLoading} tip="loading...">
<div className={treeVisible ? styles.orgContainer : styles.hide}> <div className={treeVisible ? styles.orgContainer : styles.hide}>
{/* <div className={styles.orgContainer} style={{ display: treeDispaly }}> */}
<span style={{ margin: '10px' }}>机构列表</span> <span style={{ margin: '10px' }}>机构列表</span>
<Tooltip title="添加机构"> <Tooltip title="添加机构">
<UsergroupAddOutlined <UsergroupAddOutlined
onClick={() => addOrg('根目录', '-1')} onClick={() => addOrg('根目录', '-1')}
style={{ float: 'right', color: '#1890FF', fontSize: '18px' }} style={{
float: 'right',
color: '#1890FF',
fontSize: '18px',
}}
/> />
</Tooltip> </Tooltip>
{treeData.length > 0 && ( {treeData.length > 0 && (
<Tree <Tree
// showLine="true"
showIcon="true" showIcon="true"
showLine={{ showLeafIcon: false }} showLine={{ showLeafIcon: false }}
defaultExpandAll="true" // blockNode="true"
// expandedKeys={[currentSelectOrg]} autoExpandParent="true"
expandedKeys={[currentSelectOrg]}
selectedKeys={[currentSelectOrg]} selectedKeys={[currentSelectOrg]}
onSelect={onSelect} onSelect={onSelect}
treeData={treeData.map(t => mapTree(t))} treeData={treeData.map(t => mapTree(t))}
...@@ -797,14 +791,21 @@ const UserManage = () => { ...@@ -797,14 +791,21 @@ const UserManage = () => {
{treeVisible && ( {treeVisible && (
<Tooltip title="隐藏机构列表"> <Tooltip title="隐藏机构列表">
<DoubleLeftOutlined <DoubleLeftOutlined
onClick={() => setTreeVisible(false)} onClick={() => {
// style={{ background: 'white' }} setTreeVisible(false);
// setTreeDispaly('none');
}}
/> />
</Tooltip> </Tooltip>
)} )}
{!treeVisible && ( {!treeVisible && (
<Tooltip title="显示机构列表"> <Tooltip title="显示机构列表">
<DoubleRightOutlined onClick={() => setTreeVisible(true)} /> <DoubleRightOutlined
onClick={() => {
setTreeVisible(true);
// setTreeDispaly('block');
}}
/>
</Tooltip> </Tooltip>
)} )}
</div> </div>
...@@ -814,7 +815,7 @@ const UserManage = () => { ...@@ -814,7 +815,7 @@ const UserManage = () => {
<div style={{ height: '50px' }}> <div style={{ height: '50px' }}>
<p style={{ margin: '16px 0 10px 16px', display: 'inline-block' }}> <p style={{ margin: '16px 0 10px 16px', display: 'inline-block' }}>
用户数量( 用户数量(
<span className={styles.redText}>{tableTitle}</span> <span className={styles.redText}>{tableLength}</span>
</p> </p>
<span style={{ float: 'right', margin: '10px' }}> <span style={{ float: 'right', margin: '10px' }}>
<Search <Search
...@@ -853,17 +854,10 @@ const UserManage = () => { ...@@ -853,17 +854,10 @@ const UserManage = () => {
loading={tableLoading} loading={tableLoading}
scroll={{ x: 'max-content' }} scroll={{ x: 'max-content' }}
pagination={{ pagination={{
showTotal: () => `共${tableTitle}条`, showTotal: () => `共${tableLength}条`,
pageSizeOptions: [10, 20, 50, 100], pageSizeOptions: [10, 20, 50, 100],
// pageSize: { pageSize },
// current: { pageNum },
showQuickJumper: true, showQuickJumper: true,
showSizeChanger: true, showSizeChanger: true,
// onShowSizeChange: (current, pagesize) => {
// setPageSize(pagesize);
// setPageNum(current);
// },
// onChange: current => setPageNum(current),
}} }}
/> />
</div> </div>
......
@media screen and (min-width:1300px){ // @media screen and (max-width:1400px){
.hide{ // .orgContainer{
display:none; // display:none;
} // }
} // }
.redText{ .redText{
color: red; color: red;
cursor: pointer; cursor: pointer;
...@@ -44,17 +44,40 @@ ...@@ -44,17 +44,40 @@
padding: 10px; padding: 10px;
min-width: 240px; min-width: 240px;
background: white; background: white;
overflow: auto;
.ant-tree{ .ant-tree{
padding-top: 6px; padding-top: 6px;
.ant-tree-switcher{ .ant-tree-switcher{
line-height: 1; line-height: 1;
color:#1890FF; color:#1890FF;
} .ant-tree-switcher-line-icon{
margin-left: 5px;
}
}
}
&::-webkit-scrollbar {
height: 10px;//x轴滚动条粗细
width:6px;//y轴滚动条粗细
border-bottom: 2px solid white;
}
//滚动条里面的小方块,能上下左右移动(取决于是垂直滚动条还是水平滚动条)
&::-webkit-scrollbar-thumb {
border-radius: 10px;
box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
background: rgba(74, 74, 75, 0.1);
margin-bottom: 10px;
}
//滚动条的轨道(里面装有thumb)滚动槽
&::-webkit-scrollbar-track {
box-shadow: 0;
border-radius: 0;
background: white;//滚动槽背景色
border-radius: 10px;//滚动条边框半径设置
} }
} }
.hide{ .hide{
display: none; display: none;
transition: 1s;
} }
.userContainer{ .userContainer{
height: calc(100vh - 168px) !important; height: calc(100vh - 168px) !important;
...@@ -81,6 +104,7 @@ ...@@ -81,6 +104,7 @@
.ant-table-thead tr th{ .ant-table-thead tr th{
font-weight: 600; font-weight: 600;
color:rgba(0,0,0,0.85); color:rgba(0,0,0,0.85);
// background-color: #c9e1f5;
} }
.ant-table-cell{ .ant-table-cell{
text-align:center; text-align:center;
...@@ -95,14 +119,14 @@ ...@@ -95,14 +119,14 @@
//滚动条整体部分 //滚动条整体部分
&::-webkit-scrollbar { &::-webkit-scrollbar {
height: 10px;//x轴滚动条粗细 height: 10px;//x轴滚动条粗细
width:10px;//y轴滚动条粗细 width:6px;//y轴滚动条粗细
border-bottom: 2px solid white; border-bottom: 2px solid white;
} }
//滚动条里面的小方块,能上下左右移动(取决于是垂直滚动条还是水平滚动条) //滚动条里面的小方块,能上下左右移动(取决于是垂直滚动条还是水平滚动条)
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
border-radius: 10px; border-radius: 10px;
box-shadow: inset 0 0 2px rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
background: rgba(74, 74, 75, 0.1); background: rgba(74, 74, 75, 0.1);
margin-bottom: 10px; margin-bottom: 10px;
} }
......
...@@ -35,5 +35,8 @@ ...@@ -35,5 +35,8 @@
display: flex; display: flex;
align-items: center; align-items: center;
color:#1890FF; color:#1890FF;
.ant-tree-switcher-line-icon{
margin-left: 5px;
}
} }
} }
\ No newline at end of file
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