tonytonychopper123 5 years ago
parent
commit
ac635b3584
  1. 6
      docs/guide/config.md
  2. 102
      docs/guide/format.md
  3. 6
      docs/zh/guide/config.md
  4. 310
      docs/zh/guide/data.md
  5. 102
      docs/zh/guide/format.md
  6. 310
      src/controllers/conditionformat.js
  7. 594
      src/controllers/constant.js
  8. 13
      src/controllers/freezen.js
  9. 128
      src/controllers/handler.js
  10. 244
      src/controllers/menuButton.js
  11. 4
      src/controllers/pivotTable.js
  12. 15
      src/controllers/resize.js
  13. 77
      src/controllers/searchReplace.js
  14. 11
      src/controllers/server.js
  15. 2
      src/controllers/sheetmanage.js
  16. 30
      src/controllers/splitColumn.js
  17. 59
      src/demoData/sheetCell.js
  18. 1
      src/demoData/sheetComment.js
  19. 1
      src/demoData/sheetConditionFormat.js
  20. 1107
      src/demoData/sheetFormula.js
  21. 33
      src/demoData/sheetPivotTable.js
  22. 167
      src/demoData/sheetPivotTableData.js
  23. 7862
      src/demoData/sheetSparkline.js
  24. 1
      src/demoData/sheetTable.js
  25. 5
      src/function/func.js
  26. 8
      src/global/createdom.js
  27. 7
      src/global/draw.js
  28. 19
      src/global/tooltip.js
  29. 347
      src/locale/en.js
  30. 331
      src/locale/zh.js

6
docs/guide/config.md

@ -133,12 +133,6 @@
- Default: "www.baidu.com"
- Usage: Back button link in the upper left corner
------------
## config
- Type: Object
- Default: {}
- Usage: Table row height, column width, merged cells, formulas and other settings
------------
## devicePixelRatio
- Type: Number

102
docs/guide/format.md

@ -72,108 +72,6 @@
<td>Underline</td>
<td>0 Regular, 1 Underline</td>
</tr>
<tr>
<td rowspan="14">bs</td>
<td rowspan="14">borderstyle</td>
<td rowspan="14">Border style</td>
<td>0 none</td>
<td rowspan="14">LineStyle</td>
</tr>
<tr>
<td>1 Thin</td>
</tr>
<tr>
<td>2 Hair</td>
</tr>
<tr>
<td>3 Dotted</td>
</tr>
<tr>
<td>4 Dashed</td>
</tr>
<tr>
<td>5 DashDot</td>
</tr>
<tr>
<td>6 DashDotDot</td>
</tr>
<tr>
<td>7 Double</td>
</tr>
<tr>
<td>8 Medium</td>
</tr>
<tr>
<td>9 MediumDashed</td>
</tr>
<tr>
<td>10 MediumDashDot</td>
</tr>
<tr>
<td>11 MediumDashDotDot</td>
</tr>
<tr>
<td>12 SlantedDashDot</td>
</tr>
<tr>
<td>13 Thick</td>
</tr>
<tr>
<td>bc</td>
<td>bordercolor</td>
<td>Border color</td>
<td>#fff000</td>
<td>setBorderColor</td>
</tr>
<tr>
<td>bs_t</td>
<td>borderstyleTop</td>
<td>Top border style</td>
<td rowspan="8">Same as above</td>
<td></td>
</tr>
<tr>
<td>bc_t</td>
<td>bordercolorTop</td>
<td>Top border color</td>
<td></td>
</tr>
<tr>
<td>bs_b</td>
<td>borderstyleBottom</td>
<td>Bottom border style</td>
<td></td>
</tr>
<tr>
<td>bc_b</td>
<td>bordercolorBottom</td>
<td>Bottom border color</td>
<td></td>
</tr>
<tr>
<td>bs_l</td>
<td>borderstyleLeft</td>
<td>Left border style</td>
<td></td>
</tr>
<tr>
<td>bc_l</td>
<td>bordercolorLeft</td>
<td>Left border color</td>
<td></td>
</tr>
<tr>
<td>bs_r</td>
<td>borderstyleRight</td>
<td>Right border style</td>
<td></td>
</tr>
<tr>
<td>bc_r</td>
<td>bordercolorRight</td>
<td>Right border color</td>
<td></td>
</tr>
<tr>
<td>vt</td>
<td>verticaltype</td>

6
docs/zh/guide/config.md

@ -133,12 +133,6 @@
- 默认值:"www.baidu.com"
- 作用:左上角<返回按钮的链接
------------
## config
- 类型:Object
- 默认值:{}
- 作用:表格行高、列宽、合并单元格、公式等设置
------------
## devicePixelRatio
- 类型:Number

310
docs/zh/guide/data.md

@ -7,18 +7,38 @@
配置 `updateUrl` 的地址,Luckysheet会通过ajax请求表格数据,默认载入status为1的sheet数据中的所有`data`,其余的sheet载入除`data`字段外的所有字段。
- **格式**
通过全局方法 `luckysheet.getluckysheetfile()`可以获取所有工作表的配置信息
luckysheetfile示例如下:
```json
[
{
"name": "Sheet1",
"color": "",
"status": "1",
"order": "0",
"celldata": [],
"config": {},
"index": 0
"name": "Cell", //工作表名称
"color": "", //工作表颜色
"config": {}, //表格行高、列宽、合并单元格、边框、隐藏行等设置
"index": "0", //工作表索引
"chart": [], //图表配置
"status": "1", //激活状态
"order": "0", //工作表的顺序
"hide": 0,//是否隐藏
"load": "1", //是否已远程加载
"column": 18, //列数
"row": 36, //行数
"celldata": [], //原始单元格数据集
"visibledatarow": [], //所有行的位置
"visibledatacolumn": [], //所有列的位置
"ch_width": 2322, //工作表区域的宽度
"rh_height": 949, //工作表区域的高度
"scrollLeft": 0, //左右滚动条位置
"scrollTop": 315, //上下滚动条位置
"luckysheet_select_save": [], //选中的区域
"luckysheet_conditionformat_save": {},//条件格式
"calcChain": [],//公式链
"isPivotTable":false,//是否数据透视表
"pivotTable":{},//数据透视表设置
"filter_select": null,//筛选范围
"filter": null,//筛选配置
"luckysheet_alternateformat_save": [], //交替颜色
"luckysheet_alternateformat_save_modelCustom": []//自定义交替颜色
},
{
"name": "Sheet2",
@ -40,6 +60,280 @@
}
]
```
- **说明**
------------
## name
- 类型:String
- 默认值:"Sheet1"
- 作用:工作表名称
------------
## color
- 类型:String
- 默认值:"##f20e0e"
- 作用:工作表颜色,工作表名称下方会有一条底部边框
------------
## index
- 类型:Number
- 默认值:0
- 作用:工作表索引,从0开始
------------
## status
- 类型:Number
- 默认值:1
- 作用: 激活状态,仅有一个激活状态的工作表,其他工作表为 `0`
------------
## order
- 类型:Number
- 默认值:0
- 作用: 工作表的顺序,新增工作表时会递增,从0开始
------------
## hide
- 类型:Number
- 默认值:0
- 作用: 是否隐藏,`0`为不隐藏,`1`为隐藏
------------
## load
- 类型:Number
- 默认值:0
- 作用: 是否已远程加载,`0`为未远程加载,`1`为已远程加载到数据
------------
## column
- 类型:Number
- 默认值:18
- 作用: 单元格列数
------------
## row
- 类型:Number
- 默认值:36
- 作用: 单元格行数
------------
## visibledatarow
- 类型:Number
- 默认值:[]
- 作用: 所有行的位置信息,递增的行位置数据
------------
## visibledatacolumn
- 类型:Number
- 默认值:[]
- 作用: 所有列的位置信息,递增的列位置数据
------------
## ch_width
- 类型:Number
- 默认值:2322
- 作用: 整个工作表区域的宽度(包含边界的灰色区域)
------------
## rh_height
- 类型:Number
- 默认值:2322
- 作用: 整个工作表区域的高度(包含边界的灰色区域)
------------
## scrollLeft
- 类型:Number
- 默认值:0
- 作用: 左右滚动条位置
------------
## scrollTop
- 类型:Number
- 默认值:0
- 作用: 上下滚动条位置
------------
## config
- 类型:Object
- 默认值:{}
- 作用:表格行高、列宽、合并单元格、边框、隐藏行等设置
### config.merge
- 类型:Object
- 默认值:{}
- 作用:合并单元格设置,示例:
```js
{
"13_5": {
"r": 13,
"c": 5,
"rs": 3,
"cs": 1
},
"13_7": {
"r": 13,
"c": 7,
"rs": 3,
"cs": 2
},
"14_2": {
"r": 14,
"c": 2,
"rs": 1,
"cs": 2
}
}
```
对象中的`key`为`r + '_' + c`的拼接值,`value`为左上角单元格信息: r:行数,c:列数,rs:合并的行数,cs:合并的列数
### config.rowlen
- 类型:Object
- 默认值:{}
- 作用:每个单元格的行高,示例:
```js
"rowlen": {
"0": 20,
"1": 20,
"2": 20
}
```
### config.columlen
- 类型:Object
- 默认值:{}
- 作用:每个单元格的列宽,示例:
```js
"columlen": {
"0": 97,
"1": 115,
"2": 128
}
```
### config.borderInfo
- 类型:Object
- 默认值:{}
- 作用:单元格的边框信息,示例:
```js
"borderInfo": [{
"rangeType": "cell",
"value": {
"row_index": 3,
"col_index": 3,
"l": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"r": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"t": {
"style": 10,
"color": "rgb(255, 0, 0)"
},
"b": {
"style": 10,
"color": "rgb(255, 0, 0)"
}
}
},
{
"rangeType": "range",
"borderType": "border-all",
"style": "3",
"color": "#0000ff",
"range": [{
"row": [7, 8],
"column": [2, 3]
}]
}, {
"rangeType": "range",
"borderType": "border-inside",
"style": "3",
"color": "#0000ff",
"range": [{
"row": [7, 8],
"column": [8, 9]
}]
}]
```
范围类型分单个单元格和选区两种情况
1. 选区 `rangeType: "range"`
- 边框类型 `borderType:"border-left" | "border-right" | "border-top" | "border-bottom" | "border-all" | "border-outside" | "border-inside" | "border-horizontal" | "border-vertical" | "border-none"`
- 边框粗细 `style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick`
- 边框颜色 `color: 16进制颜色值`
- 选区范围 `range: 行列信息数组`
2. 单个单元格 `rangeType:"cell"`
- 行数和列数 `value.row_index: 数字,value.col_index: 数字`
- 四个边框对象 `value.l:左边框,value.r:右边框,value.t:上边框,value.b:下边框`
- 边框粗细 `value.l.style: 1 Thin | 2 Hair | 3 Dotted | 4 Dashed | 5 DashDot | 6 DashDotDot | 7 Double | 8 Medium | 9 MediumDashed | 10 MediumDashDot | 11 MediumDashDotDot | 12 SlantedDashDot | 13 Thick`
- 边框颜色 `value.l.color: 16进制颜色值`
### config.rowhidden
- 类型:Object
- 默认值:{}
- 作用:隐藏行信息,示例:
```js
"rowhidden": {
"30": 0,
"31": 0
}
```
- 行数:`rowhidden[行数]: 0`,`key`指定行数即可,`value`总是为`0`
------------
## celldata
- 类型:Array
- 默认值:[]
- 作用: 原始单元格数据集,是一个包含`{r:0,c:0,v:{m:"value",v:"value",ct: {fa: "General", t: "g"}}}`格式单元格信息的一维数组,只在初始化的时候使用,使用celldata初始化完表格后,数据转换为luckysheetfile中的同级字段data,如`luckysheetfile[0].data`,后续操作表格的数据更新,会更新到这个data字段中,celldata不再使用。如果需要将data拿出来作为初始化数据,则需要执行 `luckysheet.getGridData(data)`转换为celldata数据。其中`rcv`一维数组转换为二维数组使用的是`luckysheet.buildGridData(luckysheetfile)`,传入参数为表格数据对象`luckysheetfile`,示例:
```js
[{
"r": 0,
"c": 0,
"v": {
ct: {fa: "General", t: "g"},
m:"value1",
v:"value1"
}
}, {
"r": 0,
"c": 1,
"v": {
ct: {fa: "General", t: "g"},
m:"value2",
v:"value2"
}
}]
```
## luckysheet_select_save
- 类型:Array
- 默认值:[]
- 作用: 选中的区域,支持多选,是一个包含多个选区对象的一维数组,示例:
```js
```
## chart
- 类型:Array
- 默认值:[]
- 作用: 图表配置(开发中)
------------
- `"luckysheet_select_save": []`, //选中的区域
- `"luckysheet_conditionformat_save": {}`,//条件格式
- `"calcChain": []`,//公式链
- `"isPivotTable":false`,//是否数据透视表
- `"pivotTable":{}`,//数据透视表设置
- `"filter_select": null`,//筛选范围
- `"filter": null`,//筛选配置
- `"luckysheet_alternateformat_save": []`, //交替颜色
- `"luckysheet_alternateformat_save_modelCustom": []`//自定义交替颜色
## 获取sheet数据

102
docs/zh/guide/format.md

@ -72,108 +72,6 @@
<td>下划线</td>
<td>0 常规 、 1 下划线</td>
</tr>
<tr>
<td rowspan="14">bs</td>
<td rowspan="14">borderstyle</td>
<td rowspan="14">边框样式</td>
<td>0 none</td>
<td rowspan="14">LineStyle</td>
</tr>
<tr>
<td>1 Thin</td>
</tr>
<tr>
<td>2 Hair</td>
</tr>
<tr>
<td>3 Dotted</td>
</tr>
<tr>
<td>4 Dashed</td>
</tr>
<tr>
<td>5 DashDot</td>
</tr>
<tr>
<td>6 DashDotDot</td>
</tr>
<tr>
<td>7 Double</td>
</tr>
<tr>
<td>8 Medium</td>
</tr>
<tr>
<td>9 MediumDashed</td>
</tr>
<tr>
<td>10 MediumDashDot</td>
</tr>
<tr>
<td>11 MediumDashDotDot</td>
</tr>
<tr>
<td>12 SlantedDashDot</td>
</tr>
<tr>
<td>13 Thick</td>
</tr>
<tr>
<td>bc</td>
<td>bordercolor</td>
<td>边框颜色</td>
<td>#fff000</td>
<td>setBorderColor</td>
</tr>
<tr>
<td>bs_t</td>
<td>borderstyleTop</td>
<td>上边框样式</td>
<td rowspan="8">同上</td>
<td></td>
</tr>
<tr>
<td>bc_t</td>
<td>bordercolorTop</td>
<td>上边框颜色</td>
<td></td>
</tr>
<tr>
<td>bs_b</td>
<td>borderstyleBottom</td>
<td>下边框样式</td>
<td></td>
</tr>
<tr>
<td>bc_b</td>
<td>bordercolorBottom</td>
<td>下边框颜色</td>
<td></td>
</tr>
<tr>
<td>bs_l</td>
<td>borderstyleLeft</td>
<td>左边框样式</td>
<td></td>
</tr>
<tr>
<td>bc_l</td>
<td>bordercolorLeft</td>
<td>左边框颜色</td>
<td></td>
</tr>
<tr>
<td>bs_r</td>
<td>borderstyleRight</td>
<td>右边框样式</td>
<td></td>
</tr>
<tr>
<td>bc_r</td>
<td>bordercolorRight</td>
<td>右边框颜色</td>
<td></td>
</tr>
<tr>
<td>vt</td>
<td>verticaltype</td>

310
src/controllers/conditionformat.js

