Index.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. <template>
  2. <el-row type="flex" class="container" justify="space-between">
  3. <el-col :span="4" class="menu-left">
  4. <el-row>
  5. <el-col :span="24" class="logo-col">
  6. <div class="logo"></div>
  7. </el-col>
  8. </el-row>
  9. <el-row>
  10. <el-col :span="24" class="title-col">
  11. <div class="title">南昌交通学院热水管理系统</div>
  12. </el-col>
  13. </el-row>
  14. <el-row class="menu-row">
  15. <el-col :span="24">
  16. <el-menu router :default-active="$route.path" class="el-menu-vertical-demo"
  17. background-color="#1D3251" text-color="#fff" active-text-color="#fff">
  18. <router-link to="devmgr">
  19. <el-menu-item index="/index/devmgr">
  20. <i class="el-icon-sbgl"></i>
  21. <span slot="title">设备管理</span>
  22. </el-menu-item>
  23. </router-link>
  24. <router-link to="balan">
  25. <el-menu-item index="/index/balan">
  26. <i class="el-icon-yue"></i>
  27. <span slot="title">余额管理</span>
  28. </el-menu-item>
  29. </router-link>
  30. <router-link to="sjdz">
  31. <el-menu-item index="/index/sjdz">
  32. <i class="el-icon-sjdz"></i>
  33. <span slot="title">商家对账</span>
  34. </el-menu-item>
  35. </router-link>
  36. <router-link to="ysfx">
  37. <el-menu-item index="/index/ysfx">
  38. <i class="el-icon-ysfx"></i>
  39. <span slot="title">用水分析</span>
  40. </el-menu-item>
  41. </router-link>
  42. <router-link to="flsz">
  43. <el-menu-item index="/index/flsz">
  44. <i class="el-icon-flsz"></i>
  45. <span slot="title">费率设置</span>
  46. </el-menu-item>
  47. </router-link>
  48. <router-link to="ysyc">
  49. <el-menu-item index="/index/ysyc">
  50. <i class="el-icon-ysyc"></i>
  51. <span slot="title">用水异常</span>
  52. </el-menu-item>
  53. </router-link>
  54. <router-link to="zfyc">
  55. <el-menu-item index="/index/zfyc">
  56. <i class="el-icon-zfyc"></i>
  57. <span slot="title">支付异常</span>
  58. </el-menu-item>
  59. </router-link>
  60. <router-link to="zhgl">
  61. <el-menu-item index="/index/zhgl">
  62. <i class="el-icon-zhgl"></i>
  63. <span slot="title">账号管理</span>
  64. </el-menu-item>
  65. </router-link>
  66. </el-menu>
  67. </el-col>
  68. </el-row>
  69. <div class="diwen"></div>
  70. </el-col>
  71. <el-col :span="20">
  72. <el-row>
  73. <el-col :span="24" class="right-top">
  74. <div class="wecome-text">{{userName}} 您好,欢迎登陆!</div>
  75. <div class="right-items">
  76. <div class="tx"></div>
  77. <div class="user-name">我是【{{unic}}】</div>
  78. <div class="shuxian"></div>
  79. <div class="logout-btn" @click="logout"></div>
  80. </div>
  81. </el-col>
  82. </el-row>
  83. <el-row>
  84. <el-col :span="24" class="right-main">
  85. <router-view @sonFun='indexFun'></router-view>
  86. </el-col>
  87. </el-row>
  88. </el-col>
  89. </el-row>
  90. </template>
  91. <script>
  92. export default {
  93. data() {
  94. return {
  95. userName: '',
  96. unic: ''
  97. }
  98. },
  99. created() {
  100. var statue = sessionStorage.getItem('uname')
  101. var unic = sessionStorage.getItem('unic')
  102. if (!statue || typeof(statue) == 'undefined' || statue == '' || statue == 'null') {
  103. this.$router.replace('/')
  104. return
  105. } else {
  106. this.userName = statue
  107. this.unic = unic
  108. }
  109. },
  110. methods: {
  111. // 通过子组件更新昵称
  112. indexFun(param) {
  113. if (typeof(param) == 'undefined' || !param) {
  114. this.unic = sessionStorage.getItem('unic')
  115. } else {
  116. this.unic = param
  117. }
  118. },
  119. // 退出登陆
  120. logout() {
  121. var _this = this
  122. this.$confirm('确认退出?', '提示', {
  123. confirmButtonText: '是,退出',
  124. cancelButtonText: '否,不退出',
  125. type: 'warning'
  126. })
  127. .then(_ => {
  128. // console.log(_);
  129. sessionStorage.removeItem('uname')
  130. _this.$router.replace('/')
  131. })
  132. .catch(_ => {
  133. // console.log(_);
  134. });
  135. }
  136. }
  137. }
  138. </script>
  139. <style scoped>
  140. @import url("Index.css");
  141. </style>