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

Loading…
Cancel
Save