App.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <template>
  2. <div id="app">
  3. <router-view/>
  4. </div>
  5. </template>
  6. <script>
  7. import {mapGetters} from 'vuex'
  8. export default{
  9. data () {
  10. return {
  11. }
  12. },
  13. computed:{
  14. ...mapGetters({
  15. searchValue:'searchValue',
  16. })
  17. },
  18. methods:{
  19. },
  20. created () {
  21. },
  22. watch: {
  23. $route(val) {
  24. try {
  25. if (!val.meta.modules) {
  26. let at_modules = JSON.parse(sessionStorage.getItem('active_modules'))
  27. val.meta.modules?'':val.meta.modules = at_modules
  28. } else {
  29. let app = val.meta.modules.apps.filter(e=>{
  30. if (e.name === val.name) return e
  31. })
  32. sessionStorage.setItem('active_modules',JSON.stringify(val.meta.modules))
  33. this.$store.dispatch('setActiveApp',{app:app[0],val:this.searchValue})
  34. let system = JSON.parse(sessionStorage.getItem('module_info'))
  35. let at_system = system.filter(e=>{
  36. if (e.systemid === val.meta.modules.systemid)
  37. return e
  38. })
  39. this.$store.dispatch('getModules',{mod:at_system[0].modules})
  40. }
  41. } catch (error) {
  42. }
  43. }
  44. }
  45. }
  46. </script>
  47. <style>
  48. body{
  49. font:16px/1.5 Helvetica Neue,Helvetica,Arial,Microsoft Yahei,Hiragino Sans GB,Heiti SC,WenQuanYi Micro Hei,sans-serif;
  50. font-family: "阿里巴巴普惠体 2.0 35 Thin";
  51. min-width: 1200px;
  52. }
  53. .rightBar{
  54. width:60px;
  55. height:100vh;
  56. background: rgba(255,255,255,.5);
  57. box-shadow: 0 2px 5px rgb(0 0 0 / 10%);
  58. }
  59. .el-drawer__header{
  60. padding: 10px !important;
  61. margin-bottom: 0 !important;
  62. font-size: 16px !important;
  63. font-family: PingFang SC-Bold, PingFang SC;
  64. font-weight: bold !important;
  65. color: #333333 !important;
  66. }
  67. </style>