obfurageHome.vue 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611
  1. <template>
  2. <a-spin tip="Loading..." :spinning="loading">
  3. <div class="monitor-container">
  4. <div class="lr left-box">
  5. <div class="warning-group">
  6. <div class="fire-analysis1 ">
  7. <div class="analysis-item warning3">
  8. <div class="title">火灾风险预警</div>
  9. <div class="value">高风险</div>
  10. </div>
  11. </div>
  12. <ventBox1 class="vent-margin-t-10">
  13. <template #title>
  14. <div>近一月报警情况</div>
  15. </template>
  16. <template #container>
  17. <div class="monitor-box">
  18. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="42" name="alarm-icon"/><span>报警信息</span></div>
  19. <div class="item-group">
  20. <div class="item-col">
  21. <SvgIcon class="icon" size="24" name="alarm-fire" />
  22. <span class="title">火焰传感器</span>
  23. <span class="value">无</span>
  24. </div>
  25. <div class="item-col">
  26. <SvgIcon class="icon" size="24" name="alarm-smoke" />
  27. <span class="title">烟雾传感器</span>
  28. <span class="value" style="color: #FF3823; font-weight: 600;">15</span>
  29. </div>
  30. <div class="item-col">
  31. <SvgIcon class="icon" size="24" name="alarm-temperature" />
  32. <span class="title">温度传感器</span>
  33. <span class="value">无</span>
  34. </div>
  35. </div>
  36. </div>
  37. <div class="monitor-box">
  38. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="42" name="warning-icon"/><span>预警信息</span></div>
  39. <div class="item-group">
  40. <div class="item-col">
  41. <SvgIcon class="icon" size="22" name="warning-fire" />
  42. <span class="title">火焰传感器</span>
  43. <span class="value">无</span>
  44. </div>
  45. <div class="item-col">
  46. <SvgIcon class="icon" size="22" name="warning-smoke" />
  47. <span class="title">烟雾传感器</span>
  48. <span class="value" style="color: #FF9B17; font-weight: 600;">15</span>
  49. </div>
  50. <div class="item-col">
  51. <SvgIcon class="icon" size="22" name="warning-temperature" />
  52. <span class="title">温度传感器</span>
  53. <span class="value">无</span>
  54. </div>
  55. </div>
  56. <div class="alarm-box">
  57. <!-- <dv-scroll-board ref="scrollBoard" :config="warningConfig"
  58. style="width: 100%; height: 240px; overflow-y: auto; " /> -->
  59. </div>
  60. </div>
  61. </template>
  62. </ventBox1>
  63. </div>
  64. </div>
  65. <div class="lr right-box">
  66. <div class="item-box sensor-container">
  67. <ventBox1>
  68. <template #title>
  69. <div>采空区火灾监测预警</div>
  70. </template>
  71. <template #container>
  72. <div class="temperature-box">
  73. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="fiber-title"/><span>光纤测温系统</span></div>
  74. <div class="temperature-group">
  75. <div class="light-group">
  76. <div class="light-bg"></div>
  77. <div class="light-item">
  78. <SvgIcon class="icon" size="25" name="aveg-temperature" />
  79. <div class="light">
  80. <div class="light-icon"></div>
  81. <div class="light-title">平均温度</div>
  82. <div class="light-val-box">
  83. <div class="light-val-icon"></div>
  84. <div class="light-val">56.99</div>
  85. </div>
  86. </div>
  87. </div>
  88. <div class="light-item">
  89. <SvgIcon class="icon" size="25" name="max-temperature" />
  90. <div class="light">
  91. <div class="light-icon"></div>
  92. <div class="light-title">最高温度</div>
  93. <div class="light-val-box">
  94. <div class="light-val-icon"></div>
  95. <div class="light-val">56.99</div>
  96. </div>
  97. </div>
  98. </div>
  99. <div class="light-item">
  100. <SvgIcon class="icon" size="25" name="min-temperature" />
  101. <div class="light">
  102. <div class="light-icon"></div>
  103. <div class="light-title">最低温度</div>
  104. <div class="light-val-box">
  105. <div class="light-val-icon"></div>
  106. <div class="light-val">56.99</div>
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. </div>
  112. <div class="warning-state-detail">
  113. 最大值产生于 <span class="state-color">2013-05-24 15:52:42</span> 时刻 <span class="state-color">15212胶运顺槽600m</span> 处
  114. </div>
  115. </div>
  116. <div>
  117. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="beamTube-title"/><span>束管监测系统</span></div>
  118. <div class="state-item" v-for="(data, index) in beamTubeColumns" :key="index">
  119. <div class="item-col">
  120. <span class="state-title">{{ Object.values(data)[0] }} :</span>
  121. <span class="state-val">{{ (bundleTubeDataSource[Object.keys(data)[0]])
  122. >= 0 ? bundleTubeDataSource[Object.keys(data)[0]] : '-' }}</span>
  123. </div>
  124. <div class="item-col" v-if="Object.keys(data)[1]">
  125. <span class="state-title">{{ Object.values(data)[1] }} :</span>
  126. <span class="state-val">{{ (bundleTubeDataSource[Object.keys(data)[1]])
  127. >= 0 ? bundleTubeDataSource[Object.keys(data)[1]] : '-' }}</span>
  128. </div>
  129. </div>
  130. </div>
  131. <div>
  132. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="pulp-title"/><span>注浆系统</span></div>
  133. <div class="state-item" v-for="(data, index) in groutColumns" :key="index">
  134. <div class="item-col">
  135. <span class="state-title">{{ Object.values(data)[0] }} :</span>
  136. <span class="state-val">{{ (pulpingDataSource[Object.keys(data)[0]])
  137. >= 0 ? pulpingDataSource[Object.keys(data)[0]] : '-' }}</span>
  138. </div>
  139. <div class="item-col" v-if="Object.keys(data)[1]">
  140. <span class="state-title">{{ Object.values(data)[1] }} :</span>
  141. <span class="state-val">{{ (pulpingDataSource[Object.keys(data)[1]])
  142. >= 0 ? pulpingDataSource[Object.keys(data)[1]] : '-' }}</span>
  143. </div>
  144. </div>
  145. <div class="input-item vent-flex-row" style="margin-bottom: 15px;">
  146. <div>设备控制:</div>
  147. <div class="vent-flex-row btn-box">
  148. <div class="btn btn1">一键启动</div>
  149. <div class="btn btn2">一键停止</div>
  150. </div>
  151. </div>
  152. </div>
  153. <div>
  154. <div class="parameter-title group-parameter-title"><SvgIcon class="icon" size="14" name="nitrogen-title"/><span>注氮系统</span></div>
  155. <div class="state-item" v-for="(data, index) in nitrogenColumns" :key="index">
  156. <div class="item-col">
  157. <span class="state-title">{{ Object.values(data)[0] }} :</span>
  158. <span class="state-val">{{ (nitrogenDataSource[Object.keys(data)[0]])
  159. >= 0 ? nitrogenDataSource[Object.keys(data)[0]] : '-' }}</span>
  160. </div>
  161. <div class="item-col" v-if="Object.keys(data)[1]">
  162. <span class="state-title">{{ Object.values(data)[1] }} :</span>
  163. <span class="state-val">{{ (nitrogenDataSource[Object.keys(data)[1]])
  164. >= 0 ? nitrogenDataSource[Object.keys(data)[1]] : '-' }}</span>
  165. </div>
  166. </div>
  167. <div class="input-item vent-flex-row">
  168. <div>设备控制:</div>
  169. <div class="vent-flex-row btn-box">
  170. <div class="btn btn1">一键启动</div>
  171. <div class="btn btn2">一键停止</div>
  172. </div>
  173. </div>
  174. </div>
  175. </template>
  176. </ventBox1>
  177. </div>
  178. <!-- <div class="item-box" >
  179. <LivePlayer id="fm-player1" style="height: 250px;" ref="player1" :videoUrl="flvURL1()" muted live loading controls />
  180. </div> -->
  181. </div>
  182. </div>
  183. </a-spin>
  184. </template>
  185. <script setup lang="ts">
  186. import { onBeforeMount, ref, onMounted, onUnmounted, reactive, defineProps, watch } from 'vue';
  187. // import MonitorTable from '../comment/MonitorTable.vue';
  188. import { ScrollBoard as DvScrollBoard } from '@kjgl77/datav-vue3';
  189. import ventBox1 from '/@/components/vent/ventBox1.vue'
  190. import { mountedThree, destroy, addChamberText, setModelType } from '../obfurage.threejs';
  191. import { SvgIcon } from '/@/components/Icon';
  192. import FourBorderBg from '/@/components/vent/fourBorderBg.vue';
  193. import { beamTubeColumns, groutColumns, nitrogenColumns } from '../obfurage.data'
  194. import { list } from '../obfurage.api';
  195. import LivePlayer from '@liveqing/liveplayer-v3';
  196. const props = defineProps({
  197. deviceId: {
  198. type: String,
  199. require: true
  200. }
  201. })
  202. const loading = ref(false);
  203. // 默认初始是第一行
  204. const sprayDataSource = ref([]);
  205. const bundleTubeDataSource = ref({});
  206. const pulpingDataSource = ref([]);
  207. const nitrogenDataSource = ref([]);
  208. const fiberDataSource = ref([]);
  209. // 监测数据
  210. const selectData = reactive({});
  211. const flvURL1 = () => {
  212. return `https://sf1-hscdn-tos.pstatp.com/obj/media-fe/xgplayer_doc_video/flv/xgplayer-demo-360p.flv`;
  213. // return ''
  214. };
  215. // https获取监测数据
  216. let timer: null | NodeJS.Timeout = null;
  217. function getMonitor(flag?) {
  218. if (Object.prototype.toString.call(timer) === '[object Null]') {
  219. timer = setTimeout(async () => {
  220. if (props.deviceId) {
  221. const data = await getDataSource(props.deviceId)
  222. Object.assign(selectData, data);
  223. }
  224. if (timer) {
  225. timer = null;
  226. }
  227. await getMonitor();
  228. loading.value = false
  229. }, flag? 0 : 1000);
  230. }
  231. };
  232. async function getDataSource(systemID) {
  233. const res = await list({ devicetype: 'sys', systemID });
  234. const result = res.msgTxt;
  235. result.forEach(item => {
  236. if(item.type.startsWith('spray_auto')) {
  237. // 喷淋
  238. sprayDataSource.value = item['datalist'].filter((data: any) => {
  239. const readData = data.readData;
  240. return Object.assign(data, readData);
  241. })
  242. }
  243. if (item.type.startsWith('"bundletube_auto"')) {
  244. // 束管
  245. bundleTubeDataSource.value = Object.assign(item['datalist'][0], item['datalist'][0]['readData'])
  246. }
  247. if (item.type === 'pulping_auto') {
  248. // 注浆
  249. pulpingDataSource.value = Object.assign(item['datalist'][0], item['datalist'][0]['readData'])
  250. }
  251. if (item.type === 'nitrogen_auto') {
  252. // 注氮
  253. nitrogenDataSource.value = Object.assign(item['datalist'][0], item['datalist'][0]['readData'])
  254. }
  255. if (item.type === 'fiber_normal') {
  256. // 注氮
  257. fiberDataSource.value = Object.assign(item['datalist'][0], item['datalist'][0]['readData'])
  258. }
  259. if (item.type === 'sys') {
  260. // 硐室基本
  261. // fiberDataSource.value = item.filter((data: any) => {
  262. // const readData = data.readData;
  263. // return Object.assign(data, readData);
  264. // })
  265. }
  266. })
  267. }
  268. // 喷粉操作
  269. function handleDust() {
  270. //
  271. }
  272. watch(() => props.deviceId, () => {
  273. setModelType('obfurageBase')
  274. loading.value = true
  275. })
  276. onBeforeMount(() => {
  277. });
  278. onMounted(() => {
  279. loading.value = true;
  280. // getMonitor(true)
  281. mountedThree().then(async () => {
  282. await setModelType('obfurage');
  283. loading.value = false;
  284. timer = null
  285. await getMonitor(true)
  286. });
  287. });
  288. onUnmounted(() => {
  289. destroy();
  290. if (timer) {
  291. clearTimeout(timer);
  292. timer = undefined;
  293. }
  294. });
  295. </script>
  296. <style lang="less" scoped>
  297. @import '/@/design/vent/modal.less';
  298. @import '../../comment/less/workFace.less';
  299. @ventSpace: zxm;
  300. .warning-group {
  301. padding: 10px 0;
  302. }
  303. .monitor-box {
  304. width: 100%;
  305. margin-bottom: 20px;
  306. .parameter-title{
  307. position: relative;
  308. width: 100%;
  309. height: 16px;
  310. margin-top: 10px;
  311. margin-bottom: 5px;
  312. .icon, span{
  313. position: absolute;
  314. top: -10px;
  315. }
  316. }
  317. .group-parameter-title{
  318. // background-image: linear-gradient(to right, #39a3ff50, #39a3ff00);
  319. .icon{
  320. left: -12px;
  321. top: -20px;
  322. }
  323. span{
  324. left: 24px;
  325. }
  326. }
  327. .item-group{
  328. display: flex;
  329. flex-wrap: wrap;
  330. .item-col{
  331. width: calc(50% - 5px);
  332. background-image: linear-gradient(to right, #39A3FF00, #39A3FF10);
  333. position: relative;
  334. // display: flex;
  335. // align-items: center;
  336. &:nth-child(even){
  337. margin-left: 10px;
  338. }
  339. padding: 2px 0;
  340. margin: 3px 0;
  341. .title{
  342. margin-left: 5px;
  343. }
  344. .value{
  345. position: absolute;
  346. right: 10px;
  347. top: 5px;
  348. }
  349. }
  350. }
  351. }
  352. .alarm-box{
  353. margin-top: 10px;
  354. }
  355. // .monitor-container {
  356. // width: 100%;
  357. // height: 100%;
  358. // // height: 550px;
  359. // // border: 1px solid #fff;
  360. // margin-top: 20px;
  361. // padding-top: 20px;
  362. // display: flex;
  363. // justify-content: space-between;
  364. // .lr {
  365. // width: 350px;
  366. // height: 100%;
  367. // display: flex;
  368. // flex-direction: column;
  369. // margin-top: 10px;
  370. // pointer-events: auto;
  371. // }
  372. // .right-box {
  373. // width: 320px;
  374. // }
  375. // .left-box {
  376. // margin-top: 30px;
  377. // .monitor-info {
  378. // .temperature-group {
  379. // width: 100%;
  380. // margin-top: 10px;
  381. // .light-group{
  382. // display: flex;
  383. // flex-direction: row;
  384. // justify-content: space-between;
  385. // position: relative;
  386. // .light-bg{
  387. // width: 331px;
  388. // height: 42px;
  389. // background: url('/@/assets/images/vent/plane-bg.png') no-repeat;
  390. // background-size: contain;
  391. // position: absolute;
  392. // z-index: -1;
  393. // top: 44px;
  394. // }
  395. // .temperature-item {
  396. // width: 120px;
  397. // display: flex;
  398. // flex-direction: column;
  399. // justify-content: center;
  400. // align-items: center;
  401. // position: reactive;
  402. // .icon {
  403. // display: block;
  404. // position: absolute;
  405. // top: -5px;
  406. // }
  407. // .temperature {
  408. // display: flex;
  409. // flex-direction: column;
  410. // justify-content: center;
  411. // align-items: center;
  412. // .temperature-icon{
  413. // width: 90px;
  414. // height: 58px;
  415. // background: url('/@/assets/images/vent/ligth-q.png');
  416. // }
  417. // .temperature-title{
  418. // position: relative;
  419. // top: -15px;
  420. // }
  421. // .temperature-val-box{
  422. // display: flex;
  423. // flex-direction: column;
  424. // justify-content: center;
  425. // align-items: center;
  426. // position: relative;
  427. // top: -10px;
  428. // .temperature-val-icon{
  429. // width: 2px;
  430. // height: 18px;
  431. // background: #00d8ff;
  432. // position: relative;
  433. // &::after{
  434. // content: '';
  435. // display: block;
  436. // position: absolute;
  437. // width: 6px;
  438. // height: 6px;
  439. // border-radius: 3px;
  440. // background: #00d8ff;
  441. // bottom: -2px;
  442. // left: -2px;
  443. // }
  444. // }
  445. // .temperature-val{
  446. // position: relative;
  447. // font-family: 'douyuFont';
  448. // color: #20dbfd;
  449. // text-shadow: 0 0 25px #00d8ff;
  450. // font-size: 13px;
  451. // border: 1px solid #40B7F3;
  452. // padding: 5px 8px 2px 8px;
  453. // top: 2px;
  454. // &::after{
  455. // width: calc(100% - 4px);
  456. // height: calc(100% - 4px);
  457. // content: '';
  458. // position: absolute;
  459. // top: 2px;
  460. // left: 2px;
  461. // display: block;
  462. // border: 1px solid #006EA6;
  463. // }
  464. // }
  465. // }
  466. // }
  467. // }
  468. // }
  469. // }
  470. // }
  471. // .warning-group {
  472. // padding: 10px 0;
  473. // }
  474. // .monitor-box {
  475. // width: 100%;
  476. // margin-bottom: 20px;
  477. // .parameter-title{
  478. // position: relative;
  479. // width: 100%;
  480. // height: 16px;
  481. // margin-top: 10px;
  482. // margin-bottom: 5px;
  483. // .icon, span{
  484. // position: absolute;
  485. // top: -10px;
  486. // }
  487. // }
  488. // .group-parameter-title{
  489. // background-image: linear-gradient(to right, #39a3ff50, #39a3ff00);
  490. // .icon{
  491. // left: -12px;
  492. // top: -20px;
  493. // }
  494. // span{
  495. // left: 20px;
  496. // }
  497. // }
  498. // .item-group{
  499. // display: flex;
  500. // flex-wrap: wrap;
  501. // .item-col{
  502. // width: calc(50% - 5px);
  503. // background-image: linear-gradient(to right, #39A3FF00, #39A3FF10);
  504. // position: relative;
  505. // // display: flex;
  506. // // align-items: center;
  507. // &:nth-child(even){
  508. // margin-left: 10px;
  509. // }
  510. // padding: 2px 0;
  511. // margin: 3px 0;
  512. // .title{
  513. // margin-left: 5px;
  514. // }
  515. // .value{
  516. // position: absolute;
  517. // right: 10px;
  518. // top: 5px;
  519. // }
  520. // }
  521. // }
  522. // }
  523. // .alarm-box{
  524. // margin-top: 10px;
  525. // }
  526. // }
  527. // .box-title{
  528. // color: #fff;
  529. // margin-bottom: 8px;
  530. // padding-left: 10px;
  531. // position: relative;
  532. // font-size: 16px;
  533. // &::after{
  534. // content: '';
  535. // position: absolute;
  536. // display: block;
  537. // width: 4px;
  538. // height: 12px;
  539. // top: 7px;
  540. // left: 0px;
  541. // background: #45d3fd;
  542. // border-radius: 4px;
  543. // }
  544. // }
  545. // }
  546. :deep(.@{ventSpace}-tabs-tabpane-active) {
  547. overflow: auto;
  548. }
  549. // .input-box {
  550. // display: flex;
  551. // align-items: center;
  552. // padding-left: 10px;
  553. // .input-title {
  554. // color: #73e8fe;
  555. // width: auto;
  556. // }
  557. // .@{ventSpace}-input-number {
  558. // border-color: #ffffff88 !important;
  559. // }
  560. // margin-right: 10px;
  561. // }
  562. </style>