Browse Source

添加事件触发全屏

yhluo 6 months ago
parent
commit
dfcc694f99
1 changed files with 12 additions and 2 deletions
  1. 12 2
      src/views/assembly/index.vue

+ 12 - 2
src/views/assembly/index.vue

@@ -38,7 +38,7 @@
           <div class="d-flex aside-width">
             <div class="react-right bg-color-r mr-3">
              <!-- <span class="text ">设备运行分析</span>-->
-              <el-button type="text" class="text" style="width:50% ;font-size: 21px;" @click="fullScreen" ref="fullScreen"
+              <el-button type="text" class="text" style="width:50% ;font-size: 21px;" @click="fullScreen" ref="fullScreenDom"
                          v-show=!isFullScreen >全屏</el-button>
               <el-button type="text" class="text" style="width:50% ;font-size: 21px;" @click="exitFullScreen" ref="exitFullScreen" v-show=isFullScreen>退出全屏</el-button>
             </div>
@@ -160,8 +160,14 @@ export default {
     this.timeFn()
     this.cancelLoading()
     this.$nextTick(()=>{
-      this.autoFullScreen()
+      setTimeout(() => {
+        this.autoFullScreen()
+        if(!this.isFullScreen){
+          this.$refs.fullScreenDom.click();
+        }
+      }, 1000);
     })
+    
     // 添加全屏状态变化监听
     document.addEventListener('fullscreenchange', this.handleFullScreenChange);
   },
@@ -252,6 +258,10 @@ export default {
 
 <style lang="scss" scoped>
 @import '../../assets/scss/indexassembly.scss';
+body{
+  transform: translateZ(0);
+  backface-visibility: hidden;
+}
 .dropdown {
   font-size: 18px;
   color: #568aea;