nitrogen-system.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <view class="page-body">
  3. <page-header :name="pageData.name" :bg="'#1560e0'" :showLeft="true" @goBack="goBack()"></page-header>
  4. <view class="scroll-wrap">
  5. <view class="basic-info-wrap">
  6. <view class="info-wrap">
  7. <view @click="activeChange(item,index)" v-for="(item,index) in list"
  8. :class="activeData.name === item.name ? 'active item' : 'item'" :key="index">
  9. <status-tip class="status-wrap" :name="item.name" :status="item.status"
  10. :tip="item.status ? '运行' : '停止'"></status-tip>
  11. </view>
  12. </view>
  13. <view class="img-wrap">
  14. <image v-if="activeData.status" src="@/static/nitrogen.jpg" />
  15. <image v-else src="@/static/nitrogen-static.png" />
  16. <view>
  17. {{ activeData.name }}
  18. </view>
  19. </view>
  20. <view class="radius-wrap"></view>
  21. </view>
  22. <view class="detail-info-wrap">
  23. <page-card style="margin-bottom: 30rpx;" :notShow="true" :name="activeData.name">
  24. <template v-slot:content>
  25. <simple-table :tableHead="tableHead" :list="paramsList[activeIndex]"></simple-table>
  26. </template>
  27. </page-card>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. export default {
  34. data() {
  35. return {
  36. pageData: {},
  37. activeData: {},
  38. activeIndex: 0,
  39. list: [{
  40. name: '1#空压',
  41. status: 0
  42. }, {
  43. name: '2#空压',
  44. status: 0
  45. }, {
  46. name: '3#空压',
  47. status: 0
  48. }],
  49. tableHead: ['名称', '参数/状态'],
  50. paramsList: [
  51. [{
  52. name: '气压(Mpa)',
  53. params: ['0.59']
  54. },
  55. {
  56. name: '排空阀',
  57. params: [{
  58. status: 0
  59. }]
  60. },
  61. {
  62. name: '系统阀',
  63. params: [{
  64. status: 1
  65. }]
  66. },
  67. {
  68. name: '送气阀',
  69. params: [{
  70. status: 1
  71. }]
  72. },
  73. {
  74. name: '罐压(Mpa)',
  75. params: ['0.59']
  76. },
  77. {
  78. name: '罐温(℃)',
  79. params: ['31.0']
  80. },
  81. {
  82. name: '罐报警值(℃)',
  83. params: ['120.0']
  84. }
  85. ],
  86. [{
  87. name: '气压(Mpa)',
  88. params: ['0.59']
  89. },
  90. {
  91. name: '排空阀',
  92. params: [{
  93. status: 0
  94. }]
  95. },
  96. {
  97. name: '系统阀',
  98. params: [{
  99. status: 1
  100. }]
  101. },
  102. {
  103. name: '送气阀',
  104. params: [{
  105. status: 1
  106. }]
  107. },
  108. {
  109. name: '罐压(Mpa)',
  110. params: ['0.59']
  111. },
  112. {
  113. name: '罐温(℃)',
  114. params: ['31.0']
  115. },
  116. {
  117. name: '罐报警值(℃)',
  118. params: ['120.0']
  119. }
  120. ],
  121. [{
  122. name: '气压(Mpa)',
  123. params: ['0.59']
  124. },
  125. {
  126. name: '排空阀',
  127. params: [{
  128. status: 0
  129. }]
  130. },
  131. {
  132. name: '系统阀',
  133. params: [{
  134. status: 1
  135. }]
  136. },
  137. {
  138. name: '送气阀',
  139. params: [{
  140. status: 1
  141. }]
  142. },
  143. {
  144. name: '罐压(Mpa)',
  145. params: ['0.59']
  146. },
  147. {
  148. name: '罐温(℃)',
  149. params: ['31.0']
  150. },
  151. {
  152. name: '罐报警值(℃)',
  153. params: ['120.0']
  154. }
  155. ]
  156. ]
  157. }
  158. },
  159. onLoad(option) {
  160. this.pageData = JSON.parse(option.data)
  161. this.getData()
  162. },
  163. methods: {
  164. goBack() { // 返回上一頁面
  165. uni.navigateBack()
  166. },
  167. activeChange(item, index) { // 切换状态
  168. this.activeData = item
  169. this.activeIndex = index
  170. },
  171. async getData() {
  172. let res = await this.$http({
  173. url: `/qsy/dcs/transform/yfjk`,
  174. method: 'POST'
  175. })
  176. this.list = res.data.data.list
  177. this.activeData = this.list[0]
  178. const mKeys = Object.keys(res.data.data).filter(key => key.startsWith('data'));
  179. this.paramsList = mKeys.map(key => {
  180. return res.data.data[key]
  181. });
  182. }
  183. }
  184. }
  185. </script>
  186. <style scoped lang="scss">
  187. .page-body {
  188. .scroll-wrap {
  189. height: calc(100vh - 85rpx);
  190. overflow: scroll;
  191. .basic-info-wrap {
  192. position: relative;
  193. height: auto;
  194. padding: 50rpx 49rpx 0;
  195. background: url(../../../../static/page_bg.png);
  196. background-size: 120%;
  197. .info-wrap {
  198. display: flex;
  199. flex-wrap: wrap;
  200. border-bottom: 1rpx dashed #fff;
  201. padding-bottom: 30rpx;
  202. .item {
  203. display: flex;
  204. padding: 24rpx 26rpx;
  205. justify-content: space-between;
  206. width: 50%;
  207. color: #fff;
  208. font-size: 26rpx;
  209. .status-wrap {
  210. width: 100%;
  211. /deep/ .tip-wrap {
  212. justify-content: space-between;
  213. }
  214. }
  215. .params {
  216. color: #FFFF00;
  217. }
  218. }
  219. .active {
  220. background: #3495FA;
  221. box-shadow: 0px 3px 7px 0px rgba(0, 8, 35, 0.31);
  222. border-radius: 14px;
  223. }
  224. }
  225. .img-wrap {
  226. padding: 49rpx 0;
  227. text-align: center;
  228. image {
  229. width: 310rpx;
  230. height: 138rpx;
  231. }
  232. view {
  233. margin-top: 25rpx;
  234. color: #fff;
  235. }
  236. }
  237. .radius-wrap {
  238. position: absolute;
  239. left: 0;
  240. bottom: 0;
  241. width: 100vw;
  242. height: 30rpx;
  243. background-color: #fff;
  244. border-radius: 35rpx 35rpx 0 0;
  245. }
  246. }
  247. .detail-info-wrap {
  248. padding: 40rpx 35rpx;
  249. /deep/ .card-wrap:last-child {
  250. margin-bottom: 0 !important;
  251. }
  252. }
  253. }
  254. }
  255. </style>