index.vue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <template>
  2. <div id='equipment'>
  3. <div class='eq-top'>
  4. <span
  5. class='eq-system'
  6. v-for='(item,index) in system'
  7. :class='item.id==systemId?"isActive":""'
  8. :key='index'
  9. @click='tabSyatem(item)'
  10. >{{item.name}}</span>
  11. </div>
  12. <div class='eq-bottom'>
  13. <div class='eq-left'>
  14. <ul>
  15. <li class='li-style' v-for='(eve,index) in everySystem' :key='"o"+index' @click='dialogVisible(eve)'>
  16. <span class='circle'></span>
  17. {{eve.label}}
  18. </li>
  19. </ul>
  20. </div>
  21. <div class='eq-right'>
  22. <div class='eq-right-bottom'>
  23. <div class='eq-title'>
  24. <span>{{floorInfo.floorName}}</span>
  25. </div>
  26. <div class='eq-content'>
  27. <floorMap ref='floorMap'></floorMap>
  28. <bottomLayer></bottomLayer>
  29. </div>
  30. <floor-list :floors='floors' @emitFloor='emitFloor'></floor-list>
  31. </div>
  32. </div>
  33. <editList></editList>
  34. </div>
  35. <eq-dialog ref='dialog' :systemName='systemName'></eq-dialog>
  36. </div>
  37. </template>
  38. <script>
  39. import floorList from '@/components/floorList.vue'
  40. import floorMap from '@/components/floorMap/index.vue'
  41. import eqDialog from './eqDialog'
  42. import bottomLayer from './bottomLayer'
  43. import editList from '@/components/edit.vue'
  44. import { system, floors } from '@/utils/plugins/components.js'
  45. export default {
  46. data() {
  47. return {
  48. system,
  49. floors,
  50. everySystem: [],
  51. systemId: 1,
  52. systemName: '供电系统',
  53. floorInfo: {
  54. floorName: 'F1',
  55. floorId: 'f1'
  56. },
  57. dialogInfo: {}
  58. }
  59. },
  60. components: { floorList, eqDialog, floorMap, bottomLayer, editList },
  61. methods: {
  62. tabSyatem(item) {
  63. this.systemId = item.id
  64. ;(this.everySystem = item.children), (this.systemName = item.name)
  65. },
  66. emitFloor(item) {
  67. this.floorInfo = item
  68. this.$refs.floorMap.init()
  69. },
  70. dialogVisible(eve) {
  71. this.$refs.dialog.showModal(eve)
  72. // this.dialogInfo = eve
  73. }
  74. },
  75. mounted() {
  76. this.everySystem = this.system[0].children
  77. this.$refs.floorMap.init()
  78. // this.$refs.dialog.init()
  79. }
  80. }
  81. </script>
  82. <style lang="less" scoped>
  83. #equipment {
  84. background: rgba(242, 245, 247, 1);
  85. display: flex;
  86. flex: 1;
  87. .eq-top {
  88. margin-left: 195px;
  89. padding-top: 24px;
  90. position: fixed;
  91. z-index: 2;
  92. .eq-system {
  93. padding: 12px 23px;
  94. color: #1f2429;
  95. background: #fff;
  96. font-size: 16px;
  97. cursor: pointer;
  98. }
  99. .isActive {
  100. color: #025baa;
  101. }
  102. }
  103. .eq-bottom {
  104. display: flex;
  105. flex: 1;
  106. .eq-left {
  107. position: fixed;
  108. z-index: 2;
  109. width: 196px;
  110. padding-top: 100px;
  111. color: #646c73;
  112. font-size: 14px;
  113. height: 100%;
  114. background: rgba(242, 245, 247, 1);
  115. }
  116. .li-style {
  117. padding: 0 0 18px 35px;
  118. cursor: pointer;
  119. .circle {
  120. width: 6px;
  121. height: 6px;
  122. background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
  123. border-radius: 50%;
  124. display: inline-block;
  125. margin-right: 10px;
  126. }
  127. }
  128. .eq-right {
  129. flex: 1;
  130. .eq-right-bottom {
  131. display: flex;
  132. flex: 1;
  133. .eq-title {
  134. position: fixed;
  135. z-index: 2;
  136. top: 146px;
  137. left: 196px;
  138. width: 141px;
  139. height: 32px;
  140. background: linear-gradient(270deg, rgba(199, 217, 234, 0) 0%, rgba(199, 217, 234, 1) 100%);
  141. box-shadow: -6px 2px 8px 0px rgba(31, 36, 41, 0.1);
  142. color: #025baa;
  143. font-size: 16px;
  144. &::before {
  145. width: 2px;
  146. height: 16px;
  147. background: rgba(2, 91, 170, 1);
  148. display: inline-block;
  149. content: '';
  150. margin-right: 10px;
  151. margin-top: 8px;
  152. }
  153. }
  154. .eq-content {
  155. flex: 1;
  156. }
  157. }
  158. }
  159. }
  160. }
  161. </style>