chore: 调整间距
This commit is contained in:
parent
78806a0933
commit
d50b4fa47c
@ -2,9 +2,10 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
|||||||
import type { ID } from '#/api/common';
|
import type { ID } from '#/api/common';
|
||||||
import type { MenuOption } from '#/api/system/menu/model';
|
import type { MenuOption } from '#/api/system/menu/model';
|
||||||
|
|
||||||
import { FolderIcon, MenuIcon, OkButtonIcon, VbenIcon } from '@vben/icons';
|
|
||||||
import { h, markRaw } from 'vue';
|
import { h, markRaw } from 'vue';
|
||||||
|
|
||||||
|
import { FolderIcon, MenuIcon, OkButtonIcon, VbenIcon } from '@vben/icons';
|
||||||
|
|
||||||
export interface Permission {
|
export interface Permission {
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
id: ID;
|
id: ID;
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
import type { MenuOption } from '#/api/system/menu/model';
|
|
||||||
|
|
||||||
import type { MenuPermissionOption } from './data';
|
import type { MenuPermissionOption } from './data';
|
||||||
|
|
||||||
|
import type { MenuOption } from '#/api/system/menu/model';
|
||||||
|
|
||||||
import { eachTree } from '@vben/utils';
|
import { eachTree } from '@vben/utils';
|
||||||
|
|
||||||
import { difference } from 'lodash-es';
|
import { difference } from 'lodash-es';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,14 +1,17 @@
|
|||||||
<script setup lang="tsx">
|
<script setup lang="tsx">
|
||||||
|
import type { MenuPermissionOption } from './data';
|
||||||
|
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
import type { MenuOption } from '#/api/system/menu/model';
|
import type { MenuOption } from '#/api/system/menu/model';
|
||||||
|
|
||||||
import type { MenuPermissionOption } from './data';
|
import { nextTick, onMounted, ref, watch } from 'vue';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
||||||
import { cloneDeep, findGroupParentIds } from '@vben/utils';
|
import { cloneDeep, findGroupParentIds } from '@vben/utils';
|
||||||
|
|
||||||
import { Alert, Checkbox, RadioGroup, Space } from 'ant-design-vue';
|
import { Alert, Checkbox, RadioGroup, Space } from 'ant-design-vue';
|
||||||
import { uniq } from 'lodash-es';
|
import { uniq } from 'lodash-es';
|
||||||
import { nextTick, onMounted, ref, watch } from 'vue';
|
|
||||||
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { columns, nodeOptions } from './data';
|
import { columns, nodeOptions } from './data';
|
||||||
import { menusWithPermissions, rowAndChildrenChecked } from './helper';
|
import { menusWithPermissions, rowAndChildrenChecked } from './helper';
|
||||||
@ -339,7 +342,7 @@ defineExpose({
|
|||||||
/>
|
/>
|
||||||
<Alert class="mx-2" type="info">
|
<Alert class="mx-2" type="info">
|
||||||
<template #message>
|
<template #message>
|
||||||
<div v-if="tableApi?.grid">
|
<div>
|
||||||
已选中
|
已选中
|
||||||
<span class="text-primary mx-1 font-semibold">
|
<span class="text-primary mx-1 font-semibold">
|
||||||
{{ checkedNum }}
|
{{ checkedNum }}
|
||||||
@ -361,7 +364,7 @@ defineExpose({
|
|||||||
</Space>
|
</Space>
|
||||||
</template>
|
</template>
|
||||||
<template #permissions="{ row }">
|
<template #permissions="{ row }">
|
||||||
<div class="flex flex-wrap gap-3">
|
<div class="flex flex-wrap gap-x-3 gap-y-1">
|
||||||
<Checkbox
|
<Checkbox
|
||||||
v-for="permission in row.permissions"
|
v-for="permission in row.permissions"
|
||||||
:key="permission.id"
|
:key="permission.id"
|
||||||
|
@ -3,7 +3,9 @@ import type { CheckboxChangeEvent } from 'ant-design-vue/es/checkbox/interface';
|
|||||||
import type { DataNode } from 'ant-design-vue/es/tree';
|
import type { DataNode } from 'ant-design-vue/es/tree';
|
||||||
import type { CheckInfo } from 'ant-design-vue/es/vc-tree/props';
|
import type { CheckInfo } from 'ant-design-vue/es/vc-tree/props';
|
||||||
|
|
||||||
import { computed, nextTick, onMounted, type PropType, ref, watch } from 'vue';
|
import type { PropType } from 'vue';
|
||||||
|
|
||||||
|
import { computed, nextTick, onMounted, ref, watch } from 'vue';
|
||||||
|
|
||||||
import { findGroupParentIds, treeToList } from '@vben/utils';
|
import { findGroupParentIds, treeToList } from '@vben/utils';
|
||||||
|
|
||||||
@ -108,8 +110,8 @@ const stop = watch([checkedKeys, () => props.treeData], () => {
|
|||||||
* @param info info.halfCheckedKeys为父节点的ID
|
* @param info info.halfCheckedKeys为父节点的ID
|
||||||
*/
|
*/
|
||||||
type CheckedState<T = number | string> =
|
type CheckedState<T = number | string> =
|
||||||
| { checked: T[]; halfChecked: T[] }
|
| T[]
|
||||||
| T[];
|
| { checked: T[]; halfChecked: T[] };
|
||||||
function handleChecked(checkedStateKeys: CheckedState, info: CheckInfo) {
|
function handleChecked(checkedStateKeys: CheckedState, info: CheckInfo) {
|
||||||
// 数组的话为节点关联
|
// 数组的话为节点关联
|
||||||
if (Array.isArray(checkedStateKeys)) {
|
if (Array.isArray(checkedStateKeys)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user