<template>
    <div class="module-main">
        <div class="module-box">
            <div class="module-box-one">
                <div class="content">
                    <img src="../../images/smodule/ys-circle.png" alt="">
                    <div class="title">当日工单总量</div>
                    <div class="nums">{{data.count}}</div>
                </div>

            </div>
            <div class="bottom">
                <div>本年总量：{{data.count2}}</div>
                <div>本月总量：{{data.count1}}</div>
            </div>
        </div>
    </div>

</template>

<script>
import Vue from 'vue';
import Component from 'vue-class-component';
import api from '../../api';

@Component({
    components: {

    },
    props: {
        data: {
            type: Object,
            default: null,
        },
    },

})
export default class Smodule14 extends Vue {
    nums = 0;

    data = {}

    created() {
        this.getTodoNum();
        setInterval(() => {
            this.getTodoNum();
        }, 3000 * 60);
    }

    getTodoNum() {
        console.log('xxxxxxxxxxxxxxxx');
        api.getTodoNum().then((res) => {
            this.data = res.data;
        }).catch(() => {}).finally(() => {
        });
    }
}
</script>

<style scoped lang="scss">
     .module-box-one{
        width: 100%;
        height: 80%;
        display: flex;
        justify-content: center;
        align-items: center;
        text-align: center;
    }
    .module-box-one .content{
        width: 57%;
        height: auto;
        position: relative;
    }
    .module-box-one .content img{
        margin-top: 20px;
        width: 100%;
    }
    .module-box-one .content .title{
        width: 100%;
        font-size: 18px;
        color: #333;
        position: absolute;
        top: 28%;
    }
    .module-box-one .content .nums{
        width: 100%;
        font-size: 50px;
        font-family: DIN;
        font-weight: bold;
        color: #0163FF ;
        position: absolute;
        top: 45%;
        overflow: hidden;
    }
    .bottom{
        width: 100%;
        height: 20%;
        div{
            width: 50%;
            text-align: center;
            display: inline-block;
            float: left;
            overflow: hidden;
        }
    }

</style>
