<template>
    <span>
        <c-button type="button" size="mini" @click="showDocOrMsg">显示</c-button>
        <el-dialog :title="title" :visible.sync="dialogOpen" width="95%">
            <c-docshow :path="path"/>
        </el-dialog>

    </span>
</template>
<script>
import Api from "~/service/Api"

export default {
    props:['path'],
    data(){
        return {
            dialogOpen :false,
        }
    },
    methods:{
        async showDocOrMsg(){
            this.dialogOpen = true
        }
    },
    computed:{
        isdoc(){
            if(this.path.endsWith(".pdf"))
                return true
            else
                return false
        },
        title(){
            if(this.isdoc)
                return "面函展示"
            else
                return "报文展示"
        }
    }
}
</script>