入表功调整
Showing
1 changed file
with
2 additions
and
3 deletions
| ... | @@ -427,8 +427,7 @@ const inputEventChange = (val, scope, field) => { | ... | @@ -427,8 +427,7 @@ const inputEventChange = (val, scope, field) => { |
| 427 | } | 427 | } |
| 428 | 428 | ||
| 429 | // 重命名 | 429 | // 重命名 |
| 430 | const setName = (name, level) => { | 430 | const setName = (name, level, rIndex) => { |
| 431 | const rIndex = currentRow.value.$index; | ||
| 432 | let rowData = tableData.value[rIndex]; | 431 | let rowData = tableData.value[rIndex]; |
| 433 | rowData[`name${level}`] = name; | 432 | rowData[`name${level}`] = name; |
| 434 | } | 433 | } |
| ... | @@ -516,7 +515,7 @@ const btnClick = async (btn, bType = null) => { | ... | @@ -516,7 +515,7 @@ const btnClick = async (btn, bType = null) => { |
| 516 | const name = value.trim(); | 515 | const name = value.trim(); |
| 517 | if (type == 'edit') { | 516 | if (type == 'edit') { |
| 518 | if (value == inputVal) return | 517 | if (value == inputVal) return |
| 519 | setName(name, level); | 518 | setName(name, level, rIndex); |
| 520 | } else if (type == 'add-same') { | 519 | } else if (type == 'add-same') { |
| 521 | const tData = rowList.at(-1); | 520 | const tData = rowList.at(-1); |
| 522 | const tIndex = tableData.value.findIndex(t => (tData.code4 ? t.code4 === tData.code4 : t.code3 === tData.code3)); | 521 | const tIndex = tableData.value.findIndex(t => (tData.code4 ? t.code4 === tData.code4 : t.code3 === tData.code3)); | ... | ... |
-
Please register or sign in to post a comment