Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
0064e792
Commit
0064e792
authored
Jan 08, 2021
by
tianfen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
perf: 修改数据初始化的滚动条
parent
090ad4f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
50 deletions
+70
-50
AvatarDropdown.js
src/components/GlobalHeader/AvatarDropdown.js
+8
-1
InitDataBase.jsx
src/pages/database/InitDataBase.jsx
+18
-7
SiteManage.jsx
src/pages/userCenter/siteManage/SiteManage.jsx
+44
-42
No files found.
src/components/GlobalHeader/AvatarDropdown.js
View file @
0064e792
...
...
@@ -7,6 +7,11 @@ import { setAuthority } from '@/utils/authority';
import
{
appConnector
}
from
'@/containers/App/store'
;
import
logo
from
'@/assets/images/logo/panda-logo2.png'
;
import
connectHistoryHoc
from
'@/containers/connectHistoryHoc'
;
const
roleName
=
{
admin
:
'管理员'
,
super
:
'超级管理员'
,
};
class
AvatarDropdown
extends
React
.
Component
{
/* eslint-disable no-unused-vars */
onMenuClick
=
event
=>
{
...
...
@@ -56,6 +61,7 @@ class AvatarDropdown extends React.Component {
<
/Menu.Item
>
<
/Menu
>
);
let
role
=
JSON
.
parse
(
localStorage
.
getItem
(
'panda-oms-authority'
))[
1
];
return
currentUser
?
(
<
HeaderDropdown
overlay
=
{
menuHeaderDropdown
}
>
<
span
className
=
{
`
${
styles
.
action
}
${
styles
.
account
}
`
}
>
...
...
@@ -66,7 +72,8 @@ class AvatarDropdown extends React.Component {
alt
=
"avatar"
/>
<
span
className
=
{
`
${
styles
.
name
}
anticon`
}
>
{
currentUser
.
name
||
loginName
||
'管理员'
}
{
roleName
[
role
]}
{
/* {currentUser.name || loginName || '管理员'} */
}
<
/span
>
<
/span
>
<
/HeaderDropdown
>
...
...
src/pages/database/InitDataBase.jsx
View file @
0064e792
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
React
,
{
useEffect
,
use
Ref
,
use
State
}
from
'react'
;
import
{
Card
,
Form
,
...
...
@@ -60,7 +60,7 @@ const InitDataBase = props => {
const
[
initContent
,
setInitContent
]
=
useState
(
''
);
// 数据库初始化内容
const
[
cardLoading
,
setCardLoading
]
=
useState
(
false
);
// 初始化card Loading
const
[
finish
,
setFinish
]
=
useState
(
false
);
const
scroll
=
useRef
(
null
);
// 获取数据库链接记录
useEffect
(()
=>
{
setTableLoading
(
true
);
...
...
@@ -136,11 +136,20 @@ const InitDataBase = props => {
setInitVisible
(
true
);
let
obj
=
form
.
getFieldsValue
();
doInitLog
();
for
(
let
i
=
0
;
i
<
9
;
i
++
)
{
for
(
let
i
=
0
;
i
<
3
;
i
++
)
{
setTimeout
(()
=>
{
doInitLog
();
},
100
);
}
const
timer
=
setInterval
(()
=>
{
if
(
scroll
.
current
.
scrollHeight
===
scroll
.
current
.
clientHeight
+
scroll
.
current
.
scrollTop
)
{
clearInterval
(
timer
);
}
scroll
.
current
.
scrollTo
(
0
,
scroll
.
current
.
scrollHeight
-
570
);
},
1000
);
initDBv4
({
_version
:
9999
,
_dc
:
Date
.
now
(),
...
...
@@ -580,10 +589,10 @@ const InitDataBase = props => {
setInitVisible
(
false
);
setInitContent
(
''
);
}
}
width=
"800px"
width=
{
800
}
bodyStyle=
{
{
maxH
eight
:
'600px'
,
overflowY
:
'scroll
'
,
h
eight
:
'600px'
,
// overflowY: 'auto
',
}
}
footer=
{
[
<
Button
...
...
@@ -596,7 +605,9 @@ const InitDataBase = props => {
</
Button
>,
]
}
>
{
initContent
}
<
div
ref=
{
scroll
}
style=
{
{
maxHeight
:
'570px'
,
overflowY
:
'auto'
}
}
>
{
initContent
}
</
div
>
</
Modal
>
<
Modal
...
...
src/pages/userCenter/siteManage/SiteManage.jsx
View file @
0064e792
...
...
@@ -10,7 +10,6 @@ import {
Spin
,
List
,
Space
,
Collapse
,
Checkbox
,
Select
,
}
from
'antd'
;
...
...
@@ -28,10 +27,10 @@ import {
getAllGroup
,
getStationUserList
,
}
from
'@/services/userCenter/siteManage/api'
;
import
ListCard
,
{
checkChildrenByCondition
,
getId
,
}
from
'@/components/CheckGroup'
;
//
import ListCard, {
//
checkChildrenByCondition,
//
getId,
//
} from '@/components/CheckGroup';
import
styles
from
'@/pages/userCenter/siteManage/SiteManage.less'
;
import
qs
from
'qs'
;
import
{
appConnector
}
from
'@/containers/App/store'
;
...
...
@@ -175,8 +174,8 @@ const SiteManage = props => {
</
List
.
Item
>
));
const
handleChangeCollpase
=
(
groupId
,
isShow
)
=>
{
let
index
=
dataList
.
findIndex
(
item
=>
item
.
GroupId
==
groupId
);
dataList
[
index
].
isShow
=
!
isShow
;
let
index
=
dataList
.
findIndex
(
item
=>
item
.
GroupId
==
=
groupId
);
//
dataList[index].isShow = !isShow;
if
(
dataList
[
index
].
children
&&
dataList
[
index
].
children
.
length
>
0
)
{
setdataList
(
lodash
.
cloneDeep
(
dataList
));
return
;
...
...
@@ -198,10 +197,12 @@ const SiteManage = props => {
dataList
[
index
].
selectList
=
e
.
target
.
checked
?
dataList
[
index
].
userList
:
[];
dataList
[
index
].
children
&&
if
(
dataList
[
index
].
children
)
{
dataList
[
index
].
children
.
forEach
(
item
=>
{
item
.
isChecked
=
e
.
target
.
checked
;
});
}
setdataList
(
lodash
.
cloneDeep
(
dataList
));
};
// 单个选择checkbox
...
...
@@ -369,9 +370,9 @@ const SiteManage = props => {
))
}
</
Select
>
</
Col
>
{
/* <Col span={3} /> */
}
<
Col
span=
{
15
}
style=
{
{
textAlign
:
'right'
}
}
>
<
Space
size=
"
small
"
>
<
Col
span=
{
3
}
/>
<
Col
span=
{
8
}
>
<
Space
size=
"
large
"
>
<
Button
type=
"primary"
onClick=
{
()
=>
{
...
...
@@ -427,13 +428,15 @@ const SiteManage = props => {
))
}
</
Spin
>
{
dataList
.
length
?
(
<
Button
type=
"primary"
className=
{
styles
.
siteCommit
}
onClick=
{
handleCommitBtn
}
>
提交
</
Button
>
<
div
style=
{
{
textAlign
:
'right'
}
}
>
<
Button
type=
"primary"
className=
{
styles
.
siteCommit
}
onClick=
{
handleCommitBtn
}
>
提交
</
Button
>
</
div
>
)
:
null
}
</
Card
>
</
div
>
...
...
@@ -452,35 +455,34 @@ const Panels = React.memo(props => {
className=
{
styles
.
sitePanelHead
}
onClick=
{
()
=>
props
.
handleChangeCollpase
(
GroupId
,
isShow
)
}
>
{
isShow
?
(
{
/* {
isShow ? (
<UpOutlined className={styles.siteIcon} />
) : (
<DownOutlined className={styles.siteIcon} />
)
}
)} */
}
<
UpOutlined
className=
{
styles
.
siteIcon
}
/>
<
p
style=
{
{
color
}
}
>
{
GroupName
}
</
p
>
</
div
>
{
isShow
?
(
<
div
className=
{
styles
.
sitePanelCon
}
>
<
Checkbox
key=
"0"
className=
{
styles
.
siteList
}
checked=
{
isChecked
}
onClick=
{
e
=>
props
.
handleChangeAll
(
e
,
index
)
}
>
全选
</
Checkbox
>
{
children
&&
children
.
map
((
v
,
vIndex
)
=>
(
<
CheckBoxRow
{
...
v
}
index=
{
index
}
vIndex=
{
vIndex
}
key=
{
v
.
userID
}
handleChangeSignel=
{
props
.
handleChangeSignel
}
/>
))
}
</
div
>
)
:
null
}
<
div
className=
{
styles
.
sitePanelCon
}
>
<
Checkbox
key=
"0"
className=
{
styles
.
siteList
}
checked=
{
isChecked
}
onClick=
{
e
=>
props
.
handleChangeAll
(
e
,
index
)
}
>
全选
</
Checkbox
>
{
children
&&
children
.
map
((
v
,
vIndex
)
=>
(
<
CheckBoxRow
{
...
v
}
index=
{
index
}
vIndex=
{
vIndex
}
key=
{
v
.
userID
}
handleChangeSignel=
{
props
.
handleChangeSignel
}
/>
))
}
</
div
>
</
div
>
);
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment