|
|
@@ -17,16 +17,6 @@
|
|
|
<div class="bs-time">{{ currentTime }}</div>
|
|
|
<div class="bs-date">{{ currentDate }}</div>
|
|
|
</div>
|
|
|
- <div class="bs-header-actions">
|
|
|
- <el-button type="primary" size="small" @click="enterFullscreen">
|
|
|
- <el-icon><FullScreen /></el-icon>
|
|
|
- <span style="margin-left: 4px">浏览器全屏</span>
|
|
|
- </el-button>
|
|
|
- <el-button type="warning" size="small" @click="exitToPlatform">
|
|
|
- <el-icon><Back /></el-icon>
|
|
|
- <span style="margin-left: 4px">退出大屏</span>
|
|
|
- </el-button>
|
|
|
- </div>
|
|
|
</div>
|
|
|
|
|
|
<!-- 顶部: 6 张业务数据卡片 -->
|
|
|
@@ -159,17 +149,6 @@
|
|
|
<script setup lang="ts">
|
|
|
import { onBeforeUnmount, onMounted, ref } from 'vue';
|
|
|
import * as echarts from 'echarts';
|
|
|
-import {
|
|
|
- Aim,
|
|
|
- Back,
|
|
|
- Document,
|
|
|
- FullScreen,
|
|
|
- Shop,
|
|
|
- Tools,
|
|
|
- User,
|
|
|
- Warning
|
|
|
-} from '@element-plus/icons-vue';
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
import {
|
|
|
getBigScreenCards,
|
|
|
getBigScreenCharts,
|
|
|
@@ -229,25 +208,9 @@ const dotColor = (c?: string): string => {
|
|
|
return '#1890ff';
|
|
|
};
|
|
|
|
|
|
-// ===== 浏览器原生全屏 + 退出大屏 =====
|
|
|
-const router = useRouter();
|
|
|
-
|
|
|
-function enterFullscreen() {
|
|
|
- const docEl = document.documentElement;
|
|
|
- const req =
|
|
|
- docEl.requestFullscreen ||
|
|
|
- (docEl as any).webkitRequestFullscreen ||
|
|
|
- (docEl as any).mozRequestFullScreen ||
|
|
|
- (docEl as any).msRequestFullscreen;
|
|
|
- if (req) {
|
|
|
- const ret = req.call(docEl);
|
|
|
- if (ret && typeof (ret as any).then === 'function') {
|
|
|
- (ret as Promise<void>).catch(() => {
|
|
|
- // 用户拒绝则保持 CSS 全屏(layout 已是 router-view 直接占满)
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
+// ===== 浏览器原生全屏 =====
|
|
|
+// 入口由 layout 菜单点击(用户手势链)触发;退出由大屏页面 ESC 键监听触发
|
|
|
+// 页面不暴露任何按钮,避免顶栏冗余
|
|
|
|
|
|
function exitFullscreen() {
|
|
|
const doc: any = document;
|
|
|
@@ -257,12 +220,6 @@ function exitFullscreen() {
|
|
|
else if (doc.msExitFullscreen) doc.msExitFullscreen();
|
|
|
}
|
|
|
|
|
|
-function exitToPlatform() {
|
|
|
- // 优先尝试退出浏览器原生全屏,再退回首页
|
|
|
- exitFullscreen();
|
|
|
- router.push('/index');
|
|
|
-}
|
|
|
-
|
|
|
// ===== 加载 =====
|
|
|
async function loadCards() {
|
|
|
try {
|