belt07.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  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. activeIndex: 0,
  34. list: [{
  35. name: '1#皮带',
  36. status: 1
  37. },{
  38. name: '2#皮带',
  39. status: 1
  40. },{
  41. name: '3#皮带',
  42. status: 1
  43. }],
  44. tableHead: ['名称', '参数/状态'],
  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.activeData = this.list[0]
  91. this.getData()
  92. },
  93. methods: {
  94. goBack() { // 返回上一頁面
  95. uni.navigateBack()
  96. },
  97. activeChange(item,index) { // 切换状态
  98. this.activeData = item
  99. this.activeIndex = index
  100. },
  101. async getData() {
  102. let res = await this.$http({
  103. url: `/qsy/dcs/transform/fxpd07`,
  104. method: 'POST'
  105. })
  106. this.activeData = this.list[0]
  107. this.list = res.data.data.list
  108. const mKeys = Object.keys(res.data.data).filter(key => key.startsWith('m'));
  109. this.paramsList = mKeys.map(key => {
  110. return res.data.data[key]
  111. });
  112. }
  113. }
  114. }
  115. </script>
  116. <style scoped lang="scss">
  117. .page-body {
  118. .scroll-wrap {
  119. height: calc(100vh - 85rpx);
  120. overflow: scroll;
  121. .basic-info-wrap {
  122. position: relative;
  123. height: auto;
  124. padding: 50rpx 49rpx 0;
  125. background: url(../../../../static/page_bg.png);
  126. background-size: 100%;
  127. .info-wrap {
  128. display: flex;
  129. flex-wrap: wrap;
  130. border-bottom: 1rpx dashed #fff;
  131. padding-bottom: 20rpx;
  132. .item {
  133. display: flex;
  134. justify-content: space-between;
  135. width: calc(50% - 64rpx);
  136. padding: 20rpx;
  137. color: #fff;
  138. font-size: 26rpx;
  139. .status-wrap {
  140. width: 100%;
  141. /deep/ .tip-wrap {
  142. justify-content: space-between;
  143. }
  144. }
  145. .params {
  146. color: #FFFF00;
  147. }
  148. }
  149. .item:nth-child(2n-1) {
  150. margin-right: 120rpx
  151. }
  152. .active {
  153. background: #3495FA;
  154. box-shadow: 0px 3px 7px 0px rgba(0, 8, 35, 0.31);
  155. border-radius: 14px;
  156. }
  157. }
  158. .img-wrap {
  159. padding: 70rpx 0;
  160. text-align: center;
  161. image {
  162. width: 443rpx;
  163. height: 48rpx;
  164. }
  165. }
  166. .radius-wrap {
  167. position: absolute;
  168. left: 0;
  169. bottom: 0;
  170. width: 100vw;
  171. height: 30rpx;
  172. background-color: #fff;
  173. border-radius: 35rpx 35rpx 0 0;
  174. }
  175. }
  176. .detail-info-wrap {
  177. padding: 40rpx 35rpx;
  178. /deep/ .card-wrap:last-child {
  179. margin-bottom: 0 !important;
  180. }
  181. }
  182. }
  183. }
  184. </style>