| | |
| | | <!-- 文本描述 --> |
| | | <div id="caption"></div> |
| | | </div> |
| | | <div id="tableTip" class="tableTip"> |
| | | 11111111 |
| | | </div> |
| | | </div> |
| | |
| | | "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); |
| | | }, |
| | | |
| | |
| | | width: 100%; |
| | | } |
| | | } |
| | | |
| | | /**提示**/ |
| | | .tableTip { |
| | | display: none; |
| | | background-color: rgb(0 0 0 / 61%); |
| | | padding: 5px; |
| | | border: 1px solid #000; |
| | | position: absolute; |
| | | z-index: 10 !important; |
| | | border-radius: 5px; |
| | | height: 25px; |
| | | color: white; |
| | | font-size: 16px; |
| | | line-height: 25px; |
| | | } |