gas-detail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524
  1. <template>
  2. <view class="gas-detail">
  3. <u-tabs
  4. class="devic-box-tab"
  5. :current="PageCur"
  6. :list="tabList"
  7. @click="NavChange"
  8. ></u-tabs>
  9. <view class="gas-content" v-if="PageCur == 0">
  10. <view class="search-area">
  11. <view class="search-l">
  12. <view class="search-item" @click="getChangeJcd">
  13. <text class="search-label">监测点:</text>
  14. <u--input
  15. inputAlign="center"
  16. v-model="searchText"
  17. placeholder="请选择监测点"
  18. suffixIcon="arrow-right"
  19. suffixIconStyle="color: #909399"
  20. ></u--input>
  21. <u-action-sheet
  22. :show="showJcd"
  23. :actions="selectList"
  24. title="请选择监测点"
  25. @close="showJcd = false"
  26. @select="selectChangeJcd"
  27. >
  28. </u-action-sheet>
  29. </view>
  30. </view>
  31. <view class="search-r">
  32. <!-- <image src="/static/model/alarmTrue.svg" alt="" class="icon-style" /> -->
  33. <u-icon name="warning-fill" color="#0eb4fc" size="18"></u-icon>
  34. <text class="icon-text">低风险</text>
  35. </view>
  36. </view>
  37. <view class="top-area" v-if="topContentList.length > 0">
  38. <view class="top-title">
  39. <view style="font-weight: bold">瓦斯抽采泵信息</view>
  40. </view>
  41. <view
  42. class="top-content"
  43. v-for="(item, index) in topContentList"
  44. :key="index"
  45. >
  46. <view class="content-title">{{ item.strinstallpos }}</view>
  47. <view class="content-item-box">
  48. <view class="content-item">
  49. <view class="item-l">
  50. <view class="item-value">{{ item.warnLevel }}</view>
  51. <view class="item-label">报警状态</view>
  52. </view>
  53. <view class="item-c"></view>
  54. <view class="item-r">
  55. <view class="item-value">{{
  56. item.readData.coVal || "--"
  57. }}</view>
  58. <view class="item-label">输入管道内一氧化碳(ppm)</view>
  59. </view>
  60. </view>
  61. <view class="content-item">
  62. <view class="item-l">
  63. <view class="item-value">{{ item.readData.gas1 || "--" }}</view>
  64. <view class="item-label">管路出口处瓦斯</view>
  65. </view>
  66. <view class="item-c"></view>
  67. <view class="item-r">
  68. <view class="item-value">{{ item.readData.gas2 || "--" }}</view>
  69. <view class="item-label">泵站内瓦斯</view>
  70. </view>
  71. </view>
  72. <view class="content-item">
  73. <view class="item-l">
  74. <view class="item-value">{{ item.readData.gas3 || "--" }}</view>
  75. <view class="item-label">输入管道内瓦斯</view>
  76. </view>
  77. <view class="item-c"></view>
  78. <view class="item-r">
  79. <view class="item-value">{{ item.readData.gas4 || "--" }}</view>
  80. <view class="item-label">管道输出瓦斯</view>
  81. </view>
  82. </view>
  83. <view class="content-item">
  84. <view class="item-l">
  85. <view class="item-value">{{
  86. item.readData.mixedTraffic || "--"
  87. }}</view>
  88. <view class="item-label">输入管道内工混流量</view>
  89. </view>
  90. <view class="item-c"></view>
  91. <view class="item-r">
  92. <view class="item-value">{{
  93. item.readData.standardTraffic || "--"
  94. }}</view>
  95. <view class="item-label">输入管道内标况流量</view>
  96. </view>
  97. </view>
  98. <view class="content-item">
  99. <view class="item-l">
  100. <view class="item-value">{{
  101. item.readData.totalGasDrainage || "--"
  102. }}</view>
  103. <view class="item-label">瓦斯抽放量</view>
  104. </view>
  105. <view class="item-c"></view>
  106. <view class="item-r">
  107. <!-- <view class="item-value">{{ item.coVal }}</view>
  108. <view class="item-label">输入管道内一氧化碳(ppm)</view> -->
  109. </view>
  110. </view>
  111. </view>
  112. </view>
  113. </view>
  114. <view class="bot-area">
  115. <view class="top-title">
  116. <view style="font-weight: bold">安全监测点信息</view>
  117. </view>
  118. <view
  119. class="top-content"
  120. v-for="(item, index) in botContentList"
  121. :key="index"
  122. >
  123. <view class="content-title">{{ item.strinstallpos || "--" }}</view>
  124. <view class="content-item-box">
  125. <view class="content-item">
  126. <view class="item-l">
  127. <view class="item-value">瓦斯</view>
  128. <view class="item-label">测点类型</view>
  129. </view>
  130. <view class="item-c"></view>
  131. <view class="item-r">
  132. <view class="item-value">{{ item.readData.gasC || "--" }}</view>
  133. <view class="item-label">甲烷</view>
  134. </view>
  135. </view>
  136. <view class="content-item">
  137. <view class="item-l">
  138. <view class="item-value">{{ item.readTime || "--" }}</view>
  139. <view class="item-label">数据时间</view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </view>
  145. </view>
  146. </view>
  147. </template>
  148. <script>
  149. import api from "@/api/api";
  150. import moment from "moment";
  151. export default {
  152. name: "gasDetail",
  153. props: {},
  154. watch: {},
  155. data() {
  156. return {
  157. timeRan: Number(new Date()),
  158. timer: "",
  159. PageCur: "0",
  160. tabList: [{ name: "预警监测" }],
  161. // isShowSelect: true,
  162. showJcd: false,
  163. searchText: "",
  164. selectList: [],
  165. topContentList: [],
  166. botContentList: [],
  167. };
  168. },
  169. beforeDestroy() {
  170. this.timer = null;
  171. clearTimeout(this.timer);
  172. },
  173. mounted() {
  174. this.getTabList();
  175. },
  176. methods: {
  177. NavChange: function (item) {
  178. clearTimeout(this.timer);
  179. this.PageCur = item.index;
  180. if (this.PageCur == 0) {
  181. this.getMonitor(this.selectList[this.PageCur].deviceID, true);
  182. }
  183. },
  184. getChangeJcd() {
  185. this.showJcd = true;
  186. },
  187. selectChangeJcd(e) {
  188. clearTimeout(this.timer);
  189. this.searchText = e.name;
  190. this.getMonitor(e.deviceID, true);
  191. },
  192. getMonitor(deviceID, flag) {
  193. let than = this;
  194. than.timer = setTimeout(
  195. async () => {
  196. await than.getSysWarnList(deviceID, "gas");
  197. if (than.timer) {
  198. than.timer = null;
  199. }
  200. than.getMonitor(deviceID);
  201. },
  202. flag ? 0 : 3000
  203. );
  204. },
  205. //获取顶部tab选项数据
  206. getTabList() {
  207. new Promise((resolve, reject) => {
  208. api
  209. .sysTypeWarn({ type: "gas" })
  210. .then((response) => {
  211. if (response.data.code == 200 && response.data.result.length != 0) {
  212. let result = response.data.result;
  213. this.selectList = result.map((el) => {
  214. //lxh
  215. return {
  216. name: el.systemname,
  217. deviceID: el.id,
  218. };
  219. });
  220. this.searchText = this.selectList[0].name;
  221. this.getMonitor(this.selectList[0].deviceID, true);
  222. } else {
  223. reject(response);
  224. }
  225. })
  226. .catch((error) => {
  227. console.log("catch===>response", response);
  228. reject(error);
  229. });
  230. });
  231. },
  232. //获取瓦斯详情数据
  233. getSysWarnList(id, type) {
  234. new Promise((resolve, reject) => {
  235. api
  236. .sysWarn({ sysid: id, type: type })
  237. .then((response) => {
  238. if (response.data.code == 200) {
  239. let data = response.data.result;
  240. this.topContentList = data.pump;
  241. this.botContentList = data.gas;
  242. } else {
  243. reject(response);
  244. }
  245. })
  246. .catch((error) => {
  247. console.log("catch===>response", response);
  248. reject(error);
  249. });
  250. });
  251. },
  252. },
  253. computed: {},
  254. };
  255. </script>
  256. <style lang="scss" scoped>
  257. .gas-detail {
  258. position: relative;
  259. box-sizing: border-box;
  260. .devic-box-tab {
  261. padding: 0px 10px !important;
  262. }
  263. .gas-content {
  264. height: 100%;
  265. box-sizing: border-box;
  266. overflow-y: auto;
  267. .search-area {
  268. width: 100%;
  269. padding: 10px 20px;
  270. display: flex;
  271. justify-content: center;
  272. align-items: center;
  273. box-sizing: border-box;
  274. background-color: #fff;
  275. margin-bottom: 2px;
  276. .search-l {
  277. width: calc(100% - 100px);
  278. position: relative;
  279. display: flex;
  280. align-items: center;
  281. margin-right: 10px;
  282. .search-item {
  283. display: flex;
  284. align-items: center;
  285. .search-label {
  286. text-align: right;
  287. }
  288. }
  289. }
  290. .search-r {
  291. display: flex;
  292. justify-content: space-between;
  293. align-items: center;
  294. width: 80px;
  295. padding: 4px 10px;
  296. border-radius: 5px;
  297. background: #d4ecff;
  298. .icon-style {
  299. width: 14px;
  300. height: 14px;
  301. }
  302. .icon-text {
  303. font-size: 14px;
  304. font-weight: bold;
  305. color: #0eb4fc;
  306. }
  307. }
  308. }
  309. .top-area {
  310. width: 100%;
  311. padding: 0px 10px;
  312. background-color: #fff;
  313. margin-bottom: 2px;
  314. box-sizing: border-box;
  315. }
  316. .bot-area {
  317. width: 100%;
  318. padding: 0px 10px;
  319. background-color: #fff;
  320. margin-bottom: 2px;
  321. box-sizing: border-box;
  322. }
  323. .top-title {
  324. height: 28px;
  325. margin-bottom: 5px;
  326. display: flex;
  327. justify-content: space-between;
  328. align-items: center;
  329. }
  330. .top-content {
  331. .content-title {
  332. height: 26px;
  333. line-height: 26px;
  334. padding: 0px 20px;
  335. font-size: 12px;
  336. background: url("/static/warndata/title.png") no-repeat;
  337. background-size: 100% 100%;
  338. }
  339. .content-item-box {
  340. padding: 10px 0px;
  341. .content-item {
  342. height: 50px;
  343. display: flex;
  344. justify-content: space-between;
  345. align-items: center;
  346. background: linear-gradient(
  347. to right,
  348. rgba(55, 135, 254, 0.08),
  349. rgba(4, 184, 255, 0.08),
  350. rgba(60, 161, 237, 0.08)
  351. );
  352. border-radius: 10px;
  353. margin-bottom: 5px;
  354. .item-l {
  355. width: calc(50% - 2px);
  356. height: 100%;
  357. display: flex;
  358. flex-direction: column;
  359. justify-content: center;
  360. align-items: center;
  361. }
  362. .item-c {
  363. width: 4px;
  364. height: 70%;
  365. border-left: 2px solid;
  366. border-image: linear-gradient(
  367. to bottom,
  368. transparent,
  369. rgba(140, 203, 254, 1),
  370. transparent
  371. )
  372. 1 1 1;
  373. }
  374. .item-r {
  375. width: calc(50% - 2px);
  376. height: 100%;
  377. display: flex;
  378. flex-direction: column;
  379. justify-content: center;
  380. align-items: center;
  381. }
  382. }
  383. }
  384. }
  385. .item-value {
  386. height: 20px;
  387. line-height: 20px;
  388. color: #0eb4fc;
  389. font-weight: bold;
  390. }
  391. .item-label {
  392. font-size: 12px;
  393. }
  394. .top-dialog-area,
  395. .center-dialog-area,
  396. .bottom-dialog-area {
  397. width: 100%;
  398. padding: 10px;
  399. box-sizing: border-box;
  400. background-color: #fff;
  401. margin-bottom: 2px;
  402. }
  403. .top-gas-list {
  404. width: 100%;
  405. padding: 10px 40px;
  406. box-sizing: border-box;
  407. background-color: #fff;
  408. margin-bottom: 2px;
  409. }
  410. .bot-gas-list {
  411. width: 100%;
  412. padding: 10px;
  413. box-sizing: border-box;
  414. background-color: #fff;
  415. margin-bottom: 2px;
  416. }
  417. .dialog-btn {
  418. display: flex;
  419. width: 100%;
  420. padding: 8px 10px;
  421. box-sizing: border-box;
  422. background-color: #fff;
  423. // margin-bottom: 2px;
  424. .u-button {
  425. margin: 0px 10px;
  426. }
  427. }
  428. .dialog-title {
  429. height: 26px;
  430. line-height: 26px;
  431. padding: 0px 20px;
  432. margin-bottom: 10px;
  433. font-size: 12px;
  434. background: url("/static/warndata/title.png") no-repeat;
  435. background-size: 100% 100%;
  436. }
  437. .dialog-item {
  438. display: flex;
  439. align-items: center;
  440. justify-content: center;
  441. margin-bottom: 10px;
  442. .dialog-label {
  443. width: 120px;
  444. text-align: right;
  445. }
  446. }
  447. .search-box {
  448. display: flex;
  449. align-items: center;
  450. justify-content: center;
  451. margin-bottom: 10px;
  452. .dialog-label {
  453. width: 80px;
  454. text-align: right;
  455. }
  456. }
  457. .content-title-gas {
  458. position: relative;
  459. height: 26px;
  460. line-height: 26px;
  461. padding-left: 20px;
  462. font-size: 12px;
  463. background: url("/static/warndata/title.png") no-repeat;
  464. background-size: 100% 100%;
  465. }
  466. .icon-gas-edit {
  467. position: absolute;
  468. right: 35px;
  469. top: 0;
  470. cursor: pointer;
  471. }
  472. .icon-gas-del {
  473. position: absolute;
  474. right: 10px;
  475. top: 0;
  476. cursor: pointer;
  477. }
  478. }
  479. }
  480. ::v-deep .u-input {
  481. padding: 2px 6px !important;
  482. }
  483. ::v-deep .u-popup {
  484. flex: 0;
  485. }
  486. </style>