diff --git a/.env.development b/.env.development index f864fbc..7550b9c 100644 --- a/.env.development +++ b/.env.development @@ -9,9 +9,9 @@ VITE_APP_DESCRIPTION="default standard template" VITE_USE_MOCK=false # API 基础URL -# VITE_API_BASE_URL=https://ops-api.apinb.com +VITE_API_BASE_URL=https://ops-api.apinb.com # 开发环境走 Vite 同源代理,避免依赖本机 80/443 nginx -VITE_API_BASE_URL= +# VITE_API_BASE_URL= # Logs 本地调试地址(仅 logs 模块使用) VITE_LOGS_API_BASE_URL=http://127.0.0.1:12440 diff --git a/dev/components.d.ts b/dev/components.d.ts new file mode 100644 index 0000000..f1bc198 --- /dev/null +++ b/dev/components.d.ts @@ -0,0 +1,24 @@ +/* eslint-disable */ +// @ts-nocheck +// biome-ignore lint: disable +// oxlint-disable +// ------ +// Generated by unplugin-vue-components +// Read more: https://github.com/vuejs/core/pull/3399 +import { GlobalComponents } from 'vue' + +export {} + +/* prettier-ignore */ +declare module 'vue' { + export interface GlobalComponents { + RouterLink: typeof import('vue-router')['RouterLink'] + RouterView: typeof import('vue-router')['RouterView'] + } +} + +// For TSX support +declare global { + const RouterLink: typeof import('vue-router')['RouterLink'] + const RouterView: typeof import('vue-router')['RouterView'] +} \ No newline at end of file diff --git a/index.html b/index.html index d59d27a..cf2934b 100644 --- a/index.html +++ b/index.html @@ -2,7 +2,7 @@ - + 智能运维管理系统 diff --git a/public/favicon.svg b/public/favicon.svg new file mode 100644 index 0000000..1e53a34 --- /dev/null +++ b/public/favicon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/message-box/index.vue b/src/components/message-box/index.vue index 7f71ce1..eb954fc 100644 --- a/src/components/message-box/index.vue +++ b/src/components/message-box/index.vue @@ -16,11 +16,6 @@ @view-history="openHistory" /> - @@ -50,7 +45,7 @@ import { import useLoading from '@/hooks/loading' import useNotificationSocket from '@/hooks/useNotificationSocket' import { Message } from '@arco-design/web-vue' -import { computed, reactive, ref, toRefs } from 'vue' +import { computed, reactive, ref, toRefs, watch } from 'vue' import { useI18n } from 'vue-i18n' import List from './list.vue' @@ -59,9 +54,13 @@ interface TabItem { title: string avatar?: string } +const visibleMessageTypes = ['message'] const { loading, setLoading } = useLoading(true) const messageType = ref('message') const { t } = useI18n() +const emit = defineEmits<{ + (event: 'unread-count-change', count: number): void +}>() const messageData = reactive<{ renderList: MessageRecord[] messageList: MessageRecord[] @@ -92,14 +91,6 @@ const tabList: TabItem[] = [ key: 'message', title: t('messageBox.tab.title.message'), }, - { - key: 'notice', - title: t('messageBox.tab.title.notice'), - }, - { - key: 'todo', - title: t('messageBox.tab.title.todo'), - }, ] async function fetchSourceData() { setLoading(true) @@ -176,6 +167,9 @@ const getDeliveryColor = (status: string) => { const renderList = computed(() => { return messageData.messageList.filter((item) => messageType.value === item.type) }) +const totalUnreadCount = computed(() => { + return messageData.messageList.filter((item) => visibleMessageTypes.includes(item.type) && !item.status).length +}) const unreadCount = computed(() => { return renderList.value.filter((item) => !item.status).length }) @@ -190,9 +184,7 @@ const formatUnreadLength = (type: string) => { const handleItemClick = (items: MessageListType) => { if (renderList.value.length) readMessage([...items]) } -const emptyList = () => { - messageData.messageList = [] -} +watch(totalUnreadCount, (count) => emit('unread-count-change', count), { immediate: true }) fetchSourceData() useNotificationSocket({ onNotification: upsertMessageToTop, diff --git a/src/components/message-box/locale/en-US.ts b/src/components/message-box/locale/en-US.ts index 92d8583..bef821b 100644 --- a/src/components/message-box/locale/en-US.ts +++ b/src/components/message-box/locale/en-US.ts @@ -1,8 +1,5 @@ export default { 'messageBox.tab.title.message': 'Message', - 'messageBox.tab.title.notice': 'Notice', - 'messageBox.tab.title.todo': 'Todo', - 'messageBox.tab.button': 'empty', 'messageBox.allRead': 'All Read', 'messageBox.viewMore': 'View More', 'messageBox.noContent': 'No Content', diff --git a/src/components/message-box/locale/zh-CN.ts b/src/components/message-box/locale/zh-CN.ts index dca6efb..92ad5d8 100644 --- a/src/components/message-box/locale/zh-CN.ts +++ b/src/components/message-box/locale/zh-CN.ts @@ -1,8 +1,5 @@ export default { 'messageBox.tab.title.message': '消息', - 'messageBox.tab.title.notice': '通知', - 'messageBox.tab.title.todo': '待办', - 'messageBox.tab.button': '清空', 'messageBox.allRead': '全部已读', 'messageBox.viewMore': '查看更多', 'messageBox.noContent': '暂无内容', diff --git a/src/components/navbar/index.vue b/src/components/navbar/index.vue index 50f7c16..5912989 100644 --- a/src/components/navbar/index.vue +++ b/src/components/navbar/index.vue @@ -52,7 +52,7 @@
  • - + @@ -67,7 +67,7 @@ >
  • @@ -126,8 +126,10 @@