index.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <div :class="[`${prefixCls}-bottom`, '!dark:bg-dark-900']">
  3. <div class="datacenter-left">
  4. <div class="page-name">
  5. <p>通用接口</p>
  6. </div>
  7. <div class="ztree-container">
  8. <p v-for="(i, k) in menu" :key="k" @click="scrollToSection(k, i)" :class="[`${action == k ? 'action' : ''}`]">{{
  9. i.groupName }}({{ i.num }})</p>
  10. </div>
  11. </div>
  12. <div class="datacenter-right">
  13. <AssemblyData></AssemblyData>
  14. </div>
  15. </div>
  16. </template>
  17. <script lang="ts">
  18. import { defineComponent, ref, watch } from 'vue';
  19. import AssemblyData from './item/AssemblyData.vue';
  20. import { onMounted } from 'vue';
  21. import { getGroup } from '/@/api/interface/interface.ts';
  22. const prefixCls = 'account-center-bottom'
  23. export default defineComponent({
  24. components: {
  25. AssemblyData,
  26. },
  27. setup() {
  28. const action = ref(0)
  29. function scrollToSection(index, i) {
  30. action.value = index;
  31. eventBus.emit("groupIdInterface", i.groupId);
  32. }
  33. onMounted(() => getGroupList())
  34. var menu = ref([]);
  35. function getGroupList() {
  36. getGroup().then((res) => {
  37. if (res.length) {
  38. eventBus.emit("groupIdInterface", res[0].groupId);
  39. menu.value = res;
  40. }
  41. })
  42. }
  43. return {
  44. scrollToSection,
  45. action,
  46. menu,
  47. prefixCls: 'account-center',
  48. };
  49. },
  50. });
  51. </script>
  52. <style lang="less" scoped>
  53. .ztree-container p.action {
  54. background: #0671DD;
  55. color: #fff;
  56. }
  57. .account-center-bottom {
  58. background: #fff;
  59. height: calc(100vh - 80px);
  60. overflow: hidden;
  61. }
  62. .datacenter-right {
  63. float: left;
  64. width: calc(100vw - 320px);
  65. }
  66. .ztree-container {
  67. float: left;
  68. overflow: auto;
  69. width: 100%;
  70. height: auto;
  71. max-height: 976px;
  72. }
  73. .ztree-container p {
  74. padding-left: 30px;
  75. line-height: 40px;
  76. margin-left: 9px;
  77. width: 233px;
  78. height: 40px;
  79. text-align: left;
  80. height: 40px;
  81. background: #FFFFFF;
  82. cursor: pointer;
  83. }
  84. .ztree-container p:hover {
  85. background: #0671DD;
  86. color: #fff;
  87. }
  88. .datacenter-left .page-name {
  89. margin-bottom: 30px;
  90. border-bottom: solid 1px #DEDEDE;
  91. }
  92. .datacenter-left .page-name p {
  93. height: 42px;
  94. line-height: 42px;
  95. font-size: 16px;
  96. font-family: PingFang SC;
  97. font-weight: bold;
  98. color: #333333;
  99. text-align: center;
  100. margin-bottom: 0px;
  101. }
  102. .datacenter-left {
  103. float: left;
  104. width: 250px;
  105. height: auto;
  106. margin-right: 16px;
  107. border-top: none;
  108. background: #F8F8F8;
  109. overflow: auto;
  110. height: calc(100% - 20px);
  111. max-height: 1306px;
  112. }
  113. .account-center {
  114. &-bottom {
  115. padding: 10px;
  116. margin: 16px;
  117. // background-color: @component-background;
  118. border-radius: 3px;
  119. }
  120. }
  121. </style>