1
0

gasWarn.vue 19 KB

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