<template>
    <div>
        <el-form ref="form" :inline="true" :model="form" label-width="80px">
            <el-form-item>
                <Timeinterval ref="Timeinterval" :interval="3" />
            </el-form-item>
            <el-form-item><el-button type="primary" icon="el-icon-search" @click="query">查询</el-button></el-form-item>
        </el-form>
        <onlinRate ref="onlinRate" :timeFlag="timeFlag" :item="item" style="height: 100px" />
    </div>
</template>
<script>
import Timeinterval from '@/views/components/TimePicker/index4'
import onlinRate from '@/views/Event-boot/components/echarts/onlinRate'
export default {
    components: { Timeinterval, onlinRate },
    props: {},
    data() {
        return { form: {}, vh: undefined, item: ['', ''], timeFlag: '' }
    },
    created() {},
    mounted() {
        this.setHeight()
        window.addEventListener('resize', this.setHeight)
        this.item = this.$refs.Timeinterval.timeValue
        // this.timeFlag = this.$refs.Timeinterval.timeFlag;

        this.$nextTick(() => {
            this.query()
            // this.runManage();
            // this.runstatusEcharts();
        })
    },
    beforeDestroy() {
        window.removeEventListener('resize', this.setHeight)
    },
    methods: {
        setHeight() {
            this.vh = window.sessionStorage.getItem('appheight')
        },
        query() {
            this.item = this.$refs.Timeinterval.timeValue
            this.timeFlag = this.$refs.Timeinterval.timeFlag
            // console.log(this.timeFlag ,'111');
            setTimeout(() => {
                this.$emit('Loading', true)
                this.$refs.onlinRate.query()
                setTimeout(() => {
                    this.$emit('Loading', false)
                }, 1500)
            }, 0)
        }
    },

    computed: {},

    watch: {}
}
</script>
<style lang="scss" scoped></style>
