|
@@ -104,6 +104,8 @@ const onChange = (checked, context) => {
|
|
|
if (node.data.Children.length) { // 如果当前节点有子节点,则把所有子节点的id都加上去
|
|
|
allChecked.value = [...new Set([...allChecked.value, node.value, ...getAllChildIds(node.data.Children)])];
|
|
|
actuallyAllChecked.value = [...new Set([...actuallyAllChecked.value, node.value, ...getAllChildIds(node.data.Children)])];
|
|
|
+ } else { // 如果当前节点有子节点,则直接加上该节点的id
|
|
|
+ actuallyAllChecked.value = [...new Set([...actuallyAllChecked.value, node.value])];
|
|
|
}
|
|
|
} else {
|
|
|
if (node.data.Children.length) { // 如果当前节点有子节点,则直接去掉该节点和子节点的所有id
|
|
@@ -145,7 +147,9 @@ const removeChildren = (arrayA, arrayB) => {
|
|
|
|
|
|
// 保存按钮
|
|
|
const handleSave = async () => {
|
|
|
- emit('setPermission', actuallyAllChecked.value);
|
|
|
+ console.log(actuallyAllChecked.value);
|
|
|
+
|
|
|
+ // emit('setPermission', actuallyAllChecked.value);
|
|
|
};
|
|
|
// 搜索
|
|
|
const changeSearchTxt = () => {
|