|
|
@@ -66,6 +66,8 @@ const query = async (pageNum: number, pageSize: number) => {
|
|
|
checkedAll: false,
|
|
|
id: item.id,
|
|
|
landName: item.landName,
|
|
|
+ layers: item.layers,
|
|
|
+ capacityAmount: item.capacityAmount,
|
|
|
checkedList: [],
|
|
|
};
|
|
|
} else {
|
|
|
@@ -73,6 +75,8 @@ const query = async (pageNum: number, pageSize: number) => {
|
|
|
const layers = Number(item?.layers || 0);
|
|
|
const capacityAmount = Number(item?.capacityAmount || 0);
|
|
|
const totalCapacity = layers * capacityAmount;
|
|
|
+ checkedItem.layers = layers;
|
|
|
+ checkedItem.capacityAmount = capacityAmount;
|
|
|
checkedItem.checkedAll = checkedItem.checkedList.length === totalCapacity;
|
|
|
}
|
|
|
});
|
|
|
@@ -138,6 +142,8 @@ const handleCheckedAllChange = (item: any, value: boolean | { value?: boolean })
|
|
|
checkeds.value[item.id] = {
|
|
|
checkedAll: checked,
|
|
|
id: item.id,
|
|
|
+ layers: item.layers,
|
|
|
+ capacityAmount: item.capacityAmount,
|
|
|
landName: item.landName,
|
|
|
checkedList: checked ? buildCheckedList(item) : [],
|
|
|
};
|
|
|
@@ -155,6 +161,8 @@ const goSelectLayersAmount = (item: any) => {
|
|
|
checkedAll: checkedList.length === Number(landItem?.layers || 0) * Number(landItem?.capacityAmount || 0),
|
|
|
id: data.id,
|
|
|
landName: landItem?.landName || '',
|
|
|
+ layers: landItem?.layers || 0,
|
|
|
+ capacityAmount: landItem?.capacityAmount || 0,
|
|
|
checkedList,
|
|
|
};
|
|
|
}
|
|
|
@@ -233,6 +241,8 @@ const handleConfirmSelection = () => {
|
|
|
const selectedData = Object.values(checkeds.value).map((item: any) => ({
|
|
|
id: item.id,
|
|
|
landName: item.landName,
|
|
|
+ layers: item.layers,
|
|
|
+ capacityAmount: item.capacityAmount,
|
|
|
checkedList: item.checkedList,
|
|
|
}));
|
|
|
console.log('确认选择的数据:', selectedData);
|
|
|
@@ -255,6 +265,8 @@ onLoad(() => {
|
|
|
checkeds.value[item.id] = {
|
|
|
id: item.id,
|
|
|
landName: item.landName,
|
|
|
+ layers: item.layers || 0,
|
|
|
+ capacityAmount: item.capacityAmount || 0,
|
|
|
checkedList: normalizeCheckedList(item.checkedList),
|
|
|
};
|
|
|
});
|