fix: bug#10777 11128 11212

This commit is contained in:
leiqiaochu 2023-03-30 11:32:15 +08:00
parent d7790f203f
commit 18d950d63f
2 changed files with 7 additions and 15 deletions

View File

@ -1366,16 +1366,7 @@ export default [
},
],
},
{
id: 'action',
name: '启/禁用',
permissions: [
{
permission: 'firmware-upgrade-task-manager',
actions: ['save'],
}
],
},
],
accessSupport: { text: "间接支持", value: "indirect" },
supportDataAccess: false,

View File

@ -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(