<template>
  <div class="manage-container">
    <el-tabs v-model="activeName" @tab-click="handleClick">
      <el-tab-pane label="关注自动回复" name="first">
        <follow-index ref="follow"></follow-index>
      </el-tab-pane>
      <el-tab-pane label="关键词自动回复" name="second">
        <keywords-index ref="keywords"></keywords-index>
      </el-tab-pane>
      <el-tab-pane label="默认自动回复" name="three">
        <default-index ref="default"></default-index>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import followIndex from './follow/index';
import keywordsIndex from './keywords/index';
import defaultIndex from './default/index';
export default {
  name: 'Index',
  components: {
    followIndex,
    keywordsIndex,
    defaultIndex,
  },
  data() {
    return {
      activeName: 'first',
    };
  },
  computed: {
    height() {
      return 500;
    },
  },
  mounted() {},
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
      if (tab.paneName == 'second') {
        this.$refs['keywords'].keywordsIndex();
      } else if (tab.paneName == 'first') {
        this.$refs['follow'].followIndex();
      } else if (tab.paneName == 'three') {
        this.$refs['default'].defaultIndex();
      }
    },
  },
};
</script>

<style lang="scss">
.el-submenu__title:hover {
  background-color: rgba(#1890ff, 0.085) !important;
  color: hsla(208, 100%, 55%, 0.95) !important;
}
.el-dialog {
  .el-dialog__header {
    background-color: #1890ff !important;
    padding: 15px 20px;
    text-align: left !important;
    .el-dialog__title {
      color: #e8f4ff !important;
    }
    .el-dialog__headerbtn .el-dialog__close {
      color: #e8f4ff !important;
    }
  }
  .el-dialog__body {
    padding: 20px !important;
    .el-form-item {
      margin-bottom: 10px !important;
      .el-input {
        width: 100% !important;
      }
      .el-select {
        width: 100% !important;
      }
      .el-cascader {
        width: 100% !important;
      }
    }
    .el-form-item:last-child {
      margin-bottom: 20px !important;
    }
  }
  .dialog-footer {
    text-align: right;
  }
}
</style>
