Commit 83ffa3547ddc816a3a03a5ab9d4c6561c42ff3e4

Authored by liuqimichale
1 parent 1df1d97d

地图 数据

src/components/VEquipment.vue
... ... @@ -66,8 +66,7 @@ export default {
66 66 watch:{
67 67 equipment:{//深度监听,可监听到对象、数组的变化
68 68 handler(val){
69   - this.equipvalue = val
70   - console.log(val.PDA)
  69 +
71 70 },
72 71 deep:true
73 72 }
... ...
src/components/VMap.vue
... ... @@ -17,7 +17,18 @@ export default {
17 17 }
18 18 },
19 19 mounted(){
20   - this.drawMap()
  20 +
  21 +
  22 + },
  23 + watch:{
  24 + // mapdata:function (newVal) {
  25 + // console.log(newVal)
  26 + // }
  27 + mapdata: function () {
  28 + this.$nextTick(()=>{
  29 + this.drawMap()
  30 + })
  31 + }
21 32 },
22 33 methods:{
23 34 initMap(){
... ... @@ -35,7 +46,7 @@ export default {
35 46 // let data = this.data
36 47 map = new BMap.Map('map', {enableMapClick: false})
37 48 var point = new BMap.Point(mapData[0].lonId, mapData[0].latId)
38   - map.centerAndZoom(point, 15)
  49 + map.centerAndZoom(point, 22)
39 50 var mapStyle={ style : "midnight" }
40 51 map.enableScrollWheelZoom(false);
41 52 map.setMapStyle(mapStyle);
... ... @@ -94,8 +105,8 @@ export default {
94 105 <li></li>
95 106 <li><div>${mapData[item].plBerthNum}</div><div>总数</div></li>
96 107 </ul>
97   - <div class="dislog-footer">停车场收入:1293847.00元</div>
98   - <div class="dislog-footer">停车场收入:1293847.00元</div>
  108 + <div class="dislog-footer">停车场收入:${mapData[item].income}元</div>
  109 + <div class="dislog-footer">停车场欠费:${mapData[item].arreageincome}元</div>
99 110 </div>`,
100 111 {
101 112 offset: new BMap.Size(-225, -55), //label的偏移量,为了让label的中心显示在点上
... ...
src/view/VHome.vue
... ... @@ -91,9 +91,9 @@ export default {
91 91 ydpper:100
92 92 },
93 93 ditudata:[
94   - {Name:'万达停车场1',lonId:'111.742579',latId:'40.818675',status:0,freeBrethNum:0,plBerthNum:1000,plName:'万达广场停车场1',plAddress:'北京万达广场1'},
95   - {Name:'万达停车场2',lonId:'111.622579',latId:'40.878675',status:1,freeBrethNum:100,plBerthNum:800,plName:'万达广场停车场2',plAddress:'北京万达广场2'},
96   - {Name:'万达停车场333333',lonId:'111.782579',latId:'40.778675',status:2,freeBrethNum:300,plBerthNum:500,plName:'万达广场停车场3',plAddress:'北京万达广场3'}
  94 + {Name:'万达停车场1',lonId:'111.742579',latId:'40.818675',status:0,freeBrethNum:0,plBerthNum:1000,plName:'万达广场停车场1',plAddress:'北京万达广场1',income:123,arreageincome:100},
  95 + {Name:'万达停车场2',lonId:'111.622579',latId:'40.878675',status:1,freeBrethNum:100,plBerthNum:800,plName:'万达广场停车场2',plAddress:'北京万达广场2',income:123,arreageincome:100},
  96 + {Name:'万达停车场333333',lonId:'111.782579',latId:'40.778675',status:2,freeBrethNum:300,plBerthNum:500,plName:'万达广场停车场3',plAddress:'北京万达广场3',income:123,arreageincome:100}
97 97 ]
98 98  
99 99 }
... ... @@ -160,7 +160,40 @@ export default {
160 160 orgIds: this.GLOBAL.orignId
161 161 }).then((response)=>{
162 162 let data = response.data.data
163   - console.log(response)
  163 + console.log(data)
  164 + var tempData = [];
  165 + for(var index in data){
  166 +
  167 + var item = data[index];
  168 + var tempItem =
  169 +
  170 +
  171 + {
  172 + Name: item.parkInfo.plName,
  173 + lonId: item.parkInfo.lonId,
  174 + latId:item.parkInfo.latId,
  175 + status: 0,
  176 + freeBrethNum: item.realTimeInfoDTO.berthFreeNum,
  177 + plBerthNum: item.realTimeInfoDTO.berthNum,
  178 + plName: item.parkInfo.plName,
  179 + plAddress: item.parkInfo.plAddress,
  180 + income:(item.realTimeInfoDTO.allIncome/100).toFixed(2),
  181 + arreageincome:(item.realTimeInfoDTO.escapeFee).toFixed(2)
  182 + }
  183 +
  184 + tempData.push(tempItem);
  185 +
  186 + }
  187 +
  188 + this.ditudata = tempData;
  189 + console.log(this.ditudata)
  190 + // ditudata:[
  191 + // {Name:'万达停车场1',lonId:'111.742579',latId:'40.818675',status:0,freeBrethNum:0,plBerthNum:1000,plName:'万达广场停车场1',plAddress:'北京万达广场1'},
  192 + // {Name:'万达停车场2',lonId:'111.622579',latId:'40.878675',status:1,freeBrethNum:100,plBerthNum:800,plName:'万达广场停车场2',plAddress:'北京万达广场2'},
  193 + // {Name:'万达停车场333333',lonId:'111.782579',latId:'40.778675',status:2,freeBrethNum:300,plBerthNum:500,plName:'万达广场停车场3',plAddress:'北京万达广场3'}
  194 + // ]
  195 +
  196 + //console.log(this.ditudata)
164 197 }).catch((response)=>{
165 198 console.log(response);
166 199 })
... ...