index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <!--
  2. * @Author: zhangyu
  3. * @Date: 2019-11-05 15:36:21
  4. * @Info:
  5. * @LastEditTime: 2019-11-14 15:46:27
  6. -->
  7. <template>
  8. <div id="screenBox">
  9. <div class="mian-icon" v-show="$route.name == 'splitScreen'">
  10. <div class="main-content">
  11. <img src="@/assets/image/uncultivated.svg">
  12. <h2>功能设计中。。。</h2>
  13. </div>
  14. </div>
  15. <router-view v-show="$route.name != 'splitScreen'" class="screen-router"></router-view>
  16. </div>
  17. </template>
  18. <script>
  19. import { mapGetters } from 'vuex'
  20. import lStorage from '@/utils/localStorage'
  21. export default {
  22. data() {
  23. return {
  24. }
  25. },
  26. created() {
  27. lStorage.set('screen_data', {})
  28. },
  29. mounted() {
  30. window.addEventListener("storage", event =>{
  31. if(event.key == '_sagacloud_admin_store_screen_data'){
  32. let data
  33. try {
  34. data = JSON.parse(event.newValue)
  35. } catch (error) {
  36. data = event.newValue
  37. }
  38. this.handleChangeRouter(data)
  39. }
  40. });
  41. },
  42. destroyed() {
  43. window.removeEventListener("storage", event => {})
  44. lStorage.remove('screen_data')
  45. },
  46. computed: {
  47. ...mapGetters('layout', ['userInfo', 'projectId', 'projects', 'userId'])
  48. },
  49. methods:{
  50. handleChangeRouter(data) {
  51. console.log(data)
  52. if(data.path && data.path == '/ledger/spacelist'){//业务空间台账
  53. this.$router.push({
  54. path:'/splitScreen/spaceledger',
  55. query: data.data
  56. })
  57. } else if (data.path && data.path == '/point/report') {//系统集成成果管理
  58. this.$router.push({
  59. path:'/splitScreen/integrateresults',
  60. query: data.data
  61. })
  62. } else {
  63. this.$router.push({
  64. path:'/splitScreen'
  65. })
  66. }
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss" scoped>
  72. #screenBox{
  73. width: 100%;
  74. height: 100%;
  75. .mian-icon{
  76. width: 100%;
  77. height: 100%;
  78. text-align: center;
  79. position: relative;
  80. .main-content{
  81. position: absolute;
  82. top: 25%;
  83. left: 50%;
  84. transform: translate(-50%, 0);
  85. h2{
  86. text-align: center;
  87. margin-top: 30px;
  88. }
  89. }
  90. }
  91. .screen-router{
  92. display: flex;
  93. flex-direction: column;
  94. justify-content: flex-start;
  95. padding: 10px;
  96. width: 100%;
  97. height: 100%;
  98. box-sizing: border-box;
  99. overflow: hidden;
  100. }
  101. }
  102. </style>