|
@@ -5,8 +5,13 @@ import { setRolePermission } from '@/services/permission'
|
|
|
import { useRequest } from 'umi'
|
|
|
const { TabPane } = Tabs
|
|
|
|
|
|
-const SetPermission = ({ ID, activeKey }) => {
|
|
|
- const [bottom, setBottom] = useState(10)
|
|
|
+const SetPermission = ({ ID, activeKey, roleType }) => {
|
|
|
+ const bottom = 10
|
|
|
+ const [state, setState] = useState({
|
|
|
+ checkValue: []
|
|
|
+ })
|
|
|
+ console.log(state.checkValue)
|
|
|
+
|
|
|
const { run: trySetRolePermission } = useRequest(
|
|
|
(frontPermission: string) => setRolePermission({ ID, frontPermission }),
|
|
|
{
|
|
@@ -17,13 +22,12 @@ const SetPermission = ({ ID, activeKey }) => {
|
|
|
}
|
|
|
)
|
|
|
const handleOnchange = e => {
|
|
|
- // console.log(e)
|
|
|
-
|
|
|
- trySetRolePermission(ID, e)
|
|
|
+ setState({ ...state, checkValue: e })
|
|
|
+ // trySetRolePermission(ID, e)
|
|
|
}
|
|
|
useEffect(() => {
|
|
|
if (activeKey === '2') {
|
|
|
- trySetRolePermission(ID, e)
|
|
|
+ // trySetRolePermission(ID, e)
|
|
|
}
|
|
|
}, [activeKey])
|
|
|
return (
|
|
@@ -66,13 +70,19 @@ const SetPermission = ({ ID, activeKey }) => {
|
|
|
<div>
|
|
|
<h4 className="pt-3">我参与的项目</h4>
|
|
|
<div className="my-2">
|
|
|
- <Checkbox.Group options={[{ value: 'access', label: '查看项目' }]} />
|
|
|
+ <Checkbox.Group
|
|
|
+ onChange={handleOnchange}
|
|
|
+ options={[{ value: 'access', label: '查看项目' }]}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|
|
|
<h4 className="pt-3">全部项目</h4>
|
|
|
<div className="my-2">
|
|
|
- <Checkbox.Group options={[{ value: 'viewAllProjects', label: '查看项目' }]} />
|
|
|
+ <Checkbox.Group
|
|
|
+ onChange={handleOnchange}
|
|
|
+ options={[{ value: 'viewAllProjects', label: '查看项目' }]}
|
|
|
+ />
|
|
|
</div>
|
|
|
</div>
|
|
|
<div>
|