sheet_common.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. /**
  2. * Created by Tony on 2017/4/28.
  3. */
  4. var sheetCommonObj = {
  5. // createSpread、initSheet 在一个Spread多个Sheet分别调用时的情况下使用。
  6. // buildSheet 在一个Spread、一个Sheet的情况下使用。
  7. createSpread: function(container, SheetCount){
  8. var me = this;
  9. var spreadBook = new GC.Spread.Sheets.Workbook(container, { sheetCount: SheetCount });
  10. spreadBook.options.allowCopyPasteExcelStyle = false;
  11. spreadBook.options.allowExtendPasteRange = true;
  12. spreadBook.options.tabStripVisible = false;
  13. //spreadBook.options.showHorizontalScrollbar = false;
  14. spreadBook.options.allowUserDragDrop = false;
  15. spreadBook.options.scrollbarMaxAlign = true;
  16. spreadBook.options.allowContextMenu = false;
  17. spreadBook.options.allowUndo = false;
  18. spreadBook.options.cutCopyIndicatorVisible = false;
  19. return spreadBook;
  20. },
  21. initSheet: function(sheet, setting, rowCount) {
  22. var me = this;
  23. var spreadNS = GC.Spread.Sheets;
  24. sheet.suspendPaint();
  25. sheet.suspendEvent();
  26. sheet.setRowCount(1, spreadNS.SheetArea.colHeader);
  27. sheet.setColumnCount(setting.header.length, spreadNS.SheetArea.viewport);
  28. sheet.options.colHeaderAutoTextIndex = 1;
  29. sheet.options.colHeaderAutoText = spreadNS.HeaderAutoText.numbers;
  30. sheet.options.protectionOptions = {
  31. allowResizeRows: true,
  32. allowResizeColumns: true
  33. };
  34. sheet.showRowOutline(false);
  35. me.buildHeader(sheet, setting);
  36. if (rowCount > 0) sheet.setRowCount(rowCount);
  37. sheet.resumeEvent();
  38. sheet.resumePaint();
  39. },
  40. buildSheet: function(container, setting, rowCount) {
  41. var me = this;
  42. var spreadBook = new GC.Spread.Sheets.Workbook(container, { sheetCount: 1 });
  43. spreadBook.options.tabStripVisible = false;
  44. //spreadBook.options.showHorizontalScrollbar = false;
  45. spreadBook.options.scrollbarMaxAlign = true;
  46. spreadBook.options.allowCopyPasteExcelStyle = false;
  47. spreadBook.options.cutCopyIndicatorVisible = false;
  48. spreadBook.options.allowExtendPasteRange = true;
  49. spreadBook.options.allowUserDragDrop = false;
  50. spreadBook.options.allowUndo = false;
  51. spreadBook.options.allowContextMenu = false;
  52. var spreadNS = GC.Spread.Sheets;
  53. var sheet = spreadBook.getSheet(0);
  54. sheet.suspendPaint();
  55. sheet.suspendEvent();
  56. //Set rowHeader count and columnHeader count.
  57. sheet.setRowCount(1, spreadNS.SheetArea.colHeader);
  58. sheet.setColumnCount(setting.header.length, spreadNS.SheetArea.viewport);
  59. sheet.options.colHeaderAutoTextIndex = 1;
  60. sheet.options.colHeaderAutoText = spreadNS.HeaderAutoText.numbers;
  61. sheet.options.clipBoardOptions = GC.Spread.Sheets.ClipboardPasteOptions.values;
  62. sheet.options.protectionOptions = {
  63. allowResizeRows: true,
  64. allowResizeColumns: true
  65. };
  66. sheet.showRowOutline(false);
  67. //setup column header
  68. me.buildHeader(sheet, setting);
  69. //setup cells
  70. if (rowCount > 0) sheet.setRowCount(rowCount);
  71. sheet.resumeEvent();
  72. sheet.resumePaint();
  73. return spreadBook;
  74. },
  75. buildHeader: function(sheet, setting){
  76. var me = this, ch = GC.Spread.Sheets.SheetArea.colHeader;
  77. for (var i = 0; i < setting.header.length; i++) {
  78. sheet.setValue(0, i, setting.header[i].headerName, ch);
  79. sheet.setColumnWidth(i, setting.header[i].headerWidth ? setting.header[i].headerWidth : 100);
  80. }
  81. if(setting.headerHeight) sheet.setRowHeight(0, setting.headerHeight, GC.Spread.Sheets.SheetArea.colHeader);
  82. },
  83. cleanData: function (sheet, setting, rowCount) {
  84. sheet.suspendPaint();
  85. sheet.suspendEvent();
  86. sheet.clear(-1, 0, -1, setting.header.length, GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.StorageType.data);
  87. if (rowCount > 0) sheet.setRowCount(rowCount);
  88. sheet.resumeEvent();
  89. sheet.resumePaint();
  90. },
  91. cleanSheet: function(sheet, setting, rowCount) {
  92. sheet.suspendPaint();
  93. sheet.suspendEvent();
  94. sheet.clear(-1, 0, -1, setting.header.length, GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.StorageType.data);
  95. if (rowCount > 0) sheet.setRowCount(rowCount);
  96. sheet.clearSelection();
  97. sheet.resumeEvent();
  98. sheet.resumePaint();
  99. },
  100. setAreaAlign: function(area, hAlign, vAlign){
  101. if (!(hAlign) || hAlign === "left") {
  102. area.hAlign(GC.Spread.Sheets.HorizontalAlign.left);
  103. } else if (hAlign === "right") {
  104. area.hAlign(GC.Spread.Sheets.HorizontalAlign.right);
  105. } else if (hAlign === "center") {
  106. area.hAlign(GC.Spread.Sheets.HorizontalAlign.center);
  107. } else {
  108. area.hAlign(GC.Spread.Sheets.HorizontalAlign.left);
  109. }
  110. if (!(vAlign) || vAlign === "center") {
  111. area.vAlign(GC.Spread.Sheets.VerticalAlign.center);
  112. } else if (vAlign === "top") {
  113. area.vAlign(GC.Spread.Sheets.VerticalAlign.top);
  114. } else if (vAlign === "bottom") {
  115. area.vAlign(GC.Spread.Sheets.VerticalAlign.bottom);
  116. } else {
  117. area.vAlign(GC.Spread.Sheets.VerticalAlign.center);
  118. }
  119. },
  120. showData: function(sheet, setting, data,distTypeTree) {
  121. var me = this, ch = GC.Spread.Sheets.SheetArea.viewport;
  122. sheet.suspendPaint();
  123. sheet.suspendEvent();
  124. //sheet.addRows(row, 1);
  125. sheet.clear(0, 0, sheet.getRowCount(), sheet.getColumnCount(), GC.Spread.Sheets.SheetArea.viewport, GC.Spread.Sheets.StorageType.data);
  126. if(sheet.getRowCount()<data.length){
  127. data.length<30? sheet.setRowCount(30):sheet.setRowCount(data.length);
  128. }else if(sheet.getRowCount()==0){
  129. sheet.setRowCount(30);
  130. }
  131. for (var col = 0; col < setting.header.length; col++) {
  132. var hAlign = "left", vAlign = "center";
  133. if (setting.header[col].hAlign) {
  134. hAlign = setting.header[col].hAlign;
  135. } else if (setting.header[col].dataType !== "String"){
  136. hAlign = "right";
  137. }
  138. vAlign = setting.header[col].vAlign?setting.header[col].vAlign:vAlign;
  139. me.setAreaAlign(sheet.getRange(-1, col, -1, 1), hAlign, vAlign);
  140. if (setting.header[col].formatter) {
  141. sheet.setFormatter(-1, col, setting.header[col].formatter, GC.Spread.Sheets.SheetArea.viewport);
  142. }
  143. if(setting.header[col].cellType === "checkBox"||setting.header[col].cellType === "button"){//clear and reset
  144. var me = this, header = GC.Spread.Sheets.SheetArea.colHeader;
  145. sheet.deleteColumns(col,1);
  146. sheet.addColumns(col, 1);
  147. sheet.setValue(0, col, setting.header[col].headerName, header);
  148. sheet.setColumnWidth(col, setting.header[col].headerWidth?setting.header[col].headerWidth:100);
  149. }
  150. if(setting.header[col].visible === false){
  151. sheet.setColumnVisible(col,false);
  152. }
  153. sheet.getCell(0, col, GC.Spread.Sheets.SheetArea.colHeader).wordWrap(true);
  154. }
  155. for (var row = 0; row < data.length; row++) {
  156. //var cell = sheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport);
  157. this.showRowData(sheet,setting,row,data,distTypeTree);
  158. if(setting.getStyle && setting.getStyle(data[row])){
  159. sheet.setStyle(row, -1, setting.getStyle(data[row]));
  160. }
  161. }
  162. this.lockCells(sheet,setting);
  163. sheet.resumeEvent();
  164. sheet.resumePaint();
  165. //me.shieldAllCells(sheet);
  166. },
  167. showRowData:function (sheet,setting,row,data,distTypeTree=null) {
  168. let ch = GC.Spread.Sheets.SheetArea.viewport;
  169. for (var col = 0; col < setting.header.length; col++) {
  170. //var cell = sheet.getCell(row, col, GC.Spread.Sheets.SheetArea.viewport);
  171. var val = data[row][setting.header[col].dataCode];
  172. if(val&&setting.header[col].dataType === "Number"){
  173. if(setting.header[col].hasOwnProperty('tofix')){
  174. val =scMathUtil.roundToString(val,setting.header[col].tofix);
  175. } else {
  176. val =val+'';
  177. }
  178. }
  179. if(val!=null&&setting.header[col].cellType === "checkBox"){
  180. this.setCheckBoxCell(row,col,sheet,val)
  181. }
  182. if(setting.header[col].cellType === "comboBox"){
  183. this.setComboBox(row,col,sheet,setting.header[col].options,setting.header[col].editorValueType);
  184. }
  185. if(setting.header[col].getText){
  186. val = setting.getText[setting.header[col].getText](data[row],val)
  187. }
  188. sheet.setValue(row, col, val, ch);
  189. }
  190. this.setRowStyle(row,sheet,data[row].bgColour);
  191. if(setting.autoFit==true){
  192. sheet.getRange(row, -1, 1, -1, GC.Spread.Sheets.SheetArea.viewport).wordWrap(true);
  193. sheet.autoFitRow(row);
  194. }
  195. },
  196. setCheckBoxCell(row,col,sheet,val){
  197. var c = new GC.Spread.Sheets.CellTypes.CheckBox();
  198. c.isThreeState(false);
  199. sheet.setCellType(row, col,c,GC.Spread.Sheets.SheetArea.viewport);
  200. sheet.getCell(row, col).value(val);
  201. sheet.getCell(row, col).hAlign(GC.Spread.Sheets.HorizontalAlign.center);
  202. },
  203. setComboBox(row,col,sheet,options,editorValueType){
  204. //let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
  205. let dynamicCombo = sheetCommonObj.getDynamicCombo(true);
  206. if(options){
  207. dynamicCombo.itemHeight(options.length).items(options);
  208. if(editorValueType==true){
  209. dynamicCombo.editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
  210. }
  211. }
  212. sheet.setCellType(row, col,dynamicCombo,GC.Spread.Sheets.SheetArea.viewport);
  213. },
  214. setRowStyle(row,sheet,bgColour) {
  215. if(bgColour){
  216. let style = new GC.Spread.Sheets.Style();
  217. style.backColor = bgColour;
  218. style.borderLeft = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
  219. style.borderTop = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
  220. style.borderRight = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
  221. style.borderBottom = new GC.Spread.Sheets.LineBorder("#D4D4D4", GC.Spread.Sheets.LineStyle.thin);
  222. sheet.setStyle(row, -1, style);
  223. }
  224. },
  225. analyzePasteData: function(setting, pastedInfo) {
  226. var rst = [], propId = pastedInfo.cellRange.col, preStrIdx = 0, itemObj = {};
  227. for (var i = 0; i < pastedInfo.pasteData.text.length; i++) {
  228. if (pastedInfo.pasteData.text[i] === "\n") {
  229. propId = pastedInfo.cellRange.col;
  230. preStrIdx = i + 1;
  231. rst.push(itemObj);
  232. if (i < pastedInfo.pasteData.text.length - 1) {
  233. itemObj = {};
  234. }
  235. } else if (pastedInfo.pasteData.text[i] === "\t" || pastedInfo.pasteData.text[i] === "\r") {
  236. if (setting.header[propId]) {
  237. itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx, i);
  238. }
  239. propId++;
  240. preStrIdx = i + 1;
  241. //if the last copied-cell were empty, should check whether the end of text
  242. if (i == pastedInfo.pasteData.text.length - 1 && setting.header[propId]) {
  243. itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx);
  244. rst.push(itemObj);
  245. }
  246. } else if (i == pastedInfo.pasteData.text.length - 1 && setting.header[propId]) {
  247. itemObj[setting.header[propId].dataCode] = pastedInfo.pasteData.text.slice(preStrIdx);
  248. rst.push(itemObj);
  249. }
  250. }
  251. return rst;
  252. },
  253. combineRowData: function(sheet, setting, row) {
  254. var rst = {};
  255. for (var col = 0; col < setting.header.length; col++) {
  256. rst[setting.header[col].dataCode] = sheet.getValue(row, col);
  257. }
  258. return rst;
  259. },
  260. shieldAllCells: function(sheet) {
  261. sheet.options.isProtected = true;
  262. },
  263. unShieldAllCells: function(sheet) {
  264. sheet.options.isProtected = false;
  265. },
  266. unLockAllCells: function (sheet) {
  267. sheet.suspendPaint();
  268. sheet.suspendEvent();
  269. let defaultStyle = new GC.Spread.Sheets.Style();
  270. defaultStyle.locked = false;
  271. sheet.setDefaultStyle(defaultStyle, GC.Spread.Sheets.SheetArea.viewport);
  272. sheet.setStyle(-1, 0, defaultStyle);
  273. sheet.options.isProtected = false;
  274. sheet.resumePaint();
  275. sheet.resumeEvent();
  276. },
  277. lockAllCells: function (sheet) {
  278. sheet.suspendPaint();
  279. sheet.suspendEvent();
  280. let defaultStyle = new GC.Spread.Sheets.Style();
  281. defaultStyle.locked = true;
  282. sheet.setDefaultStyle(defaultStyle, GC.Spread.Sheets.SheetArea.viewport);
  283. for(let i = 0; i < sheet.getRowCount(); i++){
  284. sheet.setStyle(i, 0, defaultStyle);
  285. }
  286. sheet.options.isProtected = true;
  287. sheet.resumePaint();
  288. sheet.resumeEvent();
  289. },
  290. lockCells: function(sheet, setting){
  291. sheet.suspendPaint();
  292. sheet.suspendEvent();
  293. if (setting && setting.view.lockColumns && setting.view.lockColumns.length > 0) {
  294. sheet.options.isProtected = true;
  295. sheet.getRange(-1, 0, -1, setting.header.length, GC.Spread.Sheets.SheetArea.viewport).locked(false);
  296. for (var i = 0; i < setting.view.lockColumns.length; i++) {
  297. sheet.getRange(-1,setting.view.lockColumns[i] , -1, 1, GC.Spread.Sheets.SheetArea.viewport).locked(true);
  298. }
  299. }
  300. sheet.resumePaint();
  301. sheet.resumeEvent();
  302. },
  303. setLockCol: function (sheet, col, isLocked) {
  304. sheet.suspendPaint();
  305. sheet.suspendEvent();
  306. for(let row = 0, len = sheet.getRowCount(); row < len; row++){
  307. sheet.getCell(row, col).locked(isLocked);
  308. }
  309. sheet.resumePaint();
  310. sheet.resumeEvent();
  311. },
  312. chkIfEmpty: function(rObj, setting) {
  313. var rst = true;
  314. if (rObj) {
  315. for (var i = 0; i < setting.header.length; i++) {
  316. if (rObj[setting.header[i].dataCode]) {
  317. rst = false;
  318. break;
  319. }
  320. }
  321. }
  322. return rst;
  323. },
  324. //add by zhong 2017-10-10
  325. //动态下拉框
  326. getDynamicCombo: function () {
  327. let ComboCellForActiveCell = function () { };
  328. ComboCellForActiveCell.prototype = new GC.Spread.Sheets.CellTypes.ComboBox();
  329. ComboCellForActiveCell.prototype.paintValue = function (ctx, value, x, y, w, h, style, options) {
  330. let sheet = options.sheet;
  331. if (options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
  332. GC.Spread.Sheets.CellTypes.ComboBox.prototype.paintValue.apply(this, arguments);
  333. } else {
  334. GC.Spread.Sheets.CellTypes.Base.prototype.paintValue.apply(this, arguments);
  335. }
  336. };
  337. ComboCellForActiveCell.prototype.getHitInfo = function (x, y, cellStyle, cellRect, options) {
  338. let sheet = options.sheet;
  339. if (options.row === sheet.getActiveRowIndex() && options.col === sheet.getActiveColumnIndex()) {
  340. return GC.Spread.Sheets.CellTypes.ComboBox.prototype.getHitInfo.apply(this, arguments);
  341. } else {
  342. return GC.Spread.Sheets.CellTypes.Base.prototype.getHitInfo.apply(this, arguments);
  343. }
  344. };
  345. return new ComboCellForActiveCell();
  346. },
  347. setDynamicCombo: function (sheet, beginRow, col, rowCount, items, itemsHeight, itemsType) {
  348. let me = this;
  349. sheet.suspendPaint();
  350. let combo = me.getDynamicCombo();
  351. if(itemsHeight) {
  352. combo.itemHeight(itemsHeight);
  353. combo._maxDropDownItems = itemsHeight + 5;
  354. }
  355. if(itemsType === 'value') combo.items(items).editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
  356. else if(itemsType === 'text') combo.items(items).editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text);
  357. else combo.items(items);
  358. for(let i = 0, len = rowCount; i < len; i++){
  359. sheet.getCell(beginRow + i, col).cellType(combo);
  360. }
  361. sheet.resumePaint();
  362. },
  363. setStaticCombo: function (sheet, beginRow, col, rowCount, items, itemsHeight, itemsType) {
  364. sheet.suspendPaint();
  365. let combo = new GC.Spread.Sheets.CellTypes.ComboBox();
  366. for(let i = 0, len = rowCount; i < len; i++){
  367. if(itemsHeight) combo.itemHeight(itemsHeight);
  368. if(itemsType === 'value') combo.items(items).editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.value);
  369. else if(itemsType === 'text') combo.items(items).editorValueType(GC.Spread.Sheets.CellTypes.EditorValueType.text);
  370. else combo.items(items);
  371. sheet.getCell(beginRow + i, col).cellType(combo);
  372. }
  373. sheet.resumePaint();
  374. },
  375. //注册自定义回车键事件
  376. bindEnterKey: function (workBook, operation) {
  377. workBook.commandManager().register('myEnter', operation);
  378. workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.enter, false, false, false, false);
  379. workBook.commandManager().setShortcutKey('myEnter', GC.Spread.Commands.Key.enter, false, false, false, false);
  380. },
  381. //解决esc后触发了编辑结束的保存事件,显示与实际数据不同问题
  382. bindEscKey: function (workBook, sheets) {
  383. function isDef(v){
  384. return typeof v !== 'undefined' && v !== null;
  385. }
  386. workBook.commandManager().register('myEsc', function () {
  387. let activeSheet = workBook.getActiveSheet();
  388. let hasTheSheet = false;
  389. for(let sheetObj of sheets){
  390. let sheet = sheetObj.sheet;
  391. if(sheet === activeSheet){
  392. hasTheSheet = true;
  393. let editStarting = sheetObj.editStarting;
  394. let editEnded = sheetObj.editEnded;
  395. if(editStarting){
  396. sheet.unbind(GC.Spread.Sheets.Events.EditStarting);
  397. }
  398. if(editEnded){
  399. sheet.unbind(GC.Spread.Sheets.Events.EditEnded);
  400. }
  401. let row = sheet.getActiveRowIndex();
  402. let col = sheet.getActiveColumnIndex();
  403. let orgV = sheet.getValue(row, col);
  404. if(!isDef(orgV)){
  405. orgV = '';
  406. }
  407. if(sheet.isEditing()){
  408. sheet.endEdit();
  409. sheet.setValue(row, col, orgV);
  410. }
  411. if(editStarting){
  412. sheet.bind(GC.Spread.Sheets.Events.EditStarting, editStarting);
  413. }
  414. if(editEnded){
  415. sheet.bind(GC.Spread.Sheets.Events.EditEnded, editEnded);
  416. }
  417. }
  418. }
  419. //容错处理,以防没把所有工作簿的表格信息传入参数
  420. if(!hasTheSheet){
  421. if(activeSheet.isEditing()){
  422. activeSheet.endEdit();
  423. }
  424. }
  425. });
  426. workBook.commandManager().setShortcutKey(null, GC.Spread.Commands.Key.esc, false, false, false, false);
  427. workBook.commandManager().setShortcutKey('myEsc', GC.Spread.Commands.Key.esc, false, false, false, false);
  428. },
  429. //生成列字段与列号映射
  430. initColMapping: function (obj, headers) {
  431. //colToField 列下标与列字段映射
  432. //fieldToCol 列字段与列下标映射
  433. let colMapping = {colToField: {}, fieldToCol: {}};
  434. for(let header of headers){
  435. colMapping['colToField'][headers.indexOf(header)] = header.dataCode;
  436. colMapping['fieldToCol'][header.dataCode] = headers.indexOf(header);
  437. }
  438. console.log(colMapping);
  439. obj.colMapping = colMapping
  440. },
  441. //动态根据工作簿宽度和各列宽度比例设置宽度
  442. setColumnWidthByRate: function (workBookWidth, workBook, headers){
  443. if(workBook){
  444. const sheet = workBook.getActiveSheet();
  445. sheet.suspendEvent();
  446. sheet.suspendPaint();
  447. for(let col = 0; col < headers.length; col++){
  448. if(headers[col]['rateWidth'] !== undefined && headers[col]['rateWidth'] !== null && headers[col]['rateWidth'] !== ''){
  449. sheet.setColumnWidth(col, workBookWidth * headers[col]['rateWidth'], GC.Spread.Sheets.SheetArea.colHeader)
  450. }
  451. else {
  452. if(headers[col]['headerWidth'] !== undefined && headers[col]['headerWidth'] !== null && headers[col]['headerWidth'] !== ''){
  453. sheet.setColumnWidth(col, headers[col]['headerWidth'], GC.Spread.Sheets.SheetArea.colHeader)
  454. }
  455. }
  456. }
  457. sheet.resumeEvent();
  458. sheet.resumePaint();
  459. }
  460. },
  461. }