fix: bug#10777 11128 11212
This commit is contained in:
parent
d7790f203f
commit
18d950d63f
|
@ -1366,16 +1366,7 @@ export default [
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'action',
|
||||
name: '启/禁用',
|
||||
permissions: [
|
||||
{
|
||||
permission: 'firmware-upgrade-task-manager',
|
||||
actions: ['save'],
|
||||
}
|
||||
],
|
||||
},
|
||||
|
||||
],
|
||||
accessSupport: { text: "间接支持", value: "indirect" },
|
||||
supportDataAccess: false,
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
:pagination="false"
|
||||
:rowKey="'id'"
|
||||
:scroll="{ y: '500px' }"
|
||||
ref="treeRef"
|
||||
>
|
||||
<!-- 表头 -->
|
||||
<template #headerCell="{ column }">
|
||||
|
@ -99,13 +100,14 @@
|
|||
<script setup lang="ts">
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { getPrimissTree_api } from '@/api/system/role';
|
||||
|
||||
import { getCurrentInstance } from 'vue';
|
||||
const emits = defineEmits(['update:selectItems']);
|
||||
const route = useRoute();
|
||||
const props = defineProps({
|
||||
selectItems: Array,
|
||||
});
|
||||
|
||||
const treeRef = ref();
|
||||
let { ctx: that, proxy } = getCurrentInstance();
|
||||
const columns = [
|
||||
{
|
||||
title: '菜单权限',
|
||||
|
@ -282,7 +284,6 @@ function menuChange(
|
|||
row: tableItemType,
|
||||
setButtonBool: boolean = true,
|
||||
): undefined {
|
||||
console.log(row, 'test');
|
||||
// 判断是否需要对子菜单及操作权限进行选择
|
||||
if (setButtonBool) {
|
||||
if (row.buttons && row.buttons.length > 0)
|
||||
|
@ -311,7 +312,7 @@ function menuChange(
|
|||
const parent = flatTableData.find(
|
||||
(item) => item.id === row.parentId,
|
||||
) as tableItemType;
|
||||
setStatus(parent, 'children');
|
||||
// setStatus(parent, 'children');
|
||||
// 若该父节点不是根节点 重复此操作以此来确定该父节点的父节点状态
|
||||
if (parent.parentId) {
|
||||
return menuChange(parent, false);
|
||||
|
@ -334,6 +335,7 @@ function menuChange(
|
|||
indeterminate.value = false;
|
||||
}
|
||||
emits('update:selectItems', selectList); // 选中的项传回父组件
|
||||
treeRef.value.$forceUpdate();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -430,7 +432,6 @@ function setStatus(
|
|||
prop: 'children' | 'buttons' = 'children',
|
||||
) {
|
||||
const childrens = target[prop] as any[];
|
||||
|
||||
if (childrens && childrens instanceof Array) {
|
||||
// 如果子选项有半全选,则当前节点直接为半全选
|
||||
const indeterminateLen = childrens.filter(
|
||||
|
|
Loading…
Reference in New Issue