safety_monitoring.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view>
  3. <!-- navbar -->
  4. <p-safety-monitoring-navbar :mine="mine"></p-safety-monitoring-navbar>
  5. <view style="margin-bottom: 200rpx;">
  6. <!-- 模拟量 -->
  7. <view v-if="active == 1">
  8. <p-safety-monitoring-content-1 :mine="mine" :simulation="simulation" :simulationList="simulationList"></p-safety-monitoring-content-1>
  9. </view>
  10. <!-- 开关量 -->
  11. <view v-if="active == 2">
  12. <p-safety-monitoring-content-2 :mine="mine" :sluice="sluice" :sluiceList="sluiceList"></p-safety-monitoring-content-2>
  13. </view>
  14. </view>
  15. <!-- tabbar -->
  16. <view class="tabbar">
  17. <view class="list_item">
  18. <view class="item" :class="active === 1 ? 'active':''" @click="click_item(1)">
  19. <view class="item_icon icon_one"></view>
  20. <view class="item_name">
  21. 模拟量
  22. </view>
  23. </view>
  24. <view class="item" :class="active === 2 ? 'active':''" @click="click_item(2)">
  25. <view class="item_icon icon_two"></view>
  26. <view class="item_name">
  27. 开关量
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <script>
  35. export default {
  36. data() {
  37. return {
  38. mine:"",
  39. active:1,
  40. // 模拟量
  41. // 监测统计
  42. simulation:[],
  43. simulationList:[],
  44. // 开关量
  45. sluice:[],
  46. sluiceList:[],
  47. };
  48. },
  49. onLoad(option) {
  50. this.mine = option.mine
  51. // 模拟量统计
  52. this.getSimulation()
  53. // 开关量统计
  54. this.getSluice()
  55. },
  56. methods:{
  57. click_item(item){
  58. this.active = item
  59. },
  60. // 模拟量统计
  61. getSimulation(){
  62. uni.showLoading()
  63. this.$p_api.jt_safety_simulation_total({
  64. mine:this.mine,
  65. mine_code:this.mine
  66. }).then((res)=>{
  67. uni.hideLoading()
  68. // console.log(res)
  69. this.simulation = res.data.content.total
  70. this.simulationList = res.data.content.data
  71. })
  72. },
  73. // 开关量统计
  74. getSluice(){
  75. uni.showLoading()
  76. this.$p_api.jt_safety_sluice_total({
  77. mine:this.mine,
  78. mine_code:this.mine
  79. }).then((res)=>{
  80. uni.hideLoading()
  81. // console.log(res.data.content)
  82. this.sluice = res.data.content.total
  83. this.sluiceList = res.data.content.data
  84. })
  85. },
  86. }
  87. }
  88. </script>
  89. <style lang="scss">
  90. .tabbar{
  91. z-index: 999;
  92. background-color: #fff;
  93. position: fixed;
  94. bottom: 0;
  95. width: 750rpx;
  96. .list_item{
  97. width: 100%;
  98. border-top: 2rpx solid #f3f3f3;
  99. box-sizing: border-box;
  100. padding: 12rpx 0;
  101. .item{
  102. float: left;
  103. width: 50%;
  104. .item_icon{
  105. margin: 0 auto;
  106. width: 45rpx;
  107. height: 45rpx;
  108. background-size: cover;
  109. background-repeat: no-repeat;
  110. }
  111. .icon_one{
  112. background-image: url(icon/ss1.png);
  113. }
  114. .icon_two{
  115. background-image: url(icon/work.png);
  116. }
  117. .item_name{
  118. text-align: center;
  119. font-size: 25rpx;
  120. font-family: PingFangSC-Regular, PingFang SC;
  121. font-weight: 400;
  122. color: #929292;
  123. line-height: 40rpx;
  124. }
  125. }
  126. .active{
  127. .icon_one{
  128. background-image: url(icon/ss2.png);
  129. }
  130. .icon_two{
  131. background-image: url(icon/work_active.png);
  132. }
  133. .item_name{
  134. color: #3498DB;
  135. }
  136. }
  137. }
  138. }
  139. </style>