warndata.vue 6.8 KB

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