diff --git a/src/views/big-screen/components/img-dialog.vue b/src/views/big-screen/components/img-dialog.vue index 645002b..a4b8751 100644 --- a/src/views/big-screen/components/img-dialog.vue +++ b/src/views/big-screen/components/img-dialog.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-22 15:30:25 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-12-10 11:45:44 + * @LastEditTime: 2024-12-25 16:53:29 * @FilePath: \znxjxt-ui\src\views\big-screen\components\img-dialog.vue * @Description: 大屏查看图片弹窗 --> @@ -96,21 +96,6 @@ clearable /> - - - - - 1) { this.loadMoreTopImages(); } - }, 1000); + }, 500); }); }, @@ -445,6 +424,7 @@ export default { } }) .finally(() => { + this.showImage(this.currentIndex); this.loading = false; }); }, @@ -511,7 +491,6 @@ export default { defectType: "", stakeStart: "", stakeEnd: "", - state: "", }; this.params = { page: 1, @@ -530,12 +509,11 @@ export default { // if (this.currentIndex === this.defectData.length - 1) { // this.loadMoreBottomImages(); // } - 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.scrollToCurrentImage(); this.$nextTick(() => { + this.scrollToCurrentImage(); this.updateRects(); }); }, @@ -555,7 +533,7 @@ export default { * @param {*} * @return {*} */ - scrollToCurrentImage() { + scrollToCurrentImage: debounce(function () { if (this.$refs.sidebar) { const sidebarImages = this.$refs.sidebar.querySelectorAll("img"); const currentImageElement = sidebarImages[this.currentIndex]; @@ -566,8 +544,7 @@ export default { }); } } - }, - + }, 200), /** * @description: 滚动触发事件 * @param {*} @@ -700,7 +677,7 @@ export default { }; }); this.checkedRectList = this.rectItem; - this.checkedRect = this.rectItem.map((item) => item.id); + this.checkedRect = this.rectItem?.map((item) => item.id); } }, @@ -741,7 +718,7 @@ export default { window.addEventListener("resize", this.updateRects); }, beforeDestroy() { - window.removeEventListener("keydown",this.handleKeydown); + window.removeEventListener("keydown", this.handleKeydown); window.removeEventListener("resize", this.updateRects); }, }; diff --git a/src/views/big-screen/index.vue b/src/views/big-screen/index.vue index c03bffb..85a1111 100644 --- a/src/views/big-screen/index.vue +++ b/src/views/big-screen/index.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-10-17 11:34:00 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-12-24 15:58:07 + * @LastEditTime: 2024-12-25 09:31:03 * @FilePath: \znxjxt-ui\src\views\big-screen\index.vue * @Description: 大屏首页 --> diff --git a/src/views/xj/inspection/confirmation-management/components/img-dialog.vue b/src/views/xj/inspection/confirmation-management/components/img-dialog.vue new file mode 100644 index 0000000..e88e3f9 --- /dev/null +++ b/src/views/xj/inspection/confirmation-management/components/img-dialog.vue @@ -0,0 +1,957 @@ + + + + + + + diff --git a/src/views/xj/inspection/confirmation-management/index.vue b/src/views/xj/inspection/confirmation-management/index.vue index 315c092..441a2cf 100644 --- a/src/views/xj/inspection/confirmation-management/index.vue +++ b/src/views/xj/inspection/confirmation-management/index.vue @@ -2,7 +2,7 @@ * @Author: SunTao 328867980@qq.com * @Date: 2024-11-01 13:17:41 * @LastEditors: SunTao 328867980@qq.com - * @LastEditTime: 2024-12-24 16:01:10 + * @LastEditTime: 2024-12-25 17:02:47 * @FilePath: \znxjxt-ui\src\views\xj\inspection\confirmation-management\index.vue * @Description: 巡检信息-病害确认 --> @@ -22,6 +22,7 @@ v-model="queryParams.segmentName" placeholder="请选择路段" clearable + filterable > 不是病害 - + @@ -226,7 +227,7 @@ @@ -316,8 +330,9 @@ import { mergeDefect, } from "@/api/xj/confirmation"; import imageDialog from "./components/image-dialog.vue"; +import imgDialog from "./components/img-dialog.vue"; export default { - components: { imageDialog }, + components: { imageDialog, imgDialog }, name: "ConfirmationManagement", data() { return { @@ -534,8 +549,15 @@ export default { }, /* 打开查看图片弹窗 */ - showScreenImg(item) { - this.currentImageItem = item; + showScreenImg(item, index) { + // this.currentImageItem = item; + // this.showImageDialog = true; + this.imageItem = { + ...item, + index, + pageTip: this.pagination.page, + params: this.pagination, + }; this.showImageDialog = true; }, @@ -648,4 +670,48 @@ export default { color: #ffffff; background-color: rgba(0, 0, 0, 0.5); } + +/* 修改弹窗样式 */ +::v-deep .el-dialog { + background-color: transparent; +} + +::v-deep .el-dialog__header { + padding: 10px; + background-color: #113463; + + span, + i { + color: #ffffff; + } +} + +::v-deep .el-dialog__body { + padding: 0; + // background-color: #113463; + + /* 查看点位大图弹窗 */ + .view-image-container { + position: relative; + width: 100%; + height: 50rem; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + overflow: hidden; + } + + .view-image-container img { + max-width: 100%; + max-height: 100%; + object-fit: contain; + } + + .rect-overlay { + position: absolute; + // pointer-events: none; + border: 2px solid red; + } +}