index.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <script lang="ts" setup>
  2. /**
  3. * @Name: index.vue
  4. * @Description: 店铺信息页面
  5. * @Author: Cheney
  6. */
  7. import InfoCard from '/@/views/shop-information/components/InfoCard.vue';
  8. import * as api from '/@/views/shop-information/api';
  9. import { useResponse } from '/@/utils/useResponse';
  10. import DataTable from './components/DataTable.vue';
  11. const cardData = ref();
  12. provide('cardData', cardData);
  13. const loading = ref(false);
  14. const activeName = ref('first');
  15. onBeforeMount(() => {
  16. initData();
  17. });
  18. async function initData() {
  19. const res = await useResponse({}, api.getCardData, loading);
  20. cardData.value = res.data;
  21. }
  22. </script>
  23. <template>
  24. <div class="flex flex-col px-5">
  25. <el-divider content-position="left">
  26. <div class="font-bold text-xl">店铺信息概览</div>
  27. </el-divider>
  28. <!-- 添加 flex-grow 类,确保 el-card 占据剩余空间 -->
  29. <el-card v-loading="loading" class="flex-grow" shadow="never">
  30. <el-tabs v-model="activeName">
  31. <el-tab-pane label="信息概览" name="first">
  32. <InfoCard />
  33. </el-tab-pane>
  34. <el-tab-pane label="信息汇总" name="second">
  35. <DataTable ref="table" />
  36. </el-tab-pane>
  37. </el-tabs>
  38. </el-card>
  39. </div>
  40. </template>
  41. <style scoped>
  42. :deep(.el-divider__text.is-left) {
  43. background-color: #F5F5F5;
  44. }
  45. </style>