huanghongfeng
3 天以前 5ffc36a1db18d3112a9b50a9cf3953d7fcf21bae
ÏîÄ¿´úÂë/DP/src/views/setting.vue
@@ -1,9 +1,7 @@
<template>
    <transition name="yh-setting-fade">
        <div class="setting" :class="{ settingShow: settingShow }" v-show="settingShow">
            <div class="setting_dislog" @click="settingShow = false">
            </div>
            <div class="setting_dislog" @click="settingShow = false"></div>
            <div class="setting_inner">
                <div class="setting_header">
                    è®¾ç½®
@@ -20,35 +18,17 @@
                                <el-radio :label="true">是</el-radio>
                                <el-radio :label="false">否</el-radio>
                            </el-radio-group>
                        </div>
                    </div>
                        </div>
                    </div>
                    <!-- <div class="left_shu"> å®žæ—¶ç›‘测</div>
                    <div class="setting_item">
                        <span class="setting_label">
                            è®¾å¤‡æé†’自动轮询: <span class="setting_label_tip"></span>
                        </span>
                        <div class="setting_content">
                            <el-radio-group v-model="sbtxradio" @change="(val) => radiochange(val, 'sbtxSwiper')">
                                <el-radio :label="true">是</el-radio>
                                <el-radio :label="false">否</el-radio>
                            </el-radio-group>
                        </div>
                    </div>
                    <div class="setting_item">
                        <span class="setting_label">
                            å®žæ—¶é¢„警轮播:
                        </span>
                        <div class="setting_content">
                            <el-radio-group v-model="ssyjradio" @change="(val) => radiochange(val, 'ssyjSwiper')">
                                <el-radio :label="true">是</el-radio>
                                <el-radio :label="false">否</el-radio>
                            </el-radio-group>
                        </div>
                    </div> -->
                    <div class="flex justify-center">
                        <!-- <el-button type="primary" round size="mini">确定</el-button> -->
                        <el-button
                            type="primary"
                            @click="toggleFullScreen"
                            class="fullscreen-btn"
                        >
                            {{ isFullScreen ? '退出全屏' : '全屏显示' }}
                        </el-button>
                    </div>
                </div>
            </div>
@@ -57,7 +37,6 @@
</template>
<script>
export default {
    components: {},
    data() {
@@ -66,7 +45,8 @@
            sbtxradio:true,
            ssyjradio: true,
            isScaleradio:true,
            echartsAutoTime:3000
            echartsAutoTime: 3000,
            isFullScreen: false
        };
    },
    computed: {},
@@ -82,6 +62,22 @@
                // window.location.href=window.location.href+"?t="+Date.now()
            }
        },
        toggleFullScreen() {
            if (!document.fullscreenElement) {
                // è¿›å…¥å…¨å±
                document.documentElement.requestFullscreen().catch(err => {
                    console.error(`全屏错误: ${err.message}`);
                });
            } else {
                // é€€å‡ºå…¨å±
                if (document.exitFullscreen) {
                    document.exitFullscreen();
                }
            }
        },
        handleFullScreenChange() {
            this.isFullScreen = !!document.fullscreenElement;
        }
    },
    created() {
        this.$store.commit('setting/initSwipers')
@@ -91,8 +87,10 @@
    },
    mounted() {
        document.body.appendChild(this.$el);
        document.addEventListener('fullscreenchange', this.handleFullScreenChange);
    },
    beforeDestroy() {
        document.removeEventListener('fullscreenchange', this.handleFullScreenChange);
    },
    destroyed() {
        if (this.$el && this.$el.parentNode) {
@@ -103,4 +101,7 @@
</script>
<style lang='scss' scoped>
.fullscreen-btn {
    margin-top: 20px;
}
</style>