Browse Source

照片回显

dev
是小王呀\24601 1 year ago
parent
commit
0f37e74f58
  1. 37
      src/views/modules/volunteer/VoluntaryOrganization/add.vue
  2. 111
      src/views/modules/volunteer/VolunteerProjects/add.vue
  3. 38
      src/views/modules/volunteer/VolunteerProjects/edit.vue
  4. 1
      src/views/modules/volunteer/VolunteerProjects/index.vue
  5. 7
      src/views/modules/volunteer/VolunteerProjects/record.vue

37
src/views/modules/volunteer/VoluntaryOrganization/add.vue

@ -66,7 +66,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="组织封面图" label-width="150px" prop="fileList"> <el-form-item label="组织封面图" label-width="150px" prop="coverImg">
<template> <template>
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList" <upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image> @file-removed="removedImg"></upload-image>
@ -299,21 +299,6 @@
this.formData.online = 0; this.formData.online = 0;
} }
}, },
// onChangeFileList(e) {
// if (e.length > 0) {
// let item = e[0];
// let ob = {
// fileType: '0',
// fileUrl: item.response.data.url
// };
// this.fileList = [ob];
// this.formData.coverPic = ob.fileUrl;
// }
// },
removedImg() {
this.formData.coverPic = ''
},
onChangeFileList(e) { onChangeFileList(e) {
console.log(e, 'sssssb'); console.log(e, 'sssssb');
this.fileList = e.length > 0 ? e.map(item => ({ this.fileList = e.length > 0 ? e.map(item => ({
@ -321,11 +306,27 @@
fileUrl: item.response.data.url fileUrl: item.response.data.url
})) : []; // efileList })) : []; // efileList
if (e.length > 0) { if (e.length > 0) {
this.formData.qualification = e[0].response.data.url; this.formData.coverPic = e[0].response.data.url;
} else { } else {
this.formData.qualification = ''; this.formData.coverPic = '';
} }
}, },
removedImg() {
this.formData.coverPic = ''
},
// onChangeFileList(e) {
// console.log(e, 'sssssb');
// this.fileList = e.length > 0 ? e.map(item => ({
// fileType: '0',
// fileUrl: item.response.data.url
// })) : []; // efileList
// if (e.length > 0) {
// this.formData.qualification = e[0].response.data.url;
// } else {
// this.formData.qualification = '';
// }
// },
onChangeFileList1(e) { onChangeFileList1(e) {
console.log(e, 'sssssb'); console.log(e, 'sssssb');
this.fileList1 = e.length > 0 ? e.map(item => ({ this.fileList1 = e.length > 0 ? e.map(item => ({

111
src/views/modules/volunteer/VolunteerProjects/add.vue

@ -40,7 +40,7 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="项目展示图" label-width="150px" prop="fileList"> <el-form-item label="项目展示图" label-width="150px" prop="">
<template> <template>
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList" <upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image> @file-removed="removedImg"></upload-image>
@ -144,15 +144,6 @@
recruitDeadline:"",//, recruitDeadline:"",//,
recruitRequirement:"",// recruitRequirement:"",//
attachments:[ attachments:[
{format: "png",
name:"banner.png",
type: "image",
url: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/20240912/36cbe79b43cd45d381e3c8e4f92e1c3d.png"
}
],// ],//
description:"",// description:"",//
projectTitle:"",// projectTitle:"",//
@ -341,7 +332,40 @@
this.formData.online = 0; this.formData.online = 0;
} }
}, },
onChangeFileList(e) {
console.log(e, 'sssssb');
this.fileList = e.length > 0 ? e.map(item => ({
fileType: '0',
fileUrl: item.response.data.url,
name: item.response.data.fileName,
url: item.response.data.url,
type: "image",
format: item.raw.name.split('.').pop(),
})) : []; // efileList
if (e.length > 0) {
this.formData.coverPic = e[0].response.data.url;
console.log( this.fileList, 'sssssb');
this.formData.attachments= this.fileList
} else {
this.formData.coverPic = '';
}
},
// onChangeFileList(e) {
// console.log(e, 'sssssb');
// this.fileList = e.length > 0 ? e.map(item => ({
// name: item.response.data.fileName,
// url: item.response.data.url,
// type: "image",
// format: item.raw.name.split('.').pop(),
// })) : []; // efileList
// if (e.length > 0) {
// this.formData.coverPic = e[0].response.data.url;
// console.log(this.fileList, 'sssssb');
// } else {
// this.formData.coverPic = '';
// }
// },
// onChangeFileList(e) { // onChangeFileList(e) {
// if (e.length > 0) { // if (e.length > 0) {
// let item = e[0]; // let item = e[0];
@ -356,23 +380,23 @@
removedImg() { removedImg() {
this.formData.coverPic = '' this.formData.coverPic = ''
}, },
onChangeFileList(e) { // onChangeFileList(e) {
console.log(e, e.length, 'sssssb'); // console.log(e, e.length, 'sssssb');
this.fileList = e.length > 0 ? e.map(item => ({ // this.fileList = e.length > 0 ? e.map(item => ({
name: item.response.data.fileName, // name: item.response.data.fileName,
url: item.response.data.url, // url: item.response.data.url,
type:"image", // type:"image",
format: item.raw.name.split('.').pop(), // format: item.raw.name.split('.').pop(),
})) : []; // efileList // })) : []; // efileList
console.log(this.fileList, e,'sssssb'); // console.log(this.fileList, e,'sssssb');
if (e.length > 0) { // if (e.length > 0) {
// this.formData.attachments= this.fileList // // this.formData.attachments= this.fileList
console.log(this.formData.attachments, 'sssssb'); // console.log(this.formData.attachments, 'sssssb');
} else { // } else {
} // }
}, // },
// onChangeImgs(e, rowIndex = 0) { // onChangeImgs(e, rowIndex = 0) {
// console.log('onChangeFileList', e) // console.log('onChangeFileList', e)
@ -712,43 +736,6 @@
this.searchValue = selPosition.address + selPosition.name this.searchValue = selPosition.address + selPosition.name
}, },
resetData() {
this.timeRange = []
this.fileList = []
this.searchValue = ''
this.searchOptions = []
this.resultList = []
this.activityId = ''
this.keyWords = ''
this.online = false
this.formType = ''
this.summary = true
this.formData = {
id: "",
typeId: "",
activityName: "",//
status: 0,//
assistingParty: "",//
startTime: "",//
endTime: "",//
content: "",//
address: "",//
online: 0,//
cutOffTime: "",//
points: 0,//
participants: 0,//
sendMessage: 0,//
sumUp: "",//
activityImgs: [],//
longitude: this.$store.state.user.longitude, //
latitude: this.$store.state.user.latitude//
// longitude: null, //
// latitude: null//
}
map=""
},
// //
startLoading() { startLoading() {
loading = Loading.service({ loading = Loading.service({

38
src/views/modules/volunteer/VolunteerProjects/edit.vue

@ -42,7 +42,7 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="项目展示图" label-width="150px" prop="fileList"> <el-form-item label="项目展示图" label-width="150px" prop="fileList">
<template> <template>
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList" <upload-image :defaultFileList="fileList1" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image> @file-removed="removedImg"></upload-image>
</template> </template>
</el-form-item> </el-form-item>
@ -157,18 +157,15 @@
type: "image", type: "image",
url: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/20240912/36cbe79b43cd45d381e3c8e4f92e1c3d.png" url: "https://elink-esua-epdc.oss-cn-qingdao.aliyuncs.com/epmet-saas/dev/20240912/36cbe79b43cd45d381e3c8e4f92e1c3d.png"
} }
],// ],//
description:"",// description:"",//
projectTitle:"",// projectTitle:"",//
projectLevel:'',// projectLevel:'',//
projectScopeOrgId:"",//ID projectScopeOrgId:"",//ID
publishUnitName:"",// publishUnitName:"",//
}, },
fileList1:[],
corganizerList: [], corganizerList: [],
uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2', uploadUrl: window.SITE_CONFIG['apiURL'] + '/oss/file/uploadqrcodeV2',
@ -180,18 +177,23 @@
components: { Tinymce, UploadImage }, components: { Tinymce, UploadImage },
mounted() { mounted() {
console.log(this.VolunteerList,"this.VolunteerList"); console.log(this.VolunteerList,"this.VolunteerList");
// this.formData = this.VolunteerList // this.formData = this.VolunteerList
this.formData.agencyName=this.$store.state.user.agencyName this.formData.agencyName=this.$store.state.user.agencyName
if (this.$store.state.user.level=="district") { if (this.$store.state.user.level=="district") {
this.formData.Servicelevel="区级" this.formData.Servicelevel="区级"
} }
this.getDetail() this.getDetail()
this.volunteerservicetype() this.volunteerservicetype()
}, },
watch: {
fileList1: {
handler(newValue, oldValue) {
console.log('fileList changed:', newValue);
},
deep: true //
}
},
methods: { methods: {
// //
@ -349,10 +351,19 @@
console.log(e, 'sssssb'); console.log(e, 'sssssb');
this.fileList = e.length > 0 ? e.map(item => ({ this.fileList = e.length > 0 ? e.map(item => ({
fileType: '0', fileType: '0',
fileUrl: item.response.data.url fileUrl: item.response.data.url,
name: item.response.data.fileName,
url: item.response.data.url,
type: "image",
format: item.raw.name.split('.').pop(),
})) : []; // efileList })) : []; // efileList
if (e.length > 0) { if (e.length > 0) {
this.formData.coverPic = e[0].response.data.url; this.formData.coverPic = e[0].response.data.url;
console.log(this.fileList, 'sssssb');
this.formData.attachments= this.fileList
console.log(this.formData.attachments, 'sssssb');
} else { } else {
this.formData.coverPic = ''; this.formData.coverPic = '';
} }
@ -400,7 +411,12 @@
if (code === 0) { if (code === 0) {
this.formData = data this.formData = data
console.log(this.formData,"lkjsdlkdcjkl"); console.log(this.formData,"lkjsdlkdcjkl");
console.log(this.formData.attachments[0].url,"lkjsdlkdzxczccjk");
this.fileList1.push({fileUrl:this.formData.attachments[0].url})
// this.fileList.push(url)
debugger
console.log(this.fileList1,"lkjsdlkdzxczccfsdfdsjk");
debugger
} else { } else {
this.$message.error(msg) this.$message.error(msg)
} }

1
src/views/modules/volunteer/VolunteerProjects/index.vue

@ -297,7 +297,6 @@ export default {
// //
showAddClose(){ showAddClose(){
console.log("sdlkfjklsdf1"); console.log("sdlkfjklsdf1");
this.showAdd=false this.showAdd=false
this.getTableData() this.getTableData()
}, },

7
src/views/modules/volunteer/VolunteerProjects/record.vue

@ -50,7 +50,10 @@
</el-table-column> </el-table-column>
<el-table-column prop="attachments" header-align="center" align="center" label="附件"> <el-table-column prop="attachments" header-align="center" align="center" label="附件">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.row)">查看</el-button> <el-image v-if="scope.row.attachments[0].url" style="width: 40px; height: 40px"
:src="scope.row.attachments[0].url" :preview-src-list="[scope.row.attachments[0].url]">
</el-image>
<span v-else></span>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </div> </el-table> </div>
@ -202,6 +205,8 @@
if (code === 0) { if (code === 0) {
this.tableData=data.list this.tableData=data.list
this.total=data.total this.total=data.total
console.log(this.tableData,"列表请求成功!!!!!!!!!!!!!!");
console.log("列表请求成功!!!!!!!!!!!!!!"); console.log("列表请求成功!!!!!!!!!!!!!!");
// console.log(""); // console.log("");

Loading…
Cancel
Save