index.vue 11 KB

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