| | |
| | | resizable: true, |
| | | useKey: true |
| | | }, |
| | | mouseConfig:{selected: true}, |
| | | filterConfig: { //筛选配置项 |
| | | // remote: true |
| | | }, |
| | |
| | | storage: true |
| | | }, |
| | | editConfig: { |
| | | trigger: 'click', |
| | | mode: 'row', |
| | | trigger: 'dblclick', |
| | | mode: 'cell', |
| | | showStatus: true |
| | | },//表头参数 |
| | | columns:[ |
| | |
| | | { code: 'copyAll', name: t('basicData.sameAfterwards'), prefixIcon: 'vxe-icon-feedback', visible: true, disabled: false }, |
| | | { code: 'clearChecked', name: t('basicData.clearSelection'), prefixIcon: 'vxe-icon-indicator', visible: true, disabled: false }, |
| | | { code: 'computedSize', name: '科学计数', prefixIcon: 'vxe-icon-chart-line', visible: true, disabled: false }, |
| | | { code: 'paste', name: '粘贴', prefixIcon: 'vxe-icon-paste', visible: true, disabled: false }, |
| | | ] |
| | | ] |
| | | } |
| | |
| | | } |
| | | } |
| | | }, |
| | | menuClick ({ menu, row, column }) { |
| | | async menuClick ({ menu, row, column }) { |
| | | const $grid = xGrid.value |
| | | if ($grid) { |
| | | switch (menu.code) { |
| | |
| | | } |
| | | break |
| | | } |
| | | case 'paste' :{ |
| | | if(xGrid.value.getSelectedCell()===null){ |
| | | return |
| | | } |
| | | if(xGrid.value.getSelectedCell().column.editRender===undefined){ |
| | | return |
| | | } |
| | | let text = (await navigator.clipboard.readText()) |
| | | text = text.split('\r\n') |
| | | text = text.slice(0, text.length - 1) |
| | | console.log(text) |
| | | if(text===null){ |
| | | return |
| | | } |
| | | const flag = xGrid.value.getSelectedCell()['_rowIndex'] |
| | | const column =xGrid.value.getSelectedCell().column.field |
| | | let i = 0 |
| | | xGrid.value.getTableData().visibleData.forEach((item,index)=>{ |
| | | if(index>=flag){ |
| | | item[column] = text[i] |
| | | i+=1 |
| | | } |
| | | }) |
| | | |
| | | |
| | | break |
| | | } |
| | | } |
| | | } |
| | | } |