|
@@ -47,16 +47,14 @@ const NewMergePeg = function (setting) {
|
|
|
peg = endPeg !== '' ? endPeg : '';
|
|
|
}
|
|
|
if (withPos) {
|
|
|
- peg = _.trim(sheet.getText(row, posCol)) + peg;
|
|
|
+ peg += _.trim(sheet.getText(row, posCol));
|
|
|
}
|
|
|
sheet.setText(row, pegCol, peg);
|
|
|
};
|
|
|
if (row) {
|
|
|
const rows = row instanceof Array ? row : [row];
|
|
|
- if (row instanceof Array) {
|
|
|
- for (const r of rows) {
|
|
|
- mergeRow(r)
|
|
|
- }
|
|
|
+ for (const r of rows) {
|
|
|
+ mergeRow(r)
|
|
|
}
|
|
|
} else {
|
|
|
for (let iRow = 0, iLen = sheet.getRowCount(); iRow < iLen; iRow++) {
|
|
@@ -84,6 +82,22 @@ const NewMergePeg = function (setting) {
|
|
|
}
|
|
|
},
|
|
|
clipboardPasted: function (e, info) {
|
|
|
+ for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
|
|
|
+ const curRow = info.cellRange.row + iRow;
|
|
|
+ for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
|
|
|
+ const curCol = info.cellRange.col+ iCol;
|
|
|
+ const text = info.sheet.getText(curRow, curCol);
|
|
|
+ if (curCol === spCol || curCol === epCol) {
|
|
|
+ if (text.length > 10) {
|
|
|
+ info.sheet.setText(curRow, curCol, text.substring(0, 10));
|
|
|
+ }
|
|
|
+ } else if (curCol === posCol) {
|
|
|
+ if (text.length > 50) {
|
|
|
+ info.sheet.setText(curRow, curCol, text.substring(0, 50));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
spreadObj.mergePeg();
|
|
|
},
|
|
|
deletePress: function (sheet) {
|
|
@@ -101,6 +115,15 @@ const NewMergePeg = function (setting) {
|
|
|
spreadObj.mergePeg(row);
|
|
|
},
|
|
|
editEnded: function (e, info) {
|
|
|
+ if (info.col === spCol || info.col === epCol) {
|
|
|
+ if (info.editingText.length > 10) {
|
|
|
+ info.sheet.setText(info.row, info.col, info.editingText.substring(0, 10));
|
|
|
+ }
|
|
|
+ } else if (info.col === posCol) {
|
|
|
+ if (info.editingText.length > 50) {
|
|
|
+ info.sheet.setText(info.row, info.col, info.editingText.substring(0, 50));
|
|
|
+ }
|
|
|
+ }
|
|
|
spreadObj.mergePeg(info.row);
|
|
|
},
|
|
|
cut: function (sheet, sel, callback) {
|