界面优化

This commit is contained in:
小久哥
2022-06-02 17:43:11 +08:00
parent c2ec849d83
commit 3c55a8a754
7 changed files with 195 additions and 85 deletions
+22 -2
View File
@@ -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;