【前端】智能库房综合管理系统前端项目
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.

644 lines
19 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. <!-- 门禁记录 -->
  89. <security-door :height="'calc(100% - 38px)'" />
  90. </div>
  91. <div class="env-main-middle">
  92. <div class="env-3d">
  93. <iframe
  94. id="myIframe"
  95. ref="myIframe"
  96. name="iframeMap"
  97. class="iframe_box"
  98. src="/webA/index.html"
  99. frameborder="0"
  100. scrolling="no"
  101. />
  102. <ul class="screen-env-list">
  103. <li>
  104. <svg-icon icon-class="temperature" class-name="msg-list-svg" />
  105. <div class="msg-txt">
  106. <span class="msg-list-num">60</span>
  107. <p class="msg-list-unit">温度</p>
  108. </div>
  109. </li>
  110. <li class="li-warn">
  111. <svg-icon icon-class="shidu" class-name="msg-list-svg" />
  112. <div class="msg-txt">
  113. <span class="msg-list-num">60</span>
  114. <p class="msg-list-unit">湿度%</p>
  115. </div>
  116. </li>
  117. </ul>
  118. </div>
  119. <div class="env-item container-wrap device-container">
  120. <span class="right-top-line" />
  121. <span class="left-bottom-line" />
  122. <h3><i class="iconfont icon-shebeizhuangtai" />设备状态</h3>
  123. <div class="state-list">
  124. <span>正常</span>
  125. <span>报警</span>
  126. </div>
  127. <ul class="env-device-list">
  128. <li class="device-warn">
  129. <div class="env-device-img">
  130. <img src="~@/assets/images/largeScreen/device-1.png" alt="">
  131. </div>
  132. <div class="env-device-text">
  133. <p>密集架</p>
  134. <span />
  135. </div>
  136. </li>
  137. <li>
  138. <div class="env-device-img">
  139. <img src="~@/assets/images/largeScreen/device-2.png" alt="">
  140. </div>
  141. <div class="env-device-text">
  142. <p>回转柜</p>
  143. <span />
  144. </div>
  145. </li>
  146. <li>
  147. <div class="env-device-img">
  148. <img src="~@/assets/images/largeScreen/device-3.png" alt="">
  149. </div>
  150. <div class="env-device-text">
  151. <p>空调</p>
  152. <span />
  153. </div>
  154. </li>
  155. <li>
  156. <div class="env-device-img">
  157. <img src="~@/assets/images/largeScreen/device-4.png" alt="">
  158. </div>
  159. <div class="env-device-text">
  160. <p>通道门</p>
  161. <span />
  162. </div>
  163. </li>
  164. <li>
  165. <div class="env-device-img">
  166. <img src="~@/assets/images/largeScreen/device-5.png" alt="">
  167. </div>
  168. <div class="env-device-text">
  169. <p>漏水传感器</p>
  170. <span />
  171. </div>
  172. </li>
  173. <li>
  174. <div class="env-device-img">
  175. <img src="~@/assets/images/largeScreen/device-6.png" alt="">
  176. </div>
  177. <div class="env-device-text">
  178. <p>温湿度传感器</p>
  179. <span />
  180. </div>
  181. </li>
  182. </ul>
  183. </div>
  184. </div>
  185. <div class="env-main-right">
  186. <div class="env-item container-wrap">
  187. <span class="right-top-line" />
  188. <span class="left-bottom-line" />
  189. <h3><i class="iconfont icon-zhenglishi" />阅览室</h3>
  190. <LineChart :class-name="className[0]" :chart-data="lineChartData.readRoomData" />
  191. </div>
  192. <div class="env-item container-wrap">
  193. <span class="right-top-line" />
  194. <span class="left-bottom-line" />
  195. <h3><i class="iconfont icon-zhenglishi" />整理室</h3>
  196. <LineChart :class-name="className[1]" :chart-data="lineChartData.collateRoomData" />
  197. </div>
  198. <!-- 报警记录 -->
  199. <warehouse-warning :height="'calc(100% - 38px)'" />
  200. </div>
  201. </div>
  202. <!-- 摄像头视频 -->
  203. <Video ref="camera" />
  204. </div>
  205. </template>
  206. <script>
  207. import { getCurrentTime } from '@/utils/index'
  208. import LineChart from './module/lineChart'
  209. import Video from '@/views/storeManage/warehouse3D/module/video'
  210. import data1 from './data1.json'
  211. import WarehouseWarning from '@/views/components/WarehouseWarning'
  212. import SecurityDoor from '@/views/components/SecurityDoor'
  213. const lineChartData = {
  214. readRoomData: {
  215. temperatureData: [16, 12, 15, 11, 20, 16, 15, 22],
  216. humidnessData: [10, 50, 40, 60, 50, 30, 15, 30]
  217. },
  218. collateRoomData: {
  219. temperatureData: [16, 12, 15, 11, 20, 16, 15, 22],
  220. humidnessData: [10, 50, 40, 60, 50, 30, 15, 30]
  221. }
  222. }
  223. export default {
  224. name: 'EnvironmentalScreen',
  225. components: {
  226. WarehouseWarning,
  227. SecurityDoor,
  228. LineChart,
  229. Video
  230. },
  231. data() {
  232. return {
  233. nowDate: '',
  234. timer: null,
  235. tableData: [],
  236. lineChartData: lineChartData,
  237. className: ['readRoomContainer', 'collateRoomContainer']
  238. }
  239. },
  240. created() {
  241. this.timer = setInterval(() => {
  242. this.nowDate = getCurrentTime()
  243. }, 1000)
  244. window.getIframeLoading = this.getIframeLoading // 把vue实例中的方法引用给window对象
  245. },
  246. mounted() {
  247. this.tableData = data1.rows
  248. const _this = this
  249. this.iframeWin = this.$refs.myIframe.contentWindow
  250. // inframe 加载完成之后
  251. document.getElementById('myIframe').onload = function() {
  252. _this.deviceState()
  253. }
  254. window.addEventListener('message', this.handleMessageDevice)
  255. },
  256. beforeDestroy() {
  257. if (this.timer) {
  258. clearInterval(this.timer)
  259. }
  260. },
  261. methods: {
  262. // 加载完成状态传值
  263. getIframeLoading(value) {
  264. // console.log(`我是iframe传过来的参数:${value}`)
  265. if (value === 'false') {
  266. this.handleHide('DAK_MO_OAO_001')
  267. this.handleAlarm('DAK_MO_OAO_003')
  268. }
  269. },
  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. max-width: 24%;
  363. flex: 1;
  364. height: calc(100vh - 138px);
  365. overflow: hidden;
  366. }
  367. .env-main-middle{
  368. flex: 1;
  369. margin: 0 20px;
  370. height: calc(100vh - 138px);
  371. }
  372. .container-wrap{
  373. height: calc(100%/3 - 14px);
  374. min-height: auto;
  375. }
  376. .env-item {
  377. margin-bottom: 20px;
  378. text-align: center;
  379. h3{
  380. position: relative;
  381. display: inline-block;
  382. padding: 10px 70px;
  383. font-size: 16px;
  384. color: #fff;
  385. .iconfont{
  386. margin-right: 10px;
  387. font-size: 14px;
  388. color: #F65163;
  389. }
  390. &::before{
  391. content: "";
  392. position: absolute;
  393. left: 0;
  394. top: 50%;
  395. width: 36px;
  396. height: 12px;
  397. margin-top: -6px;
  398. background: url('~@/assets/images/largeScreen/item-left.png') no-repeat;
  399. background-size: cover;
  400. }
  401. &::after{
  402. content: "";
  403. position: absolute;
  404. top: 50%;
  405. right: 0;
  406. width: 36px;
  407. height: 12px;
  408. margin-top: -6px;
  409. background: url('~@/assets/images/largeScreen/item-right.png') no-repeat;
  410. background-size: cover;
  411. }
  412. }
  413. }
  414. .screen-env-list{
  415. flex-wrap: wrap;
  416. justify-content: space-between;
  417. height: calc(100% - 38px);
  418. padding: 0 44px 0 4px;
  419. li{
  420. flex: none;
  421. width: calc(100%/2 - 44px);
  422. margin: 20px 0 20px 40px;
  423. height: calc(100%/2 - 40px);
  424. .msg-list-svg{
  425. font-size: 40px;
  426. margin-left: 20px;
  427. }
  428. &.msg-pm{
  429. .msg-list-svg{
  430. font-size: 46px;
  431. }
  432. }
  433. }
  434. }
  435. .leakage-detection{
  436. padding: 0 44px;
  437. font-size: 14px;
  438. color: #339CFF;
  439. height: calc(100% - 38px);
  440. .leakage-list{
  441. height: calc(100% - 26px);
  442. text-align: left;
  443. li{
  444. position: relative;
  445. display: flex;
  446. justify-content: space-between;
  447. align-items: center;
  448. height: calc(100%/4 - 14px);
  449. margin-bottom: 14px;
  450. padding: 0 30px;
  451. border: 1px solid #3581CC;
  452. background-color: #02255F;
  453. border-radius: 2px;
  454. &::before{
  455. content: "";
  456. position: absolute;
  457. top: 4px;
  458. left: 4px;
  459. width: 0;
  460. height: 0;
  461. border-color: transparent #339CFF;
  462. border-width: 0 0 6px 6px;
  463. border-style: solid;
  464. }
  465. p{
  466. i{
  467. margin-right: 8px;
  468. }
  469. }
  470. span.leakage-state-tip{
  471. position: relative;
  472. display: block;
  473. width: 6px;
  474. height: 6px;
  475. border-radius: 50%;
  476. background-color: #18B08F;
  477. &::before{
  478. content: "";
  479. position: absolute;
  480. left: 50%;
  481. top: 50%;
  482. width: 14px;
  483. height: 14px;
  484. border-radius: 50%;
  485. box-shadow: inset 0px 0px 10px 1px #18B08F;
  486. transform: translate(-50%,-50%);
  487. }
  488. }
  489. &.leakage-warn{
  490. border-color: #F65164;
  491. box-shadow: inset 0px 0px 15px 1px #F65164;
  492. color: #F65164;
  493. &::before{
  494. border-color: transparent #F65164;
  495. }
  496. span.leakage-state-tip{
  497. background-color: #F65164;
  498. &::before{
  499. box-shadow: inset 0px 0px 10px 1px #F65164;
  500. }
  501. }
  502. }
  503. }
  504. }
  505. }
  506. .state-list{
  507. display: flex;
  508. justify-content: flex-end;
  509. margin-bottom: 10px;
  510. font-size: 14px;
  511. color: #339CFF;
  512. span{
  513. position: relative;
  514. display: block;
  515. padding-left: 16px;
  516. margin-left: 30px;
  517. &::before{
  518. content: "";
  519. position: absolute;
  520. left: 0;
  521. top: 50%;
  522. width: 10px;
  523. height: 10px;
  524. border-radius: 50%;
  525. margin-top: -5px;
  526. background-color: #18B08F;
  527. }
  528. &:last-child::before{
  529. background-color:#F65164;
  530. }
  531. }
  532. }
  533. .device-container{
  534. position: relative;
  535. .state-list{
  536. position: absolute;
  537. right: 40px;
  538. top: 12px;
  539. }
  540. .env-device-list{
  541. display: flex;
  542. height: calc(100% - 38px);
  543. justify-content: space-between;
  544. padding: 0 0 20px 20px;
  545. li{
  546. width: calc(100%/6 - 20px);
  547. margin-right: 20px;
  548. .env-device-img{
  549. display: flex;
  550. align-items: center;
  551. justify-content: center;
  552. height: calc(100% - 40px);
  553. border: 1px solid #3581CC;
  554. margin-bottom: 10px;
  555. img{
  556. display: block;
  557. // height: 100%;
  558. // object-fit: contain;
  559. }
  560. }
  561. .env-device-text{
  562. position: relative;
  563. display: flex;
  564. justify-content: center;
  565. align-items: center;
  566. height: 36px;
  567. line-height: 36px;
  568. font-size: 14px;
  569. color: #339CFF;
  570. border: 1px solid #3581CC;
  571. background-color: #02255F;
  572. border-radius: 36px;
  573. span{
  574. position: relative;
  575. // position: absolute;
  576. // right: 8px;
  577. // top: 50%;
  578. // margin-top: -3px;
  579. display: block;
  580. width: 6px;
  581. height: 6px;
  582. margin-left: 14px;
  583. border-radius: 50%;
  584. background-color: #18B08F;
  585. &::before{
  586. content: "";
  587. position: absolute;
  588. left: 50%;
  589. top: 50%;
  590. width: 14px;
  591. height: 14px;
  592. border-radius: 50%;
  593. box-shadow: inset 0px 0px 10px 1px #18B08F;
  594. transform: translate(-50%,-50%);
  595. }
  596. }
  597. }
  598. &.device-warn{
  599. .env-device-text{
  600. span{
  601. background-color: #F65164;
  602. &::before{
  603. box-shadow: inset 0px 0px 10px 1px #F65164;
  604. }
  605. }
  606. }
  607. }
  608. }
  609. }
  610. }
  611. .env-3d{
  612. position: relative;
  613. width: 100%;
  614. height: calc(100% - (100%/3) - 8px);
  615. margin-bottom: 20px;
  616. background: url('~@/assets/images/largeScreen/bg.png') no-repeat center -130px;
  617. // background-size: 100% 100%;
  618. overflow: hidden;
  619. .iframe_box{
  620. width: 100%;
  621. height: 100%;
  622. margin-left: -80px;
  623. }
  624. .screen-env-list{
  625. position: absolute;
  626. right: 0;
  627. bottom: 0;
  628. flex-wrap: wrap;
  629. justify-content: space-between;
  630. padding: 0;
  631. width: 165px;
  632. height: 200px;
  633. li{
  634. width: 100%;
  635. margin: 20px 0 0 0;
  636. height: calc(100%/2 - 20px);
  637. }
  638. }
  639. }
  640. }
  641. }
  642. </style>