tabbar.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <div class="bigdata-map-tabbar">
  3. <el-row :gutter="20">
  4. <el-col :span="4" v-for="(item,index) in data_zhxx_data" :key="index">
  5. <div class="list-content">
  6. <span>{{item.value}}</span>
  7. <h5>{{item.name}}</h5>
  8. </div>
  9. </el-col>
  10. </el-row>
  11. <el-row :gutter="20">
  12. <el-col :span="4" v-for="(item,index) in data_zhxx_event" :key="index">
  13. <div class="list-content">
  14. <span>{{item.value}}</span>
  15. <h5>{{item.name}}</h5>
  16. </div>
  17. </el-col>
  18. </el-row>
  19. <el-row :gutter="20">
  20. <el-col :span="4">
  21. <div class="list-content">
  22. <span>{{data_zhxx_device}}</span>
  23. <h5>设备</h5>
  24. </div>
  25. </el-col>
  26. </el-row>
  27. </div>
  28. </template>
  29. <script>
  30. import {getZhxx} from '@/api/bigdata'
  31. export default {
  32. data() {
  33. return {
  34. data_zhxx_data: [],
  35. data_zhxx_event: [],
  36. data_zhxx_device: 0,
  37. //tab默认停留项el-tab-pane > name = "?"
  38. activeName: 'sp',
  39. //地区分类tabtitle
  40. district: [
  41. {
  42. label: '四平市',
  43. name: 'sp',
  44. id: ''
  45. },
  46. {
  47. label: '双辽市',
  48. name: 'sl',
  49. id: ''
  50. },
  51. {
  52. label: '梨树县',
  53. name: 'ls',
  54. id: ''
  55. },
  56. {
  57. label: '伊通县',
  58. name: 'yt',
  59. id: ''
  60. },
  61. {
  62. label: '铁东区',
  63. name: 'td',
  64. id: ''
  65. },
  66. {
  67. label: '铁西区',
  68. name: 'tx',
  69. id: ''
  70. },
  71. ],
  72. // 本地区内分类项数量
  73. regionNum: [
  74. {
  75. count: 641,
  76. name: '事件'
  77. },
  78. {
  79. count: 351,
  80. name: '隐患'
  81. },
  82. {
  83. count: 785,
  84. name: '人口'
  85. },
  86. {
  87. count: 512,
  88. name: '企业'
  89. },
  90. {
  91. count: 786,
  92. name: '林场'
  93. },
  94. {
  95. count: 544,
  96. name: '矿坑'
  97. },
  98. {
  99. count: 320,
  100. name: '收集点'
  101. },
  102. {
  103. count: 321,
  104. name: '水鹤'
  105. },
  106. {
  107. count: 400,
  108. name: '取水口'
  109. },
  110. {
  111. count: 654,
  112. name: '消火栓'
  113. },
  114. {
  115. count: 806,
  116. name: '摄像头'
  117. },
  118. {
  119. count: 312,
  120. name: '养殖场'
  121. },
  122. {
  123. count: 713,
  124. name: '处理中心'
  125. },
  126. {
  127. count: 132,
  128. name: '泡沫液'
  129. },
  130. {
  131. count: 466,
  132. name: '泡沫液'
  133. },
  134. {
  135. count: 897,
  136. name: '消防力量'
  137. },
  138. {
  139. count: 132,
  140. name: '探测器'
  141. }
  142. ]
  143. };
  144. },
  145. mounted() {
  146. this.zhxx(null);
  147. },
  148. methods: {
  149. zhxx() {
  150. let that = this
  151. getZhxx().then(resp => {
  152. console.log(resp)
  153. that.data_zhxx_device = resp.data.device
  154. that.data_zhxx_data = resp.data.data
  155. that.data_zhxx_event = resp.data.event
  156. })
  157. },
  158. handleClick(tab, event) {
  159. console.log(tab, event);
  160. }
  161. }
  162. };
  163. </script>
  164. <style rel="stylesheet/scss" lang="scss">
  165. @import '@/assets/styles/base.scss';
  166. .bigdata-map-tabbar {
  167. width: 100%;
  168. height: 28.5vh;
  169. padding: 0 1rem 1rem 1rem !important;
  170. box-shadow: 0 0 1px rgba($color: #163696, $alpha: .1),
  171. -0 -0 20px rgba($color: #163696, $alpha: .6) inset;
  172. .el-tabs__item {
  173. color: #fff;
  174. font-size: 12px;
  175. height: 32px;
  176. line-height: 32px;
  177. padding: 0 10px;
  178. }
  179. .el-tabs__item.is-active {
  180. color: #3ec6fc;
  181. }
  182. .el-tabs__nav-wrap::after {
  183. background: none;
  184. }
  185. .el-tabs__active-bar {
  186. // background-color: #ffbc30;
  187. border-radius: 20px;
  188. }
  189. .el-tab-pane {
  190. color: #fff;
  191. }
  192. .el-tabs__nav-next,
  193. .el-tabs__nav-prev {
  194. line-height: 40px;
  195. }
  196. .el-tabs__header {
  197. margin: 0 0 10px;
  198. }
  199. .list-content {
  200. width: 95%;
  201. margin: 0 auto;
  202. text-align: center;
  203. margin-top: 1rem;
  204. h5 {
  205. width: 100%;
  206. color: #0aaef2;
  207. padding: .2rem 0;
  208. border: 1px solid #091641;
  209. font-size: 12px;
  210. }
  211. span {
  212. width: 100%;
  213. display: flex;
  214. flex-direction: column;
  215. font-size: 12px;
  216. color: $white;
  217. padding: .5rem 0;
  218. font-weight: bolder;
  219. border: 1px solid #091641;
  220. border-bottom: none;
  221. }
  222. }
  223. .list-content:hover {
  224. filter: brightness(2.3);
  225. }
  226. }
  227. </style>