|
@@ -52,8 +52,9 @@ emitter.on('TopFilter', (value: any) => {
|
|
|
const profile = <Ref>inject('profile')
|
|
|
const activeName = ref('search')
|
|
|
const searchInput = ref('')
|
|
|
-const options = <any>ref([])
|
|
|
+const options = ref<{ productlineId: number; productlineName: string }[]>([])
|
|
|
const textarea = ref('')
|
|
|
+const activeNames = ref([])
|
|
|
const productLineSelect = ref('')
|
|
|
// 用于存储从 PopoverFilterTable 组件传来的数据
|
|
|
const receiveData = ref([])
|
|
@@ -61,8 +62,9 @@ const receiveData = ref([])
|
|
|
const parentAsinsSet = ref(new Set<string>())
|
|
|
|
|
|
// 根据 parentAsin 对 receiveData 数据进行分组
|
|
|
-function groupByParentAsin(receiveData: any) {
|
|
|
- return receiveData.reduce((acc: any, item: any) => {
|
|
|
+function groupByParentAsin(receiveData: { parentAsin: string; asin: string; sku: string }[]) {
|
|
|
+ return receiveData.reduce((acc: Record<string, { parentAsin: string; asin: string; sku: string }[]>, item) => {
|
|
|
+ // acc初始化为空对象, 遍历每一项, 如果不存在 parentAsin的值, 则初始化一个空数组, 然后将parentAsin的值作为key, 添加到数组中
|
|
|
if (!acc[item.parentAsin]) {
|
|
|
acc[item.parentAsin] = []
|
|
|
}
|