Commit db30ea86 by Cat

zd 社团

parent 9ef267a4
......@@ -69,9 +69,9 @@
<template slot-scope="scope">
<el-image
v-for="(item, index) in scope.row.file.split(',')"
:key="index.id"
:key="index"
style="width: 100px; height: 100px"
:src="item"
:src="pev + item"
:preview-src-list="[pev + item]"
>
</el-image>
......@@ -222,12 +222,11 @@
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<!-- <img v-if="form.file" :src="form.file" class="avatar" /> -->
<div v-if="form.file">
<div v-if="form.file.length > 0">
<img
v-for="(item, img) in form.file"
:key="img.id"
:src="item"
v-for="(item, index) in form.file"
:key="index"
:src="pev + form.file"
class="avatar"
/>
</div>
......@@ -265,9 +264,8 @@ export default {
data() {
return {
//图片上传列表
uploadList: {},
uploadList: [],
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
pev: process.env.VUE_APP_BASE_API,
// 输入框字数限制
TEXT_SIZE,
......@@ -324,8 +322,8 @@ export default {
fzr: "",
id: "",
orgName: this.$route.query.name,
file: "",
remark: "",
file: [],
},
// 表单校验
rules: {
......@@ -401,7 +399,7 @@ export default {
};
getClubInfo(params).then((response) => {
this.picList = response.rows;
this.picList.file = response.rows.file;
// this.picList.file = response.rows.file;
this.total = response.total;
this.loading = false;
});
......@@ -430,6 +428,7 @@ export default {
picUrl: null,
seqencing: null,
isShow: 0,
file: [],
};
this.imageUrl = "";
this.resetForm("form");
......@@ -455,6 +454,7 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.uploadList = [];
this.check = false;
this.reset();
this.open = true;
this.title = "新增社团活动记录";
......@@ -467,10 +467,6 @@ export default {
this.uploadList = [];
this.form.file = [];
this.form.orgName = this.$route.query.name;
console.log(
this.form.orgName,
"this.form.orgName = this.$route.query.name;"
);
listClubInfo(ids).then((response) => {
this.form = response.data;
this.form.file = response.data.file.split(",");
......@@ -495,17 +491,17 @@ export default {
},
// 上传成功回调
handleAvatarSuccess(res, file) {
console.log("response上传成功回调", res);
console.log("file上传成功回调", file);
if (res.code == 200) {
this.uploadList.push(this.pev + res.fileName);
this.uploadList.push(res.fileName);
this.form.file = this.uploadList;
console.log("this.form.file5555", this.form.file);
}
console.log(this.pev, "this.uploadList111111");
console.log(res.fileName, "res.fileName");
console.log(this.form.file, "this.form.file");
// this.imageUrl = res.data.url;
// console.log(file);
// this.commonUpload(file);
console.log(this.uploadList, "this.uploadList11111111");
console.log(this.form.file, "this.form.file2222222222");
console.log(this.pev, "this.pev33333333");
console.log(res.fileName, "res.fileName444444");
},
// 上传前格式和图片大小限制
beforeAvatarUpload(file) {
......@@ -527,25 +523,6 @@ export default {
handleRemove(file, fileList) {
this.imageUrl = "";
},
// 上传图片
// uploadImage(file) {
// const fileData = file.file;
// const formData = new FormData();
// formData.append("file", fileData);
// this.uploadLoading = true;
// commonUpload(formData)
// .then((response) => {
// this.uploadLoading = false;
// this.$modal.msgSuccess("上传成功");
// this.imageUrl = this.pev + response.url;
// // this.form.picUrl = process.env.VUE_APP_BASE_API + response.url
// this.form.file = this.pev + response.url;
// console.log(this.form.picUrl, "this.form.picUrl");
// })
// .catch((error) => {
// this.uploadLoading = false;
// });
// },
/** 提交按钮 */
submitForm() {
......@@ -556,7 +533,6 @@ export default {
const params = {
id: this.form.id,
theme: this.form.theme,
// file: this.form.file,
file: this.uploadList.toString(),
};
console.log(params, "params");
......@@ -576,7 +552,6 @@ export default {
endTime: this.form.endTime,
fzr: this.form.fzr,
orgName: this.form.orgName,
// file: this.form.file,
file: this.uploadList.toString(),
remark: this.form.remark,
......@@ -617,31 +592,6 @@ export default {
});
}
},
/** 是否发布 */
handleIsShow(row) {
console.log(row);
const data = {
id: row.id,
};
this.$modal
.confirm()
.then(() => {
this.$modal.loading("正在编辑状态,请稍等...");
isCommunityFb(data)
.then((response) => {
this.$modal.closeLoading();
this.$modal.msgSuccess("编辑成功");
})
.catch((error) => {
this.$modal.closeLoading();
});
})
.catch(() => {
// 取消操作时的逻辑
});
},
},
};
</script>
......
......@@ -162,8 +162,8 @@
/>
</div>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-form-item
>1
</el-upload>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment