|
@ -59,10 +59,11 @@ function RoleMgm(props) { |
|
|
} |
|
|
} |
|
|
//添加移动管理角色 |
|
|
//添加移动管理角色 |
|
|
|
|
|
|
|
|
const [getGovernment, setGetGovernment] = useState([]) |
|
|
|
|
|
|
|
|
const [getGovernment, setGetGovernment] = useState(0) |
|
|
const handleDeptName = (e) => { |
|
|
const handleDeptName = (e) => { |
|
|
let arr = e |
|
|
let arr = e |
|
|
let lastElement = arr[arr.length - 1]; |
|
|
let lastElement = arr[arr.length - 1]; |
|
|
|
|
|
console.log(lastElement); |
|
|
setGetGovernment(lastElement) |
|
|
setGetGovernment(lastElement) |
|
|
setAddManage({ ...addManage, depart_id: lastElement }) |
|
|
setAddManage({ ...addManage, depart_id: lastElement }) |
|
|
}; |
|
|
}; |
|
@ -208,10 +209,8 @@ function RoleMgm(props) { |
|
|
//编辑 |
|
|
//编辑 |
|
|
const CheckApplyBtn = (record) => { |
|
|
const CheckApplyBtn = (record) => { |
|
|
setEditVisible(true) |
|
|
setEditVisible(true) |
|
|
let arr = record.auth |
|
|
|
|
|
let lastElement = arr[arr.length - 1]; |
|
|
|
|
|
console.log(lastElement); |
|
|
|
|
|
setGetGovernment(lastElement) |
|
|
|
|
|
|
|
|
console.log(record); |
|
|
|
|
|
setGetGovernment(record.depart_id) |
|
|
let data = { |
|
|
let data = { |
|
|
id: record.id |
|
|
id: record.id |
|
|
} |
|
|
} |
|
@ -225,7 +224,7 @@ function RoleMgm(props) { |
|
|
let str = record.auth |
|
|
let str = record.auth |
|
|
let strArr = str.split(","); |
|
|
let strArr = str.split(","); |
|
|
let num = strArr.map(Number) |
|
|
let num = strArr.map(Number) |
|
|
console.log(num); |
|
|
|
|
|
|
|
|
// console.log(num); |
|
|
setCheckedKeys(num) |
|
|
setCheckedKeys(num) |
|
|
setGetImg(Object.assign({}, getImg, { |
|
|
setGetImg(Object.assign({}, getImg, { |
|
|
name: record.name, |
|
|
name: record.name, |
|
@ -346,7 +345,7 @@ function RoleMgm(props) { |
|
|
auth: checkedKeys, |
|
|
auth: checkedKeys, |
|
|
id: getAdminId.id |
|
|
id: getAdminId.id |
|
|
} |
|
|
} |
|
|
ajax.editDataList(data).then(res => { |
|
|
|
|
|
|
|
|
ajax.editChange(data).then(res => { |
|
|
if (res.status === 20000) { |
|
|
if (res.status === 20000) { |
|
|
setEditVisible(false) |
|
|
setEditVisible(false) |
|
|
getData(formData) |
|
|
getData(formData) |
|
@ -362,7 +361,8 @@ function RoleMgm(props) { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
if (getGovernment.length != 0) { |
|
|
|
|
|
|
|
|
console.log(getGovernment); |
|
|
|
|
|
if (getGovernment != 0) { |
|
|
let data = { |
|
|
let data = { |
|
|
id: getGovernment |
|
|
id: getGovernment |
|
|
} |
|
|
} |
|
@ -479,7 +479,7 @@ function RoleMgm(props) { |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
{ |
|
|
{ |
|
|
getGovernment.length == 0 ? '' : <div className="yisa-search"> |
|
|
|
|
|
|
|
|
getGovernment == 0 ? '' : <div className="yisa-search"> |
|
|
<label>权限分配</label><span style={{ marginLeft: 20 }}><Checkbox onChange={onCheckbox}>全选</Checkbox></span> |
|
|
<label>权限分配</label><span style={{ marginLeft: 20 }}><Checkbox onChange={onCheckbox}>全选</Checkbox></span> |
|
|
<Tree |
|
|
<Tree |
|
|
checkable |
|
|
checkable |
|
@ -564,7 +564,7 @@ function RoleMgm(props) { |
|
|
/> |
|
|
/> |
|
|
</div> |
|
|
</div> |
|
|
{ |
|
|
{ |
|
|
getGovernment ==0 ? '' : <div className="yisa-search"> |
|
|
|
|
|
|
|
|
getGovernment == 0 ? '' : <div className="yisa-search"> |
|
|
<label>权限分配</label><span style={{ marginLeft: 20 }}><Checkbox onChange={onCheckEditbox}>全选</Checkbox></span> |
|
|
<label>权限分配</label><span style={{ marginLeft: 20 }}><Checkbox onChange={onCheckEditbox}>全选</Checkbox></span> |
|
|
<Tree |
|
|
<Tree |
|
|
checkable |
|
|
checkable |
|
|