gasPage.vue 17 KB

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