Browse Source

docs(config): config

config,readme
master
lrz 5 years ago
parent
commit
552e37d221
  1. 16
      README-zh.md
  2. 17
      README.md
  3. 8
      docs/guide/data.md
  4. 2
      docs/zh/guide/README.md
  5. 43
      docs/zh/guide/config.md
  6. 190
      docs/zh/guide/operate.md
  7. 532
      docs/zh/guide/sheet.md
  8. 2
      src/controllers/server.js

16
README-zh.md

@ -150,11 +150,17 @@ npm run build
``` ```
## 加入共建 ## 加入共建
如果你想为 Luckysheet 实现一个重要功能,需要先撰写 RFC 文档,按照Luckysheet的 [RFC](https://github.com/mengshukeji/Luckysheet-rfcs) 机制进行操作,在经过社区讨论完善后才可以进行代码的提交。 1. 任何疑问或者建议,欢迎提交[Issues](https://github.com/mengshukeji/Luckysheet/issues/new/choose)
2. 如果您想为 Luckysheet 实现一个重要功能,需要先撰写 RFC 文档,按照Luckysheet的 [RFC](https://github.com/mengshukeji/Luckysheet-rfcs) 机制进行操作,在经过社区讨论完善后才可以进行代码的提交。
## 联系 3. 如果您对Luckysheet感兴趣,非常欢迎加入开发组,一起来完善这个插件(下方扫码添加小编微信备注:共建),有4类任务可以认领
- 欢迎提交 PR 或者 [Issues](https://github.com/mengshukeji/Luckysheet/issues/new/choose) - BUG修复
- Email: mengshu@office2.cn - 新功能添加
- 文档
- 推广
您将收获:
- Luckysheet官方readme文档贡献者链接
- 参与大型开源项目,技术和视野提升
## 交流 ## 交流

17
README.md

@ -154,13 +154,20 @@ Create a table
}) })
</script> </script>
``` ```
## Co-construction
If you want to implement an important function for Luckysheet, you need to write an RFC document first, follow Luckysheet's [RFC](https://github.com/mengshukeji/Luckysheet-rfcs) to operate, and submit the code after community discussion and improvement. ## Co-construction
## Contact 1. Any questions or suggestions are welcome to submit [Issues](https://github.com/mengshukeji/Luckysheet/issues/new/choose)
- Welcome to submit PR or [Issues](https://github.com/mengshukeji/Luckysheet/issues/new/choose) 2. If you want to implement an important function for Luckysheet, you need to write an RFC document first, follow Luckysheet's [RFC](https://github.com/mengshukeji/Luckysheet-rfcs) mechanism to operate, and only after community discussion and improvement, you can submit the code.
- Email: mengshu@office2.cn 3. If you are interested in Luckysheet, you are very welcome to join the development team to improve this plugin together (Email: alexads@foxmail.com), there are 4 types of tasks that can be claimed
- BUG
- New features
- Documentation
- Popularize
You will gain:
- Luckysheet official readme document contributor link
- Participate in large open source projects, improve technology and vision
## Communication ## Communication

8
docs/guide/data.md

@ -26,7 +26,7 @@
"rowlen":{}, //Table row height "rowlen":{}, //Table row height
"columnlen":{}, //Table column width "columnlen":{}, //Table column width
"rowhidden":{}, //hidden rows "rowhidden":{}, //hidden rows
"columnhidden":{}, //hidden columns "colhidden":{}, //hidden columns
"borderInfo":{}, //borders "borderInfo":{}, //borders
}, },
"celldata": [], //initialize the cell data used "celldata": [], //initialize the cell data used
@ -204,15 +204,15 @@
} }
``` ```
### config.columnhidden ### config.colhidden
- Type:Object - Type:Object
- Default:{} - Default:{}
- Usage:Hidden column information, Columns:`columnhidden[Columns]: 0`, - Usage:Hidden column information, Columns:`colhidden[Columns]: 0`,
`key` specify the number of columns,`value` is always `0` `key` specify the number of columns,`value` is always `0`
- example: - example:
```js ```js
"columnhidden": { "colhidden": {
"30": 0, "30": 0,
"31": 0 "31": 0
} }

2
docs/zh/guide/README.md

