<template>
    <div style="margin-left:15px;display:inline-block">
       <Button type="primary" icon="ios-cloud-download" @click="downexcel()">{{$t('1007')}}</Button>
    </div>
</template>
<script>
export default {
    data () {
        return {

        }
    },
    props: {
        down_url: {
            type: String
        }
    },
    methods: {
        downexcel () {
            this.axios
                .request({
                    url: this.down_url,
                    method: 'get'
                })
                .then(res => {
                    if (res.data.ret === 1) {
                        window.location.href = this.axios.publicPath + '' + res.data.data;
                    } else {
                        this.$Message.error(this.$t('' + res.data.msg));
                    }
                });
        }
    }
}
</script>
