Browse Source

add api checkTheStatusOfTheSelectedCells

master
flowerField 5 years ago
parent
commit
2e22012a27
  1. 13
      docs/guide/api.md
  2. 13
      docs/zh/guide/api.md
  3. 18
      src/global/api.js

13
docs/guide/api.md

@ -2596,6 +2596,19 @@ Use note:
------------
### checkTheStatusOfTheSelectedCells(type,status)
- **Parameter**
- {String} type: type
- {String} status: Target state value
- **Explanation**
Check whether the status of all specified types of cells in the selection meets the conditions (mainly bold, italics, strikeouts, underscores, etc.).
------------
## Chart
### insertChart([setting])

13
docs/zh/guide/api.md

@ -2514,6 +2514,19 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
### checkTheStatusOfTheSelectedCells(type,status)
- **参数**
- {String} type: 类型
- {String} status: 目标状态值
- **说明**
检查选区内所有cell指定类型的状态是否满足条件(主要是粗体、斜体、删除线和下划线等等)。
------------
## 图表
### insertChart([setting])

18
src/global/api.js

@ -6666,4 +6666,22 @@ export function refreshMenuButtonFocus(data ,r,c , success){
success();
}
})
}
/**
* 检查选区内所有cell指定类型的状态是否满足条件主要是粗体斜体删除线和下划线等等
* @param {String} type 类型
* @param {String} status 目标状态值
*/
export function checkTheStatusOfTheSelectedCells(type,status){
/* 获取选区内所有的单元格-扁平后的处理 */
let cells = getRangeWithFlatten();
let flag = cells.every(({r,c})=>{
let cell = Store.flowdata[r][c];
return cell[type] == status;
})
return flag;
}
Loading…
Cancel
Save