<template>
  <div :class="[`${prefixCls}-bottom`, '!dark:bg-dark-900']">
    <div class="datacenter-left">
      <div class="page-name">
        <p>通用接口</p>
      </div>
      <div class="ztree-container">
        <p v-for="(i, k) in menu" :key="k" @click="scrollToSection(k)"
          :class="[`${action == k ? 'action' : ''}`]">{{ i.name }}({{ i.num }})</p>
      </div>
    </div>
    <div class="datacenter-right">
      <AssemblyData></AssemblyData>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref, watch } from 'vue';
import AssemblyData from './item/AssemblyData.vue';
import { onMounted } from 'vue';
import { directoryTree, platList } from '/@/api/resource/plat';

const prefixCls = 'account-center-bottom'

export default defineComponent({
  components: {
    AssemblyData,
  },
  setup() {
    const action = ref(0)
    var menu = [
      { name: '数据分析', num: 10 },
      { name: '用户中心', num: 7 },
      { name: '授权中心', num: 8 },
      { name: '空间分析', num: 9 },
      { name: '专项接口', num: 6 }
    ]
    function scrollToSection(index) {
      action.value = index;
    }
    return {
      scrollToSection,
      action,
      menu,
      prefixCls: 'account-center',

    };
  },
});
</script>
<style lang="less" scoped>
.ztree-container p.action {
  background: #0671DD;
  color: #fff;
}
.account-center-bottom {
  background: #fff;
  height: calc(100vh - 110px);
  overflow: hidden;
}

.datacenter-right {
  float: left;
  width: calc(100vw - 320px);
}

.ztree-container {
  float: left;
  overflow: auto;
  width: 100%;
  height: auto;
  max-height: 976px;
}

.ztree-container p {
  padding-left: 30px;
  line-height: 40px;
  margin-left: 9px;
  width: 233px;
  height: 40px;
  text-align: left;
  height: 40px;
  background: #FFFFFF;
  cursor: pointer;
}

.ztree-container p:hover {
  background: #0671DD;
  color: #fff;
}

.datacenter-left .page-name {
  margin-bottom: 30px;
  border-bottom: solid 1px #DEDEDE;
}

.datacenter-left .page-name p {
  height: 42px;
  line-height: 42px;
  font-size: 16px;
  font-family: PingFang SC;
  font-weight: bold;
  color: #333333;
  text-align: center;
  margin-bottom: 0px;
}

.datacenter-left {
  float: left;
  width: 250px;
  height: auto;
  margin-right: 16px;
  border-top: none;
  background: #F8F8F8;
  overflow: auto;
  height: calc(100% - 20px);
  max-height: 1306px;
}

.account-center {
  &-bottom {
    padding: 10px;
    margin: 16px;
    // background-color: @component-background;
    border-radius: 3px;
  }
}
</style>
