diff --git a/backend/system/views/menu.py b/backend/system/views/menu.py index 03c38ca..e87441e 100644 --- a/backend/system/views/menu.py +++ b/backend/system/views/menu.py @@ -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", diff --git a/web/apps/web-antd/src/api/system/dept.ts b/web/apps/web-antd/src/api/system/dept.ts index e2fc485..950c920 100644 --- a/web/apps/web-antd/src/api/system/dept.ts +++ b/web/apps/web-antd/src/api/system/dept.ts @@ -16,7 +16,7 @@ export namespace SystemDeptApi { /** * 获取部门列表数据 */ -async function getDeptList(params: Recordable) { +async function getDeptList(params?: Recordable) { return requestClient.get>('/system/dept/', { params, }); diff --git a/web/apps/web-antd/src/views/system/dept/list.vue b/web/apps/web-antd/src/views/system/dept/list.vue index 4c6eff9..1b4154d 100644 --- a/web/apps/web-antd/src/views/system/dept/list.vue +++ b/web/apps/web-antd/src/views/system/dept/list.vue @@ -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(); }, }, }, diff --git a/web/apps/web-antd/src/views/system/dict_data/data.ts b/web/apps/web-antd/src/views/system/dict_data/data.ts index f7ca842..3b801f5 100644 --- a/web/apps/web-antd/src/views/system/dict_data/data.ts +++ b/web/apps/web-antd/src/views/system/dict_data/data.ts @@ -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', diff --git a/web/apps/web-antd/src/views/system/dict_type/data.ts b/web/apps/web-antd/src/views/system/dict_type/data.ts index 4264dfa..2788cd6 100644 --- a/web/apps/web-antd/src/views/system/dict_type/data.ts +++ b/web/apps/web-antd/src/views/system/dict_type/data.ts @@ -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', diff --git a/web/apps/web-antd/src/views/system/menu/data.ts b/web/apps/web-antd/src/views/system/menu/data.ts index 75190b4..dd4db56 100644 --- a/web/apps/web-antd/src/views/system/menu/data.ts +++ b/web/apps/web-antd/src/views/system/menu/data.ts @@ -42,7 +42,7 @@ export function useColumns( width: 100, }, { - field: 'authCode', + field: 'auth_code', title: $t('system.menu.authCode'), width: 200, }, diff --git a/web/apps/web-antd/src/views/system/menu/list.vue b/web/apps/web-antd/src/views/system/menu/list.vue index c34c31f..9ab4564 100644 --- a/web/apps/web-antd/src/views/system/menu/list.vue +++ b/web/apps/web-antd/src/views/system/menu/list.vue @@ -29,7 +29,7 @@ const [Grid, gridApi] = useVbenVxeGrid({ height: 'auto', keepSource: true, pagerConfig: { - enabled: true, + enabled: false, }, proxyConfig: { ajax: { diff --git a/web/apps/web-antd/src/views/system/menu/modules/form.vue b/web/apps/web-antd/src/views/system/menu/modules/form.vue index 94975b8..0fdd033 100644 --- a/web/apps/web-antd/src/views/system/menu/modules/form.vue +++ b/web/apps/web-antd/src/views/system/menu/modules/form.vue @@ -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'], }, diff --git a/web/apps/web-antd/src/views/system/role/modules/form.vue b/web/apps/web-antd/src/views/system/role/modules/form.vue index 6afae5f..0581a29 100644 --- a/web/apps/web-antd/src/views/system/role/modules/form.vue +++ b/web/apps/web-antd/src/views/system/role/modules/form.vue @@ -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;