emss.vue 3.9 KB

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