|
@@ -131,13 +131,13 @@ let calcBaseView = {
|
|
|
isDef: function (v) {
|
|
|
return v !== undefined && v !== null;
|
|
|
},
|
|
|
- ifEdit: function (type) {
|
|
|
+ //processMouseDown触发时间比SelectionChanged早,所以直接取selected是上一个节点的,需要传row取当前选中节点
|
|
|
+ ifEdit: function (type, row) {
|
|
|
if (type == 'ration'){
|
|
|
return true;
|
|
|
}
|
|
|
else{
|
|
|
-
|
|
|
- var selected = projectObj.project.mainTree.selected;
|
|
|
+ let selected = projectObj.project.mainTree.items[row];
|
|
|
return selected && MainTreeCol.readOnly.forCalcBase(selected)?false:true;
|
|
|
}
|
|
|
},
|
|
@@ -345,7 +345,7 @@ let calcBaseView = {
|
|
|
// ctx.fillText(value,x+w-3,y+h-3);
|
|
|
GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
|
|
|
// }
|
|
|
- if(calcBaseView.editingCell && !projectReadOnly && calcBaseView.ifEdit(type)){
|
|
|
+ if(calcBaseView.editingCell && !projectReadOnly && calcBaseView.ifEdit(type, options.row)){
|
|
|
if(calcBaseView.editingCell.row==options.row&&calcBaseView.editingCell.col==options.col){
|
|
|
var image = document.getElementById('f_btn'),imageMagin = 3;
|
|
|
var imageHeight = h-2*imageMagin;
|
|
@@ -381,7 +381,7 @@ let calcBaseView = {
|
|
|
if(me.editingCell==null){
|
|
|
var showSelectBtn = true;
|
|
|
if(hitinfo.sheet.name()!='calc_detail'){
|
|
|
- showSelectBtn=me.ifEdit(type);
|
|
|
+ showSelectBtn=me.ifEdit(type, hitinfo.row);
|
|
|
}
|
|
|
if(showSelectBtn){
|
|
|
me.editingCell={
|
|
@@ -397,7 +397,7 @@ let calcBaseView = {
|
|
|
var imageHeight = hitinfo.cellRect.height-2*imageMagin;
|
|
|
var imageWidth = hitinfo.cellRect.width*2/7;
|
|
|
if(hitinfo.x<offset&&hitinfo.x>offset-imageWidth){
|
|
|
- if(!projectReadOnly && me.ifEdit(type)){
|
|
|
+ if(!projectReadOnly && me.ifEdit(type, hitinfo.row)){
|
|
|
calcBaseView.initCalctor(type);
|
|
|
}
|
|
|
}
|