Browse Source
Merge pull request #293 from flowerField/dev
Add a new API:getRangeAxis()
master
mengshukeji
5 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with
60 additions and
3 deletions
README-zh.md
README.md
docs/guide/api.md
docs/zh/guide/api.md
src/global/api.js
@ -102,7 +102,7 @@ npm run dev
```
### 打包
```
n npm run build
npm run build
```
## 合作项目
@ -107,7 +107,7 @@ npm run dev
```
### Package
```
n npm run build
npm run build
```
## Partner project
@ -714,6 +714,25 @@ Use note:
------------
### getRangeAxis()
- **Explanation** :
Returns an array of coordinate strings corresponding to the current selection. Multiple selections may exist. Each selection may be a single cell (such as A1) or a rectangular region of multiple cells (such as D9: E12)
- **Usage** :
- The current selection is"E10:E14"、"A7:B13"、"C4"、 "A3" and "C6:D9", execute
`luckysheet.getRangeAxis()`
The returned result is:
```json
["E10:E14", "A7:B13", "C4", "A3", "C6:D9"]
```
------------
### getRangeValue([setting])
- **Parameter** :
@ -702,6 +702,25 @@ Luckysheet针对常用的数据操作需求,开放了主要功能的API,开
------------
### getRangeAxis()
- **说明** :
返回对应当前选区的坐标字符串数组,可能存在多个选区。每个选区可能是单个单元格(如 A1)或多个单元格组成的矩形区域(如 D9:E12)
- **示例** :
- 当前选区为"E10:E14"、"A7:B13"、"C4"、 "A3"和"C6:D9",执行
`luckysheet.getRangeAxis()`
则返回结果为:
```json
["E10:E14", "A7:B13", "C4", "A3", "C6:D9"]
```
------------
### getRangeValue([setting])
- **参数** :
@ -38,7 +38,7 @@ import controlHistory from '../controllers/controlHistory';
import { zoomRefreshView , zoomNumberDomBind } from '../controllers/zoom' ;
import dataVerificationCtrl from "../controllers/dataVerificationCtrl" ;
import dayjs from "dayjs" ;
import { getRangetxt } from '../methods/get' ;
const IDCardReg = /^\d{6}(18|19|20)?\d{2}(0[1-9]|1[12])(0[1-9]|[12]\d|3[01])\d{3}(\d|X)$/i ;
/ * *
@ -1470,6 +1470,25 @@ export function getRange() {
return result ;
}
/ * *
* 返回对应当前选区的坐标字符串数组 , 可能存在多个选区 。
* 每个选区可能是单个单元格 ( 如 A1 ) 或多个单元格组成的矩形区域 ( 如 D9 : E12 )
* @ returns { Array }
* /
export function getRangeAxis ( ) {
let result = [ ] ;
let rangeArr = Store . luckysheet_select_save ;
let sheetIndex = Store . currentSheetIndex ;
rangeArr . forEach ( ele => {
let axisText = getRangetxt ( sheetIndex , { column : ele . column , row : ele . row } ) ;
result . push ( axisText ) ;
} )
return result ;
}
/ * *
* 返回指定工作表指定范围的单元格二维数组数据 , 每个单元格为一个对象
* @ param { Object } options 可选参数