ventilation.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347
  1. <template>
  2. <view>
  3. <view class="content">
  4. <view class="section" v-for="(item,index) in data" :key="index">
  5. <!-- 风扇状态 -->
  6. <view class="state">
  7. <view class="icon">
  8. <view class="img kai" v-if="item.state == 1">
  9. <image src="./icon/fengshan_kai.gif"></image>
  10. </view>
  11. <view class="img guan" v-if="item.state == 2">
  12. <image src="./icon/fengshan_guan.png"></image>
  13. </view>
  14. <view class="title">{{item.title}}</view>
  15. </view>
  16. <view class="list">
  17. <view class="item" v-for="(item_2,index_2) in item.state_list" :key="index_2">
  18. <view class="label">{{item_2.label}}</view>
  19. <!-- 1-开 2-关 3-报警 -->
  20. <view class="value value_1" v-if="item_2.state == 1"></view>
  21. <view class="value value_2" v-if="item_2.state == 2"></view>
  22. <view class="value value_3" v-if="item_2.state == 3"></view>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 运行参数 -->
  27. <view class="parameter run_parameter">
  28. <view class="title">
  29. <view class="icon">
  30. <image src="./icon/canshu.png" mode=""></image>
  31. </view>
  32. <view class="text">运行参数</view>
  33. </view>
  34. <view class="list">
  35. <view class="item" v-for="(item_2,index_2) in item.run_parameter" :key="index_2"
  36. @click="show_item(item_2)">
  37. <view class="label">{{item_2.label}}</view>
  38. <view class="value">{{item_2.value}}</view>
  39. <view class="unit">{{item_2.unit}}</view>
  40. </view>
  41. </view>
  42. </view>
  43. <!-- 电机1运行参数 -->
  44. <view class="parameter electric_parameter">
  45. <view class="title">
  46. <view class="icon">
  47. <image src="./icon/dianji.png" mode=""></image>
  48. </view>
  49. <view class="text">电机1运行参数</view>
  50. </view>
  51. <view class="list">
  52. <view class="item" v-for="(item_2,index_2) in item.electric_parameter_1" :key="index_2"
  53. @click="show_item(item_2)">
  54. <view class="label">{{item_2.label}}</view>
  55. <view class="value">{{item_2.value}}</view>
  56. <view class="unit">{{item_2.unit}}</view>
  57. </view>
  58. </view>
  59. </view>
  60. <!-- 电机2运行参数 -->
  61. <view class="parameter electric_parameter">
  62. <view class="title">
  63. <view class="icon">
  64. <image src="./icon/dianji.png" mode=""></image>
  65. </view>
  66. <view class="text">电机2运行参数</view>
  67. </view>
  68. <view class="list">
  69. <view class="item" v-for="(item_2,index_2) in item.electric_parameter_2" :key="index_2"
  70. @click="show_item(item_2)">
  71. <view class="label">{{item_2.label}}</view>
  72. <view class="value">{{item_2.value}}</view>
  73. <view class="unit">{{item_2.unit}}</view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import data from './ventilation.json'
  83. export default {
  84. data() {
  85. return {
  86. mine_code:"",
  87. system_type:"",
  88. // 数据刷新定时器
  89. data_timer:{},
  90. data: {}
  91. };
  92. },
  93. onLoad(option) {
  94. uni.setNavigationBarTitle({
  95. title:option.name
  96. })
  97. this.mine_code = option.mine_code
  98. this.system_type = option.system_type
  99. // console.log(data)
  100. // this.data = data
  101. this.get_data()
  102. this.data_timer = setInterval(()=>{
  103. this.get_data()
  104. },5000)
  105. },
  106. onUnload() {
  107. clearInterval(this.data_timer)
  108. },
  109. methods: {
  110. show_item(item) {
  111. uni.showToast({
  112. icon: "none",
  113. title: item.label + " " + item.value + " " + item.unit
  114. })
  115. },
  116. get_data(){
  117. if(this.mine_code == "jinfeng"){
  118. this.$api.opcdata_getTurboData({
  119. mine_code: this.mine_code,
  120. system_type: this.system_type
  121. }).then((res)=>{
  122. this.data = res.data.sys_point
  123. })
  124. }else{
  125. this.$api.unified_automation_system({
  126. mine_code: this.mine_code,
  127. system_type: this.system_type
  128. }).then((res)=>{
  129. this.data = res.data
  130. })
  131. }
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss">
  137. page {
  138. background-color: #0B163B;
  139. box-sizing: border-box;
  140. padding: 30rpx 10rpx;
  141. }
  142. .content {
  143. display: flex;
  144. justify-content: space-between;
  145. .section {
  146. width: 360rpx;
  147. .state {
  148. .icon {
  149. background-image: url(./icon/fengshan_border.png);
  150. background-size: 160rpx 160rpx;
  151. background-repeat: no-repeat;
  152. background-position: center 0;
  153. .img {
  154. margin: 0 auto;
  155. width: 140rpx;
  156. height: 140rpx;
  157. image {
  158. margin-top: 10rpx;
  159. width: 140rpx;
  160. height: 140rpx;
  161. }
  162. }
  163. .guan {
  164. text-align: center;
  165. image {
  166. margin-top: 24rpx;
  167. width: 106rpx;
  168. height: 106rpx;
  169. }
  170. }
  171. .title {
  172. margin-top: 50rpx;
  173. text-align: center;
  174. color: #DEF1FF;
  175. font-size: 34rpx;
  176. font-weight: 700;
  177. }
  178. }
  179. .list {
  180. margin-top: 30rpx;
  181. padding: 10rpx 0;
  182. .item {
  183. height: 60rpx;
  184. display: flex;
  185. align-items: center;
  186. justify-content: center;
  187. .label {
  188. // width: 200rpx;
  189. color: #4CB1FF;
  190. font-size: 28rpx;
  191. }
  192. .value {
  193. margin-left: 30rpx;
  194. width: 40rpx;
  195. height: 40rpx;
  196. border-radius: 50%;
  197. }
  198. .value_1 {
  199. background-color: #00FF00;
  200. }
  201. .value_2 {
  202. background-color: #DCDCDC;
  203. }
  204. .value_3 {
  205. background-color: #FF0000;
  206. }
  207. }
  208. }
  209. }
  210. .parameter {
  211. box-sizing: border-box;
  212. margin-top: 50rpx;
  213. .title {
  214. margin: 0 auto;
  215. display: flex;
  216. justify-content: center;
  217. align-items: center;
  218. width: 230rpx;
  219. height: 60rpx;
  220. background-image: url(./icon/border.png);
  221. background-size: 100% 100%;
  222. background-repeat: no-repeat;
  223. .icon {
  224. margin-right: 10rpx;
  225. image {
  226. width: 30rpx;
  227. height: 30rpx;
  228. }
  229. }
  230. .text {
  231. color: #00FFF6;
  232. font-size: 30rpx;
  233. }
  234. }
  235. .list {
  236. margin-top: 40rpx;
  237. .item {
  238. height: 60rpx;
  239. display: flex;
  240. justify-content: space-between;
  241. color: #4CB1FF;
  242. font-size: 28rpx;
  243. .label {
  244. margin-left: 10rpx;
  245. width: 130rpx;
  246. text-overflow: ellipsis;
  247. white-space: nowrap;
  248. overflow: hidden;
  249. }
  250. .value {
  251. width: 120rpx;
  252. height: 40rpx;
  253. box-sizing: border-box;
  254. padding: 0 10rpx;
  255. background: rgba(0, 4, 15, 0.36);
  256. border: 2rpx solid #3D55A5;
  257. color: #FFF600;
  258. font-size: 24rpx;
  259. text-overflow: ellipsis;
  260. white-space: nowrap;
  261. overflow: hidden;
  262. }
  263. .unit {
  264. width: 70rpx;
  265. }
  266. }
  267. }
  268. }
  269. .electric_parameter {
  270. .title {
  271. width: 290rpx;
  272. }
  273. .list {
  274. .item {
  275. .label {
  276. width: 130rpx;
  277. }
  278. .unit {
  279. width: 70rpx;
  280. }
  281. }
  282. }
  283. }
  284. }
  285. .section:first-child {
  286. .state {
  287. .icon {
  288. border-right: 2rpx solid;
  289. border-image: linear-gradient(#0B163B, #00B7F5, #0B163B) 10;
  290. }
  291. .list {
  292. border-right: 2rpx solid;
  293. border-image: linear-gradient(#0B163B, #00B7F5, #0B163B) 10;
  294. }
  295. }
  296. .parameter {
  297. .list {
  298. border-right: 2rpx solid;
  299. border-image: linear-gradient(#0B163B, #00B7F5, #0B163B) 10;
  300. }
  301. }
  302. }
  303. }
  304. </style>