Merge branch 'feature/noticews'

This commit is contained in:
Theo
2024-09-24 15:45:44 +08:00
14 changed files with 1305 additions and 120 deletions

View File

@@ -1,7 +1,7 @@
<template>
<div class="flex">
<template v-if="!isMobile">
<!-- 搜索 -->
<!--搜索 -->
<menu-search />
<!--全屏 -->
<div class="nav-action-item" @click="toggle">
@@ -23,47 +23,7 @@
<lang-select class="nav-action-item" />
<!-- 消息通知 -->
<el-dropdown class="message nav-action-item" trigger="click">
<el-badge is-dot>
<div class="flex-center h100% p10px">
<i-ep-bell />
</div>
</el-badge>
<template #dropdown>
<div class="px-5 py-2">
<el-tabs v-model="activeTab">
<el-tab-pane
v-for="(label, key) in MessageTypeLabels"
:label="label"
:name="key"
:key="key"
>
<div
class="w-[380px] py-2"
v-for="message in getFilteredMessages(key)"
:key="message.id"
>
<el-link type="primary">
<el-text class="w-350px" size="default" truncated>
{{ message.title }}
</el-text>
</el-link>
</div>
</el-tab-pane>
</el-tabs>
<el-divider />
<div class="flex-x-between">
<el-link type="primary" :underline="false">
<span class="text-xs">查看更多</span>
<el-icon class="text-xs"><ArrowRight /></el-icon>
</el-link>
<el-link type="primary" :underline="false">
<span class="text-xs">全部已读</span>
</el-link>
</div>
</div>
</template>
</el-dropdown>
<notice />
</template>
<!-- 用户头像 -->
@@ -113,7 +73,6 @@ import {
} from "@/store";
import defaultSettings from "@/settings";
import { DeviceEnum } from "@/enums/DeviceEnum";
import { MessageTypeEnum, MessageTypeLabels } from "@/enums/MessageTypeEnum";
const appStore = useAppStore();
const tagsViewStore = useTagsViewStore();
@@ -122,53 +81,10 @@ const settingStore = useSettingsStore();
const route = useRoute();
const router = useRouter();
const isMobile = computed(() => appStore.device === DeviceEnum.MOBILE);
const { isFullscreen, toggle } = useFullscreen();
const activeTab = ref(MessageTypeEnum.MESSAGE);
const messages = ref([
{
id: 1,
title: "系统升级通知服务器将于今晚12点进行升级维护请提前保存工作内容。",
type: MessageTypeEnum.MESSAGE,
},
{
id: 2,
title: "新功能发布:我们的应用程序现在支持多语言功能。",
type: MessageTypeEnum.MESSAGE,
},
{
id: 3,
title: "重要提醒:请定期更改您的密码以保证账户安全。",
type: MessageTypeEnum.MESSAGE,
},
{
id: 4,
title: "通知:您有一条未读的系统消息,请及时查看。",
type: MessageTypeEnum.NOTICE,
},
{
id: 5,
title: "新订单通知:您有一笔新的订单需要处理。",
type: MessageTypeEnum.NOTICE,
},
{
id: 6,
title: "审核提醒:您的审核请求已被批准。",
type: MessageTypeEnum.NOTICE,
},
{ id: 7, title: "待办事项:完成用户权限设置。", type: MessageTypeEnum.TODO },
{ id: 8, title: "待办事项:更新产品列表。", type: MessageTypeEnum.TODO },
{ id: 9, title: "待办事项:备份数据库。", type: MessageTypeEnum.TODO },
]);
const getFilteredMessages = (type: MessageTypeEnum) => {
return messages.value.filter((message) => message.type === type);
};
/** 打开个人中心 */
function handleOpenUserProfile() {
router.push({ name: "Profile" });

View File

@@ -55,7 +55,7 @@ defineOptions({
});
import path from "path-browserify";
import { isExternal } from "@/utils/index";
import { isExternal } from "@/utils";
import { RouteRecordRaw } from "vue-router";
const props = defineProps({