gasWarn.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714
  1. <template>
  2. <customHeader :options="options" @change="getSelectRow" :optionValue="optionValue"> 瓦斯监测预警 </customHeader>
  3. <div class="gasWarn">
  4. <a-button v-if="!hasPermission('gasWarn:return')" preIcon="ant-design:rollback-outlined" type="text" size="small"
  5. style="position: absolute; left: 15px; top: 15px; color: #fff" @click="getBack">返回</a-button>
  6. <div class="alarm-menu">
  7. <div class="type-btn">
  8. <div :class="activeIndex == index ? 'btn1' : 'btn'" :style="{width:sysOrgCode=='sdmtjtdltmk' ? '50%' : '33.33%' }" v-for="(item, index) in typeMenuListGas" :key="index"
  9. @click="btnClick(index)">
  10. {{ item.name }}
  11. </div>
  12. </div>
  13. <div class="card-btn">
  14. <div :class="activeIndex1 == ind ? 'btn1' : 'btn'" v-for="(item, ind) in menuList" :key="ind"
  15. @click="cardClick(ind, item)">
  16. <div class="text">{{ item.name }}</div>
  17. <div class="warn">{{ item.warn }}</div>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="gas-content">
  22. <div style="width: 100%; height: 100%" v-if="isShow == 'yjjc'">
  23. <div class="top-area" v-if="topAreaListWs.length != 0">
  24. <div class="title-t">
  25. <div class="text-t">瓦斯抽采泵信息</div>
  26. </div>
  27. <div class="content-t">
  28. <div class="top-box" v-for="(item, index) in topAreaListWs" :key="index">
  29. <div class="box-label">{{ item.label }}</div>
  30. <div class="box-values">
  31. <div class="value-b" v-for="(items, ind) in item.list" :key="ind">
  32. <span>{{ `${items.name} : ` }}</span>
  33. <span :class="{
  34. 'box-value': items.val == 0 && items.name == '报警状态',
  35. 'box-value1': items.val == 101 && items.name == '报警状态',
  36. 'box-value2': items.val == 102 && items.name == '报警状态',
  37. 'box-value3': items.val == 103 && items.name == '报警状态',
  38. 'box-value4': items.val == 104 && items.name == '报警状态',
  39. 'box-value5': (items.val == 201 || item.val == 1001) && items.name == '报警状态',
  40. }">{{
  41. items.val == 0 && items.name == '报警状态'
  42. ? '正常'
  43. : items.val == 101 && items.name == '报警状态'
  44. ? '较低风险'
  45. : items.val == 102 && items.name == '报警状态'
  46. ? '低风险'
  47. : items.val == 103 && items.name == '报警状态'
  48. ? '中风险'
  49. : items.val == 104 && items.name == '报警状态'
  50. ? '高风险'
  51. : items.val == 201 && items.name == '报警状态'
  52. ? '报警'
  53. : items.val == 1001 && items.name == '报警状态'
  54. ? '网络断开'
  55. : items.val
  56. }}</span>
  57. </div>
  58. </div>
  59. </div>
  60. </div>
  61. </div>
  62. <div :class="topAreaListWs.length != 0 ? 'bot-area' : 'bot-area1'">
  63. <div class="title-b">
  64. <div class="text-b">安全监控测点信息</div>
  65. </div>
  66. <div class="content-b">
  67. <div class="content-b-item">
  68. <div class="card-b" v-for="(item, index) in cardListWs" :key="index">
  69. <div class="item-l">
  70. <div class="label-l">{{ item.label }}</div>
  71. <div class="value-l">{{ `${item.value}%` }}</div>
  72. </div>
  73. <div class="item-r">
  74. <div class="content-r" v-for="(items, ind) in item.listR" :key="ind">
  75. <span>{{ `${items.label} : ` }}</span>
  76. <span :class="{
  77. 'status-f': items.value == 1,
  78. 'status-l': items.value == 0,
  79. }">{{ items.value == 1 ? '异常' : items.value == 0 ? '正常' : items.value }}</span>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. </div>
  86. </div>
  87. <div style="width: 100%; height: 100%" v-else-if="isShow == 'yjzb'">
  88. <warnTargetGas />
  89. </div>
  90. <div style="width: 100%; height: 100%" v-else-if="isShow == 'wscs'">
  91. <gasParamter />
  92. </div>
  93. </div>
  94. </div>
  95. </template>
  96. <script setup lang="ts">
  97. import { ref, reactive, onMounted, onUnmounted } from 'vue';
  98. import { sysTypeWarnList, sysWarn } from '../common.api';
  99. import { useSystemSelect } from '/@/hooks/vent/useSystemSelect';
  100. import { useRouter } from 'vue-router';
  101. import CustomHeader from '/@/components/vent/customHeader.vue';
  102. import warnTargetGas from '../common/warnTargetGas.vue';
  103. import gasParamter from '../common/gasParamter.vue';
  104. import { getMonitorComponent } from '../common.data';
  105. import { usePermission } from '/@/hooks/web/usePermission';
  106. import { useGlobSetting } from '/@/hooks/setting';
  107. let typeMenuListGas=getMonitorComponent()
  108. const { sysOrgCode } = useGlobSetting();
  109. const { hasPermission } = usePermission();
  110. const { options, optionValue, getSelectRow, getSysDataSource } = useSystemSelect('sys_surface_caimei'); // 参数为场景类型(设备类型管理中可以查询到)
  111. //当前左侧激活菜单的索引
  112. let activeIndex1 = ref(0);
  113. //左侧数据列表
  114. let menuList = reactive<any[]>([]);
  115. //瓦斯顶部区域数据
  116. let topAreaListWs = reactive<any[]>([]);
  117. //瓦斯监控列表数据
  118. let cardListWs = reactive<any[]>([]);
  119. let router = useRouter();
  120. //监测/指标激活索引
  121. let activeIndex = ref(0);
  122. let isShow = ref('yjjc');
  123. // https获取监测数据
  124. let timer: null | NodeJS.Timeout = null;
  125. function getMonitor(deviceID, flag?) {
  126. timer = setTimeout(
  127. async () => {
  128. await getSysWarnList(deviceID, 'gas');
  129. if (timer) {
  130. timer = null;
  131. }
  132. getMonitor(deviceID);
  133. },
  134. flag ? 0 : 1000
  135. );
  136. }
  137. //返回首页
  138. function getBack() {
  139. router.push('/monitorChannel/monitor-alarm-home');
  140. }
  141. //获取预警详情弹窗右侧数据
  142. function getSysWarnList(id, type) {
  143. sysWarn({ sysid: id, type: type }).then((res) => {
  144. // listData.common = res;
  145. topAreaListWs.length = 0;
  146. cardListWs.length = 0;
  147. if (JSON.stringify(res) != '{}') {
  148. res.pump.forEach((v) => {
  149. topAreaListWs.push({
  150. label: v.strinstallpos || '--',
  151. list: [
  152. // { name: '抽采泵流量', val: v.readData.FlowSensor_InputFlux || 0 },
  153. { name: '报警状态', val: v.warnLevel || 0 },
  154. { name: '输入管道内一氧化碳(ppm)', val: v.readData.coVal && v.readData.coVal != '0' ? v.readData.coVal : '-' },
  155. { name: '管路出口处瓦斯(%CH4)', val: v.readData.gas1 && v.readData.gas1 != '0' ? v.readData.gas1 : '-' }, //v.readData.gas1
  156. { name: '泵站内瓦斯(%CH4)', val: v.readData.gas2 && v.readData.gas2 != '0' ? v.readData.gas2 : '-' }, //v.readData.gas2
  157. { name: '输入管道内瓦斯(%CH4)', val: v.readData.gas3 && v.readData.gas3 != '0' ? v.readData.gas3 : '-' }, //v.readData.gas3
  158. { name: '管道输出瓦斯(%CH4)', val: v.readData.gas4 && v.readData.gas4 != '0' ? v.readData.gas4 : '-' }, //v.readData.gas4
  159. { name: '输入管道内工混流量(m³/min)', val: v.readData.mixedTraffic && v.readData.mixedTraffic != '0' ? v.readData.mixedTraffic : '-' }, //v.readData.mixedTraffic
  160. {
  161. name: '输入管道内标况流量(m³/min)',
  162. val: v.readData.standardTraffic && v.readData.standardTraffic != '0' ? v.readData.standardTraffic : '-',
  163. }, //v.readData.standardTraffic
  164. { name: '瓦斯抽放量(m³)', val: v.readData.totalGasDrainage && v.readData.totalGasDrainage != '0' ? v.readData.totalGasDrainage : '-' },
  165. ],
  166. });
  167. });
  168. res.gas.forEach((el) => {
  169. el.strinstallpos = el.strinstallpos.indexOf('&') == -1 ? el.strinstallpos : el.strinstallpos.substring(0, el.strinstallpos.indexOf('&'));
  170. cardListWs.push({
  171. label: '甲烷',
  172. value: el.readData.gasC || '--',
  173. // value: 0,
  174. listR: [
  175. { id: 0, label: '测点类型', value: '瓦斯' },
  176. { id: 1, label: '测点位置', value: el.strinstallpos || '--' },
  177. // { id: 2, label: '数据时间', value: el.readData.datetime || '--' },
  178. { id: 2, label: '数据时间', value: el.readTime || '--' },
  179. { id: 3, label: '测点状态', value: el.warnFlag },
  180. ],
  181. });
  182. });
  183. }
  184. });
  185. }
  186. //获取左侧菜单列表
  187. async function getMenuList() {
  188. let res = await sysTypeWarnList({ type: 'gas' });
  189. if (res.length != 0) {
  190. menuList.length = 0;
  191. res.forEach((el) => {
  192. menuList.push({
  193. name: el.systemname,
  194. warn: '低风险',
  195. deviceID: el.id,
  196. strtype: el.strtype,
  197. });
  198. });
  199. getMonitor(menuList[0].deviceID, true);
  200. }
  201. }
  202. //监测/预警指标选项切换
  203. function btnClick(ind) {
  204. activeIndex.value = ind;
  205. clearTimeout(timer);
  206. switch (ind) {
  207. case 0:
  208. activeIndex1.value = 0;
  209. isShow.value = 'yjjc';
  210. break;
  211. case 1:
  212. activeIndex1.value = 0;
  213. isShow.value = 'yjzb';
  214. break;
  215. case 2:
  216. activeIndex1.value = 0;
  217. isShow.value = 'wscs';
  218. break;
  219. }
  220. }
  221. //菜单选项切换
  222. function cardClick(ind, item) {
  223. activeIndex1.value = ind;
  224. clearTimeout(timer);
  225. getMonitor(item.deviceID, true);
  226. }
  227. onMounted(() => {
  228. getMenuList();
  229. });
  230. onUnmounted(() => {
  231. if (timer) {
  232. clearTimeout(timer);
  233. timer = undefined;
  234. }
  235. });
  236. </script>
  237. <style lang="less" scoped>
  238. .gasWarn {
  239. width: 100%;
  240. height: 100%;
  241. padding: 80px 10px 15px 10px;
  242. box-sizing: border-box;
  243. display: flex;
  244. justify-content: space-between;
  245. .alarm-menu {
  246. height: 100%;
  247. width: 15%;
  248. .type-btn {
  249. width: 100%;
  250. height: 28px;
  251. line-height: 28px;
  252. border: 1px solid #0058ee;
  253. margin-bottom: 20px;
  254. border-radius: 5px;
  255. box-sizing: border-box;
  256. display: flex;
  257. justify-content: space-between;
  258. .btn {
  259. width: 33.33%;
  260. height: 100%;
  261. font-size: 14px;
  262. text-align: center;
  263. color: #fff;
  264. cursor: pointer;
  265. }
  266. .btn1 {
  267. width: 33.33%;
  268. height: 100%;
  269. font-size: 14px;
  270. color: #fff;
  271. text-align: center;
  272. border-radius: 2px;
  273. background: #0058ee;
  274. cursor: pointer;
  275. }
  276. }
  277. .card-btn {
  278. width: 100%;
  279. height: calc(100% - 48px);
  280. overflow-y: auto;
  281. .btn {
  282. position: relative;
  283. width: 81%;
  284. height: 14%;
  285. margin-bottom: 10%;
  286. font-family: 'douyuFont';
  287. background: url('../../../../../assets/images/fire/no-choice.png') no-repeat;
  288. background-size: 100% 100%;
  289. cursor: pointer;
  290. .text {
  291. width: 80%;
  292. position: absolute;
  293. left: 50%;
  294. top: 28px;
  295. font-size: 16px;
  296. color: #01fefc;
  297. text-align: center;
  298. transform: translate(-50%, 0);
  299. }
  300. .warn {
  301. width: 100%;
  302. position: absolute;
  303. left: 50%;
  304. bottom: 14px;
  305. font-size: 14px;
  306. color: #fff;
  307. text-align: center;
  308. transform: translate(-50%, 0);
  309. }
  310. }
  311. .btn1 {
  312. position: relative;
  313. width: 100%;
  314. height: 14%;
  315. margin-bottom: 10%;
  316. font-family: 'douyuFont';
  317. background: url('../../../../../assets/images/fire/choice.png') no-repeat;
  318. background-size: 100% 100%;
  319. cursor: pointer;
  320. .text {
  321. width: 80%;
  322. position: absolute;
  323. left: 50%;
  324. top: 28px;
  325. font-size: 16px;
  326. color: #01fefc;
  327. text-align: center;
  328. transform: translate(-62%, 0);
  329. }
  330. .warn {
  331. width: 100%;
  332. position: absolute;
  333. left: 50%;
  334. bottom: 14px;
  335. font-size: 14px;
  336. color: #fff;
  337. text-align: center;
  338. transform: translate(-60%, 0);
  339. }
  340. }
  341. }
  342. }
  343. .gas-content {
  344. position: relative;
  345. width: calc(85% - 10px);
  346. height: 100%;
  347. margin-left: 10px;
  348. padding: 15px;
  349. background: url('../../../../../assets/images/fire/border.png') no-repeat;
  350. background-size: 100% 100%;
  351. box-sizing: border-box;
  352. .top-area {
  353. height: 356px;
  354. margin-bottom: 10px;
  355. padding: 10px;
  356. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  357. background-size: 100% 100%;
  358. box-sizing: border-box;
  359. .title-t {
  360. height: 30px;
  361. margin-bottom: 10px;
  362. display: flex;
  363. justify-content: space-between;
  364. align-items: center;
  365. .text-t {
  366. font-family: 'douyuFont';
  367. font-size: 14px;
  368. color: #fff;
  369. }
  370. }
  371. .content-t {
  372. width: 100%;
  373. height: 276px;
  374. display: flex;
  375. justify-content: space-between;
  376. align-items: center;
  377. padding: 0px 10px;
  378. box-sizing: border-box;
  379. .top-box {
  380. position: relative;
  381. width: 724px;
  382. height: 100%;
  383. background: url('../../../../../assets/images/fire/top-area.png') no-repeat center;
  384. background-size: 100% 100%;
  385. .box-label {
  386. position: absolute;
  387. left: 50%;
  388. top: 198px;
  389. transform: translate(-50%, 0);
  390. width: 80%;
  391. font-family: 'douyuFont';
  392. font-size: 16px;
  393. display: flex;
  394. justify-content: center;
  395. align-items: center;
  396. word-wrap: break-word;
  397. color: #fff;
  398. }
  399. .box-values {
  400. position: absolute;
  401. left: 50%;
  402. top: 26px;
  403. transform: translate(-50%, 0);
  404. width: 84%;
  405. display: flex;
  406. justify-content: space-between;
  407. align-items: center;
  408. flex-wrap: wrap;
  409. .value-b {
  410. width: calc(50% - 10px);
  411. height: 25px;
  412. display: flex;
  413. justify-content: space-between;
  414. align-items: center;
  415. color: #fff;
  416. font-size: 14px;
  417. span {
  418. font-size: 14px;
  419. &:last-child {
  420. font-family: 'douyuFont';
  421. color: rgb(0, 242, 255);
  422. }
  423. }
  424. .box-value {
  425. color: rgb(145, 230, 9) !important;
  426. }
  427. .box-value1 {
  428. color: rgb(0, 242, 255) !important;
  429. }
  430. .box-value2 {
  431. color: #ffff35 !important;
  432. }
  433. .box-value3 {
  434. color: #ffbe69 !important;
  435. }
  436. .box-value4 {
  437. color: #ff6f00 !important;
  438. }
  439. .box-value5 {
  440. color: #ff0000 !important;
  441. }
  442. }
  443. }
  444. }
  445. }
  446. }
  447. .bot-area {
  448. height: calc(100% - 356px);
  449. padding: 10px;
  450. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  451. background-size: 100% 100%;
  452. box-sizing: border-box;
  453. .title-b {
  454. height: 30px;
  455. margin-bottom: 10px;
  456. display: flex;
  457. justify-content: space-between;
  458. align-items: center;
  459. .text-b {
  460. font-family: 'douyuFont';
  461. font-size: 14px;
  462. color: #fff;
  463. }
  464. }
  465. .content-b {
  466. height: calc(100% - 40px);
  467. overflow-y: auto;
  468. .content-b-item {
  469. display: flex;
  470. justify-content: flex-start;
  471. align-items: flex-start;
  472. flex-wrap: wrap;
  473. .card-b {
  474. position: relative;
  475. width: 30%;
  476. height: 128px;
  477. margin: 0px 15px 15px 15px;
  478. background: url('../../../../../assets/images/fire/bot-area.png') no-repeat center;
  479. background-size: 100% 100%;
  480. .item-l {
  481. position: absolute;
  482. left: 32px;
  483. top: 50%;
  484. transform: translate(0, -50%);
  485. width: 89px;
  486. height: 98px;
  487. background: url('../../../../../assets/images/fire/bot-area1.png') no-repeat center;
  488. .label-l {
  489. position: absolute;
  490. left: 50%;
  491. top: 7px;
  492. color: #fff;
  493. font-size: 14px;
  494. transform: translate(-50%, 0);
  495. }
  496. .value-l {
  497. position: absolute;
  498. left: 50%;
  499. top: 50px;
  500. transform: translate(-50%, 0);
  501. font-family: 'douyuFont';
  502. font-size: 14px;
  503. color: #3df6ff;
  504. }
  505. }
  506. .item-r {
  507. position: absolute;
  508. left: 132px;
  509. top: 50%;
  510. transform: translate(0, -50%);
  511. height: 128px;
  512. padding: 5px 0px;
  513. display: flex;
  514. flex-direction: column;
  515. justify-content: space-around;
  516. box-sizing: border-box;
  517. .content-r {
  518. display: flex;
  519. span {
  520. font-size: 14px;
  521. color: #fff;
  522. &:first-child {
  523. display: inline-block;
  524. width: 68px;
  525. }
  526. &:last-child {
  527. display: inline-block;
  528. width: calc(100% - 68px);
  529. }
  530. }
  531. .status-f {
  532. color: #ff0000;
  533. }
  534. .status-l {
  535. color: #3df6ff;
  536. }
  537. }
  538. }
  539. }
  540. }
  541. }
  542. }
  543. .bot-area1 {
  544. height: 100%;
  545. padding: 10px 15px 0px 15px;
  546. background: url('../../../../../assets/images/fire/bj1.png') no-repeat center;
  547. background-size: 100% 100%;
  548. box-sizing: border-box;
  549. .title-b {
  550. height: 30px;
  551. margin-bottom: 10px;
  552. display: flex;
  553. justify-content: space-between;
  554. align-items: center;
  555. .text-b {
  556. font-family: 'douyuFont';
  557. font-size: 14px;
  558. color: #fff;
  559. }
  560. }
  561. .content-b {
  562. width: 100%;
  563. height: calc(100% - 40px);
  564. overflow-y: auto;
  565. .content-b-item {
  566. display: flex;
  567. justify-content: flex-start;
  568. align-items: flex-start;
  569. flex-wrap: wrap;
  570. .card-b {
  571. position: relative;
  572. width: 30%;
  573. height: 128px;
  574. margin: 0px 15px 15px 15px;
  575. background: url('../../../../../assets/images/fire/bot-area.png') no-repeat center;
  576. background-size: 100% 100%;
  577. .item-l {
  578. position: absolute;
  579. left: 32px;
  580. top: 50%;
  581. transform: translate(0, -50%);
  582. width: 89px;
  583. height: 98px;
  584. background: url('../../../../../assets/images/fire/bot-area1.png') no-repeat center;
  585. .label-l {
  586. position: absolute;
  587. left: 50%;
  588. top: 7px;
  589. font-size: 14px;
  590. color: #fff;
  591. transform: translate(-50%, 0);
  592. }
  593. .value-l {
  594. position: absolute;
  595. left: 50%;
  596. top: 50px;
  597. transform: translate(-50%, 0);
  598. font-family: 'douyuFont';
  599. font-size: 14px;
  600. color: #3df6ff;
  601. }
  602. }
  603. .item-r {
  604. position: absolute;
  605. left: 132px;
  606. top: 50%;
  607. transform: translate(0, -50%);
  608. height: 128px;
  609. padding: 5px 0px;
  610. display: flex;
  611. flex-direction: column;
  612. justify-content: space-around;
  613. box-sizing: border-box;
  614. .content-r {
  615. display: flex;
  616. span {
  617. font-size: 14px;
  618. color: #fff;
  619. &:first-child {
  620. display: inline-block;
  621. width: 68px;
  622. }
  623. &:last-child {
  624. display: inline-block;
  625. width: calc(100% - 68px);
  626. }
  627. }
  628. .status-f {
  629. color: #ff0000;
  630. }
  631. .status-l {
  632. color: #3df6ff;
  633. }
  634. }
  635. }
  636. }
  637. }
  638. }
  639. }
  640. }
  641. }
  642. </style>