The file /home/project/src/components/warehouse/ProductList.tsx has been updated. Made 1 replacement.
Here's the result of running `cat -n` on a snippet of the edited file:
121→ exit={{ height: 0, opacity: 0 }}
122→ transition={animationConfig.transition}
123→ className="border-t border-gray-100"
124→ >
125→
126→ {Object.entries(weightGroups).map(([weight, products]) => {
127→ const weightKey = `${productName}-${weight}`;
128→ const isWeightExpanded = expandedGroups[weightKey];
129→ const hasNoWeight = weight === '__no_weight__';
130→
131→ // 如果没有克重,直接显示产品列表,不显示克重折叠卡片
132→ if (hasNoWeight) {
133→ return (
134→
135→
136→
137→
138→ | 颜色 |
139→ 产品码 |
140→ 库存 |
141→ 操作 |
142→
143→
144→
145→ {products.map(product => (
146→ onViewRecords(product)}
151→ onViewPriceHistory={() => onViewPriceHistory(product)}
152→ onViewStockHistory={() => onViewStockHistory(product)}
153→ onEdit={() => onEdit(product)}
154→ onDelete={() => onDelete(product.id)}
155→ />
156→ ))}
157→
158→
159→
160→ );
161→ }
162→
163→ return (
164→
165→
onToggleGroup(weightKey)}
167→ className="flex items-center justify-between p-3 cursor-pointer hover:bg-gray-100 transition-colors"
168→ >
169→
170→
171→ {isWeightExpanded ? : }
172→
173→
{weight}g
174→ {products[0]?.warp_weight && products[0]?.weft_weight && (
175→
经{products[0].warp_weight}+纬{products[0].weft_weight}
176→ )}
177→
({products.length}个颜色)
178→
179→
180→
181→
182→ {isWeightExpanded && (
183→
190→
191→
192→
193→ | 颜色 |
194→ 产品码 |
195→ 库存 |
196→ 操作 |
197→
198→
199→
200→ {products.map(product => (
201→ onViewRecords(product)}
206→ onViewPriceHistory={() => onViewPriceHistory(product)}
207→ onViewStockHistory={() => onViewStockHistory(product)}
208→ onEdit={() => onEdit(product)}
209→ onDelete={() => onDelete(product.id)}
210→ />
211→ ))}
212→
213→
214→
215→ )}
216→
217→
218→ );
219→ })}
220→
221→
222→ )}
223→
224→
225→ );