整理系统菜单及权限
This commit is contained in:
@@ -6,178 +6,73 @@
|
||||
:trigger="['click']"
|
||||
:overlay-style="{ padding: '0 10px' }"
|
||||
>
|
||||
<a-badge :count="unreadNum" class="ele-notice-trigger" :offset="[6, 4]">
|
||||
<a-badge :count="unreadNum" dot class="ele-notice-trigger" :offset="[4, 6]">
|
||||
<bell-outlined style="padding: 8px 0" />
|
||||
</a-badge>
|
||||
<template #overlay>
|
||||
<div class="ant-dropdown-menu ele-notice-pop">
|
||||
<div @click.stop="">
|
||||
<a-tabs v-model:active-key="active" :centered="true">
|
||||
<a-tab-pane key="notice" :tab="noticeTitle">
|
||||
<a-list item-layout="horizontal" :data-source="notice">
|
||||
<template #renderItem="{ item }">
|
||||
<a-list-item>
|
||||
<a-list-item-meta
|
||||
@click="openUrl('/user/notice?type=notice')"
|
||||
:title="item.title"
|
||||
:description="timeAgo(item.createTime)"
|
||||
>
|
||||
<template #avatar>
|
||||
<a-avatar :style="{ background: item.color }">
|
||||
<template #icon>
|
||||
<component :is="item.icon" />
|
||||
</template>
|
||||
</a-avatar>
|
||||
</template>
|
||||
</a-list-item-meta>
|
||||
</a-list-item>
|
||||
</template>
|
||||
</a-list>
|
||||
<div v-if="notice.length" class="ele-cell ele-notice-actions">
|
||||
<div class="ele-cell-content" @click="clearNotice">
|
||||
清空通知
|
||||
</div>
|
||||
<a-divider type="vertical" />
|
||||
<router-link
|
||||
to="/user/notice?type=notice"
|
||||
class="ele-cell-content"
|
||||
>
|
||||
查看更多
|
||||
</router-link>
|
||||
</div>
|
||||
</a-tab-pane>
|
||||
</a-tabs>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
<!-- <chat-message-list-->
|
||||
<!-- v-model:visible="visibleChatMessageList"-->
|
||||
<!-- :data="currentChatConversation"-->
|
||||
<!-- />-->
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, ref } from 'vue';
|
||||
import { message } from 'ant-design-vue/es';
|
||||
// import { useChatStore } from '@/store/modules/chat';
|
||||
// import { useUserStore } from '@/store/modules/user';
|
||||
// import { pageChatMessage } from '@/api/system/chat';
|
||||
import { ChatMessage } from '@/api/system/chat/model';
|
||||
|
||||
// import { getUnReadNum, pageNotices, pageTodos } from '@/api/user/message';
|
||||
import { openUrl } from '@/utils/common';
|
||||
import { timeAgo } from 'ele-admin-pro';
|
||||
import { useChatStore } from '@/store/modules/chat';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
|
||||
import { storeToRefs } from 'pinia';
|
||||
// import ChatMessageList from '@/views/love/chat/components/chat-message-list.vue';
|
||||
import { ChatConversation } from '@/api/system/chat/model';
|
||||
|
||||
const chatStore = useChatStore();
|
||||
const userStore = useUserStore();
|
||||
// const chatStore = useChatStore();
|
||||
// const userStore = useUserStore();
|
||||
// 是否显示
|
||||
const visible = ref<boolean>(false);
|
||||
const visibleChatMessageList = ref<boolean>(false);
|
||||
const currentChatConversation = ref<ChatConversation>();
|
||||
// 选项卡选中
|
||||
const active = ref<string>('notice');
|
||||
// 通知数据
|
||||
const notice = ref<any>([]);
|
||||
// 待办数据
|
||||
const todo = ref<any>([]);
|
||||
// 通知未读数量
|
||||
const unReadNotice = ref<any>(0);
|
||||
// 私信未读数量
|
||||
const { unReadLetter, unReadConversations } = storeToRefs(chatStore);
|
||||
const notice = ref<ChatMessage[]>([]);
|
||||
|
||||
chatStore.connectSocketIO(userStore.info?.userId || 0);
|
||||
// 代办未读数量
|
||||
const unReadTodo = ref<any>(0);
|
||||
|
||||
// 通知标题
|
||||
const noticeTitle = computed(() => {
|
||||
return '通知' + (unReadNotice.value > 0 ? `(${unReadNotice.value})` : '');
|
||||
});
|
||||
// chatStore.connectSocketIO(userStore.info?.userId || 0);
|
||||
|
||||
// 未读数量
|
||||
const unreadNum = computed(() => {
|
||||
return unReadNotice.value + unReadLetter.value + unReadTodo.value;
|
||||
return notice.value.length;
|
||||
});
|
||||
|
||||
const openChat = (item: ChatConversation) => {
|
||||
chatStore.readConversation(item.id);
|
||||
currentChatConversation.value = item;
|
||||
visible.value = false;
|
||||
visibleChatMessageList.value = true;
|
||||
};
|
||||
/* 查询数据 */
|
||||
const query = () => {
|
||||
// pageNotices({ status: 0 })
|
||||
// .then((result) => {
|
||||
// notice.value = result?.list;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// message.error(e.message);
|
||||
// });
|
||||
//
|
||||
// pageTodos({ status: 0 })
|
||||
// .then((result) => {
|
||||
// todo.value = result?.list;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// message.error(e.message);
|
||||
// });
|
||||
};
|
||||
// const query = () => {
|
||||
// pageNotices({ status: 0 })
|
||||
// .then((result) => {
|
||||
// notice.value = result?.list;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// message.error(e.message);
|
||||
// });
|
||||
//
|
||||
// pageTodos({ status: 0 })
|
||||
// .then((result) => {
|
||||
// todo.value = result?.list;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// message.error(e.message);
|
||||
// });
|
||||
// };
|
||||
|
||||
/* 查询未读数量 */
|
||||
const queryUnReadNum = () => {
|
||||
// getUnReadNum()
|
||||
// .then((result) => {
|
||||
// unReadNotice.value = result?.notice;
|
||||
// unReadTodo.value = result?.todo;
|
||||
// })
|
||||
// .catch((e) => {
|
||||
// message.error(e.message);
|
||||
// });
|
||||
};
|
||||
// const queryUnReadNum = () => {
|
||||
// const toUserId = Number(userStore.info?.userId || 0);
|
||||
// console.log(toUserId);
|
||||
// const status = 0;
|
||||
// pageChatMessage({ toUserId, status, keywords: '' }).then((result) => {
|
||||
// console.log(result);
|
||||
// notice.value = result?.list;
|
||||
// });
|
||||
// };
|
||||
|
||||
queryUnReadNum();
|
||||
|
||||
/* 清空通知 */
|
||||
const clearNotice = () => {
|
||||
unReadNotice.value = 0;
|
||||
};
|
||||
|
||||
/* 清空通知 */
|
||||
const clearLetter = () => {
|
||||
// unReadLetter = 0;
|
||||
};
|
||||
|
||||
/* 清空通知 */
|
||||
const clearTodo = () => {
|
||||
unReadTodo.value = 0;
|
||||
};
|
||||
|
||||
// query();
|
||||
// queryUnReadNum();
|
||||
</script>
|
||||
|
||||
<script lang="ts">
|
||||
import {
|
||||
BellOutlined,
|
||||
NotificationFilled,
|
||||
PushpinFilled,
|
||||
VideoCameraFilled,
|
||||
CarryOutFilled,
|
||||
BellFilled
|
||||
} from '@ant-design/icons-vue';
|
||||
import { BellOutlined } from '@ant-design/icons-vue';
|
||||
|
||||
export default {
|
||||
name: 'HeaderNotice',
|
||||
components: {
|
||||
BellOutlined,
|
||||
NotificationFilled,
|
||||
PushpinFilled,
|
||||
VideoCameraFilled,
|
||||
CarryOutFilled,
|
||||
BellFilled
|
||||
BellOutlined
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -190,7 +85,7 @@
|
||||
.ele-notice-pop {
|
||||
&.ant-dropdown-menu {
|
||||
padding: 0;
|
||||
width: 336px;
|
||||
width: 286px;
|
||||
max-width: 100%;
|
||||
margin-top: 11px;
|
||||
}
|
||||
@@ -228,4 +123,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.ele-cell-content {
|
||||
padding: 4px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<!-- 顶栏右侧区域 -->
|
||||
<template>
|
||||
<div class="ele-admin-header-tool">
|
||||
<div class="ele-admin-header-tool-item">
|
||||
<a-button @click="openUrl(`/merchant/account`)">{{
|
||||
getMerchantName()
|
||||
}}</a-button>
|
||||
</div>
|
||||
<div class="ele-admin-header-tool-item">
|
||||
<a-tree-select
|
||||
show-search
|
||||
@@ -24,7 +29,7 @@
|
||||
<!-- 旧版-->
|
||||
<!-- </div>-->
|
||||
<!-- 消息通知 -->
|
||||
<div class="ele-admin-header-tool-item">
|
||||
<div class="ele-admin-header-tool-item" @click="openUrl(`/user/notice`)">
|
||||
<header-notice />
|
||||
</div>
|
||||
<!-- 全屏切换 -->
|
||||
@@ -137,9 +142,9 @@
|
||||
</a-dropdown>
|
||||
</div>
|
||||
<!-- 主题设置 -->
|
||||
<!-- <div class="ele-admin-header-tool-item" @click="openSetting">-->
|
||||
<!-- <more-outlined />-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="ele-admin-header-tool-item" @click="openSetting">-->
|
||||
<!-- <more-outlined />-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
<!-- 修改密码弹窗 -->
|
||||
<password-modal v-model:visible="passwordVisible" />
|
||||
@@ -164,7 +169,7 @@
|
||||
SearchOutlined
|
||||
} from '@ant-design/icons-vue';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { copyText, openNew, openUrl } from '@/utils/common';
|
||||
import { copyText, getUserId, openNew, openUrl } from '@/utils/common';
|
||||
import { useThemeStore } from '@/store/modules/theme';
|
||||
import HeaderNotice from './header-notice.vue';
|
||||
import PasswordModal from './password-modal.vue';
|
||||
@@ -174,6 +179,7 @@
|
||||
import type { Menu } from '@/api/system/menu/model';
|
||||
import { listMenus } from '@/api/system/menu';
|
||||
import { isExternalLink, toTreeData } from 'ele-admin-pro';
|
||||
import { getMerchantName } from '../../utils/merchant';
|
||||
|
||||
// 是否开启响应式布局
|
||||
const themeStore = useThemeStore();
|
||||
|
||||
@@ -15,6 +15,7 @@ export {
|
||||
BarChartOutlined,
|
||||
AuditOutlined,
|
||||
PicLeftOutlined,
|
||||
BellOutlined,
|
||||
CloseCircleOutlined,
|
||||
QuestionCircleOutlined,
|
||||
SoundOutlined,
|
||||
|
||||
Reference in New Issue
Block a user