Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
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
Maple
TOSTUMI
Commits
6b46650b
Commit
6b46650b
authored
Dec 29, 2020
by
cellee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
账号权限
Signed-off-by:
cellee
<
893264950@qq.com
>
parent
a54e0a6a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
12 deletions
+28
-12
Tow.tsx
src/components/SelectCommunity/Tow.tsx
+9
-3
Tow.jsx
src/components/SelectOptions/Tow.jsx
+5
-5
AccountAdds.tsx
src/pages/AccountManagement/account/AccountAdds.tsx
+4
-1
AccountEdit.tsx
src/pages/AccountManagement/account/AccountEdit.tsx
+10
-3
No files found.
src/components/SelectCommunity/Tow.tsx
View file @
6b46650b
...
...
@@ -4,9 +4,9 @@ import SelectOptions from '../SelectOptions/Tow';
import
{
connect
}
from
'umi'
;
const
index
=
(
props
:
any
)
=>
{
const
{
dispatch
,
CommunityList
,
value
,
onChange
,
checklist
}
=
props
;
const
{
dispatch
,
CommunityList
,
value
,
onChange
,
checklist
,
list
}
=
props
;
// console.log(props)
const
[
Clist
,
setClist
]
=
useState
(
CommunityList
);
// 二级账户id
const
tosCommunityget
=
(
values
:
any
)
=>
{
dispatch
({
type
:
'Init/tosCommunityget'
,
playload
:
values
});
...
...
@@ -25,6 +25,12 @@ const index = (props: any) => {
}
},
[
checklist
]);
useEffect
(()
=>
{
if
(
list
!=
null
)
{
setClist
(
list
);
}
},
[
list
]);
// 点击选择的时候传递给子组件 已选列表
const
printContent
=
(
values
:
any
)
=>
{
onChange
({
index
:
CommunityList
.
length
==
values
.
length
?
1
:
0
,
value
:
values
});
...
...
@@ -33,7 +39,7 @@ const index = (props: any) => {
<>
{
CommunityList
!=
null
?
(
<
SelectOptions
list=
{
C
ommunityL
ist
.
sort
()
}
list=
{
C
l
ist
.
sort
()
}
checklist=
{
checklist
}
show=
{
true
}
onSubmit=
{
printContent
}
...
...
src/components/SelectOptions/Tow.jsx
View file @
6b46650b
...
...
@@ -92,13 +92,13 @@ class SelectOptions extends React.PureComponent {
componentWillReceiveProps
(
nextProps
)
{
// 如果存在更新 就拿取最新的选中小区值
// 判断是不是props 的最新值 否则每次点击都要更新
if
(
nextProps
.
checklist
!==
this
.
props
.
checklist
)
{
if
(
nextProps
.
list
!==
this
.
props
.
list
||
nextProps
.
checklist
!==
this
.
props
.
checklist
)
{
this
.
setState
({
menuList
:
ArrayToPingYin
.
get
(
nextProps
.
check
list
),
checkedListOptions
:
nextProps
.
check
list
,
menuList
:
ArrayToPingYin
.
get
(
nextProps
.
list
),
checkedListOptions
:
nextProps
.
list
,
checkedList
:
nextProps
.
checklist
,
indeterminate
:
fals
e
,
// 多选框 总框的 状态
checkAll
:
tru
e
,
// 判断传递来的小区是不是全选
indeterminate
:
tru
e
,
// 多选框 总框的 状态
checkAll
:
fals
e
,
// 判断传递来的小区是不是全选
checkNone
:
false
,
resultList
:
nextProps
.
checklist
,
flag
:
false
,
...
...
src/pages/AccountManagement/account/AccountAdds.tsx
View file @
6b46650b
...
...
@@ -337,7 +337,10 @@ const Account = (props: any) => {
</
Descriptions
>
<
Form
.
Item
name=
"community"
label=
"Community"
>
<
SelectCommunity
checklist=
{
community
?
community
:
null
}
/>
<
SelectCommunity
checklist=
{
community
?
community
:
null
}
list=
{
community
?
community
:
[]
}
/>
</
Form
.
Item
>
<
div
className=
"diy"
style=
{
{
marginBottom
:
'14px'
}
}
>
...
...
src/pages/AccountManagement/account/AccountEdit.tsx
View file @
6b46650b
...
...
@@ -7,7 +7,7 @@ import './Account.less';
import
{
zhCnFaci
,
enUsFaci
}
from
'@/utils/power'
;
import
{
AccountTip
}
from
'@/utils/tip'
;
import
SelectCommunity
from
'@/components/SelectCommunity'
;
import
SelectCommunity
from
'@/components/SelectCommunity
/Tow
'
;
import
{
getNumber
}
from
'@/utils/string'
;
// 正则
import
{
RA
}
from
'@/utils/method'
;
...
...
@@ -19,7 +19,7 @@ const Account = (props: any) => {
// 权限列表
const
treeData
=
localStorage
.
getItem
(
'umi_locale'
)
==
'zh-CN'
?
zhCnFaci
:
enUsFaci
;
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
<
string
[]
>
([
'0'
]);
// 展开栏目
const
[
expandedKeys
,
setExpandedKeys
]
=
useState
<
string
[]
>
([]);
// 展开栏目
const
[
checkedKeys
,
setCheckedKeys
]
=
useState
([]
as
any
);
// 默认已选栏目
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
<
string
[]
>
([]);
// 设置选中的树节点
const
[
autoExpandParent
,
setAutoExpandParent
]
=
useState
<
boolean
>
(
true
);
// 树形菜单展开关闭
...
...
@@ -346,7 +346,14 @@ const Account = (props: any) => {
</
Descriptions
>
<
Form
.
Item
name=
"community"
label=
"Community"
>
<
SelectCommunity
checklist=
{
community
}
/>
<
SelectCommunity
checklist=
{
community
}
list=
{
DataSave
&&
DataSave
.
userLeaderCommunityNames
?
DataSave
.
userLeaderCommunityNames
:
CommunityList
}
/>
</
Form
.
Item
>
<
div
className=
"diy"
style=
{
{
marginBottom
:
'14px'
}
}
>
...
...
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