Commit 2f1ae362 authored by 耿迪迪's avatar 耿迪迪

安检照片修改

parent dff7a094
...@@ -16,7 +16,17 @@ ...@@ -16,7 +16,17 @@
:close-on-click-modal="false" :close-on-click-modal="false"
> >
<div class="flex flex-w bb"> <div class="flex flex-w bb">
<div class="item" v-for="photo in meterImg" :key="photo.key"> <el-image
v-if="imageList"
v-for="img in imageList"
:src="img"
:preview-src-list="[img]"
:z-index="9999"
class="picture"
/>
<div class="error" v-else>暂无图片</div>
<!-- <div class="item" v-for="photo in meterImg" :key="photo.key">
<div class="view-label"> <div class="view-label">
{{ photo.label?photo.label:photo.name }} {{ photo.label?photo.label:photo.name }}
</div> </div>
...@@ -37,7 +47,7 @@ ...@@ -37,7 +47,7 @@
</MyImage> </MyImage>
</div> </div>
<div class="error" v-else>暂无图片</div> <div class="error" v-else>暂无图片</div>
</div> </div>-->
</div> </div>
</el-dialog> </el-dialog>
</template> </template>
...@@ -60,11 +70,29 @@ export default { ...@@ -60,11 +70,29 @@ export default {
}, },
], ],
open: false, open: false,
imageList: []
}; };
}, },
methods: { methods: {
viewCoverPhoto(meterImg) { viewCoverPhoto(meterImg) {
this.meterImg = JSON.parse(meterImg); this.imageList = [];
if(meterImg){
var meterImgJsonArr = JSON.parse(meterImg);
meterImgJsonArr.forEach(item =>{
if(item.img){
var imgs= item.img.split(',');
if(imgs){
this.imageList.push(...imgs)
}
}
if(item.src){
var imgs= item.img.split(',');
if(imgs){
this.imageList.push(...imgs)
}
}
})
}
this.open = true; this.open = true;
}, },
}, },
...@@ -83,8 +111,8 @@ export default { ...@@ -83,8 +111,8 @@ export default {
// margin: 3px; // margin: 3px;
// } // }
.item{ .item{
width: 200px;
margin-bottom:30px; margin-bottom:30px;
display: flex;
} }
.error { .error {
width: 130px; width: 130px;
...@@ -93,4 +121,10 @@ export default { ...@@ -93,4 +121,10 @@ export default {
line-height: 139px; line-height: 139px;
background: #f5f7fa; background: #f5f7fa;
} }
.picture {
width: 130px;
height: 130px;
margin: 2px;
}
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment