Commit 0860a075a04f0636b2c9d5bf3f65caa72e272c25

Authored by Andy
2 parents f1414ff7 04d7be6d

Merge branch 'test' of http://gitlab.renniting.cn/web_developers/lzsandtable into test

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/VInout.vue
... ... @@ -3,7 +3,7 @@
3 3 <card-title> <span>进出场消息</span></card-title>
4 4 <div class="theme-body">
5 5 <div class="access-title">
6   - <p><span><span class="access-icon"></span>{{inoutmsg}} 进场</span> <span>{{inouttime}}</span></p>
  6 + <p><span><span class="access-icon"></span>{{inoutmsg}} </span> <span>{{inouttime|formatDate}}</span></p>
7 7 </div>
8 8 <div class="access-img" :style="{backgroundImage:'url('+imgUrl+')'}"></div>
9 9 </div>
... ... @@ -13,6 +13,8 @@
13 13 <script>
14 14 import CardTitle from './base/CardTitle'
15 15 import AccountNum from './base/AccountNum'
  16 +import { formatDate } from '../utils/date'
  17 +
16 18 export default {
17 19 name: 'VInout',
18 20 components: {
... ... @@ -23,6 +25,12 @@ export default {
23 25 data(){
24 26 return{
25 27 }
  28 + },
  29 + filters:{
  30 + formatDate(time){
  31 + var date = new Date(time)
  32 + return formatDate(date, 'yyyy-MM-dd hh:mm');
  33 + }
26 34 }
27 35 }
28 36 </script>
... ...
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/utils/api.js
... ... @@ -15,3 +15,9 @@ export const berthAddress = p =&gt; post(&#39;urban/intelligence/berth/queryBerthStatis
15 15  
16 16 //....设备
17 17 export const equipmentAddress = p => post('urban/intelligence/device/queryDeviceStatistic',p)
  18 +
  19 +//....地图
  20 +export const mapAddress = p => post('urban/intelligence/park/queryParkDetailInfoByOrgIds',p)
  21 +
  22 +//....进出场
  23 +export const inoutAddress = p => post('urban/intelligence/orderPark/queryLastOrderPark',p)
... ...
src/utils/date.js 0 → 100644
  1 +export function formatDate (date, fmt) {
  2 + if (/(y+)/.test(fmt)) {
  3 + fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
  4 + }
  5 + let o = {
  6 + 'M+': date.getMonth() + 1,
  7 + 'd+': date.getDate(),
  8 + 'h+': date.getHours(),
  9 + 'm+': date.getMinutes(),
  10 + 's+': date.getSeconds()
  11 + };
  12 + for (let k in o) {
  13 + if (new RegExp(`(${k})`).test(fmt)) {
  14 + let str = o[k] + '';
  15 + fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
  16 + }
  17 + }
  18 + return fmt;
  19 +};
  20 +function padLeftZero (str) {
  21 + return ('00' + str).substr(str.length);
  22 +};
... ...
src/view/VHome.vue
... ... @@ -41,7 +41,7 @@ import VIncome from &#39;../components/VIncome&#39;
41 41 import VBerth from '../components/VBerth'
42 42 import VEquipment from '../components/VEquipment'
43 43  
44   -import { parkAddress, tollAddress, incomeAddress, berthAddress, equipmentAddress } from '../utils/api'
  44 +import { parkAddress, tollAddress, incomeAddress, berthAddress, equipmentAddress, mapAddress, inoutAddress } from '../utils/api'
45 45  
46 46 export default {
47 47 name: 'VHome',
... ... @@ -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 }
... ... @@ -101,7 +101,7 @@ export default {
101 101 mounted(){
102 102 //this.setmethod()
103 103 this.initView();
104   - //this.setmethod()
  104 + this.setmethod()
105 105  
106 106  
107 107 },
... ... @@ -128,6 +128,27 @@ export default {
128 128 console.log(response);
129 129 })
130 130  
  131 + inoutAddress({//进出场
  132 + orgIds: ['10078','10003']
  133 + }).then((response)=>{
  134 + let data = response.data.data
  135 + console.log(response)
  136 + let inoutdata = data[0]
  137 + if(inoutdata.parkState == 10){
  138 + inoutdata.parkState = "进场"
  139 + this.inouttime = inoutdata.parkInTime
  140 + this.imgUrl = inoutdata.inCarUrl
  141 + }else{
  142 + inoutdata.parkState = "出场"
  143 + this.inouttime = inoutdata.parkOutTime
  144 + this.imgUrl = inoutdata.outCarUrl
  145 + }
  146 + this.inoutmsg = inoutdata.plName+' '+inoutdata.carNumber +' '+inoutdata.parkState
  147 +
  148 + }).catch((response)=>{
  149 + console.log(response);
  150 + })
  151 +
131 152 incomeAddress({//收入
132 153 orgIds: this.GLOBAL.orignId
133 154 }).then((response)=>{
... ... @@ -137,7 +158,6 @@ export default {
137 158 seriesData:[data.aliPay,data.wxPay,data.otherPay],
138 159 total:1
139 160 }
140   -
141 161 }).catch((response)=>{
142 162 console.log(response);
143 163 })
... ... @@ -149,18 +169,52 @@ export default {
149 169 this.bertotal = data.allBerthNum
150 170 this.pieChartData = {
151 171 yData: [data.freeBerthNum,data.isOccupyBertnNum],
  172 + }
152 173  
  174 + }).catch((response)=>{
  175 + console.log(response);
  176 + })
  177 +
  178 + mapAddress({//地图
  179 + orgIds: this.GLOBAL.orignId
  180 + }).then((response)=>{
  181 + let data = response.data.data
  182 + var tempData = [];
  183 + for(var index in data){
  184 + var item = data[index];
  185 + var tempItem =
  186 + {
  187 + Name: item.parkInfo.plName,
  188 + lonId: item.parkInfo.lonId,
  189 + latId:item.parkInfo.latId,
  190 + status: 0,
  191 + freeBrethNum: item.realTimeInfoDTO.berthFreeNum,
  192 + plBerthNum: item.realTimeInfoDTO.berthNum,
  193 + plName: item.parkInfo.plName,
  194 + plAddress: item.parkInfo.plAddress,
  195 + income:(item.realTimeInfoDTO.allIncome/100).toFixed(2),
  196 + arreageincome:(item.realTimeInfoDTO.escapeFee).toFixed(2)
  197 + }
  198 + tempData.push(tempItem);
153 199 }
154 200  
  201 + this.ditudata = tempData;
  202 + console.log(this.ditudata)
  203 + // ditudata:[
  204 + // {Name:'万达停车场1',lonId:'111.742579',latId:'40.818675',status:0,freeBrethNum:0,plBerthNum:1000,plName:'万达广场停车场1',plAddress:'北京万达广场1'},
  205 + // {Name:'万达停车场2',lonId:'111.622579',latId:'40.878675',status:1,freeBrethNum:100,plBerthNum:800,plName:'万达广场停车场2',plAddress:'北京万达广场2'},
  206 + // {Name:'万达停车场333333',lonId:'111.782579',latId:'40.778675',status:2,freeBrethNum:300,plBerthNum:500,plName:'万达广场停车场3',plAddress:'北京万达广场3'}
  207 + // ]
155 208 }).catch((response)=>{
156 209 console.log(response);
157 210 })
158 211  
  212 +
  213 +
159 214 equipmentAddress({//设备
160 215 orgIds: this.GLOBAL.orignId
161 216 }).then((response)=>{
162 217 let data = response.data.data
163   - console.log(data)
164 218 if(data[0].onNum == 0){
165 219 var PDAper = 0
166 220 }else{
... ... @@ -211,7 +265,6 @@ export default {
211 265 // ydp:150,
212 266 // ydpTotal:300
213 267 // }
214   - console.log(this.equipment)
215 268  
216 269 }).catch((response)=>{
217 270 console.log(response);
... ... @@ -224,11 +277,11 @@ export default {
224 277 setmethod(){
225 278  
226 279 setInterval(()=>{
227   - this.parkingTotal++
228   - this.rodeside++
229   - },1000)
  280 + this.initView()
  281 + },10000)
230 282 }
231   - }
  283 + },
  284 +
232 285 }
233 286 </script>
234 287  
... ...