gasPage.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563
  1. <template>
  2. <div class="gasPage">
  3. <div class="top-area" v-if="topAreaListWs.length != 0">
  4. <div class="title-t">
  5. <div class="text-t">瓦斯抽采泵信息</div>
  6. </div>
  7. <div class="top-box" v-for="(item, index) in topAreaListWs" :key="index">
  8. <div class="box-label">{{ item.label }}</div>
  9. <div class="box-values">
  10. <div class="value-b" v-for="(items, ind) in item.list" :key="ind">
  11. <span>{{ `${items.name} : ` }}</span>
  12. <span :class="{
  13. 'box-value': items.val == 0 && items.name == '报警状态',
  14. 'box-value1': items.val == 101 && items.name == '报警状态',
  15. 'box-value2': items.val == 102 && items.name == '报警状态',
  16. 'box-value3': items.val == 103 && items.name == '报警状态',
  17. 'box-value4': items.val == 104 && items.name == '报警状态',
  18. 'box-value5': items.val == 201 && items.name == '报警状态',
  19. }">{{ items.val == 0 && items.name == '报警状态' ? '正常' : items.val == 101 && items.name == '报警状态'
  20. ? '较低风险'
  21. : items.val == 102 && items.name == '报警状态' ? '低风险' : items.val == 103 && items.name == '报警状态' ?
  22. '中风险' :
  23. items.val == 104 && items.name == '报警状态' ? '高风险' : items.val == 201 && items.name == '报警状态' ?
  24. '报警' :
  25. items.val }}</span>
  26. </div>
  27. </div>
  28. </div>
  29. <!-- <div class="bt-box">
  30. <div
  31. :class="{
  32. 'box-value': warnText == 0,
  33. 'box-value1': warnText == 101,
  34. 'box-value2': warnText == 102,
  35. 'box-value3': warnText == 103,
  36. 'box-value4': warnText == 104,
  37. 'box-value5': warnText == 201,
  38. }"
  39. >{{
  40. warnText == 0
  41. ? '正常'
  42. : warnText == 101
  43. ? '较低风险'
  44. : warnText == 102
  45. ? '低风险'
  46. : warnText == 103
  47. ? '中风险'
  48. : warnText == 104
  49. ? '高风险'
  50. : warnText == 201
  51. ? '报警'
  52. : warnText
  53. }}</div
  54. >
  55. </div> -->
  56. </div>
  57. <div :class="topAreaListWs.length != 0 ? 'bot-area' : 'bot-area1'">
  58. <div class="title-b">
  59. <div class="text-b">安全监控测点信息</div>
  60. </div>
  61. <div class="content-b">
  62. <div class="card-b" v-for="(item, index) in cardListWs" :key="index">
  63. <div class="item-l">
  64. <div class="label-l">{{ item.label }}</div>
  65. <div class="value-l">{{ `${item.value}%` }}</div>
  66. </div>
  67. <div class="item-r">
  68. <div class="content-r" v-for="(items, ind) in item.listR" :key="ind">
  69. <span>{{ `${items.label} : ` }}</span>
  70. <span :class="{
  71. 'status-f': items.value == 1,
  72. 'status-l': items.value == 0,
  73. }">{{ items.value == 1 ? '异常' : items.value == 0 ? '正常' : items.value }}</span>
  74. </div>
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </template>
  81. <script lang="ts" setup>
  82. import { onMounted, ref, reactive, watch, markRaw, defineProps } from 'vue';
  83. let props = defineProps({
  84. listData: Object,
  85. });
  86. //瓦斯顶部区域数据
  87. let topAreaListWs = reactive<any[]>([]);
  88. //瓦斯监控列表数据
  89. let cardListWs = reactive<any[]>([]);
  90. let warnText = ref(0);
  91. watch(
  92. () => props.listData,
  93. (val) => {
  94. console.log(val, '瓦斯详情数据-------');
  95. topAreaListWs.length = 0;
  96. cardListWs.length = 0;
  97. if (JSON.stringify(val.common) != '{}') {
  98. warnText.value = val.common.pump.length != 0 && val.common.pump[0].warnLevel != null ? val.common.pump[0].warnLevel : 0;
  99. console.log(warnText.value, ' warnText.value-------')
  100. val.common.pump.forEach((v) => {
  101. topAreaListWs.push({
  102. label: v.strinstallpos || '--',
  103. list: [
  104. // { name: '抽采泵流量', val: v.readData.FlowSensor_InputFlux || 0 },
  105. { name: '报警状态', val: v.warnLevel || 0 },
  106. { name: '输入管道内一氧化碳(ppm)', val: v.readData.coVal && v.readData.coVal != '0' ? v.readData.coVal : '-' },
  107. { name: '管路出口处瓦斯(%CH4)', val: v.readData.gas1 && v.readData.gas1 != '0' ? v.readData.gas1 : '-' }, //v.readData.gas1
  108. { name: '泵站内瓦斯(%CH4)', val: v.readData.gas2 && v.readData.gas2 != '0' ? v.readData.gas2 : '-' }, //v.readData.gas2
  109. { name: '输入管道内瓦斯(%CH4)', val: v.readData.gas3 && v.readData.gas3 != '0' ? v.readData.gas3 : '-' }, //v.readData.gas3
  110. { name: '管道输出瓦斯(%CH4)', val: v.readData.gas4 && v.readData.gas4 != '0' ? v.readData.gas4 : '-' }, //v.readData.gas4
  111. { name: '输入管道内工混流量(m³/min)', val: v.readData.mixedTraffic && v.readData.mixedTraffic != '0' ? v.readData.mixedTraffic : '-' }, //v.readData.mixedTraffic
  112. { name: '输入管道内标况流量(m³/min)', val: v.readData.standardTraffic && v.readData.standardTraffic != '0' ? v.readData.standardTraffic : '-' }, //v.readData.standardTraffic
  113. { name: '瓦斯抽放量(m³)', val: v.readData.totalGasDrainage && v.readData.totalGasDrainage != '0' ? v.readData.totalGasDrainage : '-' },
  114. ],
  115. });
  116. });
  117. val.common.gas.forEach((el) => {
  118. el.strinstallpos = el.strinstallpos.indexOf('&') == -1 ? el.strinstallpos : el.strinstallpos.substring(0, el.strinstallpos.indexOf('&'));
  119. cardListWs.push({
  120. label: '甲烷',
  121. value: el.readData.gasC || '--',
  122. listR: [
  123. { id: 0, label: '测点类型', value: '瓦斯' },
  124. { id: 1, label: '测点位置', value: el.strinstallpos || '--' },
  125. { id: 2, label: '数据时间', value: el.readData.datetime || '--' },
  126. { id: 3, label: '测点状态', value: el.warnFlag },
  127. ],
  128. });
  129. });
  130. }
  131. },
  132. { immediate: true, deep: true }
  133. );
  134. </script>
  135. <style lang="less" scoped>
  136. @font-face {
  137. font-family: 'douyuFont';
  138. src: url('../../../../assets/font/douyuFont.otf');
  139. }
  140. .gasPage {
  141. width: 100%;
  142. height: 100%;
  143. padding: 20px;
  144. box-sizing: border-box;
  145. .top-area {
  146. height: 356px;
  147. margin-bottom: 10px;
  148. padding: 10px 15px;
  149. // display: flex;
  150. // justify-content: space-between;
  151. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  152. background-size: 100% 100%;
  153. box-sizing: border-box;
  154. .title-t {
  155. height: 30px;
  156. margin-bottom: 10px;
  157. display: flex;
  158. justify-content: space-between;
  159. align-items: center;
  160. .text-t {
  161. font-family: 'douyuFont';
  162. font-size: 16px;
  163. }
  164. }
  165. .top-box {
  166. position: relative;
  167. width: 724px;
  168. height: 276px;
  169. background: url('../../../../../assets/images/fire/top-area.png') no-repeat center;
  170. background-size: 100% 100%;
  171. .box-label {
  172. position: absolute;
  173. left: 50%;
  174. top: 198px;
  175. transform: translate(-50%, 0);
  176. width: 80%;
  177. font-family: 'douyuFont';
  178. font-size: 24px;
  179. display: flex;
  180. justify-content: center;
  181. align-items: center;
  182. word-wrap: break-word;
  183. }
  184. .box-values {
  185. position: absolute;
  186. left: 50%;
  187. top: 26px;
  188. transform: translate(-50%, 0);
  189. width: 84%;
  190. // height: 26px;
  191. display: flex;
  192. justify-content: space-between;
  193. align-items: center;
  194. flex-wrap: wrap;
  195. .value-b {
  196. width: calc(50% - 10px);
  197. height: 25px;
  198. display: flex;
  199. justify-content: space-between;
  200. align-items: center;
  201. span {
  202. font-size: 14px;
  203. &:last-child {
  204. font-family: 'douyuFont';
  205. color: rgb(0, 242, 255);
  206. }
  207. }
  208. .box-value {
  209. color: rgb(145, 230, 9) !important;
  210. }
  211. .box-value1 {
  212. color: rgb(0, 242, 255) !important;
  213. }
  214. .box-value2 {
  215. color: #ffff35 !important;
  216. }
  217. .box-value3 {
  218. color: #ffbe69 !important;
  219. }
  220. .box-value4 {
  221. color: #ff6f00 !important;
  222. }
  223. .box-value5 {
  224. color: #ff0000 !important;
  225. }
  226. }
  227. }
  228. }
  229. }
  230. .bot-area {
  231. height: calc(100% - 356px);
  232. padding: 10px 15px 0px 15px;
  233. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  234. background-size: 100% 100%;
  235. box-sizing: border-box;
  236. .title-b {
  237. height: 30px;
  238. margin-bottom: 10px;
  239. display: flex;
  240. justify-content: space-between;
  241. align-items: center;
  242. .text-b {
  243. font-family: 'douyuFont';
  244. font-size: 16px;
  245. }
  246. }
  247. .content-b {
  248. height: calc(100% - 40px);
  249. display: flex;
  250. justify-content: flex-start;
  251. align-items: flex-start;
  252. flex-wrap: wrap;
  253. overflow-y: auto;
  254. .card-b {
  255. position: relative;
  256. width: 23%;
  257. height: 128px;
  258. margin: 0px 15px 15px 15px;
  259. background: url('../../../../../assets/images/fire/bot-area.png') no-repeat center;
  260. background-size: 100% 100%;
  261. .item-l {
  262. position: absolute;
  263. left: 32px;
  264. top: 50%;
  265. transform: translate(0, -50%);
  266. width: 89px;
  267. height: 98px;
  268. background: url('../../../../../assets/images/fire/bot-area1.png') no-repeat center;
  269. .label-l {
  270. position: absolute;
  271. left: 50%;
  272. top: 7px;
  273. transform: translate(-50%, 0);
  274. }
  275. .value-l {
  276. position: absolute;
  277. left: 50%;
  278. top: 50px;
  279. transform: translate(-50%, 0);
  280. font-family: 'douyuFont';
  281. font-size: 16px;
  282. color: #3df6ff;
  283. }
  284. }
  285. @media screen and (max-width: 1920px) {
  286. .item-r {
  287. position: absolute;
  288. left: 132px;
  289. top: 50%;
  290. transform: translate(0, -50%);
  291. height: 128px;
  292. padding: 5px 0px;
  293. display: flex;
  294. flex-direction: column;
  295. justify-content: space-around;
  296. box-sizing: border-box;
  297. .content-r {
  298. display: flex;
  299. span {
  300. font-size: 14px;
  301. &:first-child {
  302. display: inline-block;
  303. width: 68px;
  304. }
  305. &:last-child {
  306. display: inline-block;
  307. width: calc(100% - 68px);
  308. }
  309. }
  310. .status-f {
  311. color: #ff0000;
  312. }
  313. .status-l {
  314. color: #3df6ff;
  315. }
  316. }
  317. }
  318. }
  319. @media screen and (min-width: 1921px) and (max-width: 2560px) {
  320. .item-r {
  321. position: absolute;
  322. left: 138px;
  323. top: 50%;
  324. transform: translate(0, -50%);
  325. width: calc(100% - 138px);
  326. height: 128px;
  327. padding: 5px 0px;
  328. display: flex;
  329. flex-direction: column;
  330. justify-content: space-around;
  331. box-sizing: border-box;
  332. .content-r {
  333. display: flex;
  334. span {
  335. font-size: 14px;
  336. &:first-child {
  337. display: inline-block;
  338. width: 68px;
  339. }
  340. &:last-child {
  341. display: inline-block;
  342. width: calc(100% - 68px);
  343. }
  344. }
  345. .status-f {
  346. color: #ff0000;
  347. }
  348. .status-l {
  349. color: #3df6ff;
  350. }
  351. }
  352. }
  353. }
  354. }
  355. }
  356. }
  357. .bot-area1 {
  358. height: 100%;
  359. padding: 10px 15px 0px 15px;
  360. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  361. background-size: 100% 100%;
  362. box-sizing: border-box;
  363. .title-b {
  364. height: 30px;
  365. margin-bottom: 10px;
  366. display: flex;
  367. justify-content: space-between;
  368. align-items: center;
  369. .text-b {
  370. font-family: 'douyuFont';
  371. font-size: 16px;
  372. }
  373. // .select-b {
  374. // display: flex;
  375. // justify-content: flex-start;
  376. // align-items: center;
  377. // }
  378. }
  379. .content-b {
  380. height: calc(100% - 40px);
  381. display: flex;
  382. justify-content: flex-start;
  383. align-items: flex-start;
  384. flex-wrap: wrap;
  385. overflow-y: auto;
  386. .card-b {
  387. position: relative;
  388. width: 23%;
  389. height: 128px;
  390. margin: 0px 15px 15px 15px;
  391. background: url('../../../../../assets/images/fire/bot-area.png') no-repeat center;
  392. background-size: 100% 100%;
  393. .item-l {
  394. position: absolute;
  395. left: 32px;
  396. top: 50%;
  397. transform: translate(0, -50%);
  398. width: 89px;
  399. height: 98px;
  400. background: url('../../../../../assets/images/fire/bot-area1.png') no-repeat center;
  401. .label-l {
  402. position: absolute;
  403. left: 50%;
  404. top: 7px;
  405. transform: translate(-50%, 0);
  406. }
  407. .value-l {
  408. position: absolute;
  409. left: 50%;
  410. top: 50px;
  411. transform: translate(-50%, 0);
  412. font-family: 'douyuFont';
  413. font-size: 16px;
  414. color: #3df6ff;
  415. }
  416. }
  417. @media screen and (max-width: 1920px) {
  418. .item-r {
  419. position: absolute;
  420. left: 132px;
  421. top: 50%;
  422. transform: translate(0, -50%);
  423. height: 128px;
  424. padding: 5px 0px;
  425. display: flex;
  426. flex-direction: column;
  427. justify-content: space-around;
  428. box-sizing: border-box;
  429. .content-r {
  430. display: flex;
  431. span {
  432. font-size: 14px;
  433. &:first-child {
  434. display: inline-block;
  435. width: 68px;
  436. }
  437. &:last-child {
  438. display: inline-block;
  439. width: calc(100% - 68px);
  440. }
  441. }
  442. .status-f {
  443. color: #ff0000;
  444. }
  445. .status-l {
  446. color: #3df6ff;
  447. }
  448. }
  449. }
  450. }
  451. @media screen and (min-width: 1921px) and (max-width: 2560px) {
  452. .item-r {
  453. position: absolute;
  454. left: 138px;
  455. top: 50%;
  456. transform: translate(0, -50%);
  457. width: calc(100% - 138px);
  458. height: 128px;
  459. padding: 5px 0px;
  460. display: flex;
  461. flex-direction: column;
  462. justify-content: space-around;
  463. box-sizing: border-box;
  464. .content-r {
  465. display: flex;
  466. span {
  467. font-size: 14px;
  468. &:first-child {
  469. display: inline-block;
  470. width: 68px;
  471. }
  472. &:last-child {
  473. display: inline-block;
  474. width: calc(100% - 68px);
  475. }
  476. }
  477. .status-f {
  478. color: #ff0000;
  479. }
  480. .status-l {
  481. color: #3df6ff;
  482. }
  483. }
  484. }
  485. }
  486. }
  487. }
  488. }
  489. }
  490. </style>