lrz 5 years ago
parent
commit
2df51f9dce
  1. 283
      docs/guide/operate.md
  2. 24
      src/controllers/constant.js
  3. 160
      src/controllers/handler.js
  4. 47
      src/controllers/menuButton.js
  5. 83
      src/controllers/print.js
  6. 4
      src/controllers/resize.js
  7. 15
      src/controllers/rowColumnOperation.js
  8. 19
      src/controllers/zoom.js
  9. 3
      src/core.js
  10. 107
      src/global/extend.js
  11. 43
      src/global/getRowlen.js
  12. 94
      src/index.html
  13. 85
      src/locale/en.js
  14. 1168
      src/locale/es.js
  15. 6
      src/locale/zh.js

283
docs/guide/operate.md

@ -1,16 +1,28 @@
# Table Operation
`luckysheet` stores all operations in the history to `undo` and `redo`. If `allowupdate` is set to true and `updateURL` is available in initial, operations will be updated on the backend in real-time via webSocket. And every one can edit same sheet on the same time.
## Cell refresh
>Source code [`src/controllers/server.js`] (https://github.com/mengshukeji/Luckysheet/blob/master/src/controllers/server.js) The module shows us the function of background saving.
In general, shared editing(or collaborative editing) is controled by the account system created by developers to control permissions.
The following are all types of operations that support transferring to the background. In this case, I use mongodb as a storage example to explain how front-end and back-end interacts with eachother.
Pay attention, `i` in the object is the `index` of the sheet rather than `order`.
## Cell refresh
### single cell refresh
- **Format**
```json
{
"t": "v",
"i": 3,
"v": "asdf",
"r": 5,
"c": 7
"i": "Sheet_0554kKiKl4M7_1597974810804",
"v": {
"v": 233,
"ct": { "fa": "General", "t": "n" },
"m": "233"
},
"r": 0,
"c": 1
}
```
@ -20,7 +32,7 @@
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|v|Cell value|
|v|Cell value, refer to [单元格属性表](/zh/guide/cell.html#基本单元格)|
|r|Row number of cell|
|c|The column number of the cell|
@ -515,6 +527,43 @@
Delete the sheet whose index is the value corresponding to `deleIndex`.
### restore from a deleted sheet
- **format**
```json
{
"t": "shre",
"i": null,
"v": {
"reIndex": "0"
}
}
```
- **Explanation**
<table>
<tr>
<td colspan="2">Parameter</td>
<td>Explanation</td>
</tr>
<tr>
<td colspan="2">t</td>
<td>Operation type symbol</td>
</tr>
<tr>
<td rowspan="2">v</td>
<td>deleIndex</td>
<td>需要恢复的sheet索引</td>
</tr>
</table>
- **Backend update**
restore the sheet whose index is the number of `reIndex`.
### Position
- **Format**
@ -522,8 +571,17 @@
```json
{
"t": "shr",
"i": null,
"v": {
"index": "positon"
"0": 1,
"1": 0,
"2": 2,
"3": 3,
"4": 4,
"5": 5,
"6": 6,
"7": 7,
"Sheet_6az6nei65t1i_1596209937084": 8
}
}
```
@ -543,6 +601,31 @@
`luckysheetfile[key2].order = value2`
`luckysheetfile[key3].order = value3`
### switch to the specified sheet
- **format**
```json
{
"t": "shs",
"i": null,
"v": 1
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|v|index of the specified sheet|
- **Backend update**
setting the `status` = `1`, when the `index` of a sheet is eaqul to `v`
`luckysheetfile[v].status = 1`
## Sheet attributes (hide or show)
- **Format**
@ -618,4 +701,188 @@
- **Backend update**
According to gridkey, update the thumbnail field of the table in mysql to the img value, and update the status field of the sheet whose index is the curindex value to 1, and set the status value of other sheets to 0.
According to gridkey, update the thumbnail field of the table in mysql to the img value, and update the status field of the sheet whose index is the curindex value to 1, and set the status value of other sheets to 0.
## Chart(TODO)
There are four types of chart operations: add new chart -"add", move chart position-"xy", zoom chart-"wh", and update chart configuration-"update".
### new chart
- **format**
```json
{
"t": "c",
"i": 0,
"op":"add",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120,
"sheetIndex": "Sheet_6az6nei65t1i_1596209937084",
"needRangeShow": true,
"chartOptions": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"chartAllType": "echarts|line|default",
"rangeArray": [ { "row": [ 0, 4 ], "column": [ 0, 7 ] } ],
"rangeColCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeRowCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeConfigCheck": false,
"defaultOption": {
"title": {
"show": true,
"text": "default title"
}
}
},
"isShow": true
}
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|op|Operation options include hide and show|
|v|configuration information of charts|
- **Backend update**
update the chart settings in the current sheet,if`luckysheetfile[i].chart` is null,the array should be `[]` on initial.
```json
luckysheetfile[0].chart.push(v)
```
### move chart position
- **format**
```json
{
"t": "c",
"i": 0,
"op":"xy",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"left": 20,
"top": 120
}
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|op|Operation options include hide and show|
|v|configuration information of charts|
- **Backend update**
update the chart settings in the current sheet
```js
luckysheetfile[0].chart[v.chart_id].left = v.left;
luckysheetfile[0].chart[v.chart_id].top = v.top;
```
### zoom chart
- **format**
```json
{
"t": "c",
"i": 0,
"op":"wh",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120
}
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|op|Operation options include hide and show|
|v|configuration information of charts|
- **Backend update**
update the chart settings in the current sheet
```js
luckysheetfile[0].chart[v.chart_id].left = v.left;
luckysheetfile[0].chart[v.chart_id].top = v.top;
luckysheetfile[0].chart[v.chart_id].width = v.width;
luckysheetfile[0].chart[v.chart_id].height = v.height;
```
### change the configuration of charts
- **format**
```json
{
"t": "c",
"i": 0,
"op":"update",
"v": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"width": 400,
"height": 250,
"left": 20,
"top": 120,
"sheetIndex": "Sheet_6az6nei65t1i_1596209937084",
"needRangeShow": true,
"chartOptions": {
"chart_id": "chart_p145W6i73otw_1596209943446",
"chartAllType": "echarts|line|default",
"rangeArray": [ { "row": [ 0, 4 ], "column": [ 0, 7 ] } ],
"rangeColCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeRowCheck": { "exits": true, "range": [ 0, 0 ] },
"rangeConfigCheck": false,
"defaultOption": {
"title": {
"show": true,
"text": "default title"
}
}
},
"isShow": true
}
}
```
- **Explanation**
|Parameter|Explanation|
| ------------ | ------------ |
|t|Operation type symbol|
|i|The index value of the current sheet|
|op|Operation options include hide and show|
|v|configuration information of charts|
- **Backend update**
update the chart settings in the current sheet
```js
luckysheetfile[0].chart[v.chart_id] = v;
```

24
src/controllers/constant.js

@ -230,9 +230,9 @@ const gridHTML = function(){
<div class="luckysheet-zoom-ratioText" id="luckysheet-zoom-ratioText">100%</div>
</div>
<div class="luckysheet-print-viewList">
<div class="luckysheet-print-viewBtn luckysheet-print-viewNormal luckysheet-print-viewBtn-active" title="${locale_print.normalBtn}"><i class="icon iconfont icon-caidan1"></i></div>
<div class="luckysheet-print-viewBtn luckysheet-print-viewLayout" title="${locale_print.layoutBtn}"><i class="icon iconfont icon-caidan1"></i></div>
<div class="luckysheet-print-viewBtn luckysheet-print-viewPage" title="${locale_print.pageBtn}"><i class="icon iconfont icon-caidan1"></i></div>
<div type="viewNormal" class="luckysheet-print-viewBtn luckysheet-print-viewNormal luckysheet-print-viewBtn-active" title="${locale_print.normalBtn}"><i class="icon iconfont icon-caidan1"></i></div>
<div type="viewLayout" class="luckysheet-print-viewBtn luckysheet-print-viewLayout" title="${locale_print.layoutBtn}"><i class="icon iconfont icon-caidan1"></i></div>
<div type="viewPage" class="luckysheet-print-viewBtn luckysheet-print-viewPage" title="${locale_print.pageBtn}"><i class="icon iconfont icon-caidan1"></i></div>
</div>
<div class="luckysheet-sta-content" id="luckysheet-sta-content"></div>
<div class="luckysheet-bottom-content" id="luckysheet-bottom-content-show"></div>
@ -1423,6 +1423,24 @@ function menuToolBar (){
</div>
</div>
</div>
<div class="luckysheet-toolbar-select luckysheet-toolbar-menu-button luckysheet-inline-block" data-tips="${toolbar.print}"
id="luckysheet-icon-print" role="button" style="user-select: none;">
<div class="luckysheet-toolbar-menu-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-icon luckysheet-inline-block " style="user-select: none;">
<div aria-hidden="true" class="luckysheet-icon-img-container luckysheet-icon-img luckysheet-icon-autofilter iconfont icon-shezhi"
style="user-select: none;">
</div>
</div>
<div class="luckysheet-toolbar-menu-button-dropdown luckysheet-inline-block iconfont icon-xiayige"
style="user-select: none;margin-left: 0px;margin-right: 4px;">
</div>
</div>
</div>
</div>
`;
}

160
src/controllers/handler.js

@ -2356,17 +2356,24 @@ export default function luckysheetHandler() {
width = resizeXY[4] - resizeXY[6] + resizeXY[2] - left;
top = resizeXY[5] - resizeXY[7] + topchange;
height = Math.round(width * (resizeXY[3] / resizeXY[2]));
top = resizeXY[5] - resizeXY[7] + resizeXY[3] - height;
if(top < minTop){
top = minTop;
height = resizeXY[5] - resizeXY[7] + resizeXY[3] - top;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
left = resizeXY[4] - resizeXY[6] + resizeXY[2] - width;
}
if(top > resizeXY[5] - resizeXY[7] + resizeXY[3] - 1){
top = resizeXY[5] - resizeXY[7] + resizeXY[3] - 1;
}
height = resizeXY[5] - resizeXY[7] + resizeXY[3] - top;
height = resizeXY[5] - resizeXY[7] + resizeXY[3] - top;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
left = resizeXY[4] - resizeXY[6] + resizeXY[2] - width;
}
}
else if(resize == 'lm'){//左中
left = resizeXY[4] - resizeXY[6] + leftchange;
@ -2397,16 +2404,22 @@ export default function luckysheetHandler() {
width = resizeXY[4] - resizeXY[6] + resizeXY[2] - left;
top = resizeXY[5] - resizeXY[7];
height = Math.round(width * (resizeXY[3] / resizeXY[2]));
height = resizeXY[3] + topchange;
top = resizeXY[5] - resizeXY[7];
if(height < 1){
height = 1;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
left = resizeXY[4] - resizeXY[6] + resizeXY[2] - width;
}
if(height > minTop + Store.cellmainHeight - Store.cellMainSrollBarSize - top){
height = minTop + Store.cellmainHeight - Store.cellMainSrollBarSize - top;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
left = resizeXY[4] - resizeXY[6] + resizeXY[2] - width;
}
}
else if(resize == 'rt'){//右上
@ -2422,17 +2435,22 @@ export default function luckysheetHandler() {
width = minLeft + Store.cellmainWidth - Store.cellMainSrollBarSize - left;
}
top = resizeXY[5] - resizeXY[7] + topchange;
height = Math.round(width * (resizeXY[3] / resizeXY[2]));
top = resizeXY[5] - resizeXY[7] + resizeXY[3] - height;
if(top < minTop){
top = minTop;
height = resizeXY[5] - resizeXY[7] + resizeXY[3] - top;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
}
if(top > resizeXY[5] - resizeXY[7] + resizeXY[3] - 1){
top = resizeXY[5] - resizeXY[7] + resizeXY[3] - 1;
}
height = resizeXY[5] - resizeXY[7] + resizeXY[3] - top;
height = resizeXY[5] - resizeXY[7] + resizeXY[3] - top;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
}
}
else if(resize == 'rm'){//右中
left = resizeXY[4] - resizeXY[6];
@ -2463,16 +2481,19 @@ export default function luckysheetHandler() {
width = minLeft + Store.cellmainWidth - Store.cellMainSrollBarSize - left;
}
height = Math.round(width * (resizeXY[3] / resizeXY[2]));
top = resizeXY[5] - resizeXY[7];
height = resizeXY[3] + topchange;
if(height < 1){
height = 1;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
}
if(height > minTop + Store.cellmainHeight - Store.cellMainSrollBarSize - top){
height = minTop + Store.cellmainHeight - Store.cellMainSrollBarSize - top;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
}
}
else if(resize == 'mt'){//中上
@ -2509,21 +2530,105 @@ export default function luckysheetHandler() {
}
}
else{
if (resize == "lm" || resize == "lt" || resize == "lb") {
if(resize == 'lt'){//左上
left = x;
width = resizeXY[2] - leftchange;
if (left > resizeXY[2] + resizeXY[4] - 1) {
left = resizeXY[2] + resizeXY[4] - 1;
width = resizeXY[2] + resizeXY[0] - (resizeXY[2] + resizeXY[4] - 1);
}
else if (left <= 0) {
left = 0;
width = resizeXY[2] + resizeXY[0];
}
height = Math.round(width * (resizeXY[3] / resizeXY[2]));
top = resizeXY[3] + resizeXY[1] - height;
if (top > resizeXY[3] + resizeXY[5] - 1) {
top = resizeXY[3] + resizeXY[5] - 1;
height = resizeXY[3] + resizeXY[1] - (resizeXY[3] + resizeXY[5] - 1);
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
left = resizeXY[2] + resizeXY[0] - width;
}
else if (top <= 0) {
top = 0;
height = resizeXY[3] + resizeXY[1];
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
left = resizeXY[2] + resizeXY[0] - width;
}
}
else if(resize == 'lm'){//左中
left = x;
width = resizeXY[2] - leftchange;
if (left > resizeXY[2] + resizeXY[4] - 1) {
left = resizeXY[2] + resizeXY[4] - 1;
width = resizeXY[2] + resizeXY[0] - (resizeXY[2] + resizeXY[4] - 1);
}
else if (left <= 0) {
left = 0;
width = resizeXY[2] + resizeXY[0];
}
}
else if(resize == 'lb'){//左下
left = x;
width = resizeXY[2] - leftchange;
if (left > resizeXY[2] + resizeXY[4] - 1) {
left = resizeXY[2] + resizeXY[4] - 1;
width = resizeXY[2] - (resizeXY[2] + resizeXY[4] - 1 - resizeXY[0]);
width = resizeXY[2] + resizeXY[0] - (resizeXY[2] + resizeXY[4] - 1);
}
else if (left <= 0) {
left = 0;
width = resizeXY[2] + resizeXY[0];
}
height = Math.round(width * (resizeXY[3] / resizeXY[2]));
if (height < 1) {
height = 1;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
left = resizeXY[2] + resizeXY[0] - width;
}
else if (height >= imageCtrl.currentWinH - resizeXY[5] - 42 - 6) {
height = imageCtrl.currentWinH - resizeXY[5] - 42 - 6;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
left = resizeXY[2] + resizeXY[0] - width;
}
}
else if(resize == 'rt'){//右上
width = resizeXY[2] + leftchange;
if (resize == "rm" || resize == "rt" || resize == "rb") {
if (width < 1) {
width = 1;
}
else if (width >= imageCtrl.currentWinW - resizeXY[4] - 22 - 36) {
width = imageCtrl.currentWinW - resizeXY[4] - 22 - 36;
}
height = Math.round(width * (resizeXY[3] / resizeXY[2]));
top = resizeXY[3] + resizeXY[1] - height;
if (top > resizeXY[3] + resizeXY[5] - 1) {
top = resizeXY[3] + resizeXY[5] - 1;
height = resizeXY[3] + resizeXY[1] - (resizeXY[3] + resizeXY[5] - 1);
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
}
else if (top <= 0) {
top = 0;
height = resizeXY[3] + resizeXY[1];
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
}
}
else if(resize == 'rm'){//右中
width = resizeXY[2] + leftchange;
if (width < 1) {
@ -2533,22 +2638,43 @@ export default function luckysheetHandler() {
width = imageCtrl.currentWinW - resizeXY[4] - 22 - 36;
}
}
else if(resize == 'rb'){//右下
width = resizeXY[2] + leftchange;
if (width < 1) {
width = 1;
}
else if (width >= imageCtrl.currentWinW - resizeXY[4] - 22 - 36) {
width = imageCtrl.currentWinW - resizeXY[4] - 22 - 36;
}
height = Math.round(width * (resizeXY[3] / resizeXY[2]));
if (resize == "mt" || resize == "lt" || resize == "rt") {
if (height < 1) {
height = 1;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
}
else if (height >= imageCtrl.currentWinH - resizeXY[5] - 42 - 6) {
height = imageCtrl.currentWinH - resizeXY[5] - 42 - 6;
width = Math.round(height * (resizeXY[2] / resizeXY[3]));
}
}
else if(resize == 'mt'){//中上
top = y;
height = resizeXY[3] - topchange;
if (top > resizeXY[3] + resizeXY[5] - 1) {
top = resizeXY[3] + resizeXY[5] - 1;
height = resizeXY[3] - (resizeXY[3] + resizeXY[5] - 1 - resizeXY[1]);
height = resizeXY[3] + resizeXY[1] - (resizeXY[3] + resizeXY[5] - 1);
}
else if (top <= 0) {
top = 0;
height = resizeXY[3] + resizeXY[1];
}
}
if (resize == "mb" || resize == "lb" || resize == "rb") {
else if(resize == 'mb'){//中下
height = resizeXY[3] + topchange;
if (height < 1) {

47
src/controllers/menuButton.js

@ -2801,6 +2801,53 @@ const menuButton = {
openProtectionModal(sheetFile);
});
//print
$("#luckysheet-icon-print").click(function(){
let menuButtonId = $(this).attr("id") + "-menuButton";
let $menuButton = $("#" + menuButtonId);
const _locale = locale();
const locale_print = _locale.print;
if($menuButton.length == 0){
let itemdata = [
{"text": locale_print.menuItemPrint, "value": "print", "example": '<i class="iconfont icon-sousuo" aria-hidden="true"></i>'},
{"text": "", "value": "split", "example": ""},
{"text": locale_print.menuItemAreas, "value": "areas", "example": '<i class="iconfont icon-tihuan" aria-hidden="true"></i>'},
{"text": locale_print.menuItemRows, "value": "rows", "example": '<i class="iconfont icon-zhuandao1" aria-hidden="true"></i>'},
{"text": locale_print.menuItemColumns, "value": "columns", "example": '<i class="iconfont icon-dingwei" aria-hidden="true"></i>'},
];
let itemset = _this.createButtonMenu(itemdata);
let menu = replaceHtml(_this.menu, { "id": "print", "item": itemset, "subclass": "", "sub": "" });
$("body").append(menu);
$menuButton = $("#" + menuButtonId).width(180);
$menuButton.find(".luckysheet-cols-menuitem").click(function(){
$menuButton.hide();
luckysheetContainerFocus();
let $t = $(this), itemvalue = $t.attr("itemvalue");
if(itemvalue == "print"){ //Print config
alert("print");
}
else if(itemvalue == "areas" || itemvalue == "rows" || itemvalue == "columns"){ //range
alert("areas");
}
});
}
let userlen = $(this).outerWidth();
let tlen = $menuButton.outerWidth();
let menuleft = $(this).offset().left;
if(tlen > userlen && (tlen + menuleft) > $("#" + Store.container).width()){
menuleft = menuleft - tlen + userlen;
}
mouseclickposition($menuButton, menuleft, $(this).offset().top + 25, "lefttop");
});
$("body").on("mouseover mouseleave",".luckysheet-menuButton .luckysheet-cols-submenu", function(e){
let $t = $(this), attrid = $t.attr("itemvalue"),
$attr = $("#luckysheet-icon-" + attrid + "-menuButton");

83
src/controllers/print.js

@ -1,4 +1,9 @@
import { jsPDF } from "jspdf";
import luckysheetConfigsetting from './luckysheetConfigsetting';
import {zoomChange} from './zoom';
import sheetmanage from './sheetmanage';
import server from './server';
import Store from '../store';
// import { jsPDF } from "jspdf";
let ExcelPlaceholder = {
"[tabName]":"&A",
@ -20,4 +25,78 @@ function getOneMmsPx (){
document.querySelector("body").appendChild(div);
let mm1 = document.getElementById("mm").getBoundingClientRect();
return mm1.width;
}
}
export function viewChange(curType, preType){
let currentSheet = sheetmanage.getSheetByIndex();
if(currentSheet.config==null){
currentSheet.config = {};
}
if(currentSheet.config.sheetViewZoom==null){
currentSheet.config.sheetViewZoom = {};
}
let defaultZoom = 1, type="zoomScaleNormal";
if(curType=="viewNormal"){
type = "viewNormalZoomScale";
}
else if(curType=="viewLayout"){
type = "viewLayoutZoomScale";
}
else if(curType=="viewPage"){
type = "viewPageZoomScale";
defaultZoom = 0.6;
}
let curZoom = currentSheet.config.sheetViewZoom[type];
if(curZoom==null){
curZoom = defaultZoom;
}
currentSheet.config.curentsheetView = curType;
if (Store.clearjfundo) {
Store.jfredo.push({
"type": "viewChange",
"curType": curType,
"preType": preType,
"sheetIndex": Store.currentSheetIndex,
});
}
// Store.zoomRatio = curZoom;
// server.saveParam("all", Store.currentSheetIndex, curZoom, { "k": "zoomRatio" });
server.saveParam("cg", Store.currentSheetIndex, curType, { "k": "curentsheetView" });
zoomChange(curZoom);
}
function switchViewBtn($t){
let $viewList = $t.parent(), preType=$viewList.find("luckysheet-print-viewBtn-active").attr("type");
if($t.attr("type") == preType){
return;
}
let curType = $t.attr("type");
if(curType!=null){
viewChange(curType, preType);
}
else{
return;
}
$t.parent().find(".luckysheet-print-viewBtn").removeClass("luckysheet-print-viewBtn-active");
$t.addClass("luckysheet-print-viewBtn-active");
}
export function printInitial(){
let container = luckysheetConfigsetting.container;
let _this = this;
$("#"+container).find(".luckysheet-print-viewBtn").click(function(){
switchViewBtn($(this));
});
}

4
src/controllers/resize.js

@ -330,7 +330,8 @@ export function menuToolBarWidth() {
$('#luckysheet-chart-btn-screenshot').offset().left,
$('#luckysheet-icon-seachmore').offset().left,
$('#luckysheet-icon-protection').offset().left,
$('#luckysheet-icon-protection').offset().left + $('#luckysheet-icon-protection').outerWidth() + 5,
$('#luckysheet-icon-print').offset().left,
$('#luckysheet-icon-print').offset().left + $('#luckysheet-icon-protection').outerWidth() + 5,
];
toobarObject.toobarElements = [
'#luckysheet-icon-undo',
@ -367,5 +368,6 @@ export function menuToolBarWidth() {
'#luckysheet-chart-btn-screenshot',
'#luckysheet-icon-seachmore',
'#luckysheet-icon-protection',
'#luckysheet-icon-print',
]
}

15
src/controllers/rowColumnOperation.js

@ -1696,6 +1696,7 @@ export function rowColumnOperationInitial(){
let cfg = $.extend(true, {}, Store.config);
let type;
let images = null;
if(Store.luckysheetRightHeadClickIs == "row"){
if(!checkProtectionAuthorityNormal(Store.currentSheetIndex, "formatRows")){
@ -1724,6 +1725,8 @@ export function rowColumnOperationInitial(){
for(let r = r1; r <= r2; r++){
cfg["rowlen"][r] = size;
images = imageCtrl.moveChangeSize("row", r, size);
}
}
}
@ -1754,6 +1757,8 @@ export function rowColumnOperationInitial(){
for(let c = c1; c <= c2; c++){
cfg["columnlen"][c] = size;
images = imageCtrl.moveChangeSize("column", c, size);
}
}
}
@ -1763,9 +1768,11 @@ export function rowColumnOperationInitial(){
Store.jfredo.push({
"type": "resize",
"ctrlType": type,
"sheetIndex": Store.currentSheetIndex,
"config": $.extend(true, {}, Store.config),
"curconfig": $.extend(true, {}, cfg),
"sheetIndex": Store.currentSheetIndex
"images": $.extend(true, {}, imageCtrl.images),
"curImages": $.extend(true, {}, images)
});
}
@ -1773,6 +1780,12 @@ export function rowColumnOperationInitial(){
Store.config = cfg;
Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].config = Store.config;
//images
Store.luckysheetfile[getSheetIndex(Store.currentSheetIndex)].images = images;
server.saveParam("all", Store.currentSheetIndex, images, { "k": "images" });
imageCtrl.images = images;
imageCtrl.allImagesShow();
if(Store.luckysheetRightHeadClickIs == "row"){
server.saveParam("cg", Store.currentSheetIndex, cfg["rowlen"], { "k": "rowlen" });
jfrefreshgrid_rhcw(Store.flowdata.length, null);

19
src/controllers/zoom.js

@ -1,6 +1,7 @@
import Store from '../store';
import locale from '../locale/locale';
import { replaceHtml } from '../utils/util';
import sheetmanage from './sheetmanage';
import {changeSheetContainerSize} from './resize';
import { jfrefreshgrid_rhcw } from '../global/refresh';
import server from './server';
@ -26,9 +27,25 @@ export function zoomChange(ratio){
}
Store.zoomRatio = ratio;
let currentSheet = sheetmanage.getSheetByIndex();
if(currentSheet.config==null){
currentSheet.config = {};
}
if(currentSheet.config.sheetViewZoom==null){
currentSheet.config.sheetViewZoom = {};
}
let type = currentSheet.config.curentsheetView;
if(type==null){
type = "viewNormal";
}
currentSheet.config.sheetViewZoom[type+"ZoomScale"] = ratio;
server.saveParam("all", Store.currentSheetIndex, Store.zoomRatio, { "k": "zoomRatio" });
server.saveParam("cg", Store.currentSheetIndex, currentSheet.config["sheetViewZoom"], { "k": "sheetViewZoom" });
zoomRefreshView();
}, 100);

3
src/core.js

@ -30,6 +30,7 @@ import { getcellvalue, getdatabyselection } from './global/getdata';
import { setcellvalue } from './global/setdata';
import { selectHightlightShow } from './controllers/select';
import {zoomInitial} from './controllers/zoom';
import {printInitial} from './controllers/print';
import method from './global/method';
import * as api from './global/api';
@ -109,6 +110,7 @@ luckysheet.create = function (setting) {
luckysheetConfigsetting.defaultRowHeight = extendsetting.defaultRowHeight;
luckysheetConfigsetting.title = extendsetting.title;
luckysheetConfigsetting.container = extendsetting.container;
// Register plugins
initPlugins(extendsetting.plugins , extendsetting.data);
@ -158,6 +160,7 @@ function initialWorkBook(){
keyboardInitial();//Keyboard operate initialization
orderByInitial();//menu bar orderby function initialization
zoomInitial();//zoom method initialization
printInitial();//print initialization
}
//获取所有表格数据

107
src/global/extend.js

@ -265,7 +265,9 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) {
}
if(newFilterObj != null && newFilterObj.filter != null){
cfg["rowhidden"] = {};
if(cfg["rowhidden"] == null){
cfg["rowhidden"] = {};
}
for(let k in newFilterObj.filter){
let f_rowhidden = newFilterObj.filter[k].rowhidden;
@ -275,9 +277,6 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) {
}
}
}
else{
delete cfg["rowhidden"];
}
//条件格式配置变动
let CFarr = file.luckysheet_conditionformat_save;
@ -541,6 +540,32 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) {
cfg["rowlen"] = rowlen_new;
}
//隐藏行配置变动
if(cfg["rowhidden"] != null){
let rowhidden_new = {};
for(let r in cfg["rowhidden"]){
r = parseFloat(r);
if(r < index){
rowhidden_new[r] = cfg["rowhidden"][r];
}
else if(r == index){
if(direction == "lefttop"){
rowhidden_new[(r + value)] = cfg["rowhidden"][r];
}
else if(direction == "rightbottom"){
rowhidden_new[r] = cfg["rowhidden"][r];
}
}
else{
rowhidden_new[(r + value)] = cfg["rowhidden"][r];
}
}
cfg["rowhidden"] = rowhidden_new;
}
//空行模板
let row = [];
for(let c = 0; c < d[0].length; c++){
@ -667,6 +692,32 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) {
cfg["columnlen"] = columnlen_new;
}
//隐藏列配置变动
if(cfg["colhidden"] != null){
let colhidden_new = {};
for(let c in cfg["colhidden"]){
c = parseFloat(c);
if(c < index){
colhidden_new[c] = cfg["colhidden"][c];
}
else if(c == index){
if(direction == "lefttop"){
colhidden_new[(c + value)] = cfg["colhidden"][c];
}
else if(direction == "rightbottom"){
colhidden_new[c] = cfg["colhidden"][c];
}
}
else{
colhidden_new[(c + value)] = cfg["colhidden"][c];
}
}
cfg["colhidden"] = colhidden_new;
}
//空列模板
let col = [];
for(let r = 0; r < d.length; r++){
@ -1114,7 +1165,9 @@ function luckysheetdeletetable(type, st, ed, sheetIndex) {
}
if(newFilterObj != null && newFilterObj.filter != null){
cfg["rowhidden"] = {};
if(cfg["rowhidden"] == null){
cfg["rowhidden"] = {};
}
for(let k in newFilterObj.filter){
let f_rowhidden = newFilterObj.filter[k].rowhidden;
@ -1124,9 +1177,6 @@ function luckysheetdeletetable(type, st, ed, sheetIndex) {
}
}
}
else{
delete cfg["rowhidden"];
}
//条件格式配置变动
let CFarr = file.luckysheet_conditionformat_save;
@ -1406,6 +1456,23 @@ function luckysheetdeletetable(type, st, ed, sheetIndex) {
cfg["rowlen"] = rowlen_new;
//隐藏行配置变动
if(cfg["rowhidden"] == null){
cfg["rowhidden"] = {};
}
let rowhidden_new = {};
for(let r in cfg["rowhidden"]){
if(r < st){
rowhidden_new[r] = cfg["rowhidden"][r];
}
else if(r > ed){
rowhidden_new[r - slen] = cfg["rowhidden"][r];
}
}
cfg["rowhidden"] = rowhidden_new;
//边框配置变动
if(cfg["borderInfo"] && cfg["borderInfo"].length > 0){
let borderInfo = [];
@ -1499,6 +1566,23 @@ function luckysheetdeletetable(type, st, ed, sheetIndex) {
cfg["columnlen"] = columnlen_new;
//隐藏列配置变动
if(cfg["colhidden"] == null){
cfg["colhidden"] = {};
}
let colhidden_new = {};
for(let c in cfg["colhidden"]){
if(c < st){
colhidden_new[c] = cfg["colhidden"][c];
}
else if(c > ed){
colhidden_new[c - slen] = cfg["colhidden"][c];
}
}
cfg["colhidden"] = colhidden_new;
//边框配置变动
if(cfg["borderInfo"] && cfg["borderInfo"].length > 0){
let borderInfo = [];
@ -1918,7 +2002,9 @@ function luckysheetDeleteCell(type, str, edr, stc, edc, sheetIndex) {
}
if(newFilterObj != null && newFilterObj.filter != null){
cfg["rowhidden"] = {};
if(cfg["rowhidden"] == null){
cfg["rowhidden"] = {};
}
for(let k in newFilterObj.filter){
let f_rowhidden = newFilterObj.filter[k].rowhidden;
@ -1928,9 +2014,6 @@ function luckysheetDeleteCell(type, str, edr, stc, edc, sheetIndex) {
}
}
}
else{
delete cfg["rowhidden"];
}
//条件格式配置变动
let CFarr = file.luckysheet_conditionformat_save;

43
src/global/getRowlen.js

@ -1061,7 +1061,7 @@ function getCellTextInfo(cell , ctx, option){
if(verticalAlign == "0"){//mid
left = x + cellWidth/2 - (textW_all/2) + lastLineSpaceHeight*Math.cos(rtPI)/2;
top = y + cellHeight/2 - textH_all/2 - lastLineSpaceHeight*Math.sin(rtPI)/2;
top = y + cellHeight/2 - textH_all/2 - lastLineSpaceHeight*Math.cos(rtPI)/2;
}
else if(verticalAlign == "1"){//top
left = x + cellWidth/2 - textW_all/2;
@ -1069,13 +1069,13 @@ function getCellTextInfo(cell , ctx, option){
}
else if(verticalAlign == "2"){//bottom
left = x + cellWidth/2 - (textW_all/2)+lastLineSpaceHeight*Math.cos(rtPI);
top = y + cellHeight - rh/2 - textH_all/2 - lastLineSpaceHeight*Math.sin(rtPI);
top = y + cellHeight - rh/2 - textH_all/2 - lastLineSpaceHeight*Math.cos(rtPI);
}
}
else if(horizonAlign == "1"){//left
if(verticalAlign == "0"){//mid
left = x - rh*Math.sin(rtPI)/2 + lastLineSpaceHeight*Math.cos(rtPI)/2;
top = y + cellHeight/2 + rh*Math.cos(rtPI)/2 - lastLineSpaceHeight*Math.sin(rtPI)/2;
top = y + cellHeight/2 + rh*Math.cos(rtPI)/2 - lastLineSpaceHeight*Math.cos(rtPI)/2;
}
else if(verticalAlign == "1"){//top
left = x - rh*Math.sin(rtPI);
@ -1083,13 +1083,13 @@ function getCellTextInfo(cell , ctx, option){
}
else if(verticalAlign == "2"){//bottom
left = x + lastLineSpaceHeight*Math.cos(rtPI);
top = y + cellHeight - lastLineSpaceHeight*Math.sin(rtPI);
top = y + cellHeight - lastLineSpaceHeight*Math.cos(rtPI);
}
}
else if(horizonAlign == "2"){//right
if(verticalAlign == "0"){//mid
left = x + cellWidth - rw/2 - (textW_all_inner/2+(textH_all/2)/Math.tan(rtPI))+ lastLineSpaceHeight*Math.cos(rtPI)/2;
top = y + cellHeight/2 - textH_all/2 - lastLineSpaceHeight*Math.sin(rtPI)/2;
top = y + cellHeight/2 - textH_all/2 - lastLineSpaceHeight*Math.cos(rtPI)/2;
}
else if(verticalAlign == "1"){//top fixOneLineLeft
left = x + cellWidth - textW_all + fixOneLineLeft;
@ -1097,7 +1097,7 @@ function getCellTextInfo(cell , ctx, option){
}
else if(verticalAlign == "2"){//bottom
left = x + cellWidth - rw*Math.cos(rtPI) + lastLineSpaceHeight*Math.cos(rtPI);
top = y + cellHeight - rw*Math.sin(rtPI) - lastLineSpaceHeight*Math.sin(rtPI);
top = y + cellHeight - rw*Math.sin(rtPI) - lastLineSpaceHeight*Math.cos(rtPI);
}
}
@ -1152,21 +1152,21 @@ function getCellTextInfo(cell , ctx, option){
if(verticalAlign == "0"){//mid
left = x + cellWidth/2 - (textW_all/2) - lastLineSpaceHeight*Math.cos(rtPI)/2;
top = y + cellHeight/2 - textH_all/2 + lastLineSpaceHeight*Math.sin(rtPI)/2;
top = y + cellHeight/2 - textH_all/2 + lastLineSpaceHeight*Math.cos(rtPI)/2;
}
else if(verticalAlign == "1"){//top
left = x + cellWidth/2 - textW_all/2 - lastLineSpaceHeight*Math.cos(rtPI)/2;
top = y - (textH_all/2 - rh/2)+lastLineSpaceHeight*Math.sin(rtPI)/2;
top = y - (textH_all/2 - rh/2)+lastLineSpaceHeight*Math.cos(rtPI)/2;
}
else if(verticalAlign == "2"){//bottom
left = x + cellWidth/2 - (textW_all/2)-lastLineSpaceHeight*Math.cos(rtPI);
top = y + cellHeight - rh/2 - textH_all/2 - lastLineSpaceHeight*Math.sin(rtPI);
top = y + cellHeight - rh/2 - textH_all/2 - lastLineSpaceHeight*Math.cos(rtPI);
}
}
else if(horizonAlign == "1"){//left
if(verticalAlign == "0"){//mid
left = x - rh*Math.sin(rtPI)/2 - lastLineSpaceHeight*Math.cos(rtPI)/2;
top = y - textH_all + cellHeight/2 - rh*Math.cos(rtPI)/2 - lastLineSpaceHeight*Math.sin(rtPI)/2;
top = y - textH_all + cellHeight/2 - rh*Math.cos(rtPI)/2 - lastLineSpaceHeight*Math.cos(rtPI)/2;
}
else if(verticalAlign == "1"){//top
left = x;
@ -1174,13 +1174,13 @@ function getCellTextInfo(cell , ctx, option){
}
else if(verticalAlign == "2"){//bottom
left = x - rh*Math.sin(rtPI) - lastLineSpaceHeight*Math.cos(rtPI);
top = y - textH_all + cellHeight - rh*Math.cos(rtPI) - lastLineSpaceHeight*Math.sin(rtPI);
top = y - textH_all + cellHeight - rh*Math.cos(rtPI) - lastLineSpaceHeight*Math.cos(rtPI);
}
}
else if(horizonAlign == "2"){//right
if(verticalAlign == "0"){//mid
left = x + cellWidth - rw/2 - textW_all/2 - lastLineSpaceHeight*Math.cos(rtPI)/2;
top = y + cellHeight/2 - textH_all/2 - lastLineSpaceHeight*Math.sin(rtPI)/2;
top = y + cellHeight/2 - textH_all/2 - lastLineSpaceHeight*Math.cos(rtPI)/2;
}
else if(verticalAlign == "1"){//top fixOneLineLeft
left = x + cellWidth - rw*Math.cos(rtPI);
@ -1188,7 +1188,7 @@ function getCellTextInfo(cell , ctx, option){
}
else if(verticalAlign == "2"){//bottom
left = x + cellWidth - textW_all - lastLineSpaceHeight*Math.cos(rtPI) + fixOneLineLeft;
top = y + cellHeight - lastLineSpaceHeight*Math.sin(rtPI);
top = y + cellHeight - lastLineSpaceHeight*Math.cos(rtPI);
}
}
@ -1324,10 +1324,11 @@ function getCellTextInfo(cell , ctx, option){
textContent.rotate = rt;
rt = Math.abs(rt);
let rtPI = rt*Math.PI/180;
let textWidthAll = textWidth * Math.cos(rt*Math.PI/180) + textHeight * Math.sin(rt*Math.PI/180);//consider text box wdith and line height
let textWidthAll = textWidth * Math.cos(rtPI) + textHeight * Math.sin(rtPI);//consider text box wdith and line height
let textHeightAll = textWidth * Math.sin(rt*Math.PI/180) + textHeight * Math.cos(rt*Math.PI/180);//consider text box wdith and line height
let textHeightAll = textWidth * Math.sin(rtPI) + textHeight * Math.cos(rtPI);//consider text box wdith and line height
if(rt!=0){
textContent.textHeightAll = textHeightAll;
@ -1345,20 +1346,20 @@ function getCellTextInfo(cell , ctx, option){
let width = textWidthAll, height = textHeightAll;
let left = space_width + textHeight * Math.sin(rt*Math.PI/180)*isRotateUp; //默认为1,左对齐
let left = space_width + textHeight * Math.sin(rtPI)*isRotateUp; //默认为1,左对齐
if(horizonAlign == "0"){ //居中对齐
left = cellWidth / 2 - (width / 2) + textHeight * Math.sin(rt*Math.PI/180)*isRotateUp;
left = cellWidth / 2 - (width / 2) + textHeight * Math.sin(rtPI)*isRotateUp;
}
else if(horizonAlign == "2"){ //右对齐
left = (cellWidth - space_width) - width + textHeight * Math.sin(rt*Math.PI/180)*isRotateUp;
left = (cellWidth - space_width) - width + textHeight * Math.sin(rtPI)*isRotateUp;
}
let top = (cellHeight - space_height) - height + measureText.actualBoundingBoxAscent + textWidth * Math.sin(rt*Math.PI/180)*isRotateUp; //默认为2,下对齐
let top = (cellHeight - space_height) - height + measureText.actualBoundingBoxAscent * Math.cos(rtPI) + textWidth * Math.sin(rtPI)*isRotateUp; //默认为2,下对齐
if(verticalAlign == "0"){ //居中对齐
top = cellHeight / 2 - (height / 2) + measureText.actualBoundingBoxAscent + textWidth * Math.sin(rt*Math.PI/180)*isRotateUp;
top = cellHeight / 2 - (height / 2) + measureText.actualBoundingBoxAscent* Math.cos(rtPI) + textWidth * Math.sin(rtPI)*isRotateUp;
}
else if(verticalAlign == "1"){ //上对齐
top = space_height + measureText.actualBoundingBoxAscent + textWidth * Math.sin(rt*Math.PI/180)*isRotateUp;
top = space_height + measureText.actualBoundingBoxAscent* Math.cos(rtPI) + textWidth * Math.sin(rtPI)*isRotateUp;
}
textContent.type = "plain";

94
src/index.html

@ -37,7 +37,7 @@
container: 'luckysheet',
lang: 'en',
allowEdit:true,
forceCalculation:true,
forceCalculation:false,
plugins: ['chart'],
fontList:[
{
@ -54,52 +54,58 @@
}
],
data:
[sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart,sheetPicture,sheetDataVerification]
// [{"name":"Sheet1","config":{"columnlen":{"0":241},"rowlen":{"0":81}},"index":"1","status":"1","order":"0","luckysheet_select_save":[{"row":[0,0],"column":[4,4],"sheetIndex":1}],"zoomRatio":1,"showGridLines":"1","defaultColWidth":72,"defaultRowHeight":18,"celldata":[
// {"r":0,"c":0,
// "v":{
// "ct":{
// "fa":"General",
// "t":"inlineStr",
// "s":[
// {
// "ff":"Arial", //font family
// "fc":"#fff000",//font color
// "fs":12,//font size
// "cl":0,//strike
// "un":0,//underline
// "bl":0,//blod
// "it":0,//italic
// v:"我在马路\r\n边捡到\r\n\r\n一分钱"
// },
// {
// "ff":"Arial", //font family
// "fc":"#ff0000",//font color
// "fs":14,//font size
// "cl":"1",//strike
// "un":"1",//underline
// "bl":"1",//blod
// "it":"0",//italic
// "ss":0,//0 none 1sup 2sub
// v:"交给警\r\n察叔叔\r\n"
// },
// ]
// },
// "fs":11,
// "ff":"等线",
// "vt":0,
// "tb":2,
// "v":"",
// "qp":1,
// }
// },
// {"r":17,"c":2,"v":{"v":"Luckysheet","ct":{"fa":"General","t":"g"},"bg":null,"bl":0,"it":0,"ff":0,"fs":"11","fc":"rgb(51, 51, 51)","ht":1,"vt":1,"m":"Luckysheet"}}
// ],"calcChain":[]}]
// [sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart,sheetPicture,sheetDataVerification]
/*[{"name":"Sheet1","config":{"columnlen":{"0":241},"rowlen":{"0":81}},"index":"1","status":"1","order":"0","luckysheet_select_save":[{"row":[0,0],"column":[4,4],"sheetIndex":1}],"zoomRatio":1,"showGridLines":"1","defaultColWidth":72,"defaultRowHeight":18,"celldata":[
{"r":0,"c":0,
"v":{
"ct":{
"fa":"General",
"t":"inlineStr",
"s":[
{
"ff":"Arial", //font family
"fc":"#fff000",//font color
"fs":12,//font size
"cl":0,//strike
"un":0,//underline
"bl":0,//blod
"it":0,//italic
v:"我在马路\r\n边捡到\r\n\r\n一分钱"
},
{
"ff":"Arial", //font family
"fc":"#ff0000",//font color
"fs":14,//font size
"cl":"1",//strike
"un":"1",//underline
"bl":"1",//blod
"it":"0",//italic
"ss":0,//0 none 1sup 2sub
v:"交给警\r\n察叔叔\r\n"
},
]
},
"fs":11,
"ff":"等线",
"vt":0,
"tb":2,
"v":"",
"qp":1,
}
},
{"r":17,"c":2,"v":{"v":"Luckysheet","ct":{"fa":"General","t":"g"},"bg":null,"bl":0,"it":0,"ff":0,"fs":"11","fc":"rgb(51, 51, 51)","ht":1,"vt":1,"m":"Luckysheet"}}
],"calcChain":[]}]*/
/*
[{
"name": "Cell",
"config": {
"curentsheetView":"viewNormal",//viewNormal, viewLayout, viewPage
"sheetViewZoom":{
"viewNormalZoomScale": 1 ,
"viewLayoutZoomScale":1 ,
"viewPageZoomScale":0.6,
},
"printoptions":{
unit:"mm",//mm(default), in, pt, cm, m,
PrintArea:"$A$1:$S$31",//print range
@ -1776,7 +1782,7 @@
],
"scrollLeft": 0,
"scrollTop": 0
}]*/
}]
})
})

85
src/locale/en.js

@ -38,16 +38,16 @@ export default {
findAndReplace: 'Find and replace',
sum: 'SUM',
autoSum: 'Auto SUM',
moreFunction: 'More function',
moreFunction: 'More functions',
conditionalFormat: 'Conditional format',
postil: 'Comment',
pivotTable: 'PivotTable',
pivotTable: 'Pivot Table',
chart: 'Chart',
screenshot: 'Screenshot',
splitColumn: 'Split text',
insertImage: 'Insert image',
dataVerification: 'Data verification',
protection:"Protection the sheet",
protection:"Protect the sheet",
clearText:"Clear color",
noColorSelectedText:"No color is selected",
@ -56,9 +56,10 @@ export default {
toolLess:"Less",
toolClose:"Close",
toolMoreTip:"More features",
moreOptions:"More Options",
moreOptions:"More options",
cellFormat:"Cell format config",
print:"Print",
},
alternatingColors:{
applyRange: 'Apply to range',
@ -93,7 +94,7 @@ export default {
end: 'ESC',
tipSelectRange:"Please select the range to be copied",
tipNotMulti:"Cannot perform this operation on multiple selection range",
tipNotMulti:"Cannot perform this operation on multiple selection ranges",
},
format:{
moreCurrency: 'More currency formats',
@ -378,7 +379,7 @@ export default {
merge:{
mergeAll:"Merge all",
mergeV:"Vertically",
mergeH:"Horizentally",
mergeH:"Horizontally",
mergeCancel:"Unmerge",
overlappingError:"Cannot merge overlapping areas",
partiallyError:"Cannot perform this operation on partially merged cells",
@ -400,15 +401,15 @@ export default {
rotation:{
"none":"None",
"angleup":"Tilt Up",
"angledown":"Tilt down",
"angledown":"Tilt Down",
"vertical":"Stack Vertically",
"rotationUp":"Rotate Up",
"rotationDown":"Rotate down"
"rotationDown":"Rotate Down"
},
freezen:{
default:"Freeze",
freezenRow:"First Row",
freezenColumn:"First column",
freezenColumn:"First Column",
freezenRC:"Both",
freezenRowRange:"Freezen row range",
freezenColumnRange:"Freezen column range",
@ -422,7 +423,7 @@ export default {
"desc":"Descending ",
"custom":"Custom sort",
"hasTitle":"Data has header row",
"hasTitle":"Data has a header row",
"sortBy":"Sort by",
"addOthers":"Add another sort column",
"close":"close",
@ -442,8 +443,7 @@ export default {
},
filter:{
"filter":"create filter",
"clearFilter":"Cancel filter",
filter:"create filter",
sortByAsc:"Sort A-Z",
sortByDesc:"Sort Z-A",
@ -506,7 +506,7 @@ export default {
deleteSelected: 'Delete selected ',
hide: 'Hide',
hideSelected: 'Hide selected ',
showHide: 'Show hide ',
showHide: 'Show hidden ',
to: 'Towards',
left: 'Left',
right: 'Right',
@ -576,9 +576,9 @@ export default {
downLoadClose:"Close",
downLoadCopy:"Copy to clipboard",
downLoadBtn:"DownLoad",
downLoadBtn:"Download",
browserNotTip:"not supported by IE browser!",
rightclickTip:"Please right click \"copy\" on the picture",
rightclickTip:"Please right-click \"copy\" on the picture",
successTip:"Successfully (if pasting fails, please right-click on the image to \"copy image\")",
},
splitText:{
@ -620,7 +620,7 @@ export default {
findAndReplace:{
find:"Find",
replace:"Replace",
goto:"Goto",
goto:"Go to",
location:"Location",
formula:"Formula",
date:"Date",
@ -663,7 +663,7 @@ export default {
locationConstant:"Constant",
locationFormula:"Formula",
locationDate:"Date",
locationDigital:"number",
locationDigital:"Number",
locationString:"String",
locationBool:"Logical",
locationError:"Error",
@ -672,7 +672,7 @@ export default {
locationRowSpan:"Row span",
locationColumnSpan:"Column span",
locationTiplessTwoRow:"Please select at least two Row",
locationTiplessTwoRow:"Please select at least two rows",
locationTiplessTwoColumn:"Please select at least two columns",
locationTipNotFindCell:"Cell not found"
@ -766,9 +766,9 @@ export default {
close: 'Close',
clearColorSelect: 'Clear color select',
sheet: 'Sheet',
currentSheet: 'CurrentSheet',
dataBar: 'dataBar',
dataBarColor: 'dataBar color',
currentSheet: 'Current Sheet',
dataBar: 'data bar',
dataBarColor: 'data bar color',
gradientDataBar_1: 'Blue-white gradient data bar',
gradientDataBar_2: 'Green-white gradient data bar',
gradientDataBar_3: 'Red-white gradient data bar',
@ -781,7 +781,7 @@ export default {
solidColorDataBar_4: 'Orange data bar',
solidColorDataBar_5: 'Light blue data bar',
solidColorDataBar_6: 'Purple data bar',
colorGradation: 'colorGradation',
colorGradation: 'color gradation',
colorGradation_1: 'Green-yellow-red color gradation',
colorGradation_2: 'Red-yellow-green color gradation',
colorGradation_3: 'Green-white-red color gradation',
@ -810,11 +810,11 @@ export default {
duplicateValue: 'Duplicate value',
uniqueValue: 'Unique value',
top: 'Top',
top10: 'Top10',
top10_percent: 'Top10%',
top10: 'Top 10',
top10_percent: 'Top 10%',
last: 'Last',
last10: 'Last10',
last10_percent: 'Last10%',
last10: 'Last 10',
last10_percent: 'Last 10%',
oneself: '',
above: 'Above',
aboveAverage: 'Above average',
@ -877,7 +877,7 @@ export default {
},
dataVerification: {
cellRange: 'Cell range',
selectCellRange: 'Click to select cell range',
selectCellRange: 'Click to select a cell range',
selectCellRange2: 'Please select a range of cells',
verificationCondition: 'Verification condition',
dropdown: 'drop-down list',
@ -914,7 +914,7 @@ export default {
phoneNumber: 'Phone number',
remote: 'Automatic remote acquisition option',
prohibitInput: 'Prohibit input when input data is invalid',
hintShow: 'Show prompt when cell is selected',
hintShow: 'Show prompt when the cell is selected',
deleteVerification: 'Delete verification',
tooltipInfo1: 'The drop-down list option cannot be empty',
tooltipInfo2: 'Checkbox content cannot be empty',
@ -982,7 +982,7 @@ export default {
"Parser":"Parser",
"Statistical":"Statistical",
"Text":"Text",
"dataMining":"DataMining",
"dataMining":"Data Mining",
"selectFunctionTitle":"Select a function",
"calculationResult":"Result",
@ -996,7 +996,7 @@ export default {
"helpAbstract":"Abstract",
"execfunctionError":'Error in the formula',
"execfunctionSelfError":'Formula cannot refer to its own cell',
"execfunctionSelfError":'The formula cannot refer to its own cell',
"execfunctionSelfErrorResult":'The formula cannot refer to its own cell, which will lead to inaccurate calculation results',
"allowRepeatText":"Repeat",
@ -1020,7 +1020,7 @@ export default {
pasteMustKeybordAlertHTML:"<span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + C</span>&nbsp;&nbsp;进行复制<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + V</span>&nbsp;&nbsp;进行粘贴<br/><span style='line-height: 1.0;font-size:36px;font-weight: bold;color:#666;'>Ctrl + X</span>&nbsp;&nbsp;进行剪切",
},
pivotTable:{
title:"PivotTable",
title:"Pivot Table",
closePannel:"Close",
editRange:"Range",
tipPivotFieldSelected:"Select the fields",
@ -1040,8 +1040,8 @@ export default {
valueStatisticsSUM:"Sum",
valueStatisticsCOUNT:"Count",
valueStatisticsCOUNTA:"CountA",
valueStatisticsCOUNTUNIQUE:"CountUnique",
valueStatisticsCOUNTA:"Count A",
valueStatisticsCOUNTUNIQUE:"Count Unique",
valueStatisticsAVERAGE:"Average",
valueStatisticsMAX:"Max",
valueStatisticsMIN:"Min",
@ -1081,7 +1081,7 @@ export default {
onlyFormat:"Only format",
noFormat:"Not format",
day:"Day",
workDay:"WorkDay",
workDay:"Work Day",
month:"Month",
year:"Year",
chineseNumber:"Chinese numbers",
@ -1092,8 +1092,8 @@ export default {
},
protection:{
protectiontTitle:"Protection",
enterPassword:"Enter a password(optional)",
enterHintTitle:"Prompt when editing is prohibited(optional)",
enterPassword:"Enter a password (optional)",
enterHintTitle:"Prompt when editing is prohibited (optional)",
enterHint:"The cell or chart you are trying to change is in a protected worksheet. If you want to change it, please unprotect the worksheet. You may need to enter a password",
swichProtectionTip:"Protect the sheet and contents of locked cells",
authorityTitle:"Allow users of this sheet to:",
@ -1109,7 +1109,7 @@ export default {
deleteRows:"Delete rows",
sort:"Sort",
filter:"Filter",
usePivotTablereports:"Use PivotTable reports",
usePivotTablereports:"Use Pivot Table reports",
editObjects:"Edit objects",
editScenarios:"Edit scenarios",
@ -1118,11 +1118,11 @@ export default {
allowRangeAddTitle:"Title",
allowRangeAddSqrf:"Reference",
selectCellRange: 'Click to select cell range',
selectCellRange: 'Click to select a cell range',
selectCellRangeHolder:"Cell range",
allowRangeAddTitlePassword:"Password",
allowRangeAddTitleHint:"Prompt",
allowRangeAddTitleHintTitle:"Prompt when password is set(optional)",
allowRangeAddTitleHintTitle:"Prompt when a password is set (optional)",
allowRangeAddtitleDefault:"Input range name",
rangeItemDblclick:"Double click to edit",
@ -1148,7 +1148,7 @@ export default {
protection:"Protection",
locked:"Locked",
hidden:"Hidden",
protectionTips:"To lock cells or hide formulas, protect the wordsheet. On the toolbar, Click Protect Sheet Button",
protectionTips:"To lock cells or hide formulas, protect the worksheet. On the toolbar, Click Protect Sheet Button",
tipsPart:"Partial checked",
tipsAll:"All checked",
@ -1160,6 +1160,11 @@ export default {
normalBtn:"Normal",
layoutBtn:"Page Layout",
pageBtn:"Page break preview",
menuItemPrint:"Print (Ctrl+P)",
menuItemAreas:"Print areas",
menuItemRows:"Print title rows",
menuItemColumns:"Print title columns",
}
};

1168
src/locale/es.js

File diff suppressed because it is too large

6
src/locale/zh.js

@ -59,6 +59,7 @@ export default {
moreOptions:"更多选项",
cellFormat:"设置单元格格式",
print:"打印",
},
alternatingColors:{
applyRange: '应用范围',
@ -1175,6 +1176,11 @@ export default {
normalBtn:"常规视图",
layoutBtn:"页面布局",
pageBtn:"分页预览",
menuItemPrint:"打印(Ctrl+P)",
menuItemAreas:"打印区域",
menuItemRows:"打印标题行",
menuItemColumns:"打印标题列",
}
};

Loading…
Cancel
Save