【前端】智能库房综合管理系统前端项目
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

635 lines
18 KiB

3 years ago
  1. <template>
  2. <div class="env-container">
  3. <div class="env-top-title" />
  4. <div class="current-date">{{ nowDate }}</div>
  5. <div class="env-main">
  6. <div class="env-main-left">
  7. <div class="env-item container-wrap">
  8. <span class="right-top-line" />
  9. <span class="left-bottom-line" />
  10. <h3><i class="iconfont icon-kongqizhiliangshuju" />档案库空气质量数据</h3>
  11. <ul class="screen-env-list">
  12. <li>
  13. <svg-icon icon-class="co2" class-name="msg-list-svg" />
  14. <div class="msg-txt">
  15. <span class="msg-list-num">60</span>
  16. <p class="msg-list-unit">CO2ppm</p>
  17. </div>
  18. </li>
  19. <li>
  20. <svg-icon icon-class="voc" class-name="msg-list-svg" />
  21. <div class="msg-txt">
  22. <span class="msg-list-num">60</span>
  23. <p class="msg-list-unit">VOCmg/m³</p>
  24. </div>
  25. </li>
  26. <li class="msg-pm li-warn">
  27. <svg-icon icon-class="pm25" class-name="msg-list-svg" />
  28. <div class="msg-txt">
  29. <span class="msg-list-num">60</span>
  30. <p class="msg-list-unit">PM2.5ug/m³</p>
  31. </div>
  32. </li>
  33. <li class="msg-pm">
  34. <svg-icon icon-class="pm10" class-name="msg-list-svg" />
  35. <div class="msg-txt">
  36. <span class="msg-list-num">60</span>
  37. <p class="msg-list-unit">PM10ug/m³</p>
  38. </div>
  39. </li>
  40. </ul>
  41. </div>
  42. <div class="env-item container-wrap">
  43. <span class="right-top-line" />
  44. <span class="left-bottom-line" />
  45. <h3><i class="iconfont icon-loushuijiance" />漏水检测</h3>
  46. <div class="leakage-detection">
  47. <div class="state-list">
  48. <span>正常</span>
  49. <span>报警</span>
  50. </div>
  51. <ul class="leakage-list">
  52. <li class="leakage-warn">
  53. <p><i class="iconfont icon-weihubaojing" />维护报警</p>
  54. <span class="leakage-state-tip" />
  55. </li>
  56. <li>
  57. <p><i class="iconfont icon-loushuibaojing" />漏水报警</p>
  58. <span class="leakage-state-tip" />
  59. </li>
  60. <li>
  61. <p><i class="iconfont icon-ganyingxianduanlie" />感应线断裂</p>
  62. <span class="leakage-state-tip" />
  63. </li>
  64. <li>
  65. <p><i class="iconfont icon-loushuiweizhi" />漏水位置</p>
  66. <span>8.22</span>
  67. </li>
  68. </ul>
  69. </div>
  70. </div>
  71. <div class="env-item container-wrap">
  72. <span class="right-top-line" />
  73. <span class="left-bottom-line" />
  74. <h3><i class="iconfont icon-menjinjilu" />门禁记录</h3>
  75. <el-table
  76. ref="table"
  77. style="min-width: 100%;"
  78. height="calc(100% - 38px)"
  79. :data="tableData"
  80. class="warehose-el-table"
  81. :row-class-name="rowBgColor"
  82. >
  83. <el-table-column prop="time" label="时间" align="center" min-width="60" />
  84. <el-table-column prop="warehouse" label="库房" align="center" min-width="60" />
  85. <el-table-column prop="name" label="档案名称" align="center" :show-overflow-tooltip="true" min-width="85" />
  86. </el-table>
  87. </div>
  88. </div>
  89. <div class="env-main-middle">
  90. <div class="env-3d">
  91. <iframe
  92. id="myIframe"
  93. ref="myIframe"
  94. name="iframeMap"
  95. class="iframe_box"
  96. src="/webA/index.html"
  97. frameborder="0"
  98. scrolling="no"
  99. />
  100. <ul class="screen-env-list">
  101. <li>
  102. <svg-icon icon-class="temperature" class-name="msg-list-svg" />
  103. <div class="msg-txt">
  104. <span class="msg-list-num">60</span>
  105. <p class="msg-list-unit">温度</p>
  106. </div>
  107. </li>
  108. <li class="li-warn">
  109. <svg-icon icon-class="shidu" class-name="msg-list-svg" />
  110. <div class="msg-txt">
  111. <span class="msg-list-num">60</span>
  112. <p class="msg-list-unit">湿度%</p>
  113. </div>
  114. </li>
  115. </ul>
  116. </div>
  117. <div class="env-item container-wrap device-container">
  118. <span class="right-top-line" />
  119. <span class="left-bottom-line" />
  120. <h3><i class="iconfont icon-shebeizhuangtai" />设备状态</h3>
  121. <div class="state-list">
  122. <span>正常</span>
  123. <span>报警</span>
  124. </div>
  125. <ul class="env-device-list">
  126. <li class="device-warn">
  127. <div class="env-device-img">
  128. <img src="~@/assets/images/largeScreen/device-1.png" alt="">
  129. </div>
  130. <div class="env-device-text">
  131. <p>密集架</p>
  132. <span />
  133. </div>
  134. </li>
  135. <li>
  136. <div class="env-device-img">
  137. <img src="~@/assets/images/largeScreen/device-2.png" alt="">
  138. </div>
  139. <div class="env-device-text">
  140. <p>回转柜</p>
  141. <span />
  142. </div>
  143. </li>
  144. <li>
  145. <div class="env-device-img">
  146. <img src="~@/assets/images/largeScreen/device-3.png" alt="">
  147. </div>
  148. <div class="env-device-text">
  149. <p>空调</p>
  150. <span />
  151. </div>
  152. </li>
  153. <li>
  154. <div class="env-device-img">
  155. <img src="~@/assets/images/largeScreen/device-4.png" alt="">
  156. </div>
  157. <div class="env-device-text">
  158. <p>通道门</p>
  159. <span />
  160. </div>
  161. </li>
  162. <li>
  163. <div class="env-device-img">
  164. <img src="~@/assets/images/largeScreen/device-5.png" alt="">
  165. </div>
  166. <div class="env-device-text">
  167. <p>漏水传感器</p>
  168. <span />
  169. </div>
  170. </li>
  171. <li>
  172. <div class="env-device-img">
  173. <img src="~@/assets/images/largeScreen/device-6.png" alt="">
  174. </div>
  175. <div class="env-device-text">
  176. <p>温湿度传感器</p>
  177. <span />
  178. </div>
  179. </li>
  180. </ul>
  181. </div>
  182. </div>
  183. <div class="env-main-right">
  184. <div class="env-item container-wrap">
  185. <span class="right-top-line" />
  186. <span class="left-bottom-line" />
  187. <h3><i class="iconfont icon-zhenglishi" />阅览室</h3>
  188. <LineChart :class-name="className[0]" :chart-data="lineChartData.readRoomData" />
  189. </div>
  190. <div class="env-item container-wrap">
  191. <span class="right-top-line" />
  192. <span class="left-bottom-line" />
  193. <h3><i class="iconfont icon-zhenglishi" />整理室</h3>
  194. <LineChart :class-name="className[1]" :chart-data="lineChartData.collateRoomData" />
  195. </div>
  196. <div class="env-item container-wrap">
  197. <span class="right-top-line" />
  198. <span class="left-bottom-line" />
  199. <h3><i class="iconfont icon-baojingjilu" />报警记录</h3>
  200. <el-table
  201. ref="table"
  202. style="min-width: 100%;"
  203. height="calc(100% - 38px)"
  204. :data="tableData"
  205. class="warehose-el-table"
  206. :row-class-name="rowBgColor"
  207. >
  208. <el-table-column prop="time" label="时间" align="center" min-width="60" />
  209. <el-table-column prop="warehouse" label="库房" align="center" min-width="60" />
  210. <el-table-column prop="warning" label="警情" align="center" :show-overflow-tooltip="true" min-width="85" />
  211. </el-table>
  212. </div>
  213. </div>
  214. </div>
  215. <!-- 摄像头视频 -->
  216. <Video ref="camera" />
  217. </div>
  218. </template>
  219. <script>
  220. import { getCurrentTime } from '@/utils/index'
  221. import LineChart from './module/lineChart'
  222. import Video from '@/views/storeManage/warehouse3D/module/video'
  223. import data1 from './data1.json'
  224. const lineChartData = {
  225. readRoomData: {
  226. temperatureData: [16, 12, 15, 11, 20, 16, 15, 22],
  227. humidnessData: [10, 50, 40, 60, 50, 30, 15, 30]
  228. },
  229. collateRoomData: {
  230. temperatureData: [16, 12, 15, 11, 20, 16, 15, 22],
  231. humidnessData: [10, 50, 40, 60, 50, 30, 15, 30]
  232. }
  233. }
  234. export default {
  235. name: 'Dashboard',
  236. components: {
  237. LineChart,
  238. Video
  239. },
  240. data() {
  241. return {
  242. nowDate: '',
  243. timer: null,
  244. tableData: [],
  245. lineChartData: lineChartData,
  246. className: ['readRoomContainer', 'collateRoomContainer']
  247. }
  248. },
  249. created() {
  250. this.timer = setInterval(() => {
  251. this.nowDate = getCurrentTime()
  252. }, 1000)
  253. },
  254. mounted() {
  255. this.tableData = data1.rows
  256. const _this = this
  257. this.iframeWin = this.$refs.myIframe.contentWindow
  258. // inframe 加载完成之后
  259. document.getElementById('myIframe').onload = function() {
  260. _this.deviceState()
  261. }
  262. window.addEventListener('message', this.handleMessageDevice)
  263. },
  264. beforeDestroy() {
  265. if (this.timer) {
  266. clearInterval(this.timer)
  267. }
  268. },
  269. methods: {
  270. // 传入设备状态data / 给iframe传初始值
  271. deviceState(e) {
  272. this.iframeWin.postMessage({
  273. data: [
  274. {
  275. id: 'DAK_MO_OAO_001',
  276. wendu: 6,
  277. sidu: 10,
  278. alarmState: false
  279. },
  280. {
  281. id: 'DAK_MO_OAO_002',
  282. wendu: 2,
  283. sidu: 5,
  284. alarmState: false
  285. },
  286. {
  287. id: 'DAK_MO_OAO_003',
  288. wendu: 3,
  289. sidu: 1,
  290. alarmState: false
  291. },
  292. {
  293. id: 'DAK_MO_OAO_004',
  294. wendu: 6,
  295. sidu: 6,
  296. alarmState: false
  297. }
  298. ]
  299. }, '*')
  300. },
  301. // 点击查看设备状况 / 密集架列号
  302. handleMessageDevice(event) {
  303. const _this = this
  304. if (event.data && event.data.data) {
  305. const data = event.data.data
  306. // 摄像头
  307. if (data.includes('CAM')) {
  308. _this.$nextTick(() => {
  309. this.$refs.camera.openVideoVisible = true
  310. // 后期看接口调试变化
  311. this.$refs.camera.videoSrc = 'https://qiniu.aiyxlib.com/1606275873000.mp4'
  312. this.$refs.camera.videoTitle = data
  313. })
  314. }
  315. }
  316. },
  317. // 设置温湿度
  318. handleAQI(deviceId, wendu, sidu) {
  319. window.frames['iframeMap'].setAlertValue(deviceId, wendu, sidu)
  320. },
  321. // 设置温湿度报警状况
  322. handleAlarm(deviceId) {
  323. window.frames['iframeMap'].Myalert(deviceId, true)
  324. },
  325. // 表格隔行变色
  326. rowBgColor({ row, rowIndex }) {
  327. if (rowIndex % 2 === 1) {
  328. return 'light-blue'
  329. } else {
  330. return ''
  331. }
  332. }
  333. }
  334. }
  335. </script>
  336. <style rel="stylesheet/scss" lang="scss" scoped>
  337. @import '~@/assets/styles/lend-manage.scss';
  338. .env-container{
  339. width: 100%;
  340. height: calc(100vh);
  341. background-color: #031435;
  342. .env-top-title{
  343. width: calc(100vw);
  344. height: 130px;
  345. background: url('~@/assets/images/largeScreen/top-title.png') no-repeat 0 -14px;
  346. background-size: contain;
  347. }
  348. .current-date{
  349. position: fixed;
  350. top: 25px;
  351. right: 150px;
  352. font-size: 16px;
  353. color: #3A99FD;
  354. }
  355. .env-main{
  356. display: flex;
  357. justify-content: space-between;
  358. padding: 0 25px;
  359. margin-top: -12px;
  360. .env-main-left,
  361. .env-main-right{
  362. width: 458px;
  363. height: calc(100vh - 138px);
  364. overflow: hidden;
  365. }
  366. .env-main-middle{
  367. flex: 1;
  368. margin: 0 20px;
  369. height: calc(100vh - 138px);
  370. }
  371. .container-wrap{
  372. height: calc(100%/3 - 14px);
  373. min-height: auto;
  374. }
  375. .env-item {
  376. margin-bottom: 20px;
  377. text-align: center;
  378. h3{
  379. position: relative;
  380. display: inline-block;
  381. padding: 10px 70px;
  382. font-size: 16px;
  383. color: #fff;
  384. .iconfont{
  385. margin-right: 10px;
  386. font-size: 14px;
  387. color: #F65163;
  388. }
  389. &::before{
  390. content: "";
  391. position: absolute;
  392. left: 0;
  393. top: 50%;
  394. width: 36px;
  395. height: 12px;
  396. margin-top: -6px;
  397. background: url('~@/assets/images/largeScreen/item-left.png') no-repeat;
  398. background-size: cover;
  399. }
  400. &::after{
  401. content: "";
  402. position: absolute;
  403. top: 50%;
  404. right: 0;
  405. width: 36px;
  406. height: 12px;
  407. margin-top: -6px;
  408. background: url('~@/assets/images/largeScreen/item-right.png') no-repeat;
  409. background-size: cover;
  410. }
  411. }
  412. }
  413. .screen-env-list{
  414. flex-wrap: wrap;
  415. justify-content: space-between;
  416. padding: 0 44px 0 4px;
  417. li{
  418. flex: none;
  419. width: calc(100%/2 - 44px);
  420. margin: 15px 0 0 40px;
  421. .msg-list-svg{
  422. font-size: 40px;
  423. margin-left: 20px;
  424. }
  425. &.msg-pm{
  426. .msg-list-svg{
  427. font-size: 46px;
  428. }
  429. }
  430. }
  431. }
  432. .leakage-detection{
  433. padding: 0 44px;
  434. font-size: 14px;
  435. color: #339CFF;
  436. margin-top: -3px;
  437. .leakage-list{
  438. text-align: left;
  439. li{
  440. position: relative;
  441. display: flex;
  442. justify-content: space-between;
  443. align-items: center;
  444. margin-bottom: 8px;
  445. padding: 9px 30px;
  446. border: 1px solid #3581CC;
  447. background-color: #02255F;
  448. border-radius: 2px;
  449. &::before{
  450. content: "";
  451. position: absolute;
  452. top: 4px;
  453. left: 4px;
  454. width: 0;
  455. height: 0;
  456. border-color: transparent #339CFF;
  457. border-width: 0 0 6px 6px;
  458. border-style: solid;
  459. }
  460. p{
  461. i{
  462. margin-right: 8px;
  463. }
  464. }
  465. span.leakage-state-tip{
  466. position: relative;
  467. display: block;
  468. width: 6px;
  469. height: 6px;
  470. border-radius: 50%;
  471. background-color: #18B08F;
  472. &::before{
  473. content: "";
  474. position: absolute;
  475. left: 50%;
  476. top: 50%;
  477. width: 14px;
  478. height: 14px;
  479. border-radius: 50%;
  480. box-shadow: inset 0px 0px 10px 1px #18B08F;
  481. transform: translate(-50%,-50%);
  482. }
  483. }
  484. &.leakage-warn{
  485. border-color: #F65164;
  486. box-shadow: inset 0px 0px 15px 1px #F65164;
  487. color: #F65164;
  488. &::before{
  489. border-color: transparent #F65164;
  490. }
  491. span.leakage-state-tip{
  492. background-color: #F65164;
  493. &::before{
  494. box-shadow: inset 0px 0px 10px 1px #F65164;
  495. }
  496. }
  497. }
  498. }
  499. }
  500. }
  501. .state-list{
  502. display: flex;
  503. justify-content: flex-end;
  504. margin-bottom: 6px;
  505. font-size: 14px;
  506. color: #339CFF;
  507. span{
  508. position: relative;
  509. display: block;
  510. padding-left: 16px;
  511. margin-left: 30px;
  512. &::before{
  513. content: "";
  514. position: absolute;
  515. left: 0;
  516. top: 50%;
  517. width: 10px;
  518. height: 10px;
  519. border-radius: 50%;
  520. margin-top: -5px;
  521. background-color: #18B08F;
  522. }
  523. &:last-child::before{
  524. background-color:#F65164;
  525. }
  526. }
  527. }
  528. .device-container{
  529. position: relative;
  530. .state-list{
  531. position: absolute;
  532. right: 40px;
  533. top: 12px;
  534. }
  535. .env-device-list{
  536. display: flex;
  537. height: calc(100% - 38px);
  538. justify-content: space-between;
  539. padding: 0 0 20px 20px;
  540. li{
  541. width: calc(100%/6 - 20px);
  542. margin-right: 20px;
  543. .env-device-img{
  544. display: flex;
  545. align-items: center;
  546. justify-content: center;
  547. height: calc(100% - 40px);
  548. border: 1px solid #3581CC;
  549. margin-bottom: 10px;
  550. img{
  551. object-fit: cover;
  552. }
  553. }
  554. .env-device-text{
  555. position: relative;
  556. display: flex;
  557. justify-content: center;
  558. align-items: center;
  559. height: 36px;
  560. line-height: 36px;
  561. font-size: 14px;
  562. color: #339CFF;
  563. border: 1px solid #3581CC;
  564. background-color: #02255F;
  565. border-radius: 36px;
  566. span{
  567. position: relative;
  568. // position: absolute;
  569. // right: 8px;
  570. // top: 50%;
  571. // margin-top: -3px;
  572. display: block;
  573. width: 6px;
  574. height: 6px;
  575. margin-left: 14px;
  576. border-radius: 50%;
  577. background-color: #18B08F;
  578. &::before{
  579. content: "";
  580. position: absolute;
  581. left: 50%;
  582. top: 50%;
  583. width: 14px;
  584. height: 14px;
  585. border-radius: 50%;
  586. box-shadow: inset 0px 0px 10px 1px #18B08F;
  587. transform: translate(-50%,-50%);
  588. }
  589. }
  590. }
  591. &.device-warn{
  592. .env-device-text{
  593. span{
  594. background-color: #F65164;
  595. &::before{
  596. box-shadow: inset 0px 0px 10px 1px #F65164;
  597. }
  598. }
  599. }
  600. }
  601. }
  602. }
  603. }
  604. .env-3d{
  605. position: relative;
  606. width: 100%;
  607. height: calc(100vh - (100%/2) - 14px);
  608. margin-bottom: 20px;
  609. background: url('~@/assets/images/largeScreen/bg.png') no-repeat center -130px;
  610. // background-size: 100% 100%;
  611. overflow: hidden;
  612. .iframe_box{
  613. width: 100%;
  614. height: 100%;
  615. margin-left: -80px;
  616. }
  617. .screen-env-list{
  618. position: absolute;
  619. right: 0;
  620. bottom: 0;
  621. flex-wrap: wrap;
  622. justify-content: space-between;
  623. padding: 0;
  624. width: 165px;
  625. li{
  626. width: 100%;
  627. margin: 20px 0 0 0;
  628. }
  629. }
  630. }
  631. }
  632. }
  633. </style>