Pārlūkot izejas kodu

需求详情

master
huxinglu pirms 4 gadiem
vecāks
revīzija
834215ca2e
3 mainītis faili ar 22 papildinājumiem un 11 dzēšanām
  1. +1
    -1
      config/index.js
  2. +4
    -2
      src/api/command/index.js
  3. +17
    -8
      src/views/command/index.vue

+ 1
- 1
config/index.js Parādīt failu

@@ -12,7 +12,7 @@ module.exports = {
assetsPublicPath: '/',
proxyTable: {
'/api': {
target: 'http://nanjing.yunhengwang.com/api',
target: 'http://nanjing.yunhengwang.net/api',
changeOrigin: true,
secure: false,
pathRewrite: {

+ 4
- 2
src/api/command/index.js Parādīt failu

@@ -2,11 +2,13 @@ import axios from '../api'

export default {

getWaterDriver(){
getWaterDriver(cityId){
return axios({
url: '/api/index/water/driver',
method: 'GET',
params:{}
params:{
cityId
}
})
},


+ 17
- 8
src/views/command/index.vue Parādīt failu

@@ -118,6 +118,8 @@
name: "command-container",
data() {
return {
queryCity:0,
quList:[320102,320104,320105,320106,320111,320113,320114,320115,320116,320116,320117,320118],
dataChild:{},
driverArea:'',
driverId: '',
@@ -179,7 +181,9 @@
me.addBound();
me.addBound2();
me.map.setFitView(this.polygonList)
me.getDriver()
me.quList.map(cityId=>{
me.getDriver(cityId)
})
});
},
computed: {
@@ -438,16 +442,21 @@
this.checkDriver(marker.childData.driverId)
})
},
getDriver() {
api.getWaterDriver({}).then(res => {
this.driverDataList=res.data?res.data:[]
getDriver(cityId) {
api.getWaterDriver(cityId).then(res => {
this.driverDataList=this.driverDataList.concat(res.data?res.data:[])
let polygons=[]
res.data.map(item => {
let polygons = this.returnDriver(item)
if (polygons) {
this.driverList.push(polygons)
let polygon = this.returnDriver(item)
if (polygon) {
polygons.push(polygon)
}
})
this.loading = false
this.driverList=this.driverList.concat(polygons)
this.queryCity+=1
if( this.queryCity==12){
this.loading = false
}
}).catch(e => {
});
},

Notiek ielāde…
Atcelt
Saglabāt