index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <template>
  2. <div class="container">
  3. <el-row :gutter="20" class="normal-margin">
  4. <el-col :span="6">
  5. <user :data="dataOverview.user"></user>
  6. </el-col>
  7. <el-col :span="6">
  8. <flow ref="flow" :data="dataOverview.flow"></flow>
  9. </el-col>
  10. <el-col :span="6">
  11. <sms ref="sms" :data="dataOverview.sms"></sms>
  12. </el-col>
  13. <el-col :span="6">
  14. <storage ref="storage" :data="dataOverview.storage"></storage>
  15. </el-col>
  16. </el-row>
  17. <div class="normal-card normal-margin " shadow="none" v-for="item in modulesList" :key="item.systemid">
  18. <p class="title">{{item.systemname}}</p>
  19. <el-row :gutter="20">
  20. <el-col style="margin-top:16px" :span="4" v-for="modules in item.modules" :key="modules.systemmoduleid" @click.native="redictToModules(modules)">
  21. <div class="modules-item flex-align-center">
  22. <div class="setting-panel">
  23. <el-dropdown placement="top">
  24. <span class="el-dropdown-link">
  25. <i class="el-icon-setting"></i>
  26. </span>
  27. <el-dropdown-menu slot="dropdown">
  28. <el-dropdown-item @click.native="addToshortBar(modules)">添加到快捷操作</el-dropdown-item>
  29. </el-dropdown-menu>
  30. </el-dropdown>
  31. </div>
  32. <img width="50" height="50" :src="modules.iconurl" alt="">
  33. <p>{{modules.systemmodulename}}<br><small class="info">{{(modules.systemmodule).toUpperCase()}}</small></p>
  34. </div>
  35. </el-col>
  36. </el-row>
  37. </div>
  38. </div>
  39. </template>
  40. <script>
  41. import user from './modules/user.vue'
  42. import flow from './modules/flow.vue'
  43. import sms from './modules/sms.vue'
  44. import storage from './modules/storage.vue'
  45. export default {
  46. components:{
  47. user,
  48. flow,
  49. sms,
  50. storage
  51. },
  52. data () {
  53. return {
  54. modulesList:[],
  55. dataOverview:{}
  56. }
  57. },
  58. methods:{
  59. redictToModules (item) {
  60. this.$router.push({path:item.apps[0].path})
  61. sessionStorage.setItem('active_modules',JSON.stringify(item))
  62. window.sessionStorage.setItem('currentPath',item.apps[0].path)
  63. },
  64. async addToshortBar (item) {
  65. const res = await this.$api.requested({
  66. "classname": "sysmanage.develop.userauthforweb.userauth",
  67. "method": "create_usershortcuts",
  68. "content": {
  69. "systemmoduleid":item.systemmoduleid
  70. }
  71. })
  72. this.$store.dispatch('setUsershortcuts')
  73. },
  74. async getDataOverview () {
  75. const res = await this.$api.requested({
  76. "classname": "webmanage.dataanalysis.data",
  77. "method": "getDataOverview",
  78. "content": {}
  79. })
  80. this.dataOverview = res.data
  81. this.$refs.flow.piePlot.changeData([{num:res.data.flow.unUsed,type:'未使用'},{num:res.data.flow.used,type:'已使用'}])
  82. this.$refs.sms.piePlot.changeData([{num:res.data.sms.total - res.data.sms.used,type:'未使用'},{num:res.data.sms.used,type:'已使用'}])
  83. this.$refs.storage.piePlot.changeData([{num:res.data.storage.unUsed,type:'未使用'},{num:res.data.storage.used,type:'已使用'}])
  84. },
  85. },
  86. mounted () {
  87. this.modulesList = JSON.parse(sessionStorage.getItem('module_info'))
  88. this.getDataOverview()
  89. }
  90. }
  91. </script>
  92. <style>
  93. </style>
  94. <style scoped>
  95. .title{
  96. font-size: 16px;
  97. font-weight: bold;
  98. }
  99. .modules-item{
  100. position: relative;
  101. padding: 20px;
  102. border-radius: 8px;
  103. cursor: pointer;
  104. }
  105. .modules-item > p{
  106. margin-left: 15px;
  107. }
  108. .modules-item:hover{
  109. background: #EAF1FE;
  110. }
  111. .setting-panel{
  112. position: absolute;
  113. display: none;
  114. right:10px;
  115. top:10px;
  116. }
  117. .modules-item:hover .setting-panel{
  118. display: block;
  119. }
  120. </style>