This commit is contained in:
Cc 2025-03-11 13:54:21 +08:00
parent 746657d25f
commit d4bced25ce
2 changed files with 50 additions and 9 deletions

View File

@ -83,7 +83,12 @@ export function getWaterRate(data) {
export function getCaptureImg(data) { export function getCaptureImg(data) {
return request({ return request({
url: url:
'/device/captureImg?deviceCode=' + data.deviceCode + '&page=' + data.page, '/device/captureImg?deviceCode=' +
data.deviceCode +
'&page=' +
data.page +
'&size=' +
data.size,
method: 'get', method: 'get',
data, data,
}); });

View File

@ -1,12 +1,18 @@
<template> <template>
<div class="image-list"> <div class="image-list">
<div v-for="img in imageData" :key="img" class="block"> <div class="block">
<el-image <div class="block_item" :key="img" v-for="(img, index) in imageData">
style="width: 200px; height: 200px" <div class="block_text" @click="handleClick(index)">
:src="img" {{ img.turbidity }}
fit="cover" </div>
:preview-src-list="imageData" <el-image
></el-image> ref="imageRef"
style="width: 200px; height: 200px"
:src="img.img"
fit="cover"
:preview-src-list="imageList"
></el-image>
</div>
</div> </div>
<div class="page"> <div class="page">
<el-pagination <el-pagination
@ -36,6 +42,7 @@ export default {
data() { data() {
return { return {
imageData: [], imageData: [],
imageList: [],
fileUrl: baseURL + '/static/capture/', fileUrl: baseURL + '/static/capture/',
background: true, background: true,
lazy: true, lazy: true,
@ -44,6 +51,7 @@ export default {
queryForm: { queryForm: {
deviceCode: '', deviceCode: '',
page: 1, page: 1,
size: 10,
}, },
}; };
}, },
@ -55,6 +63,9 @@ export default {
}, },
created() {}, created() {},
methods: { methods: {
handleClick(index) {
this.$refs.imageRef[index].showViewer = true;
},
showData(row) { showData(row) {
this.queryForm.deviceCode = row.deviceCode; this.queryForm.deviceCode = row.deviceCode;
this.fetchData(); this.fetchData();
@ -66,6 +77,7 @@ export default {
// list[i] = this.fileUrl + list[i]; // list[i] = this.fileUrl + list[i];
// } // }
this.imageData = data.items; this.imageData = data.items;
this.imageList = data.items.map(item => item.img);
this.total = data.total; this.total = data.total;
}, },
handleQuery() { handleQuery() {
@ -88,7 +100,31 @@ export default {
.image-list { .image-list {
width: 100%; width: 100%;
.block { .block {
float: left; .block_text {
position: absolute;
top: 80px;
text-align: center;
z-index: 1;
width: 200px;
font-weight: bold;
opacity: 0.7;
color: #fde2c2;
font-size: 48px;
transform: rotateZ(-37deg);
cursor: pointer;
font-family: serif;
}
.block_item {
margin: 0 10px;
position: relative;
}
.image-item {
position: absolute;
}
display: flex;
flex-wrap: wrap;
margin-left: 20px; margin-left: 20px;
margin-top: 20px; margin-top: 20px;
} }