From 8f66be32c19044f31240e06ddfb2738caceb3faf Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Sat, 5 Oct 2024 16:06:20 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=9A=E7=9F=A5=E5=85=AC=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/api/system/notice/index.ts | 4 +- apps/web-antd/src/views/system/notice/data.ts | 47 ++++- .../src/views/system/notice/index.vue | 172 ++++++++++++++---- 3 files changed, 185 insertions(+), 38 deletions(-) diff --git a/apps/web-antd/src/api/system/notice/index.ts b/apps/web-antd/src/api/system/notice/index.ts index 6a8e2d15..82877943 100644 --- a/apps/web-antd/src/api/system/notice/index.ts +++ b/apps/web-antd/src/api/system/notice/index.ts @@ -26,7 +26,5 @@ export function noticeUpdate(data: any) { } export function noticeRemove(noticeIds: IDS) { - return requestClient.deleteWithMsg( - `${Api.root}/${noticeIds.join(',')}`, - ); + return requestClient.deleteWithMsg(`${Api.root}/${noticeIds}`); } diff --git a/apps/web-antd/src/views/system/notice/data.ts b/apps/web-antd/src/views/system/notice/data.ts index 2ac4aae5..07ae5b21 100644 --- a/apps/web-antd/src/views/system/notice/data.ts +++ b/apps/web-antd/src/views/system/notice/data.ts @@ -1,9 +1,10 @@ -import type { FormSchemaGetter } from '#/adapter'; +import type { FormSchemaGetter, VxeGridProps } from '#/adapter'; import { DictEnum } from '@vben/constants'; import { getPopupContainer } from '@vben/utils'; import { getDictOptions } from '#/utils/dict'; +import { renderDict } from '#/utils/render'; export const querySchema: FormSchemaGetter = () => [ { @@ -27,6 +28,50 @@ export const querySchema: FormSchemaGetter = () => [ }, ]; +export const columns: VxeGridProps['columns'] = [ + { type: 'checkbox', width: 60 }, + { + title: '公告标题', + field: 'noticeTitle', + }, + { + title: '公告类型', + field: 'noticeType', + width: 120, + slots: { + default: ({ row }) => { + return renderDict(row.noticeType, DictEnum.SYS_NOTICE_TYPE); + }, + }, + }, + { + title: '状态', + field: 'status', + width: 120, + slots: { + default: ({ row }) => { + return renderDict(row.status, DictEnum.SYS_NOTICE_STATUS); + }, + }, + }, + { + title: '创建人', + field: 'createByName', + width: 150, + }, + { + title: '创建时间', + field: 'createTime', + }, + { + field: 'action', + fixed: 'right', + slots: { default: 'action' }, + title: '操作', + width: 180, + }, +]; + export const modalSchema: FormSchemaGetter = () => [ { component: 'Input', diff --git a/apps/web-antd/src/views/system/notice/index.vue b/apps/web-antd/src/views/system/notice/index.vue index e8b6af1d..50ba542b 100644 --- a/apps/web-antd/src/views/system/notice/index.vue +++ b/apps/web-antd/src/views/system/notice/index.vue @@ -1,54 +1,158 @@