|
@@ -223,6 +223,7 @@ $(document).ready(function() {
|
|
|
*/
|
|
|
addNode: function (sheet) {
|
|
|
const self = this;
|
|
|
+ const sel = sheet.getSelections()[0];
|
|
|
const row = sheet.getSelections()[0].row;
|
|
|
|
|
|
const tree = sheet.zh_tree;
|
|
@@ -239,6 +240,7 @@ $(document).ready(function() {
|
|
|
}, function (result) {
|
|
|
const refreshNode = tree.loadPostData(result);
|
|
|
self.refreshTree(sheet, refreshNode);
|
|
|
+ sheet.setSelection(refreshNode.create[0].index, sel.col, sel.rowCount, sel.colCount);
|
|
|
self.refreshOperationValid(sheet);
|
|
|
});
|
|
|
},
|
|
@@ -664,7 +666,8 @@ $(document).ready(function() {
|
|
|
pasteBlock: function (spread, copyInfo) {
|
|
|
const self = this;
|
|
|
const sheet = spread.getActiveSheet();
|
|
|
- const row = sheet.getSelections()[0].row;
|
|
|
+ const sel = sheet.getSelections()[0];
|
|
|
+ const row = sel.row;
|
|
|
|
|
|
const tree = sheet.zh_tree;
|
|
|
if (!tree) { return; }
|
|
@@ -683,6 +686,7 @@ $(document).ready(function() {
|
|
|
pos.updateDatas(data.pos);
|
|
|
const result = tree.loadPostData(data.ledger);
|
|
|
self.refreshTree(sheet, result);
|
|
|
+ sheet.setSelection(result.create[0].index, sel.col, sel.rowCount, sel.colCount);
|
|
|
self.refreshOperationValid(sheet);
|
|
|
removeLocalCache(copyBlockTag);
|
|
|
}, null, true);
|
|
@@ -1610,6 +1614,7 @@ $(document).ready(function() {
|
|
|
}, function (result) {
|
|
|
const refreshNode = mainTree.loadPostData(result);
|
|
|
treeOperationObj.refreshTree(mainSheet, refreshNode);
|
|
|
+ sheet.setSelection(refreshNode.create[0].index, sel.col, sel.rowCount, sel.colCount);
|
|
|
treeOperationObj.refreshOperationValid(mainSheet);
|
|
|
});
|
|
|
});
|
|
@@ -1673,6 +1678,8 @@ $(document).ready(function() {
|
|
|
}, function (result) {
|
|
|
const refreshData = mainTree.loadPostData(result);
|
|
|
treeOperationObj.refreshTree(mainSheet, refreshData);
|
|
|
+ const sel = mainSheet.getSelections()[0];
|
|
|
+ sheet.setSelection(refreshData.create[0].index, sel.col, sel.rowCount, sel.colCount);
|
|
|
treeOperationObj.refreshOperationValid(mainSheet);
|
|
|
});
|
|
|
});
|
|
@@ -1842,8 +1849,8 @@ $(document).ready(function() {
|
|
|
|
|
|
$('#batch-ok').click(function () {
|
|
|
const sheet = ledgerSpread.getActiveSheet();
|
|
|
- const selection = sheet.getSelections();
|
|
|
- const row = selection[0].row;
|
|
|
+ const sel = sheet.getSelections()[0];
|
|
|
+ const row = sel.row;
|
|
|
const select = ledgerTree.nodes[row];
|
|
|
if (select) {
|
|
|
const insertData = {};
|
|
@@ -1854,6 +1861,7 @@ $(document).ready(function() {
|
|
|
pos.updateDatas(data.pos);
|
|
|
const result = ledgerTree.loadPostData(data.ledger);
|
|
|
treeOperationObj.refreshTree(sheet, result);
|
|
|
+ sheet.setSelection(result.create[0].index, sel.col, sel.rowCount, sel.colCount);
|
|
|
treeOperationObj.refreshOperationValid(sheet, selection);
|
|
|
self.obj.modal('hide');
|
|
|
}, null, true);
|