From 297b12a4a08aaf682818ab9ef5ee068983a4c168 Mon Sep 17 00:00:00 2001 From: opensnail <598092184@qq.com> Date: Thu, 18 Apr 2024 16:36:11 +0800 Subject: [PATCH] =?UTF-8?q?feat(sj=5F1.0.0):=20=E9=80=9A=E7=9F=A5=E4=BA=BA?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=AE=8C=E6=88=90=E9=92=89=E9=92=89=E6=96=B0?= =?UTF-8?q?=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/langs/en-us.ts | 10 ++- src/locales/langs/zh-cn.ts | 10 ++- src/service/api/notify.ts | 4 +- src/typings/api.d.ts | 16 +++- src/typings/app.d.ts | 6 ++ src/typings/components.d.ts | 1 + .../recipient/modules/dingding-form.vue | 76 +++++++++++++++++++ .../notify-recipient-operate-drawer.vue | 69 +++++++++-------- 8 files changed, 152 insertions(+), 40 deletions(-) create mode 100644 src/views/notify/recipient/modules/dingding-form.vue diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 2716601..38d9217 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -557,10 +557,16 @@ const local: App.I18n.Schema = { description: 'Please enter Describe', notifyAttribute: 'Please enter Attribute information', recipientName: 'Please enter Recipient name', - notifyType: 'lease select Notification type' + notifyType: 'lease select Notification type', + dingdingAts: "请输入被{'@'}人手机号或钉钉号", + qiYeWechatAts: "请输入被{'@'}人企业微信用户id", + larkAts: "请输入被{'@'}人open_id", + webhookUrl: '请输入URL' }, addNotifyRecipient: 'Add Notify recipients', - editNotifyRecipient: 'Add Notify recipients' + editNotifyRecipient: 'Add Notify recipients', + ats: "{'@'}通知人", + webhookUrl: '通知地址' } }, form: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index fc778d3..f3de5ac 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -553,10 +553,16 @@ const local: App.I18n.Schema = { description: '请输入描述', notifyAttribute: '请输入属性信息', recipientName: '请输入接收人名称', - notifyType: '请选择通知类型' + notifyType: '请选择通知类型', + dingdingAts: "请输入被{'@'}人手机号或钉钉号", + qiYeWechatAts: "请输入被{'@'}人企业微信用户id", + larkAts: "请输入被{'@'}人open_id", + webhookUrl: '请输入URL' }, addNotifyRecipient: '新增通知接收人', - editNotifyRecipient: '编辑通知接收人' + editNotifyRecipient: '编辑通知接收人', + ats: "{'@'}通知人", + webhookUrl: '通知地址' } }, form: { diff --git a/src/service/api/notify.ts b/src/service/api/notify.ts index b4c8f84..3170462 100644 --- a/src/service/api/notify.ts +++ b/src/service/api/notify.ts @@ -39,7 +39,7 @@ export function fetchGetNotifyRecipientList(params?: Api.NotifyRecipient.NotifyR /** add notify recipient */ export function fetchAddNotifyRecipient(data: Api.NotifyRecipient.NotifyRecipient) { return request({ - url: '/notify-config', + url: '/notify-recipient', method: 'post', data }); @@ -48,7 +48,7 @@ export function fetchAddNotifyRecipient(data: Api.NotifyRecipient.NotifyRecipien /** edit notify recipient */ export function fetchEditNotifyRecipient(data: Api.NotifyRecipient.NotifyRecipient) { return request({ - url: '/notify-config', + url: '/notify-recipient', method: 'put', data }); diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 1487c1f..b0cec28 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -557,13 +557,22 @@ declare namespace Api { /** 接收人名称 */ recipientName: string; /** 通知类型 */ - notifyType: string; + notifyType: AlarmType; /** 属性信息 */ - notifyAttribute: string; + notifyAttribute?: string; /** 描述 */ description: string; }>; + /** dingDing Notify */ + type DingDingNotify = Common.CommonRecord<{ + /** 接收人名称 */ + webhookUrl: string; + /** 通知类型 */ + ats: string[]; + }> & + NotifyRecipient; + /** notifyRecipient search params */ type NotifyRecipientParams = CommonType.RecordNullable< Pick & @@ -572,5 +581,8 @@ declare namespace Api { /** notifyRecipient list */ type NotifyRecipientList = Common.PaginatingQueryRecord; + + /** 1: 钉钉通知 2: 邮件通知 3: 企业通知 4: 飞书 */ + type AlarmType = 1 | 2 | 3 | 4; } } diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 407b748..594d161 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -729,9 +729,15 @@ declare namespace App { notifyAttribute: string; recipientName: string; notifyType: string; + dingdingAts: string; + qiYeWechatAts: string; + larkAts: string; + webhookUrl: string; }; addNotifyRecipient: string; editNotifyRecipient: string; + ats: string; + webhookUrl: string; }; }; form: { diff --git a/src/typings/components.d.ts b/src/typings/components.d.ts index 6b635d1..23bb140 100644 --- a/src/typings/components.d.ts +++ b/src/typings/components.d.ts @@ -51,6 +51,7 @@ declare module 'vue' { NDrawer: typeof import('naive-ui')['NDrawer'] NDrawerContent: typeof import('naive-ui')['NDrawerContent'] NDropdown: typeof import('naive-ui')['NDropdown'] + NDynamicTags: typeof import('naive-ui')['NDynamicTags'] NEmpty: typeof import('naive-ui')['NEmpty'] NFlex: typeof import('naive-ui')['NFlex'] NForm: typeof import('naive-ui')['NForm'] diff --git a/src/views/notify/recipient/modules/dingding-form.vue b/src/views/notify/recipient/modules/dingding-form.vue new file mode 100644 index 0000000..e3a3a52 --- /dev/null +++ b/src/views/notify/recipient/modules/dingding-form.vue @@ -0,0 +1,76 @@ + + + + + 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 f751ae0..77738a7 100644 --- a/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue +++ b/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue @@ -1,14 +1,17 @@