From b508d87416b0a54996c90e1e229466143f469d63 Mon Sep 17 00:00:00 2001 From: opensnail <598092184@qq.com> Date: Thu, 18 Apr 2024 18:18:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(sj=5F1.0.0):=20=E6=8E=A5=E5=85=A5=E9=A3=9E?= =?UTF-8?q?=E4=B9=A6=E3=80=81=E4=BC=81=E4=B8=9A=E5=BE=AE=E4=BF=A1=E3=80=81?= =?UTF-8?q?=E9=82=AE=E7=AE=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/langs/en-us.ts | 3 +- src/locales/langs/zh-cn.ts | 3 +- src/typings/api.d.ts | 9 +- src/typings/app.d.ts | 1 + src/typings/components.d.ts | 1 + .../recipient/modules/dingding-form.vue | 29 +++++- .../notify/recipient/modules/email-form.vue | 77 +++++++++++++++ .../notify/recipient/modules/lark-form.vue | 99 +++++++++++++++++++ .../notify-recipient-operate-drawer.vue | 32 +++--- .../recipient/modules/qiye-wecht-form.vue | 99 +++++++++++++++++++ 10 files changed, 328 insertions(+), 25 deletions(-) create mode 100644 src/views/notify/recipient/modules/email-form.vue create mode 100644 src/views/notify/recipient/modules/lark-form.vue create mode 100644 src/views/notify/recipient/modules/qiye-wecht-form.vue diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 38d9217..1e92d1d 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -566,7 +566,8 @@ const local: App.I18n.Schema = { addNotifyRecipient: 'Add Notify recipients', editNotifyRecipient: 'Add Notify recipients', ats: "{'@'}通知人", - webhookUrl: '通知地址' + webhookUrl: '通知地址', + tos: '通知人邮箱地址' } }, form: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index f3de5ac..0bb9779 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -562,7 +562,8 @@ const local: App.I18n.Schema = { addNotifyRecipient: '新增通知接收人', editNotifyRecipient: '编辑通知接收人', ats: "{'@'}通知人", - webhookUrl: '通知地址' + webhookUrl: '通知地址', + tos: '通知人邮箱地址' } }, form: { diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index b0cec28..4abe5ee 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -568,11 +568,18 @@ declare namespace Api { type DingDingNotify = Common.CommonRecord<{ /** 接收人名称 */ webhookUrl: string; - /** 通知类型 */ + /** @的用户 */ ats: string[]; }> & NotifyRecipient; + /** email Notify */ + type EmailNotify = Common.CommonRecord<{ + /** 通知人 */ + tos: string[]; + }> & + NotifyRecipient; + /** notifyRecipient search params */ type NotifyRecipientParams = CommonType.RecordNullable< Pick & diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 594d161..702df3d 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -738,6 +738,7 @@ declare namespace App { editNotifyRecipient: string; ats: string; webhookUrl: string; + tos: string; }; }; form: { diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 23bb140..8562bdb 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -59,6 +59,7 @@ declare module 'vue' { NFormItemGi: typeof import('naive-ui')['NFormItemGi'] NGi: typeof import('naive-ui')['NGi'] NGrid: typeof import('naive-ui')['NGrid'] + NIcon: typeof import('naive-ui')['NIcon'] NInput: typeof import('naive-ui')['NInput'] NInputGroup: typeof import('naive-ui')['NInputGroup'] NInputNumber: typeof import('naive-ui')['NInputNumber'] diff --git a/src/views/notify/recipient/modules/dingding-form.vue b/src/views/notify/recipient/modules/dingding-form.vue index e3a3a52..b6b16f7 100644 --- a/src/views/notify/recipient/modules/dingding-form.vue +++ b/src/views/notify/recipient/modules/dingding-form.vue @@ -62,13 +62,36 @@ defineExpose({ diff --git a/src/views/notify/recipient/modules/email-form.vue b/src/views/notify/recipient/modules/email-form.vue new file mode 100644 index 0000000..71b34fa --- /dev/null +++ b/src/views/notify/recipient/modules/email-form.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/src/views/notify/recipient/modules/lark-form.vue b/src/views/notify/recipient/modules/lark-form.vue new file mode 100644 index 0000000..e934fcf --- /dev/null +++ b/src/views/notify/recipient/modules/lark-form.vue @@ -0,0 +1,99 @@ + + + + + diff --git a/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue b/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue index 4923b72..abc88ad 100644 --- a/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue +++ b/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue @@ -5,12 +5,15 @@ import OperateDrawer from '@/components/common/operate-drawer.vue'; import { $t } from '@/locales'; import { fetchAddNotifyRecipient } from '@/service/api'; import DingDingForm from './dingding-form.vue'; +import LarkForm from './lark-form.vue'; +import EmailForm from './email-form.vue'; +import QiyeWechtForm from './qiye-wecht-form.vue'; defineOptions({ name: 'NotifyRecipientOperateDrawer' }); -const DingDingRef = ref(); +const CommonRef = ref(); interface Props { /** the type of operation */ @@ -57,13 +60,6 @@ function createDefaultModel(): Model { }; } -// const rules: Record = { -// recipientName: defaultRequiredRule, -// notifyType: defaultRequiredRule, -// notifyAttribute: defaultRequiredRule, -// description: defaultRequiredRule -// }; - function handleUpdateModelWhenEdit() { if (props.operateType === 'add') { Object.assign(model, createDefaultModel()); @@ -78,7 +74,7 @@ function handleUpdateModelWhenEdit() { async function handleSubmit() { // request if (props.operateType === 'add') { - DingDingRef.value?.save(); + CommonRef.value?.save(); } if (props.operateType === 'edit') { @@ -88,7 +84,7 @@ async function handleSubmit() { emit('submitted'); } -const dingDingFetchAdd = (dingDingModel: Api.NotifyRecipient.NotifyRecipient) => { +const commonFetchAdd = (dingDingModel: Api.NotifyRecipient.NotifyRecipient) => { const { recipientName, notifyAttribute, notifyType, description } = dingDingModel; fetchAddNotifyRecipient({ recipientName, notifyAttribute, notifyType, description }); }; @@ -109,18 +105,16 @@ watch(visible, () => { - + - - - - - + + + + + - - - +