|
@@ -360,7 +360,49 @@ var sheetCommonObj = {
|
|
|
sheet.setCellType(row, col,getSelectButton(header.headerWidth),GC.Spread.Sheets.SheetArea.viewport);
|
|
|
},
|
|
|
setTipsCell(row,col,sheet,header){
|
|
|
-
|
|
|
+ let TipCellType = function () {};
|
|
|
+ TipCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
|
|
|
+ TipCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
|
|
|
+ return {
|
|
|
+ x: x,
|
|
|
+ y: y,
|
|
|
+ row: context.row,
|
|
|
+ col: context.col,
|
|
|
+ cellStyle: cellStyle,
|
|
|
+ cellRect: cellRect,
|
|
|
+ sheet: context.sheet,
|
|
|
+ sheetArea: context.sheetArea
|
|
|
+ };
|
|
|
+ };
|
|
|
+ TipCellType.prototype.processMouseEnter = function (hitinfo) {
|
|
|
+ let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
|
|
|
+ let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
|
|
|
+ let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
|
|
|
+ let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
|
|
|
+ zoom = hitinfo.sheet.zoom();
|
|
|
+ let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
|
|
|
+ let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
|
|
|
+ let setting = {};
|
|
|
+ if(textLength <= cellWidth){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(sheet && sheet.getParent().qo){
|
|
|
+ setting.pos = SheetDataHelper.getObjPos(sheet.getParent().qo);
|
|
|
+ }
|
|
|
+
|
|
|
+ TREE_SHEET_HELPER.showTipsDiv(text,setting,hitinfo);
|
|
|
+ };
|
|
|
+ TipCellType.prototype.processMouseLeave = function (hitinfo) {
|
|
|
+ TREE_SHEET_HELPER.tipDiv = 'hide';
|
|
|
+ if (TREE_SHEET_HELPER._toolTipElement) {
|
|
|
+ $(TREE_SHEET_HELPER._toolTipElement).hide();
|
|
|
+ TREE_SHEET_HELPER._toolTipElement = null;
|
|
|
+ };
|
|
|
+ TREE_SHEET_HELPER.tipDivCheck();//延时检查:当tips正在show的时候,就调用了hide方法,会导致tips一直存在,所以设置一个超时处理
|
|
|
+ };
|
|
|
+
|
|
|
+ sheet.setCellType(row, col,new TipCellType(),GC.Spread.Sheets.SheetArea.viewport);
|
|
|
+
|
|
|
},
|
|
|
chkIfEmpty: function(rObj, setting) {
|
|
|
var rst = true;
|