parent
dd26362efb
commit
37e790c2ad
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 2.5 KiB |
After Width: | Height: | Size: 3.4 KiB |
@ -0,0 +1,54 @@
|
|||||||
|
<template>
|
||||||
|
<div class="img-preview-box-style">
|
||||||
|
<img :src="getImgURL()" style="width: 100%;height: 100%" @click="previewData">
|
||||||
|
<preview-box ref="previewBox"/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<script>
|
||||||
|
/*
|
||||||
|
* 图片及预览处理业务组件
|
||||||
|
* */
|
||||||
|
import PreviewBox from '../../../components/common/preview/PreviewBox';
|
||||||
|
import PreviewManager from '../../../components/common/preview/previewManager';
|
||||||
|
export default{
|
||||||
|
props: {
|
||||||
|
imgObj: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
img: this.$props.imgObj,
|
||||||
|
}
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
imgObj:function (newVal) {
|
||||||
|
this.img = newVal;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getImgURL: function () {
|
||||||
|
if (this.img && this.img.key && this.img.key !== "") {
|
||||||
|
return this.BaseConfig.url_path_down + this.img.key;
|
||||||
|
} else {
|
||||||
|
//暂无图片
|
||||||
|
}
|
||||||
|
},
|
||||||
|
previewData: function () {
|
||||||
|
PreviewManager.analysisPreview(this.img, this.$refs.previewBox)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
PreviewBox
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.img-preview-box-style {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in new issue