|
@@ -1,141 +0,0 @@
|
|
-<template>
|
|
|
|
- <el-popover :width="220" placement="bottom" trigger="hover">
|
|
|
|
- <template #reference>
|
|
|
|
- <div class="header-icon-bar">
|
|
|
|
- <HcIcon class="header-icon" name="question" />
|
|
|
|
- </div>
|
|
|
|
- </template>
|
|
|
|
- <div class="header-pover-menu-list">
|
|
|
|
- <div class="list-item">
|
|
|
|
- <span class="text">开启功能气泡提示</span>
|
|
|
|
- <el-switch v-model="bubbleVal" @change="bubbleUpdate" />
|
|
|
|
- </div>
|
|
|
|
- <div v-if="excelUrl" class="list-item" @click="excelPreviewClick">
|
|
|
|
- <span class="text">查看系统操作文档</span>
|
|
|
|
- <img :src="getAssetsHomeFile('word.png')" alt="" class="icon">
|
|
|
|
- <img :src="getAssetsHomeFile('word1.png')" alt="" class="icon1">
|
|
|
|
- </div>
|
|
|
|
- <div v-if="videoUrl" class="list-item" @click="videoPreviewModal = true">
|
|
|
|
- <span class="text">当前页面功能讲解</span>
|
|
|
|
- <img :src="getAssetsHomeFile('video.png')" alt="" class="icon">
|
|
|
|
- <img :src="getAssetsHomeFile('video1.png')" alt="" class="icon1">
|
|
|
|
- </div>
|
|
|
|
- </div>
|
|
|
|
- </el-popover>
|
|
|
|
- <!-- 当前页面功能讲解 -->
|
|
|
|
- <el-dialog v-model="videoPreviewModal" :before-close="videoPreviewModalClose" destroy-on-close width="62rem">
|
|
|
|
- <video :src="videoUrl" autoplay="autoplay" class="preview-video" controls="controls">
|
|
|
|
- 您的浏览器不支持 video
|
|
|
|
- </video>
|
|
|
|
- </el-dialog>
|
|
|
|
-</template>
|
|
|
|
-
|
|
|
|
-<script setup>
|
|
|
|
-import { nextTick, ref, watch } from 'vue'
|
|
|
|
-import { useRoute } from 'vue-router'
|
|
|
|
-import { useAppStore } from '~src/store'
|
|
|
|
-import { getObjValue, getToObjVal } from 'js-fast-way'
|
|
|
|
-import { getStore } from 'hc-vue3-ui'
|
|
|
|
-
|
|
|
|
-//初始变量
|
|
|
|
-const useRoutes = useRoute()
|
|
|
|
-const useAppState = useAppStore()
|
|
|
|
-
|
|
|
|
-//相关变量
|
|
|
|
-const route = getObjValue(getStore('route'))
|
|
|
|
-const bubbleVal = ref(useAppState.getBubble)
|
|
|
|
-const videoUrl = ref('')
|
|
|
|
-const excelUrl = ref('')
|
|
|
|
-const videoPreviewModal = ref(false)
|
|
|
|
-
|
|
|
|
-//监听
|
|
|
|
-watch(() => [
|
|
|
|
- useAppState.getBubble,
|
|
|
|
- useRoutes.name,
|
|
|
|
-], ([Bubble, routeName]) => {
|
|
|
|
- bubbleVal.value = Bubble
|
|
|
|
- getVideoUrl(routeName)
|
|
|
|
- getExcelUrl(routeName)
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
-//渲染完成
|
|
|
|
-nextTick(() => {
|
|
|
|
- getVideoUrl(useRoutes?.name)
|
|
|
|
- getExcelUrl(useRoutes?.name)
|
|
|
|
-})
|
|
|
|
-
|
|
|
|
-//取文档地址
|
|
|
|
-const getExcelUrl = (name) => {
|
|
|
|
- excelUrl.value = getToObjVal(route, name, 'excelUrl')
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//取视频地址
|
|
|
|
-const getVideoUrl = (name) => {
|
|
|
|
- videoUrl.value = getToObjVal(route, name, 'videoUrl')
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//开关值改变
|
|
|
|
-const bubbleUpdate = (val) => {
|
|
|
|
- bubbleVal.value = val
|
|
|
|
- useAppState.setBubble(val)
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-// 获取assets静态资源
|
|
|
|
-const getAssetsHomeFile = (url) => {
|
|
|
|
- const path = `../../assets/images/${url}`
|
|
|
|
- const modules = import.meta.globEager('../../assets/images/*')
|
|
|
|
- return modules[path].default
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//关闭视频弹窗
|
|
|
|
-const videoPreviewModalClose = () => {
|
|
|
|
- videoPreviewModal.value = false
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-//查看系统操作文档
|
|
|
|
-const excelPreviewClick = () => {
|
|
|
|
- if (excelUrl.value) {
|
|
|
|
- window.open(excelUrl.value, '_blank')
|
|
|
|
- } else {
|
|
|
|
- window?.$message.warning('暂无文档')
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-</script>
|
|
|
|
-
|
|
|
|
-<style lang="scss" scoped>
|
|
|
|
-.header-pover-menu-list {
|
|
|
|
- position: relative;
|
|
|
|
- margin: -5px -12px;
|
|
|
|
- .list-item {
|
|
|
|
- position: relative;
|
|
|
|
- padding: 10px 24px;
|
|
|
|
- cursor: pointer;
|
|
|
|
- display: flex;
|
|
|
|
- align-items: center;
|
|
|
|
- transition: background-color 0.2s;
|
|
|
|
- .text {
|
|
|
|
- flex: auto;
|
|
|
|
- }
|
|
|
|
- .icon, .icon1 {
|
|
|
|
- width: 24px;
|
|
|
|
- height: 24px;
|
|
|
|
- }
|
|
|
|
- .icon1 {
|
|
|
|
- display: none;
|
|
|
|
- }
|
|
|
|
- &:hover {
|
|
|
|
- color: #ffffff;
|
|
|
|
- background-color: var(--el-color-primary);
|
|
|
|
- .icon {
|
|
|
|
- display: none;
|
|
|
|
- }
|
|
|
|
- .icon1 {
|
|
|
|
- display: block;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-.preview-video {
|
|
|
|
- width: 100%;
|
|
|
|
-}
|
|
|
|
-</style>
|
|
|