调度
This commit is contained in:
parent
e75f49b926
commit
91bbbcf08c
@ -150,7 +150,6 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="divCountLabel">
|
<div class="divCountLabel">
|
||||||
超出运营区域
|
超出运营区域
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
@ -325,7 +324,7 @@
|
|||||||
value
|
value
|
||||||
}
|
}
|
||||||
} = e;
|
} = e;
|
||||||
dd_selvalue = value;
|
dd_selvalue.value = value;
|
||||||
showModelMessage("该功能暂未实现!");
|
showModelMessage("该功能暂未实现!");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -526,10 +525,6 @@
|
|||||||
const params={
|
const params={
|
||||||
operationRegionId:arrRegionID
|
operationRegionId:arrRegionID
|
||||||
}
|
}
|
||||||
// api.callMaintenanceApi("operation/list",params,"get").then(res=>{
|
|
||||||
// console.log("5555555555555555555555555",res);
|
|
||||||
// });
|
|
||||||
// return;
|
|
||||||
map.getRegionData(arrRegionID, (res) => {
|
map.getRegionData(arrRegionID, (res) => {
|
||||||
const {
|
const {
|
||||||
arrData,
|
arrData,
|
||||||
@ -553,25 +548,25 @@
|
|||||||
const {
|
const {
|
||||||
arrData
|
arrData
|
||||||
/* ,arrPoints,
|
/* ,arrPoints,
|
||||||
icnt,
|
icnt_2,
|
||||||
icnt_0,
|
icnt_0,
|
||||||
icnt_2 */
|
icnt_1 */
|
||||||
} = res;
|
} = res;
|
||||||
|
|
||||||
arrMakers = arrData;
|
arrMakers = arrData;
|
||||||
const{icnt,
|
const{icnt_2,
|
||||||
icnt_0,
|
icnt_0,
|
||||||
icnt_2}=showMarker();
|
icnt_1}=showMarker();
|
||||||
q_cnt.value = icnt;
|
q_cnt.value = icnt_2;
|
||||||
q_cnt0.value = icnt_0;
|
q_cnt0.value = icnt_0;
|
||||||
q_cnt2.value = icnt_2;
|
q_cnt2.value = icnt_1;
|
||||||
mapdata = {
|
mapdata = {
|
||||||
...mapdata,
|
...mapdata,
|
||||||
bikeData: {
|
bikeData: {
|
||||||
arrData,
|
arrData,
|
||||||
icnt,
|
icnt_2,
|
||||||
icnt_0,
|
icnt_0,
|
||||||
icnt_2
|
icnt_1
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
mapData_opt[mapDataIndex] = mapdata;
|
mapData_opt[mapDataIndex] = mapdata;
|
||||||
@ -583,13 +578,13 @@
|
|||||||
|
|
||||||
//地图数据
|
//地图数据
|
||||||
function loadMapData(data) {
|
function loadMapData(data) {
|
||||||
const{bikeData:{arrData,icnt,
|
const{bikeData:{arrData,icnt_2,
|
||||||
icnt_0,
|
icnt_0,
|
||||||
icnt_2 }}=data;
|
icnt_1 }}=data;
|
||||||
arrMakers = arrData;
|
arrMakers = arrData;
|
||||||
q_cnt.value = icnt;
|
q_cnt.value = icnt_2;
|
||||||
q_cnt0.value = icnt_0;
|
q_cnt0.value = icnt_0;
|
||||||
q_cnt2.value = icnt_2;
|
q_cnt2.value = icnt_1;
|
||||||
showMarker();
|
showMarker();
|
||||||
loadMapBikeData(showBike.value, data);
|
loadMapBikeData(showBike.value, data);
|
||||||
loadMapRegionData(showRegion.value, data);
|
loadMapRegionData(showRegion.value, data);
|
||||||
@ -854,15 +849,28 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function showMarker(){
|
function showMarker(){
|
||||||
let icnt = 0;
|
// let icnt_2 = 0;
|
||||||
let icnt_0 = 0;
|
// let icnt_0 = 0;
|
||||||
let icnt_2 = 0;
|
// let icnt_1 = 0;
|
||||||
|
let oData={};
|
||||||
if(arrMakers.length==0){
|
if(arrMakers.length==0){
|
||||||
orderCount.value=0;
|
orderCount.value=0;
|
||||||
markers.value=[];
|
markers.value=[];
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
let showCount=0;
|
const{lx}=selRight.value;
|
||||||
|
const maxcnt=100;
|
||||||
|
switch(lx){
|
||||||
|
case "hd":
|
||||||
|
oData=showMarker_HD(lx,maxcnt);
|
||||||
|
break;
|
||||||
|
case "dd":
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "wx":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
/* let showCount=0;
|
||||||
let arrPoints=[];
|
let arrPoints=[];
|
||||||
let ordercnt=0;
|
let ordercnt=0;
|
||||||
const maxcnt=100;
|
const maxcnt=100;
|
||||||
@ -880,26 +888,117 @@
|
|||||||
if (soc <= 20) {
|
if (soc <= 20) {
|
||||||
icnt_0++;
|
icnt_0++;
|
||||||
} else if (soc <= 60) {
|
} else if (soc <= 60) {
|
||||||
icnt_2++;
|
icnt_1++;
|
||||||
} else {
|
} else {
|
||||||
icnt++;
|
icnt_2++;
|
||||||
}
|
}
|
||||||
if(!(lng<=maxLng&&lng>=minLng&&lat<=maxLat&&lat>=minLat)||soc>quantityCount.value) return;
|
if(!(lng<=maxLng&&lng>=minLng&&lat<=maxLat&&lat>=minLat)) {
|
||||||
|
switch(lx){
|
||||||
|
case "hd":
|
||||||
|
if(soc>quantityCount.value) return;
|
||||||
|
break;
|
||||||
|
case "dd":
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "wx":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
switch(lx){
|
||||||
|
case "hd":
|
||||||
if(soc<=20) ordercnt++;
|
if(soc<=20) ordercnt++;
|
||||||
|
break;
|
||||||
|
case "dd":
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "wx":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
showCount++;
|
showCount++;
|
||||||
arrPoints.push(map.addMarker_Q(index, item,showCount>maxcnt));
|
arrPoints.push(map.addMarker_Q(index, item,showCount>maxcnt,lx));
|
||||||
});
|
});
|
||||||
if(showCount>maxcnt){
|
if(showCount>maxcnt){
|
||||||
for(let i=0;i<=maxcnt;i++){
|
for(let i=0;i<=maxcnt;i++){
|
||||||
arrPoints[i]={...arrPoints[i],joinCluster:true}
|
arrPoints[i]={...arrPoints[i],joinCluster:true}
|
||||||
}
|
}
|
||||||
|
} */
|
||||||
|
orderCount.value=oData.ordercnt;
|
||||||
|
markers.value=oData.arrPoints;
|
||||||
}
|
}
|
||||||
orderCount.value=ordercnt;
|
const {icnt_2,icnt_0,icnt_1,showCount,orderCount,arrPoints}=oData
|
||||||
markers.value=arrPoints;
|
return {icnt_2,icnt_0,icnt_1};
|
||||||
}
|
|
||||||
return {icnt,icnt_0,icnt_2};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function showMarker_HD(lx,maxcnt){
|
||||||
|
let icnt_2 = 0;
|
||||||
|
let icnt_0 = 0;
|
||||||
|
let icnt_1 = 0;
|
||||||
|
let showCount=0;
|
||||||
|
let arrPoints=[];
|
||||||
|
let ordercnt=0;
|
||||||
|
arrMakers.map((item,index) => {
|
||||||
|
item = {
|
||||||
|
...item,
|
||||||
|
soc: item.soc || 0
|
||||||
|
}
|
||||||
|
const {
|
||||||
|
bikeId,
|
||||||
|
longitude:lng,
|
||||||
|
latitude:lat,
|
||||||
|
soc
|
||||||
|
} = item;
|
||||||
|
if (soc <= 20) {
|
||||||
|
icnt_0++;
|
||||||
|
} else if (soc <= 60) {
|
||||||
|
icnt_1++;
|
||||||
|
} else {
|
||||||
|
icnt_2++;
|
||||||
|
}
|
||||||
|
if(!(lng<=maxLng&&lng>=minLng&&lat<=maxLat&&lat>=minLat) ||soc>quantityCount.value) return;
|
||||||
|
if(soc<=20) ordercnt++;
|
||||||
|
showCount++;
|
||||||
|
arrPoints.push(map.addMarker_Q(index, item,showCount>maxcnt,lx));
|
||||||
|
});
|
||||||
|
|
||||||
|
return {icnt_2,icnt_0,icnt_1,showCount,orderCount,arrPoints};
|
||||||
|
}
|
||||||
|
|
||||||
|
function showMarker_DD(lx,maxcnt){
|
||||||
|
let icnt_0 = 0;
|
||||||
|
let icnt_1 = 0;
|
||||||
|
let icnt_2 = 0;
|
||||||
|
let showCount=0;
|
||||||
|
let arrPoints=[];
|
||||||
|
let ordercnt=0;
|
||||||
|
arrMakers.map((item,index) => {
|
||||||
|
const {
|
||||||
|
bikeId,
|
||||||
|
longitude:lng,
|
||||||
|
latitude:lat,
|
||||||
|
inOperation,
|
||||||
|
inParking,
|
||||||
|
intervalTime
|
||||||
|
} = item;
|
||||||
|
if(inOperation) {
|
||||||
|
icnt_1++;
|
||||||
|
}
|
||||||
|
else if(inParking) {
|
||||||
|
icnt_2++;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(!(lng<=maxLng&&lng>=minLng&&lat<=maxLat&&lat>=minLat) ) return;
|
||||||
|
let cnt=dd_selvalue.value;
|
||||||
|
if(showDD_LX.value=="1") cnt=cnt*24;
|
||||||
|
if(intervalTime<=cont) ordercnt++;
|
||||||
|
showCount++;
|
||||||
|
arrPoints.push(map.addMarker_Q(index, item,showCount>maxcnt,lx));
|
||||||
|
});
|
||||||
|
|
||||||
|
return {icnt_2,icnt_0,icnt_1,showCount,orderCount,arrPoints};
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -373,13 +373,40 @@ export function getRegionData(arrRegionID, callback) {
|
|||||||
export const getBikeData = (arrRegionID, callback) => {
|
export const getBikeData = (arrRegionID, callback) => {
|
||||||
if (!arrRegionID || arrRegionID.length == 0) return;
|
if (!arrRegionID || arrRegionID.length == 0) return;
|
||||||
const arrMethods = [];
|
const arrMethods = [];
|
||||||
arrRegionID.map(regionId => {
|
const params = {
|
||||||
|
operationRegionIds: arrRegionID
|
||||||
|
}
|
||||||
|
api.callMaintenanceApi("operation/list", params, "post").then(res => {
|
||||||
|
const arrPoints = [];
|
||||||
|
const arrData = [];
|
||||||
|
let icnt = 0;
|
||||||
|
let icnt_0 = 0;
|
||||||
|
let icnt_2 = 0;
|
||||||
|
let {
|
||||||
|
code,
|
||||||
|
message,
|
||||||
|
data
|
||||||
|
} = res;
|
||||||
|
if (code != 200) {
|
||||||
|
showModelMessage(message);
|
||||||
|
} else {
|
||||||
|
if (data.length > 0) arrData.push(...data);
|
||||||
|
|
||||||
|
}
|
||||||
|
callback({
|
||||||
|
arrData
|
||||||
|
});
|
||||||
|
})
|
||||||
|
// api.callMaintenanceApi("operation/list",params,"get").then(res=>{
|
||||||
|
// console.log("5555555555555555555555555",res);
|
||||||
|
// });
|
||||||
|
/* arrRegionID.map(regionId => {
|
||||||
const params = {
|
const params = {
|
||||||
regionId
|
regionId
|
||||||
};
|
};
|
||||||
arrMethods.push(api.callOperateApi("ebikeRegion/getOperationBike", params, "get"));
|
arrMethods.push(api.callOperateApi("ebikeRegion/getOperationBike", params, "get"));
|
||||||
});
|
}); */
|
||||||
Promise.all(arrMethods).then(arrRes => {
|
/* Promise.all(arrMethods).then(arrRes => {
|
||||||
const arrPoints = [];
|
const arrPoints = [];
|
||||||
const arrData = [];
|
const arrData = [];
|
||||||
let icnt = 0;
|
let icnt = 0;
|
||||||
@ -394,36 +421,15 @@ export const getBikeData = (arrRegionID, callback) => {
|
|||||||
if (code != 200) {
|
if (code != 200) {
|
||||||
showModelMessage(message);
|
showModelMessage(message);
|
||||||
} else {
|
} else {
|
||||||
//data=testData();
|
|
||||||
if (data.length > 0) arrData.push(...data);
|
if (data.length > 0) arrData.push(...data);
|
||||||
/* data.map(item => {
|
|
||||||
item = {
|
|
||||||
...item,
|
|
||||||
soc: item.soc || 0
|
|
||||||
}
|
|
||||||
const {
|
|
||||||
bikeId,
|
|
||||||
longitude,
|
|
||||||
latitude,
|
|
||||||
state,
|
|
||||||
soc
|
|
||||||
} = item;
|
|
||||||
const id = arrPoints.length;
|
|
||||||
if (soc <= 20) {
|
|
||||||
icnt_0++;
|
|
||||||
} else if (soc <= 60) {
|
|
||||||
icnt_2++;
|
|
||||||
} else {
|
|
||||||
icnt++;
|
|
||||||
}
|
|
||||||
arrPoints.push(addMarker_Q(id, item));
|
|
||||||
}) */
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
callback({
|
callback({
|
||||||
arrData
|
arrData
|
||||||
});
|
});
|
||||||
})
|
}) */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function testData() {
|
function testData() {
|
||||||
@ -449,25 +455,43 @@ function testData() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//电量车辆点
|
//电量车辆点
|
||||||
export function addMarker_Q(id, data,joinCluster) {
|
export function addMarker_Q(id, data, joinCluster, lx) {
|
||||||
let {
|
let {
|
||||||
longitude,
|
longitude,
|
||||||
latitude,
|
latitude,
|
||||||
soc
|
soc,
|
||||||
|
inOperation,
|
||||||
|
inParking
|
||||||
} = data;
|
} = data;
|
||||||
let icon = "bike_1.png";
|
let icon = "";
|
||||||
let clusterId = 1;
|
let lbContent = "";
|
||||||
|
switch (lx) {
|
||||||
|
case "hd":
|
||||||
|
icon = "bike_1.png";
|
||||||
|
lbContent = soc + "%";
|
||||||
if (soc <= 20) {
|
if (soc <= 20) {
|
||||||
icon = "bike_0.png";
|
icon = "bike_0.png";
|
||||||
clusterId = 0;
|
|
||||||
} else if (soc <= 60) {
|
} else if (soc <= 60) {
|
||||||
icon = "bike_2.png";
|
icon = "bike_2.png";
|
||||||
clusterId = 2;
|
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case "dd":
|
||||||
|
icon = "bike_0.png";
|
||||||
|
if(inOperation){
|
||||||
|
lbContent="超区";
|
||||||
|
}
|
||||||
|
else if(inParking){
|
||||||
|
lbContent="违停";
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "wx":
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
const systemInfo = uni.getSystemInfoSync();
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
|
||||||
let oLabel = {
|
let oLabel = {
|
||||||
content: soc + "%",
|
content: lbContent,
|
||||||
color: "#FFF",
|
color: "#FFF",
|
||||||
anchorY: -25,
|
anchorY: -25,
|
||||||
fontSize: 9,
|
fontSize: 9,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user