|
@@ -7,6 +7,9 @@
|
|
|
<div class="app-header__right">
|
|
<div class="app-header__right">
|
|
|
<slot name="right"></slot>
|
|
<slot name="right"></slot>
|
|
|
<div class="iconbar">
|
|
<div class="iconbar">
|
|
|
|
|
+ <el-badge type="danger" :is-dot="noticeStore.unreadList.length > 0">
|
|
|
|
|
+ <app-icon icon="g-icon--notice" @click="openComponent('notice')" />
|
|
|
|
|
+ </el-badge>
|
|
|
<span class="g-icon--minimize" @click="exitFullSreen" v-if="fullScreen"></span>
|
|
<span class="g-icon--minimize" @click="exitFullSreen" v-if="fullScreen"></span>
|
|
|
<span class="g-icon--maximize" @click="setFullSreen" v-else></span>
|
|
<span class="g-icon--maximize" @click="setFullSreen" v-else></span>
|
|
|
</div>
|
|
</div>
|
|
@@ -24,19 +27,27 @@
|
|
|
</template>
|
|
</template>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <component :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
|
-import { ref, onMounted, computed } from 'vue'
|
|
|
|
|
|
|
+import { ref, onMounted, computed, defineAsyncComponent } from 'vue'
|
|
|
import { SwitchButton } from '@element-plus/icons-vue'
|
|
import { SwitchButton } from '@element-plus/icons-vue'
|
|
|
import { getFileUrl } from '@/filters'
|
|
import { getFileUrl } from '@/filters'
|
|
|
-import { useUserStore, useGlobalStore } from '@/stores'
|
|
|
|
|
|
|
+import { useComponent } from '@/hooks/component'
|
|
|
|
|
+import { useUserStore, useGlobalStore, useNoticeStore } from '@/stores'
|
|
|
import eventBus from '@/services/bus'
|
|
import eventBus from '@/services/bus'
|
|
|
import AppIcon from '@pc/components/base/icon/index.vue'
|
|
import AppIcon from '@pc/components/base/icon/index.vue'
|
|
|
|
|
|
|
|
|
|
+const componentMap = new Map<string, unknown>([
|
|
|
|
|
+ ['notice', defineAsyncComponent(() => import('./components/notice/index.vue'))],
|
|
|
|
|
+])
|
|
|
|
|
+
|
|
|
|
|
+const { componentId, openComponent, closeComponent } = useComponent()
|
|
|
const globalStore = useGlobalStore()
|
|
const globalStore = useGlobalStore()
|
|
|
const userStore = useUserStore()
|
|
const userStore = useUserStore()
|
|
|
|
|
+const noticeStore = useNoticeStore()
|
|
|
const fullScreen = ref(false)
|
|
const fullScreen = ref(false)
|
|
|
|
|
|
|
|
// 用户头像
|
|
// 用户头像
|