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