Commit 488d5e46 by wuqian

Merge branch 'master' of 47.122.114.111:qinjianhui/factory_front

parents ca5e57e0 abf185df
......@@ -286,7 +286,7 @@ const goodsColumns = computed(() => {
},
]
})
const tableData = ref<PodUsOrderListData[][]>([])
const tableData = ref<PodUsOrderListData[]>([])
const goodsData = ref<ProductList[]>([])
const searchVisible = ref(false)
const goodsLoading = ref(false)
......@@ -393,16 +393,16 @@ const submitExportForm = async () => {
idList: [],
}
// 使用函数封装映射逻辑
const mapIds = (items: PodUsOrderListData[][] | PodUsOrderListData[]) => {
// 如果是二维数组,先展平成一维数组
const flatItems = Array.isArray(items[0])
? (items as PodUsOrderListData[][]).flat()
: (items as PodUsOrderListData[])
return flatItems.map((el) => Number(el.id))
}
const mapIds = (items: PodUsOrderListData[]) =>
items
.filter(
(el): el is PodUsOrderListData & { id: string | number } =>
el.id !== undefined && el.id !== null,
)
.map((el) => Number(el.id))
switch (resourceType) {
case 0:
params.idList = mapIds(tableData.value.flat())
params.idList = mapIds(tableData.value as PodUsOrderListData[])
break
case 1:
params.idList = mapIds(selection.value)
......@@ -429,7 +429,6 @@ const submitExportForm = async () => {
exportLoading.value = false
}
}
const handleSizeChange = (pageSize: number) => {
pagination.value.pageSize = pageSize
getOrderListFn()
......@@ -1045,7 +1044,6 @@ onMounted(() => {
</span>
</template>
</ElDialog>
<ResultInfo
ref="resultRefs"
:list="resultInfo"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment