Browse Source

fix 缩略图包含非事件专题的数量bug

wangqin
qingzhengli 8 months ago
parent
commit
d2b73ebe58
  1. 3
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue
  2. 10
      ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

3
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/index.vue

@ -148,7 +148,7 @@ export default {
await Promise.allSettled((this.tabContentData || []).map(item => this.handleDeviceImmediate(item, true))) await Promise.allSettled((this.tabContentData || []).map(item => this.handleDeviceImmediate(item, true)))
Object.keys(lngLatMap).forEach(key => { Object.keys(lngLatMap).forEach(key => {
addInGraphHandle(lngLatMap[key]); addInGraphHandle(lngLatMap[key]);
}) });
} }
} }
}, },
@ -227,7 +227,6 @@ export default {
const status = item.status; const status = item.status;
console.log(item, "item");
if (!status) { this.nowSelected = item.title; this.nowSelectedCompleted = false; } if (!status) { this.nowSelected = item.title; this.nowSelectedCompleted = false; }
else if (this.nowSelected === item.title && this.nowSelectedCompleted === false) return; else if (this.nowSelected === item.title && this.nowSelectedCompleted === false) return;

10
ruoyi-ui/src/views/JiHeExpressway/pages/Home/components/RoadAndEvents/utils/map.js

@ -2,7 +2,7 @@ import { loadAMap } from "@screen/pages/Home/components/AMapContainer/loadAMap.j
// import { Message } from "element-ui"; // import { Message } from "element-ui";
import Vue from "vue"; import Vue from "vue";
import { lngLatMap } from "./buttonEvent"; import { lngLatMap } from "./buttonEvent";
import { upperFirst } from "lodash"; import { upperFirst, filter } from "lodash";
/** /**
* @typedef {Object} Point * @typedef {Object} Point
* @property {number} weight - The weight of the item. * @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 faultTitleBg = require(`@screen/images/mapBg/fault_title.svg`);
const normalTitleBg = require(`@screen/images/mapBg/active_title.svg`); const normalTitleBg = require(`@screen/images/mapBg/active_title.svg`);
const eventRegex = "./事件专题";
/** /**
* 聚合点 * 聚合点
*/ */
@ -483,9 +484,9 @@ export function marksAddInGraph(data) {
export function addInGraphHandle(data) { export function addInGraphHandle(data) {
const graphInstance = window.graphInstance; const graphInstance = window.graphInstance;
const extData = data[0].extData; const extData = data[0].extData;
console.log(extData, "extData"); // console.log(extData, "extData11111");
const { item: eventItem } = data[0].config; const { item: eventItem } = data[0].config;
if (eventItem.id.match("./事件专题")) { if (eventItem.id.match(eventRegex)) {
let { stakeMark, lang, direction } = extData; let { stakeMark, lang, direction } = extData;
stakeMark = upperFirst(stakeMark); //统一格式 大写K stakeMark = upperFirst(stakeMark); //统一格式 大写K
const distance = const distance =
@ -515,11 +516,12 @@ export function addInGraphHandle(data) {
}); });
// }, 0); // }, 0);
} }
console.log(lang, "lang"); // console.log(lang, "lang");
} }
} }
function getDataConf(data, extData) { function getDataConf(data, extData) {
data = data.filter((item) => item.config.item.id.match(eventRegex));
let dataConf; let dataConf;
const nowBg = getState(data) ? normalBg : faultBg; const nowBg = getState(data) ? normalBg : faultBg;
if (data.length === 1) { if (data.length === 1) {

Loading…
Cancel
Save