Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev

This commit is contained in:
JiangQiming 2023-03-30 11:50:49 +08:00
commit 57af547bfb
2 changed files with 6 additions and 14 deletions

View File

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

View File

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