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

656 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. <div class="chart-wrapper">
  191. <lend-across :lend-data="lendData" />
  192. </div>
  193. </div>
  194. <div class="env-item container-wrap">
  195. <span class="right-top-line" />
  196. <span class="left-bottom-line" />
  197. <h3><i class="iconfont icon-zhenglishi" />整理室</h3>
  198. <div v-if="typeData.length !== 0" class="chart-wrapper">
  199. <type-pie :type-data="typeData" />
  200. </div>
  201. <div v-else class="empty-main">
  202. <svg-icon icon-class="empty" class-name="empty-img" />
  203. <p>暂无数据</p>
  204. </div>
  205. </div>
  206. <!-- 报警记录 -->
  207. <warehouse-warning :height="'calc(100% - 38px)'" />
  208. </div>
  209. </div>
  210. <!-- 摄像头视频 -->
  211. <Video ref="camera" />
  212. </div>
  213. </template>
  214. <script>
  215. import { getCurrentTime } from '@/utils/index'
  216. import typePie from '@/views/components/echarts/typePie.vue'
  217. import lendAcross from '@/views/components/echarts/lendAcross.vue'
  218. import Video from '@/views/storeManage/warehouse3D/module/video'
  219. import data1 from './data1.json'
  220. import WarehouseWarning from '@/views/components/WarehouseWarning'
  221. import SecurityDoor from '@/views/components/SecurityDoor'
  222. const lineChartData = {
  223. readRoomData: {
  224. temperatureData: [16, 12, 15, 11, 20, 16, 15, 22],
  225. humidnessData: [10, 50, 40, 60, 50, 30, 15, 30]
  226. },
  227. collateRoomData: {
  228. temperatureData: [16, 12, 15, 11, 20, 16, 15, 22],
  229. humidnessData: [10, 50, 40, 60, 50, 30, 15, 30]
  230. }
  231. }
  232. export default {
  233. name: 'EnvironmentalScreen',
  234. components: {
  235. WarehouseWarning,
  236. SecurityDoor,
  237. Video,
  238. lendAcross,
  239. typePie
  240. },
  241. data() {
  242. return {
  243. nowDate: '',
  244. timer: null,
  245. tableData: [],
  246. lineChartData: lineChartData,
  247. lendData: [],
  248. typeData: [],
  249. className: ['readRoomContainer', 'collateRoomContainer']
  250. }
  251. },
  252. created() {
  253. this.timer = setInterval(() => {
  254. this.nowDate = getCurrentTime()
  255. }, 1000)
  256. window.getIframeLoading = this.getIframeLoading // 把vue实例中的方法引用给window对象
  257. },
  258. mounted() {
  259. this.tableData = data1.rows
  260. const _this = this
  261. this.iframeWin = this.$refs.myIframe.contentWindow
  262. // inframe 加载完成之后
  263. document.getElementById('myIframe').onload = function() {
  264. _this.deviceState()
  265. }
  266. window.addEventListener('message', this.handleMessageDevice)
  267. },
  268. beforeDestroy() {
  269. if (this.timer) {
  270. clearInterval(this.timer)
  271. }
  272. },
  273. methods: {
  274. // 加载完成状态传值
  275. getIframeLoading(value) {
  276. // console.log(`我是iframe传过来的参数:${value}`)
  277. if (value === 'false') {
  278. this.handleHide('DAK_MO_OAO_001')
  279. this.handleAlarm('DAK_MO_OAO_003')
  280. }
  281. },
  282. // 传入设备状态data / 给iframe传初始值
  283. deviceState(e) {
  284. this.iframeWin.postMessage({
  285. data: [
  286. {
  287. id: 'DAK_MO_OAO_001',
  288. wendu: 6,
  289. sidu: 10,
  290. alarmState: false
  291. },
  292. {
  293. id: 'DAK_MO_OAO_002',
  294. wendu: 2,
  295. sidu: 5,
  296. alarmState: false
  297. },
  298. {
  299. id: 'DAK_MO_OAO_003',
  300. wendu: 3,
  301. sidu: 1,
  302. alarmState: false
  303. },
  304. {
  305. id: 'DAK_MO_OAO_004',
  306. wendu: 6,
  307. sidu: 6,
  308. alarmState: false
  309. }
  310. ]
  311. }, '*')
  312. },
  313. // 点击查看设备状况 / 密集架列号
  314. handleMessageDevice(event) {
  315. const _this = this
  316. if (event.data && event.data.data) {
  317. const data = event.data.data
  318. // 摄像头
  319. if (data.includes('CAM')) {
  320. _this.$nextTick(() => {
  321. this.$refs.camera.openVideoVisible = true
  322. // 后期看接口调试变化
  323. this.$refs.camera.videoSrc = 'https://qiniu.aiyxlib.com/1606275873000.mp4'
  324. this.$refs.camera.videoTitle = data
  325. })
  326. }
  327. }
  328. },
  329. // 设置温湿度
  330. handleAQI(deviceId, wendu, sidu) {
  331. window.frames['iframeMap'].setAlertValue(deviceId, wendu, sidu)
  332. },
  333. // 设置温湿度报警状况
  334. handleAlarm(deviceId) {
  335. window.frames['iframeMap'].Myalert(deviceId, true)
  336. },
  337. // 表格隔行变色
  338. rowBgColor({ row, rowIndex }) {
  339. if (rowIndex % 2 === 1) {
  340. return 'light-blue'
  341. } else {
  342. return ''
  343. }
  344. }
  345. }
  346. }
  347. </script>
  348. <style rel="stylesheet/scss" lang="scss" scoped>
  349. @import '~@/assets/styles/lend-manage.scss';
  350. .env-container{
  351. width: 100%;
  352. height: calc(100vh);
  353. background-color: #031435;
  354. .env-top-title{
  355. width: calc(100vw);
  356. height: 130px;
  357. background: url('~@/assets/images/largeScreen/top-title.png') no-repeat 0 -14px;
  358. background-size: contain;
  359. }
  360. .current-date{
  361. position: fixed;
  362. top: 25px;
  363. right: 150px;
  364. font-size: 16px;
  365. color: #3A99FD;
  366. }
  367. .env-main{
  368. display: flex;
  369. justify-content: space-between;
  370. padding: 0 25px;
  371. margin-top: -12px;
  372. .env-main-left,
  373. .env-main-right{
  374. max-width: 24%;
  375. flex: 1;
  376. height: calc(100vh - 138px);
  377. overflow: hidden;
  378. }
  379. .env-main-middle{
  380. flex: 1;
  381. margin: 0 20px;
  382. height: calc(100vh - 138px);
  383. }
  384. .container-wrap{
  385. height: calc(100%/3 - 14px);
  386. min-height: auto;
  387. }
  388. .env-item {
  389. margin-bottom: 20px;
  390. text-align: center;
  391. h3{
  392. position: relative;
  393. display: inline-block;
  394. padding: 10px 70px;
  395. font-size: 16px;
  396. color: #fff;
  397. .iconfont{
  398. margin-right: 10px;
  399. font-size: 14px;
  400. color: #F65163;
  401. }
  402. &::before{
  403. content: "";
  404. position: absolute;
  405. left: 0;
  406. top: 50%;
  407. width: 36px;
  408. height: 12px;
  409. margin-top: -6px;
  410. background: url('~@/assets/images/largeScreen/item-left.png') no-repeat;
  411. background-size: cover;
  412. }
  413. &::after{
  414. content: "";
  415. position: absolute;
  416. top: 50%;
  417. right: 0;
  418. width: 36px;
  419. height: 12px;
  420. margin-top: -6px;
  421. background: url('~@/assets/images/largeScreen/item-right.png') no-repeat;
  422. background-size: cover;
  423. }
  424. }
  425. }
  426. .screen-env-list{
  427. flex-wrap: wrap;
  428. justify-content: space-between;
  429. height: calc(100% - 38px);
  430. padding: 0 44px 0 4px;
  431. li{
  432. flex: none;
  433. width: calc(100%/2 - 44px);
  434. margin: 20px 0 20px 40px;
  435. height: calc(100%/2 - 40px);
  436. .msg-list-svg{
  437. font-size: 40px;
  438. margin-left: 20px;
  439. }
  440. &.msg-pm{
  441. .msg-list-svg{
  442. font-size: 46px;
  443. }
  444. }
  445. }
  446. }
  447. .leakage-detection{
  448. padding: 0 44px;
  449. font-size: 14px;
  450. color: #339CFF;
  451. height: calc(100% - 38px);
  452. .leakage-list{
  453. height: calc(100% - 26px);
  454. text-align: left;
  455. li{
  456. position: relative;
  457. display: flex;
  458. justify-content: space-between;
  459. align-items: center;
  460. height: calc(100%/4 - 14px);
  461. margin-bottom: 14px;
  462. padding: 0 30px;
  463. border: 1px solid #3581CC;
  464. background-color: #02255F;
  465. border-radius: 2px;
  466. &::before{
  467. content: "";
  468. position: absolute;
  469. top: 4px;
  470. left: 4px;
  471. width: 0;
  472. height: 0;
  473. border-color: transparent #339CFF;
  474. border-width: 0 0 6px 6px;
  475. border-style: solid;
  476. }
  477. p{
  478. i{
  479. margin-right: 8px;
  480. }
  481. }
  482. span.leakage-state-tip{
  483. position: relative;
  484. display: block;
  485. width: 6px;
  486. height: 6px;
  487. border-radius: 50%;
  488. background-color: #18B08F;
  489. &::before{
  490. content: "";
  491. position: absolute;
  492. left: 50%;
  493. top: 50%;
  494. width: 14px;
  495. height: 14px;
  496. border-radius: 50%;
  497. box-shadow: inset 0px 0px 10px 1px #18B08F;
  498. transform: translate(-50%,-50%);
  499. }
  500. }
  501. &.leakage-warn{
  502. border-color: #F65164;
  503. box-shadow: inset 0px 0px 15px 1px #F65164;
  504. color: #F65164;
  505. &::before{
  506. border-color: transparent #F65164;
  507. }
  508. span.leakage-state-tip{
  509. background-color: #F65164;
  510. &::before{
  511. box-shadow: inset 0px 0px 10px 1px #F65164;
  512. }
  513. }
  514. }
  515. }
  516. }
  517. }
  518. .state-list{
  519. display: flex;
  520. justify-content: flex-end;
  521. margin-bottom: 10px;
  522. font-size: 14px;
  523. color: #339CFF;
  524. span{
  525. position: relative;
  526. display: block;
  527. padding-left: 16px;
  528. margin-left: 30px;
  529. &::before{
  530. content: "";
  531. position: absolute;
  532. left: 0;
  533. top: 50%;
  534. width: 10px;
  535. height: 10px;
  536. border-radius: 50%;
  537. margin-top: -5px;
  538. background-color: #18B08F;
  539. }
  540. &:last-child::before{
  541. background-color:#F65164;
  542. }
  543. }
  544. }
  545. .device-container{
  546. position: relative;
  547. .state-list{
  548. position: absolute;
  549. right: 40px;
  550. top: 12px;
  551. }
  552. .env-device-list{
  553. display: flex;
  554. height: calc(100% - 38px);
  555. justify-content: space-between;
  556. padding: 0 0 20px 20px;
  557. li{
  558. width: calc(100%/6 - 20px);
  559. margin-right: 20px;
  560. .env-device-img{
  561. display: flex;
  562. align-items: center;
  563. justify-content: center;
  564. height: calc(100% - 40px);
  565. border: 1px solid #3581CC;
  566. margin-bottom: 10px;
  567. img{
  568. display: block;
  569. // height: 100%;
  570. // object-fit: contain;
  571. }
  572. }
  573. .env-device-text{
  574. position: relative;
  575. display: flex;
  576. justify-content: center;
  577. align-items: center;
  578. height: 36px;
  579. line-height: 36px;
  580. font-size: 14px;
  581. color: #339CFF;
  582. border: 1px solid #3581CC;
  583. background-color: #02255F;
  584. border-radius: 36px;
  585. span{
  586. position: relative;
  587. // position: absolute;
  588. // right: 8px;
  589. // top: 50%;
  590. // margin-top: -3px;
  591. display: block;
  592. width: 6px;
  593. height: 6px;
  594. margin-left: 14px;
  595. border-radius: 50%;
  596. background-color: #18B08F;
  597. &::before{
  598. content: "";
  599. position: absolute;
  600. left: 50%;
  601. top: 50%;
  602. width: 14px;
  603. height: 14px;
  604. border-radius: 50%;
  605. box-shadow: inset 0px 0px 10px 1px #18B08F;
  606. transform: translate(-50%,-50%);
  607. }
  608. }
  609. }
  610. &.device-warn{
  611. .env-device-text{
  612. span{
  613. background-color: #F65164;
  614. &::before{
  615. box-shadow: inset 0px 0px 10px 1px #F65164;
  616. }
  617. }
  618. }
  619. }
  620. }
  621. }
  622. }
  623. .env-3d{
  624. position: relative;
  625. width: 100%;
  626. height: calc(100% - (100%/3) - 8px);
  627. margin-bottom: 20px;
  628. background: url('~@/assets/images/largeScreen/bg.png') no-repeat center -130px;
  629. // background-size: 100% 100%;
  630. overflow: hidden;
  631. .iframe_box{
  632. width: 100%;
  633. height: 100%;
  634. margin-left: -80px;
  635. }
  636. .screen-env-list{
  637. position: absolute;
  638. right: 0;
  639. bottom: 0;
  640. flex-wrap: wrap;
  641. justify-content: space-between;
  642. padding: 0;
  643. width: 165px;
  644. height: 200px;
  645. li{
  646. width: 100%;
  647. margin: 20px 0 0 0;
  648. height: calc(100%/2 - 20px);
  649. }
  650. }
  651. }
  652. }
  653. }
  654. </style>