update fullscreen layout

This commit is contained in:
DESKTOP-FUDKNA8\znjsz 2024-01-23 15:39:15 +08:00
parent 90c29c141c
commit 8402afcdfc
9 changed files with 140 additions and 70 deletions

View File

@ -18,7 +18,7 @@ const currentPage = ref("3d");
const handlePageChange = (page) => { const handlePageChange = (page) => {
currentPage.value = page; currentPage.value = page;
}; };
const mainContainer = ref(null);
const { settings } = useSettings(); const { settings } = useSettings();
const timer = ref(null); const timer = ref(null);
@ -59,12 +59,37 @@ const pathMap = {
'/1-3': 3, '/1-3': 3,
'/1-4': 8 '/1-4': 8
} }
function handleResolutionChange(width, height) {
if (mainContainer.value) {
// mainContainer.value.style.width = `${width}px`;
// mainContainer.value.style.height = `${height}px`;
changeScale(mainContainer.value, width, height)
}
}
function changeScale(elm, width, height) {
const xScale = width / 1920;
const yScale = height / 1080;
const style = {
transform: `scale(${xScale}, ${yScale})`,
transformOrigin: "top left",
};
elm.style.transform = style.transform;
elm.style.transformOrigin = style.transformOrigin;
}
function resetScale(elm) {
elm.style.transform = "initial";
elm.style.transformOrigin = "initial";
}
</script> </script>
<template> <template>
<div id="main-container" class="main-container"> <div id="main-container" ref="mainContainer" class="main-container">
<DatetimeTool v-if="currentPage !== 'announcement'" /> <DatetimeTool v-if="currentPage !== 'announcement'" />
<Tools v-if="currentPage !== 'announcement'" /> <Tools v-if="currentPage !== 'announcement'" @change-resolution="handleResolutionChange" />
<AppHeader v-if="currentPage !== 'announcement'" /> <AppHeader v-if="currentPage !== 'announcement'" />
<AnnoucementPage v-if="currentPage === 'announcement'" class="annoucement-page" <AnnoucementPage v-if="currentPage === 'announcement'" class="annoucement-page"
@home="() => handlePageChange('3d')" /> @home="() => handlePageChange('3d')" />

View File

@ -62,6 +62,10 @@ const handleClick = (page) => {
z-index: 10; z-index: 10;
} }
:fullscreen .nav-menu {
top: 25%;
}
.flex-list { .flex-list {
display: flex; display: flex;
flex-direction: column; flex-direction: column;

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
import { ref } from 'vue'; import { ref } from 'vue';
import { useSettings } from '../store/settings' import { useSettings } from '../store/settings'
const emit = defineEmits(["close"]); const emit = defineEmits(["close", "change-resolution"]);
const store = useSettings(); const store = useSettings();
const settings = ref(store.settings); const settings = ref(store.settings);
@ -20,7 +20,8 @@ function handleConfirm() {
if (settings.value.resolution.width > 7680) store.settings.resolution.width = 7680; if (settings.value.resolution.width > 7680) store.settings.resolution.width = 7680;
if (settings.value.resolution.height < 270) store.settings.resolution.height = 270; if (settings.value.resolution.height < 270) store.settings.resolution.height = 270;
if (settings.value.resolution.height > 4320) store.settings.resolution.height = 4320; if (settings.value.resolution.height > 4320) store.settings.resolution.height = 4320;
emit('close')
emit('change-resolution', store.settings.resolution.width, store.settings.resolution.height)
} }
</script> </script>

View File

@ -5,6 +5,9 @@ import IconExchange from "../assets/menu_icon/IconExchange.vue";
import IconSetting from "../assets/menu_icon/IconSetting.vue"; import IconSetting from "../assets/menu_icon/IconSetting.vue";
import SettingDialogVue from "./SettingDialog.vue"; import SettingDialogVue from "./SettingDialog.vue";
import { useSettings } from '../store/settings'; import { useSettings } from '../store/settings';
const emit = defineEmits(['change-resolution'])
const store = useSettings(); const store = useSettings();
const settings = ref(store.settings) const settings = ref(store.settings)
store.$subscribe((_, state) => { store.$subscribe((_, state) => {
@ -21,6 +24,10 @@ function showDialog() {
function toggleLunbo() { function toggleLunbo() {
settings.value.carousel = !settings.value.carousel; settings.value.carousel = !settings.value.carousel;
} }
function handleChangeResolution(w, h) {
emit('change-resolution', w, h)
}
</script> </script>
<template> <template>
@ -38,7 +45,7 @@ function toggleLunbo() {
<IconExchange :color="settings.carousel ? '#03356a' : '#50A1EC'" /> <IconExchange :color="settings.carousel ? '#03356a' : '#50A1EC'" />
</button> </button>
</div> </div>
<SettingDialogVue v-if="visible" @close="visible = false;" /> <SettingDialogVue v-if="visible" @close="visible = false;" @change-resolution="handleChangeResolution" />
</template> </template>
<style scoped> <style scoped>

View File

@ -2,7 +2,7 @@
<script setup> <script setup>
import { useSettings } from '../store/settings'; import { useSettings } from '../store/settings';
import { useWsStore } from "../store"; import { useWsStore } from "../store";
import { ref, computed } from 'vue'; import { ref, computed, watch } from 'vue';
import Icon from '../assets/svg/IconStatus.vue'; import Icon from '../assets/svg/IconStatus.vue';
import { eqMap, statusMap, initState } from './eqMaps' import { eqMap, statusMap, initState } from './eqMaps'
@ -37,10 +37,35 @@ store.$subscribe((mutation, state) => {
}) })
} }
}); });
const part3d = ref(null);
function changeScale(elm, width, height) {
const xScale = width / 1920;
const yScale = height / 1080;
const style = {
transform: `scale(${xScale}, ${yScale})`,
transformOrigin: "top left",
};
elm.style.transform = style.transform;
elm.style.transformOrigin = style.transformOrigin;
}
watch(() => settings.fullscreen, val => {
if (val) {
//
if (part3d.value) {
changeScale(part3d.value, document.documentElement.clientWidth, document.documentElement.clientHeight)
}
} else {
if (part3d.value) {
// reset scale
changeScale(part3d.value, 1920, 1080)
}
}
}, { immediate: true })
</script> </script>
<template> <template>
<div class="triple-page" :class="['line-' + line]"> <div class="triple-page" ref="part3d" :class="['line-' + line]">d
<div class="info-1" v-if="eqStatus && line == '1'"> <div class="info-1" v-if="eqStatus && line == '1'">
<div class="info"> <div class="info">
<h1> <h1>
@ -552,7 +577,11 @@ store.$subscribe((mutation, state) => {
<style scoped> <style scoped>
.triple-page { .triple-page {
background: #ccc1; /* background: #ccc1; */
background-size: 1920px 1080px;
/* background-size: 100% 100%; */
background-position: 0 -80px;
background-repeat: no-repeat;
/* flex: 1; /* flex: 1;
position: relative; */ position: relative; */
position: absolute; position: absolute;
@ -987,74 +1016,72 @@ store.$subscribe((mutation, state) => {
/* other */ /* other */
.line-1 { .line-1 {
background: url(../assets/model/F1.png) no-repeat;
background-size: 1920px 1080px; background-image: url(../assets/model/F1.png)
background-position: 0 -80px;
} }
.line-2 { .line-2 {
background: url(../assets/model/F2.png) no-repeat; background-image: url(../assets/model/F2.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-3 { .line-3 {
background: url(../assets/model/F3.png) no-repeat; background-image: url(../assets/model/F3.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-4 { .line-4 {
background: url(../assets/model/F4.png) no-repeat; background-image: url(../assets/model/F4.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-5 { .line-5 {
background: url(../assets/model/F5.png) no-repeat; background-image: url(../assets/model/F5.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-6 { .line-6 {
background: url(../assets/model/F6.png) no-repeat; background-image: url(../assets/model/F6.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-7 { .line-7 {
background: url(../assets/model/F7.png) no-repeat; background-image: url(../assets/model/F7.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-8 { .line-8 {
background: url(../assets/model/F8.png) no-repeat; background-image: url(../assets/model/F8.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-9 { .line-9 {
background: url(../assets/model/F9.png) no-repeat; background-image: url(../assets/model/F9.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-10 { .line-10 {
background: url(../assets/model/F10.png) no-repeat; background-image: url(../assets/model/F10.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-11 { .line-11 {
background: url(../assets/model/F11.png) no-repeat; background-image: url(../assets/model/F11.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
.line-12 { .line-12 {
background: url(../assets/model/F12.png) no-repeat; background-image: url(../assets/model/F12.png);
background-size: 1920px 1080px;
background-position: 0 -80px;
} }
</style> </style>

View File

@ -119,6 +119,12 @@ store.$subscribe((mutation, state) => {
flex-direction: column; flex-direction: column;
} }
:fullscreen .alert-list {
width: 35%;
top: 32px;
height: calc(100% - 64px);
}
.alert-list__table { .alert-list__table {
height: calc(100% - 72px); height: calc(100% - 72px);
/* background: linear-gradient(to right, transparent, #0ba6ff80); */ /* background: linear-gradient(to right, transparent, #0ba6ff80); */

View File

@ -45,9 +45,7 @@ const handleClose = () => {
</ScrollText> </ScrollText>
</main> </main>
<div class="announcement-footer"> <div class="announcement-footer">
<button <button id="return-btn" style="
id="return-btn"
style="
position: absolute; position: absolute;
right: 32px; right: 32px;
top: 56px; top: 56px;
@ -55,10 +53,8 @@ const handleClose = () => {
background: transparent; background: transparent;
border: none; border: none;
cursor: pointer; cursor: pointer;
" " @click="handleClose">
@click="handleClose" <IconBack color="#f00" />
>
<IconBack color="#f00"/>
</button> </button>
<ScrollText :duration="50"> {{ horizontal_content }} </ScrollText> <ScrollText :duration="50"> {{ horizontal_content }} </ScrollText>
</div> </div>
@ -76,7 +72,7 @@ const handleClose = () => {
flex: 1; flex: 1;
height: 100%; height: 100%;
width: 100%; width: 100%;
background: url(../assets/line.png) 0 0 / 100% 100% no-repeat, #000; background: url(../assets/line.png) 0 0 / 100% 100% no-repeat, #000;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
color: #f00; color: #f00;
@ -103,6 +99,11 @@ const handleClose = () => {
margin-bottom: 32px; margin-bottom: 32px;
} }
:fullscreen .announcement-content {
margin-bottom: 5%;
padding: 56px 80px 12px 80px;
}
.announcement-footer { .announcement-footer {
height: 144px; height: 144px;
/* background: #ccc1; */ /* background: #ccc1; */
@ -112,4 +113,8 @@ const handleClose = () => {
font-family: sans-serif; font-family: sans-serif;
user-select: none; user-select: none;
} }
:fullscreen .announcement-footer {
line-height: 80px;
}
</style> </style>

View File

@ -33,4 +33,15 @@ import TeamChartMonth from "../components/TeamChartMonth.vue";
flex-direction: column; flex-direction: column;
justify-content: space-around; justify-content: space-around;
} }
:fullscreen .data-list {
width: 35%;
gap: 32px;
padding: 32px 0;
justify-content: space-around;
}
:fullscreen .data-list > div {
flex: 1;
}
</style> </style>

View File

@ -71,21 +71,5 @@ export const useSettings = defineStore("settings", () => {
break; break;
} }
} }
return { settings, updateSettings, rewriteSettings, changeScale }; return { settings, updateSettings, rewriteSettings };
}); });
function changeScale(elm, width, height) {
const xScale = width / 1920;
const yScale = height / 1080;
const style = {
transform: `scale(${xScale}, ${yScale}) !important`,
transformOrigin: "top left",
};
elm.style.transform = style.transform;
elm.style.transformOrigin = style.transformOrigin;
}
function resetScale(elm) {
elm.style.transform = "initial";
elm.style.transformOrigin = "initial";
}