<template>
    <!-- 今日检查 -->
    <div class="checktoday">
        <!--<i class="iTop"></i>-->
        <div class="title">
            <span>待检查任务</span>
            <span>( {{total}} )</span>
        </div>
        <div class="content">
            <vue-seamless-scroll v-if="dataList && dataList.length>0" :data="dataList" :class-option="classOption"
                @copy-data="dataList = dataList.concat(dataList)"
                class="warp" id="warp">
                <div class="box" v-for="(item,index) in dataList" :key="index">
                    <div class="boxLeft" >
                        <i></i>
                        <p class="titp">{{item.title}}</p>
                        <!--<p>检查项：{{item.itemCount}} 个</p>-->
                        <p>{{item.groupName}}</p>
                    </div>
                    <!-- <div class="boxRight">
                        <p>{{item.groupName}}</p>
                        <p class="p2">完成率：{{item.rate}}</p>
                    </div> -->
                </div>
            </vue-seamless-scroll>
            <p v-else class="noData">暂无内容</p>
        </div>
    </div>
</template>
<script>
export default {
    name: "checktoday",
    data() {
        return {
            total:0,
            dataList:[],
        }
    },
    computed: {
        // 无缝滚动插件控制
        classOption: function () {
            return {
                step: 0.6,              // 速度
                limitMoveNum: 3,        // 最小滚动数量
                autoPlay: true
            };
        }
    },
    mounted(){
        this.getDataListFn();
        $(window).resize(function(){
            $('#warp').children("div").css('width','100%')
        });

    },
    methods:{
        getDataListFn(){

            let that = this;
            let obj = {
                gId:this.$port.gId,
                cId:this.$port.cId,
                path:this.$api.todayCheck,
            }
            this.$axios.AxiosMethods("get","3rd/bigScreenData/bigScreenMessage",obj,function (res) {
                let data = JSON.parse(res.data);
                // console.log('今日检查___________________________',data);
                that.dataList = data.todayCheck[0].list;
                that.total = data.todayCheck[0].all;
            });
            this.$websocketFn(obj,function (res) {
                let data = JSON.parse(res.data);
              // console.log('今日检查websocketFn________________',res);
                that.dataList = data.todayCheck[0].list;
                that.total = data.todayCheck[0].all;
            });
        }
    }
}
</script>
<style lang="less" scoped>
    .checktoday{
        font-size: 0.1rem;
        margin-top: 0.24rem;
        position: relative;
        /*border:0.01rem solid rgba(0,122,234,0.6);*/
        .iTop{
            width: 0.1rem;
            height: 0.1rem;
            display: block;
            position: absolute;
            background: url('../../../assets/image/img_jiao.png');
            left: 0;
        }
        .title{
          font-weight: bold;
          line-height: 0.52rem;
            font-size: 0.16rem;
            color: #fff;
            padding-left: 0.17rem;
            display: flex;
            justify-content: space-between ;
            /*border-bottom:0.01rem solid rgba(0,122,234,0.6);*/
            /*background:linear-gradient(90deg,rgba(0,54,128,1) 0%, rgba(0,30,63,1)  100%);*/
            background: url('../../../assets/image/bg2_03.png');
            background-size: 100% 100%;
            span:nth-child(2) {
                margin-right: 0.15rem;
            }
        }
        .content{
            height: 1.6rem;
            overflow: hidden;
            padding: 0.1rem 0.08rem 0.08rem 0.08rem;
            background: url('../../../assets/image/bg2_05.png');
            background-size: 100% 100%;
            .box{
                height: 0.7rem;
                display: flex;
                color: #fff;
                margin-bottom: 0.1rem;
                justify-content: space-between ;
                /*background-color: #00162F;*/
                background: rgba(0, 17, 36, 0.4);
                p{
                    line-height: 0.3rem;
                }
                .boxLeft{
                    position: relative;
                    i{
                        width: 10px;
                        height: 10px;
                        border-radius: 50%;
                        display: inline-block;
                        position: absolute;
                        left: 0.08rem;
                        top: 0.08rem;
                        background-color: #FE8204;
                    }
                    p{
                      font-size: 12px;
                      margin-left: 0.3rem;
                    }
                    p.titp{
                      font-size: 14px;
                      font-weight: bold;
                    }
                }
                .boxRight{
                    p{
                        font-size: 12px;
                        text-align: right;
                        margin-right: 10px;
                    }
                    .p2{
                      color: #FE8204;
                    }
                }
            }
            .noData{
                color: #fff;
                font-size: 0.18rem;
                line-height: 2rem;
                text-align: center;
            }
        }
    }
</style>

