Commit 6d2b2382 authored by Bill's avatar Bill

fix: 加工嵌套表格反选问题

parent 2545bc04
......@@ -544,10 +544,10 @@ const Create = () => {
onSelectAll: async (selected: boolean, selectedRows: GetOrderProcessingOrderListResponseDetail['productDateilss'], changeRows: any[]) => {
const filterEmptyRows = changeRows.filter(Boolean)
const keys = filterEmptyRows.map((_item) => `${_item.orderId}_${_item.id}`);
const orderId = changeRows[0].orderId;
const currentOrderData = fetchedOrderData?.filter((_item) => _item.id === orderId)[0];
if (selected) {
const orderId = changeRows[0].orderId;
const currentOrderData = fetchedOrderData?.filter((_item) => _item.id === orderId)[0];
const addTempRow = orderProductselectRowRecord.concat(filterEmptyRows);
const addTempRowKeys = addTempRow.map((_item) => `${_item.orderId}_${_item.id}`)
......@@ -575,8 +575,13 @@ const Create = () => {
return;
}
} else {
setOrderProductSelectRowKeys((prev) => prev.filter((_item) => !keys.includes(_item)))
const removeKeys = orderProductSelectRowKeys.filter((_item) =>!keys.includes(_item))
// const removeRecord =
setOrderProductSelectRowKeys(removeKeys)
setOrderProductSelectRowRecord((prev) => prev.filter((_item) => !keys.includes(`${_item.orderId}_${_item.id}`)))
if (currentOrderData.productDateilss.length !== removeKeys.length) {
setProcessOrder((prev) => prev.filter((_item) => _item.id !== currentOrderData.id))
}
}
}
// onSelectAll: onSelectAll
......
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