|
@@ -123,7 +123,7 @@ var gljOprObj = {
|
|
|
//这主要记录是否点击了sheet以外的地方,如果点击了sheet里的单元格,则将cancelUpdate设置为true不触发提交更新操作
|
|
|
me.cancelUpdate = true;//取消延时任务由这里进行判断处理
|
|
|
console.log("change to true");
|
|
|
- me.sheetInitSelection(selected,me.setting.style);
|
|
|
+ me.sheetInitSelection(selected);
|
|
|
if(me.rationGljEditObj){
|
|
|
if(ifNeedUpdate(selected)){
|
|
|
me.updateGljFromCache();
|
|
@@ -138,7 +138,6 @@ var gljOprObj = {
|
|
|
return true;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
updateGljFromCache:function () {
|
|
|
let me = this;
|
|
|
if(me.rationGljEditObj){
|
|
@@ -146,7 +145,6 @@ var gljOprObj = {
|
|
|
}
|
|
|
me.rationGljEditObj = null;
|
|
|
},
|
|
|
-
|
|
|
bindGLJEnterKey:function (spread,sheet) {
|
|
|
let me = this;
|
|
|
subSpread.commandManager().register('myEnter', enterKeyAction);
|
|
@@ -165,13 +163,16 @@ var gljOprObj = {
|
|
|
|
|
|
}
|
|
|
},
|
|
|
- sheetInitSelection: function (selected,style) {
|
|
|
+ sheetInitSelection: function (selected) {
|
|
|
let me = gljOprObj;
|
|
|
+ let style = {};
|
|
|
if(selected.row < me.sheetData.length){
|
|
|
+ if(me.setting.getStyle) style = me.setting.getStyle(me.sheetData[selected.row]);
|
|
|
me.sheet.setStyle(selected.row, -1, me.getSelStyle(true,style));
|
|
|
}
|
|
|
me.sheet.repaint();
|
|
|
if(me.preGljSelection && me.preGljSelection.row !== selected.row){
|
|
|
+ if(me.setting.getStyle && me.preGljSelection.row < me.sheetData.length) style = me.setting.getStyle(me.sheetData[me.preGljSelection.row]);
|
|
|
me.sheet.setStyle(me.preGljSelection.row, -1, me.getSelStyle(false,style));
|
|
|
}
|
|
|
me.preGljSelection = selected;
|
|
@@ -215,14 +216,12 @@ var gljOprObj = {
|
|
|
sheet.bind(GC.Spread.Sheets.Events.EditStarting, me.startEditChecking);
|
|
|
// sheet.bind(GC.Spread.Sheets.Events.CellClick, me.onCellClick);
|
|
|
},
|
|
|
-
|
|
|
onClipboardPasting: function (sender, args) {
|
|
|
var me = gljOprObj;
|
|
|
if(args.sheetName!="quantity_detail"&&(args.cellRange.rowCount!=1||args.cellRange.colCount!=1)){//工程量明细做特殊处理
|
|
|
args.cancel = true;
|
|
|
}
|
|
|
},
|
|
|
-
|
|
|
onClipboardPasted: function (e, info) {
|
|
|
var me = gljOprObj;
|
|
|
console.log('past');
|
|
@@ -426,8 +425,7 @@ var gljOprObj = {
|
|
|
}else {
|
|
|
return false
|
|
|
}
|
|
|
- }
|
|
|
- ,
|
|
|
+ },
|
|
|
hasComposition:function (ration_glj,isRationType) {//判断是否有组成物,有则返回true 现在主材类型的工料机也有可能有组成物。
|
|
|
let type = isRationType==true? ration_glj.subType:ration_glj.type;
|
|
|
if(notEditType.indexOf(type)!=-1||type==gljType.MAIN_MATERIAL){
|
|
@@ -493,8 +491,6 @@ var gljOprObj = {
|
|
|
},
|
|
|
showDataIfRationSelect: function (node,selectedNodeId) {
|
|
|
var isShow = false;
|
|
|
- //恢复底色
|
|
|
- this.sheet.setStyle(this.sheet.getActiveRowIndex(), -1, this.getSelStyle(false,this.setting.style));
|
|
|
if(projectReadOnly && this.setting.view.lockColumns){
|
|
|
this.setting.view.lockColumns = null;
|
|
|
}
|
|
@@ -505,6 +501,8 @@ var gljOprObj = {
|
|
|
if (this.selectedNodeId && this.selectedNodeId == node.getID()) {
|
|
|
return;
|
|
|
} else {
|
|
|
+ //恢复底色
|
|
|
+ this.sheet.setStyle(this.sheet.getActiveRowIndex(), -1, this.getSelStyle(false,this.setting.style));
|
|
|
this.selectedNodeId = node.getID();
|
|
|
}
|
|
|
if (node.sourceType == "ration") {
|
|
@@ -565,7 +563,7 @@ var gljOprObj = {
|
|
|
sheetCommonObj.showData(this.sheet, this.setting, this.sheetData);
|
|
|
//初始选择
|
|
|
this.preGljSelection = null;
|
|
|
- this.sheetInitSelection({row: this.sheet.getActiveRowIndex(), col: 0},this.setting.style);
|
|
|
+ this.sheetInitSelection({row: this.sheet.getActiveRowIndex(), col: 0});
|
|
|
this.sheet.getRange(-1, 0, -1, this.setting.header.length).locked(true);//锁住定额工料机的所有列
|
|
|
this.detailSheet.getRange(-1, 0, -1, this.detailSetting.header.length).locked(true);//锁住工程量明细的所有列
|
|
|
},
|
|
@@ -602,7 +600,7 @@ var gljOprObj = {
|
|
|
}
|
|
|
//初始选择
|
|
|
this.preGljSelection = null;
|
|
|
- this.sheetInitSelection({row: this.sheet.getActiveRowIndex(), col: this.sheet.getActiveColumnIndex()},this.setting.style);
|
|
|
+ this.sheetInitSelection({row: this.sheet.getActiveRowIndex(), col: this.sheet.getActiveColumnIndex()});
|
|
|
|
|
|
},
|
|
|
getUnitPriceCodeMap : function () {//取单价文件中,编码前缀一样的映射表
|
|
@@ -626,7 +624,6 @@ var gljOprObj = {
|
|
|
}
|
|
|
return codeMap;
|
|
|
},
|
|
|
-
|
|
|
initRationTree: function (init,codeMap) {
|
|
|
this.sheet.suspendPaint();
|
|
|
this.sheet.suspendEvent();
|