fix: 🧩 删除缓存函数
This commit is contained in:
@@ -442,58 +442,7 @@ const tableRowClassName = ({ row }: { row: any }) => {
|
||||
// 3. 基于可见顺序的索引分配颜色(确保当前视图内严格交替)
|
||||
return visibleIndex % 2 === 0 ? "warning-row" : "success-row";
|
||||
};
|
||||
// // 新增:分组缓存管理
|
||||
// const groupCache = new Map<string, { groupIndex: number; colorClass: string }>();
|
||||
// let groupCounter = 0;
|
||||
|
||||
// // // 重置分组缓存(在表格数据变化时调用)
|
||||
// const resetGroupCache = () => {
|
||||
// groupCache.clear();
|
||||
// groupCounter = 0;
|
||||
// };
|
||||
// const tableRowClassName = ({ row }: { row: any }) => {
|
||||
// // 当isTwo为1时不应用颜色
|
||||
// if (row.isTwo === 1) {
|
||||
// return "";
|
||||
// }
|
||||
|
||||
// // 确保serialNumber和twoSerialNumber存在
|
||||
// if (!row.serialNumber || !row.twoSerialNumber) {
|
||||
// return "";
|
||||
// }
|
||||
|
||||
// // 生成唯一组标识(排序后拼接,确保A-B和B-A属于同一组)
|
||||
// const groupKey = [row.serialNumber, row.twoSerialNumber].sort().join("-");
|
||||
|
||||
// // 如果该组已处理过,直接使用缓存的颜色
|
||||
// if (groupCache.has(groupKey)) {
|
||||
// return groupCache.get(groupKey)!.colorClass;
|
||||
// }
|
||||
|
||||
// // 新组:分配组索引并确定颜色(偶数组红色,奇数组绿色)
|
||||
// const groupIndex = groupCounter++;
|
||||
// const colorClass = groupIndex % 2 === 0 ? "warning-row" : "success-row";
|
||||
|
||||
// // // 缓存该组信息
|
||||
// groupCache.set(groupKey, { groupIndex, colorClass });
|
||||
|
||||
// return colorClass;
|
||||
|
||||
// // if (row.isTwo == 1) {
|
||||
// // return "";
|
||||
// // }
|
||||
// // console.log(row, "============>");
|
||||
// // // 计算当前行所在的组(每组2行)
|
||||
// // let groupIndex = Math.floor(rowIndex / 2);
|
||||
|
||||
// // // 根据组索引的奇偶性决定使用哪种颜色
|
||||
// // if (groupIndex % 2 === 0) {
|
||||
// // return "warning-row";
|
||||
// // } else {
|
||||
// // return "success-row";
|
||||
// // }
|
||||
// // return "";
|
||||
// };
|
||||
// 删除文件
|
||||
const handleRemoveFiles = () => {
|
||||
datas.uploadProgress = "";
|
||||
|
||||
Reference in New Issue
Block a user