Răsfoiți Sursa

Merge branch 'wang' into test

WanGxC 9 luni în urmă
părinte
comite
5d764f08d0

+ 6 - 3
src/views/searchTerm/analysisPage/IndicatorFunnel.vue

@@ -173,10 +173,13 @@ function initChart(opt) {
         <el-input v-model="funnelFilter.searchTermInp" :prefix-icon="Search" @change="fetchFunnelData" style="width: 200px" />
       </div>
     </div>
-    <div v-show="!funnelLoading && !hasData" class="no-data-message" style="min-height: 500px">
-      <el-empty :image-size="300" />
+    <div class="w-full" style="min-height: 500px">
+      <div v-show="!funnelLoading && !hasData" class="no-data-message" style="min-height: 500px">
+        <el-empty :image-size="300" />
+      </div>
+      <div v-show="hasData" ref="chartRef" style="width: 100%; height: 500px"></div>
     </div>
-    <div v-show="hasData" ref="chartRef" style="width: 100%; height: 500px"></div>
+
   </el-card>
 </template>
 

+ 2 - 2
src/views/searchTerm/analysisPage/IndicatorHeatmap.vue

@@ -243,8 +243,8 @@ async function fetchHeatmapData() {
       </el-select>
     </div>
 
-    <div class="w-full">
-      <div v-if="!heatmapLoading && !hasData" style="min-height: 800px" class="flex justify-center items-center">
+    <div class="w-full" style="min-height: 800px">
+      <div v-show="!heatmapLoading && !hasData" style="min-height: 800px" class="flex justify-center items-center">
         <el-empty :image-size="300"  />
       </div>
       <div v-show="hasData" ref="chartRef" style="width: 100%; height: 800px"></div>

+ 5 - 3
src/views/searchTerm/analysisPage/WordCloud.vue

@@ -147,10 +147,12 @@ function changeMetric() {
       </div>
     </div>
     <!-- 空状态 和 词云图 -->
-    <div v-show="!loading && !hasData" style="min-height: 500px">
-      <el-empty :image-size="300" />
+    <div class="w-full" style="min-height: 500px">
+      <div v-show="!loading && !hasData" style="min-height: 500px">
+        <el-empty :image-size="300" />
+      </div>
+      <div v-show="hasData" ref="chartRef" style="width: 100%; height: 500px"></div>
     </div>
-    <div v-show="hasData" ref="chartRef" style="width: 100%; height: 500px"></div>
   </el-card>
 </template>
 

+ 5 - 1
src/views/searchTerm/analysisPage/index.vue

@@ -10,13 +10,17 @@ import IndicatorOverview from './IndicatorOverview.vue';
 import IndicatorChart from './IndicatorChart.vue';
 import QuerySummary from './QuerySummary.vue';
 import dayjs from 'dayjs'
+import { usePublicData } from '/@/stores/publicData'
+import { storeToRefs } from 'pinia'
 
+const publicData = usePublicData();
+const { dateRange } = storeToRefs(publicData);
 const filter = ref({
   // 初始化 QueryCondition组件的filter
   layerType: 'asin_view',
   searchTerm: '',
   reportType: 'MONTHLY',
-  reportDate: [dayjs().format('YYYY-MM-DD'), dayjs().subtract(1, 'month').format('YYYY-MM-DD')],
+  reportDate: [dateRange.value[0], dateRange.value[1]],
   variable: 'B00TEST0001',
   metric: 'Search_Query_Score',
 });

+ 9 - 17
src/views/searchTerm/asinView/index.vue

@@ -5,20 +5,23 @@
  * @Author: Cheney
  */
 
-import { Download, Refresh, Search } from '@element-plus/icons-vue';
-import { nextTick, onBeforeMount, reactive, ref, watch } from 'vue';
+import { Refresh, Search } from '@element-plus/icons-vue';
+import { onBeforeMount, reactive, ref, watch } from 'vue';
 import dayjs from 'dayjs';
-import { getTableData, postDownload } from './api';
+import { getTableData } from './api';
 import { ElMessage } from 'element-plus';
 import { asinColumns } from './useColumns';
-import { brandColumns } from '/@/views/searchTerm/brandView/useColumns';
+import { usePublicData } from '/@/stores/publicData';
+import { storeToRefs } from 'pinia';
 
+const publicData = usePublicData();
+const { dateRange } = storeToRefs(publicData);
 const reportTypeSelect = ref('monthly');
 const searchTermInp = ref('');
 const asinInp = ref('B0');
 const tableLoading = ref(false);
 const downloadLoading = ref(false);
-const date = ref(calculateLastWeek());
+const date = ref([dateRange.value[0], dateRange.value[1]]);
 
 const gridOptions: any = reactive({
   height: 'auto',
@@ -64,7 +67,6 @@ async function handleSelectChange() {
   } else {
     await fetchTableData();
   }
-
 }
 
 async function refreshTable() {
@@ -136,16 +138,6 @@ function validateAsinInput(input: string) {
   const regex = /^[Bb]0[A-Za-z0-9\s]*$/i;
   return regex.test(input);
 }
-
-/**
- * 计算上周的周日到周六的日期范围
- */
-function calculateLastWeek() {
-  const today = dayjs();
-  const lastDay = today.subtract(1, 'day'); // 昨天
-  const firstDay = lastDay.subtract(6, 'day'); // 一周前
-  return [firstDay.format('YYYY-MM-DD'), lastDay.format('YYYY-MM-DD')];
-}
 </script>
 
 <template>
@@ -215,7 +207,7 @@ function calculateLastWeek() {
           <template #toolbar_buttons></template>
           <template v-for="col in asinColumns" #[`${col.field}_default`]="{ row }">
             <div v-if="col.field === 'clickedItemName'">
-              <el-tooltip effect="dark" :content="row.clickedItemName" placement="top" :show-after="300" >
+              <el-tooltip effect="dark" :content="row.clickedItemName" placement="top" :show-after="300">
                 <div class="line-text font-medium">
                   {{ row.clickedItemName }}
                 </div>

+ 9 - 6
src/views/searchTerm/brandView/index.vue

@@ -5,20 +5,23 @@
  * @Author: Cheney
  */
 
-import { Download, Refresh, Search } from '@element-plus/icons-vue';
-import { nextTick, onBeforeMount, reactive, ref, watch } from 'vue';
+import { Refresh, Search } from '@element-plus/icons-vue';
+import { onBeforeMount, reactive, ref, watch } from 'vue';
 import dayjs from 'dayjs';
-import { getTableData, postDownload } from './api';
+import { getTableData } from './api';
 import { ElMessage } from 'element-plus';
 import { brandColumns } from './useColumns';
-import { universalColumns } from '/@/views/productCenter/productAnalysis/utils/columns';
+import { usePublicData } from '/@/stores/publicData';
+import { storeToRefs } from 'pinia';
 
+const publicData = usePublicData();
+const { dateRange } = storeToRefs(publicData);
 const reportTypeSelect = ref('weekly');
 const searchTermInp = ref('zosi');
 // const asinInp = ref('B0');
 const tableLoading = ref(false);
 const downloadLoading = ref(false);
-const date = ref(calculateLastWeek());
+const date = ref([dateRange.value[0], dateRange.value[1]]);
 
 const gridOptions: any = reactive({
   height: 'auto',
@@ -209,7 +212,7 @@ function calculateLastWeek() {
           <template #toolbar_buttons></template>
           <template v-for="col in brandColumns" #[`${col.field}_default`]="{ row }">
             <div v-if="col.field === 'clickedItemName'">
-              <el-tooltip effect="dark" :content="row.clickedItemName" placement="top" :show-after="300" >
+              <el-tooltip effect="dark" :content="row.clickedItemName" placement="top" :show-after="300">
                 <div class="line-text">
                   {{ row.clickedItemName }}
                 </div>

+ 4 - 4
src/views/searchTerm/targetingSearchTerm/index.vue

@@ -148,10 +148,10 @@ async function fetchSearchTermData() {
         <div>
           <span class="font-medium mr-0.5">搜索词类型 </span>
           <el-select v-model="searchType" placeholder="请选择" style="width: 130px">
-            <el-option label="自动搜索" value="AUTO"></el-option>
-            <el-option label="广度搜索" value="BROAD"></el-option>
-            <el-option label="短语搜索" value="PHRASE"></el-option>
-            <el-option label="精准搜索" value="EXACT"></el-option>
+            <el-option label="自动匹配" value="AUTO"></el-option>
+            <el-option label="宽泛匹配" value="BROAD"></el-option>
+            <el-option label="短语匹配" value="PHRASE"></el-option>
+            <el-option label="精准匹配" value="EXACT"></el-option>
           </el-select>
         </div>
         <div>

+ 6 - 3
src/views/searchTerm/topSearchTermRank/index.vue

@@ -7,17 +7,20 @@
 
 import { Key, PictureRounded, Refresh, Search, TopRight } from '@element-plus/icons-vue';
 import { nextTick, onMounted, ref, watch } from 'vue';
-import dayjs from 'dayjs';
 import { useRouter } from 'vue-router';
 import { marketplaceIdEnum } from '/@/utils/marketplaceIdEnum';
 import { usePagination } from '/@/utils/usePagination';
 import { getTopSearchTermTable } from './api';
 import { ElMessage } from 'element-plus';
 import ColumnChart from '/src/views/searchTerm/topSearchTermRank/column-chart.vue';
+import { usePublicData } from '/@/stores/publicData';
+import { storeToRefs } from 'pinia';
 
+const publicData = usePublicData();
+const { dateRange } = storeToRefs(publicData);
 const router = useRouter();
 
-const date = ref([dayjs().subtract(7, 'day').format('YYYY-MM-DD'), dayjs().subtract(1, 'day').format('YYYY-MM-DD')]);
+const date = ref([dateRange.value[0], dateRange.value[1]]);
 const { tableData, total, currentPage, pageSize, handlePageChange } = usePagination(fetchTableData);
 const marketplaceSelect = ref(marketplaceIdEnum[0].value); // 当前只有美国区 默认第一个为美国
 const marketplaceOptions = marketplaceIdEnum;
@@ -124,7 +127,7 @@ function handleJump() {
       </div>
     </el-divider>
   </div>
-  <el-card class="mx-3 mb-2.5" v-loading="tableLoading" style="border: none;">
+  <el-card class="mx-3 mb-2.5" v-loading="tableLoading" style="border: none">
     <!-- table筛选栏 -->
     <div class="flex justify-between">
       <div class="flex gap-5 flex-wrap">