|
@@ -91,20 +91,6 @@ const getColor = (checked, index) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
-// 得到选中的标签的类型
|
|
|
-const getOption = (data, key = 'dataType') => {
|
|
|
- if (!data) {
|
|
|
- return;
|
|
|
- }
|
|
|
- let path = [];
|
|
|
- data.forEach((item) => {
|
|
|
- if (item.checked) {
|
|
|
- path.push(item[key]);
|
|
|
- }
|
|
|
- });
|
|
|
- return path.toString();
|
|
|
-};
|
|
|
-
|
|
|
const handleClickLegend = (item) => {
|
|
|
item.checked = !item.checked;
|
|
|
const newSelected = {};
|
|
@@ -120,7 +106,7 @@ watch(
|
|
|
if (!mapStore.pointType || mapStore.pointType.length === 0) {
|
|
|
return;
|
|
|
}
|
|
|
- getCountPointInfo({ option: getOption(mapStore.pointType, 'component') }).then((res) => {
|
|
|
+ getCountPointInfo({ option: mapStore.pointParams.option }).then((res) => {
|
|
|
res.data.list.forEach((item) => {
|
|
|
item.checked = true;
|
|
|
});
|
|
@@ -146,7 +132,7 @@ watch(
|
|
|
return;
|
|
|
}
|
|
|
// 各区县
|
|
|
- getCountPointInfoAreaList({ option: getOption(checkedData) }).then((res) => {
|
|
|
+ getCountPointInfoAreaList({ option: mapStore.pointParams.option }).then((res) => {
|
|
|
const data = res.data.list;
|
|
|
if (data.length > 0) {
|
|
|
// 使用reduce方法合并相同area的num
|