界面优化
This commit is contained in:
@@ -40,8 +40,9 @@
|
||||
<el-table-column label="讨论内容" align="center" prop="content" />
|
||||
<el-table-column label="事件图片" align="center" prop="images">
|
||||
<template slot-scope="scope">
|
||||
<el-image style="" :src="scope.row.images.split(',')[0]"
|
||||
:preview-src-list="scope.row.images.split(',')">
|
||||
<el-image
|
||||
v-if="scope.row.images[0] != null"
|
||||
:src="scope.row.images[0]" :preview-src-list="scope.row.images">
|
||||
</el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
@@ -254,6 +255,7 @@ export default {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
this.judgePictureExists();
|
||||
// 修改的提交
|
||||
if (this.form.id != null) {
|
||||
updateDiscuss(this.form).then(response => {
|
||||
@@ -271,6 +273,24 @@ export default {
|
||||
});
|
||||
});
|
||||
},
|
||||
/*判断图片是否存在*/
|
||||
judgePictureExists(){
|
||||
if (this.form.id != null) {
|
||||
if (this.form.images == "") {
|
||||
this.form.images = [];
|
||||
}else{
|
||||
let imagesType = typeof(this.form.images);
|
||||
if (imagesType == "string") {
|
||||
let imgArr = this.form.images.split(",")
|
||||
this.form.images = imgArr;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (this.form.images == undefined || this.form.images =="") {
|
||||
this.form.images = [];
|
||||
}
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
|
||||
Reference in New Issue
Block a user