|
@@ -299,11 +299,12 @@ export default {
|
|
|
const maxLen = this.form.programList.length;
|
|
|
|
|
|
if (isNaN(newValue) || newValue === null || newValue === undefined) {
|
|
|
+ this.currentEditIndex = -1;
|
|
|
console.log('序号未修改:', newValue);
|
|
|
return;
|
|
|
}
|
|
|
if (newValue < 1) {
|
|
|
- this.$message.warning('序号必须大于0');
|
|
|
+ this.$message.warning('序号必须大于1');
|
|
|
this.currentEditIndex = -1;
|
|
|
|
|
|
return;
|
|
@@ -324,15 +325,13 @@ export default {
|
|
|
// 计算目标下标
|
|
|
const targetIndex = newValue - 1;
|
|
|
if (targetIndex === index) {
|
|
|
- // this.currentEditIndex = -1;
|
|
|
+ this.currentEditIndex = -1;
|
|
|
return;
|
|
|
}
|
|
|
// 交换两个元素
|
|
|
// ...existing code...
|
|
|
- // 插入到目标位置,原本序号顺延
|
|
|
const movingItem = this.form.programList.splice(index, 1)[0];
|
|
|
this.form.programList.splice(targetIndex, 0, movingItem);
|
|
|
- // ...existing code...
|
|
|
this.currentEditIndex = -1;
|
|
|
this.$message.success("操作成功!");
|
|
|
|