closeWall.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681
  1. <template>
  2. <div class="closeWall">
  3. <div class="title">
  4. <div class="box-container">
  5. <div class="contents">
  6. <div class="text">
  7. <div class="text-label">位置: </div>
  8. <!-- <div class="text-value">{{ topContent.position }}</div> -->
  9. <div class="text-value">
  10. <a-select v-model:value="selectData" style="width: 360px" @change="changeSelect">
  11. <a-select-option v-for="file in selectList" :key="file.label" :value="file.value">{{ file.label }}</a-select-option>
  12. </a-select>
  13. </div>
  14. </div>
  15. <div class="text">
  16. <span class="text-label">时间 : </span>
  17. <span class="text-value">{{ topContent.time }}</span>
  18. </div>
  19. </div>
  20. <div class="contents">
  21. <img src="../../../../../assets/images/fire/pie.png" alt="" />
  22. <span class="text">{{ topContent.temperature }}</span>
  23. <span class="dw">°C</span>
  24. </div>
  25. </div>
  26. <div class="box-container">
  27. <div class="text1">
  28. <span>预警等级 : </span>
  29. <span
  30. :class="{
  31. value1: topContent.warnLevel == '绿色预警',
  32. value2: topContent.warnLevel == '黄色预警',
  33. value3: topContent.warnLevel == '红色预警',
  34. }"
  35. >{{ topContent.warnLevel || '-' }}</span
  36. >
  37. </div>
  38. <div class="text1">
  39. <span>煤自燃阶段 : </span>
  40. <span>{{ topContent.smokeJd || '-' }}</span>
  41. </div>
  42. </div>
  43. </div>
  44. <div class="content">
  45. <div class="title-b">采空区密闭参数</div>
  46. <div class="card-btn">
  47. <div
  48. :class="activeIndex == index ? 'box-container1' : 'box-container'"
  49. v-for="(item, index) in mbList"
  50. :key="index"
  51. @click="btnClick(item, index)"
  52. >
  53. <div class="box-label">
  54. <span> {{ item.label }}</span>
  55. <span>{{ item.dw }}</span>
  56. </div>
  57. <div class="box-item box-item1">
  58. <span class="text-t">{{ `${item.label1}:` }}</span>
  59. <span class="text-v">{{ item.nd }}</span>
  60. </div>
  61. <div class="box-item box-item2">
  62. <span class="text-t">{{ `${item.label2}:` }}</span>
  63. <span class="text-v">{{ item.time1 }}</span>
  64. </div>
  65. <div class="box-item box-item3">
  66. <span class="text-t">{{ `${item.label3}:` }}</span>
  67. <span class="text-v">{{ item.address }}</span>
  68. </div>
  69. </div>
  70. </div>
  71. <div class="echart-box">
  72. <div class="left-echartbox">
  73. <div class="title-f">
  74. <div class="title-text"
  75. >{{ `${type}趋势` }}&nbsp; <span style="color: red">{{ netStatus != 1 ? '(设备未连接)' : '' }}</span></div
  76. >
  77. </div>
  78. <div class="echarts-box">
  79. <echartLine1 :echartDataSg="echartDataSg1" :lengedDataName="echartDataSg1.lengedDataName" />
  80. </div>
  81. </div>
  82. <div class="right-echartbox">
  83. <warnZb
  84. :widthV="widthV"
  85. :heightV="heightV"
  86. :coordDw="coordDw"
  87. :widthCanvas="widthCanvas"
  88. :heightCanvas="heightCanvas"
  89. :warnLevel="topContent.warnLevel"
  90. />
  91. </div>
  92. </div>
  93. </div>
  94. </div>
  95. </template>
  96. <script lang="ts" setup>
  97. import { onMounted, ref, reactive, watch, defineProps } from 'vue';
  98. import echartLine1 from './echartLine1.vue';
  99. import warnZb from './warnZb.vue';
  100. let props = defineProps({
  101. listData: Object,
  102. });
  103. let selectSj = ref<any[]>([]);
  104. let selectData = ref('');
  105. let selectList = reactive<any[]>([]);
  106. let widthV = ref('75%');
  107. let heightV = ref('80%');
  108. let coordDw = ref<any[]>([47, 95]);
  109. let widthCanvas = ref(562);
  110. let heightCanvas = ref(316);
  111. //设备连接状态
  112. let netStatus = ref(0);
  113. //密闭-顶部区域数据
  114. let topContent = reactive({
  115. temperature: 0,
  116. position: '',
  117. time: '',
  118. warnLevel: '',
  119. smokeJd: '',
  120. });
  121. //密闭参数列表
  122. let mbList = reactive([
  123. {
  124. label: 'O₂',
  125. dw: '(%)',
  126. label1: '浓度',
  127. label2: '时间',
  128. label3: '位置',
  129. nd: '0',
  130. time1: '',
  131. address: '',
  132. },
  133. {
  134. label: 'CO',
  135. dw: '(ppm)',
  136. label1: '浓度',
  137. label2: '时间',
  138. label3: '位置',
  139. nd: '0',
  140. time1: '',
  141. address: '',
  142. },
  143. {
  144. label: 'CO₂',
  145. dw: '(%)',
  146. label1: '浓度',
  147. label2: '时间',
  148. label3: '位置',
  149. nd: '0',
  150. time1: '',
  151. address: '',
  152. },
  153. {
  154. label: 'CH₄',
  155. dw: '(%)',
  156. label1: '浓度',
  157. label2: '时间',
  158. label3: '位置',
  159. nd: '0',
  160. time1: '',
  161. address: '',
  162. },
  163. {
  164. label: 'C₂H₂',
  165. dw: '(ppm)',
  166. label1: '浓度',
  167. label2: '时间',
  168. label3: '位置',
  169. nd: '0',
  170. time1: '',
  171. address: '',
  172. },
  173. {
  174. label: 'C₂H₄',
  175. dw: '(ppm)',
  176. label1: '浓度',
  177. label2: '时间',
  178. label3: '位置',
  179. nd: '0',
  180. time1: '',
  181. address: '',
  182. },
  183. ]);
  184. //当前密闭参数激活选项
  185. let activeIndex = ref(0);
  186. //当前激活密闭参数类型
  187. let type = ref('O₂');
  188. let echartDataSg1 = reactive({
  189. xData: [],
  190. yData: [],
  191. lengedData: 'O₂',
  192. lengedDataName: '(%)',
  193. });
  194. let echartDataSgList = reactive<any[]>([]);
  195. //密闭参数选项切换
  196. function btnClick(item, ind) {
  197. activeIndex.value = ind;
  198. type.value = item.label;
  199. echartDataSg1.xData.length = 0;
  200. echartDataSg1.yData.length = 0;
  201. echartDataSg1.lengedData = type.value;
  202. echartDataSg1.lengedDataName = item.dw;
  203. switch (type.value) {
  204. case 'O₂':
  205. echartDataSgList.forEach((el) => {
  206. echartDataSg1.xData.push(el.time);
  207. echartDataSg1.yData.push(el.o2val);
  208. });
  209. break;
  210. case 'C₂H₄':
  211. echartDataSgList.forEach((el) => {
  212. echartDataSg1.xData.push(el.time);
  213. echartDataSg1.yData.push(el.ch2val);
  214. });
  215. break;
  216. case 'CO':
  217. echartDataSgList.forEach((el) => {
  218. echartDataSg1.xData.push(el.time);
  219. echartDataSg1.yData.push(el.coval);
  220. });
  221. break;
  222. case 'CH₄':
  223. echartDataSgList.forEach((el) => {
  224. echartDataSg1.xData.push(el.time);
  225. echartDataSg1.yData.push(el.chval);
  226. });
  227. break;
  228. case 'CO₂':
  229. echartDataSgList.forEach((el) => {
  230. echartDataSg1.xData.push(el.time);
  231. echartDataSg1.yData.push(el.co2val);
  232. });
  233. break;
  234. case 'C₂H₂':
  235. echartDataSgList.forEach((el) => {
  236. echartDataSg1.xData.push(el.time);
  237. echartDataSg1.yData.push(el.gasval);
  238. });
  239. break;
  240. }
  241. }
  242. function changeSelect(val) {
  243. selectData.value = val;
  244. let data = selectSj.value.filter((v) => v.strinstallpos == selectData.value)[0];
  245. topContent.time = data.readTime || '--';
  246. topContent.warnLevel = data.syswarnLevel_str;
  247. topContent.smokeJd = data.syswarnLevel_des;
  248. mbList[0].nd = data.readData.o2val || '--';
  249. mbList[1].nd = data.readData.coval || '--';
  250. mbList[2].nd = data.readData.co2val || '--';
  251. mbList[3].nd = data.readData.chval || '--';
  252. mbList[4].nd = data.readData.ch2val || '--';
  253. mbList[5].nd = data.readData.gasval || '--';
  254. mbList.forEach((el) => {
  255. el.time1 = data ? data.readTime.substring(0, data.readTime.lastIndexOf(':')) : '--';
  256. el.address = data ? data.strinstallpos : '--';
  257. });
  258. netStatus.value = data['netStatus'];
  259. }
  260. watch(
  261. () => props.listData,
  262. (val) => {
  263. console.log(val, 'val---');
  264. echartDataSg1.xData.length = 0;
  265. echartDataSg1.yData.length = 0;
  266. echartDataSgList.length = 0;
  267. selectList.length = 0;
  268. if (JSON.stringify(val) != '{}') {
  269. if (val.bundletube.length != 0) {
  270. selectSj.value = val.bundletube;
  271. selectSj.value.forEach((el) => {
  272. selectList.push({ label: el.strinstallpos, value: el.strinstallpos });
  273. });
  274. selectData.value = selectData.value ? selectData.value : selectList[0].value;
  275. let dataVal = selectData.value ? selectSj.value.filter((v) => v.strinstallpos == selectData.value)[0] : selectSj.value[0];
  276. topContent.temperature = val.temperature[0] ? val.temperature[0].readData.temperature : '--';
  277. // topContent.position = dataVal.strinstallpos || '--';
  278. topContent.time = dataVal.readTime || '--';
  279. topContent.warnLevel = dataVal.syswarnLevel_str;
  280. topContent.smokeJd = dataVal.syswarnLevel_des;
  281. mbList[0].nd = dataVal.readData.o2val || '--';
  282. mbList[1].nd = dataVal.readData.coval || '--';
  283. mbList[2].nd = dataVal.readData.co2val || '--';
  284. mbList[3].nd = dataVal.readData.chval || '--';
  285. mbList[4].nd = dataVal.readData.ch2val || '--';
  286. mbList[5].nd = dataVal.readData.gasval || '--';
  287. mbList.forEach((el) => {
  288. el.time1 = dataVal ? dataVal.readTime.substring(0, dataVal.readTime.lastIndexOf(':')) : '--';
  289. el.address = dataVal ? dataVal.strinstallpos : '--';
  290. });
  291. netStatus.value = dataVal['netStatus'];
  292. dataVal.history.forEach((v) => {
  293. echartDataSg1.xData.push(v.time);
  294. if (echartDataSg1.lengedData == 'O₂') {
  295. echartDataSg1.yData.push(v.o2val);
  296. } else if (echartDataSg1.lengedData == 'C₂H₄') {
  297. echartDataSg1.yData.push(v.ch2val);
  298. } else if (echartDataSg1.lengedData == 'CO') {
  299. echartDataSg1.yData.push(v.coval);
  300. } else if (echartDataSg1.lengedData == 'CH₄') {
  301. echartDataSg1.yData.push(v.chval);
  302. } else if (echartDataSg1.lengedData == 'CO₂') {
  303. echartDataSg1.yData.push(v.co2val);
  304. } else if (echartDataSg1.lengedData == 'C₂H₂') {
  305. echartDataSg1.yData.push(v.gasval);
  306. }
  307. echartDataSgList.push(v);
  308. });
  309. } else {
  310. topContent.temperature = 0;
  311. // topContent.position = '--';
  312. topContent.time = '--';
  313. topContent.warnLevel = '--';
  314. topContent.smokeJd = '--';
  315. mbList[0].nd = '--';
  316. mbList[1].nd = '--';
  317. mbList[2].nd = '--';
  318. mbList[3].nd = '--';
  319. mbList[4].nd = '--';
  320. mbList[5].nd = '--';
  321. mbList.forEach((el) => {
  322. el.time1 = '--';
  323. el.address = '--';
  324. });
  325. }
  326. }
  327. },
  328. { immediate: true, deep: true }
  329. );
  330. </script>
  331. <style lang="less" scoped>
  332. .closeWall {
  333. width: 100%;
  334. height: 100%;
  335. padding: 20px;
  336. box-sizing: border-box;
  337. .title {
  338. width: 100%;
  339. height: 17%;
  340. margin-bottom: 20px;
  341. display: flex;
  342. justify-content: space-between;
  343. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  344. background-size: 100% 100%;
  345. align-items: center;
  346. .box-container {
  347. display: flex;
  348. &:nth-child(1) {
  349. justify-content: space-around;
  350. align-items: center;
  351. flex: 2;
  352. height: 100%;
  353. border-right: 2px solid;
  354. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  355. }
  356. &:nth-child(2) {
  357. flex-direction: column;
  358. flex: 1;
  359. justify-content: space-around;
  360. align-items: center;
  361. height: 73%;
  362. }
  363. .contents {
  364. height: 73%;
  365. &:nth-child(1) {
  366. width: 40%;
  367. display: flex;
  368. flex-direction: column;
  369. justify-content: space-around;
  370. .text {
  371. font-size: 14px;
  372. display: flex;
  373. align-items: center;
  374. .text-label {
  375. color: #b3b8cc;
  376. font-weight: bold;
  377. }
  378. .text-value {
  379. font-family: 'douyuFont';
  380. color: #3df6ff;
  381. margin-left: 10px;
  382. }
  383. }
  384. }
  385. &:nth-child(2) {
  386. width: 40%;
  387. display: flex;
  388. justify-content: center;
  389. align-items: center;
  390. img {
  391. position: relative;
  392. width: 23%;
  393. height: 100%;
  394. background: url('../../../../../assets/images/fire/pj.svg') no-repeat center;
  395. background-size: 50% 50%;
  396. }
  397. .text {
  398. font-family: 'douyuFont';
  399. font-size: 28px;
  400. margin: 0px 15px;
  401. color: #3df6ff;
  402. }
  403. .dw {
  404. font-size: 14px;
  405. color: #b3b8cc;
  406. }
  407. }
  408. }
  409. .text1 {
  410. width: 90%;
  411. height: 30px;
  412. line-height: 30px;
  413. font-size: 14px;
  414. color: #b3b8cc;
  415. font-weight: bold;
  416. span {
  417. display: inline-block;
  418. &:nth-child(1) {
  419. width: 160px;
  420. text-align: right;
  421. }
  422. &:nth-child(2) {
  423. font-family: 'douyuFont';
  424. color: #3df6ff;
  425. margin-left: 10px;
  426. }
  427. }
  428. .value1 {
  429. color: rgb(145, 230, 9) !important;
  430. }
  431. .value2 {
  432. // color: rgb(0, 242, 255) !important;
  433. color: #ffff35 !important;
  434. }
  435. .value3 {
  436. // color: #ffff35 !important;
  437. color: #ff0000 !important;
  438. }
  439. .value4 {
  440. color: #ffbe69 !important;
  441. }
  442. .value5 {
  443. color: #ff6f00 !important;
  444. }
  445. .value6 {
  446. color: #ff0000 !important;
  447. }
  448. }
  449. }
  450. }
  451. .content {
  452. width: 100%;
  453. height: calc(83% - 20px);
  454. padding: 10px;
  455. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  456. background-size: 100% 100%;
  457. box-sizing: border-box;
  458. .title-b {
  459. height: 30px;
  460. line-height: 30px;
  461. font-family: 'douyuFont';
  462. font-size: 14px;
  463. color: #fff;
  464. // color: #3df6ff;
  465. }
  466. .card-btn {
  467. height: 28%;
  468. margin-bottom: 10px;
  469. display: flex;
  470. justify-content: space-between;
  471. .box-container {
  472. position: relative;
  473. width: 16%;
  474. height: 100%;
  475. background: url('../../../../../assets/images/fire/1.png') no-repeat center;
  476. background-size: 100% 100%;
  477. cursor: pointer;
  478. .box-label {
  479. position: absolute;
  480. left: 50%;
  481. top: 2px;
  482. transform: translate(-50%);
  483. color: #fff;
  484. }
  485. .box-item {
  486. position: absolute;
  487. left: 50%;
  488. transform: translate(-50%, 0);
  489. width: 89%;
  490. height: 16%;
  491. padding: 0px 10px;
  492. display: flex;
  493. justify-content: space-between;
  494. align-items: center;
  495. background: url('../../../../../assets/images/fire/contetn.png') no-repeat center;
  496. background-size: 100% 100%;
  497. .text-t {
  498. width: 17%;
  499. color: #fff;
  500. font-size: 12px;
  501. }
  502. .text-v {
  503. width: 83%;
  504. font-family: 'douyuFont';
  505. font-size: 10px;
  506. color: #3df6ff;
  507. display: flex;
  508. justify-content: flex-end;
  509. }
  510. }
  511. .box-item1 {
  512. top: 24%;
  513. }
  514. .box-item2 {
  515. top: 50%;
  516. }
  517. .box-item3 {
  518. top: 75%;
  519. }
  520. }
  521. .box-container1 {
  522. position: relative;
  523. width: 16%;
  524. height: 100%;
  525. background: url('../../../../../assets/images/fire/2.png') no-repeat center;
  526. background-size: 100% 100%;
  527. cursor: pointer;
  528. .box-label {
  529. position: absolute;
  530. left: 50%;
  531. top: 2px;
  532. transform: translate(-50%);
  533. color: #fff;
  534. }
  535. .box-item {
  536. position: absolute;
  537. left: 50%;
  538. transform: translate(-50%, 0);
  539. width: 89%;
  540. height: 16%;
  541. padding: 0px 10px;
  542. display: flex;
  543. justify-content: space-between;
  544. align-items: center;
  545. background: url('../../../../../assets/images/fire/contetn.png') no-repeat center;
  546. background-size: 100% 100%;
  547. .text-t {
  548. width: 17%;
  549. color: #fff;
  550. font-size: 12px;
  551. }
  552. .text-v {
  553. width: 83%;
  554. font-family: 'douyuFont';
  555. font-size: 10px;
  556. color: #3df6ff;
  557. display: flex;
  558. justify-content: flex-end;
  559. }
  560. }
  561. .box-item1 {
  562. top: 19%;
  563. }
  564. .box-item2 {
  565. top: 41%;
  566. }
  567. .box-item3 {
  568. top: 63%;
  569. }
  570. }
  571. }
  572. .echart-box {
  573. display: flex;
  574. height: calc(72% - 41px);
  575. .left-echartbox {
  576. width: calc(50% - 6px);
  577. margin-right: 6px;
  578. border: 1px solid #114aac;
  579. border-radius: 5px;
  580. .title-f {
  581. height: 40px;
  582. padding: 0px 10px;
  583. box-sizing: border-box;
  584. display: flex;
  585. justify-content: space-between;
  586. align-items: center;
  587. .title-text {
  588. font-family: 'douyuFont';
  589. font-size: 14px;
  590. color: #fff;
  591. // color: #3df6ff;
  592. }
  593. }
  594. .echarts-box {
  595. height: calc(100% - 40px);
  596. padding: 0px 10px;
  597. box-sizing: border-box;
  598. }
  599. }
  600. .right-echartbox {
  601. width: calc(50% - 6px);
  602. margin-left: 6px;
  603. border: 1px solid #114aac;
  604. border-radius: 5px;
  605. }
  606. }
  607. }
  608. }
  609. :deep(.zxm-select:not(.zxm-select-customize-input) .zxm-select-selector) {
  610. border: 1px solid #3ad8ff77 !important;
  611. background-color: #ffffff00 !important;
  612. }
  613. :deep(.zxm-select-selection-item) {
  614. color: #fff !important;
  615. }
  616. :deep(.zxm-select-arrow) {
  617. color: #fff;
  618. }
  619. </style>