Ver código fonte

✨ feat<searchTerm>: 对搜索词模块下的表格内容进行修改; 新增branView和asinView页面内容

WanGxC 10 meses atrás
pai
commit
09cf0f6d75

+ 0 - 46
src/views/searchTerm/asinView/index.vue

@@ -146,52 +146,6 @@ function calculateLastWeek() {
   const firstDay = lastDay.subtract(6, 'day'); // 一周前
   return [firstDay.format('YYYY-MM-DD'), lastDay.format('YYYY-MM-DD')];
 }
-
-// async function handleDownload() {
-//   downloadLoading.value = true;
-//   try {
-//     const body = {
-//       asin: asinInp.value,
-//       date_start: date.value[0],
-//       date_end: date.value[1],
-//       search_term: searchTermInp.value,
-//       marketplace_Ids: marketplaceSelect.value,
-//       report_type: reportTypeSelect.value,
-//     };
-//
-//     const response = await postDownload(body);
-//
-//     const blob = new Blob([response.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
-//
-//     // 创建一个临时 URL
-//     const url = window.URL.createObjectURL(blob);
-//
-//     // 创建一个临时的 <a> 元素并触发下载
-//     const link = document.createElement('a');
-//     link.href = url;
-//
-//     // 设置文件名
-//     const currentTime = dayjs().format('YYYY-MM-DD_HH_mm_ss');
-//     const filename = `TopSearchTerm_${currentTime}.xlsx`;
-//
-//     link.setAttribute('download', filename);
-//
-//     // 添加到 body, 触发点击, 然后移除
-//     document.body.appendChild(link);
-//     link.click();
-//     document.body.removeChild(link);
-//
-//     // 释放 URL 对象
-//     window.URL.revokeObjectURL(url);
-//
-//     ElMessage.success('文件下载成功');
-//   } catch (error) {
-//     console.error('==Error==:', error);
-//     ElMessage.error('文件下载失败,请重试');
-//   } finally {
-//     downloadLoading.value = false;
-//   }
-// }
 </script>
 
 <template>

+ 0 - 6
src/views/searchTerm/asinView/useColumns.ts

@@ -237,12 +237,6 @@ export const asinColumns = [
     sortable: true,
     slots: { default: 'Reporting_Date_default' }
   },
-  {
-    field: 'ASIN',
-    title: 'ASIN',
-    minWidth: 120,
-    slots: { default: 'ASIN_default' }
-  },
   {
     field: 'departmentName',
     title: '站点名',

+ 1 - 47
src/views/searchTerm/brandView/index.vue

@@ -140,52 +140,6 @@ function calculateLastWeek() {
   const firstDay = lastDay.subtract(6, 'day'); // 一周前
   return [firstDay.format('YYYY-MM-DD'), lastDay.format('YYYY-MM-DD')];
 }
-
-// async function handleDownload() {
-//   downloadLoading.value = true;
-//   try {
-//     const body = {
-//       asin: asinInp.value,
-//       date_start: date.value[0],
-//       date_end: date.value[1],
-//       search_term: searchTermInp.value,
-//       marketplace_Ids: marketplaceSelect.value,
-//       report_type: reportTypeSelect.value,
-//     };
-//
-//     const response = await postDownload(body);
-//
-//     const blob = new Blob([response.data], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
-//
-//     // 创建一个临时 URL
-//     const url = window.URL.createObjectURL(blob);
-//
-//     // 创建一个临时的 <a> 元素并触发下载
-//     const link = document.createElement('a');
-//     link.href = url;
-//
-//     // 设置文件名
-//     const currentTime = dayjs().format('YYYY-MM-DD_HH_mm_ss');
-//     const filename = `TopSearchTerm_${currentTime}.xlsx`;
-//
-//     link.setAttribute('download', filename);
-//
-//     // 添加到 body, 触发点击, 然后移除
-//     document.body.appendChild(link);
-//     link.click();
-//     document.body.removeChild(link);
-//
-//     // 释放 URL 对象
-//     window.URL.revokeObjectURL(url);
-//
-//     ElMessage.success('文件下载成功');
-//   } catch (error) {
-//     console.error('==Error==:', error);
-//     ElMessage.error('文件下载失败,请重试');
-//   } finally {
-//     downloadLoading.value = false;
-//   }
-// }
 </script>
 
 <template>
@@ -256,7 +210,7 @@ function calculateLastWeek() {
           <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" >
-                <div class="line-text font-medium">
+                <div class="line-text">
                   {{ row.clickedItemName }}
                 </div>
               </el-tooltip>

+ 1 - 1
src/views/searchTerm/topSearchTermRank/index.vue

@@ -188,7 +188,7 @@ function handleJump() {
     <!-- table -->
     <el-card shadow="never" class="mt-5">
       <div style="height: 100%; overflow: auto">
-        <el-table :data="tableData" height="795" stripe style="width: 100%">
+        <el-table :data="tableData" height="920" stripe style="width: 100%">
           <el-table-column fixed prop="searchTerm" label="搜索词" width="260">
             <template #header>
               <el-icon style="top: 2px; margin-right: 3px">

+ 1 - 1
src/views/searchTerm/topSearchTermTable/index.vue

@@ -327,7 +327,7 @@ function arraySpanMethod({ row, column, rowIndex, columnIndex }) {
     <!-- table -->
     <el-card shadow="never" class="mt-5">
       <div style="height: 100%; overflow: auto">
-        <el-table :data="tableData" :span-method="arraySpanMethod" height="795" stripe style="width: 100%">
+        <el-table :data="tableData" :span-method="arraySpanMethod" height="920" stripe style="width: 100%">
           <!-- 保持索引是1, 2, 3的顺序 不会收到合并单元格的影响 -->
           <el-table-column fixed type="index" width="50" :index="(index) => Math.floor(index / 3) + 1" />
           <el-table-column prop="searchTerm" label="搜索词" width="260">