|
@@ -452,11 +452,13 @@ $(document).ready(() => {
|
|
|
const sortData = info.sheet.zh_data || [];
|
|
|
const range = info.cellRange;
|
|
|
const data = [];
|
|
|
+ let haveNew = false;
|
|
|
for (let iRow = 0; iRow < range.rowCount; iRow++) {
|
|
|
let bPaste = true;
|
|
|
const curRow = range.row + iRow;
|
|
|
// const materialData = JSON.parse(JSON.stringify(sortData[curRow]));
|
|
|
const cLData = curRow >= sortData.length ? {unit: ''} : {id: sortData[curRow].id};
|
|
|
+ haveNew = curRow >= sortData.length ? curRow : false;
|
|
|
const hintRow = range.rowCount > 1 ? curRow : '';
|
|
|
let sameCol = 0;
|
|
|
for (let iCol = 0; iCol < range.colCount; iCol++) {
|
|
@@ -524,8 +526,16 @@ $(document).ready(() => {
|
|
|
// 更新至服务器
|
|
|
postData(preUrl + '/list/save', { type:'paste', updateData: data }, function (result) {
|
|
|
changeList = result;
|
|
|
+ if (haveNew) {
|
|
|
+ SpreadJsObj.initSheet(changeSpreadSheet, changeSpreadSetting);
|
|
|
+ }
|
|
|
SpreadJsObj.loadSheetData(changeSpreadSheet, SpreadJsObj.DataType.Data, changeList);
|
|
|
changeSpreadObj.makeSjsFooter();
|
|
|
+ if (haveNew) {
|
|
|
+ changeSpreadSheet.setSelection(haveNew, 1, 1, 1);
|
|
|
+ changeSpreadSheet.getParent().focus();
|
|
|
+ changeSpreadSheet.showRow(haveNew, spreadNS.VerticalPosition.center);
|
|
|
+ }
|
|
|
}, function () {
|
|
|
SpreadJsObj.reLoadRowData(info.sheet, info.cellRange.row, info.cellRange.rowCount);
|
|
|
return;
|