App.vue 1.8 KB

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