Commit 77dd2065 authored by d.arizona's avatar d.arizona

update

parent 12f6c03d
......@@ -47,7 +47,7 @@ export default class UserRole extends Component {
if (response.data.status === 'success') {
let data = response.data.data
let listData = data.sort((a,b) => a.user_id - b.user_id).map((item, index) => {
return [index, item.user_id, item.fullname === null? '-' : item.fullname, item.email, item.role_name, '-', item.status]
return [index, item.user_id, item.fullname === null? '-' : item.fullname, item.email, item.role_name, item.totalCompany, item.status]
})
this.setState({ listUser: listData })
} else {
......@@ -64,7 +64,7 @@ export default class UserRole extends Component {
if (response.data.status === 'success') {
let data = response.data.data
let listData = data.sort((a,b) => a.user_id - b.user_id).map((item, index) => {
return [index, item.user_id, item.fullname == null? '-' : item.fullname, item.email, item.role_name, '-', item.status]
return [index, item.user_id, item.fullname == null? '-' : item.fullname, item.email, item.role_name, item.totalCompany, item.status]
})
this.setState({ listUser: listData })
} else {
......@@ -271,7 +271,7 @@ export default class UserRole extends Component {
if (this.state.search.length > 0) {
this.searchUser()
} else {
this.getRole()
this.getUser()
}
}
}
......
......@@ -201,6 +201,29 @@ export default class EditUser extends Component {
this.setState({ company })
}
renderChild = (item, index) => {
console.log(item.child)
// item.child.map((items,indexs) => {
// return (
// // <Collapse in={true} timeout="auto" unmountOnExit>
// <div style={{ paddingLeft: 60, display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
// {/* {item.sub_menu.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
// {index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
// </span>} */}
// {/* <RemoveIcon color={'action'} fontSize={'small'} /> */}
// <span>
// <CustomCheckbox
// checked={this.handleItemChecked(items)}
// onChange={() => this.handleItemClick(items)}
// />
// </span>
// <Typography style={{ fontSize: 12 }}>{titleCase(items.company_name)}</Typography>
// </div>
// // </Collapse>
// )
// })
}
render() {
return (
<div className="test app-popup-show">
......@@ -388,7 +411,7 @@ export default class EditUser extends Component {
return(
<div>
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
{item.childCompany.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{item.child.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
</span>}
<span>
......@@ -399,26 +422,7 @@ export default class EditUser extends Component {
</span>
<Typography style={{ fontSize: 12 }}>{titleCase(item.company_name)}</Typography>
</div>
{item.childCompany.length > 0 && item.childCompany.map((items,indexs) => {
return (
<Collapse in={index === this.state.selectedIndex} timeout="auto" unmountOnExit>
<div style={{ paddingLeft: 60, display: 'flex', flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
{/* {item.sub_menu.length > 0 && <span onClick={() => this.setState({ selectedIndex: index === this.state.selectedIndex ? 0 : index })} style={{ marginLeft: 7, marginRight: 2 }}>
{index === this.state.selectedIndex ? <RemoveIcon color={'action'} fontSize={'small'} /> : <AddIcon color={'action'} fontSize={'small'} />}
</span>} */}
{/* <RemoveIcon color={'action'} fontSize={'small'} /> */}
<span>
<CustomCheckbox
checked={this.handleItemChecked(items)}
onChange={() => this.handleItemClick(items)}
/>
</span>
<Typography style={{ fontSize: 12 }}>{titleCase(items.company_name)}</Typography>
</div>
</Collapse>
)
})}
{this.renderChild(item,index)}
</div>
)
})}
......
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