| | |
| | | export default { |
| | | data() { |
| | | return { |
| | | statusTypes: ['æè´§', '空货ä½', 'æè´§ç¦ç¨', 'éå®'], // è¡¨å¤´ç¶æç±»å |
| | | statusCounts: [0, 0, 0,0] // 对åºç¶æçæ°é |
| | | statusTypes: ['æè´§', '空货ä½'], // è¡¨å¤´ç¶æç±»å |
| | | statusCounts: [0, 0] // 对åºç¶æçæ°é |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | methods: { |
| | | fetchData() { |
| | | axios.post("http://127.0.0.1:5000/api/LocationInfo/LocationStatus", null) |
| | | axios.post("http://172.21.1.139:5000/api/LocationInfo/LocationStatuskt", null) |
| | | .then((response) => { |
| | | // å设APIè¿åçæ°æ®æ ¼å¼ä¸ºï¼[{status: 'æè´§', count: 9}, {status: '空货ä½', count: 2}, ...] |
| | | const newCounts = [0, 0, 0,0]; |
| | | const newCounts = [0, 0]; |
| | | console.log(response.data) |
| | | |
| | | newCounts[0] = response.data.data[0].count; |
| | | newCounts[1] = response.data.data[1].count; |
| | | newCounts[2] = response.data.data[2].count; |
| | | newCounts[3] = response.data.data[3].count; |
| | | newCounts[1] = response.data.data[1].count+response.data.data[2].count+response.data.data[3].count; |
| | | // newCounts[2] = response.data.data[2].count; |
| | | // newCounts[3] = response.data.data[3].count; |
| | | |
| | | this.statusCounts = newCounts; |
| | | }) |