Browse Source

照片回显

dev
是小王呀\24601 1 year ago
parent
commit
0f37e74f58
  1. 37
      src/views/modules/volunteer/VoluntaryOrganization/add.vue
  2. 117
      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. 9
      src/views/modules/volunteer/VolunteerProjects/record.vue

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

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

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

@ -40,8 +40,8 @@
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="项目展示图" label-width="150px" prop="fileList">
<template>
<el-form-item label="项目展示图" label-width="150px" prop="">
<template>
<upload-image :defaultFileList="fileList" :limit="1" @change="onChangeFileList"
@file-removed="removedImg"></upload-image>
</template>
@ -144,15 +144,6 @@
recruitDeadline:"",//,
recruitRequirement:"",//
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:"",//
projectTitle:"",//
@ -341,7 +332,40 @@
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) {
// if (e.length > 0) {
// let item = e[0];
@ -356,23 +380,23 @@
removedImg() {
this.formData.coverPic = ''
},
onChangeFileList(e) {
console.log(e, e.length, '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
// onChangeFileList(e) {
// console.log(e, e.length, '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
console.log(this.fileList, e,'sssssb');
// console.log(this.fileList, e,'sssssb');
if (e.length > 0) {
// this.formData.attachments= this.fileList
console.log(this.formData.attachments, 'sssssb');
} else {
}
},
// if (e.length > 0) {
// // this.formData.attachments= this.fileList
// console.log(this.formData.attachments, 'sssssb');
// } else {
// }
// },
// onChangeImgs(e, rowIndex = 0) {
// console.log('onChangeFileList', e)
@ -711,44 +735,7 @@
this.formData.longitude = lonlat[0];
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() {
loading = Loading.service({

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

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

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

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

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

@ -50,8 +50,11 @@
</el-table-column>
<el-table-column prop="attachments" header-align="center" align="center" label="附件">
<template slot-scope="scope">
<el-button type="text" @click="handleDetail(scope.row)">查看</el-button>
</template>
<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>
</el-table-column>
</el-table> </div>
@ -202,6 +205,8 @@
if (code === 0) {
this.tableData=data.list
this.total=data.total
console.log(this.tableData,"列表请求成功!!!!!!!!!!!!!!");
console.log("列表请求成功!!!!!!!!!!!!!!");
// console.log("");

Loading…
Cancel
Save