|
|
@@ -93,7 +93,7 @@
|
|
|
<el-table-column label="工单编号" width="120">
|
|
|
<template #default="{ row, $index }">
|
|
|
<el-input v-model="row.sczl_gdbh" placeholder="Enter回车"
|
|
|
- @keydown="handleEnter($event,$index, row)" @keyup="movefous3($event,row)" />
|
|
|
+ @keydown="handleEnter($event,$index, row)" @keyup="moveFocus3($event,$index,row)" />
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
@@ -151,7 +151,7 @@
|
|
|
<el-table-column label="来源" width="95">
|
|
|
<template #default="{ row }">
|
|
|
<el-input v-model="row.sczl_Jtbh1"
|
|
|
- @keyup ="movefous2($event,row)"/>
|
|
|
+ @keyup="moveFocus"/>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
|
|
|
@@ -1427,17 +1427,31 @@ const SelectClickBz = (row, column, event) => {
|
|
|
row.sczl_dedh = ""
|
|
|
}
|
|
|
}
|
|
|
- const movefous3 = (event,row,index)=>{
|
|
|
- console.log(3333)
|
|
|
- if (event.key === "Enter"){
|
|
|
- const index2 = Array.from(formElements).indexOf(event.target)
|
|
|
- event.stopPropagation();
|
|
|
- formElements[index2+1].focus();
|
|
|
- formElements[index2+1].select();
|
|
|
- }else{
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
+ const moveFocus3 = (event, index, formElements) => {
|
|
|
+ const key = event.key; // 获取当前按下的键
|
|
|
+
|
|
|
+ console.log("当前按下的键:", key);
|
|
|
+
|
|
|
+ if (key === 'ArrowRight') {
|
|
|
+ // 右方向键:将焦点移到下一个元素
|
|
|
+ if (index + 1 < formElements.length) {
|
|
|
+ formElements[index + 1].focus();
|
|
|
+ formElements[index + 1].select();
|
|
|
+ }
|
|
|
+ } else if (key === 'ArrowLeft') {
|
|
|
+ // 左方向键:将焦点移到上一个元素
|
|
|
+ if (index - 1 >= 0) {
|
|
|
+ formElements[index - 1].focus();
|
|
|
+ formElements[index - 1].select();
|
|
|
+ }
|
|
|
+ } else if (key === 'Enter') {
|
|
|
+ event.stopPropagation();
|
|
|
+ formElements[index2-2].focus();
|
|
|
+ formElements[index2-2].select();
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
|
|
|
</script>
|
|
|
|