|
@@ -2,15 +2,21 @@
|
|
|
import { inject, reactive, ref, watch } from 'vue'
|
|
|
import CustomCell from '../CustomCell/index.vue'
|
|
|
import CustomFooterCell from '../CustomFooterCell/index.vue'
|
|
|
+import emitter from '/@/utils/emitter'
|
|
|
import { getTableDataForASIN, getTableDataForParentASIN, getTableDataForProductLine, getTableDataForSKU } from '/@/views/productCenter/productList/api'
|
|
|
import useProductlineId from '/@/views/productCenter/productList/hooks/useProductlineId'
|
|
|
import useTableColumns from '/@/views/productCenter/productList/hooks/useTableColumns'
|
|
|
-import { productLineColumns, parentAsinColumns, asinColumns, skuColumns } from '/@/views/productCenter/productList/utils/columns'
|
|
|
+import { asinColumns, parentAsinColumns, productLineColumns, skuColumns } from '/@/views/productCenter/productList/utils/columns'
|
|
|
|
|
|
const profile = <any>inject('profile')
|
|
|
const dateRange = <any>inject('dateRange')
|
|
|
const activeButton = <any>inject('activeButton')
|
|
|
|
|
|
+const searchItem = ref('')
|
|
|
+emitter.on('TopFilters-searchItem', (value: any) => {
|
|
|
+ searchItem.value = value.searchItem
|
|
|
+})
|
|
|
+
|
|
|
const isCompare = ref(true)
|
|
|
const tableLoading = ref(false)
|
|
|
|
|
@@ -42,6 +48,7 @@ const gridOptions = reactive({
|
|
|
},
|
|
|
columns: [],
|
|
|
data: [],
|
|
|
+
|
|
|
footerMethod({ columns }) {
|
|
|
// return [
|
|
|
// columns.map((column, columnIndex) => {
|
|
@@ -59,12 +66,7 @@ const gridOptions = reactive({
|
|
|
let totalValue = totalSummary[column.field]
|
|
|
let gapField = `gap${column.field.charAt(0).toUpperCase()}${column.field.slice(1)}`
|
|
|
let gapValue = totalSummary[gapField]
|
|
|
- // if (isCompare.value) {
|
|
|
- // return `${totalValue} (${gapValue >= 0 ? '+' : ''}${gapValue}%)`
|
|
|
return { totalValue, gapValue }
|
|
|
- // } else {
|
|
|
- // return totalValue
|
|
|
- // }
|
|
|
} else {
|
|
|
return '-'
|
|
|
}
|
|
@@ -82,6 +84,7 @@ async function fetchTableData(type) {
|
|
|
productlineId: productlineId.value,
|
|
|
page: tablePage.currentPage,
|
|
|
limit: tablePage.pageSize,
|
|
|
+ searchItem: searchItem.value,
|
|
|
}
|
|
|
|
|
|
// 要用引号扩住key '产品线'
|
|
@@ -119,7 +122,7 @@ function handlePageChange({ currentPage, pageSize }) {
|
|
|
fetchTableData(activeButton.value)
|
|
|
}
|
|
|
|
|
|
-watch([activeButton, productlineId, dateRange], () => {
|
|
|
+watch([activeButton, productlineId, dateRange, searchItem], () => {
|
|
|
tablePage.currentPage = 1
|
|
|
isCompare.value = true
|
|
|
fetchTableData(activeButton.value)
|