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, () => { - + - - - - - + + + + + - - - +