index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <div class="detail-info">
  3. <div class="eq-top">
  4. <img src="./static/img/backIcon.jpg" alt="" @click="back">
  5. <span>返回 </span>
  6. </div>
  7. <div class="detail-content">
  8. <div class="content-top">
  9. <p>{{roomInfo.infos.RoomLocalName}}的详情</p>
  10. <div><Checkbox v-model="isData" label="只显示有数据的信息" name="type" @on-change="onChange"></Checkbox>只显示有数据的信息</div>
  11. </div>
  12. <hr>
  13. <div class="content-bottom">
  14. <div class="content-left">
  15. <div>
  16. <ul>
  17. <li v-for="(list,index) in mainInfo" :key='index' :class="{changeStyle:changeColor == index}"
  18. @click="change(index)"><a :href="`#${list.href}`">{{list.name}}</a></li>
  19. </ul>
  20. </div>
  21. </div>
  22. <div class="content-right" @scroll="handleScroll">
  23. <p id="baseInfo" class="group"><span></span>基本信息</p>
  24. <ul>
  25. <li><span>空间ID</span>{{roomInfo.infos.RoomID}}</li>
  26. <li><span>空间名称</span>{{roomInfo.infos.RoomName || '--'}}</li>
  27. <li><span>空间本地编码</span>{{roomInfo.infos.RoomLocalID || '--'}}</li>
  28. <li><span>空间本地名称</span>{{roomInfo.infos.RoomLocalName || '--'}}</li>
  29. <li><span>空间二维码图片</span><i v-if="roomInfo.infos.RoomQRCode" @click="lookAt">查看</i></li>
  30. <li><span>BIM模型中编码</span>{{roomInfo.infos.BIMID || '--'}}</li>
  31. <li><span>空间功能区类型</span>{{roomInfo.infos.RoomFuncType || '--'}}</li>
  32. <li><span>进深</span>{{roomInfo.infos.Depth || '--'}} m</li>
  33. <li><span>面宽</span>{{roomInfo.infos.Width || '--'}} m</li>
  34. <li><span>建筑面积</span>{{roomInfo.infos.BuildArea || '--'}} m²</li>
  35. <li><span>使用面积</span>{{roomInfo.infos.NetArea || '--'}} m²</li>
  36. <li><span>高度</span>{{roomInfo.infos.Height || '--'}} m</li>
  37. <li><span>配电容量</span>{{roomInfo.infos.ElecCap || '--'}} A</li>
  38. <li><span>备注文字</span>{{roomInfo.infos.Intro || '--'}}</li>
  39. </ul>
  40. <p id="lesseeInfo" class="group"><span></span>租户信息</p>
  41. <ul>
  42. <li><span>租赁业态类型</span>{{roomInfo.infos.TenantType || '--'}}</li>
  43. <li><span>所属租户</span>{{roomInfo.infos.Tenant || '--'}}</li>
  44. </ul>
  45. <p id="peoplesInfo" class="group"><span></span>人员信息</p>
  46. <ul>
  47. <li><span>空间常驻人数</span>{{roomInfo.infos.PermanentPeopleNum || '--'}}</li>
  48. <li><span>逐时流出人数</span>{{roomInfo.infos.OutPeopleFlow || '--'}}</li>
  49. </ul>
  50. <p id="enviromentInfo" class="group"><span></span>环境参数</p>
  51. <ul>
  52. <enviroment-params v-show="roomInfo" :roomInfo='roomInfo' :isShowChange='isShowChange'></enviroment-params>
  53. </ul>
  54. <p id="eneryInfo" class="group"><span></span>能耗信息</p>
  55. <ul style="min-height: 590px">
  56. <enery-params v-show="roomInfo" :roomInfo='roomInfo' :isShowChange='isShowChange'></enery-params>
  57. </ul>
  58. </div>
  59. </div>
  60. </div>
  61. <div class="mask-bg"></div>
  62. <div class="mask">
  63. <message-modal @close='close' :isQR="isQR"></message-modal>
  64. </div>
  65. </div>
  66. </template>
  67. <script>
  68. import enviromentParams from './EnvirmentParams'
  69. import eneryParams from './EneryParams'
  70. import messageModal from '../spread/MessageModal'
  71. // import { log } from 'util'
  72. export default {
  73. components: {
  74. enviromentParams,
  75. eneryParams,
  76. messageModal
  77. },
  78. mixins: [],
  79. props: {
  80. },
  81. data () {
  82. return {
  83. isData: false,
  84. changeColor: 0,
  85. isShowChange: false, // 控制表格是否显示没数据的那一行
  86. roomInfo: {
  87. infos: {
  88. RoomLocalName: '--',
  89. RoomLocalID: '--',
  90. RoomQRCode: '--',
  91. BIMID: '--',
  92. RoomFuncType: '--',
  93. BIMLocation: '--',
  94. Depth: '--',
  95. Width: '--',
  96. Height: '--',
  97. BuildArea: '--',
  98. NetArea: '--',
  99. ElecCap: '--',
  100. TenantType: '--',
  101. Tenant: '--'
  102. },
  103. location: {
  104. building: '--',
  105. floor: '--'
  106. }
  107. },
  108. isQR: "",
  109. mainInfo: [
  110. {name: "基本信息", href: "baseInfo"},
  111. {name: "租户信息", href: "lesseeInfo"},
  112. {name: "人员信息", href: "peoplesInfo"},
  113. {name: "环境参数", href: "enviromentInfo"},
  114. {name: "能耗信息", href: 'eneryInfo'}
  115. ],
  116. groups: [],
  117. box: null // 滚动盒子
  118. }
  119. },
  120. computed: {
  121. },
  122. mounted () {
  123. this.getRouteParams()
  124. this.$nextTick(() => {
  125. this.box = document.querySelector(".content-right")
  126. this.groups = document.querySelectorAll(".content-right .group")
  127. })
  128. },
  129. methods: {
  130. // 滚动触发事件
  131. handleScroll () {
  132. let top = this.box.scrollTop
  133. let i = this.groups.length - 1
  134. for (; i >= 0; i--) {
  135. if (this.groups[i].offsetTop <= top) {
  136. this.changeColor = i
  137. break
  138. }
  139. }
  140. },
  141. change (index) {
  142. this.changeColor = index
  143. },
  144. back () {
  145. history.go(-1)
  146. },
  147. // 接受来自父组件路由传过来的参数
  148. getRouteParams () {
  149. this.roomInfo = JSON.parse(this.$route.query.obj)
  150. },
  151. // 下载弹框
  152. lookAt () {
  153. this.isQR = this.roomInfo.infos.RoomQRCode
  154. document.querySelector('body').style.overflow = 'hidden'
  155. document.querySelector('.mask-bg').style.display = 'block'
  156. document.querySelector('.mask').style.display = 'block'
  157. },
  158. close () {
  159. document.querySelector('body').style.overflow = 'auto'
  160. document.querySelector('.mask-bg').style.display = 'none'
  161. document.querySelector('.mask').style.display = 'none'
  162. },
  163. onChange (val) {
  164. if (val) {
  165. this.hiddenNoData()
  166. } else {
  167. this.showAllData()
  168. }
  169. },
  170. hiddenNoData () {
  171. this.isShowChange = true
  172. let arr = document.querySelectorAll('.content-right li')
  173. arr.forEach(i => {
  174. if (i.innerHTML.includes('--')) {
  175. i.style.display = 'none'
  176. }
  177. })
  178. },
  179. // 只显示有数据的
  180. showAllData () {
  181. this.isShowChange = false
  182. let arr = document.querySelectorAll('.content-right li')
  183. arr.forEach(i => {
  184. i.style.display = 'block'
  185. })
  186. }
  187. }
  188. }
  189. </script>
  190. <style scoped lang="less" >
  191. .detail-info {
  192. .eq-top {
  193. margin-bottom: 20px;
  194. margin-left: 20px;
  195. font-size: 7px;
  196. color: #212830;
  197. >img {
  198. //vertical-align: middle;
  199. cursor: pointer;
  200. border: 1px solid #CACACA;
  201. border-radius: 2px;
  202. }
  203. >span {
  204. font-size: 16px;
  205. color: #212830;
  206. }
  207. }
  208. .detail-content {
  209. box-shadow: 0 2px 10px 0 rgba(44,48,62,0.06);
  210. border-radius: 2px;
  211. background: #fff;
  212. padding-left:20px;
  213. .content-top {
  214. p {
  215. font-size: 18px;
  216. color: #212830;
  217. font-weight: bold;
  218. padding: 24px 0 20px 0;
  219. }
  220. }
  221. hr {
  222. margin-bottom: 0;
  223. }
  224. .content-bottom {
  225. padding-left: 10px;
  226. display: flex;
  227. margin-bottom: 20px;
  228. .content-left {
  229. width: 264px;
  230. border-radius: 2px;
  231. margin-right: 70px;
  232. padding-top: 10px;
  233. background: #FAFAFA;
  234. margin-bottom: 20px;
  235. div {
  236. li{
  237. font-size: 16px;
  238. padding:8px 0 8px 40px;
  239. font-weight: bold;
  240. cursor: pointer;
  241. &:hover {
  242. color:#6682E6;
  243. background: #fff;
  244. }
  245. a {
  246. color: #212830;
  247. &:hover {
  248. color:#6682E6;
  249. background: #fff;
  250. }
  251. }
  252. }
  253. }
  254. .active{
  255. color:#6682E6;
  256. background: #fff;
  257. }
  258. }
  259. .content-right {
  260. width: 1450px;
  261. height: 700px;
  262. overflow-y:auto;
  263. padding-top: 10px;
  264. position: relative;
  265. p {
  266. span {
  267. display: inline-block;
  268. width: 4px;
  269. height: 16px;
  270. background: #728DEE;
  271. margin-right: 10px;
  272. margin-bottom: -3px;
  273. }
  274. }
  275. ul {
  276. display: flex;
  277. flex-wrap: wrap;
  278. margin-left: 10px;
  279. margin-top: 20px;
  280. li {
  281. width: 50%;
  282. padding-bottom: 15px;
  283. overflow: hidden;
  284. text-overflow: ellipsis;
  285. white-space: nowrap;
  286. span {
  287. font-size: 14px;
  288. color: #6D747C;
  289. display: inline-block;
  290. width: 98px;
  291. margin-right: 20px;
  292. }
  293. i{
  294. color:#6682E6;
  295. cursor: pointer;
  296. }
  297. }
  298. }
  299. }
  300. }
  301. }
  302. .mask-bg{
  303. position: fixed;
  304. top: 0;
  305. bottom: 0;
  306. left: 0;
  307. right: 0;
  308. z-index: 99;
  309. background:rgba(0, 0, 0, .6);
  310. display: none;
  311. }
  312. .mask {
  313. width: 860px;
  314. height: 458px;
  315. background: #fff;
  316. position: fixed;
  317. z-index: 999;
  318. top: 120px;
  319. left: 30%;
  320. display: none;
  321. }
  322. .changeStyle{
  323. color: #6682E6!important;
  324. background: #fff;
  325. >a{
  326. color: #6682E6!important;
  327. }
  328. }
  329. }
  330. </style>
  331. <style lang="less">
  332. .detail-info {
  333. .ivu-table-wrapper {
  334. border: none;
  335. }
  336. .ivu-table td,
  337. .ivu-table th {
  338. border: none;
  339. }
  340. .ivu-table:before{
  341. height: 0;
  342. }
  343. .ivu-table:after{
  344. width:0;
  345. }
  346. .ivu-table-row .description-td>.ivu-table-cell>span{
  347. // overflow: hidden;
  348. // text-overflow: ellipsis;
  349. // white-space: nowrap;
  350. max-height: 100px;
  351. display: inline-block;
  352. }
  353. }
  354. </style>