Index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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="czjl">
  31. <el-menu-item index="/index/czjl">
  32. <i class="el-icon-cong"></i>
  33. <span slot="title">充值记录</span>
  34. </el-menu-item>
  35. </router-link>
  36. <router-link to="sjdz">
  37. <el-menu-item index="/index/sjdz">
  38. <i class="el-icon-sjdz"></i>
  39. <span slot="title">商家对账</span>
  40. </el-menu-item>
  41. </router-link>
  42. <router-link to="ysfx">
  43. <el-menu-item index="/index/ysfx">
  44. <i class="el-icon-ysfx"></i>
  45. <span slot="title">用水分析</span>
  46. </el-menu-item>
  47. </router-link>
  48. <router-link to="flsz">
  49. <el-menu-item index="/index/flsz">
  50. <i class="el-icon-flsz"></i>
  51. <span slot="title">费率设置</span>
  52. </el-menu-item>
  53. </router-link>
  54. <router-link to="ysyc">
  55. <el-menu-item index="/index/ysyc">
  56. <i class="el-icon-ysyc"></i>
  57. <span slot="title">用水异常</span>
  58. </el-menu-item>
  59. </router-link>
  60. <router-link to="zfyc">
  61. <el-menu-item index="/index/zfyc">
  62. <i class="el-icon-zfyc"></i>
  63. <span slot="title">支付异常</span>
  64. </el-menu-item>
  65. </router-link>
  66. <router-link to="zhgl">
  67. <el-menu-item index="/index/zhgl">
  68. <i class="el-icon-zhgl"></i>
  69. <span slot="title">账号管理</span>
  70. </el-menu-item>
  71. </router-link>
  72. </el-menu>
  73. </el-col>
  74. </el-row>
  75. <div class="diwen"></div>
  76. </el-col>
  77. <el-col :span="20">
  78. <el-row>
  79. <el-col :span="24" class="right-top">
  80. <div class="wecome-text">{{userName}} 您好,欢迎登陆!</div>
  81. <div class="right-items">
  82. <div class="tx"></div>
  83. <div class="user-name">我是【{{unic}}】</div>
  84. <div class="shuxian"></div>
  85. <div class="logout-btn" @click="logout"></div>
  86. </div>
  87. </el-col>
  88. </el-row>
  89. <el-row>
  90. <el-col :span="24" class="right-main">
  91. <router-view @sonFun='indexFun'></router-view>
  92. </el-col>
  93. </el-row>
  94. </el-col>
  95. </el-row>
  96. </template>
  97. <script>
  98. export default {
  99. data() {
  100. return {
  101. userName: '',
  102. unic: ''
  103. }
  104. },
  105. created() {
  106. var statue = sessionStorage.getItem('uname')
  107. var unic = sessionStorage.getItem('unic')
  108. if (!statue || typeof(statue) == 'undefined' || statue == '' || statue == 'null') {
  109. this.$router.replace('/')
  110. return
  111. } else {
  112. this.userName = statue
  113. this.unic = unic
  114. }
  115. },
  116. methods: {
  117. // 通过子组件更新昵称
  118. indexFun(param) {
  119. if (typeof(param) == 'undefined' || !param) {
  120. this.unic = sessionStorage.getItem('unic')
  121. } else {
  122. this.unic = param
  123. }
  124. },
  125. // 退出登陆
  126. logout() {
  127. var _this = this
  128. this.$confirm('确认退出?', '提示', {
  129. confirmButtonText: '是,退出',
  130. cancelButtonText: '否,不退出',
  131. type: 'warning'
  132. })
  133. .then(_ => {
  134. // console.log(_);
  135. sessionStorage.removeItem('uname')
  136. _this.$router.replace('/')
  137. })
  138. .catch(_ => {
  139. // console.log(_);
  140. });
  141. }
  142. }
  143. }
  144. </script>
  145. <style scoped>
  146. @import url("Index.css");
  147. </style>