index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div class="Spring-frame">
  3. <transition name="fade">
  4. <videoPlay v-if="video" :resInfo="item" @close="itemClose"/>
  5. </transition>
  6. <transition name="fade">
  7. <xg v-if="xg" :resInfo="item" @close="itemClose"/>
  8. </transition>
  9. <transition name="fade">
  10. <hy v-if="hy" :resInfo="item" @close="itemClose"/>
  11. </transition>
  12. <transition name="fade">
  13. <dyj v-if="dyj" :resInfo="item" @close="itemClose"/>
  14. </transition>
  15. <transition name="fade">
  16. <canyin v-if="canyin" :resInfo="item" @close="itemClose"/>
  17. </transition>
  18. <transition name="fade">
  19. <gjxx v-if="gjxx" :resInfo="item" @close="itemClose"/>
  20. </transition>
  21. <transition name="fade">
  22. <rqgj v-if="rqgj" :resInfo="item" @close="itemClose"/>
  23. </transition>
  24. <transition name="fade">
  25. <xfgj v-if="xfgj" :resInfo="item" @close="itemClose"/>
  26. </transition>
  27. </div>
  28. </template>
  29. <script>
  30. import videoPlay from "@/components2/SpringFrame/videoPlay";
  31. import xg from "@/components2/SpringFrame/xg";
  32. import hy from "@/components2/SpringFrame/hy";
  33. import dyj from "@/components2/SpringFrame/dyj";
  34. import canyin from "@/components2/SpringFrame/canyin";
  35. import gjxx from "@/components2/SpringFrame/gjxx";
  36. import rqgj from "@/components2/SpringFrame/rqgj";
  37. import xfgj from "@/components2/SpringFrame/xfgj";
  38. export default {
  39. name:"index",
  40. props:['resInfo'],
  41. components: {
  42. videoPlay,xg,hy,dyj,canyin,gjxx,rqgj,xfgj
  43. },
  44. data() {
  45. return {
  46. item:{},
  47. video:false,
  48. xg:false,
  49. hy:false,
  50. dyj:false,
  51. canyin:false,
  52. gjxx:undefined,
  53. rqgj:undefined,
  54. xfgj:undefined,
  55. }
  56. },
  57. watch: {
  58. resInfo(){
  59. this.getData()
  60. },
  61. },
  62. mounted(){
  63. this.getData()
  64. },
  65. methods: {
  66. getData(){
  67. if(this.resInfo.video){//视频
  68. this.video = true
  69. this.item = this.resInfo.video
  70. }
  71. if(this.resInfo.xg){//巡更
  72. this.xg = true
  73. this.item = this.resInfo.xg
  74. }
  75. if(this.resInfo.hy){//会议室
  76. this.hy = true
  77. }
  78. if(this.resInfo.dyj){//打印机
  79. this.dyj = true
  80. }
  81. if(this.resInfo.canyin){//餐饮
  82. this.canyin = true
  83. this.item = this.resInfo
  84. }
  85. if(this.resInfo.gjxx){//告警信息
  86. this.gjxx = true
  87. this.item = this.resInfo.gjxx
  88. }
  89. if(this.resInfo.rqgj){//入侵告警
  90. this.rqgj = true
  91. this.item = this.resInfo.rqgj
  92. }
  93. if(this.resInfo.xfgj){//消防告警
  94. this.xfgj = true
  95. this.item = this.resInfo.xfgj
  96. }
  97. },
  98. itemClose(){
  99. this.video = false
  100. this.xg = false
  101. this.hy = false
  102. this.dyj = false
  103. this.canyin = false
  104. this.gjxx = false
  105. this.rqgj = false
  106. this.xfgj = false
  107. this.item = {}
  108. this.$emit("close")
  109. },
  110. },
  111. };
  112. </script>
  113. <style lang="scss">
  114. .Spring-frame {
  115. position: absolute;
  116. width:50%;
  117. top:20%;
  118. left:25%;
  119. margin:0 auto;
  120. z-index: 1000;
  121. }
  122. </style>