tonytonychopper123 5 years ago
parent
commit
a0610bd364
  1. 38
      README-zh.md
  2. 18
      README.md
  3. 2
      src/config.js
  4. 2
      src/controllers/alternateformat.js
  5. 8
      src/controllers/conditionformat.js
  6. 62
      src/controllers/constant.js
  7. 16
      src/controllers/filter.js
  8. 5092
      src/controllers/handler.js
  9. 112
      src/controllers/menuButton.js
  10. 273
      src/controllers/moreFormat.js
  11. 6
      src/controllers/selection.js
  12. 2
      src/controllers/sheetmanage.js
  13. 23
      src/core.js
  14. 4
      src/demoData/sheetComment.js
  15. 282
      src/demoData/sheetFormula.js
  16. 4
      src/demoData/sheetPivotTable.js
  17. 4
      src/demoData/sheetPivotTableData.js
  18. 790
      src/demoData/sheetSparkline.js
  19. 16
      src/function/functionImplementation.js
  20. 2
      src/global/draw.js
  21. 5
      src/index.html
  22. 3
      src/index.js
  23. 259
      src/locale/en.js
  24. 284
      src/locale/zh.js
  25. 2
      src/plugins/js/jquery-ui.min.js
  26. 13
      src/utils/util.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: "", // 表格唯一标识符

2
src/controllers/alternateformat.js

