|
@@ -28,7 +28,7 @@
|
|
<el-table-column v-if="isFirst"
|
|
<el-table-column v-if="isFirst"
|
|
label="操作">
|
|
label="操作">
|
|
<template slot-scope="scope">
|
|
<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>
|
|
<span style="margin:0 3px;">|</span>
|
|
<el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.id)">删除</el-button>
|
|
<el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row.id)">删除</el-button>
|
|
</template>
|
|
</template>
|
|
@@ -54,7 +54,7 @@
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="内容:" prop="description" class="discDesc">
|
|
<el-form-item label="内容:" prop="description" class="discDesc">
|
|
<p v-if="showDesc" v-html="form.description" class="cont">{{form.description}}</p>
|
|
<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-form-item>
|
|
<el-button class="disclButn1" size="small" type="primary" @click="comfirn('form')">确定</el-button>
|
|
<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> -->
|
|
<!-- <el-button class="disclButn can" size="small" type="primary" @click="cancel">取消</el-button> -->
|
|
@@ -85,8 +85,8 @@
|
|
if(!value){
|
|
if(!value){
|
|
return callback(new Error('请输入标题'));
|
|
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({
|
|
this.$message({
|
|
showClose: true,
|
|
showClose: true,
|
|
type: 'warning',
|
|
type: 'warning',
|
|
@@ -115,7 +115,8 @@
|
|
showBox:false,
|
|
showBox:false,
|
|
modiId:null,
|
|
modiId:null,
|
|
showDesc:false,
|
|
showDesc:false,
|
|
- tip:true
|
|
|
|
|
|
+ tip:true,
|
|
|
|
+ modiIndex:null
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
@@ -151,12 +152,13 @@
|
|
indexMethod(index) {
|
|
indexMethod(index) {
|
|
return index + 1;
|
|
return index + 1;
|
|
},
|
|
},
|
|
- toEditDesc(item){//修改备注
|
|
|
|
|
|
+ toEditDesc(item,index){//修改备注
|
|
this.minTitle='修改说明';
|
|
this.minTitle='修改说明';
|
|
this.showBox = true;
|
|
this.showBox = true;
|
|
this.form.title = item.title;
|
|
this.form.title = item.title;
|
|
this.form.description = item.description;
|
|
this.form.description = item.description;
|
|
this.modiId = item.id;
|
|
this.modiId = item.id;
|
|
|
|
+ this.modiIndex = index;
|
|
},
|
|
},
|
|
addDesc(){//添加备注
|
|
addDesc(){//添加备注
|
|
this.minTitle='添加说明';
|
|
this.minTitle='添加说明';
|
|
@@ -243,7 +245,12 @@
|
|
}
|
|
}
|
|
})
|
|
})
|
|
}else{//仅添加到本地list
|
|
}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.$emit('func',this.list);
|
|
this.reset();
|
|
this.reset();
|
|
}
|
|
}
|
|
@@ -263,6 +270,7 @@
|
|
this.modiId = null;
|
|
this.modiId = null;
|
|
this.minTitle= "";
|
|
this.minTitle= "";
|
|
this.tip = true;
|
|
this.tip = true;
|
|
|
|
+ this.modiIndex = null;
|
|
},
|
|
},
|
|
cancel(){
|
|
cancel(){
|
|
this.reset();
|
|
this.reset();
|