@ -171,7 +171,7 @@ luckysheetfile = [ {sheet1设置}, {sheet2设置}, {sheet3设置} ]`
"rowlen":{}, //表格行高 "rowlen":{}, //表格行高
"columnlen":{}, //表格列宽 "columnlen":{}, //表格列宽
"rowhidden":{}, //隐藏行 "rowhidden":{}, //隐藏行
"columnhidden":{}, //隐藏列 "colhidden":{}, //隐藏列
"borderInfo":{}, //边框 "borderInfo":{}, //边框
}, },
"celldata": [], //初始化使用的单元格数据 "celldata": [], //初始化使用的单元格数据

43
docs/zh/guide/config.md

@ -395,7 +395,7 @@ Luckysheet开放了更细致的自定义配置选项,分别有
------------ ------------
## 钩子函数 ## 钩子函数(TODO)
钩子函数应用于二次开发时,会在各个常用鼠标或者键盘操作时植入钩子,调用开发者传入的函数,起到扩展Luckysheet功能的作用。 钩子函数应用于二次开发时,会在各个常用鼠标或者键盘操作时植入钩子,调用开发者传入的函数,起到扩展Luckysheet功能的作用。
@ -416,66 +416,107 @@ Luckysheet开放了更细致的自定义配置选项,分别有
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:点击单元格前触发,即在点击单元格的时候,最先触发这个方法 - 作用:点击单元格前触发,即在点击单元格的时候,最先触发这个方法
- 参数:
- {Number} [r]: 单元格所在行数
- {Number} [c]: 单元格所在列数
- {Object} [v]: 单元格对象
------------ ------------
### cellClicked ### cellClicked
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:点击单元格后触发,即在点击单元格的时候,最后触发这个方法 - 作用:点击单元格后触发,即在点击单元格的时候,最后触发这个方法
- 参数:
- {Number} [r]: 单元格所在行数
- {Number} [c]: 单元格所在列数
- {Object} [v]: 单元格对象
------------ ------------
### cellEditBefore ### cellEditBefore
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:双击单元格后触发,即在双击单元格编辑内容的时候,最先触发这个方法 - 作用:双击单元格后触发,即在双击单元格编辑内容的时候,最先触发这个方法
- 参数:
- {Number} [r]: 单元格所在行数
- {Number} [c]: 单元格所在列数
- {Object} [v]: 单元格对象
------------ ------------
### cellEdited ### cellEdited
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:双击单元格后触发,即在双击单元格编辑内容的时候,最后触发这个方法 - 作用:双击单元格后触发,即在双击单元格编辑内容的时候,最后触发这个方法
- 参数:
- {Number} [r]: 单元格所在行数
- {Number} [c]: 单元格所在列数
- {Object} [oldV]: 修改前单元格对象
- {Object} [newV]: 修改后单元格对象
------------ ------------
### sheetClickBefore ### sheetClickBefore
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:点击sheet页前触发 - 作用:点击sheet页前触发
- 参数:
- {Number} [i]: sheet页的index
- {Object} [sheet]: sheet页的配置
------------ ------------
### sheetClicked ### sheetClicked
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:点击sheet页后触发 - 作用:点击sheet页后触发
- 参数:
- {Number} [i]: sheet页的index
- {Object} [sheet]: sheet页的配置
------------ ------------
### workbookCreateBefore ### workbookCreateBefore
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:表格创建之前触发。旧的钩子函数叫做`beforeCreateDom` - 作用:表格创建之前触发。旧的钩子函数叫做`beforeCreateDom`
- 参数:
- {Object} [book]: 整个工作簿的配置(options)
------------ ------------
### workbookCreated ### workbookCreated
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:表格创建之后触发 - 作用:表格创建之后触发
- 参数:
- {Object} [book]: 整个工作簿的配置(options)
------------ ------------
### workbookUpdated ### workbookUpdated
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:表格创建之后触发 - 作用:表格创建之后触发
- 参数:
- {Object} [book]: 整个工作簿的配置(options)
------------ ------------
### workbookDestroyBefore ### workbookDestroyBefore
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:表格创建之后触发 - 作用:表格创建之后触发
- 参数:
- {Object} [book]: 整个工作簿的配置(options)
------------ ------------
### workbookDestroyed ### workbookDestroyed
- 类型:Function - 类型:Function
- 默认值:null - 默认值:null
- 作用:表格创建之后触发 - 作用:表格创建之后触发
- 参数:
- {Object} [book]: 整个工作簿的配置(options)
------------
### updated
- 类型:Function
- 默认值:null
- 作用:每次操作更新后执行的方法,即客户端每执行一次表格操作,Luckysheet将这次操作存到历史记录中后触发,撤销时因为也算一次操作,当然也会触发此钩子函数。
- 参数:
- {Object} [operate]: 本次操作的历史记录信息,根据不同的操作,会有不同的历史记录,参考源码 [历史记录](https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/controlHistory.js)
------------ ------------
### fireMousedown ### fireMousedown

190
docs/zh/guide/operate.md

@ -8,6 +8,8 @@
以下为所有的支持传输到后台的操作类型,并且以MongoDB做存储示例,讲解如何做前后端交互。 以下为所有的支持传输到后台的操作类型,并且以MongoDB做存储示例,讲解如何做前后端交互。
注意一点,对象中的i为当前sheet的index值,而不是order。
## 单元格刷新 ## 单元格刷新
### 单个单元格刷新 ### 单个单元格刷新
@ -33,7 +35,7 @@
|参数|说明| |参数|说明|
| ------------ | ------------ | | ------------ | ------------ |
|t|操作类型表示符号| |t|操作类型表示符号|
|i|当前sheet的索引值| |i|当前sheet的index值|
|v|单元格的值,数字、字符串或着对象格式,对象参考 [单元格属性表](/zh/guide/cell.html#基本单元格)| |v|单元格的值,数字、字符串或着对象格式,对象参考 [单元格属性表](/zh/guide/cell.html#基本单元格)|
|r|单元格的行号| |r|单元格的行号|
|c|单元格的列号| |c|单元格的列号|
@ -113,7 +115,7 @@
|t|操作类型表示符号| |t|操作类型表示符号|
|i|当前sheet的index值| |i|当前sheet的index值|
|v|需要更新value值| |v|需要更新value值|
|k|操作的key值,可选 边框:`'borderInfo'` / :行隐藏:`'rowhidden'` / 列隐藏:`'columnhidden'` / 行高:`'rowlen'` / 列宽:`'columnlen'` | |k|操作的key值,可选 边框:`'borderInfo'` / :行隐藏:`'rowhidden'` / 列隐藏:`'colhidden'` / 行高:`'rowlen'` / 列宽:`'columnlen'` |
- **后台更新** - **后台更新**
@ -1080,3 +1082,187 @@
- **后台更新** - **后台更新**
Luckysheet配置,修改title为`"Luckysheet Demo1"` Luckysheet配置,修改title为`"Luckysheet Demo1"`
## 图表(TODO)
图表操作类型有4种,分别为新增图表"add"、移动图表位置"xy"、缩放图表"wh"、修改图表配置"update"
### 新增图表
- **格式**
```json
{
"t": "c",
"i": 0,
"op":"add",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120,
"sheetIndex": "Sheet_6az6nei65t1i_1596209937084",
"needRangeShow": true,
"chartOptions": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"chartAllType": "echarts|line|default",
"rangeArray": [ { "row": [ 0, 4 ], "column": [ 0, 7 ] } ],
"rangeColCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeRowCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeConfigCheck": false,
"defaultOption": {
"title": {
"show": true,
"text": "默认标题"
}
}
},
"isShow": true
}
}
```
- **说明**
|参数|说明|
| ------------ | ------------ |
|t|操作类型表示符号|
|i|当前sheet的index值|
|op|操作选项|
|v|图表的配置信息|
- **后台更新**
更新对应sheet页中的图表设置,如果`luckysheetfile[i].chart`为null,则初始化为空数组 `[]`
```json
luckysheetfile[0].chart.push(v)
```
### 移动图表位置
- **格式**
```json
{
"t": "c",
"i": 0,
"op":"xy",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"left": 20,
"top": 120
}
}
```
- **说明**
|参数|说明|
| ------------ | ------------ |
|t|操作类型表示符号|
|i|当前sheet的index值|
|op|操作选项|
|v|图表的配置信息|
- **后台更新**
更新对应sheet页中的图表设置
```js
luckysheetfile[0].chart[v.chart_id].left = v.left;
luckysheetfile[0].chart[v.chart_id].top = v.top;
```
### 缩放图表
- **格式**
```json
{
"t": "c",
"i": 0,
"op":"wh",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120
}
}
```
- **说明**
|参数|说明|
| ------------ | ------------ |
|t|操作类型表示符号|
|i|当前sheet的index值|
|op|操作选项|
|v|图表的配置信息|
- **后台更新**
更新对应sheet页中的图表设置
```js
luckysheetfile[0].chart[v.chart_id].left = v.left;
luckysheetfile[0].chart[v.chart_id].top = v.top;
luckysheetfile[0].chart[v.chart_id].width = v.width;
luckysheetfile[0].chart[v.chart_id].height = v.height;
```
### 修改图表配置
- **格式**
```json
{
"t": "c",
"i": 0,
"op":"update",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120,
"sheetIndex": "Sheet_6az6nei65t1i_1596209937084",
"needRangeShow": true,
"chartOptions": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"chartAllType": "echarts|line|default",
"rangeArray": [ { "row": [ 0, 4 ], "column": [ 0, 7 ] } ],
"rangeColCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeRowCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeConfigCheck": false,
"defaultOption": {
"title": {
"show": true,
"text": "默认标题"
}
}
},
"isShow": true
}
}
```
- **说明**
|参数|说明|
| ------------ | ------------ |
|t|操作类型表示符号|
|i|当前sheet的index值|
|op|操作选项|
|v|图表的配置信息|
- **后台更新**
更新对应sheet页中的图表设置
```js
luckysheetfile[0].chart[v.chart_id] = v;
```

532
docs/zh/guide/sheet.md

@ -23,7 +23,7 @@ options.data示例如下:
"rowlen":{}, //表格行高 "rowlen":{}, //表格行高
"columnlen":{}, //表格列宽 "columnlen":{}, //表格列宽
"rowhidden":{}, //隐藏行 "rowhidden":{}, //隐藏行
"columnhidden":{}, //隐藏列 "colhidden":{}, //隐藏列
"borderInfo":{}, //边框 "borderInfo":{}, //边框
}, },
"scrollLeft": 0, //左右滚动条位置 "scrollLeft": 0, //左右滚动条位置
@ -40,6 +40,7 @@ options.data示例如下:
"frozen": {}, //冻结行列配置 "frozen": {}, //冻结行列配置
"chart": [], //图表配置 "chart": [], //图表配置
"allowEdit": true, //是否允许编辑 "allowEdit": true, //是否允许编辑
"zoomRatio":1, // 缩放比例
}, },
{ {
"name": "Sheet2", "name": "Sheet2",
@ -220,16 +221,16 @@ options.data示例如下:
} }
``` ```
#### config.columnhidden #### config.colhidden
- 类型:Object - 类型:Object
- 默认值:{} - 默认值:{}
- 作用:隐藏列 - 作用:隐藏列
格式为:`columnhidden[列数]: 0`, 格式为:`colhidden[列数]: 0`,
`key`指定列数即可,`value`总是为`0` `key`指定列数即可,`value`总是为`0`
- 示例: - 示例:
```js ```js
"columnhidden": { "colhidden": {
"30": 0, "30": 0,
"31": 0 "31": 0
} }
@ -384,11 +385,11 @@ options.data示例如下:
- 示例: - 示例:
```js ```js
[{ [{
"r": 6, "r": 6, //行数
"c": 3, "c": 3, //列数
"index": 1, "index": 1, //工作表id
"func": [true, 23.75, "=AVERAGE(D3:D6)"], "func": [true, 23.75, "=AVERAGE(D3:D6)"], //公式信息,包含公式计算结果和公式字符串
"color": "w", "color": "w", //"w":采用深度优先算法 "b":普通计算
"parent": null, "parent": null,
"chidren": {}, "chidren": {},
"times": 0 "times": 0
@ -422,7 +423,7 @@ options.data示例如下:
"row": [0, 12], "row": [0, 12],
"column": [0, 4] "column": [0, 4]
}, },
"pivotDataSheetIndex": 6, //The sheet index where the source data is located "pivotDataSheetIndex": 6, //源数据所在的sheet页
"column": [{ "column": [{
"index": 3, "index": 3,
"name": "subject", "name": "subject",
@ -442,7 +443,7 @@ options.data示例如下:
"nameindex": 0 "nameindex": 0
}], }],
"showType": "column", "showType": "column",
"pivotDatas": [ "pivotDatas": [ //数据透视表的源数据
["count:score", "science", "mathematics", "foreign language", "English", "total"], ["count:score", "science", "mathematics", "foreign language", "English", "total"],
["Alex", 1, 1, 1, 1, 4], ["Alex", 1, 1, 1, 1, 4],
["Joy", 1, 1, 1, 1, 4], ["Joy", 1, 1, 1, 1, 4],
@ -511,30 +512,30 @@ options.data示例如下:
- 示例: - 示例:
```js ```js
[{ [{
"cellrange": { "cellrange": { //单元格范围
"row": [1, 6], "row": [1, 6],
"column": [1, 5] "column": [1, 5]
}, },
"format": { "format": {
"head": { "head": { //页眉颜色
"fc": "#000", "fc": "#000",
"bc": "#5ed593" "bc": "#5ed593"
}, },
"one": { "one": { //第一种颜色
"fc": "#000", "fc": "#000",
"bc": "#ffffff" "bc": "#ffffff"
}, },
"two": { "two": { //第二种颜色
"fc": "#000", "fc": "#000",
"bc": "#e5fbee" "bc": "#e5fbee"
}, },
"foot": { "foot": { //页脚颜色
"fc": "#000", "fc": "#000",
"bc": "#a5efcc" "bc": "#a5efcc"
} }
}, },
"hasRowHeader": false, "hasRowHeader": false, //含有页眉
"hasRowFooter": false "hasRowFooter": false //含有页脚
}, { }, {
"cellrange": { "cellrange": {
"row": [1, 6], "row": [1, 6],
@ -571,19 +572,19 @@ options.data示例如下:
- 示例: - 示例:
```js ```js
[{ [{
"head": { "head": { //页眉颜色
"fc": "#6aa84f", "fc": "#6aa84f",
"bc": "#ffffff" "bc": "#ffffff"
}, },
"one": { "one": { //第一种颜色
"fc": "#000", "fc": "#000",
"bc": "#ffffff" "bc": "#ffffff"
}, },
"two": { "two": { //第二种颜色
"fc": "#000", "fc": "#000",
"bc": "#e5fbee" "bc": "#e5fbee"
}, },
"foot": { "foot": { //页脚颜色
"fc": "#000", "fc": "#000",
"bc": "#a5efcc" "bc": "#a5efcc"
} }
@ -604,22 +605,23 @@ options.data示例如下:
"colorGradation": 色阶 "colorGradation": 色阶
API中对此设置也有介绍[API setRangeConditionalFormat](/zh/guide/api.html)
- 示例: - 示例:
```js ```js
[ [
{ {
"type": "default", "type": "default",
"cellrange": [ "cellrange": [ //应用的范围
{ {
"row": [ 2, 7 ], "row": [ 2, 7 ],
"column": [ 2, 2 ] "column": [ 2, 2 ]
} }
], ],
"format": { "format": { //type 为 default 时 应设置文本颜色和单元格颜色
"textColor": "#000000", "textColor": "#000000",
"cellColor": "#ff0000" "cellColor": "#ff0000"
}, },
"conditionName": "betweenness", "conditionName": "betweenness", //类型
"conditionRange": [ "conditionRange": [
{ {
"row": [ 4, 4 ], "row": [ 4, 4 ],
@ -722,7 +724,474 @@ options.data示例如下:
### chart ### chart
- 类型:Array - 类型:Array
- 默认值:[] - 默认值:[]
- 作用: 图表配置 - 作用: 图表配置,参照chartMix的配置格式,允许只设置想要的图表属性,一个完整的配置案例如下。
- 示例:
:::::: details
```json
{
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120,
"sheetIndex": "Sheet_6az6nei65t1i_1596209937084",
"needRangeShow": true,
"chartOptions": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"chartAllType": "echarts|line|default",
"rangeArray": [ { "row": [ 0, 4 ], "column": [ 0, 7 ] } ],
"rangeColCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeRowCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeConfigCheck": false,
"defaultOption": {
"title": {
"show": false,
"text": "默认标题",
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"position": {
"value": "left-top",
"offsetX": 40,
"offsetY": 50
}
},
"subtitle": {
"show": false,
"text": "",
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"distance": {
"value": "auto",
"cusGap": 40
}
},
"config": {
"color": "transparent",
"fontFamily": "Sans-serif",
"grid": {
"value": "normal",
"top": 5,
"left": 10,
"right": 20,
"bottom": 10
}
},
"legend": {
"show": true,
"selectMode": "multiple",
"selected": [
{
"seriesName": "衣服",
"isShow": true
},
{
"seriesName": "食材",
"isShow": true
},
{
"seriesName": "图书",
"isShow": true
}
],
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"position": {
"value": "left-top",
"offsetX": 40,
"offsetY": 50,
"direction": "horizontal"
},
"width": {
"value": "auto",
"cusSize": 25
},
"height": {
"value": "auto",
"cusSize": 14
},
"distance": {
"value": "auto",
"cusGap": 10
},
"itemGap": 10,
"data": [
"Mon",
"Tues",
"Wed",
"Thur",
"Fri",
"Sat",
"Sun"
]
},
"tooltip": {
"show": true,
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"backgroundColor": "rgba(50,50,50,0.7)",
"triggerOn": "mousemove",
"triggerType": "item",
"axisPointer": {
"type": "line",
"style": {
"color": "#555",
"width": "normal",
"type": "solid"
}
},
"format": [
{
"seriesName": "衣服",
"prefix": "",
"suffix": "",
"ratio": 1,
"digit": "auto"
},
{
"seriesName": "食材",
"prefix": "",
"suffix": "",
"ratio": 1,
"digit": "auto"
},
{
"seriesName": "图书",
"prefix": "",
"suffix": "",
"ratio": 1,
"digit": "auto"
}
],
"position": "auto"
},
"axis": {
"axisType": "xAxisDown",
"xAxisUp": {
"show": false,
"title": {
"showTitle": false,
"text": "",
"nameGap": 15,
"rotate": 0,
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"fzPosition": "end"
},
"name": "显示X轴",
"inverse": false,
"tickLine": {
"show": true,
"width": 1,
"color": "auto"
},
"tick": {
"show": true,
"position": "outside",
"length": 5,
"width": 1,
"color": "auto"
},
"tickLabel": {
"show": true,
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"rotate": 0,
"prefix": "",
"suffix": "",
"optimize": 0,
"distance": 0,
"min": "auto",
"max": "auto",
"ratio": 1,
"digit": "auto"
},
"netLine": {
"show": false,
"width": 1,
"type": "solid",
"color": "auto",
"interval": {
"value": "auto",
"cusNumber": 0
}
},
"netArea": {
"show": false,
"interval": {
"value": "auto",
"cusNumber": 0
},
"colorOne": "auto",
"colorTwo": "auto"
},
"axisLine": {
"onZero": false
}
},
"xAxisDown": {
"show": true,
"title": {
"showTitle": false,
"text": "",
"nameGap": 15,
"rotate": 0,
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"fzPosition": "end"
},
"name": "显示X轴",
"inverse": false,
"tickLine": {
"show": true,
"width": 1,
"color": "auto"
},
"tick": {
"show": true,
"position": "outside",
"length": 5,
"width": 1,
"color": "auto"
},
"tickLabel": {
"show": true,
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"rotate": 0,
"prefix": "",
"suffix": "",
"optimize": 0,
"distance": 0,
"min": null,
"max": null,
"ratio": 1,
"digit": "auto"
},
"netLine": {
"show": false,
"width": 1,
"type": "solid",
"color": "auto",
"interval": {
"value": "auto",
"cusNumber": 0
}
},
"netArea": {
"show": false,
"interval": {
"value": "auto",
"cusNumber": 0
},
"colorOne": "auto",
"colorTwo": "auto"
},
"data": [
"BUS",
"UBER",
"TAXI",
"SUBWAY"
],
"type": "category"
},
"yAxisLeft": {
"show": true,
"title": {
"showTitle": false,
"text": "",
"nameGap": 15,
"rotate": 0,
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"fzPosition": "end"
},
"name": "显示Y轴",
"inverse": false,
"tickLine": {
"show": true,
"width": 1,
"color": "auto"
},
"tick": {
"show": true,
"position": "outside",
"length": 5,
"width": 1,
"color": "auto"
},
"tickLabel": {
"show": true,
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"rotate": 0,
"formatter": {
"prefix": "",
"suffix": "",
"ratio": 1,
"digit": "auto"
},
"split": 5,
"min": null,
"max": null,
"prefix": "",
"suffix": "",
"ratio": 1,
"digit": "auto",
"distance": 0
},
"netLine": {
"show": false,
"width": 1,
"type": "solid",
"color": "auto",
"interval": {
"value": "auto",
"cusNumber": 0
}
},
"netArea": {
"show": false,
"interval": {
"value": "auto",
"cusNumber": 0
},
"colorOne": "auto",
"colorTwo": "auto"
},
"type": "value"
},
"yAxisRight": {
"show": false,
"title": {
"showTitle": false,
"text": "",
"nameGap": 15,
"rotate": 0,
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"fzPosition": "end"
},
"name": "显示Y轴",
"inverse": false,
"tickLine": {
"show": true,
"width": 1,
"color": "auto"
},
"tick": {
"show": true,
"position": "outside",
"length": 5,
"width": 1,
"color": "auto"
},
"tickLabel": {
"show": true,
"label": {
"fontSize": 12,
"color": "#333",
"fontFamily": "sans-serif",
"fontGroup": [],
"cusFontSize": 12
},
"rotate": 0,
"formatter": {
"prefix": "",
"suffix": "",
"ratio": 1,
"digit": "auto"
},
"split": 5,
"min": null,
"max": null,
"prefix": "",
"suffix": "",
"ratio": 1,
"digit": "auto",
"distance": 0
},
"netLine": {
"show": false,
"width": 1,
"type": "solid",
"color": "auto",
"interval": {
"value": "auto",
"cusNumber": 0
}
},
"netArea": {
"show": false,
"interval": {
"value": "auto",
"cusNumber": 0
},
"colorOne": "auto",
"colorTwo": "auto"
}
}
}
}
},
"isShow": true
}
```
:::
------------ ------------
### allowEdit ### allowEdit
@ -730,6 +1199,12 @@ options.data示例如下:
- 默认值:true - 默认值:true
- 作用: 此sheet页是否允许编辑 - 作用: 此sheet页是否允许编辑
------------
### zoomRatio
- 类型:Number
- 默认值:1
- 作用: 此sheet页的缩放比例,为0~1之间的二位小数数字。比如`0.1`、`0.56`
------------ ------------
## 调试信息 ## 调试信息
@ -758,7 +1233,7 @@ Luckysheet在初始化完成之后进行的一系列操作,会将更多本地
"rowlen":{}, //表格行高 "rowlen":{}, //表格行高
"columnlen":{}, //表格列宽 "columnlen":{}, //表格列宽
"rowhidden":{}, //隐藏行 "rowhidden":{}, //隐藏行
"columnhidden":{}, //隐藏列 "colhidden":{}, //隐藏列
"borderInfo":{}, //边框 "borderInfo":{}, //边框
}, },
"scrollLeft": 0, //左右滚动条位置 "scrollLeft": 0, //左右滚动条位置
@ -775,6 +1250,9 @@ Luckysheet在初始化完成之后进行的一系列操作,会将更多本地
"frozen": {}, //冻结行列配置 "frozen": {}, //冻结行列配置
"freezen": {}, //冻结行列的渲染数据存储 "freezen": {}, //冻结行列的渲染数据存储
"chart": [], //图表配置 "chart": [], //图表配置
"allowEdit": true, //是否允许编辑
"zoomRatio":1, // 缩放比例
"visibledatarow": [], //所有行的位置 "visibledatarow": [], //所有行的位置
"visibledatacolumn": [], //所有列的位置 "visibledatacolumn": [], //所有列的位置

2
src/controllers/server.js

@ -657,7 +657,7 @@ const server = {
$("#luckysheet-sheets-item" + index).show(); $("#luckysheet-sheets-item" + index).show();
} }
} }
else if(type == "c"){ //图表操作 else if(type == "c"){ //图表操作 TODO
let op = item.op, cid = item.cid; let op = item.op, cid = item.cid;
if(op == "add"){ //插入 if(op == "add"){ //插入

Loading…
Cancel
Save