gas-detail.vue 13 KB

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