Admin.vue 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. <!--管理界面-->
  2. <template>
  3. <div class="containers">
  4. <!--主页-->
  5. <div
  6. :style="{
  7. position: 'relative',
  8. left:windowJson[0] ? windowJson[0].Left*bigScale+'px' : '',
  9. top:windowJson[0] ? windowJson[0].Top*bigScale+'px' : '',
  10. width:windowJson[0] ? windowJson[0].Width*bigScale + 'px' : '',
  11. height:windowJson[0] ? windowJson[0].Height*bigScale + 'px' : '',
  12. zIndex:windowJson[0] ? windowJson[0].ZIndex : '',
  13. display:windowJson[0] ? (windowJson[0].IsVisibility ? 'block' : 'none') : '',
  14. backgroundImage:windowJson[0] ? (windowJson[0].BackIcon ? 'url('+require(`../../../static/Data/${windowJson[0].BackIcon}`)+')' : null) : '',
  15. backgroundRepeat:'no-repeat',
  16. backgroundSize:'100% 100%',
  17. backgroundColor:`#${windowJson[0] ? (windowJson[0].BrackgroupStr ? windowJson[0].BrackgroupStr.slice(3) : null) : ''}`,
  18. margin:'0 auto'}"
  19. ref="mainpage"
  20. >
  21. <!--按钮-->
  22. <ButtonComponent />
  23. <!--大屏显示-->
  24. <BigShowComponent />
  25. <!--label标签-->
  26. <LabelComponent />
  27. <!--图片-->
  28. <ImageComponent />
  29. <!--信号源列表-->
  30. <SignalListComponent />
  31. <!--滑块-->
  32. <SliderComponent />
  33. <!--<button class="logoutBtn" @click="logout">退出</button>-->
  34. </div>
  35. <!--最小化和关闭按钮-->
  36. <div class="mini" @click="miniWindow">-</div>
  37. <div class="close" @click="closeWindow">×</div>
  38. </div>
  39. </template>
  40. <script>
  41. import {mapState} from 'vuex'
  42. import storageUtils from "../../utils/storageUtils"
  43. import '../assets/less/mainpage.less'
  44. import ButtonComponent from './Button'
  45. import LabelComponent from './Label'
  46. import BigShowComponent from './BigShow'
  47. import SignalListComponent from './SignalList'
  48. import ImageComponent from './Image'
  49. import SliderComponent from './Slider'
  50. import {reqLogout} from "../api"
  51. import {getStaticFile} from "../../utils/tools"
  52. export default {
  53. components: {
  54. ButtonComponent,
  55. LabelComponent,
  56. BigShowComponent,
  57. SignalListComponent,
  58. ImageComponent,
  59. SliderComponent
  60. },
  61. data() {
  62. return {
  63. user: storageUtils.getUser(), // 本地存储的用户
  64. windowJson:[]
  65. }
  66. },
  67. async beforeCreate() {
  68. this.windowJson = await getStaticFile('EnityWindow.Data')
  69. },
  70. methods: {
  71. // 退出登录
  72. /*async logout() {
  73. await reqLogout(this.user)
  74. // 重置用户
  75. this.$store.dispatch('resetUser')
  76. // 去登录界面
  77. this.$router.replace('/login')
  78. },*/
  79. // 最小化窗口
  80. miniWindow() {
  81. require('electron').ipcRenderer.send('window-min')
  82. },
  83. // 关闭窗口
  84. closeWindow() {
  85. require('electron').ipcRenderer.send('window-close')
  86. }
  87. },
  88. computed: {
  89. ...mapState(['bigScale'])
  90. }
  91. }
  92. </script>