@ -10,14 +10,55 @@ import { modelHTML, luckysheet_CFiconsImg } from './constant';
import server from './server';
import { selectionCopyShow } from './select';
import sheetmanage from './sheetmanage';
import locale from '../locale/locale';
import Store from '../store';
//条件格式
const conditionformat = {
fileClone: [],
editorRule: null, //{"sheetIndex": sheetIndex,"itemIndex": itemIndex,"data": luckysheetfile[sheetIndex].luckysheet_conditionformat_save[itemIndex]}
ruleTypeHtml: '<div class="ruleTypeBox"><div class="ruleTypeItem"><span class="icon">► </span><span>基于各自值设置所有单元格的格式</span></div><div class="ruleTypeItem"><span class="icon">► </span><span>只为包含以下内容的单元格设置格式</span></div><div class="ruleTypeItem"><span class="icon">► </span><span>仅对排名靠前或靠后的数值设置格式</span></div><div class="ruleTypeItem"><span class="icon">► </span><span>仅对高于或低于平均值的数值设置格式</span></div><div class="ruleTypeItem"><span class="icon">► </span><span>仅对唯一值或重复值设置格式</span></div></div>',
textCellColorHtml: '<div id="textCellColor"><div class="colorbox"><input id="checkTextColor" type="checkbox" checked="checked"><label for="checkTextColor">文本颜色:</label><input id="textcolorshow" data-tips="文本颜色" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="#9c0006" style="display: none;"></div><div class="colorbox"><input id="checkCellColor" type="checkbox" checked="checked"><label for="checkCellColor">单元格颜色:</label><input id="cellcolorshow" data-tips="单元格颜色" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="#ffc7ce" style="display: none;"></div></div>',
ruleTypeHtml: function(){
const conditionformat_Text = locale().conditionformat;
return `<div class="ruleTypeBox">
<div class="ruleTypeItem">
<span class="icon"> </span>
<span>${conditionformat_Text.ruleTypeItem1}</span>
</div>
<div class="ruleTypeItem">
<span class="icon"> </span>
<span>${conditionformat_Text.ruleTypeItem2}</span>
</div>
<div class="ruleTypeItem">
<span class="icon"> </span>
<span>${conditionformat_Text.ruleTypeItem3}</span>
</div>
<div class="ruleTypeItem">
<span class="icon"> </span>
<span>${conditionformat_Text.ruleTypeItem4}</span>
</div>
<div class="ruleTypeItem">
<span class="icon"> </span>
<span>${conditionformat_Text.ruleTypeItem5}</span>
</div>
</div>`;
},
textCellColorHtml: function(){
const conditionformat_Text = locale().conditionformat;
return `<div id="textCellColor">
<div class="colorbox">
<input id="checkTextColor" type="checkbox" checked="checked">
<label for="checkTextColor">${conditionformat_Text.textColor}</label>
<input id="textcolorshow" data-tips="${conditionformat_Text.textColor}" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="#9c0006" style="display: none;">
</div>
<div class="colorbox">
<input id="checkCellColor" type="checkbox" checked="checked">
<label for="checkCellColor">${conditionformat_Text.cellColor}</label>
<input id="cellcolorshow" data-tips="${conditionformat_Text.cellColor}" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="#ffc7ce" style="display: none;">
</div>
</div>`;
},
selectRange: [],
selectStatus: false,
dataBarList: [
@ -1545,44 +1586,51 @@ const conditionformat = {
administerRuleDialog: function(){
$("#luckysheet-modal-dialog-mask").show();
$("#luckysheet-administerRule-dialog").remove();
const conditionformat_Text = locale().conditionformat;
//工作表
let opHtml = '';
for(let j = 0; j < Store.luckysheetfile.length; j++){
if(Store.luckysheetfile[j].status == "1"){
opHtml += '<option value="' + Store.luckysheetfile[j]["index"] + '" selected="selected">当前工作表:' + Store.luckysheetfile[j]["name"] + '</option>';
opHtml += `<option value="${Store.luckysheetfile[j]["index"]}" selected="selected">
${conditionformat_Text.currentSheet}${Store.luckysheetfile[j]["name"]}
</option>`;
}
else{
opHtml += '<option value="' + Store.luckysheetfile[j]["index"] + '">表:' + Store.luckysheetfile[j]["name"] + '</option>';
opHtml += `<option value="${Store.luckysheetfile[j]["index"]}">
${conditionformat_Text.sheet}${Store.luckysheetfile[j]["name"]}
</option>`;
}
}
let content = '<div class="chooseSheet">' +
'<label>显示其格式规则:</label>' +
'<select>' + opHtml + '</select>' +
'</div>' +
'<div class="ruleBox">' +
'<div class="ruleBtn">' +
'<button id="newConditionRule" class="btn btn-default">新建规则</button>' +
'<button id="editorConditionRule" class="btn btn-default">编辑规则</button>' +
'<button id="deleteConditionRule" class="btn btn-default">删除规则</button>' +
'</div>' +
'<div class="ruleList">' +
'<div class="listTitle">' +
'<span>规则</span>' +
'<span>格式</span>' +
'<span>应用范围</span>' +
'</div>' +
'<div class="listBox"></div>' +
'</div>' +
'</div>';
let content = `<div class="chooseSheet">
<label>${conditionformat_Text.showRules}</label>
<select>${opHtml}</select>
</div>
<div class="ruleBox">
<div class="ruleBtn">
<button id="newConditionRule" class="btn btn-default">${conditionformat_Text.newRule}</button>
<button id="editorConditionRule" class="btn btn-default">${conditionformat_Text.editRule}</button>
<button id="deleteConditionRule" class="btn btn-default">${conditionformat_Text.deleteRule}</button>
</div>
<div class="ruleList">
<div class="listTitle">
<span>${conditionformat_Text.rule}</span>
<span>${conditionformat_Text.format}</span>
<span>${conditionformat_Text.applyRange}</span>
</div>
<div class="listBox"></div>
</div>
</div>`;
$("body").append(replaceHtml(modelHTML, {
"id": "luckysheet-administerRule-dialog",
"addclass": "luckysheet-administerRule-dialog",
"title": "条件格式规则管理器",
"title": conditionformat_Text.manageRules,
"content": content,
"botton": '<button id="luckysheet-administerRule-dialog-confirm" class="btn btn-primary">确定</button><button id="luckysheet-administerRule-dialog-close" class="btn btn-default">关闭</button>',
"botton": `<button id="luckysheet-administerRule-dialog-confirm" class="btn btn-primary">${conditionformat_Text.confirm}</button>
<button id="luckysheet-administerRule-dialog-close" class="btn btn-default">${conditionformat_Text.close}</button>`,
"style": "z-index:100003"
}));
let $t = $("#luckysheet-administerRule-dialog")
@ -1609,9 +1657,8 @@ const conditionformat = {
let ruleArr = _this.fileClone[getSheetIndex(index)].luckysheet_conditionformat_save; //条件格式规则集合
if(ruleArr != null && ruleArr.length > 0){
let textColorHtml = ''; //文本颜色dom
let cellColorHtml = ''; //单元格颜色dom
const conditionformat_Text = locale().conditionformat;
for(let i = 0; i < ruleArr.length; i++){
let type = ruleArr[i]["type"]; //规则类型
let format = ruleArr[i]["format"]; //规则样式
@ -1620,17 +1667,17 @@ const conditionformat = {
let ruleName; //规则名称
let formatHtml = ''; //样式dom
if(type == "dataBar"){
ruleName = "数据条";
ruleName = conditionformat_Text.dataBar;
formatHtml = '<canvas width="46" height="18" style="width: 46px;height: 18px;margin: 3px 0 0 5px;"></canvas>';
}
else if(type == "colorGradation"){
ruleName = "色阶";
ruleName = conditionformat_Text.colorGradation;
formatHtml = '<canvas width="46" height="18" style="width: 46px;height: 18px;margin: 3px 0 0 5px;"></canvas>';
}
else if(type == "icons"){
ruleName = "图标集";
ruleName = conditionformat_Text.icons;
formatHtml = '<canvas width="46" height="18" style="width: 46px;height: 18px;margin: 3px 0 0 5px;"></canvas>';
}
@ -1638,11 +1685,11 @@ const conditionformat = {
ruleName = _this.getConditionRuleName(ruleArr[i].conditionName, ruleArr[i].conditionRange, ruleArr[i].conditionValue);
if(format["textColor"] != null){
formatHtml += '<span class="colorbox" title="文本颜色" style="background-color:' + format["textColor"] + '"></span>';
formatHtml += '<span class="colorbox" title="'+ conditionformat_Text.textColor +'" style="background-color:' + format["textColor"] + '"></span>';
}
if(format["cellColor"] != null){
formatHtml += '<span class="colorbox" title="单元格颜色" style="background-color:' + format["cellColor"] + '"></span>';
formatHtml += '<span class="colorbox" title="'+ conditionformat_Text.cellColor +'" style="background-color:' + format["cellColor"] + '"></span>';
}
}
@ -1661,7 +1708,7 @@ const conditionformat = {
'<div class="format">' + formatHtml + '</div>' +
'<div class="ruleRange">' +
'<input class="formulaInputFocus" readonly="true" value="' + rangeTxtArr.join(",") + '"/>' +
'<i class="fa fa-table" aria-hidden="true" title="点击选择应用范围"></i>' +
'<i class="fa fa-table" aria-hidden="true" title="'+ conditionformat_Text.selectRange +'"></i>' +
'</div>' +
'</div>';
@ -1758,12 +1805,14 @@ const conditionformat = {
v = conditionValue[0];
}
const conditionformat_Text = locale().conditionformat;
//返回条件格式规则名称
if(conditionName == "greaterThan"){
return "单元格值 > " + v;
return conditionformat_Text.cellValue + " > " + v;
}
else if(conditionName == "lessThan"){
return "单元格值 < " + v;
return conditionformat_Text.cellValue + " < " + v;
}
else if(conditionName == "betweenness"){
let v2;
@ -1773,47 +1822,49 @@ const conditionformat = {
else{
v2 = conditionValue[1];
}
return "单元格值介于 "+ v +" 和 "+ v2 +" 之间";
return conditionformat_Text.cellValue + " " + conditionformat_Text.between + " " + v + " " + conditionformat_Text.in + " " + v2 + " " + conditionformat_Text.between2;
}
else if(conditionName == "equal"){
return "单元格值 = " + v;
return conditionformat_Text.cellValue + " = " + v;
}
else if(conditionName == "textContains"){
return "单元格值包含 =" + v;
return conditionformat_Text.cellValue + conditionformat_Text.contain + " =" + v;
}
else if(conditionName == "occurrenceDate"){
return conditionValue;
}
else if(conditionName == "duplicateValue"){
if(conditionValue == "0"){
return "重复值";
return conditionformat_Text.duplicateValue;
}
if(conditionValue == "1"){
return "唯一值";
return conditionformat_Text.uniqueValue;
}
}
else if(conditionName == "top10"){
return " "+ v +" ";
return conditionformat_Text.top + " " + v + " " + conditionformat_Text.oneself;
}
else if(conditionName == "top10%"){
return " "+ v +"% ";
return conditionformat_Text.top + " " + v + "% " + conditionformat_Text.oneself;
}
else if(conditionName == "last10"){
return " "+ v +" ";
return conditionformat_Text.last + " " + v + " " + conditionformat_Text.oneself;
}
else if(conditionName == "last10%"){
return " "+ v +"% ";
return conditionformat_Text.last + " " + v + "% " + conditionformat_Text.oneself;
}
else if(conditionName == "AboveAverage"){
return "高于平均值";
return conditionformat_Text.aboveAverage;
}
else if(conditionName == "SubAverage"){
return "低于平均值";
return conditionformat_Text.belowAverage;
}
},
newConditionRuleDialog: function(source){
let _this = this;
const conditionformat_Text = locale().conditionformat;
//规则说明
let ruleExplainHtml = _this.getRuleExplain(0);
@ -1823,9 +1874,9 @@ const conditionformat = {
$("#luckysheet-newConditionRule-dialog").remove();
let content = '<div>' +
'<div class="boxTitle">选择规则类型:</div>' +
_this.ruleTypeHtml +
'<div class="boxTitle">编辑规则说明:</div>' +
'<div class="boxTitle">' + conditionformat_Text.chooseRuleType + ':</div>' +
_this.ruleTypeHtml() +
'<div class="boxTitle">' + conditionformat_Text.editRuleDescription + ':</div>' +
'<div class="ruleExplainBox">' +
ruleExplainHtml +
'</div>' +
@ -1834,9 +1885,10 @@ const conditionformat = {
$("body").append(replaceHtml(modelHTML, {
"id": "luckysheet-newConditionRule-dialog",
"addclass": "luckysheet-newEditorRule-dialog",
"title": "新建格式规则",
"title": conditionformat_Text.newFormatRule,
"content": content,
"botton": '<button id="luckysheet-newConditionRule-dialog-confirm" class="btn btn-primary" data-source="'+source+'">确定</button><button id="luckysheet-newConditionRule-dialog-close" class="btn btn-default" data-source="'+source+'">取消</button>',
"botton": `<button id="luckysheet-newConditionRule-dialog-confirm" class="btn btn-primary" data-source="'+source+'">${conditionformat_Text.confirm}</button>
<button id="luckysheet-newConditionRule-dialog-close" class="btn btn-default" data-source="'+source+'">${conditionformat_Text.cancel}</button>`,
"style": "z-index:100003"
}));
let $t = $("#luckysheet-newConditionRule-dialog")
@ -1914,7 +1966,7 @@ const conditionformat = {
let content = '<div>' +
'<div class="boxTitle">选择规则类型:</div>' +
_this.ruleTypeHtml +
_this.ruleTypeHtml() +
'<div class="boxTitle">编辑规则说明:</div>' +
'<div class="ruleExplainBox">' +
ruleExplainHtml +
@ -2094,85 +2146,87 @@ const conditionformat = {
}).show();
},
getRuleExplain: function(index){
let textCellColorHtml = this.textCellColorHtml;
const conditionformat_Text = locale().conditionformat;
let textCellColorHtml = this.textCellColorHtml();
let ruleExplainHtml;
switch(index){
case 0: //基于各自值设置所有单元格的格式
ruleExplainHtml = '<div class="title">基于各自值设置所有单元格的格式:</div>' +
'<div style="height: 30px;margin-bottom: 5px;">' +
'<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">格式样式:</label>' +
'<select id="type1">' +
'<option value="dataBar">数据条</option>' +
'<option value="colorGradation">色阶</option>' +
'<option value="icons">图标集</option>' +
'</select>' +
'</div>' +
'<div>' +
'<div class="type1Box dataBarBox">' +
'<div style="height: 30px;margin-bottom: 5px;">' +
'<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">填充类型:</label>' +
'<select id="type2">' +
'<option value="gradient">渐变</option>' +
'<option value="solid">实心</option>' +
'</select>' +
'</div>' +
'<div style="height: 30px;margin-bottom: 5px;">' +
'<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">颜色:</label>' +
'<input data-tips="数据条颜色" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="#638ec6" style="display: none;">' +
'</div>' +
'</div>' +
'<div class="type1Box colorGradationBox" style="display: none;">' +
'<div style="height: 30px;margin-bottom: 5px;">' +
'<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">填充类型:</label>' +
'<select id="type2">' +
'<option value="threeColor">三色</option>' +
'<option value="twoColor">双色</option>' +
'</select>' +
'</div>' +
'<div class="maxVal" style="height: 30px;margin-bottom: 5px;">' +
'<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">最大值:</label>' +
'<input data-tips="最大值颜色" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="rgb(99, 190, 123)" style="display: none;">' +
'</div>' +
'<div class="midVal" style="height: 30px;margin-bottom: 5px;">' +
'<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">中间值:</label>' +
'<input data-tips="中间值颜色" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="rgb(255, 235, 132)" style="display: none;">' +
'</div>' +
'<div class="minVal" style="height: 30px;margin-bottom: 5px;">' +
'<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">最小值:</label>' +
'<input data-tips="最小值颜色" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="rgb(248, 105, 107)" style="display: none;">' +
'</div>' +
'</div>' +
'<div class="type1Box iconsBox" style="display: none;">' +
'<label>填充类型:</label>' +
'<div class="showbox">' +
'<div class="model" data-len="3" data-leftmin="0" data-top="0" title="三向箭头(彩色)" style="background-position: 0 0;"></div>' +
'<span class="ui-selectmenu-icon ui-icon ui-icon-triangle-1-s" style="margin-top: 2px;"></span>' +
'</div>' +
'<ul>' +
'<li><div data-len="3" data-leftmin="0" data-top="0" title="三向箭头(彩色)" style="background-position: 0 0;"></div></li>' +
'<li><div data-len="3" data-leftmin="5" data-top="0" title="三向箭头(灰色)" style="background-position: -131px 0;"></div></li>' +
'<li><div data-len="3" data-leftmin="0" data-top="1" title="3个三角形" style="background-position: 0 -20px;"></div></li>' +
'<li><div data-len="4" data-leftmin="0" data-top="2" title="四向箭头(彩色)" style="background-position: 0 -40px;"></div></li>' +
'<li><div data-len="4" data-leftmin="5" data-top="1" title="四向箭头(灰色)" style="background-position: -131px -20px;"></div></li>' +
'<li><div data-len="5" data-leftmin="0" data-top="3" title="五向箭头(彩色)" style="background-position: 0 -60px;"></div></li>' +
'<li><div data-len="5" data-leftmin="5" data-top="2" title="五向箭头(灰色)" style="background-position: -131px -40px;"></div></li>' +
'<li><div data-len="3" data-leftmin="0" data-top="4" title="三色交通灯(无边框)" style="background-position: 0 -80px;"></div></li>' +
'<li><div data-len="3" data-leftmin="5" data-top="4" title="三色交通灯(有边框)" style="background-position: -131px -80px;"></div></li>' +
'<li><div data-len="3" data-leftmin="0" data-top="5" title="三标志" style="background-position: 0 -100px;"></div></li>' +
'<li><div data-len="4" data-leftmin="5" data-top="5" title="四色交通灯" style="background-position: -131px -100px;"></div></li>' +
'<li><div data-len="4" data-leftmin="0" data-top="6" title="绿-红-黑渐变" style="background-position: 0 -120px;"></div></li>' +
'<li><div data-len="3" data-leftmin="0" data-top="7" title="三个符号(有圆圈)" style="background-position: 0 -140px;"></div></li>' +
'<li><div data-len="3" data-leftmin="5" data-top="7" title="三个符号(无圆圈)" style="background-position: -131px -140px;"></div></li>' +
'<li><div data-len="3" data-leftmin="0" data-top="8" title="三色旗" style="background-position: 0 -160px;"></div></li>' +
'<li><div data-len="3" data-leftmin="0" data-top="9" title="3个星形" style="background-position: 0 -180px;"></div></li>' +
'<li><div data-len="5" data-leftmin="0" data-top="10" title="五象限图" style="background-position: 0 -200px;"></div></li>' +
'<li><div data-len="5" data-leftmin="0" data-top="11" title="5个框" style="background-position: 0 -220px;"></div></li>' +
'<li><div data-len="4" data-leftmin="5" data-top="9" title="四等级" style="background-position: -131px -180px;"></div></li>' +
'<li><div data-len="5" data-leftmin="5" data-top="10" title="五等级" style="background-position: -131px -200px;"></div></li>' +
'</ul>' +
'</div>' +
'</div>';
ruleExplainHtml = `<div class="title">${conditionformat_Text.ruleTypeItem1}:</div>
<div style="height: 30px;margin-bottom: 5px;">
<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">${conditionformat_Text.formatStyle}</label>
<select id="type1">
<option value="dataBar">${conditionformat_Text.dataBar}</option>
<option value="colorGradation">${conditionformat_Text.colorGradation}</option>
<option value="icons">${conditionformat_Text.icons}</option>
</select>
</div>
<div>
<div class="type1Box dataBarBox">
<div style="height: 30px;margin-bottom: 5px;">
<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">${conditionformat_Text.fillType}</label>
<select id="type2">
<option value="gradient">${conditionformat_Text.gradient}</option>
<option value="solid">${conditionformat_Text.solid}</option>
</select>
</div>
<div style="height: 30px;margin-bottom: 5px;">
<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">${conditionformat_Text.color}</label>
<input data-tips="${conditionformat_Text.dataBarColor}" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="#638ec6" style="display: none;">
</div>
</div>
<div class="type1Box colorGradationBox" style="display: none;">
<div style="height: 30px;margin-bottom: 5px;">
<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">${conditionformat_Text.fillType}</label>
<select id="type2">
<option value="threeColor">${conditionformat_Text.tricolor}</option>
<option value="twoColor">${conditionformat_Text.twocolor}</option>
</select>
</div>
<div class="maxVal" style="height: 30px;margin-bottom: 5px;">
<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">${conditionformat_Text.maxValue}</label>
<input data-tips="${conditionformat_Text.maxValue} ${conditionformat_Text.color}" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="rgb(99, 190, 123)" style="display: none;">
</div>
<div class="midVal" style="height: 30px;margin-bottom: 5px;">
<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">${conditionformat_Text.medianValue}</label>
<input data-tips="${conditionformat_Text.medianValue} ${conditionformat_Text.color}" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="rgb(255, 235, 132)" style="display: none;">
</div>
<div class="minVal" style="height: 30px;margin-bottom: 5px;">
<label style="display: block;width: 80px;height: 30px;line-height: 30px;float: left;">${conditionformat_Text.minValue}</label>
<input data-tips="${conditionformat_Text.minValue} ${conditionformat_Text.color}" data-func="background" class="luckysheet-conditionformat-config-color" type="text" value="rgb(248, 105, 107)" style="display: none;">
</div>
</div>
<div class="type1Box iconsBox" style="display: none;">
<label>${conditionformat_Text.fillType}</label>
<div class="showbox">
<div class="model" data-len="3" data-leftmin="0" data-top="0" title="${conditionformat_Text.threeWayArrow}(${conditionformat_Text.multicolor})" style="background-position: 0 0;"></div>
<span class="ui-selectmenu-icon ui-icon ui-icon-triangle-1-s" style="margin-top: 2px;"></span>
</div>
<ul>
<li><div data-len="3" data-leftmin="0" data-top="0" title="${conditionformat_Text.threeWayArrow}(${conditionformat_Text.multicolor})" style="background-position: 0 0;"></div></li>
<li><div data-len="3" data-leftmin="5" data-top="0" title="${conditionformat_Text.threeWayArrow}(${conditionformat_Text.grayColor})" style="background-position: -131px 0;"></div></li>
<li><div data-len="3" data-leftmin="0" data-top="1" title="${conditionformat_Text.threeTriangles}" style="background-position: 0 -20px;"></div></li>
<li><div data-len="4" data-leftmin="0" data-top="2" title="${conditionformat_Text.fourWayArrow}(${conditionformat_Text.multicolor})" style="background-position: 0 -40px;"></div></li>
<li><div data-len="4" data-leftmin="5" data-top="1" title="${conditionformat_Text.fourWayArrow}(${conditionformat_Text.grayColor})" style="background-position: -131px -20px;"></div></li>
<li><div data-len="5" data-leftmin="0" data-top="3" title="${conditionformat_Text.fiveWayArrow}(${conditionformat_Text.multicolor})" style="background-position: 0 -60px;"></div></li>
<li><div data-len="5" data-leftmin="5" data-top="2" title="${conditionformat_Text.fiveWayArrow}(${conditionformat_Text.grayColor})" style="background-position: -131px -40px;"></div></li>
<li><div data-len="3" data-leftmin="0" data-top="4" title="${conditionformat_Text.threeColorTrafficLight}(${conditionformat_Text.rimless})" style="background-position: 0 -80px;"></div></li>
<li><div data-len="3" data-leftmin="5" data-top="4" title="${conditionformat_Text.threeColorTrafficLight}(${conditionformat_Text.bordered})" style="background-position: -131px -80px;"></div></li>
<li><div data-len="3" data-leftmin="0" data-top="5" title="三标志" style="background-position: 0 -100px;"></div></li>
<li><div data-len="4" data-leftmin="5" data-top="5" title="${conditionformat_Text.fourColorTrafficLight}" style="background-position: -131px -100px;"></div></li>
<li><div data-len="4" data-leftmin="0" data-top="6" title="绿-红-黑渐变" style="background-position: 0 -120px;"></div></li>
<li><div data-len="3" data-leftmin="0" data-top="7" title="三个符号(有圆圈)" style="background-position: 0 -140px;"></div></li>
<li><div data-len="3" data-leftmin="5" data-top="7" title="三个符号(无圆圈)" style="background-position: -131px -140px;"></div></li>
<li><div data-len="3" data-leftmin="0" data-top="8" title="三色旗" style="background-position: 0 -160px;"></div></li>
<li><div data-len="3" data-leftmin="0" data-top="9" title="3个星形" style="background-position: 0 -180px;"></div></li>
<li><div data-len="5" data-leftmin="0" data-top="10" title="五象限图" style="background-position: 0 -200px;"></div></li>
<li><div data-len="5" data-leftmin="0" data-top="11" title="5个框" style="background-position: 0 -220px;"></div></li>
<li><div data-len="4" data-leftmin="5" data-top="9" title="四等级" style="background-position: -131px -180px;"></div></li>
<li><div data-len="5" data-leftmin="5" data-top="10" title="五等级" style="background-position: -131px -200px;"></div></li>
</ul>
</div>
</div>`;
break;
case 1: //只为包含以下内容的单元格设置格式
ruleExplainHtml = '<div class="title">只为满足以下条件的单元格:</div>' +

594
src/controllers/constant.js

File diff suppressed because one or more lines are too long

13
src/controllers/freezen.js

@ -7,7 +7,8 @@ import menuButton from './menuButton';
import luckysheetPostil from './postil';
import luckysheetDropCell from './dropCell';
import { rowLocationByIndex, colLocationByIndex } from '../global/location';
import Store from '../store'
import Store from '../store';
import locale from '../locale/locale';
const luckysheetFreezen = {
freezenHorizontalHTML: '<div id="luckysheet-freezebar-horizontal" class="luckysheet-freezebar" tabindex="0"><div class="luckysheet-freezebar-handle luckysheet-freezebar-horizontal-handle" ><div class="luckysheet-freezebar-handle-bar luckysheet-freezebar-horizontal-handle-title" ></div><div class="luckysheet-freezebar-handle-bar luckysheet-freezebar-horizontal-handle-bar" ></div></div><div class="luckysheet-freezebar-drop luckysheet-freezebar-horizontal-drop" ><div class="luckysheet-freezebar-drop-bar luckysheet-freezebar-horizontal-drop-title" ></div><div class="luckysheet-freezebar-drop-bar luckysheet-freezebar-horizontal-drop-bar" >&nbsp;</div></div></div>',
@ -115,7 +116,9 @@ const luckysheetFreezen = {
_this.freezenverticaldata = freezenverticaldata;
$("#luckysheet-freezen-btn-horizontal").html('<i class="fa fa-indent"></i> 取消冻结');
$("#luckysheet-freezen-btn-horizontal").html('<i class="fa fa-indent"></i> '+locale().freezen.freezenCancel);
$("#luckysheet-freezebar-vertical").show().find(".luckysheet-freezebar-vertical-handle").css({ "left": left }).end().find(".luckysheet-freezebar-vertical-drop").css({ "left": left });
},
@ -235,7 +238,9 @@ const luckysheetFreezen = {
cancelFreezenHorizontal: function (sheetIndex) {
let _this = this;
$("#luckysheet-freezen-btn-horizontal").html('<i class="fa fa-list-alt"></i> 冻结首行');
$("#luckysheet-freezen-btn-horizontal").html('<i class="fa fa-list-alt"></i> '+locale().freezen.default);
_this.freezenhorizontaldata = null;
let ishorizontal = $("#luckysheet-freezebar-horizontal").is(":visible");
$("#luckysheet-freezebar-horizontal").hide();
@ -309,7 +314,7 @@ const luckysheetFreezen = {
_this.freezenhorizontaldata = freezenhorizontaldata;
$("#luckysheet-freezen-btn-horizontal").html('<i class="fa fa-list-alt"></i> 取消冻结');
$("#luckysheet-freezen-btn-horizontal").html('<i class="fa fa-list-alt"></i> '+locale().freezen.freezenCancel);
$("#luckysheet-freezebar-horizontal").show().find(".luckysheet-freezebar-horizontal-handle").css({ "top": top }).end().find(".luckysheet-freezebar-horizontal-drop").css({ "top": top });
},
createAssistCanvas: function(){

128
src/controllers/handler.js

@ -71,6 +71,7 @@ import { update, genarate } from '../global/format';
import method from '../global/method';
import { getBorderInfoCompute } from '../global/border';
import { luckysheetDrawMain } from '../global/draw';
import locale from '../locale/locale';
import Store from '../store';
//, columeflowset, rowflowset
@ -884,10 +885,10 @@ export default function luckysheetHandler() {
if (obj_s["row"] != null && obj_s["row"][0] == 0 && obj_s["row"][1] == Store.flowdata.length - 1) {
Store.luckysheetRightHeadClickIs = "column";
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("列");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text("宽");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("左");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("右");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.column);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.width);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.left);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.right);
$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").show();
@ -929,10 +930,10 @@ export default function luckysheetHandler() {
else if (obj_s["column"] != null && obj_s["column"][0] == 0 && obj_s["column"][1] == Store.flowdata[0].length - 1) {
Store.luckysheetRightHeadClickIs = "row";
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("行");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text("高");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("上");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("下");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.row);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.height);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.top);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.bottom);
$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").show();
@ -3647,22 +3648,24 @@ export default function luckysheetHandler() {
//菜单栏 截图按钮
$("#luckysheet-chart-btn-screenshot").click(function () {
const _locale = locale();
const locale_screenshot = _locale.screenshot;
if(Store.luckysheet_select_save.length == 0){
if(isEditMode()){
alert("请框选需要截图的范围");
alert(locale_screenshot.screenshotTipNoSelection);
}
else{
tooltip.info("提示!", "请框选需要截图的范围");
tooltip.info(locale_screenshot.screenshotTipTitle, locale_screenshot.screenshotTipNoSelection);
}
return;
}
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert("无法对多重选择区域执行此操作");
alert(locale_screenshot.screenshotTipHasMulti);
}
else{
tooltip.info("提示!", "无法对多重选择区域执行此操作");
tooltip.info(locale_screenshot.screenshotTipTitle, locale_screenshot.screenshotTipHasMulti);
}
return;
@ -3687,10 +3690,10 @@ export default function luckysheetHandler() {
if(has_PartMC){
if(isEditMode()){
alert("无法对合并单元格执行此操作");
alert(locale_screenshot.screenshotTipHasMerge);
}
else{
tooltip.info("提示!", "无法对合并单元格执行此操作");
tooltip.info(locale_screenshot.screenshotTipTitle, locale_screenshot.screenshotTipHasMerge);
}
return;
}
@ -3754,7 +3757,7 @@ export default function luckysheetHandler() {
}
let maxHeight = $(window).height() - 200;
tooltip.screenshot("截取成功!", '<div id="luckysheet-confirm-screenshot-save" style="height:'+ maxHeight +'px;overflow:auto;"></div>', url);
tooltip.screenshot(locale_screenshot.screenshotTipSuccess, '<div id="luckysheet-confirm-screenshot-save" style="height:'+ maxHeight +'px;overflow:auto;"></div>', url);
$("#luckysheet-confirm-screenshot-save").append(image);
newCanvas.remove();
});
@ -3762,7 +3765,8 @@ export default function luckysheetHandler() {
//截图下载
$(document).on("click", "a.download", function(){
let dataURI = $("#luckysheet-confirm-screenshot-save img").attr("src");
const _locale = locale();
const locale_screenshot = _locale.screenshot;
let binStr = atob(dataURI.split(",")[1]),
len = binStr.length,
arr = new Uint8Array(len);
@ -3775,7 +3779,7 @@ export default function luckysheetHandler() {
let element = document.createElement('a');
element.setAttribute('href', URL.createObjectURL(blob));
element.setAttribute('download', '截图.png');
element.setAttribute('download', locale_screenshot.screenshotImageName+'.png');
element.style.display = 'none';
document.body.appendChild(element);
@ -3817,7 +3821,7 @@ export default function luckysheetHandler() {
//冻结行列
$("#luckysheet-freezen-btn-horizontal").click(function () {
if($.trim($(this).text())=="取消冻结"){
if($.trim($(this).text())==locale().freezen.freezenCancel){
if (luckysheetFreezen.freezenverticaldata != null) {
luckysheetFreezen.cancelFreezenVertical();
luckysheetFreezen.createAssistCanvas();
@ -4562,10 +4566,10 @@ export default function luckysheetHandler() {
$("#luckysheet-cols-rows-shift").hide();
Store.luckysheetRightHeadClickIs = "row";
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("行");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text("高");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("上");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("下");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.row);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.height);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.top);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.bottom);
$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").show();
@ -4950,10 +4954,10 @@ export default function luckysheetHandler() {
}
Store.luckysheetRightHeadClickIs = "column";
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("列");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text("宽");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("左");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("右");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.column);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-size").text(locale().rightclick.width);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.left);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.right);
$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").show();
@ -5218,9 +5222,9 @@ export default function luckysheetHandler() {
let offset = $(this).offset();
$("#luckysheet-cols-rows-shift").show();
Store.luckysheetRightHeadClickIs = "column";
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text("列");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text("左");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text("右");
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-word").text(locale().rightclick.column);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-left").text(locale().rightclick.left);
$("#luckysheet-rightclick-menu .luckysheet-cols-rows-shift-right").text(locale().rightclick.right);
$("#luckysheet-cols-rows-add").show();
$("#luckysheet-cols-rows-data").hide();
@ -6493,8 +6497,8 @@ export default function luckysheetHandler() {
hideAfterPaletteSelect: false,
showSelectionPalette: true,
maxPaletteSize: 10,
cancelText: "取消",
chooseText: "确定颜色",
cancelText: locale().sheetconfig.cancelText,
chooseText: locale().sheetconfig.chooseText,
togglePaletteMoreText: "更多",
togglePaletteLessText: "少于",
clearText: "清除颜色选择",
@ -7522,13 +7526,14 @@ export default function luckysheetHandler() {
let luckysheet_sort_initial = true;
$("#luckysheetorderby").click(function () {
$("body .luckysheet-cols-menu").hide();
const _locale = locale();
const locale_sort = _locale.sort;
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert("不能对多重选择区域执行此操作,请选择单个区域,然后再试");
alert(locale_sort.noRangeError);
}
else{
tooltip.info("不能对多重选择区域执行此操作,请选择单个区域,然后再试", "");
tooltip.info(locale_sort.noRangeError, "");
}
return;
}
@ -7539,9 +7544,10 @@ export default function luckysheetHandler() {
if (luckysheet_sort_initial) {
luckysheet_sort_initial = false;
let content = '<div style="overflow: hidden;" class="luckysheet-sort-modal"><div><label><input type="checkbox" id="luckysheet-sort-haveheader"/><span>数据具有标题行</span></label></div><div style="overflow-y:auto;" id="luckysheet-sort-dialog-tablec"><table data-itemcount="0" cellspacing="0"> <tr><td>排序依据 <select name="sort_0"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> </td> <td> <div><label><input value="asc" type="radio" checked="checked" name="sort_0"><span>正序A-Z</span></label></div> <div><label><input value="desc" type="radio" name="sort_0"><span>倒序Z-A</span></label></div></td></tr></table></div><div style="background: #e5e5e5;border-top: 1px solid #f5f5f5; height: 1px; width: 100%;margin:2px 0px;margin-bottom:10px;"></div> <div> <span style="font-weight: bold; text-decoration: underline;text-align:center;color: blue;cursor: pointer;" class="luckysheet-sort-dialog-additem">+ 添加其他排序列</span> </div> </div>';
let content = `<div style="overflow: hidden;" class="luckysheet-sort-modal"><div><label><input type="checkbox" id="luckysheet-sort-haveheader"/><span>${locale_sort.hasTitle}</span></label></div><div style="overflow-y:auto;" id="luckysheet-sort-dialog-tablec"><table data-itemcount="0" cellspacing="0"> <tr><td>${locale_sort.hasTitle} <select name="sort_0"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> </td> <td> <div><label><input value="asc" type="radio" checked="checked" name="sort_0"><span>${locale_sort.asc}A-Z</span></label></div> <div><label><input value="desc" type="radio" name="sort_0"><span>${locale_sort.desc}Z-A</span></label></div></td></tr></table></div><div style="background: #e5e5e5;border-top: 1px solid #f5f5f5; height: 1px; width: 100%;margin:2px 0px;margin-bottom:10px;"></div> <div> <span style="font-weight: bold; text-decoration: underline;text-align:center;color: blue;cursor: pointer;" class="luckysheet-sort-dialog-additem">+ ${locale_sort.addOthers}</span> </div> </div>`;
$("body").append(replaceHtml(modelHTML, { "id": "luckysheet-sort-dialog", "addclass": "", "title": "排序范围", "content": content, "botton": '<button id="luckysheet-sort-modal-confirm" class="btn btn-primary">排序</button><button class="btn btn-default luckysheet-model-close-btn">关闭</button>' }));
$("body").append(replaceHtml(modelHTML, { "id": "luckysheet-sort-dialog", "addclass": "", "title": "排序范围", "content": content, "botton": `<button id="luckysheet-sort-modal-confirm" class="btn btn-primary">${locale_sort.confirm}</button><button class="btn btn-default luckysheet-model-close-btn">${locale_sort.close}</button>`}));
$("#luckysheet-sort-dialog .luckysheet-sort-dialog-additem").click(function () {
let last = Store.luckysheet_select_save[0];
@ -7556,7 +7562,7 @@ export default function luckysheetHandler() {
let v = getcellvalue(r1, c, Store.flowdata, "m");
if(v == null){
v = "列" + (c - c1 + 1);
v = locale_sort.columnOperation + (c - c1 + 1);
}
option += '<option value="' + c + '">' + v + '</option>';
@ -7566,7 +7572,19 @@ export default function luckysheetHandler() {
}
}
$("#luckysheet-sort-dialog table").append('<tr class="luckysheet-sort-dialog-tr"><td><span class="luckysheet-sort-item-close" onclick="$(this).parent().parent().remove();"><i class="fa fa-times" aria-hidden="true"></i></span>次要排序 <select name="sort_' + i + '">' + option + '</select> </td> <td> <div><label><input value="asc" type="radio" checked="checked" name="sort_' + i + '"><span>正序A-Z</span></label></div> <div><label><input value="desc" type="radio" name="sort_' + i + '"><span>倒序Z-A</span></label></div></td></tr>');
$("#luckysheet-sort-dialog table").append(`
<tr class="luckysheet-sort-dialog-tr">
<td><span class="luckysheet-sort-item-close" onclick="$(this).parent().parent().remove();"><i class="fa fa-times"
aria-hidden="true"></i></span>${locale_sort.secondaryTitle} <select
name="sort_${i}">${option}</select> </td>
<td>
<div><label><input value="asc" type="radio" checked="checked"
name="sort_${i}"><span>${locale_sort.asc}A-Z</span></label></div>
<div><label><input value="desc" type="radio" name="sort_${i}"><span>${locale_sort.desc}Z-A</span></label>
</div>
</td>
</tr>
`);
$("#luckysheet-sort-dialog table").data("itemcount", i);
});
@ -7583,7 +7601,7 @@ export default function luckysheetHandler() {
let v = getcellvalue(r1, c, Store.flowdata, "m");
if(v == null){
v = "列" + (c - c1 + 1);
v = locale_sort.columnOperation + (c - c1 + 1);
}
option += '<option value="' + c + '">' + v + '</option>';
@ -7598,14 +7616,14 @@ export default function luckysheetHandler() {
});
});
//自定义排序
//Custom sort
$("#luckysheet-sort-modal-confirm").click(function () {
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert("不能对多重选择区域执行此操作,请选择单个区域,然后再试");
alert(locale_sort.noRangeError);
}
else{
tooltip.info("不能对多重选择区域执行此操作,请选择单个区域,然后再试", "");
tooltip.info(locale_sort.noRangeError, "");
}
return;
@ -7617,7 +7635,7 @@ export default function luckysheetHandler() {
let r1 = last["row"][0], r2 = last["row"][1];
let c1 = last["column"][0], c2 = last["column"][1];
//数据具有标题行
//Data has header row
let t = $("#luckysheet-sort-haveheader").is(':checked');
let str;
@ -7628,7 +7646,8 @@ export default function luckysheetHandler() {
str = r1;
}
let hasMc = false; //排序选区是否有合并单元格
let hasMc = false; //Whether the sort selection has merged cells
let data = [];
for(let r = str; r <= r2; r++){
@ -7648,10 +7667,10 @@ export default function luckysheetHandler() {
if(hasMc){
if(isEditMode()){
alert("选区有合并单元格,无法执行此操作!");
alert(locale_sort.mergeError);
}
else{
tooltip.info("选区有合并单元格,无法执行此操作!", "");
tooltip.info(locale_sort.mergeError, "");
}
return;
@ -7706,7 +7725,7 @@ export default function luckysheetHandler() {
$("#luckysheet-sort-haveheader").prop("checked", false);
$("#luckysheet-sort-dialog input:radio:first").prop("checked", "checked");
$("#luckysheet-sort-dialog .luckysheet-modal-dialog-title-text").html("排序范围从<span>" + chatatABC(c1) + (r1 + 1) + "</span><span>" + chatatABC(c2) + (r2 + 1) + "</span>");
$("#luckysheet-sort-dialog .luckysheet-modal-dialog-title-text").html(locale_sort.sortRangeTitle+"<span>" + chatatABC(c1) + (r1 + 1) + "</span>"+ locale_sort.sortRangeTitleTo +"<span>" + chatatABC(c2) + (r2 + 1) + "</span>");
let $t = $("#luckysheet-sort-dialog"), myh = $t.outerHeight(), myw = $t.outerWidth();
let winw = $(window).width(), winh = $(window).height();
@ -7738,7 +7757,7 @@ export default function luckysheetHandler() {
}
});
//筛选事件处理
//filter event handler
let hidefilersubmenu = null;
$("#luckysheetfilter").click(createFilter);
@ -9681,9 +9700,11 @@ export default function luckysheetHandler() {
let reg2Arr = regArr[i].match(reg2);
for(let j = 0; j < reg2Arr.length; j++){
let cpValue = reg2Arr[j].replace(/<td.*?>/g, "").replace(/<\/td>/g, "");
cpRowArr.push(cpValue);
if(reg2Arr != null){
for(let j = 0; j < reg2Arr.length; j++){
let cpValue = reg2Arr[j].replace(/<td.*?>/g, "").replace(/<\/td>/g, "");
cpRowArr.push(cpValue);
}
}
cpDataArr.push(cpRowArr);
@ -9734,6 +9755,9 @@ export default function luckysheetHandler() {
}
}
const locale_fontjson = locale().fontjson;
if(txtdata.indexOf("luckysheet_copy_action_table") >- 1 && Store.luckysheet_copy_save["copyRange"] != null && Store.luckysheet_copy_save["copyRange"].length > 0 && isEqual){
//剪切板内容 和 luckysheet本身复制的内容 一致
if(Store.luckysheet_paste_iscut){
@ -9811,7 +9835,7 @@ export default function luckysheetHandler() {
let ffs = ff.split(",");
for(let i = 0; i < ffs.length; i++){
let fa = $.trim(ffs[i].toLowerCase());
fa = menuButton.fontjson[fa];
fa = locale_fontjson[fa];
if(fa == null){
cell.ff = 0;
}

244
src/controllers/menuButton.js

@ -600,10 +600,10 @@ const menuButton = {
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert("不能对多重选择区域执行此操作,请选择单个区域,然后再试");
alert(locale_alternatingColors.errorInfo);
}
else{
tooltip.info("不能对多重选择区域执行此操作,请选择单个区域,然后再试", "");
tooltip.info(locale_alternatingColors.errorInfo, "");
}
return;
}
@ -653,8 +653,14 @@ const menuButton = {
if($menuButton.length == 0){
let subid = "cell-color-self";
let coloritem = replaceHtml(_this.coloritem, { "class": "luckysheet-icon-alternateformat", "name": "交替颜色..." });
let menu = replaceHtml(_this.color, { "id": menuButtonId, "coloritem": coloritem, "colorself": subid, "sub": "" });
const _locale = locale();
const locale_toolbar = _locale.toolbar;
const locale_button = _locale.button;
const locale_alternatingColors = _locale.alternatingColors;
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);
@ -672,13 +678,13 @@ const menuButton = {
maxPaletteSize: 8,
maxSelectionSize: 8,
color: "#fff",
cancelText: "取消",
chooseText: "确定颜色",
togglePaletteMoreText: "自定义",
togglePaletteLessText: "收起",
cancelText: locale_button.cancel,
chooseText: locale_button.confirm,
togglePaletteMoreText: locale_toolbar.customColor,
togglePaletteLessText: locale_toolbar.collapse,
togglePaletteOnly: true,
clearText: "清除颜色选择",
noColorSelectedText: "没有颜色被选择",
clearText: locale_toolbar.clearText,
noColorSelectedText: locale_toolbar.noColorSelectedText,
localStorageKey: "spectrum.bgcolor" + server.gridKey,
palette: [
["#000", "#444", "#666", "#999", "#ccc", "#eee", "#f3f3f3", "#fff"],
@ -732,10 +738,10 @@ const menuButton = {
if(Store.luckysheet_select_save.length > 1){
if(isEditMode()){
alert("不能对多重选择区域执行此操作,请选择单个区域,然后再试");
alert(locale_alternatingColors.errorInfo);
}
else{
tooltip.info("不能对多重选择区域执行此操作,请选择单个区域,然后再试", "");
tooltip.info(locale_alternatingColors.errorInfo, "");
}
return;
}
@ -904,23 +910,26 @@ const menuButton = {
if($menuButton.length == 0){
let canvasH = 10, canvasW = 120;
const _locale = locale();
const locale_border = _locale.border;
const locale_toolbar = _locale.toolbar;
const locale_button = _locale.button;
let itemdata = [
{"text": "上框线", "value": "border-top", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-top" style="user-select: none;"> </div> </div>'},
{"text": "下框线", "value":"border-bottom", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-bottom" style="user-select: none;"> </div> </div>'},
{"text": "左框线", "value":"border-left", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-left" style="user-select: none;"> </div> </div>'},
{"text": "右框线", "value":"border-right", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-right" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderTop, "value": "border-top", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-top" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderBottom, "value":"border-bottom", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-bottom" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderLeft, "value":"border-left", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-left" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderRight, "value":"border-right", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-right" style="user-select: none;"> </div> </div>'},
{"text": "", "value": "split", "example":""},
{"text": "无", "value": "border-none", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-none" style="user-select: none;"> </div> </div>'},
{"text": "所有", "value": "border-all", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-all" style="user-select: none;"> </div> </div>'},
{"text": "外侧", "value": "border-outside", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-outside" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderNone, "value": "border-none", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-none" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderAll, "value": "border-all", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-all" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderOutside, "value": "border-outside", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-outside" style="user-select: none;"> </div> </div>'},
{"text": "", "value": "split", "example": ""},
{"text": "内侧", "value": "border-inside", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-inside" style="user-select: none;"> </div> </div>'},
{"text": "内侧横线", "value": "border-horizontal", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-horizontal" style="user-select: none;"> </div> </div>'},
{"text": "内侧竖线", "value": "border-vertical", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-vertical" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderInside, "value": "border-inside", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-inside" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderHorizontal, "value": "border-horizontal", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-horizontal" style="user-select: none;"> </div> </div>'},
{"text": locale_border.borderVertical, "value": "border-vertical", "example": '<div class="luckysheet-icon luckysheet-inline-block luckysheet-material-icon luckysheet-mousedown-cancel" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-border-vertical" style="user-select: none;"> </div> </div>'},
{"text": "", "value": "split", "example": ""},
{"text": "<span id='luckysheet-icon-borderColor-linecolor' class='luckysheet-mousedown-cancel' style='border-bottom:3px solid #000;'>边框颜色</span>", "value":"borderColor", "example":"more"},
{"text": "边框粗细<img id='luckysheetborderSizepreview' width=100 height=10 src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==' style='position:absolute;bottom:-5px;right:0px;width:100px;height:10px;'>", "value":"borderSize", "example":"more"}
{"text": "<span id='luckysheet-icon-borderColor-linecolor' class='luckysheet-mousedown-cancel' style='border-bottom:3px solid #000;'>"+ locale_border.borderColor +"</span>", "value":"borderColor", "example":"more"},
{"text": ""+ locale_border.borderSize +"<img id='luckysheetborderSizepreview' width=100 height=10 src='data:image/gif;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQImWNgYGBgAAAABQABh6FO1AAAAABJRU5ErkJggg==' style='position:absolute;bottom:-5px;right:0px;width:100px;height:10px;'>", "value":"borderSize", "example":"more"}
];
let itemset = _this.createButtonMenu(itemdata);
@ -928,7 +937,7 @@ const menuButton = {
let menu = replaceHtml(_this.menu, { "id": "border-menu", "item": itemset, "subclass": "", "sub": "" });
let subitemdata = [
{"text": "无边框", "value": "0", "example": ""},
{"text": locale_border.borderNone, "value": "0", "example": ""},
{"text": "<canvas type='Thin' class='border-Thin' width="+ canvasW +" height="+ canvasH +" style='width:"+ canvasW +"px;height:"+ canvasH +"px;position:static;'></canvas>", "value": "1", "example": ""},
{"text": "<canvas type='Hair' class='border-Hair' width="+ canvasW +" height="+ canvasH +" style='width:"+ canvasW +"px;height:"+ canvasH +"px;position:static;'></canvas>", "value": "2", "example": ""},
{"text": "<canvas type='Dotted' class='border-Dotted' width="+ canvasW +" height="+ canvasH +" style='width:"+ canvasW +"px;height:"+ canvasH +"px;position:static;'></canvas>", "value": "3", "example": ""},
@ -948,10 +957,10 @@ const menuButton = {
let submenu = replaceHtml(_this.menu, { "id": "borderSize", "item": subitemset, "subclass": "luckysheet-menuButton-sub" });
let submenuid = "luckysheet-icon-borderSize-menuButton";
let subcolormenuid = "luckysheet-icon-borderColor-menuButton";
let colormenu = replaceHtml(_this.color, { "id": subcolormenuid, "coloritem": "", "colorself": "", "sub": "luckysheet-menuButton-sub" });
let colormenu = replaceHtml(_this.color, { "id": subcolormenuid, "coloritem": "", "colorself": "", "sub": "luckysheet-menuButton-sub",resetColor:locale_toolbar.resetColor });
$("body").append(menu + colormenu + submenu);
$menuButton = $("#" + menuButtonId).width(150);
$menuButton = $("#" + menuButtonId).width(160);
_this.focus($menuButton, "border-all");
$("#" + submenuid + " canvas").each(function(i){
@ -1066,13 +1075,13 @@ const menuButton = {
maxPaletteSize: 8,
maxSelectionSize: 8,
color: "#000",
cancelText: "取消",
chooseText: "确定颜色",
togglePaletteMoreText: "自定义",
togglePaletteLessText: "收起",
cancelText: locale_button.cancel,
chooseText: locale_button.confirm,
togglePaletteMoreText: locale_toolbar.customColor,
togglePaletteLessText: locale_toolbar.collapse,
togglePaletteOnly: true,
clearText: "清除颜色选择",
noColorSelectedText: "没有颜色被选择",
clearText: locale_toolbar.clearText,
noColorSelectedText:locale_toolbar.noColorSelectedText,
localStorageKey: "spectrum.bordercolor" + server.gridKey,
palette: [
["#000", "#444", "#666", "#999", "#ccc", "#eee", "#f3f3f3", "#fff"],
@ -1166,11 +1175,14 @@ const menuButton = {
let $menuButton = $("#" + menuButtonId);
if($menuButton.length == 0){
const _locale = locale();
const locale_merge = _locale.merge;
let itemdata = [
{"text": "全部合并", "value": "mergeAll", "example": ""},
{"text": "垂直合并", "value": "mergeV", "example": ""},
{"text": "水平合并", "value": "mergeH", "example": ""},
{"text": "取消合并", "value": "mergeCancel", "example": ""}
{"text": locale_merge.mergeAll, "value": "mergeAll", "example": ""},
{"text": locale_merge.mergeV, "value": "mergeV", "example": ""},
{"text": locale_merge.mergeH, "value": "mergeH", "example": ""},
{"text": locale_merge.mergeCancel, "value": "mergeCancel", "example": ""}
];
let itemset = _this.createButtonMenu(itemdata);
@ -1187,10 +1199,10 @@ const menuButton = {
if(selectIsOverlap()){
if(isEditMode()){
alert("不能合并重叠区域");
alert(locale_merge.overlappingError);
}
else{
tooltip.info("不能合并重叠区域", "");
tooltip.info(locale_merge.overlappingError, "");
}
return;
}
@ -1213,10 +1225,10 @@ const menuButton = {
if(has_PartMC){
if(isEditMode()){
alert("无法对部分合并单元格执行此操作");
alert(locale_merge.partiallyError);
}
else{
tooltip.info("无法对部分合并单元格执行此操作", "");
tooltip.info(locale_merge.partiallyError, "");
}
return;
}
@ -1256,10 +1268,12 @@ const menuButton = {
let $menuButton = $("#" + menuButtonId);
if($menuButton.length == 0){
const _locale = locale();
const locale_align = _locale.align;
let itemdata = [
{"text": "左对齐", "value": "left", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-left" style="user-select: none;"> </div> </div>'},
{"text": "中间对齐", "value": "center", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-center" style="user-select: none;"> </div> </div>'},
{"text": "右对齐", "value": "right", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-right" style="user-select: none;"> </div> </div>'}
{"text": locale_align.left, "value": "left", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-left" style="user-select: none;"> </div> </div>'},
{"text": locale_align.center, "value": "center", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-center" style="user-select: none;"> </div> </div>'},
{"text": locale_align.right, "value": "right", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-align-right" style="user-select: none;"> </div> </div>'}
];
let itemset = _this.createButtonMenu(itemdata);
@ -1309,12 +1323,13 @@ const menuButton = {
$("#luckysheet-icon-valign-menu").click(function(){
let menuButtonId = $(this).attr("id") + "-menuButton";
let $menuButton = $("#" + menuButtonId);
const _locale = locale();
const locale_align = _locale.align;
if($menuButton.length == 0){
let itemdata = [
{"text": "顶部对齐", "value": "top", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-top" style="user-select: none;"> </div> </div>'},
{"text": "居中对齐", "value": "middle", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-middle" style="user-select: none;"> </div> </div>'},
{"text": "底部对齐", "value": "bottom", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-bottom" style="user-select: none;"> </div> </div>'}
{"text": locale_align.top, "value": "top", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-top" style="user-select: none;"> </div> </div>'},
{"text": locale_align.middle, "value": "middle", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-middle" style="user-select: none;"> </div> </div>'},
{"text": locale_align.bottom, "value": "bottom", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-valign-bottom" style="user-select: none;"> </div> </div>'}
];
let itemset = _this.createButtonMenu(itemdata);
@ -1356,10 +1371,12 @@ const menuButton = {
let $menuButton = $("#" + menuButtonId);
if($menuButton.length == 0){
const _locale = locale();
const locale_textWrap = _locale.textWrap;
let itemdata = [
{"text": "溢出", "value": "overflow", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-overflow" style="user-select: none;"> </div> </div>'},
{"text": "自动换行", "value": "wrap", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-wrap" style="user-select: none;"> </div> </div>'},
{"text": "截断", "value": "clip", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-clip" style="user-select: none;"> </div> </div>'}
{"text": locale_textWrap.overflow, "value": "overflow", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-overflow" style="user-select: none;"> </div> </div>'},
{"text": locale_textWrap.wrap, "value": "wrap", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-wrap" style="user-select: none;"> </div> </div>'},
{"text": locale_textWrap.clip, "value": "clip", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-textwrap-clip" style="user-select: none;"> </div> </div>'}
];
let itemset = _this.createButtonMenu(itemdata);
@ -1401,13 +1418,15 @@ const menuButton = {
let $menuButton = $("#" + menuButtonId);
if($menuButton.length == 0){
const _locale = locale();
const locale_rotation = _locale.rotation;
let itemdata = [
{"text": "无旋转", "value": "none", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none" style="user-select: none;"> </div> </div>'},
{"text": "向上倾斜", "value": "angleup", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-angleup" style="user-select: none;"> </div> </div>'},
{"text": "向下倾斜", "value": "angledown", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-angledown" style="user-select: none;"> </div> </div>'},
{"text": "竖排文字", "value": "vertical", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-vertical" style="user-select: none;"> </div> </div>'},
{"text": "向上90°", "value": "rotation-up", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-rotation-up" style="user-select: none;"> </div> </div>'},
{"text": "向下90°", "value": "rotation-down", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-rotation-down" style="user-select: none;"> </div> </div>'},
{"text": locale_rotation.none, "value": "none", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-none" style="user-select: none;"> </div> </div>'},
{"text": locale_rotation.angleup, "value": "angleup", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-angleup" style="user-select: none;"> </div> </div>'},
{"text": locale_rotation.angledown, "value": "angledown", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-angledown" style="user-select: none;"> </div> </div>'},
{"text": locale_rotation.vertical, "value": "vertical", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-vertical" style="user-select: none;"> </div> </div>'},
{"text": locale_rotation.rotationUp, "value": "rotation-up", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-rotation-up" style="user-select: none;"> </div> </div>'},
{"text": locale_rotation.rotationDown, "value": "rotation-down", "example": '<div class="luckysheet-icon luckysheet-inline-block" style="user-select: none;opacity:1;"> <div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-rotation-rotation-down" style="user-select: none;"> </div> </div>'},
];
let itemset = _this.createButtonMenu(itemdata);
@ -1449,16 +1468,18 @@ const menuButton = {
let $menuButton = $("#" + menuButtonId);
if($menuButton.length == 0){
const _locale = locale();
const locale_freezen = _locale.freezen;
let itemdata = [
{"text": "冻结首行", "value": "freezenRow", "example": ''},
{"text": "冻结首列", "value": "freezenColumn", "example": ''},
{"text": "冻结行列", "value": "freezenRC", "example": ''},
{"text": locale_freezen.freezenRow, "value": "freezenRow", "example": ''},
{"text": locale_freezen.freezenColumn, "value": "freezenColumn", "example": ''},
{"text": locale_freezen.freezenRC, "value": "freezenRC", "example": ''},
{"text": "", "value": "split", "example": ""},
{"text": "冻结行到选区", "value": "freezenRowRange", "example": ''},
{"text": "冻结列到选区", "value": "freezenColumnRange", "example": ''},
{"text": "冻结行列到选区", "value": "freezenRCRange", "example": ''},
{"text": locale_freezen.freezenRowRange, "value": "freezenRowRange", "example": ''},
{"text": locale_freezen.freezenColumnRange, "value": "freezenColumnRange", "example": ''},
{"text": locale_freezen.freezenRCRange, "value": "freezenRCRange", "example": ''},
{"text": "", "value": "split", "example": ""},
{"text": "取消冻结", "value": "freezenCancel", "example": ''}
{"text": locale_freezen.freezenCancel, "value": "freezenCancel", "example": ''}
];
let itemset = _this.createButtonMenu(itemdata);
@ -1466,7 +1487,7 @@ const menuButton = {
let menu = replaceHtml(_this.menu, { "id": "freezen-menu", "item": itemset, "subclass": "", "sub": "" });
$("body").append(menu);
$menuButton = $("#" + menuButtonId).width(130);
$menuButton = $("#" + menuButtonId).width(160);
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
@ -1544,10 +1565,10 @@ const menuButton = {
else if(itemvalue == "freezenRowRange"){ //选区行冻结
if(Store.luckysheet_select_save == null || Store.luckysheet_select_save.length == 0){
if(isEditMode()){
alert("没有选区");
alert(locale_freezen.noSeletionError);
}
else{
tooltip.info("没有选区", "");
tooltip.info(locale_freezen.noSeletionError, "");
}
return;
@ -1584,10 +1605,10 @@ const menuButton = {
else if(itemvalue == "freezenColumnRange"){ //选区列冻结
if(Store.luckysheet_select_save == null || Store.luckysheet_select_save.length == 0){
if(isEditMode()){
alert("没有选区");
alert(locale_freezen.noSeletionError);
}
else{
tooltip.info("没有选区","");
tooltip.info(locale_freezen.noSeletionError,"");
}
return;
@ -1624,10 +1645,10 @@ const menuButton = {
else if(itemvalue == "freezenRCRange"){ //选区行列冻结
if(Store.luckysheet_select_save == null || Store.luckysheet_select_save.length == 0){
if(isEditMode()){
alert("没有选区");
alert(locale_freezen.noSeletionError);
}
else{
tooltip.info("没有选区","");
tooltip.info(locale_freezen.noSeletionError,"");
}
return;
@ -1675,7 +1696,7 @@ const menuButton = {
luckysheetFreezen.createAssistCanvas();
luckysheetrefreshgrid();
}
else if(itemvalue == "freezenCancel"){ //取消冻结
else if(itemvalue == "freezenCancel"){ //Cancel freezen
if (luckysheetFreezen.freezenverticaldata != null) {
luckysheetFreezen.cancelFreezenVertical();
luckysheetFreezen.createAssistCanvas();
@ -1713,13 +1734,16 @@ const menuButton = {
let $menuButton = $("#" + menuButtonId);
if($menuButton.length == 0){
const _locale = locale();
const locale_sort = _locale.sort;
const locale_filter = _locale.filter;
let itemdata = [
{"text": "升序", "value": "asc", "example": '<i style="font-size:14px;" class="fa fa-sort-numeric-asc" aria-hidden="true"></i>'},
{"text": "降序", "value": "desc", "example": '<i style="font-size:14px;" class="fa fa-sort-numeric-desc" aria-hidden="true"></i>'},
{"text": "自定义排序...", "value": "diysort", "example": '<i style="font-size:14px;" class="fa fa-sort" aria-hidden="true"></i>'},
{"text": locale_sort.asc, "value": "asc", "example": '<i style="font-size:14px;" class="fa fa-sort-numeric-asc" aria-hidden="true"></i>'},
{"text": locale_sort.desc, "value": "desc", "example": '<i style="font-size:14px;" class="fa fa-sort-numeric-desc" aria-hidden="true"></i>'},
{"text": locale_sort.custom+"...", "value": "diysort", "example": '<i style="font-size:14px;" class="fa fa-sort" aria-hidden="true"></i>'},
{"text": "", "value": "split", "example": ""},
{"text": "筛选", "value": "filter", "example": '<i style="font-size:14px;" class="fa fa-filter" aria-hidden="true"></i>'},
{"text": "清除筛选", "value": "clearfilter", "example": '<i style="font-size:14px;" class="fa fa-window-close" aria-hidden="true"></i>'}
{"text": locale_filter.filter, "value": "filter", "example": '<i style="font-size:14px;" class="fa fa-filter" aria-hidden="true"></i>'},
{"text": locale_filter.clearFilter, "value": "clearfilter", "example": '<i style="font-size:14px;" class="fa fa-window-close" aria-hidden="true"></i>'}
];
let itemset = _this.createButtonMenu(itemdata);
@ -1772,22 +1796,23 @@ const menuButton = {
$("#luckysheet-icon-seachmore").click(function(){
let menuButtonId = $(this).attr("id") + "-menuButton";
let $menuButton = $("#" + menuButtonId);
const _locale = locale();
const locale_findAndReplace = _locale.findAndReplace;
if($menuButton.length == 0){
let itemdata = [
{"text": "查找 ...", "value": "search", "example": '<i style="font-size:14px;" class="fa fa-search" aria-hidden="true"></i>'},
{"text": "替换 ...", "value": "replace", "example": '<i style="font-size:14px;" class="fa fa-files-o" aria-hidden="true"></i>'},
{"text": "转到 ...", "value": "goto", "example": '<i style="font-size:14px;" class="fa fa-arrow-right" aria-hidden="true"></i>'},
{"text": locale_findAndReplace.find+" ...", "value": "search", "example": '<i style="font-size:14px;" class="fa fa-search" aria-hidden="true"></i>'},
{"text": locale_findAndReplace.replace+" ...", "value": "replace", "example": '<i style="font-size:14px;" class="fa fa-files-o" aria-hidden="true"></i>'},
{"text": locale_findAndReplace.goto+" ...", "value": "goto", "example": '<i style="font-size:14px;" class="fa fa-arrow-right" aria-hidden="true"></i>'},
{"text": "", "value": "split", "example": ""},
{"text": "定位条件 ...", "value": "location", "example": '<i style="font-size:14px;" class="fa fa-location-arrow" aria-hidden="true"></i>'},
{"text": "公式", "value": "locationFormula", "example": '定位'},
{"text": "日期", "value": "locationConstantDate", "example": '定位'},
{"text": "数字", "value": "locationConstantNumber", "example": '定位'},
{"text": "字符", "value": "locationConstantString", "example": '定位'},
{"text": "错误", "value": "locationConstantError", "example": '定位'},
{"text": "条件格式", "value": "locationCF", "example": '定位'},
{"text": "间隔行", "value": "locationStepRow", "example": '定位'},
{"text": "间隔列", "value": "locationStepColumn", "example": '定位'}
{"text": locale_findAndReplace.location+" ...", "value": "location", "example": '<i style="font-size:14px;" class="fa fa-location-arrow" aria-hidden="true"></i>'},
{"text": locale_findAndReplace.formula, "value": "locationFormula", "example": locale_findAndReplace.locationExample},
{"text": locale_findAndReplace.date, "value": "locationConstantDate", "example": locale_findAndReplace.locationExample},
{"text": locale_findAndReplace.number, "value": "locationConstantNumber", "example": locale_findAndReplace.locationExample},
{"text": locale_findAndReplace.string, "value": "locationConstantString", "example": locale_findAndReplace.locationExample},
{"text": locale_findAndReplace.error, "value": "locationConstantError", "example": locale_findAndReplace.locationExample},
{"text": locale_findAndReplace.condition, "value": "locationCF", "example": locale_findAndReplace.locationExample},
{"text": locale_findAndReplace.rowSpan, "value": "locationStepRow", "example": locale_findAndReplace.locationExample},
{"text": locale_findAndReplace.columnSpan, "value": "locationStepColumn", "example": locale_findAndReplace.locationExample}
];
let itemset = _this.createButtonMenu(itemdata);
@ -1795,7 +1820,7 @@ const menuButton = {
let menu = replaceHtml(_this.menu, { "id": "seachmore", "item": itemset, "subclass": "", "sub": "" });
$("body").append(menu);
$menuButton = $("#" + menuButtonId).width(150);
$menuButton = $("#" + menuButtonId).width(180);
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
@ -1853,10 +1878,10 @@ const menuButton = {
else if(itemvalue == "locationStepRow"){ //间隔行
if(Store.luckysheet_select_save.length == 0 || (Store.luckysheet_select_save.length == 1 && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1])){
if(isEditMode()){
alert("请选择最少两行");
alert(locale_findAndReplace.lessTwoRowTip);
}
else{
tooltip.info("提示", "请选择最少两行");
tooltip.info("", locale_findAndReplace.lessTwoRowTip);
}
return;
}
@ -1868,10 +1893,10 @@ const menuButton = {
else if(itemvalue == "locationStepColumn"){ //间隔列
if(Store.luckysheet_select_save.length == 0 || (Store.luckysheet_select_save.length == 1 && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1])){
if(isEditMode()){
alert("请选择最少两列");
alert(locale_findAndReplace.lessTwoColumnTip);
}
else{
tooltip.info("提示", "请选择最少两列");
tooltip.info("", locale_findAndReplace.lessTwoColumnTip);
}
return;
}
@ -2568,6 +2593,8 @@ const menuButton = {
$("#luckysheet-icon-postil").click(function(){
let menuButtonId = $(this).attr("id")+"-menuButton";
let $menuButton = $("#" + menuButtonId);
const locale_comment = locale().comment;
$menuButton.remove();
@ -2589,18 +2616,18 @@ const menuButton = {
let itemdata;
if(Store.flowdata[row_index][col_index] != null && Store.flowdata[row_index][col_index].ps != null){
itemdata = [
{"text": "编辑批注", "value": "editPs", "example": ""},
{"text": "删除", "value": "delPs", "example": ""},
{"text": locale_comment.edit, "value": "editPs", "example": ""},
{"text": locale_comment.delete, "value": "delPs", "example": ""},
{"text": "", "value": "split", "example": ""},
{"text": "显示/隐藏批注", "value": "showHidePs", "example": ""},
{"text": "显示/隐藏所有批注", "value": "showHideAllPs", "example": ""}
{"text": locale_comment.showOne, "value": "showHidePs", "example": ""},
{"text": locale_comment.showAll, "value": "showHideAllPs", "example": ""}
];
}
else{
itemdata = [
{"text": "新建批注", "value": "newPs", "example": ""},
{"text": locale_comment.insert, "value": "newPs", "example": ""},
{"text": "", "value": "split", "example": ""},
{"text": "显示/隐藏所有批注", "value": "showHideAllPs", "example": ""}
{"text": locale_comment.showAll, "value": "showHideAllPs", "example": ""}
];
}
@ -3307,8 +3334,9 @@ 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;
const _locale = locale();
const locale_fontarray = _locale.fontarray;
const locale_fontjson = _locale.fontjson;
for(let i = 0; i < foucsList.length; i++){
let attr = foucsList[i];
let foucsStatus = _this.checkstatus(d, r, c, attr);
@ -3340,7 +3368,7 @@ const menuButton = {
else if(attr == "ff"){
let menuButtonId = "luckysheet-icon-font-family-menuButton";
let $menuButton = $("#" + menuButtonId);
const locale_fontarray = locale().fontarray;
// const locale_fontarray = locale().fontarray;
let itemname = locale_fontarray[0], itemvalue = 0;
if(foucsStatus != null){
if(isdatatypemulti(foucsStatus)["num"]){
@ -3348,7 +3376,7 @@ const menuButton = {
itemname = locale_fontarray[itemvalue];
}
else{
itemvalue = _this.fontjson[foucsStatus];
itemvalue = locale_fontjson[foucsStatus];
itemname = locale_fontarray[itemvalue];
}
}
@ -3606,7 +3634,9 @@ const menuButton = {
"13": "Thick"
};
type = borderType[type.toString()];
type = borderType[type.toString()];
canvasborder.save();
try {
if(type == "Hair"){

4
src/controllers/pivotTable.js

@ -881,8 +881,8 @@ const pivotTable = {
$("body").append(replaceHtml(modelHTML, { "id": "luckysheet-data-pivotTable-selection", "addclass": "luckysheet-data-pivotTable-selection", "title": "选取数据范围", "content": '<input id="luckysheet-pivotTable-range-selection-input" class="luckysheet-datavisual-range-container" style="font-size: 14px;padding:5px;max-width:none;" spellcheck="false" aria-label="数据范围" placeholder="数据范围">', "botton": '<button id="luckysheet-pivotTable-selection-confirm" class="btn btn-primary">确认选取</button><button class="btn btn-default luckysheet-model-close-btn">取消</button>' }));
$("body").append(replaceHtml(filtermenuHTML, { "menuid": "pivotTableFilter" }));
$("body").append(replaceHtml(filtersubmenuHTML, { "menuid": "pivotTableFilter" }));
$("body").append(replaceHtml(filtermenuHTML(), { "menuid": "pivotTableFilter" }));
$("body").append(replaceHtml(filtersubmenuHTML(), { "menuid": "pivotTableFilter" }));
$("body").append(pivottableconfigHTML);
$("body").append(pivottablesumHTML);

15
src/controllers/resize.js

@ -2,6 +2,7 @@ import luckysheetConfigsetting from './luckysheetConfigsetting';
import luckysheetFreezen from './freezen';
import { luckysheetrefreshgrid } from '../global/refresh';
import Store from '../store';
import locale from '../locale/locale';
let gridW = 0,
gridH = 0;
@ -103,10 +104,11 @@ export default function luckysheetsizeauto() {
luckysheetFreezen.createAssistCanvas();
luckysheetrefreshgrid($("#luckysheet-cell-main").scrollLeft(), $("#luckysheet-cell-main").scrollTop());
const _locale = locale();
const locale_toolbar = _locale.toolbar;
let ismore = false,
toolbarW = 0,
morebtn = '<div class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;"> </div><div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="更多按钮" id="luckysheet-icon-morebtn" role="button" style="user-select: none;"> <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block" style="user-select: none;"> <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block" style="user-select: none;"> <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block" style="user-select: none;color:#0188fb;"><i class="fa fa-list-ul"></i> 更多... </div> </div> </div> </div>',
morebtn = '<div class="luckysheet-toolbar-separator luckysheet-inline-block" style="user-select: none;"> </div><div class="luckysheet-toolbar-button luckysheet-inline-block" data-tips="'+ locale_toolbar.toolMoreTip +'" id="luckysheet-icon-morebtn" role="button" style="user-select: none;"> <div class="luckysheet-toolbar-button-outer-box luckysheet-inline-block" style="user-select: none;"> <div class="luckysheet-toolbar-button-inner-box luckysheet-inline-block" style="user-select: none;"> <div class="luckysheet-toolbar-menu-button-caption luckysheet-inline-block" style="user-select: none;color:#0188fb;"><i class="fa fa-list-ul"></i> '+ locale_toolbar.toolMore +'... </div> </div> </div> </div>',
morediv = '<div id="luckysheet-icon-morebtn-div" class="luckysheet-wa-editor" style="position:absolute;top:'+ (Store.infobarHeight + Store.toolbarHeight + 2 + $("#" + Store.container).offset().top + $("body").scrollTop() ) +'px; right:0px;z-index:1003;padding-left:0px;display:none;height:auto;white-space:initial;"></div>';
if($("#luckysheet-icon-morebtn-div").length == 0){
@ -123,7 +125,7 @@ export default function luckysheetsizeauto() {
let $t = $(this);
toolbarW += $t.outerWidth();
if(!ismore && toolbarW > gridW - 120){
if(!ismore && toolbarW > gridW - 140){
ismore = true;
}
@ -133,17 +135,18 @@ export default function luckysheetsizeauto() {
});
if(ismore){
$("#luckysheet-wa-editor").append(morebtn);
$("#luckysheet-icon-morebtn").click(function(){
let right = $(window).width() - $("#luckysheet-icon-morebtn").offset().left - $("#luckysheet-icon-morebtn").width()+ $("body").scrollLeft();
$("#luckysheet-icon-morebtn-div").toggle().css("right", right < 0 ? 0 : right);
let $txt = $(this).find(".luckysheet-toolbar-menu-button-caption");
if($txt.text().indexOf("更多") > -1){
$(this).find(".luckysheet-toolbar-menu-button-caption").html('<i class="fa fa-list-ul"></i> 收起... ');
if($txt.text().indexOf(locale_toolbar.toolMore) > -1){
$(this).find(".luckysheet-toolbar-menu-button-caption").html('<i class="fa fa-list-ul"></i> '+ locale_toolbar.toolClose +'... ');
}
else{
$(this).find(".luckysheet-toolbar-menu-button-caption").html('<i class="fa fa-list-ul"></i> 更多... ');
$(this).find(".luckysheet-toolbar-menu-button-caption").html('<i class="fa fa-list-ul"></i> '+ locale_toolbar.toolMore +'... ');
}
});

77
src/controllers/searchReplace.js

@ -11,6 +11,7 @@ import editor from '../global/editor';
import tooltip from '../global/tooltip';
import func_methods from '../global/func_methods';
import Store from '../store';
import locale from '../locale/locale';
//查找替换
const luckysheetSearchReplace = {
@ -18,34 +19,37 @@ const luckysheetSearchReplace = {
$("#luckysheet-modal-dialog-mask").hide();
$("#luckysheet-search-replace").remove();
const _locale = locale();
const locale_findAndReplace = _locale.findAndReplace;
let content = '<div class="tabBox">' +
'<span id="searchTab">查找</span>' +
'<span id="replaceTab">替换</span>' +
'<span id="searchTab">'+ locale_findAndReplace.find +'</span>' +
'<span id="replaceTab">'+ locale_findAndReplace.replace +'</span>' +
'</div>' +
'<div class="ctBox">' +
'<div class="inputBox">' +
'<div class="textboxs" id="searchInput">查找内容:<input class="formulaInputFocus" spellcheck="false" value=""/></div>' +
'<div class="textboxs" id="replaceInput">替换内容:<input class="formulaInputFocus" spellcheck="false" value=""/></div>' +
'<div class="textboxs" id="searchInput">'+ locale_findAndReplace.findTextbox +':<input class="formulaInputFocus" spellcheck="false" value=""/></div>' +
'<div class="textboxs" id="replaceInput">'+ locale_findAndReplace.replaceTextbox +':<input class="formulaInputFocus" spellcheck="false" value=""/></div>' +
'<div class="checkboxs">' +
'<div id="regCheck">' +
'<input type="checkbox"/>' +
'<span>正则表达式匹配</span>' +
'<span>'+ locale_findAndReplace.regexTextbox +'</span>' +
'</div>' +
'<div id="wordCheck">' +
'<input type="checkbox"/>' +
'<span>整词匹配</span>' +
'<span>'+ locale_findAndReplace.wholeTextbox +'</span>' +
'</div>' +
'<div id="caseCheck">' +
'<input type="checkbox"/>' +
'<span>区分大小写匹配</span>' +
'<span>'+ locale_findAndReplace.distinguishTextbox +'</span>' +
'</div>' +
'</div>' +
'</div>' +
'<div class="btnBox">' +
'<button id="replaceAllBtn" class="btn btn-default">全部替换</button>' +
'<button id="replaceBtn" class="btn btn-default">替换</button>' +
'<button id="searchAllBtn" class="btn btn-default">查找全部</button>' +
'<button id="searchNextBtn" class="btn btn-default">查找下一个</button>' +
'<button id="replaceAllBtn" class="btn btn-default">'+ locale_findAndReplace.allReplaceBtn +'</button>' +
'<button id="replaceBtn" class="btn btn-default">'+ locale_findAndReplace.replaceBtn +'</button>' +
'<button id="searchAllBtn" class="btn btn-default">'+ locale_findAndReplace.allFindBtn +'</button>' +
'<button id="searchNextBtn" class="btn btn-default">'+ locale_findAndReplace.findBtn +'</button>' +
'</div>' +
'</div>';
@ -57,7 +61,7 @@ const luckysheetSearchReplace = {
"botton": '<button class="btn btn-default luckysheet-model-close-btn">关闭</button>',
"style": "z-index:100003"
}));
let $t = $("#luckysheet-search-replace").find(".luckysheet-modal-dialog-content").css("min-width", 400).end(),
let $t = $("#luckysheet-search-replace").find(".luckysheet-modal-dialog-content").css("min-width", 500).end(),
myh = $t.outerHeight(),
myw = $t.outerWidth();
let winw = $(window).width(), winh = $(window).height();
@ -175,7 +179,8 @@ const luckysheetSearchReplace = {
if(searchText == "" || searchText == null){
return;
}
const _locale = locale();
const locale_findAndReplace = _locale.findAndReplace;
let range;
if(Store.luckysheet_select_save.length == 0 || (Store.luckysheet_select_save.length == 1 && Store.luckysheet_select_save[0].row[0] == Store.luckysheet_select_save[0].row[1] && Store.luckysheet_select_save[0].column[0] == Store.luckysheet_select_save[0].column[1])){
range = [{
@ -191,10 +196,10 @@ const luckysheetSearchReplace = {
if(searchIndexArr.length == 0){
if(isEditMode()){
alert("没有查找到该内容");
alert(locale_findAndReplace.noFindTip);
}
else{
tooltip.info("没有查找到该内容", "");
tooltip.info(locale_findAndReplace.noFindTip, "");
}
return;
@ -294,6 +299,9 @@ const luckysheetSearchReplace = {
searchAll: function(){
let _this = this;
const _locale = locale();
const locale_findAndReplace = _locale.findAndReplace;
$("#luckysheet-search-replace #searchAllbox").remove();
let searchText = $("#luckysheet-search-replace #searchInput input").val();
@ -316,10 +324,10 @@ const luckysheetSearchReplace = {
if(searchIndexArr.length == 0){
if(isEditMode()){
alert("没有查找到该内容");
alert(locale_findAndReplace.noFindTip);
}
else{
tooltip.info("没有查找到该内容", "");
tooltip.info(locale_findAndReplace.noFindTip, "");
}
return;
@ -346,7 +354,7 @@ const luckysheetSearchReplace = {
}
}
$('<div id="searchAllbox"><div class="boxTitle"><span>工作表</span><span>单元格</span><span>值</span></div><div class="boxMain">' + searchAllHtml + '</div></div>').appendTo($("#luckysheet-search-replace"));
$('<div id="searchAllbox"><div class="boxTitle"><span>'+ locale_findAndReplace.searchTargetSheet +'</span><span>'+locale_findAndReplace.searchTargetCell+'</span><span>'+locale_findAndReplace.searchTargetValue+'</span></div><div class="boxMain">' + searchAllHtml + '</div></div>').appendTo($("#luckysheet-search-replace"));
$("#luckysheet-search-replace #searchAllbox .boxItem").eq(0).addClass("on").siblings().removeClass("on");
@ -463,13 +471,16 @@ const luckysheetSearchReplace = {
replace: function(){
let _this = this;
const _locale = locale();
const locale_findAndReplace = _locale.findAndReplace;
let searchText = $("#luckysheet-search-replace #searchInput input").val();
if(searchText == "" || searchText == null){
if(isEditMode()){
alert("请输入查找内容");
alert(locale_findAndReplace.searchInputTip);
}
else{
tooltip.info("请输入查找内容", "");
tooltip.info(locale_findAndReplace.searchInputTip, "");
}
return;
@ -490,10 +501,10 @@ const luckysheetSearchReplace = {
if(searchIndexArr.length == 0){
if(isEditMode()){
alert("没有可替换的内容");
alert(locale_findAndReplace.noReplceTip);
}
else{
tooltip.info("没有可替换的内容", "");
tooltip.info(locale_findAndReplace.noReplceTip, "");
}
return;
@ -515,10 +526,10 @@ const luckysheetSearchReplace = {
if(count == null){
if(searchIndexArr.length == 0){
if(isEditMode()){
alert("找不到匹配项");
alert(locale_findAndReplace.noMatchTip);
}
else{
tooltip.info("找不到匹配项", "");
tooltip.info(locale_findAndReplace.noMatchTip, "");
}
return;
@ -612,13 +623,16 @@ const luckysheetSearchReplace = {
replaceAll: function(){
let _this = this;
const _locale = locale();
const locale_findAndReplace = _locale.findAndReplace;
let searchText = $("#luckysheet-search-replace #searchInput input").val();
if(searchText == "" || searchText == null){
if(isEditMode()){
alert("请输入查找内容");
alert(locale_findAndReplace.searchInputTip);
}
else{
tooltip.info("请输入查找内容", "");
tooltip.info(locale_findAndReplace.searchInputTip, "");
}
return;
@ -639,10 +653,10 @@ const luckysheetSearchReplace = {
if(searchIndexArr.length == 0){
if(isEditMode()){
alert("没有可替换的内容");
alert(locale_findAndReplace.noReplceTip);
}
else{
tooltip.info("没有可替换的内容", "");
tooltip.info(locale_findAndReplace.noReplceTip, "");
}
return;
@ -712,11 +726,14 @@ const luckysheetSearchReplace = {
Store.luckysheet_select_save = $.extend(true, [], range);
selectHightlightShow();
let succeedInfo = replaceHtml(locale_findAndReplace.successTip, {
"xlength": searchIndexArr.length
});
if(isEditMode()){
alert("已经帮您搜索并进行了" + searchIndexArr.length + "处替换");
alert(succeedInfo);
}
else{
tooltip.info("已经帮您搜索并进行了" + searchIndexArr.length + "处替换", "");
tooltip.info(succeedInfo, "");
}
}
}

11
src/controllers/server.js

@ -9,6 +9,7 @@ import luckysheetPostil from './postil';
import { getObjType, replaceHtml, getByteLen } from '../utils/util';
import { getSheetIndex } from '../methods/get';
import Store from '../store';
import locale from '../locale/locale';
const server = {
gridKey: null,
@ -322,13 +323,15 @@ const server = {
currentSheetItem.append('<div class="luckysheet-sheets-item-color" style=" position: absolute; width: 100%; height: 3px; bottom: 0px; left: 0px; background-color: ' + value + ';"></div>');
}
}
else if(k == "pivotTable"){ //数据透视表
else if(k == "pivotTable"){ //PivotTable
// luckysheet.pivotTable.changePivotTable(index);
}
else if(k == "freezen"){ //冻结行列
else if(k == "freezen"){ //freezen row and column
if(index == Store.currentSheetIndex){
const _locale = locale();
const locale_freezen = _locale.freezen;
if(file["freezen"].horizontal == null){
$("#luckysheet-freezen-btn-horizontal").html('<i class="fa fa-list-alt"></i> 冻结首行');
$("#luckysheet-freezen-btn-horizontal").html('<i class="fa fa-list-alt"></i> '+locale_freezen.freezenRow);
luckysheetFreezen.freezenhorizontaldata = null;
$("#luckysheet-freezebar-horizontal").hide();
}
@ -337,7 +340,7 @@ const server = {
}
if(file["freezen"].vertical == null){
$("#luckysheet-freezen-btn-vertical").html('<i class="fa fa-indent"></i> 冻结首列');
$("#luckysheet-freezen-btn-vertical").html('<i class="fa fa-indent"></i> '+locale_freezen.freezenColumn);
luckysheetFreezen.freezenverticaldata = null;
$("#luckysheet-freezebar-vertical").hide();
}

2
src/controllers/sheetmanage.js

@ -753,6 +753,8 @@ const sheetmanage = {
Store.flowdata = file["data"];
editor.webWorkerFlowDataCache(Store.flowdata);//worker存数据
formula.execFunctionGroupData = null;
window.luckysheet_getcelldata_cache = null;
luckysheetPostil.buildAllPs(Store.flowdata);

30
src/controllers/splitColumn.js

@ -7,45 +7,51 @@ import { setcellvalue } from '../global/setdata';
import { getcellvalue } from '../global/getdata';
import { jfrefreshgrid } from '../global/refresh';
import Store from '../store';
import locale from '../locale/locale';
//分列
const luckysheetSplitColumn = {
createDialog: function(){
let _this = this;
const _locale = locale();
const locale_splitText = _locale.splitText;
const locale_punctuation = _locale.punctuation;
const locale_button = _locale.button;
$("#luckysheet-modal-dialog-mask").show();
$("#luckysheet-splitColumn-dialog").remove();
let content = '<div class="box">' +
'<div class="boxTitle">分割符号</div>' +
'<div class="boxTitle">'+locale_splitText.splitDelimiters+'</div>' +
'<div class="boxMain">' +
'<div style="height: 22px;line-height: 22px;">' +
'<input id="splitColumn_type_01" type="checkbox"/>' +
'<label for="splitColumn_type_01">Tab 键</label>' +
'<label for="splitColumn_type_01">'+ locale_punctuation.tab +'</label>' +
'</div>' +
'<div style="height: 22px;line-height: 22px;">' +
'<input id="splitColumn_type_02" type="checkbox"/>' +
'<label for="splitColumn_type_02">分号</label>' +
'<label for="splitColumn_type_02">'+ locale_punctuation.semicolon +'</label>' +
'</div>' +
'<div style="height: 22px;line-height: 22px;">' +
'<input id="splitColumn_type_03" type="checkbox"/>' +
'<label for="splitColumn_type_03">逗号</label>' +
'<label for="splitColumn_type_03">'+ locale_punctuation.comma +'</label>' +
'</div>' +
'<div style="height: 22px;line-height: 22px;">' +
'<input id="splitColumn_type_04" type="checkbox"/>' +
'<label for="splitColumn_type_04">空格</label>' +
'<label for="splitColumn_type_04">'+ locale_punctuation.space +'</label>' +
'</div>' +
'<div style="height: 22px;line-height: 22px;">' +
'<input id="splitColumn_type_05" type="checkbox"/>' +
'<label for="splitColumn_type_05">其它</label>' +
'<label for="splitColumn_type_05">'+ locale_splitText.splitOther +'</label>' +
'<input type="text" class="formulaInputFocus" maxlength="1"/>' +
'</div>' +
'</div>' +
'<div style="height: 22px;line-height: 22px;">' +
'<input id="splitColumn_type_06" type="checkbox"/>' +
'<label for="splitColumn_type_06">连续分隔符号视为单个处理</label>' +
'<label for="splitColumn_type_06">'+ locale_splitText.splitContinueSymbol +'</label>' +
'</div>' +
'<div class="boxTitle" style="margin-top: 10px;">数据预览</div>' +
'<div class="boxTitle" style="margin-top: 10px;">'+ locale_splitText.splitDataPreview +'</div>' +
'<div class="boxMain" id="splitColumnData">' +
'</div>' +
@ -54,9 +60,9 @@ const luckysheetSplitColumn = {
$("body").append(replaceHtml(modelHTML, {
"id": "luckysheet-splitColumn-dialog",
"addclass": "luckysheet-splitColumn-dialog",
"title": "文本分列",
"title": locale_splitText.splitTextTitle,
"content": content,
"botton": '<button id="luckysheet-splitColumn-dialog-confirm" class="btn btn-primary">确定</button><button class="btn btn-default luckysheet-model-close-btn">关闭</button>',
"botton": '<button id="luckysheet-splitColumn-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-splitColumn-dialog").find(".luckysheet-modal-dialog-content").css("min-width", 400).end(),
@ -71,6 +77,8 @@ const luckysheetSplitColumn = {
},
init: function(){
let _this = this;
const _locale = locale();
const locale_splitText = _locale.splitText;
//数据预览
$(document).off("change.SPCinpcheckbox").on("change.SPCcheckbox", "#luckysheet-splitColumn-dialog .box input[type='checkbox']", function(){
@ -118,7 +126,7 @@ const luckysheetSplitColumn = {
_this.update(r, c, dataArr);
}
tooltip.confirm("提示", "此处已有数据,是否替换它?", func1);
tooltip.confirm("", locale_splitText.splitConfirmToExe, func1);
}
else{
_this.update(r, c, dataArr);

59
src/demoData/sheetCell.js

@ -1157,6 +1157,10 @@ const sheetCell = {
"8": 128,
"9": 140,
"10": 144
},
"rowhidden": {
"30": 0,
"31": 0
}
},
"index": "0",
@ -5547,25 +5551,50 @@ const sheetCell = {
"ht": 1,
"vt": 1
}
}, {
"r": 30,
"c": 0,
"v": {
"ct": {
"fa": "General",
"t": "g"
},
"v": "hidden1",
"m": "hidden1"
}
}, {
"r": 31,
"c": 0,
"v": {
"m": "hidden2",
"ct": {
"fa": "General",
"t": "g"
},
"v": "hidden2"
}
}],
"visibledatarow": [],
"visibledatacolumn": [],
"rowsplit": [],
"ch_width": 4748,
"rh_height": 1790,
"visibledatarow": [21, 42, 63, 84, 105, 126, 147, 168, 189, 210, 231, 252, 273, 294, 315, 336, 357, 389, 410, 431, 452, 473, 494, 515, 536, 616, 637, 658, 739, 759, 759, 759, 779, 799, 819, 839],
"visibledatacolumn": [98, 172, 288, 417, 554, 677, 816, 948, 1077, 1218, 1363, 1437, 1511, 1585, 1659, 1733, 1807, 1881, 1955, 2029, 2103, 2177],
"ch_width": 2322,
"rh_height": 949,
"luckysheet_select_save": [{
"row": [
0,
0
],
"column": [
0,
0
]
"left": 0,
"width": 97,
"top": 759,
"height": -1,
"left_move": 0,
"width_move": 97,
"top_move": 759,
"height_move": -1,
"row": [30, 31],
"column": [0, 0],
"row_focus": 30,
"column_focus": 0
}],
"luckysheet_selection_range": [],
"scrollLeft": 0,
"scrollTop": 0
"scrollTop": 315,
"load": "1"
}
export default sheetCell

1
src/demoData/sheetComment.js

@ -66,7 +66,6 @@ const sheetComment = {
}],
"visibledatarow": [],
"visibledatacolumn": [],
"rowsplit": [],
"ch_width": 4748,
"rh_height": 1790,
"luckysheet_select_save": [{

1
src/demoData/sheetConditionFormat.js

@ -6112,7 +6112,6 @@ const sheetConditionFormat = {
}],
"visibledatarow": [],
"visibledatacolumn": [],
"rowsplit": [],
"ch_width": 4748,
"rh_height": 1790,
"luckysheet_select_save": [{

1107
src/demoData/sheetFormula.js

File diff suppressed because it is too large

33
src/demoData/sheetPivotTable.js

@ -22,27 +22,27 @@ const sheetPivotTable = {
"celldata": [{
"r": 0,
"c": 0,
"v": "计数:分数"
"v": "count:score"
}, {
"r": 0,
"c": 1,
"v": "理综"
"v": "science"
}, {
"r": 0,
"c": 2,
"v": "数学"
"v": "mathematics"
}, {
"r": 0,
"c": 3,
"v": "英语"
"v": "foreign language"
}, {
"r": 0,
"c": 4,
"v": "语文"
"v": "English"
}, {
"r": 0,
"c": 5,
"v": "总计"
"v": "total"
}, {
"r": 1,
"c": 0,
@ -118,7 +118,7 @@ const sheetPivotTable = {
}, {
"r": 4,
"c": 0,
"v": "总计"
"v": "total"
}, {
"r": 4,
"c": 1,
@ -142,7 +142,6 @@ const sheetPivotTable = {
}],
"visibledatarow": [],
"visibledatacolumn": [],
"rowsplit": [],
"ch_width": 4748,
"rh_height": 1790,
"luckysheet_select_save": [{
@ -168,32 +167,32 @@ const sheetPivotTable = {
"row_focus": 0,
"column_focus": 0
},
"pivotDataSheetIndex": 5, //The sheet index where the source data is located
"pivotDataSheetIndex": 6, //The sheet index where the source data is located
"column": [{
"index": 3,
"name": "科目",
"fullname": "科目"
"name": "subject",
"fullname": "subject"
}],
"row": [{
"index": 1,
"name": "学生",
"fullname": "学生"
"name": "student",
"fullname": "student"
}],
"filter": [],
"values": [{
"index": 4,
"name": "分数",
"fullname": "计数:分数",
"name": "score",
"fullname": "count:score",
"sumtype": "COUNTA",
"nameindex": 0
}],
"showType": "column",
"pivotDatas": [
["计数:分数", "理综", "数学", "英语", "语文", "总计"],
["count:score", "science", "mathematics", "foreign language", "English", "total"],
["Alex", 1, 1, 1, 1, 4],
["Joy", 1, 1, 1, 1, 4],
["Tim", 1, 1, 1, 1, 4],
["总计", 3, 3, 3, 3, 12]
["total", 3, 3, 3, 3, 12]
],
"drawPivotTable": false,
"pivotTableBoundary": [5, 6]

167
src/demoData/sheetPivotTableData.js

@ -19,74 +19,74 @@ const sheetPivotTableData = {
}],
"status": "0",
"order": "6",
"hide": 1,
"hide": 0,
"column": 18,
"row": 36,
"celldata": [{
"r": 0,
"c": 0,
"v": {
"m": "模考",
"m": "Mock test",
"ct": {
"fa": "General",
"t": "g"
},
"v": "模考"
"v": "Mock test"
}
}, {
"r": 0,
"c": 1,
"v": {
"m": "学生",
"m": "student",
"ct": {
"fa": "General",
"t": "g"
},
"v": "学生"
"v": "student"
}
}, {
"r": 0,
"c": 2,
"v": {
"m": "班级",
"m": "class",
"ct": {
"fa": "General",
"t": "g"
},
"v": "班级"
"v": "class"
}
}, {
"r": 0,
"c": 3,
"v": {
"m": "科目",
"m": "subject",
"ct": {
"fa": "General",
"t": "g"
},
"v": "科目"
"v": "subject"
}
}, {
"r": 0,
"c": 4,
"v": {
"m": "分数",
"m": "score",
"ct": {
"fa": "General",
"t": "g"
},
"v": "分数"
"v": "score"
}
}, {
"r": 1,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 1,
@ -103,23 +103,23 @@ const sheetPivotTableData = {
"r": 1,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 1,
"c": 3,
"v": {
"m": "语文",
"m": "English",
"ct": {
"fa": "General",
"t": "g"
},
"v": "语文"
"v": "English"
}
}, {
"r": 1,
@ -136,12 +136,12 @@ const sheetPivotTableData = {
"r": 2,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 2,
@ -158,23 +158,23 @@ const sheetPivotTableData = {
"r": 2,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 2,
"c": 3,
"v": {
"m": "数学",
"m": "mathematics",
"ct": {
"fa": "General",
"t": "g"
},
"v": "数学"
"v": "mathematics"
}
}, {
"r": 2,
@ -191,12 +191,12 @@ const sheetPivotTableData = {
"r": 3,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 3,
@ -213,23 +213,23 @@ const sheetPivotTableData = {
"r": 3,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 3,
"c": 3,
"v": {
"m": "英语",
"m": "foreign language",
"ct": {
"fa": "General",
"t": "g"
},
"v": "英语"
"v": "foreign language"
}
}, {
"r": 3,
@ -246,12 +246,12 @@ const sheetPivotTableData = {
"r": 4,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 4,
@ -268,23 +268,23 @@ const sheetPivotTableData = {
"r": 4,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 4,
"c": 3,
"v": {
"m": "理综",
"m": "science",
"ct": {
"fa": "General",
"t": "g"
},
"v": "理综"
"v": "science"
}
}, {
"r": 4,
@ -301,12 +301,12 @@ const sheetPivotTableData = {
"r": 5,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 5,
@ -323,23 +323,23 @@ const sheetPivotTableData = {
"r": 5,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 5,
"c": 3,
"v": {
"m": "语文",
"m": "English",
"ct": {
"fa": "General",
"t": "g"
},
"v": "语文"
"v": "English"
}
}, {
"r": 5,
@ -356,12 +356,12 @@ const sheetPivotTableData = {
"r": 6,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 6,
@ -378,23 +378,23 @@ const sheetPivotTableData = {
"r": 6,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 6,
"c": 3,
"v": {
"m": "数学",
"m": "mathematics",
"ct": {
"fa": "General",
"t": "g"
},
"v": "数学"
"v": "mathematics"
}
}, {
"r": 6,
@ -411,12 +411,12 @@ const sheetPivotTableData = {
"r": 7,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 7,
@ -433,23 +433,23 @@ const sheetPivotTableData = {
"r": 7,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 7,
"c": 3,
"v": {
"m": "英语",
"m": "foreign language",
"ct": {
"fa": "General",
"t": "g"
},
"v": "英语"
"v": "foreign language"
}
}, {
"r": 7,
@ -466,12 +466,12 @@ const sheetPivotTableData = {
"r": 8,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 8,
@ -488,23 +488,23 @@ const sheetPivotTableData = {
"r": 8,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 8,
"c": 3,
"v": {
"m": "理综",
"m": "science",
"ct": {
"fa": "General",
"t": "g"
},
"v": "理综"
"v": "science"
}
}, {
"r": 8,
@ -521,12 +521,12 @@ const sheetPivotTableData = {
"r": 9,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 9,
@ -543,23 +543,23 @@ const sheetPivotTableData = {
"r": 9,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 9,
"c": 3,
"v": {
"m": "语文",
"m": "English",
"ct": {
"fa": "General",
"t": "g"
},
"v": "语文"
"v": "English"
}
}, {
"r": 9,
@ -576,12 +576,12 @@ const sheetPivotTableData = {
"r": 10,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 10,
@ -598,23 +598,23 @@ const sheetPivotTableData = {
"r": 10,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 10,
"c": 3,
"v": {
"m": "数学",
"m": "mathematics",
"ct": {
"fa": "General",
"t": "g"
},
"v": "数学"
"v": "mathematics"
}
}, {
"r": 10,
@ -631,12 +631,12 @@ const sheetPivotTableData = {
"r": 11,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 11,
@ -653,23 +653,23 @@ const sheetPivotTableData = {
"r": 11,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 11,
"c": 3,
"v": {
"m": "英语",
"m": "foreign language",
"ct": {
"fa": "General",
"t": "g"
},
"v": "英语"
"v": "foreign language"
}
}, {
"r": 11,
@ -686,12 +686,12 @@ const sheetPivotTableData = {
"r": 12,
"c": 0,
"v": {
"m": "第一轮",
"m": "first round",
"ct": {
"fa": "General",
"t": "g"
},
"v": "第一轮"
"v": "first round"
}
}, {
"r": 12,
@ -708,23 +708,23 @@ const sheetPivotTableData = {
"r": 12,
"c": 2,
"v": {
"m": "一班",
"m": "Class one",
"ct": {
"fa": "General",
"t": "g"
},
"v": "一班"
"v": "Class one"
}
}, {
"r": 12,
"c": 3,
"v": {
"m": "理综",
"m": "science",
"ct": {
"fa": "General",
"t": "g"
},
"v": "理综"
"v": "science"
}
}, {
"r": 12,
@ -740,7 +740,6 @@ const sheetPivotTableData = {
}],
"visibledatarow": [],
"visibledatacolumn": [],
"rowsplit": [],
"ch_width": 4748,
"rh_height": 1790,
"luckysheet_select_save": [{

7862
src/demoData/sheetSparkline.js

File diff suppressed because it is too large

1
src/demoData/sheetTable.js

@ -884,7 +884,6 @@ const sheetTable = {
}],
"visibledatarow": [],
"visibledatacolumn": [],
"rowsplit": [],
"ch_width": 4748,
"rh_height": 1790,
"luckysheet_select_save": [{

5
src/function/func.js

@ -184,11 +184,12 @@ function luckysheet_compareWith() {
fp[m][n] = booleanToNum(fp[m][n]);
tp[m][n] = booleanToNum(tp[m][n]);
let value;
if(isRealNum(fp[m][n]) && isRealNum(tp[m][n])){
let value = parseFloat(fp[m][n]) * parseFloat(tp[m][n]);
value = parseFloat(fp[m][n]) * parseFloat(tp[m][n]);
}
else{
let value = error.v;
value = error.v;
}
rowArr.push(value);

8
src/global/createdom.js

@ -97,11 +97,11 @@ export default function luckysheetcreatedom(colwidth, rowheight, data, menu, tit
//新建行菜单
$("body").append(maskHTML);
$("body").append(colsmenuHTML);
$("body").append(rightclickHTML);
$("body").append(rightclickHTML());
$("body").append(inputHTML);
$("body").append(replaceHtml(filtermenuHTML, { "menuid": "filter" }));
$("body").append(replaceHtml(filtersubmenuHTML, { "menuid": "filter" }));
$("body").append(sheetconfigHTML);
$("body").append(replaceHtml(filtermenuHTML(), { "menuid": "filter" }));
$("body").append(replaceHtml(filtersubmenuHTML(), { "menuid": "filter" }));
$("body").append(sheetconfigHTML());
//批注
luckysheetPostil.buildAllPs(Store.flowdata);

7
src/global/draw.js

@ -776,7 +776,8 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
luckysheetTableContent.font = fontset;
let textMetrics = luckysheetTableContent.measureText(value).width;
let oneLineTextHeight = menuButton.getTextSize("田", fontset)[1];
// let oneLineTextHeight = menuButton.getTextSize("田", fontset)[1];
let oneLineTextHeight = menuButton.getTextSize(value, fontset)[1];
let textW, textH;
@ -1554,6 +1555,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
canvas.stroke();
canvas.closePath();
canvas.restore();
}
let borderRightRender = function(style, color, start_r, start_c, end_r, end_c, offsetLeft, offsetTop, canvas){
@ -1570,6 +1572,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
canvas.stroke();
canvas.closePath();
canvas.restore();
}
let borderBottomRender = function(style, color, start_r, start_c, end_r, end_c, offsetLeft, offsetTop, canvas){
@ -1586,6 +1589,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
canvas.stroke();
canvas.closePath();
canvas.restore();
}
let borderTopRender = function(style, color, start_r, start_c, end_r, end_c, offsetLeft, offsetTop, canvas){
@ -1602,6 +1606,7 @@ function luckysheetDrawMain(scrollWidth, scrollHeight, drawWidth, drawHeight, of
canvas.stroke();
canvas.closePath();
canvas.restore();
}
let borderInfoCompute = getBorderInfoCompute();

19
src/global/tooltip.js

@ -1,6 +1,7 @@
import { modelHTML, luckysheetchartpointconfigHTML, luckysheetToolHTML } from '../controllers/constant';
import browser from './browser';
import { replaceHtml } from '../utils/util';
import locale from '../locale/locale';
const tooltip = {
info: function (title, content) {
@ -24,12 +25,15 @@ const tooltip = {
confirm: function (title, content, func1, func2, name1, name2) {
$("#luckysheet-modal-dialog-mask").show();
$("#luckysheet-confirm").remove();
const _locale = locale();
const locale_button = _locale.button;
if(name1 == null){
name1 = "确定";
name1 = locale_button.confirm;
}
if(name2 == null){
name2 = "取消";
name2 = locale_button.cancel;
}
$("body").append(replaceHtml(modelHTML, {
@ -62,6 +66,9 @@ const tooltip = {
});
},
screenshot: function (title, content, imgurl) {
const _locale = locale();
const locale_screenshot = _locale.screenshot;
$("#luckysheet-modal-dialog-mask").show();
$("#luckysheet-confirm").remove();
$("body").append(replaceHtml(modelHTML, {
@ -70,7 +77,7 @@ const tooltip = {
"style": "z-index:100003",
"title": title,
"content": content,
"botton": '<a style="text-decoration:none;color:#fff;" class="download btn btn-primary luckysheet-model-conform-btn">&nbsp;&nbsp;下载&nbsp;&nbsp;</a>&nbsp;&nbsp;<button class="btn btn-primary luckysheet-model-copy-btn">&nbsp;&nbsp;复制到剪切板&nbsp;&nbsp;</button><button class="btn btn-default luckysheet-model-cancel-btn">&nbsp;&nbsp;关闭&nbsp;&nbsp;</button>'
"botton": '<a style="text-decoration:none;color:#fff;" class="download btn btn-primary luckysheet-model-conform-btn">&nbsp;&nbsp;'+ locale_screenshot.downLoadBtn +'&nbsp;&nbsp;</a>&nbsp;&nbsp;<button class="btn btn-primary luckysheet-model-copy-btn">&nbsp;&nbsp;'+ locale_screenshot.downLoadCopy +'&nbsp;&nbsp;</button><button class="btn btn-default luckysheet-model-cancel-btn">&nbsp;&nbsp;'+ locale_screenshot.downLoadClose +'&nbsp;&nbsp;</button>'
}));
let $t = $("#luckysheet-confirm").find(".luckysheet-modal-dialog-content").css("min-width", 300).end(),
myh = $t.outerHeight(),
@ -80,7 +87,7 @@ const tooltip = {
$("#luckysheet-confirm").css({ "left": (winw + scrollLeft - myw) / 2, "top": (winh + scrollTop - myh) / 3 }).show();
$t.find(".luckysheet-model-conform-btn").click(function () {
if(browser.isIE() == "1"){
alert("下载功能IE浏览器不支持!");
alert(locale_screenshot.browserNotTip);
}
else{
if (!!window.ActiveXObject || "ActiveXObject" in window){
@ -106,11 +113,11 @@ const tooltip = {
let dt = new clipboard.DT();
dt.setData("text/html", "<img src='"+ imgurl +"'>");
if(browser.isIE() == "1"){
alert("请在图片上右键点击'复制'");
alert(locale_screenshot.rightclickTip);
}
else{
clipboard.write(dt);
alert("已成功复制(如果粘贴失败,请在图片上右键点击'复制图片')");
alert(locale_screenshot.successTip);
}
});
},

347
src/locale/en.js

@ -40,7 +40,7 @@ export default {
autoSum: 'Auto SUM',
moreFunction: 'More function',
conditionalFormat: 'Conditional format',
postil: 'Postil',
postil: 'Comment',
pivotTable: 'PivotTable',
chart: 'Chart',
screenshot: 'Screenshot',
@ -48,6 +48,10 @@ export default {
clearText:"Clear color",
noColorSelectedText:"No color is selected",
toolMore:"More",
toolClose:"Close",
toolMoreTip:"More features",
},
alternatingColors:{
applyRange: 'Apply to range',
@ -312,6 +316,345 @@ export default {
MicrosoftYaHei:"YaHei",
},
fontarray: ["Times New Roman","Arial","Tahoma","Verdana"],
fontjson: {"arial":1,"times new roman":0,"tahoma":2,"verdana":3}
fontjson: {"arial":1,"times new roman":0,"tahoma":2,"verdana":3},
border:{
borderTop:'borderTop',
borderBottom:'borderBottom',
borderLeft:'borderLeft',
borderRight:'borderRight',
borderNone:'borderNone',
borderAll:'borderAll',
borderOutside:'borderOutside',
borderInside:'borderInside',
borderHorizontal:'borderHorizontal',
borderVertical:'borderVertical',
borderColor:'borderColor',
borderSize:'borderSize',
},
merge:{
mergeAll:"Merge all",
mergeV:"Vertically",
mergeH:"Horizentally",
mergeCancel:"Unmerge",
overlappingError:"Cannot merge overlapping areas",
partiallyError:"Cannot perform this operation on partially merged cells",
},
align:{
left:"left",
center:"center",
right:"right",
top:"Top",
middle:"Middle",
bottom:"Bottom",
},
textWrap:{
"overflow":"Overflow",
"wrap":"Wrap",
"clip":"Clip",
},
rotation:{
"none":"None",
"angleup":"Tilt Up",
"angledown":"Tilt down",
"vertical":"Stack Vertically",
"rotationUp":"Rotate Up",
"rotationDown":"Rotate down"
},
freezen:{
default:"Freezen",
freezenRow:"First Row",
freezenColumn:"First column",
freezenRC:"Both",
freezenRowRange:"Freezen row range",
freezenColumnRange:"Freezen column range",
freezenRCRange:"Freezen both range",
freezenCancel:"Cancel",
noSeletionError:"No Range to be selected",
},
sort:{
"asc":"Ascending ",
"desc":"Descending ",
"custom":"Custom sort",
"hasTitle":"Data has header row",
"sortBy":"Sort by",
"addOthers":"Add another sort column",
"close":"close",
"confirm":"sort",
"columnOperation":"Column",
"secondaryTitle":"then by",
"sortRangeTitle":"Sort range from",
"sortRangeTitleTo":"to",
"noRangeError":"Cannot perform this operation on multiple selection areas, please select a single range and try again",
"mergeError":"There are merged cells in the selection, this operation cannot be performed!",
},
filter:{
"filter":"create filter",
"clearFilter":"Cancel filter",
sortByAsc:"Sort A-Z",
sortByDesc:"Sort Z-A",
filterByColor:"Filter by color",
filterByCondition:"Filter by condition",
filterByValues:"Filter by values",
filiterInputNone:"None",
filiterInputTip:"Enter filter value",
filiterRangeStartTip:"Value for formula",
filiterRangeEndTip:"Value for formula",
filterValueByAllBtn:"Check all",
filterValueByClearBtn:"Clear",
filterValueByInverseBtn:"Inverse",
filterValueByTip:"filter By Values",
filterConform:"Confirm",
filterCancel:"Cancel",
clearFilter:"Clear filter",
conditionNone:"None",
conditionCellIsNull:"Is empty",
conditionCellNotNull:"Is not empty",
conditionCellTextContain:"Text contains",
conditionCellTextNotContain:"Text does not contain",
conditionCellTextStart:"Text starts with",
conditionCellTextEnd:"Text ends with",
conditionCellTextEqual:"Text is exactly",
conditionCellDateEqual:"Date is",
conditionCellDateBefore:"Date is before",
conditionCellDateAfter:"Date is after",
conditionCellGreater:"Greater than",
conditionCellGreaterEqual:"Greater than or equal to",
conditionCellLess:"Less than",
conditionCellLessEqual:"Less than or equal to",
conditionCellEqual:"Is equal to",
conditionCellNotEqual:"Is not equal to",
conditionCellBetween:"Is between",
conditionCellNotBetween:"Is not between",
},
rightclick: {
copy: 'Copy',
copyAs: 'Copy as',
paste: 'Paste',
insert: 'Insert',
delete: 'Delete',
deleteSelected: 'Delete selected ',
hide: 'Hide',
hideSelected: 'Hide selected ',
showHide: 'Show hide',
to: 'Towards',
left: 'Left',
right: 'Right',
top: 'Top',
bottom: 'Bottom',
add: 'Add',
row: 'Row',
column: 'Column',
width: 'Width',
height: 'Height',
number: 'Number',
confirm: 'Confirm',
orderAZ: 'A-Z order',
orderZA: 'Z-A order',
clearContent: 'Clear content',
matrix: 'Matrix operation selection',
sortSelection: 'Sort selection',
filterSelection: 'Filter selection',
chartGeneration: 'Chart generation',
firstLineTitle: 'First line title',
untitled: 'Untitled',
array1: 'One-dimensional array',
array2: 'Two-dimensional array',
array3: 'Multidimensional Arrays',
diagonal: 'Diagonal',
antiDiagonal: 'Anti-diagonal',
diagonalOffset: 'Diagonal offset',
offset: 'Offset',
Boolean: '布尔值',
flip: 'Flip',
upAndDown: 'Up and down',
leftAndRight: 'Left and right',
clockwise: 'Clockwise',
counterclockwise: 'Counterclockwise',
transpose: 'Transpose',
matrixCalculation: 'Matrix calculation',
plus: 'Plus',
minus: 'Minus',
multiply: 'Multiply',
divided: 'Divided',
power: 'Power',
root: 'Root',
log: 'Log',
delete0: 'Delete 0 values at both ends',
removeDuplicate: 'Remove duplicate values',
byRow: 'By row',
byCol: 'By column',
generateNewMatrix: 'Generate new matrix',
},
comment:{
"insert":"Insert",
"edit":"Edit",
"delete":"Delete",
"showOne":"Show/Hide",
"showAll":"Show/Hide All"
},
screenshot:{
screenshotTipNoSelection:"Please select the scope of the screenshot",
screenshotTipTitle:"Warning!",
screenshotTipHasMerge:"This operation cannot be performed on merged cells",
screenshotTipHasMulti:"This operation cannot be performed on multiple selection regions",
screenshotTipSuccess:"Successful",
screenshotImageName:"Screenshot",
downLoadClose:"Close",
downLoadCopy:"Copy to clipboard",
downLoadBtn:"DownLoad",
browserNotTip:"not supported by IE browser!",
rightclickTip:"Please right click \"copy\" on the picture",
successTip:"Successfully (if pasting fails, please right-click on the image to \"copy image\")",
},
splitText:{
splitDelimiters:"Delimiters",
splitOther:"Other",
splitContinueSymbol:"Consecutive separators are treated as a single",
splitDataPreview:"Preview",
splitTextTitle:"Split text",
splitConfirmToExe:"There is already data here, do you want to replace it?",
},
punctuation:{
"tab":"Tab",
"semicolon":"semicolon",
"comma":"comma",
"space":"space",
},
findAndReplace:{
find:"Find",
replace:"Replace",
goto:"Goto",
location:"Location",
formula:"Formula",
date:"Date",
number:"Number",
string:"String",
error:"Error",
condition:"Condition",
rowSpan:"Row span",
columnSpan:"Column span",
locationExample:"Location",
lessTwoRowTip:"Please select at least two rows",
lessTwoColumnTip:"Please select at least two columns",
findTextbox:"Find Content",
replaceTextbox:"Replace Content",
regexTextbox:"Regular Expression",
wholeTextbox:"Whole word",
distinguishTextbox:"Case sensitive",
allReplaceBtn:"Replace All",
replaceBtn:"Replace",
allFindBtn:"Find All",
findBtn:"Find next",
noFindTip:"The content was not found",
searchTargetSheet:"Sheet",
searchTargetCell:"Cell",
searchTargetValue:"Value",
searchInputTip:"Please enter the search content",
noReplceTip:"There is nothing to replace",
noMatchTip:"No match found",
successTip:"${xlength} items found",
},
sheetconfig: {
delete: 'Delete',
copy: 'Copy',
rename: 'Rename',
changeColor: 'Change color',
hide: 'Hide',
unhide: 'Unhide',
moveLeft: 'Move left',
moveRight: 'Move right',
resetColor: 'Reset color',
cancelText: 'Cancel',
chooseText: 'Confirm color',
},
conditionformat: {
rule: 'Rule',
newRule: 'New rule',
editRule: 'Edit rule',
deleteRule: 'Delete rule',
showRules: 'Show its formatting rules',
manageRules: 'Conditional Formatting Rule Manager',
format: 'Format',
applyRange: 'Apply range',
selectRange: 'Click to select application range',
ruleTypeItem1: 'Format all cells based on their respective values',
ruleTypeItem2: 'Only format cells that contain',
ruleTypeItem3: 'Format only the top or bottom numbers',
ruleTypeItem4: 'Format only values above or below the average',
ruleTypeItem5: 'Format only unique or repeated values',
textColor: 'Text color',
cellColor: 'Cell color',
confirm: 'Confirm',
cancel: 'Cancel',
close: 'Close',
sheet: 'Sheet',
currentSheet: 'CurrentSheet',
dataBar: 'dataBar',
dataBarColor: 'dataBar color',
colorGradation: 'colorGradation',
icons: 'icons',
cellValue: 'Cell value',
between: 'Between',
in: 'In',
between2: '',
contain: 'Contain',
duplicateValue: 'Duplicate value',
uniqueValue: 'Unique value',
top: 'Top',
last: 'Last',
oneself: '',
aboveAverage: 'Above average',
belowAverage: 'Below average',
chooseRuleType: 'Choose rule type',
editRuleDescription: 'Edit rule description',
newFormatRule: 'New format rule',
formatStyle: 'Format style',
fillType: 'Fill type',
color: 'Color',
twocolor: 'Two-color',
tricolor: 'Tricolor',
multicolor: 'Multi color',
grayColor: 'Gray color',
gradient: 'Gradient',
solid: 'Solid',
maxValue: 'Max value',
medianValue: 'Median value',
minValue: 'Min value',
threeWayArrow: 'Three-way arrow',
fourWayArrow: 'Four-way arrow',
fiveWayArrow: 'Five-way arrow',
threeTriangles: 'Three triangles',
threeColorTrafficLight: 'Three-color traffic light',
fourColorTrafficLight: 'Four-color traffic light',
rimless: 'Rimless',
bordered: 'Bordered',
},
};

331
src/locale/zh.js

@ -48,6 +48,9 @@ export default {
clearText:"清除颜色选择",
noColorSelectedText:"没有颜色被选择",
toolMore:"更多",
toolClose:"收起",
toolMoreTip:"更多功能",
},
alternatingColors:{
@ -333,6 +336,332 @@ export default {
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}
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},
border:{
borderTop:'上框线',
borderBottom:'下框线',
borderLeft:'左框线',
borderRight:'右框线',
borderNone:'无',
borderAll:'所有',
borderOutside:'外侧',
borderInside:'内侧',
borderHorizontal:'内侧横线',
borderVertical:'内侧竖线',
borderColor:'边框颜色',
borderSize:'边框粗细'
},
merge:{
mergeAll:"全部合并",
mergeV:"垂直合并",
mergeH:"水平合并",
mergeCancel:"取消合并",
overlappingError:"不能合并重叠区域",
partiallyError:"无法对部分合并单元格执行此操作",
},
align:{
left:"左对齐",
center:"中间对齐",
right:"右对齐",
top:"顶部对齐",
middle:"居中对齐",
bottom:"底部对齐",
},
textWrap:{
"overflow":"溢出",
"wrap":"自动换行",
"clip":"截断",
},
freezen:{
default:"冻结首行",
freezenRow:"冻结首行",
freezenColumn:"冻结首列",
freezenRC:"冻结行列",
freezenRowRange:"冻结行到选区",
freezenColumnRange:"冻结列到选区",
freezenRCRange:"冻结行列到选区",
freezenCancel:"取消冻结",
noSeletionError:"没有选区",
},
sort:{
"asc":"升序",
"desc":"降序",
"custom":"自定义排序",
"hasTitle":"数据具有标题行",
"sortBy":"排序依据",
"addOthers":"添加其他排序列",
"close":"关闭",
"confirm":"排序",
"columnOperation":"列",
"secondaryTitle":"次要排序",
"sortRangeTitle":"排序范围从",
"sortRangeTitleTo":"到",
"noRangeError":"不能对多重选择区域执行此操作,请选择单个区域,然后再试",
"mergeError":"选区有合并单元格,无法执行此操作!",
},
filter:{
"filter":"筛选",
"clearFilter":"清除筛选",
sortByAsc:"以A-Z升序排列",
sortByDesc:"以Z-A降序排列",
filterByColor:"按颜色筛选",
filterByCondition:"按条件过滤",
filterByValues:"按值过滤",
filiterInputNone:"无",
filiterInputTip:"输入筛选值",
filiterRangeStartTip:"范围开始",
filiterRangeEndTip:"范围结束",
filterValueByAllBtn:"全选",
filterValueByClearBtn:"清除",
filterValueByInverseBtn:"反选",
filterValueByTip:"按照值进行筛选",
filterConform:"确 认",
filterCancel:"取 消",
clearFilter:"清除筛选",
conditionNone:"无",
conditionCellIsNull:"单元格为空",
conditionCellNotNull:"单元格有数据",
conditionCellTextContain:"文本包含",
conditionCellTextNotContain:"文本不包含",
conditionCellTextStart:"文本开头为",
conditionCellTextEnd:"文本结尾为",
conditionCellTextEqual:"文本等于",
conditionCellDateEqual:"日期等于",
conditionCellDateBefore:"日期早于",
conditionCellDateAfter:"日期晚于",
conditionCellGreater:"大于",
conditionCellGreaterEqual:"大于等于",
conditionCellLess:"小于",
conditionCellLessEqual:"小于等于",
conditionCellEqual:"等于",
conditionCellNotEqual:"不等于",
conditionCellBetween:"介于",
conditionCellNotBetween:"不在其中",
},
rightclick: {
copy: '复制',
copyAs: '复制为',
paste: '粘贴',
insert: '插入',
delete: '删除',
deleteSelected: '删除选中',
hide: '隐藏',
hideSelected: '隐藏选中',
showHide: '显示隐藏',
to: '向',
left: '左',
right: '右',
top: '上',
bottom: '下',
add: '增加',
row: '行',
column: '列',
width: '宽',
height: '高',
number: '数字',
confirm: '确认',
orderAZ: 'A-Z顺序排列',
orderZA: 'Z-A降序排列',
clearContent: '清除内容',
matrix: '矩阵操作选区',
sortSelection: '排序选区',
filterSelection: '筛选选区',
chartGeneration: '图表生成',
firstLineTitle: '首行为标题',
untitled: '无标题',
array1: '一维数组',
array2: '二维数组',
array3: '多维数组',
diagonal: '对角线',
antiDiagonal: '反对角线',
diagonalOffset: '对角偏移',
offset: '偏移量',
boolean: '布尔值',
flip: '翻转',
upAndDown: '上下',
leftAndRight: '左右',
clockwise: '顺时针',
counterclockwise: '逆时针',
transpose: '转置',
matrixCalculation: '矩阵计算',
plus: '加',
minus: '减',
multiply: '乘',
divided: '除',
power: '次方',
root: '次方根',
log: 'log',
delete0: '删除两端0值',
removeDuplicate: '删除重复值',
byRow: '按行',
byCol: '按列',
generateNewMatrix: '生成新矩阵',
},
comment:{
"insert":"新建批注",
"edit":"编辑批注",
"delete":"删除",
"showOne":"显示/隐藏批注",
"showAll":"显示/隐藏所有批注"
},
screenshot:{
screenshotTipNoSelection:"请框选需要截图的范围",
screenshotTipTitle:"提示!",
screenshotTipHasMerge:"无法对合并单元格执行此操作",
screenshotTipHasMulti:"无法对多重选择区域执行此操作",
screenshotTipSuccess:"截取成功",
screenshotImageName:"截图",
downLoadClose:"关闭",
downLoadCopy:"复制到剪切板",
downLoadBtn:"下载",
browserNotTip:"下载功能IE浏览器不支持!",
rightclickTip:"请在图片上右键点击'复制'",
successTip:"已成功复制(如果粘贴失败,请在图片上右键点击'复制图片')",
},
splitText:{
splitSymbol:"分割符号",
splitOther:"其它",
splitContinueSymbol:"连续分隔符号视为单个处理",
splitDataPreview:"数据预览",
splitTextTitle:"文本分列",
splitConfirmToExe:"此处已有数据,是否替换它?",
},
punctuation:{
"tab":"Tab 键",
"semicolon":"分号",
"comma":"逗号",
"space":"空格",
},
findAndReplace:{
find:"查找",
replace:"替换",
goto:"转到",
location:"定位条件",
formula:"公式",
date:"日期",
number:"数字",
string:"字符",
error:"错误",
condition:"条件格式",
rowSpan:"间隔行",
columnSpan:"间隔列",
locationExample:"定位",
lessTwoRowTip:"请选择最少两行",
lessTwoColumnTip:"请选择最少两行",
findTextbox:"查找内容",
replaceTextbox:"替换内容",
regexTextbox:"正则表达式匹配",
wholeTextbox:"整词匹配",
distinguishTextbox:"区分大小写匹配",
allReplaceBtn:"全部替换",
replaceBtn:"替换",
allFindBtn:"查找全部",
findBtn:"查找下一个",
noFindTip:"没有查找到该内容",
searchTargetSheet:"工作表",
searchTargetCell:"单元格",
searchTargetValue:"值",
searchInputTip:"请输入查找内容",
noReplceTip:"没有可替换的内容",
noMatchTip:"找不到匹配项",
successTip:"已经帮您搜索并进行了${xlength}处替换",
},
sheetconfig: {
delete: '删除',
copy: '复制',
rename: '重命名',
changeColor: '更改颜色',
hide: '隐藏',
unhide: '取消隐藏',
moveLeft: '向左移',
moveRight: '向右移',
resetColor: '重置颜色',
cancelText: '取消',
chooseText: '确定颜色',
},
conditionformat: {
rule: '规则',
newRule: '新建规则',
editRule: '编辑规则',
deleteRule: '删除规则',
showRules: '显示其格式规则',
manageRules: '条件格式规则管理器',
format: '格式',
applyRange: '应用范围',
selectRange: '点击选择应用范围',
ruleTypeItem1: '基于各自值设置所有单元格的格式',
ruleTypeItem2: '只为包含以下内容的单元格设置格式',
ruleTypeItem3: '仅对排名靠前或靠后的数值设置格式',
ruleTypeItem4: '仅对高于或低于平均值的数值设置格式',
ruleTypeItem5: '仅对唯一值或重复值设置格式',
textColor: '文本颜色',
cellColor: '单元格颜色',
confirm: '确定',
cancel: '取消',
close: '关闭',
sheet: '表',
currentSheet: '当前工作表',
dataBar: '数据条',
dataBarColor: '数据条颜色',
colorGradation: '色阶',
icons: '图标集',
cellValue: '单元格值',
between: '介于',
in: '和',
between2: '之间',
contain: '包含',
duplicateValue: '重复值',
uniqueValue: '唯一值',
top: '前',
last: '后',
oneself: '个',
aboveAverage: '高于平均值',
belowAverage: '低于平均值',
chooseRuleType: '选择规则类型',
editRuleDescription: '编辑规则说明',
newFormatRule: '新建格式规则',
formatStyle: '格式样式',
fillType: '填充类型',
color: '颜色',
twocolor: '双色',
tricolor: '三色',
multicolor: '彩色',
grayColor: '灰色',
gradient: '渐变',
solid: '实心',
maxValue: '最大值',
medianValue: '中间值',
minValue: '最小值',
threeWayArrow: '三向箭头',
fourWayArrow: '四向箭头',
fiveWayArrow: '五向箭头',
threeTriangles: '3个三角形',
threeColorTrafficLight: '三色交通灯',
fourColorTrafficLight: '四色交通灯',
rimless: '无边框',
bordered: '有边框',
},
};

Loading…
Cancel
Save