移动端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

caseDistribution.vue 5.4 KiB

пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. <template>
  2. <div class="home_wrapper">
  3. <div class="header_main">
  4. 案件分布
  5. <div class="return_btn" @click="onClickLeft"></div>
  6. </div>
  7. <div class="tab">
  8. <van-dropdown-menu active-color="#1989fa">
  9. <van-dropdown-item v-model="value1" :options="option1" @change="changeYear" />
  10. <van-dropdown-item v-model="value2" :options="option2" @change="changeDept" />
  11. </van-dropdown-menu>
  12. </div>
  13. <div id='container'></div>
  14. </div>
  15. </template>
  16. <script>
  17. import {casePointList, treeselect} from "@/api/lawEnforcement/index";
  18. let map ;
  19. let myGeo ;
  20. export default {
  21. name: "caseAllocation",
  22. data() {
  23. return {
  24. value1: 2022,
  25. value2: '',
  26. option1: [
  27. { text: '2022', value: 2022 },
  28. { text: '2021', value: 2021 },
  29. { text: '2020', value: 2020 },
  30. { text: '2019', value: 2019 },
  31. { text: '2018', value: 2018 },
  32. ],
  33. option2: [
  34. { text: '全部', value: '' },
  35. { text: '羊亭镇', value: '山东省威海市羊亭镇' },
  36. { text: '张村镇', value: '山东省威海市张村镇' },
  37. { text: '桥头镇', value: '山东省威海市桥头镇' },
  38. { text: '温泉镇', value: '山东省威海市温泉镇' },
  39. ],
  40. geoJson: "",
  41. center: { lng: 122.089726, lat: 37.540728 }, //经纬度
  42. zoom: 1, //地图展示级别
  43. };
  44. },
  45. created() {
  46. treeselect().then((response) => {
  47. if (response.code == 200) {
  48. this.deptOptions = response.data;
  49. }
  50. })
  51. },
  52. mounted(){
  53. this.getCasePointList();
  54. },
  55. methods: {
  56. getCasePointList(){
  57. let query = {
  58. year:'2022',
  59. deptId:'100'
  60. };
  61. casePointList(query).then(res => {
  62. this.clockin_user = res.data.userName;
  63. // 将地址解析结果显示在地图上,并调整地图视野
  64. map = new BMapGL.Map('container');
  65. //创建地址解析器实例
  66. myGeo = new BMapGL.Geocoder();
  67. for (let i = 0 ; i < res.data.length ; i++){
  68. myGeo.getPoint(res.data[i].address, function(point) {
  69. if (point) {
  70. map.centerAndZoom(point, 10);
  71. map.enableScrollWheelZoom(true);
  72. map.addOverlay(new BMapGL.Marker(point, {}))
  73. }
  74. },'北京市')
  75. }
  76. })
  77. },
  78. changeDept(val){
  79. myGeo.getPoint(val, function(point) {
  80. if (point) {
  81. map.centerAndZoom(point, 15);
  82. map.enableScrollWheelZoom(true);
  83. // map.addOverlay(new BMapGL.Marker(point, {}))
  84. }
  85. })
  86. },
  87. changeYear(val){
  88. let query = {
  89. year:val,
  90. deptId:'100'
  91. };
  92. casePointList(query).then(res => {
  93. this.clockin_user = res.data.userName;
  94. // 将地址解析结果显示在地图上,并调整地图视野
  95. map = new BMapGL.Map('container');
  96. //创建地址解析器实例
  97. myGeo = new BMapGL.Geocoder();
  98. for (let i = 0 ; i < res.data.length ; i++){
  99. myGeo.getPoint(res.data[i].address, function(point) {
  100. if (point) {
  101. map.centerAndZoom(point, 10);
  102. map.enableScrollWheelZoom(true);
  103. map.addOverlay(new BMapGL.Marker(point, {}))
  104. }
  105. },'北京市')
  106. }
  107. })
  108. }
  109. },
  110. }
  111. </script>
  112. <style scoped lang="scss">
  113. #container{
  114. width: 100%;
  115. height: 100vh;
  116. overflow: hidden;
  117. }
  118. #result{
  119. position: fixed;
  120. top: 10px;
  121. left: 10px;
  122. width: 250px;
  123. height: 30px;
  124. line-height: 30px;
  125. text-align: center;
  126. background: #fff;
  127. box-shadow: 0 2px 6px 0 rgba(27, 142, 236, 0.5);
  128. border-radius: 7px;
  129. z-index: 99;
  130. }
  131. .home_wrapper{
  132. background: #e9e9e9;
  133. min-height: 100vh;
  134. width: 100vw;
  135. padding: 0 ;
  136. background: url('../../../../static/images/lawEnforcement/new/map.png') no-repeat 27%;
  137. background-size: auto 100%;
  138. .header_main{
  139. height: 116px;
  140. background: url('../../../../static/images/lawEnforcement/new/list_head.png') no-repeat;
  141. background-size: 100% 100%;
  142. position: fixed;
  143. top: 0;
  144. left: 0;
  145. width: 100%;
  146. font-size: 36px;
  147. line-height: 116px;
  148. text-align: center;
  149. color: #fff;
  150. z-index: 999;
  151. .return_btn{
  152. width: 24px;
  153. height: 43.2px;
  154. background: url('../../../assets/images/sunVillage_info/list_icon_5.png') center center no-repeat;
  155. background-size: 20px 36px;
  156. position: absolute;
  157. left: 38px;
  158. top: 36px;
  159. }
  160. .add_btn{
  161. width: 56.4px;
  162. height: 40.8px;
  163. background: url('../../../assets/images/sunVillage_info/list_icon_9.png') center center no-repeat;
  164. background-size: 47px 34px;
  165. position: absolute;
  166. right: 38px;
  167. top: 36px;
  168. }
  169. }
  170. }
  171. .tab{
  172. width: 94%;
  173. position: absolute;
  174. top: 130px;
  175. left: 3%;
  176. border-radius: 8PX;
  177. overflow: hidden;
  178. z-index: 999999;
  179. /deep/ .van-dropdown-item__content{
  180. width: 94%;
  181. left: 3%;
  182. border-bottom-left-radius: 8PX;
  183. border-bottom-right-radius: 8PX;
  184. }
  185. }
  186. .map_area {
  187. width: 100vw;
  188. height: 100vh;
  189. background: #ddd;
  190. position: absolute;
  191. left: 0;
  192. top: 0;
  193. }
  194. </style>