From 2daa6353b684e2b5bb7f16ba3473a22941434318 Mon Sep 17 00:00:00 2001 From: opensnail <598092184@qq.com> Date: Thu, 30 May 2024 23:12:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(sj=5F1.0.0=5Fbeta3):=20=E9=80=9A=E7=9F=A5?= =?UTF-8?q?=E4=BA=BA=E6=94=AF=E6=8C=81=E5=AF=BC=E5=87=BA=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/typings/api.d.ts | 8 ++++-- src/views/notify/recipient/index.vue | 38 ++++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 4 deletions(-) diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 3106f27..b65346a 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -649,8 +649,7 @@ declare namespace Api { /** notifyRecipient search params */ type NotifyRecipientParams = CommonType.RecordNullable< - Pick & - CommonSearchParams + Pick & CommonSearchParams >; /** notifyRecipient list */ @@ -659,6 +658,11 @@ declare namespace Api { /** 1: 钉钉通知 2: 邮件通知 3: 企业通知 4: 飞书 5: Webhook */ type AlarmType = 1 | 2 | 3 | 4 | 5; + type ExportNotifyRecipient = Common.CommonRecord<{ + notifyRecipientIds: string[]; + }> & + NotifyRecipientParams; + /* 1: application/json 2:application/x-www-form-urlencoded */ type AlarmTypeWebhook = 1 | 2; } diff --git a/src/views/notify/recipient/index.vue b/src/views/notify/recipient/index.vue index 3fc9375..a34c4b6 100644 --- a/src/views/notify/recipient/index.vue +++ b/src/views/notify/recipient/index.vue @@ -9,6 +9,7 @@ import { useTable, useTableOperate } from '@/hooks/common/table'; import { alarmTypeRecord } from '@/constants/business'; import { tagColor } from '@/utils/common'; import { useAuth } from '@/hooks/business/auth'; +import { downloadFetch } from '@/utils/download'; import NotifyRecipientOperateDrawer from './modules/notify-recipient-operate-drawer.vue'; import NotifyRecipientSearch from './modules/notify-recipient-search.vue'; import NotifyRecipientDetailDrawer from './modules/notify-recipient-detail-drawer.vue'; @@ -28,7 +29,7 @@ const { columns, columnChecks, data, getData, loading, mobilePagination, searchP size: 10, // if you want to use the searchParams in Form, you need to define the following properties, and the value is null // the value can not be undefined, otherwise the property in Form will not be reactive - recipientName: '', + recipientName: null, notifyType: null }, columns: () => [ @@ -137,6 +138,18 @@ async function handleDelete(id: string) { function edit(id: string) { handleEdit(id); } + +function body(): Api.NotifyRecipient.ExportNotifyRecipient { + return { + notifyRecipientIds: checkedRowKeys.value, + notifyType: searchParams.notifyType, + recipientName: searchParams.recipientName + }; +} + +function handleExport() { + downloadFetch('/notify-recipient/export', body(), $t('page.notifyRecipient.title')); +}