|
@@ -0,0 +1,273 @@
|
|
|
+<template>
|
|
|
+ <div class="large-screen" id="largeScreen">
|
|
|
+ <div class="header">
|
|
|
+ <span class="header-name">{{ sysTitle }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="left-sidebar-container">
|
|
|
+ <div class="top-info-area">
|
|
|
+ <div class="info-block">
|
|
|
+ <img src="@/assets/images/home/tianqi.svg" alt="">
|
|
|
+ <span>{{ weather.text }}</span>
|
|
|
+ <span>{{ weather.temperature }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <router-view class="sidebar-router-view" name="left"></router-view>
|
|
|
+ </div>
|
|
|
+ <router-view></router-view>
|
|
|
+ <div class="right-sidebar-container">
|
|
|
+ <div class="top-info-area">
|
|
|
+ <div class="info-block ">
|
|
|
+ <span class="date-info">
|
|
|
+ <span>{{ nowDay.currentTime }}</span>
|
|
|
+ <span>{{ nowDay.week }}</span>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <router-view class="sidebar-router-view" name="right"></router-view>
|
|
|
+ </div>
|
|
|
+ <div class="footer-container">
|
|
|
+ <Footer></Footer>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import autofit from 'autofit.js'
|
|
|
+import Footer from '../footer.vue';
|
|
|
+import {dateFormat} from '@/utils/index.js'
|
|
|
+import axios from 'axios';
|
|
|
+import {listFactor} from "@/api/basecfg/cacfg";
|
|
|
+import {mapMutations} from 'vuex';
|
|
|
+import {listDisStaCoal} from "@/api/basecfg/disStaCoal";
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'LargeScreen',
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ sysTitle: '',
|
|
|
+ nowDay: {
|
|
|
+ currentTime: '',
|
|
|
+ week: '',
|
|
|
+ },
|
|
|
+ timer: null,
|
|
|
+ weather: {
|
|
|
+ text: '',
|
|
|
+ temperature: ''
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ components: {
|
|
|
+ Footer
|
|
|
+ },
|
|
|
+ computed: {},
|
|
|
+ async created() {
|
|
|
+ const {rows: regionFactor} = await listFactor({
|
|
|
+ regionCode: process.env.VUE_APP_REGION_CODE,
|
|
|
+ })
|
|
|
+ if (regionFactor && regionFactor.length > 0) {
|
|
|
+ this.setRegionFactor(regionFactor[0].factorValue)
|
|
|
+ }
|
|
|
+
|
|
|
+ const {rows: energyFactor} = await listDisStaCoal({
|
|
|
+ energyCode: '45',
|
|
|
+ })
|
|
|
+ if (regionFactor && regionFactor.length > 0) {
|
|
|
+ this.setElec2CFactor(energyFactor[0].coefficientValue)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ autofit.init({
|
|
|
+ designHeight: 1080,
|
|
|
+ designWidth: 1920,
|
|
|
+ renderDom: "#largeScreen",
|
|
|
+ resize: true
|
|
|
+ })
|
|
|
+ this.getDate();
|
|
|
+ this.getWeather()
|
|
|
+ this.timer = setInterval(() => {
|
|
|
+ this.getDate();
|
|
|
+ }, 1000);
|
|
|
+ this.getConfigKey("sys.info.title").then(response => {
|
|
|
+ this.sysTitle = response.msg;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ beforeDestroy() {
|
|
|
+ clearInterval(this.timer)
|
|
|
+ this.timer = null
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapMutations('userState', ["setRegionFactor", "setElec2CFactor"]),
|
|
|
+ async getDate() {
|
|
|
+ let nowTime = new Date();
|
|
|
+ this.nowDay.week = "星期" + "日一二三四五六".charAt(nowTime.getDay());
|
|
|
+ this.nowDay.currentTime = dateFormat(nowTime, 'yyyy-MM-dd HH:mm:ss')
|
|
|
+ },
|
|
|
+ getWeather() {
|
|
|
+ axios.get('https://api.seniverse.com/v3/weather/now.json?key=SoZVeNXSD1AlWok1V&location=nanjing&language=zh-Hans&unit=c').then(({data: {results}}) => {
|
|
|
+ if (results && results.length) {
|
|
|
+ this.weather.text = results[0].now.text
|
|
|
+ this.weather.temperature = `${results[0].now.temperature}°C`
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang='scss' scoped>
|
|
|
+.large-screen {
|
|
|
+ background: #000;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ color: #fff;
|
|
|
+ font-size: 18px;
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.header {
|
|
|
+ width: 100%;
|
|
|
+ z-index: 40;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ height: 230px;
|
|
|
+ text-align: center;
|
|
|
+ background-image: url('~@/assets/images/layout/head.png');
|
|
|
+ background-size: 85% 100%;
|
|
|
+ background-position: center;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+
|
|
|
+ .header-name {
|
|
|
+ font-size: 32px;
|
|
|
+ font-weight: bold;
|
|
|
+ letter-spacing: 0.1em;
|
|
|
+ background-clip: text;
|
|
|
+ color: transparent;
|
|
|
+ line-height: 70px;
|
|
|
+ background-image: linear-gradient(to bottom,
|
|
|
+ white 30%,
|
|
|
+ #75bfe9 100%);
|
|
|
+ }
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+// 左侧栏的容器样式
|
|
|
+.left-sidebar-container {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 50;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 425px;
|
|
|
+ height: 1081px;
|
|
|
+ background-image: url('~@/assets/images/layout/left.png');
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ padding-left: 7px;
|
|
|
+ padding-right: 6px;
|
|
|
+ padding-top: 4px;
|
|
|
+ padding-bottom: 20px;
|
|
|
+ pointer-events: auto;
|
|
|
+
|
|
|
+ // 顶部信息区域样式
|
|
|
+ .top-info-area {
|
|
|
+ height: 10%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ font-size: 18px;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 信息块样式
|
|
|
+ .info-block {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ padding-left: 25px;
|
|
|
+ color: #B3E3E8;
|
|
|
+ margin-top: 8px;
|
|
|
+ height: 38px;
|
|
|
+
|
|
|
+ img {
|
|
|
+ height: 24px;
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+
|
|
|
+ span {
|
|
|
+ margin-right: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 路由视图容器样式
|
|
|
+ .sidebar-router-view {
|
|
|
+ height: 90%;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 右侧栏的容器样式
|
|
|
+.right-sidebar-container {
|
|
|
+ position: absolute;
|
|
|
+ z-index: 40;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ width: 425px;
|
|
|
+ height: 1081px;
|
|
|
+ background-image: url('~@/assets/images/layout/right.png');
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ padding-left: 6px;
|
|
|
+ padding-right: 7px;
|
|
|
+ padding-top: 4px;
|
|
|
+ padding-bottom: 20px;
|
|
|
+ pointer-events: auto;
|
|
|
+
|
|
|
+ // 顶部信息区域样式
|
|
|
+ .top-info-area {
|
|
|
+ height: 10%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 信息块样式
|
|
|
+ .info-block {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ height: 38px;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ justify-content: flex-end;
|
|
|
+ padding-right: 25px;
|
|
|
+ margin-top: 8px;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 日期数据样式
|
|
|
+ .date-info {
|
|
|
+ color: #B3E3E8;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ span {
|
|
|
+ margin-left: 5px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 路由视图容器样式
|
|
|
+ .sidebar-router-view {
|
|
|
+ height: 90%;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+// 底部栏的容器样式
|
|
|
+.footer-container {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-end;
|
|
|
+ justify-content: center;
|
|
|
+ width: 100%;
|
|
|
+ position: absolute;
|
|
|
+ bottom: 0;
|
|
|
+ height: 230px;
|
|
|
+ pointer-events: none;
|
|
|
+ background-image: url('~@/assets/images/layout/footer.png');
|
|
|
+ background-position: center;
|
|
|
+ background-repeat: no-repeat;
|
|
|
+ background-size: 85% 100%;
|
|
|
+ z-index: 20;
|
|
|
+}
|
|
|
+</style>
|