<!--应用接入-->
<template>
  <div style="position: relative">
    <el-collapse
      v-model="activeName"
      accordion
      ref="collapse"
      v-resize="resize"
      style="margin-bottom:20px"
    >
      <el-collapse-item name="1">
        <template slot="title">
          <div class="title">操作指引</div>
        </template>
        <div class="instructions">
  
          <div class="instructionsList">
            <div
              class="item"
              v-for="(item, index) in instructionsList"
              :key="index"
            >
              <div>
                <img class="img" :src="item.img" alt="" />

                <div class="itemTitle">
                  <span class="head-index">{{ index + 1 }} &nbsp;</span
                  >{{ item.title }}
                </div>

                <div class="itemDescribe">{{ item.describe }}</div>
              </div>

              <i
              v-if="instructionsList.length!==index+1"
                class="el-icon-arrow-right"
                style="margin-left: 50px; font-size: 30px; font-weight: bolder;color:#b8babf"
              ></i>
            </div>
          </div>
        </div>
      </el-collapse-item>
    </el-collapse>
    <div class="tableBox" :style="{ height: tableHeight }">
   
            <el-button
              class="add"
              type="primary"
              icon="el-icon-plus"
              :size="defaultFormItemSize"
              >创建应用</el-button
            >
        
      <vxe-table
        border
        show-header-overflow
        show-overflow
        :row-config="{ isHover: true }"
        :data="tableData"
        min-height="96"
      >
        <vxe-column field="appName" title="应用名称"></vxe-column>
        <vxe-column field="appID" title="AppID"></vxe-column>
        <vxe-column field="apiKey" title="API Key"></vxe-column>
        <vxe-column field="secretKey" title="Secret Key"></vxe-column>
        <vxe-column field="creationTime" title="创建时间"></vxe-column>
        <vxe-column field="operation" title="操作">
          <!-- <template slot-scope="scope">
              <el-button
                type="text"
                :size="defaultFormItemSize"
                @click="dataImport(scope.row)"
                >导入</el-button
              >
              <el-button
                type="text"
                :size="defaultFormItemSize"
                @click="del(scope.row)"
                >删除</el-button
              >
            </template> -->
        </vxe-column>
      </vxe-table>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex';
export default {
  data () {
    return {
      activeName: '1',
      collapseHeight: 0,
      instructionsList: [
        {
          title: '创建应用',
          describe:
            '创建应用, 获取密钥',
          img: require('@/assets/img/pg1.svg')
        },
        {
          title: '调用服务',
          describe: '查看请求示例, 调用服务',
          img: require('@/assets/img/pg2.svg')
        },
        {
          title: '查看用量',
          describe:
            '查看报表了解使用情况',
          img: require('@/assets/img/pg3.svg')
        }
      ],
      myDataSetPage: {
        formFilter: {
          dataName: ''
        }
      },
      tableData: [
        {
          id: 10001,
          name: 'Test1',
          role: 'Develop',
          sex: 'Man',
          age: 28,
          address: 'test abc'
        }
      ]
    };
  },

  components: {},

  computed: {
    ...mapGetters(['getMainContextHeight']),

    tableHeight () {
      return this.getMainContextHeight - this.collapseHeight - 54 + 'px';
    }
  },

  mounted () {},

  methods: {
    resize (e) {
      setTimeout(() => {
        this.collapseHeight = e.height;
      }, 300);
    },
    onReset () {}
  }
};
</script>
<style lang="scss" scoped>
@import "@/assets/style/element-variables.scss";
.instructions {
  background-color: white;
  width: 100%;
  padding: 0px 20px 20px 20px;
  height: 180px;

  .instructionsList {
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    .item {
      display: flex;
      align-items: center;
    }
  }
  .title {
    color: $--color-text-primary;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
  }
  .describe {
    color: $--color-text-secondary;
    margin-bottom: 16px;
  }
  .itemTitle {
    color: $--color-text-primary;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
  }
  .head-index {
    font-size: 24px;
    color: #e8e9eb;
    line-height: 32px;
  }
  .itemDescribe {
    width: 170px;
    color: $--color-text-secondary;
  }
  .img {
    height: 72px;
    width: 140px;
  }
}
.tableBox {
  background-color: white;
  width: 100%;
  padding: 20px;
  overflow: auto;
  .add {
    margin-bottom: 20px;
  }
}
div /deep/ .el-collapse-item__content {
  padding-bottom: 0;
}
div /deep/ .el-collapse-item__header {
  padding-left: 20px;
}
</style>
