Investigation.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <template >
  2. <div class="maintenance-supervision">
  3. <div class="maintenance-supervision_header">
  4. <button-group @change="change">
  5. <button-group-item >
  6. 消防设施
  7. </button-group-item>
  8. <button-group-item >
  9. 生命通道
  10. </button-group-item>
  11. <button-group-item >
  12. 用电用气
  13. </button-group-item>
  14. <button-group-item >
  15. 消防管理
  16. </button-group-item>
  17. </button-group>
  18. </div>
  19. <div >
  20. <div class="row header">
  21. <span class="time">排查指标</span>
  22. <span class="person">正常数</span>
  23. <span class="result">异常数</span>
  24. </div>
  25. <ul class="item">
  26. <li class="row" >
  27. <span class="time">整体情况</span>
  28. <span class="person">{{ totalNumber.zcs }}</span>
  29. <span class="result">{{ totalNumber.ycs }}</span>
  30. </li>
  31. </ul>
  32. <VueSeamlessScroll
  33. :data="list[checked]"
  34. :class-option="classOption"
  35. class="warp"
  36. v-if="reload"
  37. >
  38. <ul class="item">
  39. <li class="row" v-for="(item, index) in list[checked]" :key="index">
  40. <span class="time">{{ item.yhxmxl }}</span>
  41. <span class="person">{{ item.zcs }}</span>
  42. <span class="result" >{{ item.ycs }}</span
  43. >
  44. </li>
  45. </ul>
  46. </VueSeamlessScroll>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. import VueSeamlessScroll from "vue-seamless-scroll";
  52. import { pctj } from '@/api/risk'
  53. export default {
  54. name: 'MaintenanceSupervision',
  55. props: {
  56. qx: String
  57. },
  58. data() {
  59. return {
  60. list: [
  61. [],
  62. [],
  63. [],
  64. []
  65. ],
  66. checked: 0,
  67. reload: true
  68. }
  69. },
  70. components: {
  71. VueSeamlessScroll
  72. },
  73. computed: {
  74. classOption() {
  75. return {
  76. singleHeight: 36
  77. };
  78. },
  79. totalNumber() {
  80. const data = this.list[this.checked]
  81. return data.reduce((item, cur) => {
  82. return {
  83. zcs: item.zcs + cur.zcs,
  84. ycs: item.ycs + cur.ycs
  85. }
  86. }, {zcs: 0, ycs: 0})
  87. }
  88. },
  89. watch: {
  90. qx:{
  91. handler(){
  92. this.loadData()
  93. },
  94. immediate: true
  95. }
  96. },
  97. methods: {
  98. change(idx) {
  99. this.reload = false
  100. this.checked = idx
  101. setTimeout(() => {
  102. this.reload = true
  103. }, 200)
  104. },
  105. loadData() {
  106. this.reload = false
  107. pctj({
  108. pageNum: 1,
  109. pageSize: 100,
  110. qx: (this.qx === "重庆市" ? "" : this.qx)
  111. }).then(res => {
  112. const temp = res.data.rows
  113. this.list = [
  114. temp.filter(item => item.yhxmdl === '消防设施'),
  115. temp.filter(item => item.yhxmdl === '生命通道'),
  116. temp.filter(item => item.yhxmdl === '用电用气'),
  117. temp.filter(item => item.yhxmdl === '消防管理')
  118. ]
  119. this.reload = true
  120. })
  121. }
  122. }
  123. }
  124. </script>
  125. <style scoped lang='less'>
  126. .maintenance-supervision {
  127. padding: 10px 10px 0px 10px;
  128. .maintenance-supervision_header {
  129. border-bottom: 1px solid #154956;
  130. padding-bottom: 2px;
  131. }
  132. .warp {
  133. height: 258px;
  134. margin: 0 auto;
  135. overflow: hidden;
  136. .item {
  137. list-style: none;
  138. padding: 0;
  139. margin: 0 auto;
  140. cursor: pointer;
  141. }
  142. }
  143. .header {
  144. height: 33px !important;
  145. line-height: 33px !important;
  146. background-color: rgba(0, 163, 255, 0.3) !important;
  147. margin-top: 15px;
  148. margin-bottom: 6px;
  149. span {
  150. color: #98DFE9 !important;
  151. }
  152. border: none !important;
  153. }
  154. .row,
  155. li,
  156. a {
  157. display: block;
  158. height: 36px;
  159. line-height: 36px;
  160. display: flex;
  161. justify-content: space-between;
  162. align-items: center;
  163. box-sizing: border-box;
  164. font-size: 12px;
  165. color: #D2F3F8;
  166. background-color: rgba(0, 0, 0, 0.2);
  167. border-bottom: 1px dashed #516B7A;
  168. .time,
  169. .person,
  170. .result {
  171. flex: 0.33;
  172. display: flex;
  173. justify-content: center;
  174. align-items: center;
  175. text-align: center;
  176. // 超出隐藏
  177. display: inline-block;
  178. overflow: hidden ;
  179. text-overflow: ellipsis ;
  180. white-space:nowrap;
  181. }
  182. .result {
  183. color: #FF4F4F;
  184. }
  185. }
  186. }
  187. </style>