Commit db30ea86 by Cat

zd 社团

parent 9ef267a4
...@@ -69,9 +69,9 @@ ...@@ -69,9 +69,9 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-image <el-image
v-for="(item, index) in scope.row.file.split(',')" v-for="(item, index) in scope.row.file.split(',')"
:key="index.id" :key="index"
style="width: 100px; height: 100px" style="width: 100px; height: 100px"
:src="item" :src="pev + item"
:preview-src-list="[pev + item]" :preview-src-list="[pev + item]"
> >
</el-image> </el-image>
...@@ -222,12 +222,11 @@ ...@@ -222,12 +222,11 @@
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
> >
<!-- <img v-if="form.file" :src="form.file" class="avatar" /> --> <div v-if="form.file.length > 0">
<div v-if="form.file">
<img <img
v-for="(item, img) in form.file" v-for="(item, index) in form.file"
:key="img.id" :key="index"
:src="item" :src="pev + form.file"
class="avatar" class="avatar"
/> />
</div> </div>
...@@ -265,9 +264,8 @@ export default { ...@@ -265,9 +264,8 @@ export default {
data() { data() {
return { return {
//图片上传列表 //图片上传列表
uploadList: {}, uploadList: [],
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址 uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
pev: process.env.VUE_APP_BASE_API, pev: process.env.VUE_APP_BASE_API,
// 输入框字数限制 // 输入框字数限制
TEXT_SIZE, TEXT_SIZE,
...@@ -324,8 +322,8 @@ export default { ...@@ -324,8 +322,8 @@ export default {
fzr: "", fzr: "",
id: "", id: "",
orgName: this.$route.query.name, orgName: this.$route.query.name,
file: "",
remark: "", remark: "",
file: [],
}, },
// 表单校验 // 表单校验
rules: { rules: {
...@@ -401,7 +399,7 @@ export default { ...@@ -401,7 +399,7 @@ export default {
}; };
getClubInfo(params).then((response) => { getClubInfo(params).then((response) => {
this.picList = response.rows; this.picList = response.rows;
this.picList.file = response.rows.file; // this.picList.file = response.rows.file;
this.total = response.total; this.total = response.total;
this.loading = false; this.loading = false;
}); });
...@@ -430,6 +428,7 @@ export default { ...@@ -430,6 +428,7 @@ export default {
picUrl: null, picUrl: null,
seqencing: null, seqencing: null,
isShow: 0, isShow: 0,
file: [],
}; };
this.imageUrl = ""; this.imageUrl = "";
this.resetForm("form"); this.resetForm("form");
...@@ -455,6 +454,7 @@ export default { ...@@ -455,6 +454,7 @@ export default {
/** 新增按钮操作 */ /** 新增按钮操作 */
handleAdd() { handleAdd() {
this.uploadList = []; this.uploadList = [];
this.check = false;
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "新增社团活动记录"; this.title = "新增社团活动记录";
...@@ -467,10 +467,6 @@ export default { ...@@ -467,10 +467,6 @@ export default {
this.uploadList = []; this.uploadList = [];
this.form.file = []; this.form.file = [];
this.form.orgName = this.$route.query.name; this.form.orgName = this.$route.query.name;
console.log(
this.form.orgName,
"this.form.orgName = this.$route.query.name;"
);
listClubInfo(ids).then((response) => { listClubInfo(ids).then((response) => {
this.form = response.data; this.form = response.data;
this.form.file = response.data.file.split(","); this.form.file = response.data.file.split(",");
...@@ -495,17 +491,17 @@ export default { ...@@ -495,17 +491,17 @@ export default {
}, },
// 上传成功回调 // 上传成功回调
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
console.log("response上传成功回调", res);
console.log("file上传成功回调", file);
if (res.code == 200) { if (res.code == 200) {
this.uploadList.push(this.pev + res.fileName); this.uploadList.push(res.fileName);
this.form.file = this.uploadList; this.form.file = this.uploadList;
console.log("this.form.file5555", this.form.file);
} }
console.log(this.pev, "this.uploadList111111"); console.log(this.uploadList, "this.uploadList11111111");
console.log(res.fileName, "res.fileName"); console.log(this.form.file, "this.form.file2222222222");
console.log(this.form.file, "this.form.file"); console.log(this.pev, "this.pev33333333");
console.log(res.fileName, "res.fileName444444");
// this.imageUrl = res.data.url;
// console.log(file);
// this.commonUpload(file);
}, },
// 上传前格式和图片大小限制 // 上传前格式和图片大小限制
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
...@@ -527,25 +523,6 @@ export default { ...@@ -527,25 +523,6 @@ export default {
handleRemove(file, fileList) { handleRemove(file, fileList) {
this.imageUrl = ""; 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() { submitForm() {
...@@ -556,7 +533,6 @@ export default { ...@@ -556,7 +533,6 @@ export default {
const params = { const params = {
id: this.form.id, id: this.form.id,
theme: this.form.theme, theme: this.form.theme,
// file: this.form.file,
file: this.uploadList.toString(), file: this.uploadList.toString(),
}; };
console.log(params, "params"); console.log(params, "params");
...@@ -576,7 +552,6 @@ export default { ...@@ -576,7 +552,6 @@ export default {
endTime: this.form.endTime, endTime: this.form.endTime,
fzr: this.form.fzr, fzr: this.form.fzr,
orgName: this.form.orgName, orgName: this.form.orgName,
// file: this.form.file,
file: this.uploadList.toString(), file: this.uploadList.toString(),
remark: this.form.remark, remark: this.form.remark,
...@@ -617,31 +592,6 @@ export default { ...@@ -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> </script>
......
...@@ -162,8 +162,8 @@ ...@@ -162,8 +162,8 @@
/> />
</div> </div>
<i v-else class="el-icon-plus avatar-uploader-icon"></i> <i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-form-item </el-upload>
>1 </el-form-item>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <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