fix: fix getValidatorStatusAsync api result (#5963)

This commit is contained in:
wpxp123456
2025-10-13 11:35:22 +08:00
committed by GitHub
parent dc3f9d3c7b
commit 9ea416e368
@@ -146,15 +146,19 @@ export class SheetsDataValidationValidatorService extends Disposable {
throw new Error(`cannot find current worksheet, sheetId: ${subUnitId}`);
}
const rules = this._sheetDataValidationModel.getRules(unitId, subUnitId);
await Promise.all(rules.map((rule) => {
return Promise.all(rule.ranges.map((range) => {
const promises: Promise<DataValidationStatus>[] = [];
Range.foreach(range, (row, col) => {
promises.push(this._validatorByCell(workbook, worksheet, row, col));
});
return promises;
}));
}));
await Promise.all(
rules.map((rule) => {
return Promise.all(
rule.ranges.map((range) => {
const promises: Promise<DataValidationStatus>[] = [];
Range.foreach(range, (row, col) => {
promises.push(this._validatorByCell(workbook, worksheet, row, col));
});
return Promise.all(promises);
})
);
})
);
return this._dataValidationCacheService.ensureCache(unitId, subUnitId);
}