Sfoglia il codice sorgente

feature:修改音乐专辑只有一个的修改序号问题

zeng.chen 1 mese fa
parent
commit
53437da790
1 ha cambiato i file con 3 aggiunte e 4 eliminazioni
  1. 3 4
      src/views/music/album/detail.vue

+ 3 - 4
src/views/music/album/detail.vue

@@ -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("操作成功!");