<template>
    <div class="runTimeRecord">
        <div class="other-people">
            <div class="image-border image-border1"></div>
            <div class="image-border image-border2"></div>
            <div class="image-border image-border3"></div>
            <div class="image-border image-border4"></div>
            <div class="other-people-title">
                实时监测
            </div>
            <ul>
                <li v-for="l in list" :class="{'yellow':l.WarnNum != 0}">
                    <span> {{l.Dettime|fmtDate}}</span>
                    <em>{{l.RegionName}} {{l.WarnString}}</em>
                </li>
            </ul>
        </div>
    </div>
</template>

<script>
    import {Watching} from '../api/getApiRes.js'
    export default {
        data() {
            return {
                list: [],
            }
        },
        props: ['totalRs'],
        watch: {
            totalRs: function (val) {
                let that = this;
                that.wordDisplay(val.RegionDetRs);
            },
        },
        methods: {
            wordDisplay(word) {
                let index = 0;
                let that = this;
                setTimeout(function () {
                    if(!word) {
                        return false
                    }
                    that.list.unshift(word[index]);
                    index = index + 1 ;
                }, 800);
            }
        },
        filters: {
            fmtDate: function (value) {
                if(!value){
                    return '---';
                }else{
                    return value.substr(11,8);
                }
            }
        }
    }
</script>

<style scoped>
    .runTimeRecord {
        width: 100%;
        overflow: hidden;
        display: block;
        margin: 0 auto;
    }

    .runTimeRecord ul {
        width: 100%;
        overflow: hidden;
        display: block;
        margin: 0 auto;
        margin-top: 50px;
    }

    .runTimeRecord li {
        height: 34px;
        line-height: 34px;
        padding-left: 20px;
        padding-right: 10px;
        background: rgba(0, 107, 184, 0.2);
        font-size: 14px;
        color: #6DC1FF;
        text-align: left;
        overflow: hidden;
        margin-bottom: 5px;
    }

    .runTimeRecord li span {
        font-family: UnidreamLED;
        font-size: 16px;
        margin-right: 10px;
    }
    .other-people {
        width: 439px;
        height: 480px;
        margin-left: 0;
    }
     li.yellow {
        color: #FFDD00;
    }
</style>
