gasWarn.vue 21 KB

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