<template>
  <div class="manage-container">
    <el-tabs
      v-model="activeName"
      class="tabRight"
      type="card"
      @tab-click="handleClick"
    >
      <el-tab-pane label="平台角色" name="first">
        <role-index ref="role"></role-index>
      </el-tab-pane>
      <el-tab-pane label="小程序角色" name="second">
        <applets-index ref="applets"></applets-index>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
import roleIndex from './components/role/roleIndex';
import appletsIndex from './components/applets/appletsIndex';
export default {
  name: 'Manage',
  components: {
    roleIndex,
    appletsIndex,
  },
  data() {
    return {
      roleData: [],
      lazy: true,
      activeName: 'first',
      layout: 'total, sizes, prev, pager, next, jumper',
      total: 0,
      input: '',
      textarea: '',
      list: [],
      background: true,
      listLoading: true,
      elementLoadingText: '正在加载...',
      queryForm: {
        page: 1,
        size: 20,
        name: '',
      },
    };
  },
  computed: {
    height() {
      return 500;
    },
  },
  methods: {
    handleClick(tab, event) {
      console.log(tab, event);
      if (tab.paneName == 'first') {
        this.$refs['role'].roleIndex();
      } else if (tab.paneName == 'second') {
        this.$refs['applets'].appletsIndex();
      }
    },
  },
};
</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>
