detail.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <template>
  2. <view class="detail-page">
  3. <navigation title="设备详情"></navigation>
  4. <view class="info-box">
  5. <image src="@/static/ic_tab_shutdown_selected.png" class="img-icon"></image>
  6. <view>
  7. <view class="item-text">设备名称:{{ item.name || '-' }}</view>
  8. <view class="item-text">稼动率:{{ item.time || '-' }}</view>
  9. <view class="item-text">当班产量:{{ item.name || '-' }}</view>
  10. <view class="item-text">模具编号:{{ item.time || '-' }}</view>
  11. <view class="item-text">生产产品:{{ item.name || '-' }}</view>
  12. </view>
  13. </view>
  14. <view class="chart-box">
  15. <view class="title">每小时产量</view>
  16. <qiun-data-charts type="line" :opts="opts" :chartData="chartData" />
  17. </view>
  18. <view class="chart-box">
  19. <view class="title">每小时用电量</view>
  20. <qiun-data-charts type="line" :opts="opts" :chartData="chartDataElec" />
  21. </view>
  22. </view>
  23. </template>
  24. <script>
  25. export default {
  26. data() {
  27. return {
  28. chartData: {},
  29. chartDataElec: {},
  30. opts: {
  31. color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
  32. "#ea7ccc"
  33. ],
  34. padding: [15, 10, 0, 15],
  35. legend: {
  36. show: false
  37. },
  38. xAxis: {
  39. disableGrid: true
  40. },
  41. yAxis: {
  42. gridType: "dash",
  43. dashLength: 2,
  44. data: [{
  45. tofix: 2,
  46. }]
  47. },
  48. extra: {
  49. line: {
  50. type: "curve",
  51. width: 2
  52. }
  53. }
  54. },
  55. }
  56. },
  57. onLoad(option) {
  58. console.log(option.type)
  59. this.getServerData()
  60. this.getServerDataElec()
  61. },
  62. methods: {
  63. // 产量
  64. getServerData() {
  65. setTimeout(() => {
  66. let res = {
  67. categories: ["2018", "2019", "2020", "2021", "2022", "2023"],
  68. series: [{
  69. name: "每小时产量",
  70. data: [35, 8, 25, 37, 4, 20]
  71. }, ]
  72. };
  73. this.chartData = JSON.parse(JSON.stringify(res));
  74. }, 500);
  75. },
  76. // 用电量
  77. getServerDataElec() {
  78. let res = {
  79. categories: ["2018", "2019", "2020", "2021", "2022", "2023"],
  80. series: [{
  81. name: "每小时用电量",
  82. data: [35, 8, 25, 37, 4, 20]
  83. }, ]
  84. };
  85. this.chartDataElec = JSON.parse(JSON.stringify(res));
  86. },
  87. }
  88. }
  89. </script>
  90. <style lang="scss" scoped>
  91. .detail-page {
  92. .info-box {
  93. background-color: #fff;
  94. margin: 24rpx;
  95. padding: 20rpx 40rpx;
  96. border-radius: 12rpx;
  97. display: flex;
  98. color: $uni-text-color-list;
  99. .img-icon {
  100. width: 200rpx;
  101. height: 200rpx;
  102. margin-left: 10%;
  103. margin-right: 10%;
  104. }
  105. .item-text {
  106. margin-top: 8rpx;
  107. }
  108. }
  109. .chart-box {
  110. background-color: #fff;
  111. margin: 24rpx;
  112. padding: 20rpx;
  113. border-radius: 12rpx;
  114. .title {
  115. font-size: 28rpx;
  116. }
  117. }
  118. }
  119. </style>