diff --git a/src/locales/langs/en-us.ts b/src/locales/langs/en-us.ts index 6ca5f22..deb2240 100644 --- a/src/locales/langs/en-us.ts +++ b/src/locales/langs/en-us.ts @@ -161,6 +161,8 @@ const local: App.I18n.Schema = { manage: 'System Manage', manage_user: 'User Manage', notify: 'notify', + notify_recipient: 'Notify recipient', + notify_scene: 'Notify scene', 'manage_user-detail': 'User Detail', manage_role: 'Role Manage', manage_menu: 'Menu Manage', @@ -520,6 +522,21 @@ const local: App.I18n.Schema = { }, addNotifyConfig: 'Add Alarm notification', editNotifyConfig: 'Add Alarm notification' + }, + notifyRecipient: { + title: 'NotifyRecipient List', + recipientName: 'Recipient name', + notifyType: 'Notification type', + notifyAttribute: 'Attribute information', + description: 'Describe', + form: { + description: 'Please enter Describe', + notifyAttribute: 'Please enter Attribute information', + recipientName: 'Please enter Recipient name', + notifyType: 'lease select Notification type' + }, + addNotifyRecipient: 'Add Notify recipients', + editNotifyRecipient: 'Add Notify recipients' } }, form: { diff --git a/src/locales/langs/zh-cn.ts b/src/locales/langs/zh-cn.ts index 2e09ea6..29734cc 100644 --- a/src/locales/langs/zh-cn.ts +++ b/src/locales/langs/zh-cn.ts @@ -161,6 +161,8 @@ const local: App.I18n.Schema = { manage: '系统管理', manage_user: '用户管理', notify: '告警通知', + notify_recipient: '通知人', + notify_scene: '通知场景', 'manage_user-detail': '用户详情', manage_role: '角色管理', manage_menu: '菜单管理', @@ -516,6 +518,21 @@ const local: App.I18n.Schema = { }, addNotifyConfig: '新增告警通知', editNotifyConfig: '编辑告警通知' + }, + notifyRecipient: { + title: 'NotifyRecipient 列表', + recipientName: '接收人名称', + notifyType: '通知类型', + notifyAttribute: '属性信息', + description: '描述', + form: { + description: '请输入描述', + notifyAttribute: '请输入属性信息', + recipientName: '请输入接收人名称', + notifyType: '请选择通知类型' + }, + addNotifyRecipient: '新增通知接收人', + editNotifyRecipient: '编辑通知接收人' } }, form: { diff --git a/src/router/elegant/imports.ts b/src/router/elegant/imports.ts index d288fb4..0b8b7da 100644 --- a/src/router/elegant/imports.ts +++ b/src/router/elegant/imports.ts @@ -36,7 +36,8 @@ export const views: Record Promise import("@/views/multi-menu/first_child/index.vue"), "multi-menu_second_child_home": () => import("@/views/multi-menu/second_child_home/index.vue"), namepase: () => import("@/views/namepase/index.vue"), - notify: () => import("@/views/notify/index.vue"), + notify_recipient: () => import("@/views/notify/recipient/index.vue"), + notify_scene: () => import("@/views/notify/scene/index.vue"), pods: () => import("@/views/pods/index.vue"), "user-center": () => import("@/views/user-center/index.vue"), }; diff --git a/src/router/elegant/routes.ts b/src/router/elegant/routes.ts index b932774..ba7970a 100644 --- a/src/router/elegant/routes.ts +++ b/src/router/elegant/routes.ts @@ -335,11 +335,31 @@ export const generatedRoutes: GeneratedRoute[] = [ { name: 'notify', path: '/notify', - component: 'layout.base$view.notify', + component: 'layout.base', meta: { title: 'notify', i18nKey: 'route.notify' - } + }, + children: [ + { + name: 'notify_recipient', + path: '/notify/recipient', + component: 'view.notify_recipient', + meta: { + title: 'notify_recipient', + i18nKey: 'route.notify_recipient' + } + }, + { + name: 'notify_scene', + path: '/notify/scene', + component: 'view.notify_scene', + meta: { + title: 'notify_scene', + i18nKey: 'route.notify_scene' + } + } + ] }, { name: 'pods', diff --git a/src/router/elegant/transform.ts b/src/router/elegant/transform.ts index f79982c..c06a2d1 100644 --- a/src/router/elegant/transform.ts +++ b/src/router/elegant/transform.ts @@ -114,14 +114,14 @@ function transformElegantRouteToVueRoute( } } - + // add redirect to child if (children?.length && !vueRoute.redirect) { vueRoute.redirect = { name: children[0].name }; } - + if (children?.length) { const childRoutes = children.flatMap(child => transformElegantRouteToVueRoute(child, layouts, views)); @@ -176,6 +176,8 @@ const routeMap: RouteMap = { "multi-menu_second_child_home": "/multi-menu/second/child/home", "namepase": "/namepase", "notify": "/notify", + "notify_recipient": "/notify/recipient", + "notify_scene": "/notify/scene", "pods": "/pods", "user-center": "/user-center" }; diff --git a/src/service/api/notify.ts b/src/service/api/notify.ts index 7f2e75e..b4c8f84 100644 --- a/src/service/api/notify.ts +++ b/src/service/api/notify.ts @@ -26,3 +26,30 @@ export function fetchEditNotify(data: Api.NotifyConfig.NotifyConfig) { data }); } + +/** get notify recipient list */ +export function fetchGetNotifyRecipientList(params?: Api.NotifyRecipient.NotifyRecipientParams) { + return request({ + url: '/notify-recipient/page/list', + method: 'get', + params + }); +} + +/** add notify recipient */ +export function fetchAddNotifyRecipient(data: Api.NotifyRecipient.NotifyRecipient) { + return request({ + url: '/notify-config', + method: 'post', + data + }); +} + +/** edit notify recipient */ +export function fetchEditNotifyRecipient(data: Api.NotifyRecipient.NotifyRecipient) { + return request({ + url: '/notify-config', + method: 'put', + data + }); +} diff --git a/src/typings/api.d.ts b/src/typings/api.d.ts index 43a1f0c..e9eb2cc 100644 --- a/src/typings/api.d.ts +++ b/src/typings/api.d.ts @@ -475,4 +475,34 @@ declare namespace Api { } & NotifyConfig >; } + + /** + * namespace Notify-recipient + * + * backend api module: "notify-recipient" + */ + namespace NotifyRecipient { + type CommonSearchParams = Pick; + + /** notifyRecipient */ + type NotifyRecipient = Common.CommonRecord<{ + /** 接收人名称 */ + recipientName: string; + /** 通知类型 */ + notifyType: string; + /** 属性信息 */ + notifyAttribute: string; + /** 描述 */ + description: string; + }>; + + /** notifyRecipient search params */ + type NotifyRecipientParams = CommonType.RecordNullable< + Pick & + CommonSearchParams + >; + + /** notifyRecipient list */ + type NotifyRecipientList = Common.PaginatingQueryRecord; + } } diff --git a/src/typings/app.d.ts b/src/typings/app.d.ts index 395fcaa..2cdf9f8 100644 --- a/src/typings/app.d.ts +++ b/src/typings/app.d.ts @@ -694,6 +694,21 @@ declare namespace App { addNotifyConfig: string; editNotifyConfig: string; }; + notifyRecipient: { + title: string; + recipientName: string; + notifyType: string; + notifyAttribute: string; + description: string; + form: { + description: string; + notifyAttribute: string; + recipientName: string; + notifyType: string; + }; + addNotifyRecipient: string; + editNotifyRecipient: string; + }; }; form: { required: string; diff --git a/src/typings/elegant-router.d.ts b/src/typings/elegant-router.d.ts index 208d07e..61c3ae4 100644 --- a/src/typings/elegant-router.d.ts +++ b/src/typings/elegant-router.d.ts @@ -50,6 +50,8 @@ declare module "@elegant-router/types" { "multi-menu_second_child_home": "/multi-menu/second/child/home"; "namepase": "/namepase"; "notify": "/notify"; + "notify_recipient": "/notify/recipient"; + "notify_scene": "/notify/scene"; "pods": "/pods"; "user-center": "/user-center"; }; @@ -91,7 +93,6 @@ declare module "@elegant-router/types" { | "404" | "500" | "about" - | "demo-route" | "function" | "home" | "login" @@ -123,7 +124,6 @@ declare module "@elegant-router/types" { | "500" | "login" | "about" - | "demo-route_child" | "function_hide-child_one" | "function_hide-child_three" | "function_hide-child_two" @@ -140,7 +140,8 @@ declare module "@elegant-router/types" { | "multi-menu_first_child" | "multi-menu_second_child_home" | "namepase" - | "notify" + | "notify_recipient" + | "notify_scene" | "pods" | "user-center" >; diff --git a/src/views/notify/recipient/index.vue b/src/views/notify/recipient/index.vue new file mode 100644 index 0000000..218b761 --- /dev/null +++ b/src/views/notify/recipient/index.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue b/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue new file mode 100644 index 0000000..16259f5 --- /dev/null +++ b/src/views/notify/recipient/modules/notify-recipient-operate-drawer.vue @@ -0,0 +1,120 @@ + + + + + diff --git a/src/views/notify/recipient/modules/notify-recipient-search.vue b/src/views/notify/recipient/modules/notify-recipient-search.vue new file mode 100644 index 0000000..e20f2ef --- /dev/null +++ b/src/views/notify/recipient/modules/notify-recipient-search.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/src/views/notify/index.vue b/src/views/notify/scene/index.vue similarity index 95% rename from src/views/notify/index.vue rename to src/views/notify/scene/index.vue index c80cbfa..dc0d964 100644 --- a/src/views/notify/index.vue +++ b/src/views/notify/scene/index.vue @@ -4,8 +4,8 @@ import { fetchGetNotifyConfigList } from '@/service/api'; import { $t } from '@/locales'; import { useAppStore } from '@/store/modules/app'; import { useTable, useTableOperate } from '@/hooks/common/table'; -import NotifyConfigOperateDrawer from './modules/notify-config-operate-drawer.vue'; -import NotifyConfigSearch from './modules/notify-config-search.vue'; +import NotifyConfigOperateDrawer from '@/views/notify/scene/modules/notify-config-operate-drawer.vue'; +import NotifyConfigSearch from '@/views/notify/scene/modules/notify-config-search.vue'; const appStore = useAppStore(); diff --git a/src/views/notify/modules/notify-config-operate-drawer.vue b/src/views/notify/scene/modules/notify-config-operate-drawer.vue similarity index 100% rename from src/views/notify/modules/notify-config-operate-drawer.vue rename to src/views/notify/scene/modules/notify-config-operate-drawer.vue diff --git a/src/views/notify/modules/notify-config-search.vue b/src/views/notify/scene/modules/notify-config-search.vue similarity index 100% rename from src/views/notify/modules/notify-config-search.vue rename to src/views/notify/scene/modules/notify-config-search.vue