From 4740daf677f4564a6ef650b5be2f76b32097710a Mon Sep 17 00:00:00 2001
From: bibi <541660090@qq.com>
Date: Thu, 3 Mar 2022 16:51:50 +0800
Subject: [PATCH] 1
---
.../EstateInfo/_houseManage/depend/form.vue | 1 +
.../Operation/Announcement/depend/form.vue | 15 ++++-
src/views/Operation/clientSet/index.vue | 64 +++++++++----------
3 files changed, 45 insertions(+), 35 deletions(-)
diff --git a/src/views/Basic/EstateInfo/_houseManage/depend/form.vue b/src/views/Basic/EstateInfo/_houseManage/depend/form.vue
index 99113ee..6b0f540 100644
--- a/src/views/Basic/EstateInfo/_houseManage/depend/form.vue
+++ b/src/views/Basic/EstateInfo/_houseManage/depend/form.vue
@@ -280,6 +280,7 @@ export default {
},
close(){
this.$refs.ruleForm.resetFields();
+ this.fileList = []
this.formType = 'add'
},
handleCancel() {
diff --git a/src/views/Operation/Announcement/depend/form.vue b/src/views/Operation/Announcement/depend/form.vue
index 96d6379..31783cf 100644
--- a/src/views/Operation/Announcement/depend/form.vue
+++ b/src/views/Operation/Announcement/depend/form.vue
@@ -131,6 +131,7 @@ export default {
},
submit() {
console.log(this.documentList);
+ // 附件
let arr = [];
for (let k of this.documentList) {
if (k.response) {
@@ -140,6 +141,16 @@ export default {
}
}
this.form.annexUrls = arr;
+ // 封面图
+ let pic = [];
+ for (let k of this.fileList) {
+ if (k.response) {
+ pic.push(k.response.data);
+ } else {
+ pic.push(k.url.split("/")[k.url.split("/").length - 1]);
+ }
+ }
+ this.form.coverImgUrls = pic;
console.log(this.form);
this.$refs.ruleForm.validate(async (valid) => {
if (valid) {
@@ -208,7 +219,7 @@ export default {
}
this.fileList = pic;
} else {
- this.form.coverImgList = [];
+ this.form.coverImgUrls = [];
}
if (res.data.annexImgList.length > 0) {
console.log(res.data.annexImgList);
@@ -225,7 +236,7 @@ export default {
}
this.documentList = file;
} else {
- this.form.coverImgList = [];
+ this.form.annexUrls = [];
}
});
} else {
diff --git a/src/views/Operation/clientSet/index.vue b/src/views/Operation/clientSet/index.vue
index 81cc94a..d7fc0c0 100644
--- a/src/views/Operation/clientSet/index.vue
+++ b/src/views/Operation/clientSet/index.vue
@@ -5,25 +5,23 @@
添加轮播图
+
×
-
-
- 上传图片尺寸: 750*300
-
+
- 暂无图片
+ 暂无图片
@@ -43,7 +41,7 @@
-
+
-
@@ -166,6 +164,28 @@ export default {
title: "添加轮播图",
};
},
+ // 保存
+ async saveSetting() {
+ if (this.add.title === "添加轮播图") {
+ let res = await swiperInsert(this.form);
+ if (res.code === 200) {
+ this.$message.success(res.msg);
+ this.newSwiperClose();
+ this.getData();
+ } else {
+ this.$message.error(res.msg);
+ }
+ } else if (this.add.title === "修改轮播图") {
+ let res = await swiperUpdate(this.form);
+ if (res.code === 200) {
+ this.$message.success(res.msg);
+ this.getData();
+ this.newSwiperClose();
+ } else {
+ this.$message.error(res.msg);
+ }
+ }
+ },
// 编辑
edit(data) {
this.add = {
@@ -214,33 +234,11 @@ export default {
};
},
// 选择链接确定
- submit(data, customizeUrl) {
+ submitURL(data, customizeUrl) {
this.form.customizeUrl = customizeUrl;
this.form.associationId = data[0];
this.close();
},
- // 保存
- async saveSetting() {
- if (this.add.title === "添加轮播图") {
- let res = await swiperInsert(this.form);
- if (res.code === 200) {
- this.$message.success(res.msg);
- this.getData();
- this.newSwiperClose();
- } else {
- this.$message.error(res.msg);
- }
- } else if (this.add.title === "修改轮播图") {
- let res = await swiperUpdate(this.form);
- if (res.code === 200) {
- this.$message.success(res.msg);
- this.getData();
- this.newSwiperClose();
- } else {
- this.$message.error(res.msg);
- }
- }
- },
// 关闭选择
close() {
this.table.show = false;
@@ -294,7 +292,7 @@ export default {
height: 200px;
}
.list-img {
- width: 90%;
+ width: 300px;
height: 200px;
}
.card-close {