- getAlertSetting(rowCount, cells) {
- const warningList = reportInfo.warning
- let MessageList = []
- if (warningList.length === 0) {
- return MessageList
- }
- for (let cellIndex = 0; cellIndex < cells.length; cellIndex++) {
- for (let index = 0; index < warningList.length; index++) {
- const element = warningList[index]
- const row = rowCount + cellIndex
- const col = ReportUtils.stringToNum(element.warningCol)
- const value = activeSheet.getValue(row, col)
- const conditionalFormats = activeSheet.conditionalFormats.getRules(
- row,
- col
- )
- if (conditionalFormats && conditionalFormats.length > 0) {
- for (let i = 0; i < conditionalFormats.length; i++) {
- const rule = conditionalFormats[i]
- const warningMsg = element.warningMsg
- const Message = `${row}行-${element.warningCol}列 ${warningMsg}`
- if (rule.evaluate(activeSheet, row, col, value)) {
- MessageList.push({
- isConditionMet: true,
- Message,
- row,
- col,
- value
- })
- }
- }
- }
- }
- }
- return MessageList
- },
复制代码 |