Commit 4b44e519 by 张立顺

style:详情页图片弹框显示

1 parent 67630f41
...@@ -54,6 +54,12 @@ ...@@ -54,6 +54,12 @@
<!-- v-for="(subItem, subIdx) in item.imgList" --> <!-- v-for="(subItem, subIdx) in item.imgList" -->
<img class="detail-img" <img class="detail-img"
:src="detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:''"> :src="detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:''">
<span class="img-btns">
<span class="btn-item">
<i @click.stop="handleImgLook(detailForm.papersList?detailForm.papersList[imgToAttr[subItem]]:'')"
class="el-icon-zoom-in"></i>
</span>
</span>
<div v-if="item.labelList" <div v-if="item.labelList"
class="imageLabel"> class="imageLabel">
{{item.labelList[subIdx]}} {{item.labelList[subIdx]}}
...@@ -101,7 +107,12 @@ ...@@ -101,7 +107,12 @@
</el-form-item> </el-form-item>
</div> </div>
</el-form> --> </el-form> -->
<el-dialog :visible.sync="lookImgVisible"
append-to-body>
<img width="100%"
:src="picUrl"
alt="图片">
</el-dialog>
</div> </div>
</template> </template>
...@@ -120,6 +131,8 @@ export default { ...@@ -120,6 +131,8 @@ export default {
}, },
data() { data() {
return { return {
lookImgVisible: false,
picUrl: '',
detailForm: {}, detailForm: {},
formArray: [ formArray: [
{ {
...@@ -613,6 +626,11 @@ export default { ...@@ -613,6 +626,11 @@ export default {
}, },
methods: { methods: {
handleImgLook(url) {
this.lookImgVisible = true
this.picUrl = url
},
resetTableHeight() { resetTableHeight() {
function getClientHeight() { function getClientHeight() {
let clientHeight = 0 let clientHeight = 0
...@@ -812,17 +830,14 @@ export default { ...@@ -812,17 +830,14 @@ export default {
cursor: pointer; cursor: pointer;
margin-right: 100px; margin-right: 100px;
} }
.account-detail .detail-img:hover { // .account-detail .detail-img:hover {
margin-right: 0px; // margin-right: 0px;
width: 90%; // width: 90%;
height: 90%; // height: 90%;
} // }
.account-detail .detail-img:hover + .imageLabel { // .account-detail .detail-img:hover + .imageLabel {
// margin-right: 0px; // width: 90%;
width: 90%; // }
// width: 50%;
// height: 50%;
}
.itemContainer { .itemContainer {
padding: 30px 0; padding: 30px 0;
background: #f4f6fc; background: #f4f6fc;
...@@ -831,6 +846,7 @@ export default { ...@@ -831,6 +846,7 @@ export default {
.imageContainer { .imageContainer {
// style="display: inline-block;" // style="display: inline-block;"
// max-height: 50%; // max-height: 50%;
position: relative;
max-width: 50%; max-width: 50%;
box-sizing: border-box; box-sizing: border-box;
display: inline-block; display: inline-block;
...@@ -848,6 +864,33 @@ export default { ...@@ -848,6 +864,33 @@ export default {
font-size: 14px; font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC; font-family: PingFangSC-Regular, PingFang SC;
} }
.img-btns {
display: none;
position: absolute;
width: 180px;
height: 104px;
left: 0;
top: 0;
z-index: 2;
color: #fff;
background: rgba(0, 0, 0, 0.5);
}
.img-btns .btn-item {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.img-btns .btn-item {
display: flex;
width: 70%;
justify-content: space-around;
}
.imageContainer:hover .img-btns {
display: block;
}
/* .transition-box { /* .transition-box {
margin-bottom: 10px; margin-bottom: 10px;
width: 200px; width: 200px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!