Admin.vue 3.3 KB

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