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

安检照片修改

parent dff7a094
...@@ -16,28 +16,38 @@ ...@@ -16,28 +16,38 @@
: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
<div class="view-label"> v-if="imageList"
{{ photo.label?photo.label:photo.name }} v-for="img in imageList"
</div> :src="img"
<div v-if="photo.img"> :preview-src-list="[img]"
<MyImage :z-index="9999"
class="view-img" class="picture"
:src="photo.img.split(',')[0]" />
:previewSrcList="photo.img.split(',')" <div class="error" v-else>暂无图片</div>
> <!-- <div class="item" v-for="photo in meterImg" :key="photo.key">
</MyImage>
</div> <div class="view-label">
<div v-else-if="photo.src"> {{ photo.label?photo.label:photo.name }}
<MyImage </div>
class="view-img" <div v-if="photo.img">
:src="photo.src.split(',')[0]" <MyImage
:previewSrcList="photo.src.split(',')" class="view-img"
> :src="photo.img.split(',')[0]"
</MyImage> :previewSrcList="photo.img.split(',')"
</div> >
<div class="error" v-else>暂无图片</div> </MyImage>
</div> </div>
<div v-else-if="photo.src">
<MyImage
class="view-img"
:src="photo.src.split(',')[0]"
:previewSrcList="photo.src.split(',')"
>
</MyImage>
</div>
<div class="error" v-else>暂无图片</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