safety_monitoring.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view>
  3. <!-- navbar -->
  4. <p-safety-monitoring-navbar :mine="mine"></p-safety-monitoring-navbar>
  5. <view style="padding-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. // this.get_product_data_query_power()
  56. },
  57. methods:{
  58. get_product_data_query_power(){
  59. this.$p_api.product_data_query_power({
  60. staff_num: uni.getStorageSync('user').staff_num,
  61. data_module: "aqjc"
  62. }).then((res)=>{
  63. if(res.data.content.status){
  64. console.log("可查看")
  65. }else{
  66. uni.showToast({
  67. icon:"none",
  68. title:"没有查看权限!"
  69. })
  70. setTimeout(()=>{
  71. uni.navigateBack()
  72. },1000)
  73. }
  74. })
  75. },
  76. click_item(item){
  77. this.active = item
  78. },
  79. // 模拟量统计
  80. getSimulation(){
  81. uni.showLoading()
  82. this.$p_api.jt_safety_simulation_total({
  83. mine:this.mine,
  84. mine_code:this.mine
  85. }).then((res)=>{
  86. uni.hideLoading()
  87. // console.log(res)
  88. this.simulation = res.data.content.total
  89. this.simulationList = res.data.content.data
  90. })
  91. },
  92. // 开关量统计
  93. getSluice(){
  94. uni.showLoading()
  95. this.$p_api.jt_safety_sluice_total({
  96. mine:this.mine,
  97. mine_code:this.mine
  98. }).then((res)=>{
  99. uni.hideLoading()
  100. // console.log(res.data.content)
  101. this.sluice = res.data.content.total
  102. this.sluiceList = res.data.content.data
  103. })
  104. },
  105. }
  106. }
  107. </script>
  108. <style lang="scss">
  109. .tabbar{
  110. z-index: 999;
  111. background-color: #fff;
  112. position: fixed;
  113. bottom: 0;
  114. width: 750rpx;
  115. .list_item{
  116. width: 100%;
  117. border-top: 2rpx solid #f3f3f3;
  118. box-sizing: border-box;
  119. padding: 12rpx 0;
  120. .item{
  121. float: left;
  122. width: 50%;
  123. .item_icon{
  124. margin: 0 auto;
  125. width: 45rpx;
  126. height: 45rpx;
  127. background-size: cover;
  128. background-repeat: no-repeat;
  129. }
  130. .icon_one{
  131. background-image: url(icon/ss1.png);
  132. }
  133. .icon_two{
  134. background-image: url(icon/work.png);
  135. }
  136. .item_name{
  137. text-align: center;
  138. font-size: 25rpx;
  139. font-family: PingFangSC-Regular, PingFang SC;
  140. font-weight: 400;
  141. color: #929292;
  142. line-height: 40rpx;
  143. }
  144. }
  145. .active{
  146. .icon_one{
  147. background-image: url(icon/ss2.png);
  148. }
  149. .icon_two{
  150. background-image: url(icon/work_active.png);
  151. }
  152. .item_name{
  153. color: #3498DB;
  154. }
  155. }
  156. }
  157. }
  158. </style>