liuyang 5 years ago
parent
commit
979ef81418
  1. 38
      README-zh.md
  2. 18
      README.md
  3. 2
      src/config.js
  4. 8
      src/controllers/conditionformat.js
  5. 16
      src/controllers/filter.js
  6. 5077
      src/controllers/handler.js
  7. 4
      src/controllers/menuButton.js
  8. 6
      src/controllers/selection.js
  9. 2
      src/controllers/sheetmanage.js
  10. 23
      src/core.js
  11. 4
      src/demoData/sheetComment.js
  12. 282
      src/demoData/sheetFormula.js
  13. 4
      src/demoData/sheetPivotTable.js
  14. 4
      src/demoData/sheetPivotTableData.js
  15. 790
      src/demoData/sheetSparkline.js
  16. 16
      src/function/functionImplementation.js
  17. 2
      src/global/draw.js
  18. 3
      src/index.html
  19. 3
      src/index.js
  20. 2
      src/plugins/js/jquery-ui.min.js

38
README-zh.md

@ -1,10 +1,10 @@
# Luckysheet
简体中文 | [English](./README.md)
## Introduction - 介绍
## 介绍
Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。
## Features - 特性
## 特性
1. Luckysheet支持表格设置包括冻结行列、合并单元格、筛选、排序、查询、条件格式、批注
2. 支持数据分析功能包括透视表、图表、分列、矩阵操作、内置385个计算函数
3. 支持一键截图、复制为json数据、共享编辑、excel与Luckysheet之间数据的复制粘贴
@ -15,28 +15,32 @@ Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置
![演示](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif)
## Plan - 计划
- 模块化(进行中)
- excel导入/导出
- 表单
## 计划
- 完善图表插件
- 插入图片
- 数据验证(复选框、下拉列表)
- 打印
- 单元格分段样式
- 树形菜单
- 表格功能:筛选,切片
- excel导入/导出
- 更多...
## Documentation - 文档
## 文档
[在线demo](https://mengshukeji.github.io/LuckysheetDemo/)
[在线文档](https://mengshukeji.github.io/LuckysheetDocs/)
## Requirements - 环境
## 环境
[Node.js](https://nodejs.org/en/) Version >= 6
## Installation - 安装
## 安装
```
npm install
npm install gulp -g
```
## Development - 开发
## 开发
开发
```
npm run dev
@ -49,7 +53,7 @@ npm run build
Luckysheet的核心代码为luckysheet-core.js和luckysheet-function.js,开发者看源码只需要看这两个文件即可,接下来会讨论进行模块化方案,完善这个插件.
## Usage - 用法
## 用法
#### 第一步
`npm run build`后`dist`文件夹下的所有文件复制到项目目录
@ -82,10 +86,10 @@ Luckysheet的核心代码为luckysheet-core.js和luckysheet-function.js,开发
</script>
```
## Contact - 联系
## 联系
mengshu@office2.cn
## communication - 交流
## 交流
- 添加小编微信,拉你进Luckysheet开发者交流微信群,备注:加群
@ -97,11 +101,11 @@ mengshu@office2.cn
<img src="https://minio.cnbabylon.com/public/luckysheet/QQ%E7%BE%A4%E4%BA%8C%E7%BB%B4%E7%A0%81.jpg" width = "200" alt="微信群" align="center" />
## Authors and acknowledgment - 贡献者和感谢
- Bug Pan ([@wpxp123456](https://github.com/wpxp123456))
- Dushusir ([@Dushusir](https://github.com/Dushusir))
## 贡献者和感谢
- [@wpxp123456](https://github.com/wpxp123456)
- [@Dushusir](https://github.com/Dushusir)
## License - 版权信息
## 版权信息
[MIT](http://opensource.org/licenses/MIT)
Copyright (c) 2020-present, mengshukeji

18
README.md

@ -1,4 +1,6 @@
# Luckysheet
[![Join the chat at https://gitter.im/mengshukeji/Luckysheet](https://badges.gitter.im/mengshukeji/Luckysheet.svg)](https://gitter.im/mengshukeji/Luckysheet?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
English| [简体中文](./README-zh.md)
## Introduction
@ -17,10 +19,14 @@ Luckysheet is an online spreadsheet like excel that is powerful, simple to confi
![Demo](https://minio.cnbabylon.com/public/luckysheet/LuckysheetDemo.gif)
## Plan
- modularization (in progress)
- Excel import/export
- Form
- Improve chart plugin
- Insert picture
- Data validation (checkbox, drop-down list)
- Print
- Cell segmentation style
- Tree menu
- Table function: filter, slice
- Excel import/export
- More...
## Documentation
@ -88,11 +94,11 @@ mengshu@office2.cn
## communication
coming soon!
- [Gitter](https://gitter.im/mengshukeji/Luckysheet)
## Authors and acknowledgment
- Bug Pan ([@wpxp123456](https://github.com/wpxp123456))
- Dushusir ([@Dushusir](https://github.com/Dushusir))
- [@wpxp123456](https://github.com/wpxp123456)
- [@Dushusir](https://github.com/Dushusir)
## License
[MIT](http://opensource.org/licenses/MIT)

2
src/config.js

@ -22,7 +22,7 @@ export default {
config: {}, //表格行高、列宽、合并单元格、公式等设置
fullscreenmode: true, //是否全屏模式,非全屏模式下,标记框不会强制选中。
devicePixelRatio: window.devicePixelRatio, //设备比例,比例越大表格分标率越高
allowEdit: false, //是否允许前台编辑
allowEdit: true, //是否允许前台编辑
loadUrl: "", // 配置loadUrl的地址,luckysheet会通过ajax请求表格数据,默认载入status为1的sheet数据中的所有data,其余的sheet载入除data字段外的所有字段
loadSheetUrl: "", //配置loadSheetUrl的地址,参数为gridKey(表格主键) 和 index(sheet主键合集,格式为[1,2,3]),返回的数据为sheet的data字段数据集合
gridKey: "", // 表格唯一标识符

8
src/controllers/conditionformat.js

@ -2064,6 +2064,9 @@ const conditionformat = {
$("#luckysheet-editorConditionRule-dialog #isPercent").attr("checked", "checked");
}
}
$("#luckysheet-editorConditionRule-dialog #textcolorshow").spectrum("set", ruleFormat.textColor);
$("#luckysheet-editorConditionRule-dialog #cellcolorshow").spectrum("set", ruleFormat.cellColor);
}
},
infoDialog: function(title, content){
@ -3333,8 +3336,9 @@ const conditionformat = {
dSmall = genarate(conditionValue0)[2];
}
else{
dBig = genarate(conditionValue0.toString().split("-")[1])[2];
dSmall = genarate(conditionValue0.toString().split("-")[0])[2];
let str = conditionValue0.toString().split("-");
dBig = genarate(str[1].trim())[2];
dSmall = genarate(str[0].trim())[2];
}
//循环应用范围计算
for(let r = cellrange[s].row[0]; r <= cellrange[s].row[1]; r++){

16
src/controllers/filter.js

@ -193,14 +193,14 @@ function createFilterOptions(luckysheet_filter_save, filterObj) {
$("#luckysheet-filter-selected-sheet" + Store.currentSheetIndex).remove();
$("#luckysheet-filter-options-sheet" + Store.currentSheetIndex).remove();
if(Store.luckysheet_filter_save == null || JSON.stringify(Store.luckysheet_filter_save) == "{}"){
if(luckysheet_filter_save == null || JSON.stringify(luckysheet_filter_save) == "{}"){
return;
}
let r1 = Store.luckysheet_filter_save.row[0],
r2 = Store.luckysheet_filter_save.row[1];
let c1 = Store.luckysheet_filter_save.column[0],
c2 = Store.luckysheet_filter_save.column[1];
let r1 = luckysheet_filter_save.row[0],
r2 = luckysheet_filter_save.row[1];
let c1 = luckysheet_filter_save.column[0],
c2 = luckysheet_filter_save.column[1];
let row = Store.visibledatarow[r2],
row_pre = r1 - 1 == -1 ? 0 : Store.visibledatarow[r1 - 1];
@ -254,13 +254,13 @@ function createFilterOptions(luckysheet_filter_save, filterObj) {
$("#luckysheet-rightclick-menu").hide();
$("#luckysheet-filter-menu, #luckysheet-filter-submenu").hide();
if ($("#luckysheet-cell-main").scrollTop() > Store.luckysheet_filter_save["top_move"]) {
$("#luckysheet-scrollbar-y").scrollTop(Store.luckysheet_filter_save["top_move"]);
if ($("#luckysheet-cell-main").scrollTop() > luckysheet_filter_save["top_move"]) {
$("#luckysheet-scrollbar-y").scrollTop(luckysheet_filter_save["top_move"]);
}
let file = Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)];
file.filter_select = Store.luckysheet_filter_save;
file.filter_select = luckysheet_filter_save;
}
export {

5077
src/controllers/handler.js

File diff suppressed because it is too large

4
src/controllers/menuButton.js

@ -3522,7 +3522,7 @@ const menuButton = {
}
}
if(["0", "1", "2"].indexOf(foucsStatus) == -1){
if(["0", "1", "2"].indexOf(foucsStatus.toString()) == -1){
foucsStatus = "1";
}
}
@ -3537,7 +3537,7 @@ const menuButton = {
}
}
if(["0", "1", "2"].indexOf(foucsStatus) == -1){
if(["0", "1", "2"].indexOf(foucsStatus.toString()) == -1){
foucsStatus = "2";
}
}

6
src/controllers/selection.js

@ -590,7 +590,7 @@ const selection = {
}
}
if (getObjType(data) == "object") {
if (typeof data == "object") {
if (data.length == 0) { return; };
let cfg = $.extend(true, {}, Store.config);
@ -1679,7 +1679,7 @@ const selection = {
},
matchcopy: function (data1, data2) {
let data1cache = [], data2cache = [], data1len, data2len;
if (getObjType(data1) == "object") {
if (typeof data1 == "object") {
data1cache = data1;
}
else {
@ -1691,7 +1691,7 @@ const selection = {
data1len = data1cache.length;
if (getObjType(data2) == "object") {
if (typeof data2 == "object") {
data2cache = data2;
}
else {

2
src/controllers/sheetmanage.js

@ -228,7 +228,7 @@ const sheetmanage = {
indicator = indicator.eq(0).data("index");
}
else {
indicator = luckysheetcurrentSheetitem.prevAll(":visible").eq(0).data("index");
indicator = luckysheetcurrentSheetitem.preval(":visible").eq(0).data("index");
}
$("#luckysheet-sheets-item" + indicator).addClass("luckysheet-sheets-item-active");

23
src/core.js

@ -8,9 +8,17 @@ import sheetmanage from './controllers/sheetmanage';
import luckysheetsizeauto from './controllers/resize';
import luckysheetHandler from './controllers/handler';
import {initPlugins} from './controllers/expendPlugins';
import {
getluckysheetfile,
getluckysheet_select_save,
getconfig,
getvisibledatarow,
getvisibledatacolumn
} from './methods/get';
let luckysheet = {};
//创建luckysheet表格
luckysheet.create = function (setting) {
let extendsetting = common_extend(defaultSetting, setting);
@ -101,6 +109,21 @@ luckysheet.create = function (setting) {
}
}
//获取所有表格数据
luckysheet.getluckysheetfile = getluckysheetfile;
//获取当前表格 选区
luckysheet.getluckysheet_select_save = getluckysheet_select_save;
//获取当前表格 config配置
luckysheet.getconfig = getconfig;
//获取当前表格 行高数据
luckysheet.getvisibledatarow = getvisibledatarow;
//获取当前表格 列宽数据
luckysheet.getvisibledatacolumn = getvisibledatacolumn;
export {
luckysheet
}

4
src/demoData/sheetComment.js

@ -6,7 +6,7 @@ const sheetComment = {
"2": 102
}
},
"index": "4",
"index": "5",
"chart": [{
"sheetIndex": "0",
"dataSheetIndex": "0",
@ -20,7 +20,7 @@ const sheetComment = {
"myTop": "11"
}],
"status": "0",
"order": "4",
"order": "5",
"column": 18,
"row": 36,
"celldata": [{

282
src/demoData/sheetFormula.js

@ -6928,6 +6928,288 @@ const sheetFormula = {
"c": 10,
"v": {}
}],
"calcChain":[
{
"r": 6,
"c": 3,
"index": 1,
"func": [
true,
23.75,
"=AVERAGE(D3:D6)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 7,
"c": 3,
"index": 1,
"func": [
true,
30,
"=MAX(D3:D6)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 8,
"c": 3,
"index": 1,
"func": [
true,
17,
"=MIN(D3:D6)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 5,
"c": 9,
"index": 1,
"func": [
true,
"J2",
"=INDIRECT(\"I2\")"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 6,
"c": 9,
"index": 1,
"func": [
true,
1,
"=INDIRECT(I2)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 7,
"c": 9,
"index": 1,
"func": [
true,
"I",
"=INDIRECT(\"I\"&(1+2))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 8,
"c": 9,
"index": 1,
"func": [
true,
1,
"=INDIRECT(I4&J3)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 9,
"c": 9,
"index": 1,
"func": [
true,
"#REF!",
"=INDIRECT(\"Formula!\"&I2)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 10,
"c": 9,
"index": 1,
"func": [
true,
"#REF!",
"=INDIRECT(\"Formula!I2\")"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 14,
"c": 7,
"index": 1,
"func": [
true,
207,
"=SUBTOTAL(9,OFFSET($D$15,ROW($D$15:$D$18)-ROW($D$15),1,3))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 15,
"c": 7,
"index": 1,
"func": [
true,
182,
"=SUBTOTAL(9,OFFSET(E15,ROW(E15:E18)-ROW(E15),1,3))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 16,
"c": 7,
"index": 1,
"func": [
true,
152,
"=SUBTOTAL(9,OFFSET(F15,ROW(F15:F18)-ROW(F15),1,3))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 17,
"c": 7,
"index": 1,
"func": [
true,
541,
"=SUBTOTAL(9,OFFSET(G15,ROW(G15:G18)-ROW(G15),1,3))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 22,
"c": 8,
"index": 1,
"func": [
true,
"#NAME?",
"=INDEX(D21:D25,MATCH(TRUE,ISNA(MATCH(D21:D25,C21:C27,0)),0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 23,
"c": 8,
"index": 1,
"func": [
true,
"#NAME?",
"=INDEX(D21:D25,MATCH(TRUE,ISNA(MATCH(D21:D25,C21:C27,0)),0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 38,
"c": 6,
"index": 1,
"func": [
true,
1,
"=SUM(IF((C31:C39=\"Fax\")+(D31:D39=\"Jones\")<>2,1,0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 30,
"c": 6,
"index": 1,
"func": [
true,
"#NAME?",
"=SUM((C31:C39=\"Fax\")*(D31:D39=\"Brown\")*(E31:E39))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 32,
"c": 6,
"index": 1,
"func": [
true,
"#NAME?",
"=SUM((C31:C39=\"Fax\")*(D31:D39=\"Brown\"))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 34,
"c": 6,
"index": 1,
"func": [
true,
1,
"=SUM(IF((C31:C39=\"Fax\")+(D31:D39=\"Jones\"),1,0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 36,
"c": 6,
"index": 1,
"func": [
true,
1,
"=SUM(IF(MOD((C31:C39=\"Fax\")+(D31:D39=\"Jones\"),2),1,0))"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
}
],
"visibledatarow": [],
"visibledatacolumn": [],
"rowsplit": [],

4
src/demoData/sheetPivotTable.js

@ -2,7 +2,7 @@ const sheetPivotTable = {
"name": "PivotTable",
"color": "",
"config": {},
"index": "6",
"index": "7",
"chart": [{
"sheetIndex": "0",
"dataSheetIndex": "0",
@ -16,7 +16,7 @@ const sheetPivotTable = {
"myTop": "11"
}],
"status": "0",
"order": "6",
"order": "7",
"column": 18,
"row": 36,
"celldata": [{

4
src/demoData/sheetPivotTableData.js

@ -4,7 +4,7 @@ const sheetPivotTableData = {
"config": {
"merge": {}
},
"index": "5",
"index": "6",
"chart": [{
"sheetIndex": "0",
"dataSheetIndex": "0",
@ -18,7 +18,7 @@ const sheetPivotTableData = {
"myTop": "11"
}],
"status": "0",
"order": "5",
"order": "6",
"hide": 1,
"column": 18,
"row": 36,

790
src/demoData/sheetSparkline.js

@ -0,0 +1,790 @@
const sheetSparkline = {
"name": "Sparkline",
"color": "",
"config": {
"merge": {
"1_2": {
"r": 1,
"c": 2,
"rs": 1,
"cs": 2
},
"1_4": {
"r": 1,
"c": 4,
"rs": 1,
"cs": 2
},
"0_0": {
"r": 0,
"c": 0,
"rs": 1,
"cs": 6
},
"2_2": {
"r": 2,
"c": 2,
"rs": 3,
"cs": 2
},
"2_4": {
"r": 2,
"c": 4,
"rs": 3,
"cs": 2
}
},
"rowlen": {
"0": 25
},
"columlen": {
"0": 101
}
},
"index": "4",
"chart": [
{
"sheetIndex": "0",
"dataSheetIndex": "0",
"chartType": "column",
"row": "[1,3]",
"column": "[3,3]",
"chartStyle": "default",
"myWidth": "480",
"myHeight": "288",
"myLeft": "67",
"myTop": "11"
}
],
"status": "0",
"order": "4",
"column": 18,
"row": 36,
"celldata": [
{
"r": 0,
"c": 0,
"v": {
"v": "The company revenue in 2014",
"ct": {
"fa": "General",
"t": "g"
},
"m": "The company revenue in 2014",
"mc": {
"r": 0,
"c": 0,
"rs": 1,
"cs": 6
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 1,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 2,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 3,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 4,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 0,
"c": 5,
"v": {
"mc": {
"r": 0,
"c": 0
},
"fs": "14",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 0,
"v": {
"m": "Month",
"ct": {
"fa": "General",
"t": "g"
},
"v": "Month",
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 1,
"v": {
"m": "Revenue",
"ct": {
"fa": "General",
"t": "g"
},
"v": "Revenue",
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 2,
"v": {
"m": "Diagram 1",
"ct": {
"fa": "General",
"t": "g"
},
"v": "Diagram 1",
"mc": {
"r": 1,
"c": 2,
"rs": 1,
"cs": 2
},
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 3,
"v": {
"mc": {
"r": 1,
"c": 2
},
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 4,
"v": {
"m": "Diagram 2",
"ct": {
"fa": "General",
"t": "g"
},
"v": "Diagram 2",
"mc": {
"r": 1,
"c": 4,
"rs": 1,
"cs": 2
},
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 1,
"c": 5,
"v": {
"mc": {
"r": 1,
"c": 4
},
"bg": "#f1c232",
"fc": "#ffffff",
"ht": "0",
"vt": "0"
}
},
{
"r": 2,
"c": 0,
"v": {
"m": "2014-02-01",
"ct": {
"fa": "yyyy-MM-dd",
"t": "d"
},
"v": 41671
}
},
{
"r": 2,
"c": 1,
"v": {
"v": 30,
"ct": {
"fa": "General",
"t": "n"
},
"m": "30",
"ht": "0",
"vt": "0"
}
},
{
"r": 2,
"c": 2,
"v": {
"mc": {
"r": 2,
"c": 2,
"rs": 3,
"cs": 2
},
"f": "=LINESPLINES(B3:B5,'pink',4,'avg','yellow','red','green',3)",
"spl": {
"shapes": {
"0": {
"id": 0,
"type": "Shape",
"args": [
0,
[
[
0,
20
],
[
0,
20
],
[
72,
51
],
[
144,
3
]
],
"pink",
null,
4
]
},
"1": {
"id": 1,
"type": "Rect",
"args": [
1,
0,
null,
144,
null,
null,
"yellow"
]
},
"2": {
"id": 2,
"type": "Circle",
"args": [
2,
72,
51,
3,
null,
"green",
null
]
},
"3": {
"id": 3,
"type": "Circle",
"args": [
3,
144,
3,
3,
null,
"red",
null
]
}
},
"shapeseq": [
0,
1,
2,
3
],
"offsetX": 0,
"offsetY": 5,
"pixelWidth": 147,
"pixelHeight": 55
}
}
},
{
"r": 2,
"c": 3,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 2,
"c": 4,
"v": {
"mc": {
"r": 2,
"c": 4,
"rs": 3,
"cs": 2
},
"f": "=COLUMNSPLINES(B3:B5,35,'red','green','auto','brown')",
"spl": {
"shapes": {
"0": {
"id": 0,
"type": "Rect",
"args": [
0,
98,
1,
13,
28,
"red",
"red"
]
},
"1": {
"id": 1,
"type": "Rect",
"args": [
1,
49,
30,
13,
20,
"green",
"green"
]
},
"2": {
"id": 2,
"type": "Rect",
"args": [
2,
0,
20,
13,
9,
"brown",
"brown"
]
}
},
"shapeseq": [
0,
1,
2
],
"offsetX": 0,
"offsetY": 0,
"pixelWidth": 147,
"pixelHeight": 60
}
}
},
{
"r": 2,
"c": 5,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
},
{
"r": 3,
"c": 0,
"v": {
"m": "2014-03-01",
"ct": {
"fa": "yyyy-MM-dd",
"t": "d"
},
"v": 41699
}
},
{
"r": 3,
"c": 1,
"v": {
"v": -60,
"ct": {
"fa": "General",
"t": "n"
},
"m": "-60",
"ht": "0",
"vt": "0"
}
},
{
"r": 3,
"c": 2,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 3,
"c": 3,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 3,
"c": 4,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
},
{
"r": 3,
"c": 5,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
},
{
"r": 4,
"c": 0,
"v": {
"m": "2014-04-01",
"ct": {
"fa": "yyyy-MM-dd",
"t": "d"
},
"v": 41730
}
},
{
"r": 4,
"c": 1,
"v": {
"v": 80,
"ct": {
"fa": "General",
"t": "n"
},
"m": "80",
"ht": "0",
"vt": "0"
}
},
{
"r": 4,
"c": 2,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 4,
"c": 3,
"v": {
"mc": {
"r": 2,
"c": 2
}
}
},
{
"r": 4,
"c": 4,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
},
{
"r": 4,
"c": 5,
"v": {
"mc": {
"r": 2,
"c": 4
}
}
}
],
"visibledatarow": [
26,
46,
66,
86,
106,
126,
146,
166,
186,
206,
226,
246,
266,
286,
306,
326,
346,
366,
386,
406,
426,
446,
466,
486,
506,
526,
546,
566,
586,
606,
626,
646,
666,
686,
706,
726,
746,
766,
786,
806,
826,
846,
866,
886,
906,
926,
946,
966,
986,
1006,
1026,
1046,
1066,
1086,
1106,
1126,
1146,
1166,
1186,
1206,
1226,
1246,
1266,
1286,
1306,
1326,
1346,
1366,
1386,
1406,
1426,
1446,
1466,
1486,
1506,
1526,
1546,
1566,
1586,
1606,
1626,
1646,
1666,
1686
],
"visibledatacolumn": [
102,
176,
250,
324,
398,
472,
546,
620,
694,
768,
842,
916,
990,
1064,
1138,
1212,
1286,
1360,
1434,
1508,
1582,
1656,
1730,
1804,
1878,
1952,
2026,
2100,
2174,
2248,
2322,
2396,
2470,
2544,
2618,
2692,
2766,
2840,
2914,
2988,
3062,
3136,
3210,
3284,
3358,
3432,
3506,
3580,
3654,
3728,
3802,
3876,
3950,
4024,
4098,
4172,
4246,
4320,
4394,
4468
],
"rowsplit": [],
"ch_width": 4748,
"rh_height": 1790,
"luckysheet_select_save": [
{
"row": [
0,
0
],
"column": [
0,
0
]
}
],
"luckysheet_selection_range": [],
"scrollLeft": 0,
"scrollTop": 0,
"calcChain": [
{
"r": 2,
"c": 2,
"index": "4",
"func": [
true,
"",
"=LINESPLINES(B3:B5,'pink',4,'avg','yellow','red','green',3)"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
},
{
"r": 2,
"c": 4,
"index": "4",
"func": [
true,
"",
"=COLUMNSPLINES(B3:B5,35,'red','green','auto','brown')"
],
"color": "w",
"parent": null,
"chidren": {},
"times": 0
}
]
}
export default sheetSparkline;

16
src/function/functionImplementation.js

@ -10301,11 +10301,9 @@ const functionImplementation = {
//计算
if(A1){
var reg = /^(([a-zA-Z]+)|([$][a-zA-Z]+))(([0-9]+)|([$][0-9]+))$/g;
if(reg.test(ref_text)){
var row = parseInt(ref_text.replace(/[^0-9]/g, "")) - 1;
var col = ABCatNum(ref_text.replace(/[^A-Za-z]/g, ""));
if(formula.iscelldata(ref_text)){
let cellrange = formula.getcellrange(ref_text);
let row = cellrange.row[0], col = cellrange.column[0];
if(row < 0 || row >= Store.flowdata.length || col < 0 || col >= Store.flowdata[0].length){
return formula.error.r;
@ -10322,11 +10320,9 @@ const functionImplementation = {
}
}
else{
var reg = /^[R][0-9]+[C][0-9]+$/g;
if(reg.test(ref_text)){
var row = parseInt(ref_text.split("R")[1].split("C")[0]);
var col = parseInt(ref_text.split("R")[1].split("C")[1]);
if(formula.iscelldata(ref_text)){
let cellrange = formula.getcellrange(ref_text);
let row = cellrange.row[0], col = cellrange.column[0];
if(row < 0 || row >= Store.flowdata.length || col < 0 || col >= Store.flowdata[0].length){
return formula.error.r;

2
src/global/draw.js

@ -833,7 +833,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
//水平对齐方式是 居中或居右对齐 且单元格宽度小于文字宽度 (用离屏canvas渲染)
let canvasName, cellsize;
if(browser.BrowserType() != "Safari" && (canvasType == "offline" || ((horizonAlign == "0" || horizonAlign == "2") && (end_c - start_c) < textW) || ((verticalAlign == "0" || verticalAlign == "2") && (end_r - start_r) < textH))){
if(browser.BrowserType() != "Safari" && (canvasType == "offline" || ((horizonAlign == "0" || horizonAlign == "2") && (end_c - start_c) < textW) || ((end_r - start_r) < textH))){
canvasName = offlinecanvas;
canvasName.font = fontset;

3
src/index.html

@ -27,13 +27,14 @@
import sheetComment from './demoData/sheetComment.js'
import sheetPivotTableData from './demoData/sheetPivotTableData.js'
import sheetPivotTable from './demoData/sheetPivotTable.js'
import sheetSparkline from './demoData/sheetSparkline.js'
$(function () {
luckysheet.create({
container: 'luckysheet',
lang: 'en',
plugins: ['chart'],
data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable]
data: [sheetCell,sheetFormula,sheetConditionFormat,sheetTable,sheetSparkline,sheetComment,sheetPivotTableData,sheetPivotTable]
})
})

3
src/index.js

@ -1,7 +1,8 @@
import './utils/math'
import { luckysheet } from './core'
import __firefox from './utils/polyfill'
// Prevent gulp warning: 'Use of eval is strongly discouraged, as it poses security risks and may cause issues with minification'
// window.evall = window.eval;
// polyfill event in firefox
if(window.addEventListener && (navigator.userAgent.indexOf("Firefox") > 0)){
__firefox();

2
src/plugins/js/jquery-ui.min.js

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save