【同步】同步企业版功能全屏按钮

This commit is contained in:
小诺 2021-05-09 13:22:10 +08:00 committed by 15099670051
parent 219862501c
commit 9c01fd01be

View File

@ -1,14 +1,11 @@
<template> <template>
<div class="user-wrapper"> <div class="user-wrapper">
<div class="content-box"> <div class="content-box">
<!--<a href="https://www.xiaonuo.vip" target="_blank"> <span class="action" @click="toggleFullscreen">
<span class="action"> <a-icon type="fullscreen-exit" v-if="isFullscreen"/>
<a-icon type="question-circle-o"></a-icon> <a-icon type="fullscreen" v-else/>
</span> </span>
</a>-->
<notice-icon class="action"/> <notice-icon class="action"/>
<a-dropdown> <a-dropdown>
<span class="action ant-dropdown-link user-dropdown-menu"> <span class="action ant-dropdown-link user-dropdown-menu">
<a-avatar class="avatar" size="small" :src="avatar"/> <a-avatar class="avatar" size="small" :src="avatar"/>
@ -72,6 +69,7 @@
</template> </template>
<script> <script>
import screenfull from 'screenfull'
import NoticeIcon from '@/components/NoticeIcon' import NoticeIcon from '@/components/NoticeIcon'
import { mapActions, mapGetters } from 'vuex' import { mapActions, mapGetters } from 'vuex'
import { ALL_APPS_MENU } from '@/store/mutation-types' import { ALL_APPS_MENU } from '@/store/mutation-types'
@ -81,7 +79,8 @@ import { message } from 'ant-design-vue/es'
export default { export default {
name: 'UserMenu', name: 'UserMenu',
components: { components: {
NoticeIcon NoticeIcon,
screenfull
}, },
props: { props: {
mode: { mode: {
@ -103,7 +102,8 @@ export default {
visible: false, visible: false,
confirmLoading: false, confirmLoading: false,
form1: this.$form.createForm(this), form1: this.$form.createForm(this),
defApp: [] defApp: [],
isFullscreen: false
} }
}, },
@ -159,6 +159,19 @@ export default {
handleCancel () { handleCancel () {
this.form1.resetFields() this.form1.resetFields()
this.visible = false this.visible = false
},
/* 全屏切换 */
toggleFullscreen () {
if (!screenfull.isEnabled) {
message.error('您的浏览器不支持全屏模式')
return
}
screenfull.toggle()
if (screenfull.isFullscreen) {
this.isFullscreen = false
} else {
this.isFullscreen = true
}
} }
} }
} }