49 lines
843 B
Vue
49 lines
843 B
Vue
<template>
|
|
<j-modal
|
|
:title="title"
|
|
:width="width"
|
|
:visible="visible"
|
|
:confirmLoading="confirmLoading"
|
|
switchFullscreen
|
|
@cancel="handleCancel"
|
|
cancelText="关闭">
|
|
|
|
<img :src="imgSrc" class="preview-img">
|
|
|
|
<template slot="footer">
|
|
<a-button @click="handleCancel">关闭</a-button>
|
|
</template>
|
|
</j-modal>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'PreviewImgModal',
|
|
data() {
|
|
return {
|
|
title: '图片',
|
|
width: 800,
|
|
visible: false,
|
|
confirmLoading: false,
|
|
// 图片id
|
|
imgId: ''
|
|
}
|
|
},
|
|
computed: {
|
|
imgSrc() {
|
|
return `${ window._CONFIG['domianURL'] }/sys/common/download/${ this.imgId }`
|
|
}
|
|
},
|
|
methods: {
|
|
handleCancel() {
|
|
this.visible = false
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style scoped>
|
|
.preview-img {
|
|
width: 100%;
|
|
}
|
|
</style> |