|
|
@ -1,4 +1,4 @@
|
|
|
|
import React, { useState, useEffect } from 'react'
|
|
|
|
import React, { useState, useEffect, memo } from 'react'
|
|
|
|
import { trigger, WordsBtn } from 'educoder'
|
|
|
|
import { trigger, WordsBtn } from 'educoder'
|
|
|
|
import { Input, Checkbox, Popconfirm } from "antd";
|
|
|
|
import { Input, Checkbox, Popconfirm } from "antd";
|
|
|
|
import axios from 'axios'
|
|
|
|
import axios from 'axios'
|
|
|
@ -8,9 +8,11 @@ import axios from 'axios'
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSuccess, showNotification, getUserId, fetchUser }) {
|
|
|
|
function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSuccess, showNotification, getUserId, fetchUser }) {
|
|
|
|
const [checkBoxRoles, setCheckBoxRoles] = useState(member_roles)
|
|
|
|
const [checkBoxRoles, setCheckBoxRoles] = useState(member_roles)
|
|
|
|
useEffect(() => {
|
|
|
|
// useEffect(() => {
|
|
|
|
setCheckBoxRoles(member_roles)
|
|
|
|
// if (checkBoxRoles.length != member_roles.length) { // 死循环
|
|
|
|
}, [member_roles])
|
|
|
|
// setCheckBoxRoles(member_roles)
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
// }, [member_roles])
|
|
|
|
function onCheckBoxChange(val) {
|
|
|
|
function onCheckBoxChange(val) {
|
|
|
|
console.log(val)
|
|
|
|
console.log(val)
|
|
|
|
|
|
|
|
|
|
|
@ -77,4 +79,4 @@ function ChangeRolePop({ member_roles = [], record, courseId, onChangeRoleSucces
|
|
|
|
</Popconfirm>
|
|
|
|
</Popconfirm>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
export default ChangeRolePop
|
|
|
|
export default memo(ChangeRolePop)
|