| | |
| | | keyboardConfig:{ |
| | | isArrow: true, |
| | | isDel: true, |
| | | isEnter: true, |
| | | isTab: true, |
| | | isEdit: true, |
| | | isChecked: true, |
| | | enterToTab:true |
| | | // enterToTab:true, |
| | | //isEnter: true, |
| | | }, |
| | | |
| | | customConfig: { |
| | |
| | | |
| | | }) |
| | | |
| | | const editClosedEvent = ({ row, column,rowIndex}) => { |
| | | const editClosedEvent = ({ row, column,rowIndex,columnIndex}) => { |
| | | const $table = props.OrderDetail |
| | | let checkVal = row[column.property]*1 |
| | | const oldVal = $table.getTableData().fullData[rowIndex][column.property]*1 |
| | | if(checkVal!==oldVal){ |
| | | row[column.property]=null |
| | | } |
| | | } |
| | | |
| | | const handleKeyDown = (evnt) =>{ |
| | | const length = xGrid.value.getTableData().fullData.length |
| | | if(evnt.$event.keyCode === 13 ){ |
| | | const { rowIndex,row,column } = xGrid.value.getSelectedCell() || xGrid.value.getEditRecord() |
| | | let nextRowIndex = xGrid.value.getRowIndex(row) + 1 |
| | | |
| | | |
| | | switch (column.field){ |
| | | case 'width': |
| | | xGrid.value.setSelectCell(row, 'height') |
| | | break; |
| | | case 'height': |
| | | xGrid.value.setSelectCell(row, 'quantity') |
| | | break; |
| | | case 'quantity': |
| | | if(nextRowIndex === length){ |
| | | return |
| | | } |
| | | const nextRow = xGrid.value.getTableData().fullData[nextRowIndex] |
| | | xGrid.value.setCurrentRow(nextRow) |
| | | xGrid.value.scrollToRow(nextRow) |
| | | xGrid.value.setSelectCell(nextRow, 'width') |
| | | break; |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | </script> |
| | |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | @edit-closed="editClosedEvent" |
| | | @keydown="handleKeyDown" |
| | | > |
| | | </vxe-grid> |
| | | </div> |