gas-detail.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529
  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">
  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.warnFlag || "--" }}</view>
  139. <view class="item-label">测点状态</view>
  140. </view>
  141. <view class="item-c"></view>
  142. <view class="item-r">
  143. <view class="item-value">{{ item.readTime || "--" }}</view>
  144. <view class="item-label">数据时间</view>
  145. </view>
  146. </view>
  147. </view>
  148. </view>
  149. </view>
  150. </view>
  151. </view>
  152. </template>
  153. <script>
  154. import api from "@/api/api";
  155. import moment from "moment";
  156. export default {
  157. name: "gasDetail",
  158. props: {},
  159. watch: {},
  160. data() {
  161. return {
  162. timeRan: Number(new Date()),
  163. timer: "",
  164. PageCur: "0",
  165. tabList: [{ name: "预警监测" }, { name: "预警指标" }],
  166. // isShowSelect: true,
  167. showJcd: false,
  168. searchText: "",
  169. selectList: [],
  170. topContentList: [],
  171. botContentList: [],
  172. };
  173. },
  174. beforeDestroy() {
  175. this.timer = null;
  176. clearTimeout(this.timer);
  177. },
  178. mounted() {
  179. this.getTabList();
  180. },
  181. methods: {
  182. NavChange: function (item) {
  183. clearTimeout(this.timer);
  184. this.PageCur = item.index;
  185. if (this.PageCur == 0) {
  186. this.getMonitor(this.selectList[this.PageCur].deviceID, true);
  187. }
  188. },
  189. getChangeJcd() {
  190. this.showJcd = true;
  191. },
  192. selectChangeJcd(e) {
  193. clearTimeout(this.timer);
  194. this.searchText = e.name;
  195. this.getMonitor(e.deviceID, true);
  196. },
  197. getMonitor(deviceID, flag) {
  198. let than = this;
  199. than.timer = setTimeout(
  200. async () => {
  201. await than.getSysWarnList(deviceID, "gas");
  202. if (than.timer) {
  203. than.timer = null;
  204. }
  205. than.getMonitor(deviceID);
  206. },
  207. flag ? 0 : 3000
  208. );
  209. },
  210. //获取顶部tab选项数据
  211. getTabList() {
  212. new Promise((resolve, reject) => {
  213. api
  214. .sysTypeWarn({ type: "gas" })
  215. .then((response) => {
  216. if (response.data.code == 200 && response.data.result.length != 0) {
  217. let result = response.data.result;
  218. this.selectList = result.map((el) => {
  219. //lxh
  220. return {
  221. name: el.systemname,
  222. deviceID: el.id,
  223. };
  224. });
  225. this.searchText = this.selectList[0].name;
  226. this.getMonitor(this.selectList[0].deviceID, true);
  227. } else {
  228. reject(response);
  229. }
  230. })
  231. .catch((error) => {
  232. console.log("catch===>response", response);
  233. reject(error);
  234. });
  235. });
  236. },
  237. //获取瓦斯详情数据
  238. getSysWarnList(id, type) {
  239. new Promise((resolve, reject) => {
  240. api
  241. .sysWarn({ sysid: id, type: type })
  242. .then((response) => {
  243. if (response.data.code == 200) {
  244. let data = response.data.result;
  245. this.topContentList = data.pump;
  246. this.botContentList = data.gas;
  247. } else {
  248. reject(response);
  249. }
  250. })
  251. .catch((error) => {
  252. console.log("catch===>response", response);
  253. reject(error);
  254. });
  255. });
  256. },
  257. },
  258. computed: {},
  259. };
  260. </script>
  261. <style lang="scss" scoped>
  262. .gas-detail {
  263. position: relative;
  264. box-sizing: border-box;
  265. .devic-box-tab {
  266. padding: 0px 10px !important;
  267. }
  268. .gas-content {
  269. height: 100%;
  270. box-sizing: border-box;
  271. overflow-y: auto;
  272. .search-area {
  273. width: 100%;
  274. padding: 10px 20px;
  275. display: flex;
  276. justify-content: center;
  277. align-items: center;
  278. box-sizing: border-box;
  279. background-color: #fff;
  280. margin-bottom: 2px;
  281. .search-l {
  282. width: calc(100% - 100px);
  283. position: relative;
  284. display: flex;
  285. align-items: center;
  286. margin-right: 10px;
  287. .search-item {
  288. display: flex;
  289. align-items: center;
  290. .search-label {
  291. text-align: right;
  292. }
  293. }
  294. }
  295. .search-r {
  296. display: flex;
  297. justify-content: space-between;
  298. align-items: center;
  299. width: 80px;
  300. padding: 4px 10px;
  301. border-radius: 5px;
  302. background: #d4ecff;
  303. .icon-style {
  304. width: 14px;
  305. height: 14px;
  306. }
  307. .icon-text {
  308. font-size: 14px;
  309. font-weight: bold;
  310. color: #0eb4fc;
  311. }
  312. }
  313. }
  314. .top-area {
  315. width: 100%;
  316. padding: 0px 10px;
  317. background-color: #fff;
  318. margin-bottom: 2px;
  319. box-sizing: border-box;
  320. }
  321. .bot-area {
  322. width: 100%;
  323. padding: 0px 10px;
  324. background-color: #fff;
  325. margin-bottom: 2px;
  326. box-sizing: border-box;
  327. }
  328. .top-title {
  329. height: 28px;
  330. margin-bottom: 5px;
  331. display: flex;
  332. justify-content: space-between;
  333. align-items: center;
  334. }
  335. .top-content {
  336. .content-title {
  337. height: 26px;
  338. line-height: 26px;
  339. padding: 0px 20px;
  340. font-size: 12px;
  341. background: url("/static/warndata/title.png") no-repeat;
  342. background-size: 100% 100%;
  343. }
  344. .content-item-box {
  345. padding: 10px 0px;
  346. .content-item {
  347. height: 50px;
  348. display: flex;
  349. justify-content: space-between;
  350. align-items: center;
  351. background: linear-gradient(
  352. to right,
  353. rgba(55, 135, 254, 0.08),
  354. rgba(4, 184, 255, 0.08),
  355. rgba(60, 161, 237, 0.08)
  356. );
  357. border-radius: 10px;
  358. margin-bottom: 5px;
  359. .item-l {
  360. width: calc(50% - 2px);
  361. height: 100%;
  362. display: flex;
  363. flex-direction: column;
  364. justify-content: center;
  365. align-items: center;
  366. }
  367. .item-c {
  368. width: 4px;
  369. height: 70%;
  370. border-left: 2px solid;
  371. border-image: linear-gradient(
  372. to bottom,
  373. transparent,
  374. rgba(140, 203, 254, 1),
  375. transparent
  376. )
  377. 1 1 1;
  378. }
  379. .item-r {
  380. width: calc(50% - 2px);
  381. height: 100%;
  382. display: flex;
  383. flex-direction: column;
  384. justify-content: center;
  385. align-items: center;
  386. }
  387. }
  388. }
  389. }
  390. .item-value {
  391. height: 20px;
  392. line-height: 20px;
  393. color: #0eb4fc;
  394. font-weight: bold;
  395. }
  396. .item-label {
  397. font-size: 12px;
  398. }
  399. .top-dialog-area,
  400. .center-dialog-area,
  401. .bottom-dialog-area {
  402. width: 100%;
  403. padding: 10px;
  404. box-sizing: border-box;
  405. background-color: #fff;
  406. margin-bottom: 2px;
  407. }
  408. .top-gas-list {
  409. width: 100%;
  410. padding: 10px 40px;
  411. box-sizing: border-box;
  412. background-color: #fff;
  413. margin-bottom: 2px;
  414. }
  415. .bot-gas-list {
  416. width: 100%;
  417. padding: 10px;
  418. box-sizing: border-box;
  419. background-color: #fff;
  420. margin-bottom: 2px;
  421. }
  422. .dialog-btn {
  423. display: flex;
  424. width: 100%;
  425. padding: 8px 10px;
  426. box-sizing: border-box;
  427. background-color: #fff;
  428. // margin-bottom: 2px;
  429. .u-button {
  430. margin: 0px 10px;
  431. }
  432. }
  433. .dialog-title {
  434. height: 26px;
  435. line-height: 26px;
  436. padding: 0px 20px;
  437. margin-bottom: 10px;
  438. font-size: 12px;
  439. background: url("/static/warndata/title.png") no-repeat;
  440. background-size: 100% 100%;
  441. }
  442. .dialog-item {
  443. display: flex;
  444. align-items: center;
  445. justify-content: center;
  446. margin-bottom: 10px;
  447. .dialog-label {
  448. width: 120px;
  449. text-align: right;
  450. }
  451. }
  452. .search-box {
  453. display: flex;
  454. align-items: center;
  455. justify-content: center;
  456. margin-bottom: 10px;
  457. .dialog-label {
  458. width: 80px;
  459. text-align: right;
  460. }
  461. }
  462. .content-title-gas {
  463. position: relative;
  464. height: 26px;
  465. line-height: 26px;
  466. padding-left: 20px;
  467. font-size: 12px;
  468. background: url("/static/warndata/title.png") no-repeat;
  469. background-size: 100% 100%;
  470. }
  471. .icon-gas-edit {
  472. position: absolute;
  473. right: 35px;
  474. top: 0;
  475. cursor: pointer;
  476. }
  477. .icon-gas-del {
  478. position: absolute;
  479. right: 10px;
  480. top: 0;
  481. cursor: pointer;
  482. }
  483. }
  484. }
  485. ::v-deep .u-input {
  486. padding: 2px 6px !important;
  487. }
  488. ::v-deep .u-popup {
  489. flex: 0;
  490. }
  491. </style>