chamberHome.vue 21 KB

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