jxpdjk.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197
  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" :class="activeData.name === item.name ? 'active item' : 'item'"
  8. :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 src="@/static/pd.png"/>
  15. </view>
  16. <view class="radius-wrap"></view>
  17. </view>
  18. <view class="detail-info-wrap">
  19. <page-card style="margin-bottom: 30rpx;" :notShow="true" :name="'皮带参数'">
  20. <template v-slot:content>
  21. <simple-table :tableHead="tableHead" :list="paramsList[activeIndex]"></simple-table>
  22. </template>
  23. </page-card>
  24. </view>
  25. </view>
  26. </view>
  27. </template>
  28. <script>
  29. export default {
  30. data() {
  31. return {
  32. activeData: {},
  33. list: [{
  34. name: '1#皮带',
  35. status: 1
  36. },{
  37. name: '2#皮带',
  38. status: 1
  39. },{
  40. name: '3#皮带',
  41. status: 1
  42. }],
  43. tableHead: ['名称', '参数/状态'],
  44. activeIndex: 0,
  45. paramsList: [{
  46. name: '速度',
  47. params: ['23m/s']
  48. },{
  49. name: '远近控状态',
  50. params: ['正常']
  51. },{
  52. name: '联锁模式',
  53. params: ['暂无']
  54. },{
  55. name: '区域闯入',
  56. params: ['暂无']
  57. },{
  58. name: '急停',
  59. params: ['暂无']
  60. },{
  61. name: '备要信号',
  62. params: [{
  63. status: 1
  64. }]
  65. },{
  66. name: '烟雾',
  67. params: [{
  68. status: 1
  69. }]
  70. },{
  71. name: '堆煤',
  72. params: [{
  73. status: 1
  74. }]
  75. },{
  76. name: '纵断',
  77. params: [{
  78. status: 1
  79. }]
  80. },{
  81. name: '跑偏',
  82. params: [{
  83. status: 1
  84. }]
  85. }]
  86. }
  87. },
  88. onLoad(option) {
  89. this.pageData = JSON.parse(option.data)
  90. this.getData()
  91. },
  92. methods: {
  93. goBack() { // 返回上一頁面
  94. uni.navigateBack()
  95. },
  96. activeChange(item,index) { // 切换状态
  97. this.activeData = item
  98. this.activeIndex = index
  99. },
  100. async getData() {
  101. let res = await this.$http({
  102. url: `/qsy/dcs/transform/jxpdjk`,
  103. method: 'POST'
  104. })
  105. this.activeData = this.list[0]
  106. this.list = res.data.data.list
  107. const mKeys = Object.keys(res.data.data).filter(key => key.startsWith('m'));
  108. this.paramsList = mKeys.map(key => {
  109. return res.data.data[key]
  110. });
  111. }
  112. }
  113. }
  114. </script>
  115. <style scoped lang="scss">
  116. .page-body {
  117. .scroll-wrap {
  118. height: calc(100vh - 85rpx);
  119. overflow: scroll;
  120. .basic-info-wrap {
  121. position: relative;
  122. height: auto;
  123. padding: 50rpx 49rpx 0;
  124. background: url(../../../../static/page_bg.png);
  125. background-size: 100%;
  126. .info-wrap {
  127. display: flex;
  128. flex-wrap: wrap;
  129. border-bottom: 1rpx dashed #fff;
  130. padding-bottom: 20rpx;
  131. .item {
  132. display: flex;
  133. justify-content: space-between;
  134. width: calc(50% - 64rpx);
  135. padding: 20rpx;
  136. color: #fff;
  137. font-size: 26rpx;
  138. .status-wrap {
  139. width: 100%;
  140. /deep/ .tip-wrap {
  141. justify-content: space-between;
  142. }
  143. }
  144. .params {
  145. color: #FFFF00;
  146. }
  147. }
  148. .item:nth-child(2n-1) {
  149. margin-right: 120rpx
  150. }
  151. .active {
  152. background: #3495FA;
  153. box-shadow: 0px 3px 7px 0px rgba(0, 8, 35, 0.31);
  154. border-radius: 14px;
  155. }
  156. }
  157. .img-wrap {
  158. padding: 70rpx 0;
  159. text-align: center;
  160. image {
  161. width: 443rpx;
  162. height: 48rpx;
  163. }
  164. }
  165. .radius-wrap {
  166. position: absolute;
  167. left: 0;
  168. bottom: 0;
  169. width: 100vw;
  170. height: 30rpx;
  171. background-color: #fff;
  172. border-radius: 35rpx 35rpx 0 0;
  173. }
  174. }
  175. .detail-info-wrap {
  176. padding: 40rpx 35rpx;
  177. /deep/ .card-wrap:last-child {
  178. margin-bottom: 0 !important;
  179. }
  180. }
  181. }
  182. }
  183. </style>