index.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <script setup lang="ts">
  2. import { storeToRefs } from 'pinia'
  3. import { provide, ref } from 'vue'
  4. import DataTable from '/@/views/productCenter/productAnalysis/components/DataTable/index.vue'
  5. import TopParentAsin from './components/TopParentAsin/index.vue'
  6. import TrendOverview from './components/TrendOverview/index.vue'
  7. import SalesOverview from './components/SalesOverview/index.vue'
  8. import CpRecommendations from './components/CpRecommendations/index.vue'
  9. import DateRangePicker from '/@/components/DateRangePicker/index.vue'
  10. import { usePublicData } from '/@/stores/publicData'
  11. import { useShopInfo } from '/@/stores/shopInfo'
  12. // 店铺信息
  13. const shopInfo = useShopInfo()
  14. const { profile } = storeToRefs(shopInfo)
  15. // 公共数据
  16. const publicData = usePublicData()
  17. const { dateRange } = storeToRefs(publicData)
  18. provide('dateRange', dateRange)
  19. provide('profile', profile)
  20. const activeName = ref('trendOverview')
  21. const filter1 = ref('')
  22. const options1 = [
  23. {
  24. value: 'Option1',
  25. label: 'Option1',
  26. },
  27. {
  28. value: 'Option2',
  29. label: 'Option2',
  30. },
  31. ]
  32. const filter2 = ref('')
  33. const options2 = [
  34. {
  35. value: 'Option1',
  36. label: 'Option1',
  37. },
  38. {
  39. value: 'Option2',
  40. label: 'Option2',
  41. },
  42. ]
  43. const updatedData = ref([])
  44. provide('tableData', updatedData)
  45. function handleUpdate(value: any) {
  46. updatedData.value = value
  47. }
  48. </script>
  49. <template>
  50. <div class="outer-container">
  51. <TopParentAsin></TopParentAsin>
  52. <div class="filters">
  53. <DateRangePicker v-model="dateRange" style="position: absolute; right: 14px; top: 163px; z-index: 9; border-radius: 20px"></DateRangePicker>
  54. <!-- <div v-show="activeName == 'trendOverview'">
  55. <el-select v-model="filter1" placeholder="Select" style="width: 240px; margin-right: 8px">
  56. <el-option v-for="item in options1" :key="item.value" :label="item.label" :value="item.value" />
  57. </el-select>
  58. <el-select v-model="filter2" placeholder="Select" style="width: 240px">
  59. <el-option v-for="item in options2" :key="item.value" :label="item.label" :value="item.value" />
  60. </el-select>
  61. </div> -->
  62. </div>
  63. <div>
  64. <el-tabs v-model="activeName" type="border-card" class="chart-tabs">
  65. <el-tab-pane label="趋势总览" name="trendOverview">
  66. <TrendOverview @updateList="handleUpdate"></TrendOverview>
  67. <DataTable></DataTable>
  68. </el-tab-pane>
  69. <el-tab-pane label="广告优化" name="adOptimization">广告优化</el-tab-pane>
  70. <el-tab-pane label="销售概览" name="salesOverview" lazy>
  71. <SalesOverview></SalesOverview>
  72. </el-tab-pane>
  73. <el-tab-pane label="竞品推荐" name="cpRecommendations">
  74. <CpRecommendations></CpRecommendations>
  75. </el-tab-pane>
  76. </el-tabs>
  77. </div>
  78. </div>
  79. </template>
  80. <style scoped>
  81. .outer-container {
  82. padding: 5px 10px 0 10px;
  83. }
  84. .filters {
  85. display: flex;
  86. flex-direction: row-reverse;
  87. gap: 8px;
  88. margin-top: 5px;
  89. }
  90. /* :deep(.el-tabs--border-card > .el-tabs__header) {
  91. background-color: transparent;
  92. } */
  93. :deep(.el-tabs.el-tabs--top.el-tabs--border-card.chart-tabs) {
  94. border-radius: 8px;
  95. }
  96. </style>