index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. <template>
  2. <!-- 设备设施 -->
  3. <div id='equipment'>
  4. <div class='eq-top'>
  5. <span class='eq-system' v-for='(item,index) in system' :class='item.id==systemId?"isActive":""' :key='index' @click='tabSyatem(item)'>
  6. <img :src='item.id==systemId?item.icon1:item.icon' />
  7. {{item.name}}
  8. </span>
  9. </div>
  10. <div class='eq-bottom'>
  11. <div class='eq-left'>
  12. <ul v-for='(eve,index) in everySystem' :key='"o"+index'>
  13. <li class='li-style' :class='{"is-active": eve.id}' @click='dialogVisible(eve)'>
  14. <span class='circle'></span>
  15. <span class='hanzi'>{{eve.label}}</span>
  16. </li>
  17. </ul>
  18. </div>
  19. <div class='eq-right'>
  20. <div class='eq-right-bottom'>
  21. <div class='title-box'>
  22. <div class='eq-title'>
  23. <span>{{floorInfo.code}}</span>
  24. </div>
  25. </div>
  26. <div class='eq-content'>
  27. <div class='legend-boxs'>
  28. <Legend :systemName='systemName' :floors='floorsArr' type='1'></Legend>
  29. </div>
  30. <floorMap ref='floorMap' :id='"equip"' :loadName='loadName' :type='"system"'></floorMap>
  31. <div class='additional-box' v-if='fqPic.length>0'>
  32. <div class='additional' @click='additionalColl'>
  33. <img src='../../assets/imgs/bg.png' alt />
  34. </div>
  35. <el-collapse-transition>
  36. <div v-if='show' class='add-img'>图</div>
  37. </el-collapse-transition>
  38. </div>
  39. </div>
  40. <floor-list v-if='floorsArr.length>0' :floorsArr='floorsArr' @emitFloor='emitFloor' id='system'></floor-list>
  41. </div>
  42. </div>
  43. </div>
  44. <eq-dialog ref='dialog' :systemName='systemName' :smsxt='smsxt' @emitCount='emitCount'></eq-dialog>
  45. </div>
  46. </template>
  47. <script>
  48. import floorList from '@/components/floorList.vue'
  49. import floorMap from '@/components/floorMap/index.vue'
  50. import eqDialog from './eqDialog'
  51. import editList from '@/components/edit.vue'
  52. import { system } from '@/utils/plugins/components.js'
  53. import { queryPic } from '@/api/public.js'
  54. import { mapGetters } from 'vuex'
  55. export default {
  56. data() {
  57. return {
  58. system,
  59. everySystem: [],
  60. systemId: 1,
  61. categoryId: 'GDXT',
  62. systemName: '供电系统',
  63. floorInfo: {
  64. gname: 'f1',
  65. code: 'F1'
  66. },
  67. smsxt: '1001',
  68. dialogInfo: {},
  69. brand: [], //品牌
  70. manufacturer: [],
  71. show: false,
  72. fqPic: [],
  73. loadName: '',
  74. type: '',
  75. objCount: []
  76. }
  77. },
  78. components: { floorList, eqDialog, floorMap, editList },
  79. methods: {
  80. // 查询tab页
  81. tabSyatem(item) {
  82. console.log(item)
  83. this.systemId = item.id
  84. this.everySystem = item.children
  85. this.systemName = item.name
  86. this.smsxt = item.smsxt
  87. this.$cookie.set('categoryId', item.categoryId, 3)
  88. if (this.smsxt == '1003' || this.smsxt == '1004') {
  89. this.Index()
  90. }
  91. this.init()
  92. },
  93. //判断有没有原理图,如果没有则不出现系统原理图列表li
  94. emitCount(objCount) {
  95. this.objCount = objCount
  96. },
  97. emitFloor(item) {
  98. this.floorInfo = item
  99. this.$refs.floorMap.init(this.floorInfo.gname)
  100. this.init()
  101. },
  102. dialogVisible(eve) {
  103. this.$refs.dialog.showModal(eve)
  104. },
  105. additionalColl() {
  106. this.show = !this.show
  107. },
  108. Index() {
  109. let picFloor = this.$cookie.get('floorNow')
  110. let getParams = {
  111. module: '1003',
  112. floor: picFloor,
  113. plazaId: this.$store.state.plazaId
  114. }
  115. if (this.smsxt) {
  116. getParams.system = this.smsxt
  117. }
  118. queryPic({ getParams }).then(res => {
  119. //console.log('分区图', res)
  120. this.fqPic = res.data
  121. })
  122. },
  123. init() {
  124. this.loadName = `设备设施-${this.systemName}-${this.floorInfo.code}`
  125. },
  126. // 从设备设施进入的机房
  127. queryType(val) {
  128. this.type = val
  129. console.log(this.type)
  130. }
  131. },
  132. mounted() {
  133. console.log('smsxtsmsxtsmsxt', this.$route.query.smsxt)
  134. if (this.$route.query.smsxt) {
  135. this.smsxt = this.$route.query.smsxt
  136. this.system.forEach(el => {
  137. if (el.smsxt == this.smsxt) {
  138. this.everySystem = el.children
  139. this.systemName = el.name
  140. this.systemId = el.id
  141. }
  142. })
  143. }
  144. this.everySystem = this.system[0].children
  145. this.init()
  146. this.$refs.floorMap.init(this.floorInfo.gname)
  147. },
  148. computed: {
  149. ...mapGetters(['floorsArr'])
  150. }
  151. }
  152. </script>
  153. <style lang="less" scoped>
  154. #equipment {
  155. background: rgba(242, 245, 247, 1);
  156. display: flex;
  157. flex: 1;
  158. overflow: hidden;
  159. .eq-top {
  160. margin-left: 260px;
  161. padding-top: 24px;
  162. position: fixed;
  163. z-index: 3;
  164. min-width: 1300px;
  165. .eq-system {
  166. padding: 12px 20px;
  167. background: #fff;
  168. font-size: 16px;
  169. cursor: pointer;
  170. img {
  171. width: 16px;
  172. height: 16px;
  173. margin-right: 4px;
  174. margin-bottom: 3px;
  175. }
  176. }
  177. .isActive {
  178. color: #025baa;
  179. font-weight: bolder;
  180. background: linear-gradient(360deg, rgba(2, 91, 170, 0.1) 0%, rgba(2, 91, 170, 0) 100%);
  181. }
  182. }
  183. .eq-bottom {
  184. display: flex;
  185. flex: 1;
  186. .eq-left {
  187. position: fixed;
  188. z-index: 2;
  189. width: 260px;
  190. padding-top: 100px;
  191. color: #646c73;
  192. font-size: 14px;
  193. height: 100%;
  194. background: rgba(242, 245, 247, 1);
  195. }
  196. .li-style {
  197. margin-left: 28px;
  198. // padding: 9px 6px;
  199. cursor: pointer;
  200. .circle {
  201. width: 6px;
  202. height: 6px;
  203. background: linear-gradient(180deg, rgba(54, 156, 247, 1) 0%, rgba(2, 91, 170, 1) 100%);
  204. border-radius: 50%;
  205. display: inline-block;
  206. margin-right: 10px;
  207. }
  208. .hanzi {
  209. padding: 10px 2px;
  210. width: 200px;
  211. display: inline-block;
  212. &:hover {
  213. color: rgba(2, 91, 170, 1);
  214. background: linear-gradient(270deg, rgba(199, 217, 234, 0) 0%, rgba(199, 217, 234, 1) 100%);
  215. }
  216. }
  217. }
  218. .eq-right {
  219. flex: 1;
  220. .eq-right-bottom {
  221. display: flex;
  222. flex: 1;
  223. .title-box {
  224. position: fixed;
  225. z-index: 2;
  226. top: 146px;
  227. left: 260px;
  228. display: flex;
  229. img {
  230. margin-top: -5px;
  231. }
  232. .eq-title {
  233. width: 140px;
  234. height: 32px;
  235. background: linear-gradient(270deg, rgba(199, 217, 234, 0) 0%, rgba(199, 217, 234, 1) 100%);
  236. box-shadow: -6px 2px 8px 0px rgba(31, 36, 41, 0.1);
  237. color: #025baa;
  238. font-size: 16px;
  239. &::before {
  240. width: 2px;
  241. height: 16px;
  242. background: rgba(2, 91, 170, 1);
  243. display: inline-block;
  244. content: '';
  245. margin-right: 10px;
  246. margin-top: 8px;
  247. }
  248. }
  249. }
  250. .eq-content {
  251. flex: 1;
  252. .legend-boxs {
  253. position: fixed;
  254. z-index: 9;
  255. right: 32px;
  256. top: 160px;
  257. }
  258. .additional-box {
  259. position: relative;
  260. .additional {
  261. width: 44px;
  262. height: 44px;
  263. background: rgba(255, 255, 255, 1);
  264. box-shadow: 0px 2px 15px 0px rgba(31, 36, 41, 0.08);
  265. border-radius: 2px;
  266. position: fixed;
  267. right: 32px;
  268. top: 420px;
  269. z-index: 2;
  270. display: flex;
  271. justify-content: center;
  272. align-items: center;
  273. cursor: pointer;
  274. img {
  275. width: 20px;
  276. height: 20px;
  277. }
  278. }
  279. .add-img {
  280. width: 560px;
  281. height: 325px;
  282. background: #ffffff;
  283. -webkit-box-shadow: 0px 2px 8px 0px rgba(31, 36, 41, 0.06);
  284. box-shadow: 0px 2px 8px 0px rgba(31, 36, 41, 0.06);
  285. border-radius: 2px;
  286. border: 1px solid #e4e5e7;
  287. position: absolute;
  288. right: 77px;
  289. top: 93px;
  290. z-index: 2;
  291. }
  292. }
  293. }
  294. }
  295. }
  296. }
  297. }
  298. </style>
  299. <style lang="less">
  300. .el-table {
  301. th {
  302. background: rgba(248, 249, 250, 1);
  303. font-size: 12px;
  304. padding: 8px 0;
  305. color: #646a73;
  306. }
  307. td {
  308. font-size: 14px;
  309. color: #1f2429;
  310. padding: 8px 0;
  311. overflow: hidden;
  312. text-overflow: ellipsis;
  313. white-space: nowrap;
  314. }
  315. }
  316. </style>