<template>
        <a-tabs default-active-key="1" @change="callback" class="card-container">
            <a-tab-pane key="1" tab="区域环境数据">
                <itdm-environment-quyu-list @ok="submitCallback" :key="timer1"></itdm-environment-quyu-list>
            </a-tab-pane>
            <a-tab-pane key="2" tab="进出水口数据" force-render>
                <itdm-environment-water-list :key="timer2"></itdm-environment-water-list>
            </a-tab-pane>
            <a-tab-pane key="3" tab="水液位数据" force-render>
                <itdm-environment-yewei-list :key="timer3"></itdm-environment-yewei-list>
            </a-tab-pane>
        </a-tabs>
</template>

<script>
import ItdmEnvironmentQuyuList from '../itdmDataHistory/ItdmEnvironmentQuyuList.vue';
import ItdmEnvironmentWaterList from '../itdmDataHistory/ItdmEnvironmentWaterList.vue';
import ItdmEnvironmentYeweiList from '../itdmDataHistory/ItdmEnvironmentYeweiList.vue';
  export default {
    name: 'itdmEnvironmentDataList',
    components: {
        ItdmEnvironmentQuyuList,
        ItdmEnvironmentWaterList,
        ItdmEnvironmentYeweiList
    },
    data () {
      return {
        timer1: '',
        timer2: '',
        timer3: '',
      }
    },
    methods: {
      submitCallback(){
        this.$emit('ok');
      },
      callback(key) {
        if (key == 1) {
          this.timer1 = new Date().getTime()
        } else if (key == 2) {
          this.timer2 = new Date().getTime()
        } else if (key == 3) {
          this.timer3 = new Date().getTime()
        }
      },
    }
  }
</script>

<style scoped>
.ant-card-body{
    padding-top: 10px !important;
}
</style>