Преглед на файлове

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

liucf преди 6 години
родител
ревизия
cac2740c1f
променени са 1 файла, в които са добавени 15 реда и са изтрити 7 реда
  1. 15 7
      src/components/icss/VersionDesc.vue

+ 15 - 7
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>
@@ -54,7 +54,7 @@
           </el-form-item>
           <el-form-item label="内容:" prop="description" class="discDesc">
             <p v-if="showDesc" v-html="form.description" class="cont">{{form.description}}</p>
-            <el-input v-else type="textarea" :rows="3" placeholder="请输入内容" v-model="form.description" maxlength="120" @keydown.native="contentInp"></el-input>
+            <el-input v-else type="textarea" :rows="3" placeholder="请输入内容" v-model="form.description" maxlength="500" @keydown.native="contentInp"></el-input>
           </el-form-item>
           <el-button class="disclButn1" size="small" type="primary" @click="comfirn('form')">确定</el-button>
           <!-- <el-button class="disclButn can" size="small" type="primary" @click="cancel">取消</el-button> -->
@@ -85,8 +85,8 @@
         if(!value){
           return callback(new Error('请输入标题'));
         }
-        if (value.length >= 120) {
-           this.form.description = value.substr(0, 120);
+        if (value.length >= 500) {
+           this.form.description = value.substr(0, 500);
            this.$message({
              showClose: true,
              type: 'warning',
@@ -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();