import Vue from "vue";

export default Vue.extend({
    template: `
        <div @click="showPhoto">
            <img style="width:40px" :src="src" alt>
            <Modal
                v-model="show"
                title="图片"
                footer-hide
                :width='432'
                >
                <img style="width:400px" :src="photoSrc" alt>
            </Modal>
        </div>
    `,
    name: 'translate-cell',
    data() {
        return {
            src:null,
            show:false,
            photoSrc:null
        };
    },
    mounted(){
        let column = this.params.colDef;
        if ( this.params.value ){
            this.src = this.params.value
        }
    },
    computed: {

    },
    methods: {
        showPhoto(){
            console.log(this.params)
            if ( this.params.data.photoPath ){
                this.show = true;
                this.photoSrc = this.params.data.photoPath;
            }
        }
    }
});