Commit 4ebb050a by Cat

zd 社团修改

parent 29b98332
......@@ -96,7 +96,7 @@
type="info"
size="small"
round
@click="clubActivityRecord(task.id)"
@click="clubActivityRecord(task.id, task.name)"
>社团活动记录</el-button
>
<el-button
......@@ -316,11 +316,12 @@ export default {
});
},
// 社团活动记录
clubActivityRecord(id) {
clubActivityRecord(id, name) {
this.$router.push({
path: "/massOrganization/clubActivityRecord",
query: {
id,
name,
},
});
},
......@@ -351,10 +352,8 @@ export default {
},
// 搜索按钮
handleQuery() {
this.throttle(() => {
this.queryForm.pageNum = 1;
this.getList();
});
this.queryForm.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
......
......@@ -69,24 +69,14 @@
<template slot-scope="scope">
<el-image
v-for="(item, index) in scope.row.file.split(',')"
:key="index"
:key="index.id"
style="width: 100px; height: 100px"
:src="item"
:preview-src-list="[item]"
:preview-src-list="[pev + item]"
>
</el-image>
</template>
</el-table-column>
<!-- <el-table-column label="是否发布" align="center" prop="isfb">
<template slot-scope="scope">
<el-switch
v-model="scope.row.isShow"
active-value="1"
inactive-value="0"
@change="handleIsShow(scope.row)"
></el-switch>
</template>
</el-table-column> -->
<el-table-column
label="操作"
align="center"
......@@ -139,7 +129,7 @@
>
<el-row>
<el-col :span="24">
<el-form-item label="风采主题:" prop="theme">
<el-form-item label="活动主题:" prop="theme">
<el-input
v-model="form.theme"
placeholder="请输入"
......@@ -232,11 +222,11 @@
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"
>
<img v-if="form.file" :src="form.file" class="avatar" />
<!-- <img v-if="form.file" :src="form.file" class="avatar" /> -->
<div v-if="form.file">
<img
v-for="(item, index) in form.file"
:key="index"
v-for="(item, img) in form.file"
:key="img.id"
:src="item"
class="avatar"
/>
......@@ -275,7 +265,7 @@ export default {
data() {
return {
//图片上传列表
uploadList: [],
uploadList: {},
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
pev: process.env.VUE_APP_BASE_API,
......@@ -333,7 +323,7 @@ export default {
endTime: "",
fzr: "",
id: "",
orgName: "",
orgName: this.$route.query.name,
file: "",
remark: "",
},
......@@ -410,10 +400,8 @@ export default {
theme: this.queryParams.theme,
};
getClubInfo(params).then((response) => {
// console.log("response", response);
this.picList = response.rows;
this.picList.file = response.rows.file;
// console.log(this.picList.file);
this.total = response.total;
this.loading = false;
});
......@@ -467,10 +455,10 @@ export default {
/** 新增按钮操作 */
handleAdd() {
this.uploadList = [];
this.reset();
this.open = true;
this.title = "新增社团活动记录";
this.form.orgName = this.$route.query.name;
},
/** 编辑按钮操作 */
handleUpdate(row) {
......@@ -478,14 +466,15 @@ export default {
const ids = row.id || this.ids;
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(",");
console.log("this.form.file", this.form.file);
this.imageUrl = this.pev + this.form.picUrl;
console.log(this.imageUrl, "this.imageUrl");
this.open = true;
this.title = "编辑社团活动记录";
});
......@@ -496,32 +485,23 @@ export default {
this.open = true;
this.uploadList = [];
this.form.file = [];
const ids = row.id || this.ids;
listClubInfo(ids).then((response) => {
this.form = response.data;
// this.form.file = response.data.file;
console.log("this.form.file", this.form.file);
this.form.file = response.data.file.split(",");
// console.log(this.form.file);
this.open = true;
});
this.title = "查看社团活动记录";
},
// 上传成功回调
handleAvatarSuccess(res, file) {
// this.imageUrl = res.data.url;
// console.log(file);
// this.commonUpload(file);
console.log("Success res", res);
console.log("Success file", file);
if (res.code == 200) {
this.uploadList.push(this.pev + res.fileName);
this.form.file = this.uploadList;
console.log("this.uploadList", this.uploadList);
console.log("this.form.file", 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);
......@@ -548,24 +528,24 @@ export default {
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;
});
},
// 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() {
......
......@@ -428,10 +428,6 @@ export default {
this.form.file = this.uploadList;
}
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);
......
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