closeWall.vue 14 KB

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