fix:修改大屏加载图片问题,点击详情加载地图打点问题,

This commit is contained in:
SunTao 2025-01-08 15:45:49 +08:00
parent 91a43f8ba1
commit 566f074b8c
3 changed files with 35 additions and 18 deletions

View File

@ -2,13 +2,17 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-22 15:30:25 * @Date: 2024-10-22 15:30:25
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-12-25 16:53:29 * @LastEditTime: 2025-01-08 15:43:05
* @FilePath: \znxjxt-ui\src\views\big-screen\components\img-dialog.vue * @FilePath: \znxjxt-ui\src\views\big-screen\components\img-dialog.vue
* @Description: 大屏查看图片弹窗 * @Description: 大屏查看图片弹窗
--> -->
<template> <template>
<div class="app"> <div
class="app"
v-loading="loading"
element-loading-background="rgba(0, 0, 0, 0.8)"
>
<div class="left-list"> <div class="left-list">
<div class="img-top"> <div class="img-top">
<div <div
@ -284,6 +288,11 @@ export default {
this.getDefectType(); this.getDefectType();
}, },
}, },
currentIndex: {
handler(val) {
console.log(val, "dsfdsad");
},
},
}, },
created() { created() {
this.getSegmentList(); this.getSegmentList();
@ -324,6 +333,7 @@ export default {
* @return {*} * @return {*}
*/ */
getMediaBySnapshotid() { getMediaBySnapshotid() {
this.loading = true;
getMediaIndex({ getMediaIndex({
classType: this.bottomTipClick, classType: this.bottomTipClick,
id: this.imageItem.snapshotId, id: this.imageItem.snapshotId,
@ -409,7 +419,8 @@ export default {
const data = { const data = {
classType: this.bottomTipClick, classType: this.bottomTipClick,
...this.imgForm, ...this.imgForm,
...this.params, page: this.pageTip,
size: this.params.size,
}; };
defeaseList(data) defeaseList(data)
.then(({ code, data }) => { .then(({ code, data }) => {
@ -506,9 +517,6 @@ export default {
* @return {*} * @return {*}
*/ */
showImage(index) { showImage(index) {
// if (this.currentIndex === this.defectData.length - 1) {
// this.loadMoreBottomImages();
// }
this.currentIndex = index; this.currentIndex = index;
const indexInfo = this.defectData[this.currentIndex]?.items.length - 1; const indexInfo = this.defectData[this.currentIndex]?.items.length - 1;
this.selectedThumbnail = indexInfo; // Reset to the first thumbnail when changing the main item this.selectedThumbnail = indexInfo; // Reset to the first thumbnail when changing the main item
@ -544,14 +552,20 @@ export default {
}); });
} }
} }
}, 200), }, 100),
/** /**
* @description: 滚动触发事件 * @description: 滚动触发事件
* @param {*} * @param {*}
* @return {*} * @return {*}
*/ */
handleScroll() { handleScroll: debounce(function () {
const sidebar = this.$refs.sidebar; const sidebar = this.$refs.sidebar;
console.log(
sidebar.scrollTop + sidebar.clientHeight,
sidebar.scrollHeight,
"sdfsdf"
);
// //
if (sidebar.scrollTop < 2 && this.pageTip > 1 && !this.loading) { if (sidebar.scrollTop < 2 && this.pageTip > 1 && !this.loading) {
this.loadMoreTopImages(); this.loadMoreTopImages();
@ -567,8 +581,10 @@ export default {
} }
// if (this.currentIndex === this.defectData.length - 1) { // if (this.currentIndex === this.defectData.length - 1) {
// this.loadMoreBottomImages(); // this.loadMoreBottomImages();
// } else if (this.currentIndex === 0) {
// this.loadMoreTopImages();
// } // }
}, }, 100),
/** /**
* @description: 向下加载更多图片方法 * @description: 向下加载更多图片方法
@ -587,7 +603,7 @@ export default {
*/ */
loadMoreTopImages() { loadMoreTopImages() {
this.pageTip -= 1; this.pageTip -= 1;
this.params.page -= 1; // this.params.page -= 1;
this.currentIndex += this.params.size; this.currentIndex += this.params.size;
this.getListTop(); this.getListTop();
}, },
@ -616,8 +632,8 @@ export default {
* @param {*} * @param {*}
* @return {*} * @return {*}
*/ */
handleKeydown(event) { handleKeydown: throttle(function (event) {
if (event.key === "ArrowUp") { if (event.key === "ArrowUp" && !this.loading) {
event.preventDefault(); event.preventDefault();
if (this.currentIndex > 0) { if (this.currentIndex > 0) {
this.currentIndex--; this.currentIndex--;
@ -626,7 +642,7 @@ export default {
this.scrollToCurrentImage(); this.scrollToCurrentImage();
this.updateRects(); this.updateRects();
} }
} else if (event.key === "ArrowDown") { } else if (event.key === "ArrowDown" && !this.loading) {
event.preventDefault(); event.preventDefault();
if (this.currentIndex < this.defectData.length - 1) { if (this.currentIndex < this.defectData.length - 1) {
this.currentIndex === this.defectData.length - 1 this.currentIndex === this.defectData.length - 1
@ -640,7 +656,7 @@ export default {
this.loadMoreBottomImages(); this.loadMoreBottomImages();
} }
} }
}, }, 100),
/** /**
* @description: 选择框修改事件 * @description: 选择框修改事件
@ -714,7 +730,7 @@ export default {
}, },
}, },
mounted() { mounted() {
window.addEventListener("keydown", throttle(this.handleKeydown, 100)); window.addEventListener("keydown", this.handleKeydown);
window.addEventListener("resize", this.updateRects); window.addEventListener("resize", this.updateRects);
}, },
beforeDestroy() { beforeDestroy() {

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-17 11:34:00 * @Date: 2024-10-17 11:34:00
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2025-01-08 09:11:29 * @LastEditTime: 2025-01-08 14:31:54
* @FilePath: \znxjxt-ui\src\views\big-screen\index.vue * @FilePath: \znxjxt-ui\src\views\big-screen\index.vue
* @Description: 大屏首页 * @Description: 大屏首页
--> -->
@ -955,6 +955,7 @@ export default {
mapPointList({ mapPointList({
type: this.elementDiv, type: this.elementDiv,
classType: this.bottomTipClick, classType: this.bottomTipClick,
...this.imageItem,
...this.defectMapPiont, ...this.defectMapPiont,
}).then(({ code, data }) => { }).then(({ code, data }) => {
if (code === 200) { if (code === 200) {

View File

@ -2,7 +2,7 @@
* @Author: SunTao 328867980@qq.com * @Author: SunTao 328867980@qq.com
* @Date: 2024-10-18 10:19:56 * @Date: 2024-10-18 10:19:56
* @LastEditors: SunTao 328867980@qq.com * @LastEditors: SunTao 328867980@qq.com
* @LastEditTime: 2024-12-26 16:44:24 * @LastEditTime: 2025-01-08 13:50:00
* @FilePath: \znxjxt-ui\src\views\big-screen\overview-components\disease-current.vue * @FilePath: \znxjxt-ui\src\views\big-screen\overview-components\disease-current.vue
* @Description: 总览大屏-病害三维饼图 * @Description: 总览大屏-病害三维饼图
--> -->
@ -335,7 +335,7 @@ export default {
false, false,
k, k,
// //
series[i].pieData.value / 2500 series[i].pieData.value / 5000
); );
startValue = endValue; startValue = endValue;