Commit 350097e42a1640b26c8c3ec2a318c82bcc362f9f
1 parent
633692cc
调取接口
Showing
12 changed files
with
222 additions
and
38 deletions
.babelrc
0 → 100644
package-lock.json
... | ... | @@ -894,8 +894,7 @@ |
894 | 894 | "babel-plugin-syntax-object-rest-spread": { |
895 | 895 | "version": "6.13.0", |
896 | 896 | "resolved": "http://registry.npm.taobao.org/babel-plugin-syntax-object-rest-spread/download/babel-plugin-syntax-object-rest-spread-6.13.0.tgz", |
897 | - "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=", | |
898 | - "dev": true | |
897 | + "integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=" | |
899 | 898 | }, |
900 | 899 | "babel-plugin-syntax-trailing-function-commas": { |
901 | 900 | "version": "6.22.0", |
... | ... | @@ -1199,7 +1198,6 @@ |
1199 | 1198 | "version": "6.26.0", |
1200 | 1199 | "resolved": "http://registry.npm.taobao.org/babel-plugin-transform-object-rest-spread/download/babel-plugin-transform-object-rest-spread-6.26.0.tgz", |
1201 | 1200 | "integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=", |
1202 | - "dev": true, | |
1203 | 1201 | "requires": { |
1204 | 1202 | "babel-plugin-syntax-object-rest-spread": "^6.8.0", |
1205 | 1203 | "babel-runtime": "^6.26.0" |
... | ... | @@ -1292,6 +1290,38 @@ |
1292 | 1290 | } |
1293 | 1291 | } |
1294 | 1292 | }, |
1293 | + "babel-preset-es2015": { | |
1294 | + "version": "6.24.1", | |
1295 | + "resolved": "http://registry.npm.taobao.org/babel-preset-es2015/download/babel-preset-es2015-6.24.1.tgz", | |
1296 | + "integrity": "sha1-1EBQ1rwsn+6nAqrzjXJ6AhBTiTk=", | |
1297 | + "dev": true, | |
1298 | + "requires": { | |
1299 | + "babel-plugin-check-es2015-constants": "^6.22.0", | |
1300 | + "babel-plugin-transform-es2015-arrow-functions": "^6.22.0", | |
1301 | + "babel-plugin-transform-es2015-block-scoped-functions": "^6.22.0", | |
1302 | + "babel-plugin-transform-es2015-block-scoping": "^6.24.1", | |
1303 | + "babel-plugin-transform-es2015-classes": "^6.24.1", | |
1304 | + "babel-plugin-transform-es2015-computed-properties": "^6.24.1", | |
1305 | + "babel-plugin-transform-es2015-destructuring": "^6.22.0", | |
1306 | + "babel-plugin-transform-es2015-duplicate-keys": "^6.24.1", | |
1307 | + "babel-plugin-transform-es2015-for-of": "^6.22.0", | |
1308 | + "babel-plugin-transform-es2015-function-name": "^6.24.1", | |
1309 | + "babel-plugin-transform-es2015-literals": "^6.22.0", | |
1310 | + "babel-plugin-transform-es2015-modules-amd": "^6.24.1", | |
1311 | + "babel-plugin-transform-es2015-modules-commonjs": "^6.24.1", | |
1312 | + "babel-plugin-transform-es2015-modules-systemjs": "^6.24.1", | |
1313 | + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", | |
1314 | + "babel-plugin-transform-es2015-object-super": "^6.24.1", | |
1315 | + "babel-plugin-transform-es2015-parameters": "^6.24.1", | |
1316 | + "babel-plugin-transform-es2015-shorthand-properties": "^6.24.1", | |
1317 | + "babel-plugin-transform-es2015-spread": "^6.22.0", | |
1318 | + "babel-plugin-transform-es2015-sticky-regex": "^6.24.1", | |
1319 | + "babel-plugin-transform-es2015-template-literals": "^6.22.0", | |
1320 | + "babel-plugin-transform-es2015-typeof-symbol": "^6.22.0", | |
1321 | + "babel-plugin-transform-es2015-unicode-regex": "^6.24.1", | |
1322 | + "babel-plugin-transform-regenerator": "^6.24.1" | |
1323 | + } | |
1324 | + }, | |
1295 | 1325 | "babel-preset-stage-2": { |
1296 | 1326 | "version": "6.24.1", |
1297 | 1327 | "resolved": "http://registry.npm.taobao.org/babel-preset-stage-2/download/babel-preset-stage-2-6.24.1.tgz", |
... | ... | @@ -1336,7 +1366,6 @@ |
1336 | 1366 | "version": "6.26.0", |
1337 | 1367 | "resolved": "http://registry.npm.taobao.org/babel-runtime/download/babel-runtime-6.26.0.tgz", |
1338 | 1368 | "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", |
1339 | - "dev": true, | |
1340 | 1369 | "requires": { |
1341 | 1370 | "core-js": "^2.4.0", |
1342 | 1371 | "regenerator-runtime": "^0.11.0" |
... | ... | @@ -2379,8 +2408,7 @@ |
2379 | 2408 | "core-js": { |
2380 | 2409 | "version": "2.6.5", |
2381 | 2410 | "resolved": "http://registry.npm.taobao.org/core-js/download/core-js-2.6.5.tgz", |
2382 | - "integrity": "sha1-RLyNJJ5/sv9dAOA0Gn/7lPv2eJU=", | |
2383 | - "dev": true | |
2411 | + "integrity": "sha1-RLyNJJ5/sv9dAOA0Gn/7lPv2eJU=" | |
2384 | 2412 | }, |
2385 | 2413 | "core-util-is": { |
2386 | 2414 | "version": "1.0.2", |
... | ... | @@ -10019,8 +10047,7 @@ |
10019 | 10047 | "regenerator-runtime": { |
10020 | 10048 | "version": "0.11.1", |
10021 | 10049 | "resolved": "http://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.11.1.tgz", |
10022 | - "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=", | |
10023 | - "dev": true | |
10050 | + "integrity": "sha1-vgWtf5v30i4Fb5cmzuUBf78Z4uk=" | |
10024 | 10051 | }, |
10025 | 10052 | "regenerator-transform": { |
10026 | 10053 | "version": "0.10.1", | ... | ... |
package.json
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | }, |
13 | 13 | "dependencies": { |
14 | 14 | "axios": "^0.18.0", |
15 | + "babel-plugin-transform-object-rest-spread": "^6.26.0", | |
15 | 16 | "echarts": "^4.1.0", |
16 | 17 | "vue": "^2.5.2" |
17 | 18 | }, |
... | ... | @@ -25,6 +26,7 @@ |
25 | 26 | "babel-plugin-transform-runtime": "^6.22.0", |
26 | 27 | "babel-plugin-transform-vue-jsx": "^3.5.0", |
27 | 28 | "babel-preset-env": "^1.3.2", |
29 | + "babel-preset-es2015": "^6.24.1", | |
28 | 30 | "babel-preset-stage-2": "^6.22.0", |
29 | 31 | "chalk": "^2.0.1", |
30 | 32 | "copy-webpack-plugin": "^4.0.1", | ... | ... |
src/components/VEquipment.vue
... | ... | @@ -4,7 +4,7 @@ |
4 | 4 | <ul class="theme-body" style="padding: 10px 20px 20px 0;"> |
5 | 5 | <li class="equipment-section"> |
6 | 6 | <div class="normal-status front"> |
7 | - <p class="text-blue">23.4%</p> | |
7 | + <p class="text-blue">{{equipment.pdaper}}%</p> | |
8 | 8 | <p>PDA在线率</p> |
9 | 9 | </div> |
10 | 10 | <div class="rotate-status back"> |
... | ... | @@ -14,7 +14,7 @@ |
14 | 14 | </li> |
15 | 15 | <li class="equipment-section"> |
16 | 16 | <div class="normal-status front"> |
17 | - <p class="text-blue">23.4%</p> | |
17 | + <p class="text-blue">{{equipment.berthper}}%</p> | |
18 | 18 | <p>地磁在线率</p> |
19 | 19 | </div> |
20 | 20 | <div class="rotate-status back"> |
... | ... | @@ -62,6 +62,14 @@ export default { |
62 | 62 | }, |
63 | 63 | mounted(){ |
64 | 64 | }, |
65 | + watch:{ | |
66 | + equipment:{//深度监听,可监听到对象、数组的变化 | |
67 | + handler(val){ | |
68 | + console.log(val) | |
69 | + }, | |
70 | + deep:true | |
71 | + } | |
72 | + }, | |
65 | 73 | methods: { |
66 | 74 | |
67 | 75 | } | ... | ... |
src/components/VParking.vue
... | ... | @@ -31,7 +31,20 @@ export default { |
31 | 31 | props:['total','rodeside','rodeclose'], |
32 | 32 | data(){ |
33 | 33 | return{ |
34 | + | |
34 | 35 | } |
36 | + }, | |
37 | + created(){ | |
38 | + | |
39 | + | |
40 | + }, | |
41 | + watch:{ | |
42 | + // rodeside:function(val){ | |
43 | + // //console.log(val) | |
44 | + // }, | |
45 | + // total:function (val) { | |
46 | + // //console.log(val) | |
47 | + // } | |
35 | 48 | } |
36 | 49 | } |
37 | 50 | </script> | ... | ... |
src/components/base/AccountNum.vue
... | ... | @@ -16,7 +16,15 @@ export default { |
16 | 16 | props:['totalnum'], |
17 | 17 | data(){ |
18 | 18 | return { |
19 | - total: formaterTotal(this.totalnum) | |
19 | + //total: formaterTotal(this.totalnum) | |
20 | + } | |
21 | + }, | |
22 | + created(){ | |
23 | + //console.log(this.totalnum) | |
24 | + }, | |
25 | + computed:{ | |
26 | + total(){ | |
27 | + return formaterTotal(this.totalnum) | |
20 | 28 | } |
21 | 29 | } |
22 | 30 | } | ... | ... |
src/components/base/PieEchart.vue
... | ... | @@ -68,7 +68,12 @@ export default { |
68 | 68 | }, |
69 | 69 | methods: { |
70 | 70 | setOptions({yData} = {}) { |
71 | - let per = ((yData[0]/(yData[0]+yData[1]))*100).toFixed(2)+'%' | |
71 | + if(yData[0] == 0){ | |
72 | + var per = '0%' | |
73 | + }else{ | |
74 | + var per = ((yData[0]/(yData[0]+yData[1]))*100).toFixed(2)+'%' | |
75 | + } | |
76 | + | |
72 | 77 | this.chart.setOption( |
73 | 78 | { |
74 | 79 | tooltip: { | ... | ... |
src/main.js
src/utils/api.js
0 → 100644
1 | +import {post} from './request' | |
2 | + | |
3 | +//....停车场总数 | |
4 | +export const parkAddress = p => post('urban/intelligence/park/queryParkNumInfoStatisticByOrgIds',p) | |
5 | + | |
6 | +//....收费员 | |
7 | +export const tollAddress = p => post('urban/intelligence/employee/queryEmployeeStaByOrgIds',p) | |
8 | + | |
9 | + | |
10 | +//....收入 | |
11 | +export const incomeAddress = p => post('urban/intelligence/income/queryIncomeStaByOrgIds',p) | |
12 | + | |
13 | +//....泊位 | |
14 | +export const berthAddress = p => post('urban/intelligence/berth/queryBerthStatisticByOrgIds',p) | |
15 | + | |
16 | +//....设备 | |
17 | +export const equipmentAddress = p => post('urban/intelligence/device/queryDeviceStatistic',p) | ... | ... |
src/utils/request.js
... | ... | @@ -6,11 +6,11 @@ const CancelToken = axios.CancelToken; |
6 | 6 | //请求拦截器 // 在发送请求之前做些什么 |
7 | 7 | axios.interceptors.request.use(config => { |
8 | 8 | //发起请求时,取消掉当前正在进行的相同请求 |
9 | - config.headers['x-auth-token'] = '18de1300-c3f2-4365-9f51-62f77614f8c5' | |
10 | - //config.headers['x-auth-token'] = '6840160c-7c45-42c4-8736-805f13487565' //测试地址 | |
9 | + // config.headers['x-auth-token'] = '18de1300-c3f2-4365-9f51-62f77614f8c5' | |
10 | + config.headers['x-auth-token'] = '6840160c-7c45-42c4-8736-805f13487565' //测试地址 | |
11 | 11 | config.data = { |
12 | 12 | ...config.data, |
13 | - sysCode: '1001' | |
13 | + // sysCode: '1001' | |
14 | 14 | } |
15 | 15 | // config.data = qs.stringify(config.data); |
16 | 16 | return config |
... | ... | @@ -75,7 +75,7 @@ axios.interceptors.response.use(response => { |
75 | 75 | //基础url前缀 |
76 | 76 | //axios.defaults.baseURL = '/api' |
77 | 77 | |
78 | -axios.defaults.baseURL = 'http://bcp.service.renniting.cn/'; | |
78 | +axios.defaults.baseURL = 'http://39.98.54.240:8093/'; | |
79 | 79 | //axios.defaults.baseURL = 'http://test.renniting.cn/bcp/';//测试地址 |
80 | 80 | //设置默认请求头 |
81 | 81 | // axios.defaults.withCredentials=true;//让ajax携带cookie | ... | ... |
src/utils/variables.js
0 → 100644
src/view/VHome.vue
1 | 1 | <template> |
2 | 2 | <div class="main-content"> |
3 | + {{equipment.PDA}} | |
3 | 4 | <v-header></v-header> |
4 | 5 | <ul class="main-wrap"> |
5 | 6 | <li class="main-left"> |
... | ... | @@ -40,6 +41,9 @@ import VInout from '../components/VInout' |
40 | 41 | import VIncome from '../components/VIncome' |
41 | 42 | import VBerth from '../components/VBerth' |
42 | 43 | import VEquipment from '../components/VEquipment' |
44 | + | |
45 | +import { parkAddress, tollAddress, incomeAddress, berthAddress, equipmentAddress } from '../utils/api' | |
46 | + | |
43 | 47 | export default { |
44 | 48 | name: 'VHome', |
45 | 49 | components: { |
... | ... | @@ -54,30 +58,32 @@ export default { |
54 | 58 | }, |
55 | 59 | data(){ |
56 | 60 | return { |
57 | - parkingTotal: 319706, | |
58 | - rodeside: 2345, | |
59 | - rodeclose: 23, | |
60 | - tollTotal: 23454, | |
61 | - tollsign: 12309, | |
62 | - tollnosign: 2130, | |
61 | + parkingTotal: 0, | |
62 | + rodeside: 0, | |
63 | + rodeclose: 0, | |
64 | + tollTotal: 0, | |
65 | + tollsign: 0, | |
66 | + tollnosign: 0, | |
63 | 67 | inoutmsg: '万达广场停车场1 京A231231', |
64 | 68 | inouttime: '08:00', |
65 | 69 | imgUrl: 'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1552297151876&di=fcc094f43d6caaf4b9526dabbefd1243&imgtype=0&src=http%3A%2F%2F5b0988e595225.cdn.sohucs.com%2Fimages%2F20190124%2F1fc9d7e14be54986b9e2e055a2b5ccc1.jpeg', |
66 | - incometotal:123213, | |
70 | + incometotal:0, | |
67 | 71 | barChartData:{ |
68 | - seriesData:[2000,200,300], | |
69 | - total:2500 | |
72 | + seriesData:[0,0,0], | |
73 | + total:1 | |
70 | 74 | }, |
71 | - bertotal:28839, | |
75 | + bertotal:0, | |
72 | 76 | pieChartData: { |
73 | - yData: [21321,13311], | |
77 | + yData: [0,0], | |
74 | 78 | legendData: ['空余','占有'] |
75 | 79 | }, |
76 | 80 | equipment:{ |
77 | 81 | PDA:150, |
78 | 82 | PDATotal:3000, |
83 | + pdaper:100, | |
79 | 84 | berth:150, |
80 | 85 | berthTotal:2300, |
86 | + berthper:100, | |
81 | 87 | daozha:150, |
82 | 88 | daozhaTotal:1300, |
83 | 89 | ydp:150, |
... | ... | @@ -92,22 +98,112 @@ export default { |
92 | 98 | } |
93 | 99 | }, |
94 | 100 | mounted(){ |
95 | - // this.setmethod() | |
96 | - // this.$nextTick(function () { | |
97 | - // this.setmethod() | |
98 | - // }) | |
99 | - var self = this | |
100 | - var t =setInterval(()=>{ | |
101 | - self.parkingTotal ++ | |
102 | - console.log(self.parkingTotal) | |
103 | - },1000) | |
101 | + //this.setmethod() | |
102 | + this.initView(); | |
103 | + //this.setmethod() | |
104 | + | |
104 | 105 | |
105 | 106 | }, |
106 | 107 | methods:{ |
108 | + initView(){ | |
109 | + parkAddress({//停车场 | |
110 | + orgIds: this.GLOBAL.orignId | |
111 | + }).then((response)=>{ | |
112 | + let data = response.data.data | |
113 | + this.parkingTotal = data.allNum | |
114 | + this.rodeside = data.lcNum | |
115 | + this.rodeclose = data.fbNum | |
116 | + }).catch((response)=>{ | |
117 | + console.log(response); | |
118 | + }) | |
119 | + tollAddress({//收费员 | |
120 | + orgIds: this.GLOBAL.orignId | |
121 | + }).then((response)=>{ | |
122 | + let data = response.data.data | |
123 | + this.tollTotal = data.allTollCollector | |
124 | + this.tollsign = data.signInTollCollector | |
125 | + this.tollnosign = data.unSignInTollCollector | |
126 | + }).catch((response)=>{ | |
127 | + console.log(response); | |
128 | + }) | |
129 | + | |
130 | + incomeAddress({//收入 | |
131 | + orgIds: this.GLOBAL.orignId | |
132 | + }).then((response)=>{ | |
133 | + let data = response.data.data | |
134 | + this.incometotal = data.totalPay | |
135 | + this.barChartData = { | |
136 | + seriesData:[data.aliPay,data.wxPay,data.otherPay], | |
137 | + total:1 | |
138 | + } | |
139 | + | |
140 | + }).catch((response)=>{ | |
141 | + console.log(response); | |
142 | + }) | |
143 | + | |
144 | + berthAddress({//泊位 | |
145 | + orgIds: this.GLOBAL.orignId | |
146 | + }).then((response)=>{ | |
147 | + let data = response.data.data | |
148 | + this.bertotal = data.allBerthNum | |
149 | + this.pieChartData = { | |
150 | + yData: [data.freeBerthNum,data.isOccupyBertnNum], | |
151 | + | |
152 | + } | |
153 | + | |
154 | + }).catch((response)=>{ | |
155 | + console.log(response); | |
156 | + }) | |
157 | + | |
158 | + equipmentAddress({//设备 | |
159 | + orgIds: this.GLOBAL.orignId | |
160 | + }).then((response)=>{ | |
161 | + let data = response.data.data | |
162 | + console.log(data[0].onNum) | |
163 | + // if(data[0].onNum == 0){ | |
164 | + // var PDAper = 0 | |
165 | + // }else{ | |
166 | + // var PDAper = ((data[0].onNum/data[0].num)*100).toFixed(2) | |
167 | + // } | |
168 | + // | |
169 | + // if(data[1].onNum == 0){ | |
170 | + // var berthper = 0 | |
171 | + // }else{ | |
172 | + // var berthper = ((data[1].onNum/data[1].num)*100).toFixed(2) | |
173 | + // } | |
174 | + | |
175 | + this.$set(this.equipment,'PDA',data[0].onNum) | |
176 | + //this.$set(this.equipment,'PDATotal',data[0].num) | |
177 | + //this.$set(this.equipment,'pdaper',PDAper) | |
178 | + | |
179 | + // this.$set(this.equipment,'berth',data[1].onNum) | |
180 | + // this.$set(this.equipment,'berthTotal',data[1].num) | |
181 | + // this.$set(this.equipment,'berthper',berthper) | |
182 | + // this.equipment = { | |
183 | + // PDA:data[0].onNum, | |
184 | + // PDATotal:data[0].num, | |
185 | + // berth:150, | |
186 | + // berthTotal:2300, | |
187 | + // daozha:150, | |
188 | + // daozhaTotal:1300, | |
189 | + // ydp:150, | |
190 | + // ydpTotal:300 | |
191 | + // } | |
192 | + console.log(this.equipment) | |
193 | + | |
194 | + }).catch((response)=>{ | |
195 | + console.log(response); | |
196 | + }) | |
197 | + | |
198 | + | |
199 | + | |
200 | + | |
201 | + }, | |
107 | 202 | setmethod(){ |
203 | + | |
108 | 204 | setInterval(()=>{ |
109 | - this.parkingTotal ++ | |
110 | - console.log(this.parkingTotal) | |
205 | + this.parkingTotal++ | |
206 | + this.rodeside++ | |
111 | 207 | },1000) |
112 | 208 | } |
113 | 209 | } | ... | ... |