整合代码
This commit is contained in:
parent
ed3309fcd1
commit
ce945b24d3
@ -229,6 +229,9 @@
|
|||||||
findIndex,
|
findIndex,
|
||||||
find
|
find
|
||||||
} from "lodash";
|
} from "lodash";
|
||||||
|
import {
|
||||||
|
useSelarea
|
||||||
|
} from "@/stores/selarea.js";
|
||||||
|
|
||||||
var qqmapsdk = new QQMapWX({
|
var qqmapsdk = new QQMapWX({
|
||||||
key: map.sdkKey
|
key: map.sdkKey
|
||||||
@ -295,6 +298,7 @@
|
|||||||
const arrAreaData = ref(null); //行政区划
|
const arrAreaData = ref(null); //行政区划
|
||||||
const mapData_opt = []; //运营区数据
|
const mapData_opt = []; //运营区数据
|
||||||
let selArea = null; //选中行政区划
|
let selArea = null; //选中行政区划
|
||||||
|
const selAreaStore = useSelarea();
|
||||||
const showMore = ref(false); //显示更多
|
const showMore = ref(false); //显示更多
|
||||||
const showBike = ref(true); //显示车辆
|
const showBike = ref(true); //显示车辆
|
||||||
const showRegion = ref(false); //显示站点
|
const showRegion = ref(false); //显示站点
|
||||||
@ -428,6 +432,7 @@
|
|||||||
lat
|
lat
|
||||||
} = data;
|
} = data;
|
||||||
selArea = data;
|
selArea = data;
|
||||||
|
selAreaStore.setValue(id);
|
||||||
const zoneId = id;
|
const zoneId = id;
|
||||||
mapcenter.value = {
|
mapcenter.value = {
|
||||||
latitude: lat,
|
latitude: lat,
|
||||||
@ -445,7 +450,71 @@
|
|||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '加载中'
|
title: '加载中'
|
||||||
});
|
});
|
||||||
const params = {
|
map.getOperation(zoneId, (res) => {
|
||||||
|
uni.hideLoading();
|
||||||
|
if (!res) return;
|
||||||
|
const {
|
||||||
|
arrRegionID,
|
||||||
|
arrCircles,
|
||||||
|
arrPolygons,
|
||||||
|
arrData
|
||||||
|
} = res;
|
||||||
|
let mapdata = {
|
||||||
|
zoneId,
|
||||||
|
arrCircles,
|
||||||
|
arrPolygons,
|
||||||
|
arrData
|
||||||
|
};
|
||||||
|
polygons.value = arrPolygons;
|
||||||
|
circles.value = arrCircles;
|
||||||
|
mapDataIndex = mapDataIndex == -1 ? mapData_opt.length : mapDataIndex;
|
||||||
|
mapData_opt[mapDataIndex] = mapdata;
|
||||||
|
|
||||||
|
//站点
|
||||||
|
if (arrRegionID.length == 0) return;
|
||||||
|
map.getRegionData(arrRegionID, (res) => {
|
||||||
|
const {
|
||||||
|
arrData,
|
||||||
|
arrCircles,
|
||||||
|
arrPolygons
|
||||||
|
} = res;
|
||||||
|
mapdata = {
|
||||||
|
...mapdata,
|
||||||
|
regionData: {
|
||||||
|
arrData,
|
||||||
|
arrCircles,
|
||||||
|
arrPolygons
|
||||||
|
}
|
||||||
|
};
|
||||||
|
mapData_opt[mapDataIndex] = mapdata;
|
||||||
|
loadMapRegionData(showRegion.value, mapdata);
|
||||||
|
})
|
||||||
|
|
||||||
|
//车辆
|
||||||
|
map.getBikeData(arrRegionID, (res) => {
|
||||||
|
const {
|
||||||
|
arrData,
|
||||||
|
arrPoints,
|
||||||
|
icnt,
|
||||||
|
icnt_0,
|
||||||
|
icnt_2
|
||||||
|
} = res;
|
||||||
|
mapdata = {
|
||||||
|
...mapdata,
|
||||||
|
bikeData: {
|
||||||
|
arrData,
|
||||||
|
arrPoints
|
||||||
|
}
|
||||||
|
};
|
||||||
|
mapData_opt[mapDataIndex] = mapdata;
|
||||||
|
q_cnt.value = icnt;
|
||||||
|
q_cnt0.value = icnt_0;
|
||||||
|
q_cnt2.value = icnt_2;
|
||||||
|
arrMakers = arrData;
|
||||||
|
loadMapBikeData(showBike.value, mapdata);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
/* const params = {
|
||||||
zoneId
|
zoneId
|
||||||
}
|
}
|
||||||
api.callOperateApi("ebikeRegion/getOperation", params, "get").then((res) => {
|
api.callOperateApi("ebikeRegion/getOperation", params, "get").then((res) => {
|
||||||
@ -544,7 +613,7 @@
|
|||||||
showModelMessage(message);
|
showModelMessage(message);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
//地图数据
|
//地图数据
|
||||||
@ -702,9 +771,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//查询工单
|
//查询工单
|
||||||
function queryOrders(lx,index) {
|
function queryOrders(lx, index) {
|
||||||
selRight.value=index;
|
selRight.value = index;
|
||||||
console.log("11111111111111111111",lx,index)
|
console.log("11111111111111111111", lx, index)
|
||||||
showModelMessage("该功能暂未实现!");
|
showModelMessage("该功能暂未实现!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
ebike-maintenance/stores/selarea.js
Normal file
12
ebike-maintenance/stores/selarea.js
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import { defineStore } from 'pinia'
|
||||||
|
import {ref} from "vue";
|
||||||
|
|
||||||
|
export const useSelarea = defineStore('selarea', ()=>{
|
||||||
|
const data=ref('');
|
||||||
|
const setValue=(value)=>{
|
||||||
|
data.value=value;
|
||||||
|
}
|
||||||
|
return{ value:data.value, setValue};
|
||||||
|
},{
|
||||||
|
persist: true
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user