From ab27c4f4e7ed7c560f800cf2599942e9c16366c3 Mon Sep 17 00:00:00 2001 From: Feynman Date: Tue, 21 Apr 2026 09:53:39 +0800 Subject: [PATCH] feat: add new notification filters and localization support for module and server name in SystemNotification.vue --- apps/daas/src/i18n/langs/en.js | 2 + apps/daas/src/i18n/langs/zh-CN.js | 2 + apps/daas/src/i18n/langs/zh-TW.js | 2 + .../views/notification/SystemNotification.vue | 43 ++++++++++++++++++- 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/apps/daas/src/i18n/langs/en.js b/apps/daas/src/i18n/langs/en.js index f85b884f5..9249e6701 100644 --- a/apps/daas/src/i18n/langs/en.js +++ b/apps/daas/src/i18n/langs/en.js @@ -936,6 +936,8 @@ export default { notify_migration: 'Data copy', notify_notice_type: 'Message Type', notify_notice_level: 'Message level', + notify_belong_module: 'Module', + notify_search_server_name: 'Search task name or other keywords', notify_manage_sever: 'Management side', notify_inspect: 'Verify Task', notify_ddl_deal: 'DDL processing', diff --git a/apps/daas/src/i18n/langs/zh-CN.js b/apps/daas/src/i18n/langs/zh-CN.js index 51d2ac756..c71e116b2 100644 --- a/apps/daas/src/i18n/langs/zh-CN.js +++ b/apps/daas/src/i18n/langs/zh-CN.js @@ -884,6 +884,8 @@ export default { notify_migration: '数据复制', notify_notice_type: '消息类型', notify_notice_level: '消息级别', + notify_belong_module: '所属模块', + notify_search_server_name: '搜索任务名称或其他关键字', notify_manage_sever: '管理端', notify_inspect: '校验任务', notify_ddl_deal: 'DDL处理', diff --git a/apps/daas/src/i18n/langs/zh-TW.js b/apps/daas/src/i18n/langs/zh-TW.js index d425a3924..55fcd6279 100644 --- a/apps/daas/src/i18n/langs/zh-TW.js +++ b/apps/daas/src/i18n/langs/zh-TW.js @@ -880,6 +880,8 @@ export default { notify_migration: '數據複製', notify_notice_type: '消息類型', notify_notice_level: '消息級別', + notify_belong_module: '所屬模組', + notify_search_server_name: '搜尋任務名稱或其他關鍵字', notify_manage_sever: '管理端', notify_inspect: '校驗任務', notify_ddl_deal: 'DDL處理', diff --git a/apps/daas/src/views/notification/SystemNotification.vue b/apps/daas/src/views/notification/SystemNotification.vue index 9dca21dde..ce0e4455d 100644 --- a/apps/daas/src/views/notification/SystemNotification.vue +++ b/apps/daas/src/views/notification/SystemNotification.vue @@ -7,13 +7,15 @@ import { readAllNotifications, } from '@tap/api/src/core/notification' import PageContainer from '@tap/business/src/components/PageContainer.vue' +import VIcon from '@tap/component/src/base/VIcon.vue' import SelectList from '@tap/component/src/filter-bar/FilterItemSelect.vue' import { $emit, $on } from '@tap/shared/src/event' import dayjs from 'dayjs' +import { debounce } from 'lodash-es' import { TYPEMAP } from './tyepMap' export default { - components: { SelectList, PageContainer }, + components: { SelectList, PageContainer, VIcon }, emits: ['notificationUpdate'], data() { return { @@ -25,6 +27,8 @@ export default { searchParams: { search: '', msg: '', + system: '', + serverName: '', }, currentPage: 1, @@ -44,6 +48,14 @@ export default { JobDDL: this.$t('notify_ddl_deal'), system: this.$t('notify_system'), }, + systemOptions: [ + { value: 'sync', label: this.$t('notify_sync') }, + { value: 'migration', label: this.$t('notify_migration') }, + { value: 'agent', label: this.$t('notify_manage_sever') }, + { value: 'inspect', label: this.$t('notify_inspect') }, + { value: 'JobDDL', label: this.$t('notify_ddl_deal') }, + { value: 'system', label: this.$t('notify_system') }, + ], options: [ { value: 'ERROR', @@ -113,6 +125,7 @@ export default { } }, created() { + this.getDataDebounce = debounce(this.getData, 300) this.getData() this.getFilterItems() $on(this.$root, 'notificationUpdate', () => { @@ -124,7 +137,7 @@ export default { this.$router.push({ name: 'notificationSetting' }) }, getData() { - const { search, msg } = this.searchParams + const { search, msg, system, serverName } = this.searchParams const where = {} if (!this.read) { where.read = false @@ -135,6 +148,12 @@ export default { if (msg || msg !== '') { where.msg = msg } + if (system || system !== '') { + where.system = system + } + if (serverName || serverName !== '') { + where.serverName = { like: serverName, options: 'i' } + } const filter = { where, order: 'createTime DESC', @@ -369,6 +388,26 @@ export default { dropdown-width="240px" @change="getData()" /> + + + +