index.vue 5.0 KB

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