aside.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. <template>
  2. <div class="aside__panel">
  3. <div class="logo">
  4. <img v-show="img.usetype === 'actionlogo'" v-for="img in siteinfo.attinfos" :key="img.index" style="height:40px" :src="img.url" alt="">
  5. </div>
  6. <el-menu
  7. style="background:none"
  8. text-color="#fff"
  9. active-text-color="#000"
  10. class="el-menu-vertical-demo">
  11. <el-menu-item :index="String(item.systemid)" v-for="item in systemList" :key="item.index" @click="handelMenuClick(item,'system')">
  12. <span slot="title">{{item.systemname}}</span>
  13. </el-menu-item>
  14. <el-divider></el-divider>
  15. <el-menu-item :index="String(index + 10)" v-for="(item,index) in menuApp" :key="index" @click="handelMenuAppClick(item,'app')">
  16. <div class="flex-align-center flex-between menuItem">
  17. <span slot="title">{{item.systemappname}}</span>
  18. <i class="el-icon-error menuIconClose" @click.stop="deleteMenuApp(item)"></i>
  19. </div>
  20. </el-menu-item>
  21. </el-menu>
  22. </div>
  23. </template>
  24. <script>
  25. import {mapGetters} from 'vuex'
  26. export default {
  27. data () {
  28. return {
  29. systemList:[],
  30. active:"0"
  31. }
  32. },
  33. computed:{
  34. ...mapGetters({
  35. menuApp:'menuApp',
  36. siteinfo:'siteinfo',
  37. })
  38. },
  39. methods:{
  40. handelMenuClick (item,type) {
  41. this.active = String(item.systemid)
  42. this.$emit('getModules',item.modules,type)
  43. },
  44. handelMenuAppClick (app,type) {
  45. let system = JSON.parse(sessionStorage.getItem('module_info'))
  46. let mod = system.filter(e=>{return e.systemid === app.systemid})[0].modules.filter(e=>{return e.systemmoduleid === app.systemmoduleid})[0]
  47. let clickApp = mod.apps.filter(e=>{return e.systemappid === app.systemappid})
  48. sessionStorage.setItem('active_modules',JSON.stringify(mod))
  49. this.$emit('getModules',system.filter(e=>{return e.systemid === app.systemid})[0].modules,type)
  50. this.$store.dispatch('setActiveApp',{app:clickApp[0],val:''})
  51. this.$router.push({path:clickApp[0].path})
  52. },
  53. async deleteMenuApp (item) {
  54. const res = await this.$api.requested({
  55. "classname": "sysmanage.develop.userauthforweb.userauth",
  56. "method": "delete_usershortcuts",
  57. "content": {
  58. "systemappid":item.systemappid
  59. }
  60. })
  61. this.$store.dispatch('setAppMenu')
  62. }
  63. },
  64. mounted () {
  65. this.systemList = JSON.parse(sessionStorage.getItem('module_info'))
  66. this.$store.dispatch('setAppMenu')
  67. },
  68. watch:{
  69. $route (val) {
  70. }
  71. }
  72. }
  73. </script>
  74. <style>
  75. .aside__panel {
  76. margin: 0 10px 0 0;
  77. font-weight: bold;
  78. transition: linear .3s;
  79. }
  80. .aside__panel .el-menu-item{
  81. height: 40px;
  82. line-height: 40px;
  83. border-radius: 0 40px 40px 0;
  84. margin: 5px 0;
  85. }
  86. .aside__panel .el-menu-item:hover{
  87. background-color: rgba(255 ,255,255,1) !important;
  88. border-radius: 0 40px 40px 0;
  89. color:#333 !important;
  90. }
  91. .el-menu-item:focus, .el-menu-item:hover{
  92. background: none;
  93. }
  94. .is-active .menuIconClose{
  95. display: block !important;
  96. }
  97. </style>
  98. <style scoped>
  99. .is-active{
  100. background-color: rgba(255 ,255,255,1) !important;
  101. border-radius: 0 40px 40px 0;
  102. color:#333 !important;
  103. box-shadow: 0 15px 30px rgb(0 0 0 / 10%);
  104. }
  105. .logo{
  106. display:flex;
  107. align-items:center;
  108. justify-content:flex-start;
  109. height: 62px;
  110. line-height: 62px;
  111. color:#fff;
  112. padding-left:20px;
  113. /* border-right: 1px solid #f1f2f3; */
  114. }
  115. .menuIconClose{
  116. display: none;
  117. color:#333
  118. }
  119. .menuItem:hover .menuIconClose{
  120. display: block;
  121. }
  122. </style>