Commit 4a1f6436 authored by 邓超's avatar 邓超

fix: 解决树卡顿

parent 4023f242
...@@ -429,7 +429,7 @@ class PicturesWall extends React.Component<PicturesWallType> { ...@@ -429,7 +429,7 @@ class PicturesWall extends React.Component<PicturesWallType> {
</div> </div>
<Modal <Modal
visible={previewVisible} visible={previewVisible}
title={previewTitle} // title={previewTitle}
footer={null} footer={null}
onCancel={this.handleCancel} onCancel={this.handleCancel}
> >
......
...@@ -57,7 +57,7 @@ const AddModal = props => { ...@@ -57,7 +57,7 @@ const AddModal = props => {
const [selectTreeData, setSelectTreeData] = useState([]); const [selectTreeData, setSelectTreeData] = useState([]);
const [selectDataFirst, setSelectDataFirst] = useState([]); const [selectDataFirst, setSelectDataFirst] = useState([]);
const [multiOperate, setMultiOperate] = useState(true); // 是否禁用用户批量操作 const [multiOperate, setMultiOperate] = useState(true); // 是否禁用用户批量操作
const [selectedRowKeys, setSelectedRowKeys] = useState(['13926', '13941']); // 已选字段配置数,机构改变时重置 const [selectedRowKeys, setSelectedRowKeys] = useState([]); // 已选字段配置数,机构改变时重置
const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 批量删除 const [deleteUserVisible, setDeleteUserVisible] = useState(false); // 批量删除
const [checkStrictly, setCheckStrictly] = useState(false); const [checkStrictly, setCheckStrictly] = useState(false);
const [selectGroup, setSelectGroup] = useState([]); const [selectGroup, setSelectGroup] = useState([]);
...@@ -412,13 +412,16 @@ const AddModal = props => { ...@@ -412,13 +412,16 @@ const AddModal = props => {
// 返回上一级 // 返回上一级
const back = () => { const back = () => {
console.log(props.location.state); console.log(props.location.state);
let { template, tableScroll, keepValue } = props.location.state; let { template, tableScroll, keepValue, pickIndex, groupArr } = props.location.state;
console.log(keepValue); console.log(keepValue);
console.log(pickIndex, groupArr, 'back');
history.push({ history.push({
pathname: '/bsmanger/base/tablemanger', pathname: '/bsmanger/base/tablemanger',
query: { query: {
template, template,
tableScroll, tableScroll,
backIndex: pickIndex,
group: groupArr,
keepValue, keepValue,
}, },
}); });
......
.content {
position: relative;
display: flex;
width: 100%;
}
.tablemanager_container { .tablemanager_container {
position: relative;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
width: 100vm; width: 100%;
border: 1px solid #f0f0f0; border: 1px solid #f0f0f0;
.lack{ .lack {
background-color: rgb(255, 255, 0); background-color: rgb(255, 255, 0);
color: rgb(255, 0, 0); color: rgb(255, 0, 0);
} }
.ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table{ .ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table {
margin-left: 0; margin-left: 0;
} }
.ant-table.ant-table-bordered > .ant-table-container{ .ant-table.ant-table-bordered > .ant-table-container {
border: none; border: none;
} }
.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);
} }
.ant-btn{ .ant-btn {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.clickRowStyle{
.clickRowStyle {
background: #cfe7fd; background: #cfe7fd;
} }
.operate_bar { .operate_bar {
...@@ -46,5 +54,56 @@ ...@@ -46,5 +54,56 @@
} }
} }
} }
}
.orgContainer {
position: relative;
left: 0;
top: 0;
height: calc(100vh - 74px);
width: 250px;
margin-right: 10px;
transition-property: width;
transition-duration: 0.5s;
white-space: nowrap;
.processTitle {
font-size: 15px;
font-weight: bold;
color: #333e51;
padding-left: 14px;
}
.splitLine {
width: 100%;
color: #eeecec;
}
.listItem {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 14px;
line-height: 28px;
font-size: 14px;
font-weight: 400;
color: #414e65;
cursor: pointer;
}
.listHover {
background-color: #f5f6f9;
}
.pickItem {
background-color: #aed8fa;
}
.switcher {
display: block;
position: absolute;
font-size: 18px;
color: #1890ff !important;
top: 50%;
right: 2px;
transform: translate(0%, -50%);
z-index: 1;
}
}
.orgContainerHide {
width: 26px;
} }
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
height: calc(100vh - 74px); height: calc(100vh - 74px);
width: 250px; width: 250px;
margin-right: 10px; margin-right: 10px;
transition-property: width, left; transition-property: width;
transition-duration: 0.5s; transition-duration: 0.5s;
white-space: nowrap; white-space: nowrap;
.processTitle { .processTitle {
...@@ -53,8 +53,6 @@ ...@@ -53,8 +53,6 @@
} }
} }
.orgContainerHide { .orgContainerHide {
left: 0px;
top: 0;
width: 26px; width: 26px;
} }
.processContainer { .processContainer {
......
...@@ -80,6 +80,11 @@ import MapScopeEditModal from '@/components/MapScope'; ...@@ -80,6 +80,11 @@ import MapScopeEditModal from '@/components/MapScope';
import AuthModal from './AuthModal'; import AuthModal from './AuthModal';
import styles from './UserManage.less'; import styles from './UserManage.less';
import { createGuid } from '@/utils/transformUtil'; import { createGuid } from '@/utils/transformUtil';
const TdCell = props => {
// onMouseEnter, onMouseLeave在数据量多的时候,会严重阻塞表格单元格渲染,严重影响性能
const { onMouseEnter, onMouseLeave, ...restProps } = props;
return <td {...restProps} />;
};
const UserManage = () => { const UserManage = () => {
const { TreeNode } = Tree; const { TreeNode } = Tree;
...@@ -842,26 +847,6 @@ const UserManage = () => { ...@@ -842,26 +847,6 @@ const UserManage = () => {
// 查找用户 // 查找用户
const submitSearchUser = () => { const submitSearchUser = () => {
// getUserByKey(searchWord)
// .then(res => {
// if (res.success) {
// setSelectedRowKeys([]); // 重置选中用户数
// setCurrentOrgOperate(true); // 禁止当前机构操作
// setMultiOperate(true); // 禁用批量操作
// setOrgTitle('全部机构搜索结果'); // 设置表头
// setCurrentSelectOrg('-1'); // 清空选中机构
// setTableData(res.root);
// setTableLength(res.root.length);
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// message.error(err);
// });
GetUserByKeyNew({ key: searchWord }) GetUserByKeyNew({ key: searchWord })
.then(res => { .then(res => {
if (res.code === 0) { if (res.code === 0) {
...@@ -891,25 +876,6 @@ const UserManage = () => { ...@@ -891,25 +876,6 @@ const UserManage = () => {
// 根据当前 userID 获取用户关联角色 // 根据当前 userID 获取用户关联角色
const getRoleList = e => { const getRoleList = e => {
setLoading(true); setLoading(true);
// getUserRelationList(currentUser.userID)
// .then(res => {
// setLoading(false);
// if (res.success) {
// const { roleList, stationList } = res;
// setRolelist(roleList);
// setStationlist(stationList);
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// setLoading(false);
// setTableLoading(false);
// message.error(err);
// });
GetUserRelationListNew({ userID: e.userID }) GetUserRelationListNew({ userID: e.userID })
.then(res => { .then(res => {
console.log(111); console.log(111);
...@@ -934,25 +900,6 @@ const UserManage = () => { ...@@ -934,25 +900,6 @@ const UserManage = () => {
// 获取全部未勾选的角色列表与站点列表 // 获取全部未勾选的角色列表与站点列表
const getEmptyRoleList = () => { const getEmptyRoleList = () => {
setLoading(true); setLoading(true);
// getUserRelationList('')
// .then(res => {
// setLoading(false);
// if (res.roleList && res.roleList.length > 0) {
// const { roleList, stationList } = res;
// setRolelist(roleList);
// setStationlist(stationList);
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// setLoading(false);
// setTableLoading(false);
// message.error(err);
// });
GetUserRelationListNew({ userID: 0 }) GetUserRelationListNew({ userID: 0 })
.then(res => { .then(res => {
console.log(222); console.log(222);
...@@ -1133,29 +1080,6 @@ const UserManage = () => { ...@@ -1133,29 +1080,6 @@ const UserManage = () => {
// }; // };
// 提交-删除用户 // 提交-删除用户
const submitDeleteUser = () => { const submitDeleteUser = () => {
// postDeleteUser(currentUser.userID)
// .then(res => {
// if (res.success) {
// setDeleteUserVisible(false);
// notification.success({
// message: '提交成功',
// duration: 2,
// });
// // eslint-disable-next-line no-unused-expressions
// currentSelectOrg === '-1'
// ? submitSearchUser()
// : onSelect([currentSelectOrg]);
// } else {
// notification.error({
// message: '提交失败',
// description: res.message,
// });
// }
// })
// .catch(err => {
// setTableLoading(false);
// message.error(err);
// });
DeleteUserNew({ DeleteUserNew({
userID: currentUser.userID, userID: currentUser.userID,
ouID: currentUser.OUID, ouID: currentUser.OUID,
...@@ -1462,7 +1386,6 @@ const UserManage = () => { ...@@ -1462,7 +1386,6 @@ const UserManage = () => {
<div <div
className={classnames({ className={classnames({
[styles.userContainer]: true, [styles.userContainer]: true,
[styles.userContainerHide]: !treeVisible,
})} })}
> >
<div style={{ height: '50px' }}> <div style={{ height: '50px' }}>
......
...@@ -153,7 +153,7 @@ ...@@ -153,7 +153,7 @@
overflow-x: hidden; overflow-x: hidden;
margin-right: 10px; margin-right: 10px;
position: relative; position: relative;
transition-property: width, left; transition-property: width;
transition-duration: 0.5s; transition-duration: 0.5s;
white-space: nowrap; white-space: nowrap;
.ant-tree { .ant-tree {
...@@ -181,8 +181,6 @@ ...@@ -181,8 +181,6 @@
.orgContainerHide { .orgContainerHide {
// transform: translateX(-230px); // transform: translateX(-230px);
left: 0px;
top: 0;
width: 26px; width: 26px;
} }
.ant-popover-message-title { .ant-popover-message-title {
......
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