| | |
| | | "dojo/topic", |
| | | 'jimu/BaseWidget', |
| | | 'dojo/on', |
| | | 'dojo/mouse', |
| | | 'dstore/Memory', |
| | | 'dstore/Trackable', |
| | | 'dgrid/Grid', |
| | |
| | | 'dgrid/test/data/createSyncStore', |
| | | "libs/echarts/v4/echarts.min", |
| | | 'libs/layer/layer.js', |
| | | 'libs/turf/turf.min.js'], function (declare, lang, array, html, topic, BaseWidget, on, Memory, Trackable, Grid, Keyboard, Selection,Editor, RequestMemory, createSyncStore, echarts, layer, turf) { |
| | | 'libs/turf/turf.min.js'], function (declare, lang, array, html, topic, BaseWidget, on,mouse, Memory, Trackable, Grid, Keyboard, Selection,Editor, RequestMemory, createSyncStore, echarts, layer, turf) { |
| | | return declare([BaseWidget], { |
| | | baseClass: 'jimu-widget-FloodAnalysis', |
| | | name: 'FloodAnalysis', |
| | |
| | | // let data = evt.cell.row.data |
| | | // }); |
| | | |
| | | function makeHandler (grid, type, dir) { |
| | | return function (event) { |
| | | let tip = $('#tableTip') |
| | | var obj = grid[type](event) |
| | | |
| | | if (dir == 'entered' && obj.column.field == 'location' ){ |
| | | tip.show() |
| | | tip.css({ |
| | | "top":(194+(Number(obj.row.id)*24.5))+'px', |
| | | // "left":event.offsetX+10+'px' |
| | | }) |
| | | tip.html(obj.row.data.location) |
| | | }else if (dir == 'left'){ |
| | | tip.hide() |
| | | } |
| | | }; |
| | | } |
| | | |
| | | grid.on(on.selector('.dgrid-content .dgrid-cell', mouse.enter), makeHandler(grid, 'cell', 'entered')); |
| | | grid.on(on.selector('.dgrid-content .dgrid-cell', mouse.leave), makeHandler(grid, 'cell', 'left')); |
| | | |
| | | //防止绑定多次点击事件 |
| | | if (this.dgridSelectEvent){ |
| | | this.dgridSelectEvent.remove() |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | grid.renderArray(dataList); |
| | | }, |
| | | |