fix(index): 修复邮管角色车辆定位查看权限问题
- 移除交警和邮管角色禁止地图查看车辆定位的限制 - 允许邮管角色通过 organizationParentId 查询管辖范围内车辆 - 保持快递角色使用 organizationParentId 查询车辆不变
This commit is contained in:
@@ -197,7 +197,10 @@ function Home() {
|
|||||||
// 邮管(youzheng)可以查看管辖范围内车辆,通过 organizationParentId 查询
|
// 邮管(youzheng)可以查看管辖范围内车辆,通过 organizationParentId 查询
|
||||||
if (roleCode == 'youzheng') {
|
if (roleCode == 'youzheng') {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
where.organizationParentId = user.organizationId;
|
// where.organizationParentId = undefined;
|
||||||
|
where.limit = 1000;
|
||||||
|
// @ts-ignore
|
||||||
|
where.status = 1;
|
||||||
}
|
}
|
||||||
if (roleCode == 'kuaidi') {
|
if (roleCode == 'kuaidi') {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
@@ -213,7 +216,7 @@ function Home() {
|
|||||||
// 转换WGS84坐标到GCJ02坐标
|
// 转换WGS84坐标到GCJ02坐标
|
||||||
let markerLat = item.latitude;
|
let markerLat = item.latitude;
|
||||||
let markerLng = item.longitude;
|
let markerLng = item.longitude;
|
||||||
|
|
||||||
if (item.latitude && item.longitude &&
|
if (item.latitude && item.longitude &&
|
||||||
!isNaN(item.latitude) &&
|
!isNaN(item.latitude) &&
|
||||||
!isNaN(item.longitude) &&
|
!isNaN(item.longitude) &&
|
||||||
@@ -231,7 +234,7 @@ function Home() {
|
|||||||
console.error('标记点坐标转换错误:', error);
|
console.error('标记点坐标转换错误:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
arr.push({
|
arr.push({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
@@ -279,11 +282,11 @@ function Home() {
|
|||||||
setList(res?.list || [])
|
setList(res?.list || [])
|
||||||
if (res?.list && res?.list.length > 0) {
|
if (res?.list && res?.list.length > 0) {
|
||||||
const data = res?.list[0];
|
const data = res?.list[0];
|
||||||
|
|
||||||
// 转换WGS84坐标到GCJ02坐标
|
// 转换WGS84坐标到GCJ02坐标
|
||||||
let displayLat = data.latitude;
|
let displayLat = data.latitude;
|
||||||
let displayLng = data.longitude;
|
let displayLng = data.longitude;
|
||||||
|
|
||||||
if (data.latitude && data.longitude &&
|
if (data.latitude && data.longitude &&
|
||||||
!isNaN(data.latitude) &&
|
!isNaN(data.latitude) &&
|
||||||
!isNaN(data.longitude) &&
|
!isNaN(data.longitude) &&
|
||||||
@@ -301,7 +304,7 @@ function Home() {
|
|||||||
console.error('搜索结果坐标转换错误:', error);
|
console.error('搜索结果坐标转换错误:', error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setLongitude(displayLng)
|
setLongitude(displayLng)
|
||||||
setLatitude(displayLat)
|
setLatitude(displayLat)
|
||||||
if (isAdmin) {
|
if (isAdmin) {
|
||||||
|
|||||||
Reference in New Issue
Block a user