|
@@ -1,71 +1,53 @@
|
|
|
<!--管理界面-->
|
|
|
<template>
|
|
|
<div class="containers">
|
|
|
- <!--主页-->
|
|
|
- <div
|
|
|
- :style="{
|
|
|
+ <!--主页-->
|
|
|
+ <div
|
|
|
+ :style="{
|
|
|
position: 'relative',
|
|
|
- left:windowJson[0].Left*Scale+'px',
|
|
|
- top:windowJson[0].Top*Scale+'px',
|
|
|
- width:windowJson[0].Width*Scale + 'px',
|
|
|
- height:windowJson[0].Height*Scale + 'px',
|
|
|
- zIndex:windowJson[0].ZIndex,
|
|
|
- display:windowJson[0].IsVisibility ? 'block' : 'none',
|
|
|
- backgroundImage:windowJson[0].BackIcon ? 'url('+require(`../../../static/images/${windowJson[0].BackIcon}`)+')' : null,
|
|
|
+ left:windowJson[0] ? windowJson[0].Left*scale+'px' : '',
|
|
|
+ top:windowJson[0] ? windowJson[0].Top*scale+'px' : '',
|
|
|
+ width:windowJson[0] ? windowJson[0].Width*scale + 'px' : '',
|
|
|
+ height:windowJson[0] ? windowJson[0].Height*scale + 'px' : '',
|
|
|
+ zIndex:windowJson[0] ? windowJson[0].ZIndex : '',
|
|
|
+ display:windowJson[0] ? (windowJson[0].IsVisibility ? 'block' : 'none') : '',
|
|
|
+ backgroundImage:windowJson[0] ? (windowJson[0].BackIcon ? 'url('+require(`../../../static/images/${windowJson[0].BackIcon}`)+')' : null) : '',
|
|
|
backgroundRepeat:'no-repeat',
|
|
|
backgroundSize:'100% 100%',
|
|
|
- backgroundColor:`#${windowJson[0].BrackgroupStr ? windowJson[0].BrackgroupStr.slice(3) : null}`,
|
|
|
+ backgroundColor:`#${windowJson[0] ? (windowJson[0].BrackgroupStr ? windowJson[0].BrackgroupStr.slice(3) : null) : ''}`,
|
|
|
margin:'0 auto'}"
|
|
|
- ref="mainpage"
|
|
|
- >
|
|
|
- <!--按钮-->
|
|
|
- <ButtonComponent />
|
|
|
+ ref="mainpage"
|
|
|
+ >
|
|
|
+ <!--按钮-->
|
|
|
+ <ButtonComponent />
|
|
|
|
|
|
- <!--大屏显示-->
|
|
|
- <BigShowComponent />
|
|
|
+ <!--大屏显示-->
|
|
|
+ <BigShowComponent />
|
|
|
|
|
|
- <!--label标签-->
|
|
|
- <LabelComponent />
|
|
|
+ <!--label标签-->
|
|
|
+ <LabelComponent />
|
|
|
|
|
|
- <!--图片-->
|
|
|
- <ImageComponent />
|
|
|
+ <!--图片-->
|
|
|
+ <ImageComponent />
|
|
|
|
|
|
- <!--信号源列表-->
|
|
|
- <SignalListComponent />
|
|
|
+ <!--信号源列表-->
|
|
|
+ <SignalListComponent />
|
|
|
|
|
|
- <!--滑块-->
|
|
|
- <SliderComponent />
|
|
|
+ <!--滑块-->
|
|
|
+ <SliderComponent />
|
|
|
|
|
|
- <!--其他页面-->
|
|
|
- <!--<div v-for="item in windowJson"
|
|
|
- :style="{
|
|
|
- left:item.Left+'px',
|
|
|
- top:item.Top+'px',
|
|
|
- width:item.Width + 'px',
|
|
|
- height:item.Height + 'px',
|
|
|
- zIndex:item.ZIndex,
|
|
|
- display:item.IsVisibility ? 'block' : 'none',
|
|
|
- backgroundColor:`#${item.BrackgroupStr.slice(3)}`,
|
|
|
- backgroundImage:item.BackIcon ? 'url('+require(`../../../static/images/${item.BackIcon}`)+')' : null,
|
|
|
- backgroundRepeat:'no-repeat',
|
|
|
- backgroundSize:'100% 100%',
|
|
|
- margin:'0 auto',
|
|
|
- }"
|
|
|
- >
|
|
|
- </div>-->
|
|
|
-
|
|
|
- <button class="logoutBtn" @click="logout">退出</button>
|
|
|
- </div>
|
|
|
- <!--最小化和关闭按钮-->
|
|
|
- <div class="mini" @click="miniWindow">-</div>
|
|
|
- <div class="close" @click="closeWindow">×</div>
|
|
|
+ <button class="logoutBtn" @click="logout">退出</button>
|
|
|
</div>
|
|
|
+ <!--最小化和关闭按钮-->
|
|
|
+ <div class="mini" @click="miniWindow">-</div>
|
|
|
+ <div class="close" @click="closeWindow">×</div>
|
|
|
+</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import '../assets/less/mainpage.less'
|
|
|
import {mapState} from 'vuex'
|
|
|
import storageUtils from "../../utils/storageUtils"
|
|
|
+ import '../assets/less/mainpage.less'
|
|
|
|
|
|
import ButtonComponent from './Button'
|
|
|
import LabelComponent from './Label'
|
|
@@ -74,6 +56,7 @@
|
|
|
import ImageComponent from './Image'
|
|
|
import SliderComponent from './Slider'
|
|
|
import {reqLogout} from "../api"
|
|
|
+ import {getStaticFile} from "../../utils/tools"
|
|
|
|
|
|
export default {
|
|
|
components: {
|
|
@@ -85,16 +68,17 @@
|
|
|
SliderComponent
|
|
|
},
|
|
|
|
|
|
- mounted() {
|
|
|
- this.fullScreen()
|
|
|
- },
|
|
|
-
|
|
|
data() {
|
|
|
return {
|
|
|
user: storageUtils.getUser(), // 本地存储的用户
|
|
|
+ windowJson:[]
|
|
|
}
|
|
|
},
|
|
|
|
|
|
+ async beforeCreate() {
|
|
|
+ this.windowJson = await getStaticFile('EnityWindow.Data')
|
|
|
+ },
|
|
|
+
|
|
|
methods: {
|
|
|
// 退出登录
|
|
|
async logout() {
|
|
@@ -105,18 +89,6 @@
|
|
|
this.$router.replace('/login')
|
|
|
},
|
|
|
|
|
|
- // 显示全屏
|
|
|
- fullScreen(){
|
|
|
- const de = this.$refs.mainpage
|
|
|
- if (de.requestFullscreen) {
|
|
|
- de.requestFullscreen()
|
|
|
- } else if (de.mozRequestFullScreen) {
|
|
|
- de.mozRequestFullScreen()
|
|
|
- } else if (de.webkitRequestFullScreen) {
|
|
|
- de.webkitRequestFullScreen()
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
// 最小化窗口
|
|
|
miniWindow() {
|
|
|
require('electron').ipcRenderer.send('window-min')
|
|
@@ -129,7 +101,7 @@
|
|
|
},
|
|
|
|
|
|
computed: {
|
|
|
- ...mapState(['windowJson','Scale'])
|
|
|
+ ...mapState(['scale'])
|
|
|
}
|
|
|
}
|
|
|
</script>
|