修改菜单管理

This commit is contained in:
xie7654
2025-06-30 21:18:26 +08:00
parent bfe190ef74
commit c7f7bf9258
9 changed files with 23 additions and 21 deletions

View File

@@ -16,7 +16,7 @@ export namespace SystemDeptApi {
/**
* 获取部门列表数据
*/
async function getDeptList(params: Recordable<any>) {
async function getDeptList(params?: Recordable<any>) {
return requestClient.get<Array<SystemDeptApi.SystemDept>>('/system/dept/', {
params,
});

View File

@@ -98,15 +98,12 @@ const [Grid, gridApi] = useVbenVxeGrid({
height: 'auto',
keepSource: true,
pagerConfig: {
enabled: true,
enabled: false,
},
proxyConfig: {
ajax: {
query: async ({ page }, _params) => {
return await getDeptList({
page: page.currentPage,
pageSize: page.pageSize,
});
query: async (_params) => {
return await getDeptList();
},
},
},

View File

@@ -7,6 +7,7 @@ import type { SystemDictDataApi } from '#/api/system/dict_data';
import { z } from '#/adapter/form';
import { getDictTypeList } from '#/api/system/dict_type';
import { $t } from '#/locales';
import {format_datetime} from "#/utils/date";
/**
* 获取编辑表单的字段配置。如果没有使用多语言可以直接export一个数组常量
@@ -157,7 +158,6 @@ export function useColumns(
{
field: 'color_type',
title: '颜色类型',
},
{
field: 'css_class',
@@ -183,6 +183,7 @@ export function useColumns(
field: 'create_time',
title: '创建时间',
width: 180,
formatter: ({ cellValue }) => format_datetime(cellValue),
},
{
align: 'right',

View File

@@ -6,6 +6,7 @@ import type { SystemDictTypeApi } from '#/api/system/dict_type';
import { z } from '#/adapter/form';
import { $t } from '#/locales';
import {format_datetime} from "#/utils/date";
/**
* 获取编辑表单的字段配置。如果没有使用多语言可以直接export一个数组常量
@@ -113,6 +114,7 @@ export function useColumns(
field: 'create_time',
title: '创建时间',
width: 180,
formatter: ({ cellValue }) => format_datetime(cellValue),
},
{
align: 'right',

View File

@@ -42,7 +42,7 @@ export function useColumns(
width: 100,
},
{
field: 'authCode',
field: 'auth_code',
title: $t('system.menu.authCode'),
width: 200,
},

View File

@@ -29,7 +29,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
height: 'auto',
keepSource: true,
pagerConfig: {
enabled: true,
enabled: false,
},
proxyConfig: {
ajax: {

View File

@@ -245,11 +245,13 @@ const schema: VbenFormSchema[] = [
return values.type === 'action' ? 'required' : null;
},
show: (values) => {
return ['action', 'catalog', 'embedded', 'menu'].includes(values.type);
return ['action', 'button', 'catalog', 'embedded', 'menu'].includes(
values.type,
);
},
triggerFields: ['type'],
},
fieldName: 'authCode',
fieldName: 'auth_code',
label: $t('system.menu.authCode'),
},
{
@@ -278,7 +280,8 @@ const schema: VbenFormSchema[] = [
},
dependencies: {
show: (values) => {
return values.type !== 'action';
// return values.type !== 'action';
return !['action', 'button'].includes(values.type);
},
triggerFields: ['type'],
},
@@ -296,7 +299,7 @@ const schema: VbenFormSchema[] = [
},
dependencies: {
show: (values) => {
return values.type !== 'action';
return !['action', 'button'].includes(values.type);
},
triggerFields: ['type'],
},
@@ -315,7 +318,7 @@ const schema: VbenFormSchema[] = [
},
dependencies: {
show: (values) => {
return values.type !== 'action';
return !['action', 'button'].includes(values.type);
},
triggerFields: ['type'],
},
@@ -326,7 +329,7 @@ const schema: VbenFormSchema[] = [
component: 'Divider',
dependencies: {
show: (values) => {
return !['action', 'link'].includes(values.type);
return !['action', 'button', 'link'].includes(values.type);
},
triggerFields: ['type'],
},
@@ -373,7 +376,7 @@ const schema: VbenFormSchema[] = [
component: 'Checkbox',
dependencies: {
show: (values) => {
return !['action'].includes(values.type);
return !['action', 'button'].includes(values.type);
},
triggerFields: ['type'],
},
@@ -403,7 +406,7 @@ const schema: VbenFormSchema[] = [
component: 'Checkbox',
dependencies: {
show: (values) => {
return !['action', 'link'].includes(values.type);
return !['action', 'button', 'link'].includes(values.type);
},
triggerFields: ['type'],
},
@@ -418,7 +421,7 @@ const schema: VbenFormSchema[] = [
component: 'Checkbox',
dependencies: {
show: (values) => {
return !['action', 'link'].includes(values.type);
return !['action', 'button', 'link'].includes(values.type);
},
triggerFields: ['type'],
},

View File

@@ -70,6 +70,7 @@ async function loadPermissions() {
loadingPermissions.value = true;
try {
const res = await getMenuList();
console.log(res, 'res')
permissions.value = res.items as unknown as DataNode[];
} finally {
loadingPermissions.value = false;