|
|
|
|
@ -420,6 +420,7 @@ let globalTempMapVoList = ref([]);
|
|
|
|
|
// 地图数据 |
|
|
|
|
const getMapData = async (timeValue) => { |
|
|
|
|
const res = await getComfortMapIcon(timeValue); |
|
|
|
|
console.log('后端返回原始数据:', res.comfortMapVoList); |
|
|
|
|
const mappedData = res.comfortMapVoList?.map(item => { |
|
|
|
|
let name; |
|
|
|
|
switch (item.name) { |
|
|
|
|
@ -465,6 +466,7 @@ const getMapData = async (timeValue) => {
|
|
|
|
|
value: item.totalCase, |
|
|
|
|
}; |
|
|
|
|
}); |
|
|
|
|
console.log('转换后数据:', mappedData); |
|
|
|
|
globalTempMapVoList.value = mappedData |
|
|
|
|
|
|
|
|
|
const total = mappedData.reduce((sum, item) => sum + (Number(item.rightsNumber) || 0), 0); |
|
|
|
|
@ -472,7 +474,7 @@ const getMapData = async (timeValue) => {
|
|
|
|
|
console.log('mappedData',mappedData) |
|
|
|
|
const range30Percent = avg * 0.3 // 不用取整,小数也可以 |
|
|
|
|
option.value.series[0].data = mappedData; |
|
|
|
|
|
|
|
|
|
console.log('option series data:', option.value.series[0].data); |
|
|
|
|
option.value.visualMap.pieces = [ |
|
|
|
|
{gte: 0, lte: avg - range30Percent, label: "低于平均问题30%", color: "#4987F6"}, |
|
|
|
|
{gte: avg - range30Percent, lte: avg + range30Percent + 0.1, label: `平均问题上下浮动30%内`, color: "#F6A149"}, |
|
|
|
|
@ -495,7 +497,24 @@ const getCaseAriseSituationRateList = async (timeValue) => {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const handleClick = (params) => { |
|
|
|
|
const departId = params.data.departId; |
|
|
|
|
console.log('点击事件参数:', params); |
|
|
|
|
// 1) 直接点到有 data 的区域 |
|
|
|
|
let departId = params?.data?.departId; |
|
|
|
|
// 2) 点到 geo / data 匹配不上:用 name 反查 |
|
|
|
|
if (!departId) { |
|
|
|
|
const hit = globalTempMapVoList.value.find((item) => |
|
|
|
|
item.name?.includes(params?.name?.substring?.(0, 2)) |
|
|
|
|
); |
|
|
|
|
departId = hit?.departId; |
|
|
|
|
} |
|
|
|
|
if (!departId) { |
|
|
|
|
ElMessage({ |
|
|
|
|
message: "数据加载中,请稍后再试", |
|
|
|
|
type: "warning", |
|
|
|
|
duration: 1500, |
|
|
|
|
}); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
const url = router.resolve({ |
|
|
|
|
path: "/datav/subOneRightsComfort", |
|
|
|
|
query: {departId: departId}, |
|
|
|
|
|