浏览代码

版本信息新增页面修改说明

liucf 6 年之前
父节点
当前提交
b2482e7da6
共有 1 个文件被更改,包括 12 次插入4 次删除
  1. 12 4
      src/components/icss/VersionDesc.vue

+ 12 - 4
src/components/icss/VersionDesc.vue

@@ -28,7 +28,7 @@
         <el-table-column v-if="isFirst"
                 label="操作">
             <template slot-scope="scope">
-                <el-button type="text" size="small" @click="toEditDesc(scope.row)">修改</el-button>
+                <el-button type="text" size="small" @click="toEditDesc(scope.row,scope.$index)">修改</el-button>
                 <span style="margin:0 3px;">|</span>
                 <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.id)">删除</el-button>
             </template>
@@ -115,7 +115,8 @@
         showBox:false,
         modiId:null,
         showDesc:false,
-        tip:true
+        tip:true,
+        modiIndex:null
       }
     },
     created(){
@@ -151,12 +152,13 @@
       indexMethod(index) {
         return index + 1;
       },
-      toEditDesc(item){//修改备注
+      toEditDesc(item,index){//修改备注
         this.minTitle='修改说明';
         this.showBox = true;
         this.form.title = item.title;
         this.form.description = item.description;
         this.modiId = item.id;
+        this.modiIndex = index;
       },
       addDesc(){//添加备注
         this.minTitle='添加说明';
@@ -243,7 +245,12 @@
                   }
                 })
               }else{//仅添加到本地list
-                this.list.push(item);
+                if(this.modiIndex !==null){
+                  this.list[this.modiIndex].description = this.form.description;
+                  this.list[this.modiIndex].title = this.form.title;
+                }else{
+                  this.list.push(item);
+                }
                 this.$emit('func',this.list);
                 this.reset();
               } 
@@ -263,6 +270,7 @@
         this.modiId = null;
         this.minTitle= "";
         this.tip = true;
+        this.modiIndex = null;
       },
       cancel(){
         this.reset();