Browse Source

图标浮动问题

main
不爱学习的石同学 11 months ago
parent
commit
962a8a9654
  1. 43
      src/views/datav/subonedatav/SubOneGlobal.vue

43
src/views/datav/subonedatav/SubOneGlobal.vue

@ -75,14 +75,15 @@
style="width: 13.66%; margin-left: 10px"
/>
</div>
<v-charts
style="height: 360px"
:option="option"
autoresize
ref="subOneGlobalMap"
@click="handleClick"
/>
<div id="map">
<v-charts
style="height: 360px"
:option="option"
autoresize
ref="subOneGlobalMap"
@click="handleClick"
/>
</div>
<div>
<datav-card title="问题趋势">
<v-charts
@ -130,7 +131,7 @@
</el-row>
</main>
</div>
<negative-info-depart-dialog v-model="show" :departId="tempDepartId" />
<negative-info-depart-dialog v-model="showDialog" :departId="tempDepartId"/>
</el-scrollbar>
</template>
@ -151,7 +152,7 @@ import {
} from "@/api/screen/subScreen/subOneGlobal.ts";
// region
const show = ref(false); //
const showDialog = ref(false); //
const tempDepartId = ref(0); // id
const router = useRouter();
@ -196,7 +197,7 @@ const colors = [
percentage: 40,
},
];
let subOneGlobalMapIntervalId ;
let subOneGlobalMapIntervalId;
// endregion
@ -439,7 +440,7 @@ const getSubOneGlobalMapIcon = async (departId = currentDepartId, timeValue = ti
{gte: range80Percent, label: "高于最大问题80%", color: "#D34343"},
];
}
const getSubOneGlobalTrendData = async (departId = currentDepartId, year) => {
const getSubOneGlobalTrendData = async (departId = currentDepartId, year) => {
const res = await getSubOneGlobalTrend(departId, year);
const categories = res.globalRecentlyTrendList.map(item => item.name);
const values = res.globalRecentlyTrendList.map(item => item.value);
@ -476,7 +477,7 @@ const mapAnimation = () => {
const mySubOneGlobalMap = subOneGlobalMap?.value?.chart;
if (!mySubOneGlobalMap) return;
// 9 0~8ok
const tempNum = currentMapData?.value?.geoJson?.features?.length
const tempNum = currentMapData?.value?.geoJson?.features?.length
const randomNum = Math.floor(Math.random() * tempNum);
mySubOneGlobalMap.dispatchAction({
type: "downplay", //downplay
@ -515,6 +516,8 @@ watch(time, () => {
});
const setupEventListeners = () => {
const mySubOneGlobalMap = subOneGlobalMap?.value?.chart;
const map = document.getElementById("map");
console.log(map)
//
mySubOneGlobalMap.on('mousemove', (e) => {
// console.log(e.dataIndex);
@ -525,15 +528,20 @@ const setupEventListeners = () => {
});
//
mySubOneGlobalMap.on('mouseout', () => {
clearInterval(subOneGlobalMapIntervalId); //
subOneGlobalMapIntervalId = setInterval(mapAnimation, 2000);
//
if (showDialog.value) {
clearInterval(subOneGlobalMapIntervalId); //
} else {
clearInterval(subOneGlobalMapIntervalId); //
subOneGlobalMapIntervalId = setInterval(mapAnimation, 2000);
}
});
};
const handleClick = (params) => {
const departId = params.data.departId;
show.value = true;
tempDepartId.value=2661
showDialog.value = true;
tempDepartId.value = departId
clearInterval(subOneGlobalMapIntervalId);
// alert(departId)
}
@ -556,6 +564,7 @@ const handleClick = (params) => {
background: linear-gradient(180deg, rgba(1, 4, 87, 0.8) 0%, rgba(3, 21, 119, 0.8) 100%);
border: 1px solid #4E8FFF;
margin: -10px -10px -10px -10px;
}
////

Loading…
Cancel
Save