|
@@ -71,6 +71,7 @@ layui.define(function(exports) {
|
|
|
if (sheetConfig && sheetConfig.data) {
|
|
|
option.data = sheetConfig.data
|
|
|
}
|
|
|
+
|
|
|
option.hook = {
|
|
|
cellEditBefore: function(range) {
|
|
|
const cell = luckysheet.getCellValue((range[0].row)[0], (range[0].column)[0], {type: 'v'})
|
|
@@ -106,38 +107,38 @@ layui.define(function(exports) {
|
|
|
return true
|
|
|
},
|
|
|
rangeCopyAfter:function(range,data){
|
|
|
- // copyRange = range;
|
|
|
- // let scol = copyRange[0].column[0];
|
|
|
- // let ecol = copyRange[0].column[1];
|
|
|
- // let srow = copyRange[0].row[0];
|
|
|
- // let erow = copyRange[0].row[1];
|
|
|
- // console.log(scol);
|
|
|
- // console.log(srow);
|
|
|
- // console.log(luckysheet.getCellValue(3, 6));
|
|
|
- // for(let i=srow;i<=erow;i++){
|
|
|
- // for(let j=scol;j<=ecol;j++){
|
|
|
- // const cell = luckysheet.getCellValue(i, j);
|
|
|
- // console.log(cell)
|
|
|
- // }
|
|
|
- // }
|
|
|
+ copyRange = range;
|
|
|
+ let scol = copyRange[0].column[0];
|
|
|
+ let ecol = copyRange[0].column[1];
|
|
|
+ let srow = copyRange[0].row[0];
|
|
|
+ let erow = copyRange[0].row[1];
|
|
|
+ console.log(scol);
|
|
|
+ console.log(srow);
|
|
|
+ console.log(luckysheet.getCellValue(3, 6));
|
|
|
+ for(let i=srow;i<=erow;i++){
|
|
|
+ for(let j=scol;j<=ecol;j++){
|
|
|
+ const cell = luckysheet.getCellValue(i, j);
|
|
|
+ console.log(cell)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
rangePasteBefore:function(range,data){
|
|
|
- // console.log('rangePasteBefore')
|
|
|
- // console.log(range);
|
|
|
- // console.log(data);
|
|
|
- // let scol = range[0].column[0];
|
|
|
- // let ecol = range[0].column[1];
|
|
|
- // let srow = range[0].row[0];
|
|
|
- // let erow = range[0].row[1];
|
|
|
- // console.log(scol);
|
|
|
- // console.log(srow);
|
|
|
- // console.log(luckysheet.getCellValue(3, 6));
|
|
|
- // for(let i=srow;i<=erow;i++){
|
|
|
- // for(let j=scol;j<=ecol;j++){
|
|
|
- // const cell = luckysheet.getCellValue(i, j);
|
|
|
- // console.log(cell)
|
|
|
- // }
|
|
|
- // }
|
|
|
+ console.log('rangePasteBefore')
|
|
|
+ console.log(range);
|
|
|
+ console.log(data);
|
|
|
+ let scol = range[0].column[0];
|
|
|
+ let ecol = range[0].column[1];
|
|
|
+ let srow = range[0].row[0];
|
|
|
+ let erow = range[0].row[1];
|
|
|
+ console.log(scol);
|
|
|
+ console.log(srow);
|
|
|
+ console.log(luckysheet.getCellValue(3, 6));
|
|
|
+ for(let i=srow;i<=erow;i++){
|
|
|
+ for(let j=scol;j<=ecol;j++){
|
|
|
+ const cell = luckysheet.getCellValue(i, j);
|
|
|
+ console.log(cell)
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
cellMousedown:function(cell,position,sheet,ctx){
|
|
|
//console.log('r='+position.r+','+'c='+position.c);
|
|
@@ -145,8 +146,8 @@ layui.define(function(exports) {
|
|
|
//console.log(cell);
|
|
|
},
|
|
|
rangePasteAfter:function(range,data){
|
|
|
- //console.log('rangePasteAfter')
|
|
|
- //console.log(data);
|
|
|
+ console.log('rangePasteAfter')
|
|
|
+ console.log(data);
|
|
|
},
|
|
|
sheetMousemove: function(cell, position, sheet, moveState) {
|
|
|
if (moveState.cellSelectedMove && !moveJson.move) {
|