| | |
| | | <svg-icon class-name="search-icon" icon-class="search" /> |
| | | </div> |
| | | </el-tooltip> |
| | | <!-- 消息 --> |
| | | <el-tooltip :content="$t('navbar.message')" effect="dark" placement="bottom"> |
| | | <div> |
| | | <el-popover placement="bottom" trigger="click" transition="el-zoom-in-top" :width="300" :persistent="false"> |
| | | <template #reference> |
| | | <el-badge :value="newNotice > 0 ? newNotice : ''" :max="99"> |
| | | <svg-icon icon-class="message" /> |
| | | </el-badge> |
| | | </template> |
| | | <template #default> |
| | | <notice></notice> |
| | | </template> |
| | | </el-popover> |
| | | </div> |
| | | </el-tooltip> |
| | | <el-tooltip content="Github" effect="dark" placement="bottom"> |
| | | <ruo-yi-git id="ruoyi-git" class="right-menu-item hover-effect" /> |
| | | </el-tooltip> |
| | |
| | | <router-link to="/user/profile" v-if="!dynamic"> |
| | | <el-dropdown-item>{{ $t('navbar.personalCenter') }}</el-dropdown-item> |
| | | </router-link> |
| | | <el-dropdown-item command="setLayout"> |
| | | <el-dropdown-item command="setLayout" v-if="settingsStore.showSettings"> |
| | | <span>{{ $t('navbar.layoutSetting') }}</span> |
| | | </el-dropdown-item> |
| | | <el-dropdown-item divided command="logout"> |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import SearchMenu from './topBar/search.vue'; |
| | | import SearchMenu from './TopBar/search.vue'; |
| | | import useAppStore from '@/store/modules/app'; |
| | | import useUserStore from '@/store/modules/user'; |
| | | import useSettingsStore from '@/store/modules/settings'; |
| | |
| | | import { dynamicClear, dynamicTenant } from "@/api/system/tenant"; |
| | | import { ComponentInternalInstance } from "vue"; |
| | | import { TenantVO } from "@/api/types"; |
| | | import notice from './notice/index.vue'; |
| | | import useNoticeStore from '@/store/modules/notice'; |
| | | |
| | | const appStore = useAppStore(); |
| | | const userStore = useUserStore(); |
| | | const settingsStore = useSettingsStore(); |
| | | const noticeStore = storeToRefs(useNoticeStore()); |
| | | const newNotice = ref(<number>0); |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | |
| | | commandMap[command](); |
| | | } |
| | | } |
| | | |
| | | //用深度监听 消息 |
| | | watch(() => noticeStore.state.value.notices, (newVal, oldVal) => { |
| | | newNotice.value = newVal.filter((item: any) => !item.read).length; |
| | | }, { deep: true }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | |
| | | height:30px; |
| | | } |
| | | |
| | | :deep(.el-badge__content.is-fixed){ |
| | | top: 12px; |
| | | } |
| | | |
| | | .flex { |
| | | display: flex; |
| | | } |