Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ethan
/
ant-admin-pro
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit f89d8610
authored
2018-01-24 15:45:21 +0800
by
ethanlamzs
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
树形数据 选择逻辑
1 parent
b270d3cf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
7 deletions
src/routes/devutil/schoollist.js
src/routes/devutil/schoolmgr.js
src/routes/devutil/schoollist.js
View file @
f89d861
...
...
@@ -165,6 +165,9 @@ export default class linkmanadm extends PureComponent {
const
{
schools
:
{
data
},
loading
}
=
this
.
props
;
const
{
selectedRows
,
modalVisible
,
addInputValue
}
=
this
.
state
;
console
.
log
(
'schlist'
);
console
.
log
(
this
.
props
);
const
columns
=
[
{
title
:
'学校'
,
...
...
src/routes/devutil/schoolmgr.js
View file @
f89d861
...
...
@@ -15,7 +15,8 @@ import {
Tooltip
,
Menu
,
Dropdown
,
Tree
Tree
,
Button
}
from
'antd'
;
import
{
...
...
@@ -46,15 +47,14 @@ const TreeNode = Tree.TreeNode;
export
default
class
schoolmgr
extends
Component
{
state
=
{
checkedKeys
:[],
};
componentDidMount
()
{
const
{
dispatch
}
=
this
.
props
;
//console.log(this.props);
//console.log(this.state);
let
schoolCode
=
this
.
props
.
match
.
params
.
schcode
;
this
.
setState
({
...
...
@@ -68,7 +68,7 @@ export default class schoolmgr extends Component{
}
//初始化对应的树节点数据
onLoadData
=
(
treeNode
)
=>
{
return
new
Promise
((
resolve
)
=>
{
if
(
treeNode
.
props
.
children
)
{
...
...
@@ -89,6 +89,7 @@ export default class schoolmgr extends Component{
}
//加载所有数节点
renderTreeNodes
=
(
data
)
=>
{
return
data
.
map
((
item
)
=>
{
if
(
item
.
children
)
{
...
...
@@ -104,6 +105,7 @@ export default class schoolmgr extends Component{
});
}
//加载对应的联系人节点
renderTreeLefs
=
(
groupid
)
=>
{
const
{
linkman
:{
linkmanMap
}}
=
this
.
props
;
if
(
linkmanMap
[
'g_'
+
groupid
]){
...
...
@@ -116,6 +118,17 @@ export default class schoolmgr extends Component{
return
""
;
}
onCheck
=
(
checkedKeys
)
=>
{
console
.
log
(
'onCheck'
,
checkedKeys
);
this
.
setState
({
checkedKeys
});
}
//根据当前选择的对象,删除指定的联系人
removelkman
=
()
=>
{
console
.
log
(
'removelkman'
);
}
render
(){
...
...
@@ -159,13 +172,27 @@ export default class schoolmgr extends Component{
<
Col
xl
=
{
16
}
lg
=
{
24
}
md
=
{
24
}
sm
=
{
24
}
xs
=
{
24
}
>
<
div
>
<
div
><
span
>
企业号通讯录结构
<
/span></
div
>
<
Tree
checkable
loadData
=
{
this
.
onLoadData
}
>
<
Tree
checkable
loadData
=
{
this
.
onLoadData
}
onCheck
=
{
this
.
onCheck
}
checkedKeys
=
{
this
.
state
.
checkedKeys
}
>
{
this
.
renderTreeNodes
(
groups
)}
<
/Tree
>
<
/div
>
<
/Col
>
<
Col
xl
=
{
8
}
lg
=
{
24
}
md
=
{
24
}
sm
=
{
24
}
xs
=
{
24
}
>
<
div
>
two
<
/div
>
<
div
>
<
ChartCard
bordered
=
{
false
}
title
=
'操作/功能区'
contentHeight
=
{
46
}
>
<
div
>
<
Button
style
=
{{
marginLeft
:
8
}}
onClick
=
{
this
.
removelkman
}
>
删除联系人
<
/Button
>
<
/div
>
<
/ChartCard
>
<
/div
>
<
/Col
>
<
/Row
>
<
/div>
;
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment