|
|
|
@ -1,5 +1,5 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<div class="home-page">
|
|
|
|
<div class="home-page" :class="{ 'is-fullscreen': isFullscreenLayout }">
|
|
|
|
<div class="home-welcome">
|
|
|
|
<div class="home-welcome">
|
|
|
|
<div class="home-welcome-left">
|
|
|
|
<div class="home-welcome-left">
|
|
|
|
<div class="home-welcome-title text-white!">{{t("home.welcome")}}</div>
|
|
|
|
<div class="home-welcome-title text-white!">{{t("home.welcome")}}</div>
|
|
|
|
@ -338,15 +338,26 @@ import { WeatherVO } from '@/api/home/info'
|
|
|
|
import bannerImg from '@/assets/imgs/banner.png'
|
|
|
|
import bannerImg from '@/assets/imgs/banner.png'
|
|
|
|
import { DashboardApi,DashboardProductVO,DeviceStatusVO } from '@/api/dashboard'
|
|
|
|
import { DashboardApi,DashboardProductVO,DeviceStatusVO } from '@/api/dashboard'
|
|
|
|
import { formatDate } from '@/utils/formatTime'
|
|
|
|
import { formatDate } from '@/utils/formatTime'
|
|
|
|
|
|
|
|
import { useRoute } from 'vue-router'
|
|
|
|
defineOptions({ name: 'Home' })
|
|
|
|
defineOptions({ name: 'Home' })
|
|
|
|
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
const userStore = useUserStore()
|
|
|
|
const userStore = useUserStore()
|
|
|
|
const { setWatermark } = useWatermark()
|
|
|
|
const { setWatermark } = useWatermark()
|
|
|
|
const loading = ref(true)
|
|
|
|
const loading = ref(true)
|
|
|
|
const avatar = userStore.getUser.avatar
|
|
|
|
const avatar = userStore.getUser.avatar
|
|
|
|
const username = userStore.getUser.nickname
|
|
|
|
const username = userStore.getUser.nickname
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isEnabledQueryValue = (value: unknown) => {
|
|
|
|
|
|
|
|
const rawValue = Array.isArray(value) ? value[0] : value
|
|
|
|
|
|
|
|
return ['1', 'true', 'yes', 'on'].includes(String(rawValue ?? '').toLowerCase())
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const isFullscreenLayout = computed(() =>
|
|
|
|
|
|
|
|
isEnabledQueryValue(route.query.fullscreen ?? route.query.full)
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
const getCssVar = (name: string, fallback: string) => {
|
|
|
|
const getCssVar = (name: string, fallback: string) => {
|
|
|
|
if (typeof window === 'undefined') return fallback
|
|
|
|
if (typeof window === 'undefined') return fallback
|
|
|
|
const v = getComputedStyle(document.documentElement).getPropertyValue(name).trim()
|
|
|
|
const v = getComputedStyle(document.documentElement).getPropertyValue(name).trim()
|
|
|
|
@ -869,6 +880,17 @@ getAllApi()
|
|
|
|
gap: 16px;
|
|
|
|
gap: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.home-page.is-fullscreen {
|
|
|
|
|
|
|
|
position: fixed;
|
|
|
|
|
|
|
|
inset: 0;
|
|
|
|
|
|
|
|
z-index: 2000;
|
|
|
|
|
|
|
|
width: 100vw;
|
|
|
|
|
|
|
|
height: 100vh;
|
|
|
|
|
|
|
|
padding: 16px;
|
|
|
|
|
|
|
|
overflow: auto;
|
|
|
|
|
|
|
|
background: #f5f7fa;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.home-section {
|
|
|
|
.home-section {
|
|
|
|
margin-bottom: 16px;
|
|
|
|
margin-bottom: 16px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|