From 8f8d0cb8c5563a31afba3fe11b525e6bccd5eb56 Mon Sep 17 00:00:00 2001
From: wpxp123456 <2677556700@qq.com>
Date: Mon, 26 Oct 2020 17:00:54 +0800
Subject: [PATCH 1/3] feat(date format): date format Chinese
---
src/controllers/constant.js | 12 ++
src/controllers/moreFormat.js | 8 +-
src/controllers/rowColumnOperation.js | 200 +++++++++++++++++++++++---
src/locale/zh.js | 8 +-
4 files changed, 198 insertions(+), 30 deletions(-)
diff --git a/src/controllers/constant.js b/src/controllers/constant.js
index 528b247a5..4c17884c8 100644
--- a/src/controllers/constant.js
+++ b/src/controllers/constant.js
@@ -320,6 +320,18 @@ function rightclickHTML(){
${rightclick.column}
+
+
简体中文 | [English](./README.md)
@@ -9,6 +10,8 @@
## 介绍
🚀Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。
+> Luckysheet最近参加了“2020年度OSC中国开源项目评选”,为了支持Luckysheet更好的得到关注和发展,请大家帮忙投票: [https://www.oschina.net/p/luckysheet](https://www.oschina.net/p/luckysheet)。
+
## 相关链接
| 源码 | 文档 | Demo | 插件Demo | 论坛 |
| ------ | -------- | ------ | ------ | ------ |
From 4815d86ce564da43aa1ced3b48d38e88afc39f77 Mon Sep 17 00:00:00 2001
From: wpxp123456 <2677556700@qq.com>
Date: Tue, 27 Oct 2020 16:40:07 +0800
Subject: [PATCH 3/3] fix(bug): dataVerification and sheet move and delete cell
bug
---
src/controllers/dataVerificationCtrl.js | 29 +++++++++++++-----
src/controllers/sheetmanage.js | 18 +++++++++++
src/global/api.js | 3 ++
src/global/extend.js | 40 +++++++++++++++++--------
4 files changed, 71 insertions(+), 19 deletions(-)
diff --git a/src/controllers/dataVerificationCtrl.js b/src/controllers/dataVerificationCtrl.js
index 686cfc712..de64c1888 100644
--- a/src/controllers/dataVerificationCtrl.js
+++ b/src/controllers/dataVerificationCtrl.js
@@ -573,6 +573,28 @@ const dataVerificationCtrl = {
return;
}
+ let str = range[range.length - 1].row[0],
+ edr = range[range.length - 1].row[1],
+ stc = range[range.length - 1].column[0],
+ edc = range[range.length - 1].column[1];
+ let d = editor.deepCopyFlowData(Store.flowdata);
+
+ if(str < 0){
+ str = 0;
+ }
+
+ if(edr > d.length - 1){
+ edr = d.length - 1;
+ }
+
+ if(stc < 0){
+ stc = 0;
+ }
+
+ if(edc > d[0].length - 1){
+ edc = d[0].length - 1;
+ }
+
let type = $("#luckysheet-dataVerification-dialog #data-verification-type-select").val();
let type2 = null, value1 = "", value2 = "";
@@ -699,13 +721,6 @@ const dataVerificationCtrl = {
let historyDataVerification = $.extend(true, {}, _this.dataVerification);
let currentDataVerification = $.extend(true, {}, _this.dataVerification);
- let str = range[range.length - 1].row[0],
- edr = range[range.length - 1].row[1],
- stc = range[range.length - 1].column[0],
- edc = range[range.length - 1].column[1];
-
- let d = editor.deepCopyFlowData(Store.flowdata);
-
for(let r = str; r <= edr; r++){
for(let c = stc; c <= edc; c++){
currentDataVerification[r + '_' + c] = item;
diff --git a/src/controllers/sheetmanage.js b/src/controllers/sheetmanage.js
index bf008a642..deaaf2f5b 100644
--- a/src/controllers/sheetmanage.js
+++ b/src/controllers/sheetmanage.js
@@ -314,6 +314,24 @@ const sheetmanage = {
});
server.saveParam("shr", null, orders);
+
+ Store.luckysheetfile.sort((x, y) => {
+ let order_x = x.order;
+ let order_y = y.order;
+
+ if(order_x != null && order_y != null){
+ return order_x - order_y;
+ }
+ else if(order_x != null){
+ return -1;
+ }
+ else if(order_y != null){
+ return 1;
+ }
+ else{
+ return 1;
+ }
+ })
},
createSheet: function() { //修复拖动sheet更新后台后,重新打开显示错误
let _this = this;
diff --git a/src/global/api.js b/src/global/api.js
index 453bee483..8366f27f6 100644
--- a/src/global/api.js
+++ b/src/global/api.js
@@ -4709,6 +4709,9 @@ export function setSheetActive(order, options = {}) {
success
} = {...options}
+ $("#luckysheet-sheet-area div.luckysheet-sheets-item").removeClass("luckysheet-sheets-item-active");
+ $("#luckysheet-sheets-item" + file.index).addClass("luckysheet-sheets-item-active");
+
sheetmanage.changeSheet(file.index);
setTimeout(() => {
diff --git a/src/global/extend.js b/src/global/extend.js
index 23b2eca3e..305e8a37e 100644
--- a/src/global/extend.js
+++ b/src/global/extend.js
@@ -482,9 +482,17 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) {
else if(index == r){
if(direction == "lefttop"){
newDataVerification[(r + value) + "_" + c] = item;
+
+ for(let i = 0; i < value; i++){
+ newDataVerification[(r + i) + "_" + c] = item;
+ }
}
else{
newDataVerification[r + "_" + c] = item;
+
+ for(let i = 0; i < value; i++){
+ newDataVerification[(r + i + 1) + "_" + c] = item;
+ }
}
}
else{
@@ -498,9 +506,17 @@ function luckysheetextendtable(type, index, value, direction, sheetIndex) {
else if(index == c){
if(direction == "lefttop"){
newDataVerification[r + "_" + (c + value)] = item;
+
+ for(let i = 0; i < value; i++){
+ newDataVerification[r + "_" + (c + i)] = item;
+ }
}
else{
newDataVerification[r + "_" + c] = item;
+
+ for(let i = 0; i < value; i++){
+ newDataVerification[r + "_" + (c + i + 1)] = item;
+ }
}
}
else{
@@ -2112,20 +2128,20 @@ function luckysheetDeleteCell(type, str, edr, stc, edc, sheetIndex) {
let row_index = cfg["borderInfo"][i].value.row_index;
let col_index = cfg["borderInfo"][i].value.col_index;
- if(row_index < str || col_index < stc){
- borderInfo.push(cfg["borderInfo"][i]);
- }
- else if(row_index > edr || col_index > edc){
- if(row_index > edr){
- row_index -= rlen;
- cfg["borderInfo"][i].value.row_index = row_index;
+ if(row_index < str || row_index > edr || col_index < stc || col_index > edc){
+ if(type == 'moveLeft'){
+ if(col_index > edc && row_index >= str && row_index <= edr){
+ col_index -= clen;
+ cfg["borderInfo"][i].value.col_index = col_index;
+ }
}
-
- if(col_index > edc){
- col_index -= clen;
- cfg["borderInfo"][i].value.col_index = col_index;
+ else if(type == 'moveUp'){
+ if(row_index > edr && col_index >= stc && col_index <= edc){
+ row_index -= rlen;
+ cfg["borderInfo"][i].value.row_index = row_index;
+ }
}
-
+
borderInfo.push(cfg["borderInfo"][i]);
}
}