|
@@ -78,27 +78,31 @@ let contentOprObj = {
|
|
|
sheet.addRows(sheet.getRowCount(), 1);
|
|
|
sheet.getCell(sheet.getRowCount() - 1, 1).cellType(checkBox);
|
|
|
},
|
|
|
- upMove: function (rowIdx) {
|
|
|
+ upMove: function (cell) {
|
|
|
let me = contentOprObj;
|
|
|
- let thisObj = me.currentCache[rowIdx],
|
|
|
- preObj = me.currentCache[rowIdx - 1],
|
|
|
+ let thisObj = me.currentCache[cell.row],
|
|
|
+ preObj = me.currentCache[cell.row - 1],
|
|
|
temp, contentTxt;
|
|
|
temp = thisObj.serialNo;
|
|
|
thisObj.serialNo = preObj.serialNo;
|
|
|
preObj.serialNo = temp;
|
|
|
me.sortCache(me.currentCache);
|
|
|
- me.save();
|
|
|
+ me.save(function () {
|
|
|
+ me.workBook.getSheet(0).setActiveCell(cell.row - 1, cell.col);
|
|
|
+ });
|
|
|
},
|
|
|
- downMove: function (rowIdx) {
|
|
|
+ downMove: function (cell) {
|
|
|
let me = contentOprObj;
|
|
|
- let thisObj = me.currentCache[rowIdx],
|
|
|
- nextObj = me.currentCache[rowIdx + 1],
|
|
|
+ let thisObj = me.currentCache[cell.row],
|
|
|
+ nextObj = me.currentCache[cell.row + 1],
|
|
|
temp, contentTxt;
|
|
|
temp = thisObj.serialNo;
|
|
|
thisObj.serialNo = nextObj.serialNo;
|
|
|
nextObj.serialNo = temp;
|
|
|
me.sortCache(me.currentCache);
|
|
|
- me.save();
|
|
|
+ me.save(function () {
|
|
|
+ me.workBook.getSheet(0).setActiveCell(cell.row + 1, cell.col);
|
|
|
+ });
|
|
|
},
|
|
|
deleteContent: function (rowIdx) {
|
|
|
let me = contentOprObj;
|
|
@@ -117,11 +121,11 @@ let contentOprObj = {
|
|
|
me.currentCache.push(newObj);
|
|
|
|
|
|
},
|
|
|
- save: function () {
|
|
|
+ save: function (callback) {
|
|
|
let me = contentOprObj;
|
|
|
let contentTxt = me.getColData(me.currentCache);
|
|
|
let txtObj = {field: 'jobContentText', text: contentTxt ? contentTxt : ''};
|
|
|
- pageCCOprObj.updateCharacterContent(pageCCOprObj.currentFindSet, {field: 'jobContent', updateArr: me.currentCache}, txtObj, contentOprObj);
|
|
|
+ pageCCOprObj.updateCharacterContent(pageCCOprObj.currentFindSet, {field: 'jobContent', updateArr: me.currentCache}, txtObj, contentOprObj, callback);
|
|
|
},
|
|
|
onEditEnded: function (sender, args) {
|
|
|
let me = contentOprObj;
|
|
@@ -245,11 +249,11 @@ let contentOprObj = {
|
|
|
me.deleteContent(target.row);
|
|
|
}},
|
|
|
"upMove": {name: "上移", disabled: upDis, icon: "fa-arrow-up", callback: function (key, opt) {
|
|
|
- me.upMove(target.row);
|
|
|
+ me.upMove({row: target.row, col: target.col});
|
|
|
|
|
|
}},
|
|
|
"downMove": {name: "下移", disabled: downDis, icon: "fa-arrow-down", callback: function (key, opt) {
|
|
|
- me.downMove(target.row);
|
|
|
+ me.downMove({row: target.row, col: target.col});
|
|
|
}}
|
|
|
}
|
|
|
};
|
|
@@ -388,27 +392,31 @@ let characterOprObj = {
|
|
|
sheet.getCell(rowIdx, 1).cellType(combo);
|
|
|
sheet.getCell(rowIdx, 2).cellType(checkBox);
|
|
|
},
|
|
|
- upMove: function (rowIdx) {
|
|
|
+ upMove: function (cell) {
|
|
|
let me = characterOprObj;
|
|
|
- let thisObj = me.currentCache[rowIdx],
|
|
|
- preObj = me.currentCache[rowIdx - 1],
|
|
|
+ let thisObj = me.currentCache[cell.row],
|
|
|
+ preObj = me.currentCache[cell.row - 1],
|
|
|
temp;
|
|
|
temp = thisObj.serialNo;
|
|
|
thisObj.serialNo = preObj.serialNo;
|
|
|
preObj.serialNo = temp;
|
|
|
contentOprObj.sortCache(me.currentCache);
|
|
|
- me.save();
|
|
|
+ me.save(function () {
|
|
|
+ me.workBook.getSheet(0).setActiveCell(cell.row - 1, cell.col);
|
|
|
+ });
|
|
|
},
|
|
|
- downMove: function (rowIdx) {
|
|
|
+ downMove: function (cell) {
|
|
|
let me = characterOprObj;
|
|
|
- let thisObj = me.currentCache[rowIdx],
|
|
|
- nextObj = me.currentCache[rowIdx + 1],
|
|
|
+ let thisObj = me.currentCache[cell.row],
|
|
|
+ nextObj = me.currentCache[cell.row + 1],
|
|
|
temp;
|
|
|
temp = thisObj.serialNo;
|
|
|
thisObj.serialNo = nextObj.serialNo;
|
|
|
nextObj.serialNo = temp;
|
|
|
contentOprObj.sortCache(me.currentCache);
|
|
|
- me.save();
|
|
|
+ me.save(function () {
|
|
|
+ me.workBook.getSheet(0).setActiveCell(cell.row + 1, cell.col);
|
|
|
+ });
|
|
|
},
|
|
|
deleteCharacter: function (rowIdx) {
|
|
|
let me = characterOprObj;
|
|
@@ -488,11 +496,11 @@ let characterOprObj = {
|
|
|
me.currentCache.push(newCharacter);
|
|
|
}
|
|
|
},
|
|
|
- save: function () {
|
|
|
+ save: function (callback) {
|
|
|
let me = characterOprObj;
|
|
|
let characterTxt = me.getColData(me.currentCache);
|
|
|
let txtObj = {field: 'itemCharacterText', text: characterTxt ? characterTxt : ''};
|
|
|
- pageCCOprObj.updateCharacterContent(pageCCOprObj.currentFindSet, {field: 'itemCharacter', updateArr: me.currentCache}, txtObj, characterOprObj);
|
|
|
+ pageCCOprObj.updateCharacterContent(pageCCOprObj.currentFindSet, {field: 'itemCharacter', updateArr: me.currentCache}, txtObj, characterOprObj, callback);
|
|
|
},
|
|
|
onEditStart: function (sender, args) {
|
|
|
let me = characterOprObj;
|
|
@@ -621,10 +629,10 @@ let characterOprObj = {
|
|
|
me.deleteCharacter(target.row);
|
|
|
}},
|
|
|
"upMove": {name: "上移", disabled: upDis, icon: "fa-arrow-up", callback: function (key, opt) {
|
|
|
- me.upMove(target.row);
|
|
|
+ me.upMove({row: target.row, col: target.col});
|
|
|
}},
|
|
|
"downMove": {name: "下移", disabled: downDis, icon: "fa-arrow-down", callback: function (key, opt) {
|
|
|
- me.downMove(target.row);
|
|
|
+ me.downMove({row: target.row, col: target.col});
|
|
|
}}
|
|
|
}
|
|
|
};
|
|
@@ -725,7 +733,7 @@ let pageCCOprObj = {
|
|
|
projectObj.mainSpread.focus(true);
|
|
|
},
|
|
|
//更新特征及内容数据
|
|
|
- updateCharacterContent: function (findSet, updateObj, txtObj, oprObj) {
|
|
|
+ updateCharacterContent: function (findSet, updateObj, txtObj, oprObj, callback) {
|
|
|
let me = pageCCOprObj, updateCol;
|
|
|
if(txtObj){
|
|
|
updateCol = txtObj.field === 'itemCharacterText' ? 4 : 5;//更新清单行特征列或内容列
|
|
@@ -751,6 +759,9 @@ let pageCCOprObj = {
|
|
|
let activeCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];
|
|
|
projectObj.mainSpread.getActiveSheet().setValue(activeCell.row, updateCol, txtObj.text + ''); //刷新输出显示
|
|
|
projectObj.mainSpread.getActiveSheet().autoFitRow(activeCell.row);
|
|
|
+ if(callback){
|
|
|
+ callback();
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
},
|