Эх сурвалжийг харах

refactor(table): 优化表格配置和查询参数

- 调整表格列配置,增加 fixed属性以优化滚动体验
- 修改查询参数以适应新的 API要求
- 移除不必要的字段前缀,简化查询参数结构
WanGxC 7 сар өмнө
parent
commit
7d60eb9efd

+ 1 - 1
src/views/product-manage/competitor-monitor/component/DataTable.vue

@@ -98,7 +98,7 @@ async function fetchList() {
     goods__brand: queryParameter?.brand,
     goods__tag: queryParameter?.group,
     status: queryParameter?.status,
-    shop_id: queryParameter?.shop,
+    shop: queryParameter?.shop,
     asin: queryParameter?.asin,
     goods__sku: queryParameter?.sku,
     platform_number: queryParameter?.platformId,

+ 1 - 1
src/views/product-manage/product-list/component/DataTable.vue

@@ -94,7 +94,7 @@ async function fetchList() {
     status: queryParameter?.status,
     asin: queryParameter?.asin,
     sku: queryParameter?.sku,
-    shop_id: queryParameter?.shop
+    shop: queryParameter?.shop
   };
 
   await useTableData(api.getTableData, query, gridOptions);

+ 6 - 7
src/views/product-manage/product-monitor/component/DataTable.vue

@@ -86,23 +86,22 @@ onMounted(() => {
   fetchList();
 });
 
-// TODO: 删除goods
 async function fetchList() {
   gridOptions.data = [];
   gridOptions.columns = [];
 
   const query = {
     country_code: queryParameter?.country,
-    goods__brand: queryParameter?.brand,
-    goods__tag: queryParameter?.group,
+    brand: queryParameter?.brand,
+    tag: queryParameter?.group,
     status: queryParameter?.status,
     shop_id: queryParameter?.shop,
     asin: queryParameter?.asin,
-    goods__sku: queryParameter?.sku,
+    sku: queryParameter?.sku,
     platform_number: queryParameter?.platformId,
-    goods__all_ratings: queryParameter?.scoreNumber,
-    goods__all_reviews: queryParameter?.commentNumber,
-    goods__all_score: queryParameter?.displayScore
+    scoreNumber: queryParameter?.scoreNumber,
+    commentNumber: queryParameter?.commentNumber,
+    displayScore: queryParameter?.displayScore
   };
 
   await useTableData(api.getTableData, query, gridOptions);

+ 8 - 8
src/views/store-manage/Columns.ts

@@ -1,7 +1,7 @@
 export const MarketStoreColumns = [
-  { type: 'seq', title: 'No.', minWidth: 60, align: 'center' },
+  { type: 'seq', title: 'No.', width: 60, align: 'center', fixed: 'left' },
   {
-    field: 'platform_number', title: '平台编号', minWidth: 'auto', align: 'center',
+    field: 'platform_number', title: '平台编号', minWidth: 'auto', align: 'center',fixed: 'left',
     slots: { default: 'platform_number' }
   },
   {
@@ -31,8 +31,8 @@ export const MarketStoreColumns = [
 ];
 
 export const OnlineMerchandiseColumns = [
-  { type: 'seq', title: 'No.', width: 60, align: 'center' },
-  { field: 'asin', title: 'ASIN', minWidth: 'auto', align: 'center', slots: { default: 'asin' } },
+  { type: 'seq', title: 'No.', width: 60, align: 'center', fixed: 'left', },
+  { field: 'asin', title: 'ASIN', minWidth: 'auto', align: 'center', slots: { default: 'asin' }, fixed: 'left', },
   { field: 'sku', title: 'SKU', minWidth: 'auto', align: 'center', slots: { default: 'sku' } },
   { field: 'platform_number', title: '平台编号', minWidth: 'auto', align: 'center',
     slots: { default: 'platform_number' }
@@ -42,11 +42,11 @@ export const OnlineMerchandiseColumns = [
     slots: { default: 'shop_name' }
   },
   {
-    field: 'country_code', title: '国 家', minWidth: 'auto', align: 'center',
+    field: 'country_code', title: '国 家', width: 'auto', align: 'center',
     slots: { default: 'country_code' }
   },
   {
-    field: 'region', title: '站 点', minWidth: 'auto', align: 'center',
+    field: 'region', title: '站 点', width: 'auto', align: 'center',
     slots: { default: 'region' }
   },
   {
@@ -58,11 +58,11 @@ export const OnlineMerchandiseColumns = [
     slots: { default: 'fulfillment_channel' }
   },
   {
-    field: 'raw_launch_datetime', title: '上架时间', minWidth: 'auto', align: 'center',
+    field: 'raw_launch_datetime', title: '上架时间', width: 'auto', align: 'center',
     slots: { default: 'raw_launch_datetime' }
   },
   {
-    field: 'price', title: '价 格', minWidth: 'auto', align: 'center',
+    field: 'price', title: '价 格', width: 'auto', align: 'center',
     slots: { default: 'price' }
   },
   {

+ 1 - 1
src/views/store-manage/market-store/component/DataTable.vue

@@ -75,7 +75,7 @@ async function fetchList() {
   const query = {
     country_code: queryParameter?.country,
     region: queryParameter?.region,
-    name__icontains: queryParameter?.shop
+    shop: queryParameter?.shop
   };
 
   await useTableData(api.getTableData, query, gridOptions);

+ 3 - 3
src/views/store-manage/online-merchandise/component/DataTable.vue

@@ -78,11 +78,11 @@ async function fetchList() {
 
   const query = {
     asin: queryParameter?.asin,
-    sku__startswith: queryParameter?.sku,
+    sku: queryParameter?.sku,
     country_code: queryParameter?.country,
     shop_id: queryParameter?.shop,
-    shop__region: queryParameter?.region,
-    fulfillment_channel: queryParameter?.delivery,
+    region: queryParameter?.region,
+    delivery: queryParameter?.delivery,
     status: queryParameter?.status,
   };