|
|
@ -2,7 +2,7 @@ import { loadAMap } from "@screen/pages/Home/components/AMapContainer/loadAMap.j |
|
|
|
// import { Message } from "element-ui";
|
|
|
|
import Vue from "vue"; |
|
|
|
import { lngLatMap } from "./buttonEvent"; |
|
|
|
import { upperFirst } from "lodash"; |
|
|
|
import { upperFirst, filter } from "lodash"; |
|
|
|
/** |
|
|
|
* @typedef {Object} Point |
|
|
|
* @property {number} weight - The weight of the item. |
|
|
@ -27,6 +27,7 @@ const normalBg = require(`@screen/images/mapBg/active.svg`); |
|
|
|
const faultTitleBg = require(`@screen/images/mapBg/fault_title.svg`); |
|
|
|
const normalTitleBg = require(`@screen/images/mapBg/active_title.svg`); |
|
|
|
|
|
|
|
const eventRegex = "./事件专题"; |
|
|
|
/** |
|
|
|
* 聚合点 |
|
|
|
*/ |
|
|
@ -126,6 +127,12 @@ export class MarkerCluster { |
|
|
|
const startIndex = (page - 1) * pageSize; |
|
|
|
const endIndex = startIndex + pageSize; |
|
|
|
let num = (page - 1) * pageSize; |
|
|
|
if (data.length === 0 || data.length === 1) { |
|
|
|
return this.infoWindow.close(); |
|
|
|
} |
|
|
|
const { latitude: lat, longitude: lng } = data[0].extData; |
|
|
|
const lngLatStr = `${parseFloat(lng)}/${parseFloat(lat)}`; //更新清除节点后的数据
|
|
|
|
data = lngLatMap[lngLatStr]; |
|
|
|
// 截取当前页的数据
|
|
|
|
const currentPageData = data.slice(startIndex, endIndex); |
|
|
|
window.currentPageData = currentPageData; |
|
|
@ -145,7 +152,7 @@ export class MarkerCluster { |
|
|
|
.join(""); |
|
|
|
// 渲染当前页数据
|
|
|
|
dataContainer.innerHTML = itemsTpl; |
|
|
|
dataPage.innerHTML = `第${page}页`; |
|
|
|
dataPage && (dataPage.innerHTML = `第${page}页`); |
|
|
|
bindItemClick(); |
|
|
|
} |
|
|
|
|
|
|
@ -483,9 +490,9 @@ export function marksAddInGraph(data) { |
|
|
|
export function addInGraphHandle(data) { |
|
|
|
const graphInstance = window.graphInstance; |
|
|
|
const extData = data[0].extData; |
|
|
|
console.log(extData, "extData"); |
|
|
|
// console.log(extData, "extData11111");
|
|
|
|
const { item: eventItem } = data[0].config; |
|
|
|
if (eventItem.id.match("./事件专题")) { |
|
|
|
if (eventItem.id.match(eventRegex)) { |
|
|
|
let { stakeMark, lang, direction } = extData; |
|
|
|
stakeMark = upperFirst(stakeMark); //统一格式 大写K
|
|
|
|
const distance = |
|
|
@ -515,11 +522,12 @@ export function addInGraphHandle(data) { |
|
|
|
}); |
|
|
|
// }, 0);
|
|
|
|
} |
|
|
|
console.log(lang, "lang"); |
|
|
|
// console.log(lang, "lang");
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function getDataConf(data, extData) { |
|
|
|
data = data.filter((item) => item.config.item.id.match(eventRegex)); |
|
|
|
let dataConf; |
|
|
|
const nowBg = getState(data) ? normalBg : faultBg; |
|
|
|
if (data.length === 1) { |
|
|
|