chenlu
2024-08-27 5df5dba2a321098fd0fc7e18b71549f5c2312049
north-glass-erp/northglass-erp/src/components/sd/order/OrderCraftDetail.vue
@@ -20,7 +20,15 @@
  exportConfig: {},
  scrollY:{ enabled: true,gt:13 },//开启虚拟滚动
  //scrollX:{ enabled: true,gt:15 },//开启虚拟滚动
  mouseConfig:{selected: true},//鼠标选中
  keyboardConfig:{
    isArrow: true,
    isDel: true,
    isEnter: true,
    isTab: true,
    isEdit: true,
    isChecked: true
  },
  columnConfig: {
    resizable: true,
    useKey: true
@@ -73,6 +81,24 @@
    xGrid.value.reloadData(res.data)
  })
})
const handleKeyDown = (evnt) =>{
  if(evnt.$event.keyCode === 38 ){
    let nextRowIndex = xGrid.value.getRowIndex(xGrid.value.getCurrentRecord()) - 1;
    if (nextRowIndex < xGrid.value.getTableData().fullData.length && nextRowIndex>=0) {
      xGrid.value.setCurrentRow(xGrid.value.getTableData().fullData[nextRowIndex]);
    }
  }
  if(evnt.$event.keyCode === 40 ){
    let nextRowIndex = xGrid.value.getRowIndex(xGrid.value.getCurrentRecord()) + 1;
    if (nextRowIndex < xGrid.value.getTableData().fullData.length) {
      xGrid.value.setCurrentRow(xGrid.value.getTableData().fullData[nextRowIndex]);
    }
  }
}
</script>
<template>
@@ -83,6 +109,7 @@
        class="mytable-scrollbar"
        ref="xGrid"
        v-bind="gridOptions"
        @keydown="handleKeyDown"
    >
      <template #num1_filter="{ column, $panel }">
        <div>