|
@@ -307,7 +307,9 @@ var TREE_SHEET_HELPER = {
|
|
|
let halfBoxLength = 5;
|
|
|
let halfExpandLength = 3;
|
|
|
let isRationNode = sheet.name()=="mainSheet" && initNode.sourceType == ModuleNames.ration;
|
|
|
-
|
|
|
+ let questionImg = document.getElementById('question_pic'),
|
|
|
+ questionImgWidth = 16,
|
|
|
+ questionImgHeight = 16;
|
|
|
|
|
|
let TreeNodeCellType = function () {
|
|
|
this.clickDropDown = false; //如果是点击下拉框的三角形的时候,默认展开下拉框
|
|
@@ -422,6 +424,12 @@ var TREE_SHEET_HELPER = {
|
|
|
if (isRationNode&& options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
|
|
|
sheetCommonObj.drowTriangle(ctx,x+w-12,y+h/2+2);
|
|
|
}
|
|
|
+ //定额库章节树问号
|
|
|
+ if(sheet.name() === 'stdRationLib_chapter' && this.enterCell && options.row === this.enterCell.row ){
|
|
|
+ let centerX = Math.floor(x) + w - 20;
|
|
|
+ let centerY = Math.floor((y + (y + h)) / 2);
|
|
|
+ ctx.drawImage(questionImg, centerX + 3, centerY - 7, questionImgWidth,questionImgHeight);
|
|
|
+ }
|
|
|
|
|
|
};
|
|
|
TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
|
|
@@ -436,6 +444,12 @@ var TREE_SHEET_HELPER = {
|
|
|
};
|
|
|
};
|
|
|
TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
|
|
|
+ //点击问号符,弹出说明、工程量计算规则窗口
|
|
|
+ if(hitinfo.sheet.name() === 'stdRationLib_chapter') {
|
|
|
+ if(hitinfo.x < hitinfo.cellRect.x + hitinfo.cellRect.width && hitinfo.x > hitinfo.cellRect.x + hitinfo.cellRect.width - questionImgWidth) {
|
|
|
+ rationLibObj.initQuestionModal(hitinfo.row);
|
|
|
+ }
|
|
|
+ }
|
|
|
let offset = -1;
|
|
|
let node = tree.items[hitinfo.row];
|
|
|
tree.selected = node;
|
|
@@ -477,6 +491,15 @@ var TREE_SHEET_HELPER = {
|
|
|
TreeNodeCellType.prototype.processMouseEnter = function(hitinfo){
|
|
|
if(hitinfo.sheet.name() === 'stdBillsGuidance_bills'){
|
|
|
TREE_SHEET_HELPER.delayShowTips(hitinfo,setting);
|
|
|
+ } else if(hitinfo.sheet.name() === 'stdRationLib_chapter'){
|
|
|
+ if(this.enterCell==null){
|
|
|
+ this.enterCell={
|
|
|
+ row:hitinfo.row,
|
|
|
+ col:hitinfo.col
|
|
|
+ };
|
|
|
+ hitinfo.sheet.invalidateLayout();
|
|
|
+ hitinfo.sheet.repaint();
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
TreeNodeCellType.prototype.processMouseMove = function(hitinfo){//造价书主界面,当鼠标移动到单元格最右往左50个像素内时才显示悬浮提示内容
|
|
@@ -491,6 +514,11 @@ var TREE_SHEET_HELPER = {
|
|
|
};
|
|
|
TreeNodeCellType.prototype.processMouseLeave = function (hitinfo) {
|
|
|
TREE_SHEET_HELPER.hideTipsDiv();
|
|
|
+ if(hitinfo.sheet.name() === 'stdRationLib_chapter') {
|
|
|
+ this.enterCell = null;
|
|
|
+ hitinfo.sheet.invalidateLayout();
|
|
|
+ hitinfo.sheet.repaint();
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
if(isRationNode){
|
|
@@ -662,5 +690,67 @@ var TREE_SHEET_HELPER = {
|
|
|
}
|
|
|
}
|
|
|
},delayTimes);
|
|
|
+ },
|
|
|
+ getQuestionCellType: function (mouseDownCallback = null) {
|
|
|
+ let img = document.getElementById('question_pic'),
|
|
|
+ imgWidth = 16,
|
|
|
+ imgHeight = 16;
|
|
|
+ let QuestionCellType = function () {};
|
|
|
+ QuestionCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
|
|
|
+ QuestionCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
|
|
|
+ if (style.backColor) {
|
|
|
+ ctx.save();
|
|
|
+ ctx.fillStyle = style.backColor;
|
|
|
+ ctx.fillRect(x, y, w, h);
|
|
|
+ ctx.restore();
|
|
|
+ } else {
|
|
|
+ ctx.clearRect(x, y, w, h);
|
|
|
+ }
|
|
|
+ GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
|
|
|
+ if(this.editingCell){
|
|
|
+ let centerX = Math.floor(x) + w - 20;
|
|
|
+ let centerY = Math.floor((y + (y + h)) / 2);
|
|
|
+ ctx.drawImage(img, centerX + 3, centerY - 7, imgWidth,imgHeight);
|
|
|
+ }
|
|
|
+ };
|
|
|
+ QuestionCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
|
|
|
+ return {
|
|
|
+ x: x,
|
|
|
+ y: y,
|
|
|
+ row: context.row,
|
|
|
+ col: context.col,
|
|
|
+ cellStyle: cellStyle,
|
|
|
+ cellRect: cellRect,
|
|
|
+ sheetArea: context.sheetArea
|
|
|
+ };
|
|
|
+ };
|
|
|
+ QuestionCellType.prototype.processMouseDown = function (hitinfo) {
|
|
|
+ //弹出说明等窗口
|
|
|
+ if(this.editingCell && this.editingCell.row === hitinfo.row){
|
|
|
+ let offSet = hitinfo.cellRect.x + hitinfo.cellRect.width;
|
|
|
+ if(hitinfo.x < offSet && hitinfo.x > offSet - imgWidth){
|
|
|
+ if(mouseDownCallback) {
|
|
|
+ mouseDownCallback(hitinfo.row);
|
|
|
+ }
|
|
|
+ //$('#rationQuestionModal').modal('show');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
+ QuestionCellType.prototype.processMouseEnter = function (hitinfo){
|
|
|
+ if(this.editingCell==null){
|
|
|
+ this.editingCell={
|
|
|
+ row:hitinfo.row,
|
|
|
+ col:hitinfo.col
|
|
|
+ };
|
|
|
+ hitinfo.sheet.invalidateLayout();
|
|
|
+ hitinfo.sheet.repaint();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ QuestionCellType.prototype.processMouseLeave = function (hitinfo) {
|
|
|
+ this.editingCell=null;
|
|
|
+ hitinfo.sheet.invalidateLayout();
|
|
|
+ hitinfo.sheet.repaint();
|
|
|
+ };
|
|
|
+ return new QuestionCellType();
|
|
|
}
|
|
|
};
|