pump-machine.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  1. <template>
  2. <view class="page-body">
  3. <page-header :name="'乳化泵'" :bg="'#1560e0'" :showLeft="true" @goBack="goBack()"></page-header>
  4. <view class="scroll-wrap">
  5. <view class="basic-info-wrap">
  6. <view class="status-tip-wrap" style="margin-bottom: 26rpx;">
  7. <status-tip :class="active === index ? 'active-item' : ''" @clickItem="tabChange" class="item" v-for="(item, index) in rhbList" :key="index" :name="item.name"
  8. :status="item.status" :tip="item.status ? '运行' : '停止'"></status-tip>
  9. </view>
  10. <view class="detail-wrap">
  11. <view class="icon">
  12. <image src="@/static/rhb.jpg"/>
  13. </view>
  14. <view class="info">
  15. <view class="item">{{ rhbList[active].name }}</view>
  16. <view class="item"><span>润滑油温(℃)</span>{{ rhbList[active].temperature }}</view>
  17. <view class="item"><span>润滑油压(Mpa)</span>{{ rhbList[active].mpa }}</view>
  18. </view>
  19. </view>
  20. <view class="radius-wrap"></view>
  21. </view>
  22. <view class="detail-info-wrap">
  23. <page-card :name="'乳化泵油压变化曲线'" style="margin-bottom: 30rpx;" :notShow="true">
  24. <template v-slot:content>
  25. <view class="change-wrap">
  26. <bar-chart :barType="'line'" :optSet="optLine" :data="lineChartData"
  27. :barHeight="'249rpx'"></bar-chart>
  28. </view>
  29. </template>
  30. </page-card>
  31. <page-card :name="'乳化泵系统压力曲线图'" :notShow="true">
  32. <template v-slot:content>
  33. <view class="pressure-wrap">
  34. <bar-chart :barType="'column'" :optSet="optColumn" :data="columnChartData"
  35. :barHeight="'273rpx'"></bar-chart>
  36. </view>
  37. </template>
  38. </page-card>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <script>
  44. export default {
  45. data() {
  46. return {
  47. active: 0, // 当前活动的tab
  48. rhbList: [{ // 乳化泵信息
  49. name: '1#液泵',
  50. status: 0,
  51. temperature: 0,
  52. mpa: 1
  53. }, {
  54. name: '乳化增压泵',
  55. status: 1,
  56. temperature: 10,
  57. mpa: 23
  58. }, {
  59. name: '2#液泵',
  60. status: 0,
  61. temperature: 35,
  62. mpa: 26
  63. }, {
  64. name: '1#水泵',
  65. status: 0,
  66. temperature: 22,
  67. mpa: 56
  68. }, {
  69. name: '3#液泵',
  70. status: 0,
  71. temperature: 45,
  72. mpa: 67
  73. }, {
  74. name: '2#水泵',
  75. status: 0,
  76. temperature: 12,
  77. mpa: 32
  78. }, {
  79. name: '其他',
  80. status: null,
  81. temperature: 80,
  82. mpa: 1
  83. }, ],
  84. lineChartData: {}, // 折线图数据
  85. optLine: { // 折线图配置
  86. dataLabel: false, // 不显示数据标签
  87. color: ['#5C79D1'], // 折线图颜色
  88. dataPointShape: false,
  89. legend: {
  90. show: false, // 不显示底部标签
  91. },
  92. xAxis: {
  93. boundaryGap: 'justify', // 折线两端是否连接坐标轴
  94. axisLineColor: '#E5E5E5', // x轴线的颜色
  95. fontColor: '#A9A9A9' // x轴字体的颜色
  96. },
  97. yAxis: {
  98. gridColor: '#E5E5E5', // 横向数据标线的颜色
  99. data: [{
  100. axisLineColor: '#E5E5E5', // y轴线的颜色
  101. fontColor: '#A9A9A9' // y轴字体的颜色
  102. }]
  103. }
  104. },
  105. columnChartData: {}, // 柱状图数据
  106. optColumn: { // 柱状图配置
  107. dataLabel: false, // 不显示数据标签
  108. color: ['#5C79D1'], // 柱状图颜色
  109. legend: {
  110. show: false, // 不显示底部标签
  111. },
  112. xAxis: {
  113. axisLineColor: '#E5E5E5', // x轴线的颜色
  114. fontColor: '#A9A9A9' // x轴字体的颜色
  115. },
  116. yAxis: {
  117. gridColor: '#E5E5E5', // 横向数据标线的颜色
  118. showTitle: true, // 是否显示标题
  119. data: [{
  120. title: '单位:m/min', // 标题内容
  121. titleFontColor: '#A9A9A9', // 标题字体颜色
  122. titleOffsetY: -5, // 标题纵向偏移量
  123. axisLineColor: '#E5E5E5', // y轴线的颜色
  124. fontColor: '#A9A9A9' // y轴字体的颜色
  125. }]
  126. },
  127. extra: {
  128. column: {
  129. width: 18 // 设置柱子的宽度
  130. }
  131. }
  132. }
  133. }
  134. },
  135. onLoad() {
  136. this.getColumnData()
  137. this.getLineData()
  138. },
  139. methods: {
  140. tabChange(e) { // 乳化泵切换
  141. this.active = this.rhbList.findIndex((v) => {return v.name === e})
  142. },
  143. getColumnData() { // 获取柱状图数据
  144. let res = {
  145. categories: ["23:32", "23:32", "23:32", "23:32", "23:32", "23:32"],
  146. series: [{
  147. name: '产量:',
  148. data: [0.8, 0.7, 0.8, 0.9, 1.3, 1.4]
  149. }]
  150. };
  151. this.columnChartData = JSON.parse(JSON.stringify(res));
  152. },
  153. getLineData() { // 获取折线图数据
  154. let res = {
  155. categories: ["23:32", "23:32", "23:32", "23:32", "23:32", "23:32"],
  156. series: [{
  157. name: '综采循环作业:',
  158. data: [45, 0, 100, 0, 90, 0, 85]
  159. }]
  160. };
  161. this.lineChartData = JSON.parse(JSON.stringify(res));
  162. },
  163. goBack() { // 返回上一頁面
  164. uni.navigateBack()
  165. }
  166. }
  167. }
  168. </script>
  169. <style scoped lang="scss">
  170. .page-body {
  171. .scroll-wrap {
  172. height: calc(100vh - 85rpx);
  173. overflow: scroll;
  174. .basic-info-wrap {
  175. position: relative;
  176. height: 630rpx;
  177. padding: 25rpx 35rpx 0;
  178. background: url(../../../../static/page_bg.png);
  179. background-size: 100%;
  180. .status-tip-wrap {
  181. display: flex;
  182. flex-wrap: wrap;
  183. border-bottom: 1rpx dashed #fff;
  184. padding-bottom: 42rpx;
  185. .active-item {
  186. background: #3495FA;
  187. border-radius: 14rpx;
  188. }
  189. .item {
  190. width: calc(50% - 21rpx);
  191. margin-left: 21rpx;
  192. padding: 0 47rpx;
  193. /deep/ .tip-wrap {
  194. padding: 23rpx 0;
  195. justify-content: space-between;
  196. color: #fff;
  197. font-size: 26rpx
  198. }
  199. }
  200. .item:nth-child(2n - 1) {
  201. margin-left: 0;
  202. }
  203. .item:nth-child(-n+2) {
  204. margin-top: 0;
  205. }
  206. }
  207. .detail-wrap {
  208. display: flex;
  209. padding: 0 76rpx;
  210. .icon {
  211. margin-right: 82rpx;
  212. image {
  213. width: 112rpx;
  214. height: 150rpx;
  215. }
  216. }
  217. .info {
  218. width: calc(100% - 194rpx);
  219. font-size: 28rpx;
  220. color: #fff;
  221. .item {
  222. display: flex;
  223. justify-content: space-between;
  224. margin-bottom: 20rpx;
  225. }
  226. }
  227. }
  228. .radius-wrap {
  229. position: absolute;
  230. left: 0;
  231. bottom: 0;
  232. width: 100vw;
  233. height: 30rpx;
  234. background-color: #fff;
  235. border-radius: 35rpx 35rpx 0 0;
  236. }
  237. }
  238. .detail-info-wrap {
  239. padding: 40rpx 35rpx;
  240. .change-wrap {
  241. padding: 28rpx 20rpx;
  242. }
  243. .pressure-wrap {
  244. padding: 28rpx 20rpx;
  245. }
  246. }
  247. }
  248. }
  249. </style>