@ -264,7 +264,7 @@ const alternateformat = {
let _this = this;
$("#luckysheet-modal-dialog-slider-alternateformat").remove();
$("body").append(luckysheetAlternateformatHtml);
$("body").append(luckysheetAlternateformatHtml());
luckysheetsizeauto();
//关闭

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++){

62
src/controllers/constant.js

File diff suppressed because one or more lines are too long

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 {

5092
src/controllers/handler.js

File diff suppressed because it is too large

112
src/controllers/menuButton.js

@ -31,12 +31,14 @@ import { getSheetIndex, getRangetxt, getluckysheetfile } from '../methods/get';
import { setluckysheetfile } from '../methods/set';
import { replaceHtml, getObjType, rgbTohex, mouseclickposition, luckysheetfontformat } from '../utils/util';
import Store from '../store';
import locale from '../locale/locale';
import { connect } from 'tls';
const menuButton = {
"menu": '<div class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-menuButton ${subclass} luckysheet-mousedown-cancel" id="luckysheet-icon-${id}-menuButton">${item}</div>',
"item": '<div itemvalue="${value}" itemname="${name}" class="luckysheet-cols-menuitem ${sub} luckysheet-mousedown-cancel"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel" style="padding: 3px 0px 3px 1px;"><span style="margin-right:3px;width:13px;display:inline-block;" class="icon luckysheet-mousedown-cancel"></span> ${name} <span class="luckysheet-submenu-arrow luckysheet-mousedown-cancel" style="user-select: none;">${example}</span></div></div>',
"split": '<div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div>',
"color": '<div class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel luckysheet-menuButton ${sub}" id="${id}"><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel luckysheet-color-reset"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">重置颜色</div></div> <div class="luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <input type="text" class="luckysheet-color-selected" /> </div> </div> <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div> ${coloritem}</div>',
"color": '<div class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-mousedown-cancel luckysheet-menuButton ${sub}" id="${id}"><div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel luckysheet-color-reset"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">${resetColor}</div></div> <div class="luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <input type="text" class="luckysheet-color-selected" /> </div> </div> <div class="luckysheet-menuseparator luckysheet-mousedown-cancel" role="separator"></div> ${coloritem}</div>',
"coloritem": '<div class="luckysheet-cols-menuitem luckysheet-mousedown-cancel ${class}"><div class="luckysheet-cols-menuitem-content luckysheet-mousedown-cancel">${name}</div></div>',
"subcolor": '<div id="luckysheet-icon-${id}-menuButton" class="luckysheet-cols-menu luckysheet-rightgclick-menu luckysheet-rightgclick-menu-sub luckysheet-menuButton-sub luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <div class="luckysheet-mousedown-cancel"> <input type="text" class="luckysheet-color-selected" /> </div> </div></div>',
"rightclickmenu": null,
@ -380,33 +382,15 @@ const menuButton = {
//更多格式
$("#luckysheet-icon-fmt-other").click(function(){
const _locale = locale();
const locale_format = _locale.format;
const locale_defaultFmt = _locale.defaultFmt;
let menuButtonId = $(this).attr("id")+"-menuButton";
let $menuButton = $("#" + menuButtonId);
if($menuButton.length == 0){
let itemdata = [
{ "text": "自动", "value": "General", "example": "" },
{ "text": "纯文本", "value": "@", "example": "" },
{ "text": "", "value": "split", "example": "" },
{ "text": "数字", "value": "##0.00", "example": "1000.12" },
{ "text": "百分比", "value": "#0.00%", "example": "12.21%" },
{ "text": "科学计数", "value": "0.00E+00", "example": "1.01E+5" },
{ "text": "", "value": "split", "example": "" },
{ "text": "会计", "value": "¥(0.00)", "example": "¥(1200.09)" },
//{ "text": "财务", "value": "(#.####)", "example": "(1200.09)" },
{ "text": "万元", "value": "w", "example": "1亿2000万2500" },
{ "text": "货币", "value": "¥0.00", "example": "¥1200.09" },
//{ "text": "货币整数", "value": "¥####", "example": "¥1200" },
{ "text": "万元2位小数", "value": "w0.00", "example": "2万2500.55" },
{ "text": "", "value": "split", "example": "" },
{ "text": "日期", "value": "yyyy-MM-dd", "example": "2017-11-29" },
{ "text": "时间", "value": "hh:mm AM/PM", "example": "3:00 PM" },
{ "text": "时间24H", "value": "hh:mm", "example": "15:00" },
{ "text": "日期时间", "value": "yyyy-MM-dd hh:mm AM/PM", "example": "2017-11-29 3:00 PM" },
{ "text": "日期时间24H", "value": "yyyy-MM-dd hh:mm", "example": "2017-11-29 15:00" },
{ "text": "", "value": "split", "example": "" },
{ "text": "自定义格式", "value": "fmtOtherSelf", "example": "more" }
];
let itemdata = locale_defaultFmt;
let itemset = _this.createButtonMenu(itemdata);
@ -414,9 +398,9 @@ const menuButton = {
let menu = replaceHtml(_this.menu, {"id": "fmt-other", "item": itemset, "subclass": "", "sub": ""});
let subitemdata = [
{"text":"更多货币格式...", "value":"morecurrency", "example":""},
{"text":"更多日期与时间格式...", "value":"moredatetime", "example":""},
{"text":"更多数字格式...", "value":"moredigit", "example":""}
{"text":locale_format.moreCurrency+"...", "value":"morecurrency", "example":""},
{"text":locale_format.moreDateTime+"...", "value":"moredatetime", "example":""},
{"text":locale_format.moreNumber+"...", "value":"moredigit", "example":""}
];
let subitemset = _this.createButtonMenu(subitemdata);
let submenu = replaceHtml(_this.menu, {"id": "fmtOtherSelf", "item": subitemset, "subclass": "luckysheet-menuButton-sub"});
@ -469,30 +453,25 @@ const menuButton = {
$("#luckysheet-icon-font-family").click(function(){
let menuButtonId = $(this).attr("id")+"-menuButton";
let $menuButton = $("#"+menuButtonId);
if($menuButton.length == 0){
let itemdata = [
{ "value": "0", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:微软雅黑'>微软雅黑</span>", "example": "" },
{ "value": "1", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:宋体'>宋体</span>", "example": "" },
{ "value": "2", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:黑体'>黑体</span>", "example": "" },
{ "value": "3", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:楷体'>楷体</span>", "example": "" },
{ "value": "4", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:仿宋'>仿宋</span>", "example": "" },
{ "value": "5", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:新宋体'>新宋体</span>", "example": "" },
{ "value": "6", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:华文新魏'>华文新魏</span>", "example": "" },
{ "value": "7", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:华文行楷'>华文行楷</span>", "example": "" },
{ "value": "8", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:华文隶书'>华文隶书</span>", "example": "" },
{ "value": "9", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:Arial'>Arial</span>", "example": "" },
{ "value": "10", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:Times New Roman'>Times New Roman</span>", "example": "" },
{ "value": "11", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:Tahoma'>Tahoma</span>", "example": "" },
{ "value": "12", "text": "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:Verdana'>Verdana</span>", "example": "" }
];
const locale_fontarray = locale().fontarray;
let itemdata = [];
for(let a=0;a<locale_fontarray.length;a++){
let fItem = locale_fontarray[a];
let ret = {};
ret.value = a;
ret.text = "<span class='luckysheet-mousedown-cancel' style='font-size:16px;font-family:"+fItem+"'>"+fItem+"</span>";
ret.example = "";
itemdata.push(ret);
}
let itemset = _this.createButtonMenu(itemdata);
let menu = replaceHtml(_this.menu, {"id": "font-family", "item": itemset, "subclass": "", "sub": ""});
$("body").append(menu);
$menuButton = $("#"+menuButtonId).width(150);
$menuButton = $("#"+menuButtonId).width(200);
_this.focus($menuButton);
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
@ -534,14 +513,18 @@ const menuButton = {
let $menuButton = $("#"+menuButtonId);
if($menuButton.length == 0){
const _locale = locale();
const locale_toolbar = _locale.toolbar;
const locale_button = _locale.button;
const locale_alternatingColors = _locale.alternatingColors;
let itemdata = [
{"name":"交替颜色...", "id":"luckysheet-color-alternate", "example":""}
{"name":locale_toolbar.alternatingColors+"...", "id":"luckysheet-color-alternate", "example":""}
];
let itemset = _this.createButtonMenu(itemdata);
let subid = "text-color-self";
let coloritem = replaceHtml(_this.coloritem, {"class": "luckysheet-icon-alternateformat", "name": "交替颜色..."});
let menu = replaceHtml(_this.color, {"id":menuButtonId, "coloritem": coloritem, "colorself": subid, "sub": ""});
let coloritem = replaceHtml(_this.coloritem, {"class": "luckysheet-icon-alternateformat", "name": locale_toolbar.alternatingColors+"..."});
let menu = replaceHtml(_this.color, {"id":menuButtonId, "coloritem": coloritem, "colorself": subid, "sub": "","resetColor":locale_toolbar.resetColor});
$("body").append(menu);
$menuButton = $("#" + menuButtonId);
@ -558,14 +541,14 @@ const menuButton = {
showSelectionPalette: true,
maxPaletteSize: 8,
maxSelectionSize: 8,
cancelText: "取消",
chooseText: "确定颜色",
togglePaletteMoreText: "自定义",
togglePaletteLessText: "收起",
cancelText: locale_button.cancel,
chooseText: locale_button.confirm,
togglePaletteMoreText: locale_toolbar.customColor,
togglePaletteLessText: locale_toolbar.collapse,
togglePaletteOnly: true,
clearText: "清除颜色选择",
clearText: locale_toolbar.clearText,
color:"#000",
noColorSelectedText: "没有颜色被选择",
noColorSelectedText: locale_toolbar.noColorSelectedText,
localStorageKey: "spectrum.textcolor" + server.gridKey,
palette: [["#000","#444","#666","#999","#ccc","#eee","#f3f3f3","#fff"],
["#f00","#f90","#ff0","#0f0","#0ff","#00f","#90f","#f0f"],
@ -2696,8 +2679,6 @@ const menuButton = {
}
});
},
fontarray: ["微软雅黑","宋体","黑体","楷体","仿宋","新宋体","华文新魏","华文行楷","华文隶书","Arial","Times New Roman","Tahoma","Verdana"],
fontjson: {"微软雅黑":0,"microsoft yahei":0,"宋体":1,"simsun":1,"黑体":2,"simhei":2,"楷体":3,"kaiti":3,"仿宋":4,"fangsong":4,"新宋体":5,"nsimsun":5,"华文新魏":6,"stxinwei":6,"华文行楷":7,"stxingkai":7,"华文隶书":8,"stliti":8,"arial":9,"times new roman":10,"tahoma":11,"verdana":12},
getQKBorder: function(width, type, color){
let bordertype = "";
if(width.indexOf("pt") > -1){
@ -3326,6 +3307,7 @@ const menuButton = {
menuButtonFocus: function(d, r, c){
let _this = this;
let foucsList = ["bl", "it", "cl", "ff", "ht", "vt", "fs", "tb", "tr"];
const locale_fontarray = locale().fontarray;
for(let i = 0; i < foucsList.length; i++){
let attr = foucsList[i];
@ -3358,16 +3340,16 @@ const menuButton = {
else if(attr == "ff"){
let menuButtonId = "luckysheet-icon-font-family-menuButton";
let $menuButton = $("#" + menuButtonId);
let itemname = "微软雅黑", itemvalue = 0;
const locale_fontarray = locale().fontarray;
let itemname = locale_fontarray[0], itemvalue = 0;
if(foucsStatus != null){
if(isdatatypemulti(foucsStatus)["num"]){
itemvalue = parseInt(foucsStatus);
itemname = _this.fontarray[itemvalue];
itemname = locale_fontarray[itemvalue];
}
else{
itemvalue = _this.fontjson[foucsStatus];
itemname = _this.fontarray[itemvalue];
itemname = locale_fontarray[itemvalue];
}
}
@ -3540,7 +3522,7 @@ const menuButton = {
}
}
if(["0", "1", "2"].indexOf(foucsStatus) == -1){
if(["0", "1", "2"].indexOf(foucsStatus.toString()) == -1){
foucsStatus = "1";
}
}
@ -3555,7 +3537,7 @@ const menuButton = {
}
}
if(["0", "1", "2"].indexOf(foucsStatus) == -1){
if(["0", "1", "2"].indexOf(foucsStatus.toString()) == -1){
foucsStatus = "2";
}
}
@ -3974,7 +3956,9 @@ const menuButton = {
},
getTextHeightCache: {},
getTextSize: function(text, font){
let f = font || '10pt 微软雅黑';
let fontarray = locale().fontarray;
let f = font || '10pt ' + fontarray[0];
let _this = this;
if (f in _this.getTextHeightCache){
@ -4364,6 +4348,8 @@ const menuButton = {
let cf_compute = conditionformat.getComputeMap();
let checksCF = conditionformat.checksCF(r, c, cf_compute);
const locale_fontarray = locale().fontarray;
let cell = d[r][c];
for(let key in cell){
let value = _this.checkstatus(d, r, c , key);
@ -4404,7 +4390,7 @@ const menuButton = {
if(key == "ff" && value != "0"){
let f = value;
if(!isNaN(parseInt(value))){
f = _this.fontarray[parseInt(value)];
f = locale_fontarray[parseInt(value)];
}
style += "font-family: " + f + ";";
}

273
src/controllers/moreFormat.js

@ -5,6 +5,7 @@ import editor from '../global/editor';
import tooltip from '../global/tooltip';
import { isEditMode } from '../global/validate';
import Store from '../store';
import locale from '../locale/locale';
//更多格式
const luckysheetMoreFormat = {
@ -795,13 +796,275 @@ const luckysheetMoreFormat = {
createDialog: function(type){
let _this = this;
const currencyDetail = locale().currencyDetail;
const locale_format = locale().format;
const locale_button = locale().button;
this.moneyFmtList = [
{'name': currencyDetail.RMB,'pos': 'before','value': '¥'},
{'name': currencyDetail.USdollar,'pos': 'before','value': '$'},
{'name': currencyDetail.EUR,'pos': 'before','value': '€'},
{'name': currencyDetail.GBP,'pos': 'before','value': '£'},
{'name': currencyDetail.HK,'pos': 'before','value': '$'},
{'name': currencyDetail.JPY,'pos': 'before','value': '¥'},
{'name': currencyDetail.AlbanianLek,'pos': 'before','value': 'Lek'},
{'name': currencyDetail.AlgerianDinar,'pos': 'before','value': 'din'},
{'name': currencyDetail.Afghani,'pos': 'after','value': 'Af'},
{'name': currencyDetail.ArgentinePeso,'pos': 'before','value': '$'},
{'name': currencyDetail.UnitedArabEmiratesDirham,'pos': 'before','value': 'dh'},
{'name': currencyDetail.ArubanFlorin,'pos': 'before','value': 'Afl'},
{'name': currencyDetail.OmaniRial,'pos': 'before','value': 'Rial'},
{'name': currencyDetail.Azerbaijanimanat,'pos': 'before','value': '?'},
{'name': currencyDetail.EgyptianPound,'pos': 'before','value': '£'},
{'name': currencyDetail.EthiopianBirr,'pos': 'before','value': 'Birr'},
{'name': currencyDetail.AngolaKwanza,'pos': 'before','value': 'Kz'},
{'name': currencyDetail.AustralianDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.Patacas,'pos': 'before','value': 'MOP'},
{'name': currencyDetail.BarbadosDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.PapuaNewGuineaKina,'pos': 'before','value': 'PGK'},
{'name': currencyDetail.BahamianDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.PakistanRupee,'pos': 'before','value': 'Rs'},
{'name': currencyDetail.ParaguayanGuarani,'pos': 'after','value': 'Gs'},
{'name': currencyDetail.BahrainiDinar,'pos': 'before','value': 'din'},
{'name': currencyDetail.PanamanianBalboa,'pos': 'before','value': 'B/'},
{'name': currencyDetail.Brazilianreal,'pos': 'before','value': 'R$'},
{'name': currencyDetail.Belarusianruble,'pos': 'after','value': 'р'},
{'name': currencyDetail.BermudianDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.BulgarianLev,'pos': 'before','value': 'lev'},
{'name': currencyDetail.IcelandKrona,'pos': 'before','value': 'kr'},
{'name': currencyDetail.BosniaHerzegovinaConvertibleMark,'pos': 'before','value': 'KM'},
{'name': currencyDetail.PolishZloty,'pos': 'after','value': 'z?'},
{'name': currencyDetail.Boliviano,'pos': 'before','value': 'Bs'},
{'name': currencyDetail.BelizeDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.BotswanaPula,'pos': 'before','value': 'P'},
{'name': currencyDetail.NotDannuzhamu,'pos': 'before','value': 'Nu'},
{'name': currencyDetail.BurundiFranc,'pos': 'before','value': 'FBu'},
{'name': currencyDetail.NorthKoreanWon,'pos': 'before','value': '?KP'},
{'name': currencyDetail.DanishKrone,'pos': 'after','value': 'kr'},
{'name': currencyDetail.EastCaribbeanDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.DominicaPeso,'pos': 'before','value': 'RD$'},
{'name': currencyDetail.RussianRuble,'pos': 'after','value': '?'},
{'name': currencyDetail.EritreanNakfa,'pos': 'before','value': 'Nfk'},
{'name': currencyDetail.CFAfranc,'pos': 'before','value': 'CFA'},
{'name': currencyDetail.PhilippinePeso,'pos': 'before','value': '?'},
{'name': currencyDetail.FijiDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.CapeVerdeEscudo,'pos': 'before','value': 'CVE'},
{'name': currencyDetail.FalklandIslandsPound,'pos': 'before','value': '£'},
{'name': currencyDetail.GambianDalasi,'pos': 'before','value': 'GMD'},
{'name': currencyDetail.Congolesefranc,'pos': 'before','value': 'FrCD'},
{'name': currencyDetail.ColombianPeso,'pos': 'before','value': '$'},
{'name': currencyDetail.CostaRicanColon,'pos': 'before','value': '?'},
{'name': currencyDetail.CubanPeso,'pos': 'before','value': '$'},
{'name': currencyDetail.Cubanconvertiblepeso,'pos': 'before','value': '$'},
{'name': currencyDetail.GuyanaDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.KazakhstanTenge,'pos': 'before','value': '?'},
{'name': currencyDetail.Haitiangourde,'pos': 'before','value': 'HTG'},
{'name': currencyDetail.won,'pos': 'before','value': '?'},
{'name': currencyDetail.NetherlandsAntillesGuilder,'pos': 'before','value': 'NAf.'},
{'name': currencyDetail.Honduraslempiras,'pos': 'before','value': 'L'},
{'name': currencyDetail.DjiboutiFranc,'pos': 'before','value': 'Fdj'},
{'name': currencyDetail.KyrgyzstanSom,'pos': 'before','value': 'KGS'},
{'name': currencyDetail.GuineaFranc,'pos': 'before','value': 'FG'},
{'name': currencyDetail.CanadianDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.GhanaianCedi,'pos': 'before','value': 'GHS'},
{'name': currencyDetail.Cambodianriel,'pos': 'before','value': 'Riel'},
{'name': currencyDetail.CzechKoruna,'pos': 'after','value': 'K?'},
{'name': currencyDetail.ZimbabweDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.QatariRiyal,'pos': 'before','value': 'Rial'},
{'name': currencyDetail.CaymanIslandsDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.Comorianfranc,'pos': 'before','value': 'CF'},
{'name': currencyDetail.KuwaitiDinar,'pos': 'before','value': 'din'},
{'name': currencyDetail.CroatianKuna,'pos': 'before','value': 'kn'},
{'name': currencyDetail.KenyanShilling,'pos': 'before','value': 'Ksh'},
{'name': currencyDetail.LesothoLoti,'pos': 'before','value': 'LSL'},
{'name': currencyDetail.LaoKip,'pos': 'before','value': '?'},
{'name': currencyDetail.LebanesePound,'pos': 'before','value': 'L£'},
{'name': currencyDetail.Lithuanianlitas,'pos': 'before','value': 'Lt'},
{'name': currencyDetail.LibyanDinar,'pos': 'before','value': 'din'},
{'name': currencyDetail.LiberianDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.RwandaFranc,'pos': 'before','value': 'RF'},
{'name': currencyDetail.RomanianLeu,'pos': 'before','value': 'RON'},
{'name': currencyDetail.MalagasyAriary,'pos': 'before','value': 'Ar'},
{'name': currencyDetail.MaldivianRufiyaa,'pos': 'before','value': 'Rf'},
{'name': currencyDetail.MalawiKwacha,'pos': 'before','value': 'MWK'},
{'name': currencyDetail.MalaysianRinggit,'pos': 'before','value': 'RM'},
{'name': currencyDetail.MacedoniawearingDinar,'pos': 'before','value': 'din'},
{'name': currencyDetail.MauritiusRupee,'pos': 'before','value': 'MURs'},
{'name': currencyDetail.MauritanianOuguiya,'pos': 'before','value': 'MRO'},
{'name': currencyDetail.MongolianTugrik,'pos': 'before','value': '?'},
{'name': currencyDetail.BangladeshiTaka,'pos': 'before','value': '?'},
{'name': currencyDetail.PeruvianNuevoSol,'pos': 'before','value': 'S/'},
{'name': currencyDetail.MyanmarKyat,'pos': 'before','value': 'K'},
{'name': currencyDetail.MoldovanLeu,'pos': 'before','value': 'MDL'},
{'name': currencyDetail.MoroccanDirham,'pos': 'before','value': 'dh'},
{'name': currencyDetail.MozambiqueMetical,'pos': 'before','value': 'MTn'},
{'name': currencyDetail.MexicanPeso,'pos': 'before','value': '$'},
{'name': currencyDetail.NamibianDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.SouthAfricanRand,'pos': 'before','value': 'R'},
{'name': currencyDetail.SouthSudanesePound,'pos': 'before','value': '£'},
{'name': currencyDetail.NicaraguaCordoba,'pos': 'before','value': 'C$'},
{'name': currencyDetail.NepaleseRupee,'pos': 'before','value': 'Rs'},
{'name': currencyDetail.NigerianNaira,'pos': 'before','value': '?'},
{'name': currencyDetail.NorwegianKrone,'pos': 'after','value': 'kr'},
{'name': currencyDetail.GeorgianLari,'pos': 'before','value': 'GEL'},
{'name': currencyDetail.RenminbiOffshore,'pos': 'before','value': '¥'},
{'name': currencyDetail.SwedishKrona,'pos': 'after','value': 'kr'},
{'name': currencyDetail.SwissFranc,'pos': 'before','value': 'CHF'},
{'name': currencyDetail.SerbianDinar,'pos': 'before','value': 'din'},
{'name': currencyDetail.SierraLeone,'pos': 'before','value': 'SLL'},
{'name': currencyDetail.SeychellesRupee,'pos': 'before','value': 'SCR'},
{'name': currencyDetail.SaudiRiyal,'pos': 'before','value': 'Rial'},
{'name': currencyDetail.SaoTomeDobra,'pos': 'before','value': 'Db'},
{'name': currencyDetail.SaintHelenapound,'pos': 'before','value': '£'},
{'name': currencyDetail.SriLankaRupee,'pos': 'before','value': 'Rs'},
{'name': currencyDetail.SwazilandLilangeni,'pos': 'before','value': 'SZL'},
{'name': currencyDetail.SudanesePound,'pos': 'before','value': 'SDG'},
{'name': currencyDetail.Surinamesedollar,'pos': 'before','value': '$'},
{'name': currencyDetail.SolomonIslandsDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.SomaliShilling,'pos': 'before','value': 'SOS'},
{'name': currencyDetail.TajikistanSomoni,'pos': 'before','value': 'Som'},
{'name': currencyDetail.PacificFranc,'pos': 'after','value': 'FCFP'},
{'name': currencyDetail.ThaiBaht,'pos': 'before','value': '?'},
{'name': currencyDetail.TanzanianShilling,'pos': 'before','value': 'TSh'},
{'name': currencyDetail.TonganPaanga,'pos': 'before','value': 'T$'},
{'name': currencyDetail.TrinidadandTobagoDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.TunisianDinar,'pos': 'before','value': 'din'},
{'name': currencyDetail.TurkishLira,'pos': 'before','value': '?'},
{'name': currencyDetail.VanuatuVatu,'pos': 'before','value': 'VUV'},
{'name': currencyDetail.GuatemalanQuetzal,'pos': 'before','value': 'Q'},
{'name': currencyDetail.CommissionBolivar,'pos': 'before','value': 'Bs'},
{'name': currencyDetail.BruneiDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.UgandanShilling,'pos': 'before','value': 'UGX'},
{'name': currencyDetail.UkrainianHryvnia,'pos': 'before','value': 'грн.'},
{'name': currencyDetail.UruguayanPeso,'pos': 'before','value': '$'},
{'name': currencyDetail.Uzbekistansom,'pos': 'before','value': 'so?m'},
{'name': currencyDetail.WesternSamoaTala,'pos': 'before','value': 'WST'},
{'name': currencyDetail.SingaporeDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.NT,'pos': 'before','value': 'NT$'},
{'name': currencyDetail.NewZealandDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.HungarianForint,'pos': 'before','value': 'Ft'},
{'name': currencyDetail.SyrianPound,'pos': 'before','value': '£'},
{'name': currencyDetail.JamaicanDollar,'pos': 'before','value': '$'},
{'name': currencyDetail.ArmenianDram,'pos': 'before','value': 'Dram'},
{'name': currencyDetail.YemeniRial,'pos': 'before','value': 'Rial'},
{'name': currencyDetail.IraqiDinar,'pos': 'before','value': 'din'},
{'name': currencyDetail.IranianRial,'pos': 'before','value': 'Rial'},
{'name': currencyDetail.NewIsraeliShekel,'pos': 'before','value': '?'},
{'name': currencyDetail.IndianRupee,'pos': 'before','value': '?'},
{'name': currencyDetail.IndonesianRupiah,'pos': 'before','value': 'Rp'},
{'name': currencyDetail.JordanianDinar,'pos': 'before','value': 'din'},
{'name': currencyDetail.VND,'pos': 'after','value': '?'},
{'name': currencyDetail.ZambianKwacha,'pos': 'before','value': 'ZMW'},
{'name': currencyDetail.GibraltarPound,'pos': 'before','value': '£'},
{'name': currencyDetail.ChileanPeso,'pos': 'before','value': '$'},
{'name': currencyDetail.CFAFrancBEAC,'pos': 'before','value': 'FCFA'}
];
this.dateFmtList = locale().dateFmtList;
this.numFmtList = [
{
"name": "1235",
"value": "0"
},
{
"name": "1234.56",
"value": "0.00"
},
{
"name": "1,235",
"value": "#,##0"
},
{
"name": "1,234.56",
"value": "#,##0.00"
},
{
"name": "1,235",
"value": "#,##0_);(#,##0)"
},
{
"name": "1,235",
"value": "#,##0_);[Red](#,##0)"
},
{
"name": "1,234.56",
"value": "#,##0.00_);(#,##0.00)"
},
{
"name": "1,234.56",
"value": "#,##0.00_);[Red](#,##0.00)"
},
{
"name": "$1,235",
"value": "$#,##0_);($#,##0)"
},
{
"name": "$1,235",
"value": "$#,##0_);[Red]($#,##0)"
},
{
"name": "$1,234.56",
"value": "$#,##0.00_);($#,##0.00)"
},
{
"name": "$1,234.56",
"value": "$#,##0.00_);[Red]($#,##0.00)"
},
{
"name": "1234.56",
"value": "@"
},
{
"name": "123456%",
"value": "0%"
},
{
"name": "123456.00%",
"value": "0.00%"
},
{
"name": "1.23E+03",
"value": "0.00E+00"
},
{
"name": "1.2E+3",
"value": "##0.0E+0"
},
{
"name": "1234 5/9",
"value": "# ?/?"
},
{
"name": "1234 14/25",
"value": "# ??/??"
},
{
"name": "$ 1,235",
"value": '_($* #,##0_);_(...($* "-"_);_(@_)'
},
{
"name": "1,235",
"value": '_(* #,##0_);_(*..._(* "-"_);_(@_)'
},
{
"name": "$ 1,234.56",
// "value": '_($* #,##0.00_)...* "-"??_);_(@_)'
"value": '_($* #,##0.00_);_(...($* "-"_);_(@_)'
},
{
"name": "1,234.56",
"value": '_(* #,##0.00_);...* "-"??_);_(@_)'
},
]
$("#luckysheet-modal-dialog-mask").show();
$("#luckysheet-moreFormat-dialog").remove();
let title = "", content = '';
if(type == "morecurrency"){ //货币
title = "货币格式";
title = locale_format.titleCurrency;
let listHtml = '';
@ -819,14 +1082,14 @@ const luckysheetMoreFormat = {
content = '<div class="box" id="morecurrency">'+
'<div class="decimal">'+
'<label>小数位数:</label>'+
'<label>'+ locale_format.decimalPlaces +':</label>'+
'<input type="number" class="formulaInputFocus" value="2" min="0" max="9"/>'+
'</div>'+
'<div class="listbox">'+ listHtml +'</div>'+
'</div>';
}
else if(type == "moredatetime"){ //日期时间
title = "日期与时间格式";
title = locale_format.titleDateTime;
let listHtml = '';
@ -845,7 +1108,7 @@ const luckysheetMoreFormat = {
'</div>';
}
else if(type == "moredigit"){ //数字
title = "数字格式";
title = locale_format.titleNumber;
let listHtml = '';
@ -869,7 +1132,7 @@ const luckysheetMoreFormat = {
"addclass": "luckysheet-moreFormat-dialog",
"title": title,
"content": content,
"botton": '<button id="luckysheet-moreFormat-dialog-confirm" class="btn btn-primary">确定</button><button class="btn btn-default luckysheet-model-close-btn">取消</button>',
"botton": '<button id="luckysheet-moreFormat-dialog-confirm" class="btn btn-primary">'+ locale_button.confirm +'</button><button class="btn btn-default luckysheet-model-close-btn">'+ locale_button.cancel +'</button>',
"style": "z-index:100003"
}));
let $t = $("#luckysheet-moreFormat-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end(),

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;

5
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: 'zh',
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();

259
src/locale/en.js

@ -45,12 +45,24 @@ export default {
chart: 'Chart',
screenshot: 'Screenshot',
splitColumn: 'Split column',
clearText:"Clear color",
noColorSelectedText:"No color is selected",
},
alternatingColors:{
applyRange: 'Apply to range',
selectRange: 'Select a data range',
header: 'Header',
footer: 'Footer',
errorInfo:"Cannot perform this operation on multiple selection areas, please select a single area and try again",
textTitle:"Format style",
custom:"CUSTOM",
close:"close",
selectionTextColor:"Click to select text color",
selectionCellColor:"Click to select cell color",
removeColor:"Remove alternating colors",
colorShow:"color",
},
button: {
confirm: 'OK',
@ -61,30 +73,245 @@ export default {
paintFormatEnd: 'ESC key to exit',
},
format:{
auto: 'Automatic',
text: 'Plain text',
number: 'Number',
percent: 'Percent',
scientific: 'Scientific',
accounting: 'Accounting',
tenThousand: 'Ten thousand',
currency: 'Currency',
tenThousandDecimal: 'Ten thousand (2 decimal places)',
date: 'Date',
time: 'Time',
time24H: 'Time 24H',
dateTime: 'Date time',
dateTime24H: 'Date time 24 H',
customFormats: 'Custom formats',
moreCurrency: 'More currency formats',
moreDateTime: 'More date and time formats',
moreNumber: 'More number formats',
titleCurrency: 'Currency formats',
decimalPlaces: 'Decimal places',
titleDateTime: 'Date and time formats',
titleNumber: 'Number formats'
},
info:{
detailUpdate: 'New opened',
detailSave: 'Local cache restored',
row: 'row',
column: 'column'
}
},
currencyDetail:{
RMB:'RMB',
USdollar:'US dollar',
EUR:'EUR',
GBP:'GBP',
HK:'HK',
JPY:'JPY',
AlbanianLek:'Albanian Lek',
AlgerianDinar:'Algerian Dinar',
Afghani:'Afghani',
ArgentinePeso:'Argentine Peso',
UnitedArabEmiratesDirham:'United Arab Emirates Dirham',
ArubanFlorin:'Aruban Florin',
OmaniRial:'Omani Rial',
Azerbaijanimanat:'Azerbaijani manat',
EgyptianPound:'Egyptian Pound',
EthiopianBirr:'Ethiopian Birr',
AngolaKwanza:'Angola Kwanza',
AustralianDollar:'Australian Dollar',
Patacas:'Patacas',
BarbadosDollar:'Barbados Dollar',
PapuaNewGuineaKina:'Papua New Guinea Kina',
BahamianDollar:'Bahamian Dollar',
PakistanRupee:'Pakistan Rupee',
ParaguayanGuarani:'Paraguayan Guarani',
BahrainiDinar:'Bahraini Dinar',
PanamanianBalboa:'Panamanian Balboa',
Brazilianreal:'Brazilian real',
Belarusianruble:'Belarusian ruble',
BermudianDollar:'Bermudian Dollar',
BulgarianLev:'Bulgarian Lev',
IcelandKrona:'Iceland Krona',
BosniaHerzegovinaConvertibleMark:'Bosnia-Herzegovina Convertible Mark',
PolishZloty:'Polish Zloty',
Boliviano:'Boliviano',
BelizeDollar:'Belize Dollar',
BotswanaPula:'Botswana Pula',
NotDannuzhamu:'Not Dannuzhamu',
BurundiFranc:'Burundi Franc',
NorthKoreanWon:'North Korean Won',
DanishKrone:'Danish Krone',
EastCaribbeanDollar:'East Caribbean Dollar',
DominicaPeso:'Dominica Peso',
RussianRuble:'Russian Ruble',
EritreanNakfa:'Eritrean Nakfa',
CFAfranc:'CFA franc',
PhilippinePeso:'Philippine Peso',
FijiDollar:'Fiji Dollar',
CapeVerdeEscudo:'Cape Verde Escudo',
FalklandIslandsPound:'Falkland Islands Pound',
GambianDalasi:'Gambian Dalasi',
Congolesefranc:'Congolese franc',
ColombianPeso:'Colombian Peso',
CostaRicanColon:'Costa Rican Colon',
CubanPeso:'Cuban Peso',
Cubanconvertiblepeso:'Cuban convertible peso',
GuyanaDollar:'Guyana Dollar',
KazakhstanTenge:'Kazakhstan Tenge',
Haitiangourde:'Haitian gourde',
won:'won',
NetherlandsAntillesGuilder:'Netherlands Antilles Guilder',
Honduraslempiras:'Honduras lempiras',
DjiboutiFranc:'Djibouti Franc',
KyrgyzstanSom:'Kyrgyzstan Som',
GuineaFranc:'Guinea Franc',
CanadianDollar:'Canadian Dollar',
GhanaianCedi:'Ghanaian Cedi',
Cambodianriel:'Cambodian riel',
CzechKoruna:'Czech Koruna',
ZimbabweDollar:'Zimbabwe Dollar',
QatariRiyal:'Qatari Riyal',
CaymanIslandsDollar:'Cayman Islands Dollar',
Comorianfranc:'Comorian franc',
KuwaitiDinar:'Kuwaiti Dinar',
CroatianKuna:'Croatian Kuna',
KenyanShilling:'Kenyan Shilling',
LesothoLoti:'Lesotho Loti',
LaoKip:'Lao Kip',
LebanesePound:'Lebanese Pound',
Lithuanianlitas:'Lithuanian litas',
LibyanDinar:'Libyan Dinar',
LiberianDollar:'Liberian Dollar',
RwandaFranc:'Rwanda Franc',
RomanianLeu:'Romanian Leu',
MalagasyAriary:'Malagasy Ariary',
MaldivianRufiyaa:'Maldivian Rufiyaa',
MalawiKwacha:'Malawi Kwacha',
MalaysianRinggit:'Malaysian Ringgit',
MacedoniawearingDinar:'Macedonia wearing Dinar',
MauritiusRupee:'Mauritius Rupee',
MauritanianOuguiya:'Mauritanian Ouguiya',
MongolianTugrik:'Mongolian Tugrik',
BangladeshiTaka:'Bangladeshi Taka',
PeruvianNuevoSol:'Peruvian Nuevo Sol',
MyanmarKyat:'Myanmar Kyat',
MoldovanLeu:'Moldovan Leu',
MoroccanDirham:'Moroccan Dirham',
MozambiqueMetical:'Mozambique Metical',
MexicanPeso:'Mexican Peso',
NamibianDollar:'Namibian Dollar',
SouthAfricanRand:'South African Rand',
SouthSudanesePound:'South Sudanese Pound',
NicaraguaCordoba:'Nicaragua Cordoba',
NepaleseRupee:'Nepalese Rupee',
NigerianNaira:'Nigerian Naira',
NorwegianKrone:'Norwegian Krone',
GeorgianLari:'Georgian Lari',
RMBOffshore:'RMB (Offshore)',
SwedishKrona:'Swedish Krona',
SwissFranc:'Swiss Franc',
SerbianDinar:'Serbian Dinar',
SierraLeone:'Sierra Leone',
SeychellesRupee:'Seychelles Rupee',
SaudiRiyal:'Saudi Riyal',
SaoTomeDobra:'Sao Tome Dobra',
SaintHelenapound:'Saint Helena pound',
SriLankaRupee:'Sri Lanka Rupee',
SwazilandLilangeni:'Swaziland Lilangeni',
SudanesePound:'Sudanese Pound',
Surinamesedollar:'Surinamese dollar',
SolomonIslandsDollar:'Solomon Islands Dollar',
SomaliShilling:'Somali Shilling',
TajikistanSomoni:'Tajikistan Somoni',
PacificFranc:'Pacific Franc',
ThaiBaht:'Thai Baht',
TanzanianShilling:'Tanzanian Shilling',
TonganPaanga:"Tongan Pa'anga",
TrinidadandTobagoDollar:'Trinidad and Tobago Dollar',
TunisianDinar:'Tunisian Dinar',
TurkishLira:'Turkish Lira',
VanuatuVatu:'Vanuatu Vatu',
GuatemalanQuetzal:'Guatemalan Quetzal',
CommissionBolivar:'Commission Bolivar',
BruneiDollar:'Brunei Dollar',
UgandanShilling:'Ugandan Shilling',
UkrainianHryvnia:'Ukrainian Hryvnia',
UruguayanPeso:'Uruguayan Peso',
Uzbekistansom:'Uzbekistan som',
WesternSamoaTala:'Western Samoa Tala',
SingaporeDollar:'Singapore Dollar',
NT:'NT',
NewZealandDollar:'New Zealand Dollar',
HungarianForint:'Hungarian Forint',
SyrianPound:'Syrian Pound',
JamaicanDollar:'Jamaican Dollar',
ArmenianDram:'Armenian Dram',
YemeniRial:'Yemeni Rial',
IraqiDinar:'Iraqi Dinar',
IranianRial:'Iranian Rial',
NewIsraeliShekel:'New Israeli Shekel',
IndianRupee:'Indian Rupee',
IndonesianRupiah:'Indonesian Rupiah',
JordanianDinar:'Jordanian Dinar',
VND:'VND',
ZambianKwacha:'Zambian Kwacha',
GibraltarPound:'Gibraltar Pound',
ChileanPeso:'Chilean Peso',
CFAFrancBEAC:'CFA Franc BEAC'
},
defaultFmt:[
{ "text": 'Automatic', "value": "General", "example": "" },
{ "text": 'Plain text', "value": "@", "example": "" },
{ "text": "", "value": "split", "example": "" },
{ "text": 'Number', "value": "##0.00", "example": "1000.12" },
{ "text": 'Percent', "value": "#0.00%", "example": "12.21%" },
{ "text": 'Scientific', "value": "0.00E+00", "example": "1.01E+5" },
{ "text": "", "value": "split", "example": "" },
{ "text": 'Accounting', "value": "¥(0.00)", "example": "¥(1200.09)" },
{ "text": 'Currency', "value": "¥0.00", "example": "¥1200.09" },
{ "text": "", "value": "split", "example": "" },
{ "text": 'Date', "value": "yyyy-MM-dd", "example": "2017-11-29" },
{ "text": 'Time', "value": "hh:mm AM/PM", "example": "3:00 PM" },
{ "text": 'Time 24H', "value": "hh:mm", "example": "15:00" },
{ "text": 'Date time', "value": "yyyy-MM-dd hh:mm AM/PM", "example": "2017-11-29 3:00 PM" },
{ "text": 'Date time 24 H', "value": "yyyy-MM-dd hh:mm", "example": "2017-11-29 15:00" },
{ "text": "", "value": "split", "example": "" },
{ "text": 'Custom formats', "value": "fmtOtherSelf", "example": "more" }
],
dateFmtList:[
{
"name": "1930-08-05",
"value": "yyyy-MM-dd"
},
{
"name": "1930/8/5",
"value": "yyyy/MM/dd"
},
{
"name": "08-05",
"value": "MM-dd"
},
{
"name": "8-5",
"value": "M-d"
},
{
"name": "13:30:30",
"value": "h:mm:ss"
},
{
"name": "13:30",
"value": "h:mm"
},
{
"name": "PM 01:30",
"value": 'AM/PM hh:mm'
},
{
"name": "PM 1:30",
"value": 'AM/PM h:mm'
},
{
"name": "PM 1:30:30",
"value": 'AM/PM h:mm:ss'
},
{
"name": "08-05 PM 01:30",
"value": "MM-dd AM/PM hh:mm"
}
],
fontFamily:{
MicrosoftYaHei:"YaHei",
},
fontarray: ["Times New Roman","Arial","Tahoma","Verdana"],
fontjson: {"arial":1,"times new roman":0,"tahoma":2,"verdana":3}
};

284
src/locale/zh.js

@ -44,12 +44,26 @@ export default {
chart: '图表',
screenshot: '截图',
splitColumn: '分列',
clearText:"清除颜色选择",
noColorSelectedText:"没有颜色被选择",
},
alternatingColors:{
applyRange: '应用范围',
selectRange: '选择应用范围',
header: '页眉',
footer: '页脚',
errorInfo:"不能对多重选择区域执行此操作,请选择单个区域,然后再试",
textTitle:"格式样式",
custom:"自定义",
close:"关闭",
selectionTextColor:"点击选择文本颜色",
selectionCellColor:"点击选择单元格颜色",
removeColor:"移除交替颜色",
colorShow:"颜色",
},
button: {
confirm: '确定',
@ -60,29 +74,265 @@ export default {
paintFormatEnd: 'ESC键退出',
},
format: {
auto: '自动',
text: '纯文本',
number: '数字',
percent: '百分比',
scientific: '科学计数',
accounting: '会计',
tenThousand: '万元',
currency: '货币',
tenThousandDecimal: '万元2位小数',
date: '日期',
time: '时间',
time24H: '时间24H',
dateTime: '日期时间',
dateTime24H: '日期时间24H',
customFormats: '自定义格式',
moreCurrency: '更多货币格式',
moreDateTime: '更多日期与时间格式',
moreNumber: '更多数字格式'
moreNumber: '更多数字格式',
titleCurrency: '货币格式',
decimalPlaces: '小数位数',
titleDateTime: '日期与时间格式',
titleNumber: '数字格式'
},
info: {
detailUpdate: '新打开',
detailSave: '已恢复本地缓存',
row: '行',
column: '列'
}
},
currencyDetail:{
RMB:'人民币',
USdollar:'美元',
EUR:'欧元',
GBP:'英镑',
HK:'港元',
JPY:'日元',
AlbanianLek:'阿尔巴尼亚列克',
AlgerianDinar:'阿尔及利亚第纳尔',
Afghani:'阿富汗尼',
ArgentinePeso:'阿根廷比索',
UnitedArabEmiratesDirham:'阿拉伯联合酋长国迪拉姆',
ArubanFlorin:'阿鲁巴弗罗林',
OmaniRial:'阿曼里亚尔',
Azerbaijanimanat:'阿塞拜疆马纳特',
EgyptianPound:'埃及镑',
EthiopianBirr:'埃塞俄比亚比尔',
AngolaKwanza:'安哥拉宽扎',
AustralianDollar:'澳大利亚元',
Patacas:'澳门元',
BarbadosDollar:'巴巴多斯元',
PapuaNewGuineaKina:'巴布亚新几内亚基那',
BahamianDollar:'巴哈马元',
PakistanRupee:'巴基斯坦卢比',
ParaguayanGuarani:'巴拉圭瓜拉尼',
BahrainiDinar:'巴林第纳尔',
PanamanianBalboa:'巴拿马巴波亚',
Brazilianreal:'巴西里亚伊',
Belarusianruble:'白俄罗斯卢布',
BermudianDollar:'百慕大元',
BulgarianLev:'保加利亚列弗',
IcelandKrona:'冰岛克朗',
BosniaHerzegovinaConvertibleMark:'波黑可兑换马克',
PolishZloty:'波兰兹罗提',
Boliviano:'玻利维亚诺',
BelizeDollar:'伯利兹元',
BotswanaPula:'博茨瓦纳普拉',
NotDannuzhamu:'不丹努扎姆',
BurundiFranc:'布隆迪法郎',
NorthKoreanWon:'朝鲜圆',
DanishKrone:'丹麦克朗',
EastCaribbeanDollar:'东加勒比元',
DominicaPeso:'多米尼加比索',
RussianRuble:'俄国卢布',
EritreanNakfa:'厄立特里亚纳克法',
CFAfranc:'非洲金融共同体法郎',
PhilippinePeso:'菲律宾比索',
FijiDollar:'斐济元',
CapeVerdeEscudo:'佛得角埃斯库多',
FalklandIslandsPound:'福克兰群岛镑',
GambianDalasi:'冈比亚达拉西',
Congolesefranc:'刚果法郎',
ColombianPeso:'哥伦比亚比索',
CostaRicanColon:'哥斯达黎加科朗',
CubanPeso:'古巴比索',
Cubanconvertiblepeso:'古巴可兑换比索',
GuyanaDollar:'圭亚那元',
KazakhstanTenge:'哈萨克斯坦坚戈',
Haitiangourde:'海地古德',
won:'韩元',
NetherlandsAntillesGuilder:'荷属安的列斯盾',
Honduraslempiras:'洪都拉斯拉伦皮拉',
DjiboutiFranc:'吉布提法郎',
KyrgyzstanSom:'吉尔吉斯斯坦索姆',
GuineaFranc:'几内亚法郎',
CanadianDollar:'加拿大元',
GhanaianCedi:'加纳塞地',
Cambodianriel:'柬埔寨瑞尔',
CzechKoruna:'捷克克朗',
ZimbabweDollar:'津巴布韦元',
QatariRiyal:'卡塔尔里亚尔',
CaymanIslandsDollar:'开曼群岛元',
Comorianfranc:'科摩罗法郎',
KuwaitiDinar:'科威特第纳尔',
CroatianKuna:'克罗地亚库纳',
KenyanShilling:'肯尼亚先令',
LesothoLoti:'莱索托洛蒂',
LaoKip:'老挝基普',
LebanesePound:'黎巴嫩镑',
Lithuanianlitas:'立陶宛立特',
LibyanDinar:'利比亚第纳尔',
LiberianDollar:'利比亚元',
RwandaFranc:'卢旺达法郎',
RomanianLeu:'罗马尼亚列伊',
MalagasyAriary:'马达加斯加阿里亚里',
MaldivianRufiyaa:'马尔代夫拉菲亚',
MalawiKwacha:'马拉维克瓦查',
MalaysianRinggit:'马来西亚林吉特',
MacedoniawearingDinar:'马其顿戴第纳尔',
MauritiusRupee:'毛里求斯卢比',
MauritanianOuguiya:'毛里塔尼亚乌吉亚',
MongolianTugrik:'蒙古图格里克',
BangladeshiTaka:'孟加拉塔卡',
PeruvianNuevoSol:'秘鲁新索尔',
MyanmarKyat:'缅甸开亚特',
MoldovanLeu:'摩尔多瓦列伊',
MoroccanDirham:'摩洛哥迪拉姆',
MozambiqueMetical:'莫桑比克梅蒂卡尔',
MexicanPeso:'墨西哥比索',
NamibianDollar:'纳米比亚元',
SouthAfricanRand:'南非兰特',
SouthSudanesePound:'南苏丹镑',
NicaraguaCordoba:'尼加拉瓜科多巴',
NepaleseRupee:'尼泊尔卢比',
NigerianNaira:'尼日利亚奈拉',
NorwegianKrone:'挪威克朗',
GeorgianLari:'乔治亚拉瑞',
RMBOffshore:'人民币(离岸)',
SwedishKrona:'瑞典克朗',
SwissFranc:'瑞士法郎',
SerbianDinar:'塞尔维亚第纳尔',
SierraLeone:'塞拉利昂利昂',
SeychellesRupee:'塞舌尔卢比',
SaudiRiyal:'沙特里亚尔',
SaoTomeDobra:'圣多美多布拉',
SaintHelenapound:'圣赫勒拿群岛磅',
SriLankaRupee:'斯里兰卡卢比',
SwazilandLilangeni:'斯威士兰里兰吉尼',
SudanesePound:'苏丹镑',
Surinamesedollar:'苏里南元',
SolomonIslandsDollar:'所罗门群岛元',
SomaliShilling:'索马里先令',
TajikistanSomoni:'塔吉克斯坦索莫尼',
PacificFranc:'太平洋法郎',
ThaiBaht:'泰国铢',
TanzanianShilling:'坦桑尼亚先令',
TonganPaanga:'汤加潘加',
TrinidadandTobagoDollar:'特立尼达和多巴哥元',
TunisianDinar:'突尼斯第纳尔',
TurkishLira:'土耳其里拉',
VanuatuVatu:'瓦努阿图瓦图',
GuatemalanQuetzal:'危地马拉格查尔',
CommissionBolivar:'委内瑞拉博利瓦',
BruneiDollar:'文莱元',
UgandanShilling:'乌干达先令',
UkrainianHryvnia:'乌克兰格里夫尼亚',
UruguayanPeso:'乌拉圭比索',
Uzbekistansom:'乌兹别克斯坦苏姆',
WesternSamoaTala:'西萨摩亚塔拉',
SingaporeDollar:'新加坡元',
NT:'新台币',
NewZealandDollar:'新西兰元',
HungarianForint:'匈牙利福林',
SyrianPound:'叙利亚镑',
JamaicanDollar:'牙买加元',
ArmenianDram:'亚美尼亚德拉姆',
YemeniRial:'也门里亚尔',
IraqiDinar:'伊拉克第纳尔',
IranianRial:'伊朗里亚尔',
NewIsraeliShekel:'以色列新谢克尔',
IndianRupee:'印度卢比',
IndonesianRupiah:'印度尼西亚卢比',
JordanianDinar:'约旦第纳尔',
VND:'越南盾',
ZambianKwacha:'赞比亚克瓦查',
GibraltarPound:'直布罗陀镑',
ChileanPeso:'智利比索',
CFAFrancBEAC:'中非金融合作法郎',
},
defaultFmt:[
{ "text": '自动', "value": "General", "example": "" },
{ "text": '纯文本', "value": "@", "example": "" },
{ "text": "", "value": "split", "example": "" },
{ "text": '数字', "value": "##0.00", "example": "1000.12" },
{ "text": '百分比', "value": "#0.00%", "example": "12.21%" },
{ "text": '科学计数', "value": "0.00E+00", "example": "1.01E+5" },
{ "text": "", "value": "split", "example": "" },
{ "text": '会计', "value": "¥(0.00)", "example": "¥(1200.09)" },
//{ "text": "财务", "value": "(#.####)", "example": "(1200.09)" },
{ "text": '万元', "value": "w", "example": "1亿2000万2500" },
{ "text": '货币', "value": "¥0.00", "example": "¥1200.09" },
//{ "text": "货币整数", "value": "¥####", "example": "¥1200" },
{ "text": '万元2位小数', "value": "w0.00", "example": "2万2500.55" },
{ "text": "", "value": "split", "example": "" },
{ "text": '日期', "value": "yyyy-MM-dd", "example": "2017-11-29" },
{ "text": '时间', "value": "hh:mm AM/PM", "example": "3:00 PM" },
{ "text": '时间24H', "value": "hh:mm", "example": "15:00" },
{ "text": '日期时间', "value": "yyyy-MM-dd hh:mm AM/PM", "example": "2017-11-29 3:00 PM" },
{ "text": '日期时间24H', "value": "yyyy-MM-dd hh:mm", "example": "2017-11-29 15:00" },
{ "text": "", "value": "split", "example": "" },
{ "text": '自定义格式', "value": "fmtOtherSelf", "example": "more" }
],
dateFmtList:[
{
"name": "1930-08-05",
"value": "yyyy-MM-dd"
},
{
"name": "1930/8/5",
"value": "yyyy/MM/dd"
},
{
"name": "1930年8月5日",
"value": 'yyyy"年"M"月"d"日"'
},
{
"name": "08-05",
"value": "MM-dd"
},
{
"name": "8-5",
"value": "M-d"
},
{
"name": "8月5日",
"value": 'M"月"d"日"'
},
{
"name": "13:30:30",
"value": "h:mm:ss"
},
{
"name": "13:30",
"value": "h:mm"
},
{
"name": "下午01:30",
"value": 'AM/PM hh:mm'
},
{
"name": "下午1:30",
"value": 'AM/PM h:mm'
},
{
"name": "下午1:30:30",
"value": 'AM/PM h:mm:ss'
},
{
"name": "08-05 下午01:30",
"value": "MM-dd AM/PM hh:mm"
},
// {
// "name": "1930年8月5日星期二",
// "value": ''
// },
// {
// "name": "1930年8月5日星期二 下午1:30:30",
// "value": ''
// },
],
fontFamily:{
MicrosoftYaHei:"Microsoft YaHei",
},
fontarray: ["微软雅黑","宋体","黑体","楷体","仿宋","新宋体","华文新魏","华文行楷","华文隶书","Arial","Times New Roman","Tahoma","Verdana"],
fontjson: {"微软雅黑":0,"microsoft yahei":0,"宋体":1,"simsun":1,"黑体":2,"simhei":2,"楷体":3,"kaiti":3,"仿宋":4,"fangsong":4,"新宋体":5,"nsimsun":5,"华文新魏":6,"stxinwei":6,"华文行楷":7,"stxingkai":7,"华文隶书":8,"stliti":8,"arial":9,"times new roman":10,"tahoma":11,"verdana":12}
};

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

File diff suppressed because one or more lines are too long

13
src/utils/util.js

@ -3,6 +3,7 @@ import menuButton from '../controllers/menuButton';
import { isdatatype, isdatatypemulti } from '../global/datecontroll';
import { hasChinaword } from '../global/validate';
import Store from '../store';
import locale from '../locale/locale';
/**
* Common tool methods
@ -292,6 +293,7 @@ function ArrayUnique(dataArr) {
//获取字体配置
function luckysheetfontformat(format) {
let fontarray = locale().fontarray;
if (getObjType(format) == "object") {
let font = "";
@ -323,21 +325,22 @@ function luckysheetfontformat(format) {
}
if (!format.ff) {
font += '微软雅黑, "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';
font += fontarray[0] + ', "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';
}
else {
let fontarray = menuButton.fontarray;
let fontfamily = null;
let fontjson = locale().fontjson;
if (isdatatypemulti(format.ff)["num"]) {
fontfamily = fontarray[parseInt(format.ff)];
}
else {
fontfamily = fontarray[menuButton.fontjson[format.ff]];
fontfamily = fontarray[fontjson[format.ff]];
}
if (fontfamily == null) {
fontfamily = "微软雅黑";
fontfamily = fontarray[0];
}
font += fontfamily + ', "Helvetica Neue", Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif';

Loading…
Cancel
Save