|
|
@@ -211,7 +211,7 @@ var sheetCommonObj = {
|
|
|
}
|
|
|
|
|
|
if (setting.header[col].cellType === "tipsCell") {
|
|
|
- this.setTipsCell(row, col, sheet, setting.header[col]);
|
|
|
+ this.setTipsCell(row, col, sheet);
|
|
|
}
|
|
|
if (setting.owner === 'gljTree') {
|
|
|
if (setting.header[col].cellType === "checkBox") {
|
|
|
@@ -223,6 +223,7 @@ var sheetCommonObj = {
|
|
|
val = distTypeVal;
|
|
|
}
|
|
|
}
|
|
|
+ if(setting.setCellType) setting.setCellType(sheet,data[row],row,col)
|
|
|
if (setting.header[col].getText) {
|
|
|
val = setting.getText[setting.header[col].getText](data[row], val)
|
|
|
}
|
|
|
@@ -682,7 +683,7 @@ var sheetCommonObj = {
|
|
|
sheet.setCellType(row, col, cellType, GC.Spread.Sheets.SheetArea.viewport);
|
|
|
},
|
|
|
|
|
|
- setTipsCell(row, col, sheet, header) {
|
|
|
+ setTipsCell(row, col, sheet,tips) {
|
|
|
let TipCellType = function () { };
|
|
|
TipCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
|
|
|
TipCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
|
|
|
@@ -699,16 +700,20 @@ var sheetCommonObj = {
|
|
|
};
|
|
|
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();
|
|
|
+ console.log(tips);
|
|
|
let setting = {};
|
|
|
- if (textLength <= cellWidth) {
|
|
|
- return;
|
|
|
+ if(!tips){
|
|
|
+ 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();
|
|
|
+ if (textLength <= cellWidth) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
+ text = tips;
|
|
|
if (sheet && sheet.getParent().qo) {
|
|
|
setting.pos = SheetDataHelper.getObjPos(sheet.getParent().qo);
|
|
|
}
|
|
|
@@ -856,7 +861,7 @@ var sheetCommonObj = {
|
|
|
}
|
|
|
return new getTipsCombo();
|
|
|
}, */
|
|
|
- getTreeNodeCellType: function (datas, row, parentMap,treeCol, paintFunc) {// 2018-09-26 不用spreadjs默认的树结构,自定义控件
|
|
|
+ getTreeNodeCellType: function (datas, row, parentMap,treeCol, paintFunc,tips) {// 2018-09-26 不用spreadjs默认的树结构,自定义控件
|
|
|
var ns = GC.Spread.Sheets;
|
|
|
let rectW = 10;
|
|
|
let rectH = 10;
|
|
|
@@ -921,6 +926,26 @@ var sheetCommonObj = {
|
|
|
sheetArea: context.sheetArea
|
|
|
};
|
|
|
}
|
|
|
+ if(tips){
|
|
|
+ TreeNodeCellType.prototype.processMouseEnter = function (hitinfo) {
|
|
|
+ let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
|
|
|
+ let setting = {};
|
|
|
+ text = tips;
|
|
|
+ if (hitinfo.sheet && hitinfo.sheet.getParent().qo) {
|
|
|
+ setting.pos = SheetDataHelper.getObjPos(hitinfo.sheet.getParent().qo);
|
|
|
+ }
|
|
|
+
|
|
|
+ TREE_SHEET_HELPER.showTipsDiv(text, setting, hitinfo);
|
|
|
+ };
|
|
|
+ TreeNodeCellType.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一直存在,所以设置一个超时处理
|
|
|
+ };
|
|
|
+ }
|
|
|
TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
|
|
|
////方框外1像素内都有效
|
|
|
if (!_.isEmpty(this.rectInfo) && Math.floor(hitinfo.x) <= this.rectInfo.x + this.rectInfo.rectW + 2 && Math.floor(hitinfo.x) >= this.rectInfo.x - 2) {
|