feat: 优化显示效果
parent
c54e0a5899
commit
47c4931fe1
|
@ -76,6 +76,15 @@ export function useTypeGridFormSchema(): VbenFormSchema[] {
|
||||||
clearable: true,
|
clearable: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fieldName: 'type',
|
||||||
|
label: '字典类型',
|
||||||
|
component: 'Input',
|
||||||
|
componentProps: {
|
||||||
|
placeholder: '请输入字典类型',
|
||||||
|
clearable: true,
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
fieldName: 'status',
|
fieldName: 'status',
|
||||||
label: '状态',
|
label: '状态',
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import type { Recordable } from '@vben/types';
|
||||||
|
|
||||||
import type { SystemDeptApi } from '#/api/system/dept';
|
import type { SystemDeptApi } from '#/api/system/dept';
|
||||||
import type { SystemRoleApi } from '#/api/system/role';
|
import type { SystemRoleApi } from '#/api/system/role';
|
||||||
|
|
||||||
|
@ -13,6 +15,7 @@ import { useVbenForm } from '#/adapter/form';
|
||||||
import { getMenuList } from '#/api/system/menu';
|
import { getMenuList } from '#/api/system/menu';
|
||||||
import { assignRoleMenu, getRoleMenuList } from '#/api/system/permission';
|
import { assignRoleMenu, getRoleMenuList } from '#/api/system/permission';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
|
import { SystemMenuTypeEnum } from '#/utils';
|
||||||
|
|
||||||
import { useAssignMenuFormSchema } from '../data';
|
import { useAssignMenuFormSchema } from '../data';
|
||||||
|
|
||||||
|
@ -121,6 +124,18 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
|
||||||
});
|
});
|
||||||
return ids;
|
return ids;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getNodeClass(node: Recordable<any>) {
|
||||||
|
const classes: string[] = [];
|
||||||
|
if (node.value?.type === SystemMenuTypeEnum.BUTTON) {
|
||||||
|
classes.push('inline-flex');
|
||||||
|
if (node.index % 3 >= 1) {
|
||||||
|
classes.push('!pl-0');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return classes.join(' ');
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -134,9 +149,11 @@ function getAllNodeIds(nodes: any[], ids: number[] = []): number[] {
|
||||||
multiple
|
multiple
|
||||||
bordered
|
bordered
|
||||||
:expanded="expandedKeys"
|
:expanded="expandedKeys"
|
||||||
|
:get-node-class="getNodeClass"
|
||||||
v-bind="slotProps"
|
v-bind="slotProps"
|
||||||
value-field="id"
|
value-field="id"
|
||||||
label-field="name"
|
label-field="name"
|
||||||
|
icon-field="meta.icon"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
</Form>
|
</Form>
|
||||||
|
|
Loading…
Reference in New Issue