tree_sheet_helper.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. /**
  2. * Created by Mai on 2017/4/1.
  3. */
  4. var TREE_SHEET_HELPER = {
  5. getObjPos: function (obj) {
  6. let target = obj;
  7. let pos = {x: obj.offsetLeft, y: obj.offsetTop};
  8. target = obj.offsetParent;
  9. while (target) {
  10. pos.x += target.offsetLeft;
  11. pos.y += target.offsetTop;
  12. target = target.offsetParent;
  13. }
  14. return pos;
  15. },
  16. /**
  17. * 初始化setting,需要提示单元格text时,必须先初始化setting
  18. * @param obj
  19. * @param setting
  20. */
  21. initSetting: function (obj, setting) {
  22. setting.pos = this.getObjPos(obj);
  23. },
  24. createNewSpread: function (obj) {
  25. var spread = new GC.Spread.Sheets.Workbook(obj, {sheetCount: 1});
  26. spread.options.tabStripVisible = false;
  27. spread.options.scrollbarMaxAlign = true;
  28. spread.options.cutCopyIndicatorVisible = false;
  29. spread.options.allowCopyPasteExcelStyle = false;
  30. spread.options.allowUserDragDrop = false;
  31. spread.options.allowContextMenu = false;
  32. spread.options.showDragFillSmartTag = false;
  33. spread.getActiveSheet().setRowCount(3);
  34. return spread;
  35. },
  36. getSheetCellStyle: function (setting) {
  37. var style = new GC.Spread.Sheets.Style();
  38. style.locked = setting.readOnly ? true : false;
  39. style.name = setting.id;
  40. style.font = setting.data.font;
  41. style.hAlign = setting.data.hAlign;
  42. style.vAlign = setting.data.vAlign;
  43. style.wordWrap = setting.data.wordWrap;
  44. if (setting.data.formatter) {
  45. style.formatter = setting.data.formatter;
  46. }
  47. return style;
  48. },
  49. loadSheetHeader: function (setting, sheet) {
  50. if (setting.frozenCols) {
  51. sheet.frozenColumnCount(setting.frozenCols);
  52. }
  53. sheet.setColumnCount(setting.cols.length);
  54. sheet.setRowCount(setting.headRows, GC.Spread.Sheets.SheetArea.colHeader);
  55. setting.headRowHeight.forEach(function (rowHeight, index) {
  56. sheet.setRowHeight(index, rowHeight, GC.Spread.Sheets.SheetArea.colHeader);
  57. });
  58. setting.cols.forEach(function (col, index) {
  59. var i, iRow = 0, cell;
  60. for (i = 0; i < col.head.spanCols.length; i++) {
  61. if (col.head.spanCols[i] !== 0) {
  62. cell = sheet.getCell(iRow, index, GC.Spread.Sheets.SheetArea.colHeader);
  63. cell.value(col.head.titleNames[i]).font(col.head.font).hAlign(col.head.hAlign[i]).vAlign(col.head.vAlign[i]).wordWrap(true);
  64. }
  65. if (col.head.spanCols[i] > 1 || col.head.spanRows[i] > 1) {
  66. sheet.addSpan(iRow, index, col.head.spanRows[i], col.head.spanCols[i], GC.Spread.Sheets.SheetArea.colHeader);
  67. }
  68. iRow += col.head.spanRows[i];
  69. };
  70. sheet.setColumnWidth(index, col.width);
  71. });
  72. },
  73. protectdSheet: function (sheet) {
  74. var option = {
  75. allowSelectLockedCells: true,
  76. allowSelectUnlockedCells: true,
  77. allowResizeRows: true,
  78. allowResizeColumns: true
  79. };
  80. sheet.options.protectionOptions = option;
  81. sheet.options.isProtected = true;
  82. },
  83. massOperationSheet: function (sheet, Operation) {
  84. sheet.suspendPaint();
  85. sheet.suspendEvent();
  86. Operation();
  87. sheet.resumeEvent();
  88. sheet.resumePaint();
  89. },
  90. refreshNodesVisible: function (nodes, sheet, recursive) {
  91. nodes.forEach(function (node) {
  92. var iRow;
  93. iRow = node.serialNo();
  94. sheet.setRowVisible(iRow, node.visible, GC.Spread.Sheets.SheetArea.viewport);
  95. if (recursive) {
  96. TREE_SHEET_HELPER.refreshNodesVisible(node.children, sheet, recursive);
  97. }
  98. })
  99. },
  100. refreshTreeNodeData: function (setting, sheet, nodes, recursive) {
  101. nodes.forEach(function (node) {
  102. setting.cols.forEach(function (colSetting, iCol) {
  103. var iRow = node.serialNo();
  104. var cell = sheet.getCell(iRow, iCol, GC.Spread.Sheets.SheetArea.viewport);
  105. var getFieldText = function () {
  106. var fields = colSetting.data.field.split('.');
  107. var validField = fields.reduce(function (field1, field2) {
  108. if (eval('node.data.' + field1)) {
  109. return field1 + '.' + field2
  110. } else {
  111. return field1;
  112. }
  113. });
  114. if (eval('node.data.' + validField)) {
  115. return eval('node.data.' + validField);
  116. } else {
  117. return '';
  118. }
  119. };
  120. var getFieldText2 = function () {
  121. var fields = colSetting.data.field.split('.'), iField, data = node.data;
  122. for (iField = 0; iField < fields.length; iField++) {
  123. if (data[fields[iField]]) {
  124. data = data[fields[iField]];
  125. } else {
  126. return '';
  127. }
  128. }
  129. return data;
  130. };
  131. if (colSetting.data.getText && Object.prototype.toString.apply(colSetting.data.getText) === "[object Function]") {
  132. cell.value(colSetting.data.getText(node));
  133. } else {
  134. cell.value(getFieldText2());
  135. }
  136. if (colSetting.data.cellType && Object.prototype.toString.apply(colSetting.data.cellType) !== "[object String]") {
  137. cell.cellType(colSetting.data.cellType);
  138. }
  139. if (colSetting.readOnly) {
  140. if (Object.prototype.toString.apply(colSetting.readOnly) === "[object Function]") {
  141. cell.locked(colSetting.readOnly(node));
  142. } else {
  143. cell.locked(true);
  144. }
  145. } else {
  146. cell.locked(false);
  147. }
  148. });
  149. sheet.autoFitRow(node.serialNo());
  150. if (recursive) {
  151. TREE_SHEET_HELPER.refreshTreeNodeData(setting, sheet, node.children, recursive);
  152. }
  153. });
  154. },
  155. refreshChildrenVisiable:function(sheet,tree,node,row,visiable){
  156. let iCount = node.posterityCount(), i, child;
  157. for (i = 0; i < iCount; i++) {
  158. child = tree.items[row + i +1];
  159. sheet.setRowVisible(row + i + 1, visiable?visiable:child.visible, GC.Spread.Sheets.SheetArea.viewport);
  160. }
  161. sheet.invalidateLayout();
  162. },
  163. showTreeData: function (setting, sheet, tree) {
  164. var indent = 20;
  165. var halfBoxLength = 5;
  166. var halfExpandLength = 3;
  167. let defaultHeight = 17; // 单元格默认高度,getAutoFitHeight返回17时,单元格高度才是20...不清楚原因
  168. let levelIndent = -5;
  169. var TreeNodeCellType = function () {
  170. };
  171. TreeNodeCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
  172. TreeNodeCellType.prototype.paint = function (ctx, value, x, y, w, h, style, options) {
  173. if (style.backColor) {
  174. ctx.save();
  175. ctx.fillStyle = style.backColor;
  176. ctx.fillRect(x, y, w, h);
  177. ctx.restore();
  178. } else {
  179. ctx.clearRect(x, y, w, h);
  180. }
  181. // ������(x1, y1)���(��, ��), (x2, y2)�յ�(��, ��), ��ɫ
  182. var drawLine = function (canvas, x1, y1, x2, y2, color) {
  183. ctx.save();
  184. // ����ƫ����
  185. ctx.translate(0.5, 0.5);
  186. ctx.beginPath();
  187. ctx.moveTo(x1, y1);
  188. ctx.lineTo(x2, y2);
  189. ctx.strokeStyle = color;
  190. ctx.stroke();
  191. ctx.restore();
  192. };
  193. var drawExpandBox = function (ctx, x, y, w, h, centerX, centerY, expanded) {
  194. var rect = {}, h1, h2, offset = 1;
  195. rect.top = centerY - halfBoxLength;
  196. rect.bottom = centerY + halfBoxLength;
  197. rect.left = centerX - halfBoxLength;
  198. rect.right = centerX + halfBoxLength;
  199. if (rect.left < x + w) {
  200. rect.right = Math.min(rect.right, x + w);
  201. ctx.save();
  202. // ����ƫ����
  203. ctx.translate(0.5, 0.5);
  204. ctx.strokeStyle = 'black';
  205. ctx.beginPath();
  206. ctx.moveTo(rect.left, rect.top);
  207. ctx.lineTo(rect.left, rect.bottom);
  208. ctx.lineTo(rect.right, rect.bottom);
  209. ctx.lineTo(rect.right, rect.top);
  210. ctx.lineTo(rect.left, rect.top);
  211. ctx.stroke();
  212. ctx.fillStyle = 'white';
  213. ctx.fill();
  214. ctx.restore();
  215. // Draw Horizontal Line
  216. h1 = centerX - halfExpandLength;
  217. h2 = Math.min(centerX + halfExpandLength, x + w);
  218. if (h2 > h1) {
  219. drawLine(ctx, h1, centerY, h2, centerY, 'black');
  220. }
  221. // Draw Vertical Line
  222. if (!expanded && (centerX < x + w)) {
  223. drawLine(ctx, centerX, centerY - halfExpandLength, centerX, centerY + halfExpandLength, 'black');
  224. }
  225. }
  226. }
  227. var node = tree.items[options.row];
  228. var showTreeLine = true;
  229. if (!node) { return; }
  230. var iLevel = node.depth();
  231. var centerX = Math.floor(x) + node.depth() * indent + indent / 2;
  232. var x1 = centerX + indent / 2;
  233. var centerY = Math.floor((y + (y + h)) / 2);
  234. var y1;
  235. // Draw Sibling Line
  236. if (showTreeLine) {
  237. // Draw Horizontal Line
  238. if (centerX < x + w) {
  239. drawLine(ctx, centerX, centerY, Math.min(x1, x + w), centerY, 'gray');
  240. }
  241. // Draw Vertical Line
  242. if (centerX < x + w) {
  243. y1 = node.isLast() ? centerY : y + h;
  244. if (node.isFirst() && !node.parent) {
  245. drawLine(ctx, centerX, centerY, centerX, y1, 'gray');
  246. } else {
  247. drawLine(ctx, centerX, y, centerX, y1, 'gray');
  248. }
  249. }
  250. }
  251. // Draw Expand Box
  252. if (node.children.length > 0) {
  253. drawExpandBox(ctx, x, y, w, h, centerX, centerY, node.expanded);
  254. }
  255. // Draw Parent Line
  256. if (showTreeLine) {
  257. var parent = node.parent, parentCenterX = centerX - indent;
  258. while (parent) {
  259. if (!parent.isLast()) {
  260. if (parentCenterX < x + w) {
  261. drawLine(ctx, parentCenterX, y, parentCenterX, y + h, 'gray');
  262. }
  263. }
  264. parent = parent.parent;
  265. parentCenterX -= indent;
  266. }
  267. };
  268. // Draw Text
  269. x = x + (node.depth() + 1) * indent;
  270. w = w - (node.depth() + 1) * indent;
  271. GC.Spread.Sheets.CellTypes.Text.prototype.paint.apply(this, arguments);
  272. };
  273. TreeNodeCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
  274. return {
  275. x: x,
  276. y: y,
  277. row: context.row,
  278. col: context.col,
  279. cellStyle: cellStyle,
  280. cellRect: cellRect,
  281. sheetArea: context.sheetArea
  282. };
  283. };
  284. TreeNodeCellType.prototype.processMouseDown = function (hitinfo) {
  285. var offset = -1;
  286. var node = tree.items[hitinfo.row];
  287. tree.selected = node;
  288. if (!node || node.children.length === 0) { return; }
  289. var centerX = hitinfo.cellRect.x + offset + node.depth() * indent + indent / 2;
  290. var centerY = (hitinfo.cellRect.y + offset + (hitinfo.cellRect.y + offset + hitinfo.cellRect.height)) / 2;
  291. if (hitinfo.x > centerX - halfBoxLength && hitinfo.x < centerX + halfBoxLength && hitinfo.y > centerY - halfBoxLength && hitinfo.y < centerY + halfBoxLength) {
  292. node.setExpanded(!node.expanded);
  293. TREE_SHEET_HELPER.massOperationSheet(hitinfo.sheet, function () {
  294. var iCount = node.posterityCount(), i, child;
  295. for (i = 0; i < iCount; i++) {
  296. child = tree.items[hitinfo.row + i + 1];
  297. hitinfo.sheet.setRowVisible(hitinfo.row + i + 1, child.visible, hitinfo.sheetArea);
  298. //hitinfo.sheet.setRowVisible(hitinfo.row + i + 1, child.vis(), hitinfo.sheetArea);
  299. }
  300. hitinfo.sheet.invalidateLayout();
  301. });
  302. hitinfo.sheet.repaint();
  303. }
  304. };
  305. /* TreeNodeCellType.prototype.getAutoFitHeight = function(value, text, cellStyle, zoomFactor, context){
  306. debugger;
  307. // if (!defaultHeight) {
  308. defaultHeight = context.sheet.getCell(context.row, -1).height();
  309. // }
  310. const node = tree.items[context.row];
  311. const nodeIndent = node ? (node.depth() + 1) * indent + node.depth() * levelIndent + 5 : 0;
  312. const cellWidth = context.sheet.getCell(-1, context.col).width();
  313. const textLength = this.getAutoFitWidth(...arguments);
  314. const tempNum = textLength / (cellWidth - nodeIndent);
  315. const lineNum = tempNum % 1 > 0.92 ? Math.ceil(tempNum + 1) : Math.ceil(tempNum); // 不这么处理的话有些行高算出来不对
  316. //const lineNum = Math.ceil(textLength / (cellWidth - nodeIndent));
  317. return lineNum * defaultHeight;
  318. }; */
  319. TreeNodeCellType.prototype.processMouseEnter = function(hitinfo){
  320. if(hitinfo.sheet.name() === 'stdBillsGuidance_bills'){
  321. TREE_SHEET_HELPER.delayShowTips(hitinfo,setting);
  322. } else if (hitinfo.sheet.name() === 'stdBillsGuidance_guidance') {
  323. let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
  324. let value = hitinfo.sheet.getValue(hitinfo.row, hitinfo.col);
  325. let acStyle = hitinfo.sheet.getActualStyle(hitinfo.row, hitinfo.col),
  326. zoom = hitinfo.sheet.zoom();
  327. let node = tree.items[hitinfo.row];
  328. let nodeIndent = node ? (node.depth() + 1) * indent + node.depth() - 3 : 0;
  329. let textLength = this.getAutoFitWidth(value, text, acStyle, zoom, {sheet: hitinfo.sheet, row: hitinfo.row, col: hitinfo.col, sheetArea: GC.Spread.Sheets.SheetArea.viewport});
  330. let cellWidth = hitinfo.sheet.getCell(-1, hitinfo.col).width();
  331. if(textLength > cellWidth - nodeIndent && node.data.name){
  332. // hitinfo.x += 100;
  333. const leftWidth = $('#billsSpread').width();
  334. hitinfo.x += leftWidth + 10;
  335. hitinfo.y += 10;
  336. TREE_SHEET_HELPER.delayShowTips(hitinfo,setting, node.data.name);
  337. }
  338. // const node = tree.items[hitinfo.row];
  339. /* let textWidth = ctx.measureText(value).width;
  340. console.log(textWidth); */
  341. }
  342. };
  343. TreeNodeCellType.prototype.processMouseLeave = function (hitinfo) {
  344. TREE_SHEET_HELPER.hideTipsDiv();
  345. };
  346. let TipCellType = function () {};
  347. TipCellType.prototype = new GC.Spread.Sheets.CellTypes.Text();
  348. TipCellType.prototype.getHitInfo = function (x, y, cellStyle, cellRect, context) {
  349. return {
  350. x: x,
  351. y: y,
  352. row: context.row,
  353. col: context.col,
  354. cellStyle: cellStyle,
  355. cellRect: cellRect,
  356. sheet: context.sheet,
  357. sheetArea: context.sheetArea
  358. };
  359. };
  360. TipCellType.prototype.processMouseEnter = function (hitinfo) {
  361. let text = hitinfo.sheet.getText(hitinfo.row, hitinfo.col);
  362. if (setting.pos && text && text !== '') {
  363. if (!this._toolTipElement) {
  364. var div = document.createElement("div");
  365. $(div).css("position", "absolute")
  366. .css("border", "1px #C0C0C0 solid")
  367. .css("box-shadow", "1px 2px 5px rgba(0,0,0,0.4)")
  368. .css("font", "9pt Arial")
  369. .css("padding", 5)
  370. .css("background", '#303133')
  371. .css("color", '#fff');
  372. this._toolTipElement = div;
  373. }
  374. $(this._toolTipElement).text(text).css("top", setting.pos.y + hitinfo.y + 15).css("left", setting.pos.x + hitinfo.x + 15);
  375. $(this._toolTipElement).hide();
  376. document.body.insertBefore(this._toolTipElement, null);
  377. $(this._toolTipElement).show("fast");
  378. }
  379. };
  380. TipCellType.prototype.processMouseLeave = function (hininfo) {
  381. if (this._toolTipElement) {
  382. document.body.removeChild(this._toolTipElement);
  383. this._toolTipElement = null;
  384. }
  385. }
  386. TREE_SHEET_HELPER.protectdSheet(sheet);
  387. TREE_SHEET_HELPER.massOperationSheet(sheet, function () {
  388. sheet.rowOutlines.direction(GC.Spread.Sheets.Outlines.OutlineDirection.backward);
  389. sheet.showRowOutline(false);
  390. if (setting.defaultRowHeight) {
  391. sheet.defaults.rowHeight = setting.defaultRowHeight;
  392. }
  393. sheet.setRowCount(tree.count() + setting.emptyRows, GC.Spread.Sheets.SheetArea.viewport);
  394. setting.cols.forEach(function (colSetting, iCol) {
  395. sheet.setStyle(-1, iCol, TREE_SHEET_HELPER.getSheetCellStyle(colSetting));
  396. if (colSetting.showHint) {
  397. sheet.getRange(-1, iCol, -1, 1).cellType(new TipCellType());
  398. }
  399. });
  400. sheet.getRange(-1, setting.treeCol, -1, 1).cellType(new TreeNodeCellType());
  401. TREE_SHEET_HELPER.refreshTreeNodeData(setting, sheet, tree.roots, true);
  402. TREE_SHEET_HELPER.refreshNodesVisible(tree.roots, sheet, true);
  403. });
  404. },
  405. showTipsDiv:function (text,setting,hitinfo) {
  406. if (text && text !== '') {
  407. if(text) text = replaceAll(/[\n]/,'<br>',text);
  408. if(!this._fixedTipElement){
  409. let div = $('#fixedTip')[0];
  410. if (!div) {
  411. div = document.createElement("div");
  412. $(div).css("padding", 5)
  413. .attr("id", 'fixedTip');
  414. $(div).hide();
  415. document.body.insertBefore(div, null);
  416. }
  417. this._fixedTipElement = div;
  418. }
  419. $(this._fixedTipElement).width('');
  420. $(this._fixedTipElement).html(text);
  421. if (!this._toolTipElement) {
  422. let div = $('#autoTip')[0];
  423. if (!div) {
  424. div = document.createElement("div");
  425. $(div).css("position", "absolute")
  426. .css("border", "1px #C0C0C0 solid")
  427. .css("box-shadow", "1px 2px 5px rgba(0,0,0,0.4)")
  428. .css("font", "0.9rem Calibri")
  429. .css("padding", 5)
  430. .css("background", '#303133')
  431. .css("color", '#fff')
  432. $(div).attr("id", 'autoTip');
  433. $(div).hide();
  434. document.body.insertBefore(div, null);
  435. }
  436. this._toolTipElement = div;
  437. $(this._toolTipElement).width('');
  438. //实时读取位置信息
  439. if(hitinfo.sheet && hitinfo.sheet.getParent().qo){
  440. setting.pos = SheetDataHelper.getObjPos(hitinfo.sheet.getParent().qo);
  441. }
  442. $(this._toolTipElement).html(`<span>${text}</span><div class="triangle-border tb-border_up"></div><div class="triangle-border tb-background_up"></div>`);
  443. //清单指引、清单库做特殊处理
  444. if($(hitinfo.sheet.name === 'stdBillsGuidance_bills')){
  445. $(this._toolTipElement).html(`<span>${text}</span>`);
  446. let divWidth = $(this._fixedTipElement).width(),
  447. divHeight = $(this._fixedTipElement).height();
  448. if(divWidth > 600){
  449. divWidth = 590;
  450. $(this._toolTipElement).width(divWidth);
  451. }
  452. let top = setting.pos.y + hitinfo.y - divHeight / 2 < 0 ? 0 : setting.pos.y + hitinfo.y - divHeight / 2;
  453. $(this._toolTipElement).css("top", top).css("left", hitinfo.x + 20);
  454. } else {
  455. //计算显示的初始位置
  456. /* 显示在单元格上方,三角形指向下的版本
  457. let top = setting.pos.y + hitinfo.cellRect.y -$(this._toolTipElement).height() -26;
  458. let left = setting.pos.x + hitinfo.cellRect.x;
  459. $(this._toolTipElement).css("top", top).css("left", left);*/
  460. //显示在下方,三角形指
  461. let top = setting.pos.y + hitinfo.cellRect.y+26;
  462. let left = setting.pos.x + hitinfo.cellRect.x;
  463. $(this._toolTipElement).css("top", top).css("left", left);
  464. }
  465. $(this._toolTipElement).show("fast");
  466. TREE_SHEET_HELPER.tipDiv = 'show';//做个标记
  467. }
  468. }
  469. },
  470. hideTipsDiv:function () {
  471. TREE_SHEET_HELPER.tipTimeStamp = +new Date();//这个是为了造价书清单编号树节点的那个延时显示而打的时间戳,防止已经要隐藏的提示框,延时显示
  472. let me = TREE_SHEET_HELPER;
  473. TREE_SHEET_HELPER.tipDiv = 'hide';
  474. if (me._toolTipElement) {
  475. $(me._toolTipElement).hide();
  476. me._toolTipElement = null;
  477. }
  478. TREE_SHEET_HELPER.tipDivCheck();//延时检查:当tips正在show的时候,就调用了hide方法,会导致tips一直存在,所以设置一个超时处理
  479. },
  480. tipDivCheck(){
  481. setTimeout(function () {
  482. let tips = $('#autoTip');
  483. if(TREE_SHEET_HELPER.tipDiv == 'show'){
  484. return;
  485. } else if(TREE_SHEET_HELPER.tipDiv == 'hide'&&tips){
  486. tips.hide();
  487. TREE_SHEET_HELPER._toolTipElement = null;
  488. }
  489. },600)
  490. },
  491. delayShowTips:function(hitinfo,setting,tips){//延时显示
  492. let delayTimes = 500; //延时时间
  493. let now_timeStamp = +new Date();
  494. TREE_SHEET_HELPER.tipTimeStamp = now_timeStamp;
  495. setTimeout(function () {
  496. if(now_timeStamp - TREE_SHEET_HELPER.tipTimeStamp == 0){//鼠标停下的时候才显示
  497. let tag = hitinfo.sheet.getTag(hitinfo.row, hitinfo.col);
  498. if(tips && tips !=""){ //有tips的话优先显示tips
  499. tag = tips;
  500. }
  501. if(tag&&tag!=''){
  502. TREE_SHEET_HELPER.showTipsDiv(tag,setting,hitinfo);
  503. }
  504. }
  505. },delayTimes);
  506. }
  507. };