warndata.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. <template>
  2. <view class="container">
  3. <u-navbar
  4. title="预警分析"
  5. :safeAreaInsetTop="false"
  6. style="margin-top: 30px"
  7. left-icon=""
  8. >
  9. </u-navbar>
  10. <view class="main">
  11. <view class="flcard">
  12. <text class="text-style">通风监测预警</text>
  13. </view>
  14. <view class="flcard">
  15. <view class="datacard demo-layout bg-purple-light">
  16. <view style="margin-top: 10rpx">
  17. <text class="text-style1">{{ windData.zongjinfeng }}</text>
  18. </view>
  19. <view style="margin-top: 10rpx">总进风量(m³/min):</view>
  20. </view>
  21. <view class="datacard demo-layout bg-purple-light">
  22. <view style="margin-top: 10rpx">
  23. <text class="text-style1">{{ windData.zonghuifeng }}</text>
  24. </view>
  25. <view style="margin-top: 10rpx">总回风量(m³/min):</view>
  26. </view>
  27. <view class="datacard demo-layout bg-purple-light">
  28. <view style="margin-top: 10rpx">
  29. <text class="text-style1">{{ xufengliang }}</text>
  30. </view>
  31. <view style="margin-top: 10rpx">总需风量(m³/min):</view>
  32. </view>
  33. </view>
  34. <view class="flcard">
  35. <text class="text-style">火灾监测预警</text>
  36. </view>
  37. <view class="flcard">
  38. <view class="firecontainer">
  39. <view class="title">
  40. <span class="firetext">外因火灾</span>
  41. </view>
  42. <view class="firecard"> </view>
  43. </view>
  44. <view class="firecontainer">
  45. <view class="title">
  46. <span class="firetext">内因火灾</span>
  47. </view>
  48. <view class="firecard"> </view>
  49. </view>
  50. </view>
  51. <view class="flcard">
  52. <text class="text-style">粉尘监测预警</text>
  53. </view>
  54. <view class="flcard">
  55. <text class="u-collapse-content"
  56. >众多的贴心小工具,是您开发过程中召之即来的利器,让您飞镖在手,百步穿杨</text
  57. >
  58. </view>
  59. <view class="flcard">
  60. <text class="text-style">瓦斯监测预警</text>
  61. </view>
  62. <view class="flcard">
  63. <view class="firecontainer">
  64. <view class="title">
  65. <span class="firetext" v-if="gasDevice.length > 0">{{ gasDevice[0].systemname }}</span>
  66. </view>
  67. <view class="firecard"> </view>
  68. </view>
  69. <view class="firecontainer">
  70. <view class="title">
  71. <span class="firetext" v-if="gasDevice.length > 0">{{ gasDevice[1].systemname }}</span>
  72. </view>
  73. <view class="firecard"> </view>
  74. </view>
  75. </view>
  76. <view class="flcard">
  77. <text class="text-style">设备监测预警</text>
  78. </view>
  79. <view class="flcard demo-layout bg-purple-light">
  80. <view class="deviceCard">
  81. <view
  82. class="item-container"
  83. v-for="(item, index) in devicekindData"
  84. :key="index"
  85. >
  86. <view class="item">
  87. <text style="margin-right: 10px">{{ item.name }}</text>
  88. <text>{{ item.status }}</text>
  89. </view>
  90. </view>
  91. </view>
  92. </view>
  93. </view>
  94. </view>
  95. </template>
  96. <script>
  97. import api from "@/api/api";
  98. export default {
  99. props: {},
  100. watch: {},
  101. data() {
  102. return {
  103. windData: [],
  104. devicekindData: [],
  105. fireData: [],
  106. gasData: [],
  107. gasDevice: [],
  108. xufengliang: "", //总需风量
  109. };
  110. },
  111. mounted() {
  112. this.getWranInfo();
  113. },
  114. methods: {
  115. //获取预警信息
  116. getWranInfo() {
  117. new Promise((resolve, reject) => {
  118. api
  119. .getWarnInfo()
  120. .then((response) => {
  121. if (response.data.code == 200) {
  122. this.windData = response.data.result.ventInfo;
  123. this.devicekindData = response.data.result.info.devicekindInfo;
  124. this.fireData = response.data.result.info.sysInfo.fireS;
  125. this.gasData = response.data.result.info.sysInfo.gasS;
  126. this.gasDevice = this.gasData.devices;
  127. console.log(this.gasDevice, "数据");
  128. this.xufengliang = this.windData.sysdata.xufengliang;
  129. } else {
  130. reject(response);
  131. }
  132. })
  133. .catch((error) => {
  134. console.log("catch===>response", response);
  135. reject(error);
  136. });
  137. });
  138. },
  139. },
  140. };
  141. </script>
  142. <style scoped>
  143. >>> .u-navbar--fixed {
  144. margin-top: 20px;
  145. }
  146. .main {
  147. margin-top: 100rpx;
  148. display: flex;
  149. flex-direction: column;
  150. }
  151. .text-style {
  152. font-weight: bold;
  153. }
  154. .flcard {
  155. padding: 20rpx;
  156. background-color: #ffffff;
  157. margin-bottom: 5rpx;
  158. }
  159. .datacard {
  160. width: 32.5%;
  161. margin: 1px;
  162. float: left;
  163. height: 100rpx;
  164. text-align: center;
  165. border-radius: 10px;
  166. background: url(/static/model/windM3.png),
  167. linear-gradient(
  168. to right,
  169. rgba(55, 135, 254, 0.08),
  170. rgba(4, 184, 255, 0.08),
  171. rgba(60, 161, 237, 0.08)
  172. );
  173. }
  174. .datacard1 {
  175. width: 100%;
  176. margin: 2px;
  177. float: left;
  178. height: 200rpx;
  179. text-align: center;
  180. border-radius: 10px;
  181. background: linear-gradient(
  182. to right,
  183. rgba(55, 135, 254, 0.08),
  184. rgba(4, 184, 255, 0.08),
  185. rgba(60, 161, 237, 0.08)
  186. );
  187. }
  188. .title {
  189. width: 100%;
  190. height: 50rpx;
  191. background: url(/static/warndata/title.png);
  192. background-repeat: no-repeat;
  193. background-size: 100% 100%;
  194. display: flex; /* 将父级元素设置为 Flex 容器 */
  195. align-items: center; /* 垂直居中子元素 */
  196. }
  197. .firecard {
  198. width: 100%;
  199. margin: 1px;
  200. float: left;
  201. height: 100rpx;
  202. text-align: center;
  203. border-radius: 10px;
  204. margin-top: 10px;
  205. background: linear-gradient(
  206. to right,
  207. rgba(55, 135, 254, 0.08),
  208. rgba(4, 184, 255, 0.08),
  209. rgba(60, 161, 237, 0.08)
  210. );
  211. background-repeat: repeat;
  212. }
  213. .deviceCard {
  214. display: grid;
  215. grid-template-columns: repeat(2, 1fr);
  216. margin-top: 10rpx;
  217. }
  218. .item-container {
  219. height: 100px;
  220. background-image: url(/static/warndata/window.png);
  221. background-size: 100% 60%;
  222. background-repeat: no-repeat;
  223. }
  224. .item {
  225. margin-left: 70px;
  226. margin-top: 36px;
  227. }
  228. .firetext {
  229. margin: 20px;
  230. }
  231. .text-style1 {
  232. color: #3787fe;
  233. font-size: large;
  234. }
  235. .firecontainer {
  236. margin-top: 10px;
  237. }
  238. </style>