修改菜单管理
This commit is contained in:
@@ -94,7 +94,6 @@ class MenuViewSet(CustomModelViewSet):
|
||||
if name:
|
||||
queryset = queryset.filter(name=name)
|
||||
has_menu_name = queryset.exists()
|
||||
print(has_menu_name, 'has_menu_name')
|
||||
return self._build_response(data=has_menu_name)
|
||||
|
||||
@action(detail=False, methods=['get'], url_path='path-exists')
|
||||
@@ -114,7 +113,6 @@ class MenuViewSet(CustomModelViewSet):
|
||||
# If 'prefetch_related' has been applied to a queryset, we need to
|
||||
# forcibly invalidate the prefetch cache on the instance.
|
||||
instance._prefetched_objects_cache = {}
|
||||
headers = self.get_success_headers(serializer.data)
|
||||
return self._build_response(
|
||||
data=serializer.data,
|
||||
message="ok",
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
|
||||
@@ -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();
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -42,7 +42,7 @@ export function useColumns(
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
field: 'authCode',
|
||||
field: 'auth_code',
|
||||
title: $t('system.menu.authCode'),
|
||||
width: 200,
|
||||
},
|
||||
|
||||
@@ -29,7 +29,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
pagerConfig: {
|
||||
enabled: true,
|
||||
enabled: false,
|
||||
},
|
||||
proxyConfig: {
|
||||
ajax: {
|
||||
|
||||
@@ -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'],
|
||||
},
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user