index.vue 11 KB

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