closeWall.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544
  1. <template>
  2. <div class="closeWall">
  3. <div class="title">
  4. <div class="box-container">
  5. <div class="contents">
  6. <img src="../../../../../assets/images/fire/pie.png" alt="" />
  7. <span class="text">{{ topContent.temperature }}</span>
  8. <span class="dw">°C</span>
  9. </div>
  10. <div class="contents">
  11. <div class="text">
  12. <span class="text-label">位置 : </span>
  13. <span class="text-value">{{ topContent.position }}</span>
  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>
  21. <div class="box-container">
  22. <div class="text1">{{ topContent.warn }}</div>
  23. </div>
  24. </div>
  25. <div class="content">
  26. <div class="title-b">采空区密闭参数</div>
  27. <div class="card-btn">
  28. <div
  29. :class="activeIndex == index ? 'box-container1' : 'box-container'"
  30. v-for="(item, index) in mbList"
  31. :key="index"
  32. @click="btnClick(item, index)"
  33. >
  34. <div class="box-label">
  35. <span> {{ item.label }}</span>
  36. <span>{{ item.dw }}</span>
  37. </div>
  38. <div class="box-item box-item1">
  39. <span class="text-t">{{ `${item.label1}:` }}</span>
  40. <span class="text-v">{{ item.nd }}</span>
  41. </div>
  42. <div class="box-item box-item2">
  43. <span class="text-t">{{ `${item.label2}:` }}</span>
  44. <span class="text-v">{{ item.time1 }}</span>
  45. </div>
  46. <div class="box-item box-item3">
  47. <span class="text-t">{{ `${item.label3}:` }}</span>
  48. <span class="text-v">{{ item.address }}</span>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="echart-box">
  53. <div class="title-f">
  54. <div class="title-text">{{ `${type}趋势` }}</div>
  55. </div>
  56. <div class="echarts-box">
  57. <echartLine1 :echartDataSg="echartDataSg1" :lengedDataName="echartDataSg1.lengedDataName" />
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. </template>
  63. <script lang="ts" setup>
  64. import { onMounted, ref, reactive, watch, defineProps } from 'vue';
  65. import echartLine1 from './echartLine1.vue';
  66. let props = defineProps({
  67. listData: Object,
  68. });
  69. //密闭-顶部区域数据
  70. let topContent = reactive({
  71. temperature: 0,
  72. position: '',
  73. time: '',
  74. warn: '',
  75. });
  76. //密闭参数列表
  77. let mbList = reactive([
  78. {
  79. label: 'O₂',
  80. dw: '(%)',
  81. label1: '浓度',
  82. label2: '时间',
  83. label3: '位置',
  84. nd: '0',
  85. time1: '',
  86. address: '',
  87. },
  88. {
  89. label: 'CO',
  90. dw: '(ppm)',
  91. label1: '浓度',
  92. label2: '时间',
  93. label3: '位置',
  94. nd: '0',
  95. time1: '',
  96. address: '',
  97. },
  98. {
  99. label: 'CO₂',
  100. dw: '(%)',
  101. label1: '浓度',
  102. label2: '时间',
  103. label3: '位置',
  104. nd: '0',
  105. time1: '',
  106. address: '',
  107. },
  108. {
  109. label: 'CH₄',
  110. dw: '(%)',
  111. label1: '浓度',
  112. label2: '时间',
  113. label3: '位置',
  114. nd: '0',
  115. time1: '',
  116. address: '',
  117. },
  118. {
  119. label: 'C₂H₂',
  120. dw: '(ppm)',
  121. label1: '浓度',
  122. label2: '时间',
  123. label3: '位置',
  124. nd: '0',
  125. time1: '',
  126. address: '',
  127. },
  128. {
  129. label: 'C₂H₄',
  130. dw: '(ppm)',
  131. label1: '浓度',
  132. label2: '时间',
  133. label3: '位置',
  134. nd: '0',
  135. time1: '',
  136. address: '',
  137. },
  138. ]);
  139. //当前密闭参数激活选项
  140. let activeIndex = ref(0);
  141. //当前激活密闭参数类型
  142. let type = ref('O₂');
  143. let echartDataSg1 = reactive({
  144. xData: [],
  145. yData: [],
  146. lengedData: 'O₂',
  147. lengedDataName: '(%)',
  148. });
  149. let echartDataSgList = reactive<any[]>([]);
  150. //密闭参数选项切换
  151. function btnClick(item, ind) {
  152. activeIndex.value = ind;
  153. type.value = item.label;
  154. echartDataSg1.xData.length = 0;
  155. echartDataSg1.yData.length = 0;
  156. echartDataSg1.lengedData = type.value;
  157. echartDataSg1.lengedDataName = item.dw;
  158. switch (type.value) {
  159. case 'O₂':
  160. echartDataSgList.forEach((el) => {
  161. echartDataSg1.xData.push(el.time);
  162. echartDataSg1.yData.push(el.o2val);
  163. });
  164. break;
  165. case 'C₂H₄':
  166. echartDataSgList.forEach((el) => {
  167. echartDataSg1.xData.push(el.time);
  168. echartDataSg1.yData.push(el.ch2val);
  169. });
  170. break;
  171. case 'CO':
  172. echartDataSgList.forEach((el) => {
  173. echartDataSg1.xData.push(el.time);
  174. echartDataSg1.yData.push(el.coval);
  175. });
  176. break;
  177. case 'CH₄':
  178. echartDataSgList.forEach((el) => {
  179. echartDataSg1.xData.push(el.time);
  180. echartDataSg1.yData.push(el.chval);
  181. });
  182. break;
  183. case 'CO₂':
  184. echartDataSgList.forEach((el) => {
  185. echartDataSg1.xData.push(el.time);
  186. echartDataSg1.yData.push(el.co2val);
  187. });
  188. break;
  189. case 'C₂H₂':
  190. echartDataSgList.forEach((el) => {
  191. echartDataSg1.xData.push(el.time);
  192. echartDataSg1.yData.push(el.gasval);
  193. });
  194. break;
  195. }
  196. }
  197. watch(
  198. () => props.listData,
  199. (val) => {
  200. console.log(val, 'val---');
  201. echartDataSg1.xData.length = 0;
  202. echartDataSg1.yData.length = 0;
  203. echartDataSgList.length = 0;
  204. if (JSON.stringify(val) != '{}') {
  205. if (val.bundletube.length != 0) {
  206. topContent.temperature = val.temperature[0] ? val.temperature[0].readData.temperature : '--';
  207. topContent.position = val.bundletube[0].strinstallpos || '--';
  208. topContent.time = val.bundletube[0].readTime || '--';
  209. topContent.warn =
  210. val.bundletube[0].warnLevel == 0
  211. ? '正常'
  212. : val.bundletube[0].warnLevel == 101
  213. ? '较低风险'
  214. : val.bundletube[0].warnLevel == 102
  215. ? '低风险'
  216. : val.bundletube[0].warnLevel == 103
  217. ? '中风险'
  218. : val.bundletube[0].warnLevel == 104
  219. ? '高风险'
  220. : val.bundletube[0].warnLevel == 201
  221. ? '报警'
  222. : '正常';
  223. mbList[0].nd = val.bundletube[0].readData.o2val || '--';
  224. mbList[1].nd = val.bundletube[0].readData.coval || '--';
  225. mbList[2].nd = val.bundletube[0].readData.co2val || '--';
  226. mbList[3].nd = val.bundletube[0].readData.chval || '--';
  227. mbList[4].nd = val.bundletube[0].readData.ch2val || '--';
  228. mbList[5].nd = val.bundletube[0].readData.gasval || '--';
  229. mbList.forEach((el) => {
  230. el.time1 = val.bundletube[0] ? val.bundletube[0].readTime.substring(0, val.bundletube[0].readTime.lastIndexOf(':')) : '--';
  231. el.address = val.bundletube[0] ? val.bundletube[0].strinstallpos : '--';
  232. });
  233. val.bundletube[0].history.forEach((v) => {
  234. echartDataSg1.xData.push(v.time);
  235. if (echartDataSg1.lengedData == 'O₂') {
  236. echartDataSg1.yData.push(v.o2val);
  237. } else if (echartDataSg1.lengedData == 'C₂H₄') {
  238. echartDataSg1.yData.push(v.ch2val);
  239. } else if (echartDataSg1.lengedData == 'CO') {
  240. echartDataSg1.yData.push(v.coval);
  241. } else if (echartDataSg1.lengedData == 'CH₄') {
  242. echartDataSg1.yData.push(v.chval);
  243. } else if (echartDataSg1.lengedData == 'CO₂') {
  244. echartDataSg1.yData.push(v.co2val);
  245. } else if (echartDataSg1.lengedData == 'C₂H₂') {
  246. echartDataSg1.yData.push(v.gasval);
  247. }
  248. echartDataSgList.push(v);
  249. });
  250. } else {
  251. topContent.temperature = 0;
  252. topContent.position = '--';
  253. topContent.time = '--';
  254. topContent.warn = '正常';
  255. mbList[0].nd = '--';
  256. mbList[1].nd = '--';
  257. mbList[2].nd = '--';
  258. mbList[3].nd = '--';
  259. mbList[4].nd = '--';
  260. mbList[5].nd = '--';
  261. mbList.forEach((el) => {
  262. el.time1 = '--';
  263. el.address = '--';
  264. });
  265. }
  266. }
  267. },
  268. { immediate: true, deep: true }
  269. );
  270. </script>
  271. <style lang="less" scoped>
  272. .closeWall {
  273. width: 100%;
  274. height: 100%;
  275. padding: 20px;
  276. box-sizing: border-box;
  277. .title {
  278. width: 100%;
  279. height: 17%;
  280. margin-bottom: 20px;
  281. display: flex;
  282. justify-content: space-between;
  283. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  284. background-size: 100% 100%;
  285. align-items: center;
  286. .box-container {
  287. display: flex;
  288. &:nth-child(1) {
  289. justify-content: space-around;
  290. align-items: center;
  291. flex: 2;
  292. height: 100%;
  293. border-right: 2px solid;
  294. border-image: linear-gradient(to bottom, transparent, rgba(2, 70, 136, 1), transparent) 1 1 1;
  295. }
  296. &:nth-child(2) {
  297. flex: 1;
  298. justify-content: center;
  299. align-items: center;
  300. height: 100%;
  301. }
  302. .contents {
  303. height: 73%;
  304. &:nth-child(1) {
  305. width: 40%;
  306. display: flex;
  307. justify-content: center;
  308. align-items: center;
  309. img {
  310. position: relative;
  311. width: 23%;
  312. height: 100%;
  313. background: url('../../../../../assets/images/fire/pj.svg') no-repeat center;
  314. background-size: 50% 50%;
  315. }
  316. .text {
  317. font-family: 'douyuFont';
  318. font-size: 32px;
  319. margin: 0px 15px;
  320. color: #3df6ff;
  321. }
  322. .dw {
  323. font-size: 14px;
  324. color: #b3b8cc;
  325. }
  326. }
  327. &:nth-child(2) {
  328. width: 60%;
  329. display: flex;
  330. flex-direction: column;
  331. justify-content: space-around;
  332. .text {
  333. font-size: 14px;
  334. .text-label {
  335. color: #b3b8cc;
  336. font-weight: bold;
  337. }
  338. .text-value {
  339. font-family: 'douyuFont';
  340. color: #3df6ff;
  341. margin-left: 10px;
  342. }
  343. }
  344. }
  345. }
  346. .text1 {
  347. font-size: 16px;
  348. color: #b3b8cc;
  349. font-weight: bold;
  350. }
  351. }
  352. }
  353. .content {
  354. width: 100%;
  355. height: calc(83% - 20px);
  356. padding: 10px;
  357. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  358. background-size: 100% 100%;
  359. box-sizing: border-box;
  360. .title-b {
  361. height: 30px;
  362. line-height: 30px;
  363. font-family: 'douyuFont';
  364. font-size: 14px;
  365. color: #fff;
  366. // color: #3df6ff;
  367. }
  368. .card-btn {
  369. height: 28%;
  370. margin-bottom: 10px;
  371. display: flex;
  372. justify-content: space-between;
  373. .box-container {
  374. position: relative;
  375. width: 16%;
  376. height: 100%;
  377. background: url('../../../../../assets/images/fire/1.png') no-repeat center;
  378. background-size: 100% 100%;
  379. cursor: pointer;
  380. .box-label {
  381. position: absolute;
  382. left: 50%;
  383. top: 2px;
  384. transform: translate(-50%);
  385. color: #fff;
  386. }
  387. .box-item {
  388. position: absolute;
  389. left: 50%;
  390. transform: translate(-50%, 0);
  391. width: 89%;
  392. height: 16%;
  393. padding: 0px 10px;
  394. display: flex;
  395. justify-content: space-between;
  396. align-items: center;
  397. background: url('../../../../../assets/images/fire/contetn.png') no-repeat center;
  398. background-size: 100% 100%;
  399. .text-t {
  400. width: 17%;
  401. color: #fff;
  402. font-size: 12px;
  403. }
  404. .text-v {
  405. width: 83%;
  406. font-family: 'douyuFont';
  407. font-size: 10px;
  408. color: #3df6ff;
  409. display: flex;
  410. justify-content: flex-end;
  411. }
  412. }
  413. .box-item1 {
  414. top: 24%;
  415. }
  416. .box-item2 {
  417. top: 50%;
  418. }
  419. .box-item3 {
  420. top: 75%;
  421. }
  422. }
  423. .box-container1 {
  424. position: relative;
  425. width: 16%;
  426. height: 100%;
  427. background: url('../../../../../assets/images/fire/2.png') no-repeat center;
  428. background-size: 100% 100%;
  429. cursor: pointer;
  430. .box-label {
  431. position: absolute;
  432. left: 50%;
  433. top: 2px;
  434. transform: translate(-50%);
  435. color: #fff;
  436. }
  437. .box-item {
  438. position: absolute;
  439. left: 50%;
  440. transform: translate(-50%, 0);
  441. width: 89%;
  442. height: 16%;
  443. padding: 0px 10px;
  444. display: flex;
  445. justify-content: space-between;
  446. align-items: center;
  447. background: url('../../../../../assets/images/fire/contetn.png') no-repeat center;
  448. background-size: 100% 100%;
  449. .text-t {
  450. width: 17%;
  451. color: #fff;
  452. font-size: 12px;
  453. }
  454. .text-v {
  455. width: 83%;
  456. font-family: 'douyuFont';
  457. font-size: 10px;
  458. color: #3df6ff;
  459. display: flex;
  460. justify-content: flex-end;
  461. }
  462. }
  463. .box-item1 {
  464. top: 19%;
  465. }
  466. .box-item2 {
  467. top: 41%;
  468. }
  469. .box-item3 {
  470. top: 63%;
  471. }
  472. }
  473. }
  474. .echart-box {
  475. height: calc(72% - 41px);
  476. border: 1px solid #114aac;
  477. .title-f {
  478. height: 40px;
  479. padding: 0px 10px;
  480. box-sizing: border-box;
  481. display: flex;
  482. justify-content: space-between;
  483. align-items: center;
  484. .title-text {
  485. font-family: 'douyuFont';
  486. font-size: 14px;
  487. color: #fff;
  488. // color: #3df6ff;
  489. }
  490. }
  491. .echarts-box {
  492. height: calc(100% - 40px);
  493. }
  494. }
  495. }
  496. }
  497. </style>