<!--
 * @Descripttion: 当前组件信息
 * @version: 1.0.0
 * @Author: 无尘
 * @Date: 2020-03-16 09:59:39
 * @LastEditors: 无尘
 * @LastEditTime: 2020-09-25 14:09:44
 -->
<template>
  <div class="daily-set-wrap ">
    <div class="daily-set-content border-box">
      <common-alert-tip :tip-content="tipContent"></common-alert-tip>
      <div class="admin-table-body m-t-20">
       <el-table ref="multipleTable" v-loading="loading" :data="tableData" tooltip-effect="dark" style="width: 100%">
          <el-table-column label="姓名">
            <template slot-scope="scope">
              {{scope.row.staffName || '--'}}
            </template>
          </el-table-column>
          <el-table-column label="账号">
            <template slot-scope="scope">
              {{scope.row.wxUserId || '--'}}
            </template>
          </el-table-column>
          <el-table-column label="手机号">
            <template slot-scope="scope">
              {{scope.row.phoneNumber || '--'}}
            </template>
          </el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>
<script>
import fetch from '@/api/enterprise.js';
const { getAdmin } = fetch;
import commonAlertTip from '@/components/common/common-alert-tip.vue';
export default {
  name: 'SuperAdminPage',
  components: { commonAlertTip },
  data() {
    return {
      wxEnterpriseId: localStorage.getItem('haoBanUser') ? JSON.parse(localStorage.getItem('haoBanUser')).wxEnterpriseId : '',
      tipContent: '超级管理员不可新增，默认为企业微信所添加的好办应用管理员，拥有好办所有管理权限。',
      loading: false,
      tableData: []
    };
  },
  mounted() {
    const that = this;
    that.$emit('showTab', '/superAdmin');
    document.documentElement.style.backgroundColor = '#f0f2f5';
    that.getData();
  },
  destroyed() {
    document.documentElement.style.backgroundColor = '#fff';
  },
  methods: {

    /**
     * @description: 获取超级管理员数据
     * @author: 无尘
     */
    getData() {
      const that = this;
      that.loading = true;
      const para = {
        wxEnterpriseId: that.wxEnterpriseId
      };
      getAdmin(para)
        .then(res => {
          that.loading = false;
          that.tableData = res.result || [];
        })
        .catch(function(error) {
          that.loading = false;
        });
    }
  }
};
</script>
<style type="text/less" lang="less" scoped>
.bg-ebecf0 {
  background: #ebecf0;
}
.color-c0c4cc {
  display: inline-block;
  line-height: 34px;
  padding-left: 10px;
  color: #c0c4cc;
}
.condition-tips {
  display: inline-block;
  vertical-align: middle;
  line-height: 32px;
}
.p-l-30 {
  padding-left: 30px;
}
.p-l-40 {
  padding-left: 40px;
}
.p-l-55 {
  padding-left: 55px;
}
.p-l-85 {
  padding-left: 85px;
}
.m-l-20 {
  margin-left: 20px;
}
.line-50 {
  height: 50px;
  line-height: 50px;
}

.table-condition {
  /* min-width: 1200px; */
}
.admin-table-body {
  .admin-thead {
    width: 100%;
    height: 48px;
    line-height: 48px;
  }
  .row-th {
    height: 48px;
    line-height: 48px;
  }
  .el-row {
    font-size: 14px;
    border-bottom: 1px solid #dcdfe6;
    overflow: hidden;
    &.border-set {
      border-bottom: 0px solid #dcdfe6;
      .el-col {
        position: relative;
        border-bottom: 1px solid #dcdfe6;
        &::after {
          content: ' ';
          position: absolute;
          left: 0px;
          bottom: 0;
          width: 100%;
          height: 50px;
          border-bottom: 1px solid #dcdfe6;
          z-index: 1;
        }
        &.line-one {
          &::after {
            content: ' ';
            position: absolute;
            left: 55px;
            bottom: 0;
            width: calc(100% - 55px);
            height: 50px;
            border-bottom: 1px solid #dcdfe6;
            z-index: 1;
          }
        }
      }
    }
    .hide-border {
      position: relative;
      &::after {
        content: ' ';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 55px;
        height: 1px;
        background: #fff;
        z-index: 1;
      }
    }
  }
}
.daily-set-wrap {
  height: 100%;
  .daily-set-content {
    padding: 20px;
    .table-condition-left {
      font-size: 0;
    }
  }
  .el-form {
    .el-form-item {
      margin-bottom: 4px;
    }
    /deep/ .el-form-item__label {
      color: #606266;
    }
  }
  .depart-item-content {
    width: 213px;
    height: 32px;
    overflow: hidden;
    white-space: nowrap;
    border-radius: 4px;
    border: 1px solid #dcdfe6;
    cursor: pointer;
  }
  .item-cell-select {
    /deep/ .el-select__tags {
      white-space: nowrap;
      overflow: hidden;
    }
  }
  .depart-cell {
    position: relative;
    margin: 0 24px 24px 0;
    .el-icon-circle-close {
      position: absolute;
      top: -10px;
      right: -10px;
      font-size: 16px;
      color: #808995;
      cursor: pointer;
    }
  }
}
</style>
