Commit a1eefbd9 authored by guoyou's avatar guoyou

峰会回顾图片删除

parent 1549e381
...@@ -38,4 +38,11 @@ export function activityIds() { ...@@ -38,4 +38,11 @@ export function activityIds() {
url: '/api/summit/imxr/ids', url: '/api/summit/imxr/ids',
method: 'get' method: 'get'
}) })
}
export function remove(id) {
return fetch({
url: '/api/summit/activity/remove/' + id,
method: 'delete'
})
} }
\ No newline at end of file
This diff is collapsed.
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
list-type="picture-card" list-type="picture-card"
:file-list="list" :file-list="list"
:on-success="handlePictureCardPreview" :on-success="handlePictureCardPreview"
:on-remove="handleRemove" :on-remove="handleRemoveZip"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
> >
<i class="el-icon-plus"></i> <i class="el-icon-plus"></i>
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
</el-col> </el-col>
<el-col> <el-col>
<el-form-item> <el-form-item>
<el-button class="button" type="primary" @click="cre">确 定</el-button>
<el-button class="button" @click="cancelHandel">取 消</el-button> <el-button class="button" @click="cancelHandel">取 消</el-button>
<!-- <el-button class="button" type="primary" @click="cre">确 定</el-button> -->
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -117,12 +117,14 @@ export default { ...@@ -117,12 +117,14 @@ export default {
imgFlag: false, imgFlag: false,
BASE_API: process.env.BASE_API, BASE_API: process.env.BASE_API,
percent: 0, //上传进度 percent: 0, //上传进度
list: [], list: [], //压缩包
oldList: '',
oldVadio: '',
vadio: [], //视频
activeId: '', //峰会id
form: { form: {
id: undefined, id: undefined,
banner: undefined, banner: undefined,
activityId: undefined,
banner: undefined,
videoPath: undefined, videoPath: undefined,
picturePath: undefined picturePath: undefined
} }
...@@ -151,44 +153,70 @@ export default { ...@@ -151,44 +153,70 @@ export default {
// }, // },
mounted() { mounted() {
this.getOrderInfo() this.getOrderInfo()
console.log(this.reviewRow)
}, },
methods: { methods: {
vidioSuccess(res) { vidioSuccess(res, file, fileList) {
this.$notify({ if (res.status == 200) {
title: '提示', this.$notify({
message: res.message, title: '提示',
type: 'success', message: res.message,
duration: 2000 type: 'success',
}) duration: 2000
})
this.vadio = fileList
}
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
// const zip = file.type === 'application/zip' const zip = file.type === 'application/zip'
// if (!zip) { if (!zip) {
// this.$message.error('上传头像图片只能是 zip 格式!') this.$message.error('上传压缩包只能是 zip 格式!')
// } }
// return zip return zip
}, },
videoUpload(file) { videoUpload(file) {
console.log(file.type)
const isJPG = file.type === 'video/mp4' const isJPG = file.type === 'video/mp4'
if (!isJPG) { if (!isJPG) {
this.$message.error('上传头像图片只能是 mp4 格式!') this.$message.error('上传压缩包只能是 mp4 格式!')
} }
return isJPG return isJPG
}, },
getOrderInfo() { getOrderInfo() {
console.log(this.reviewRow.id)
one(this.reviewRow.id).then(res => { one(this.reviewRow.id).then(res => {
this.form = res.data this.form = res.data
this.activeId = res.data.id //峰会id
this.oldList = res.data.picturePath || '' //压缩包
this.oldVadio = res.data.videoPath || '' //视频
this.dialogVisible = true this.dialogVisible = true
this.imgDialogVisible = true this.imgDialogVisible = true
}) })
}, },
cre() { cre() {
console.log(this.form.picturePath) let zipPic = []
save(this.form).then(res => { this.list.forEach(element => {
zipPic.push(element.url)
})
let mp4Vadio = []
this.vadio.forEach(element => {
mp4Vadio.push(element.response.data)
})
let params = {
id: this.activeId, //回顾id
banner: this.form.banner,
activityId: this.reviewRow.id, //峰会id
videoPath: this.oldVadio
? mp4Vadio == ''
? this.oldVadio
: mp4Vadio.join(',') + ',' + this.oldVadio
: mp4Vadio.join(','),
picturePath: this.oldList
? zipPic == ''
? this.oldList
: zipPic.join(',') + ',' + this.oldList
: zipPic.join(',')
}
save(params).then(res => {
this.responseResult(res) this.responseResult(res)
}) })
}, },
...@@ -241,20 +269,22 @@ export default { ...@@ -241,20 +269,22 @@ export default {
this.form.videoPath = file.data this.form.videoPath = file.data
this.imgDialogVisible = true this.imgDialogVisible = true
}, },
handleRemoveZip(file, fileList) {
this.list = fileList
},
handleRemove(file, fileList) { handleRemove(file, fileList) {
// console.log(file) this.vadio = fileList
console.log(file, fileList)
}, },
handlePictureCardPreview(res, file) { handlePictureCardPreview(res, file, fileList) {
this.$notify({ if (res.status == 200) {
title: '提示', this.$notify({
message: res.message, title: '提示',
type: 'success', message: '上传成功',
duration: 2000 type: 'success'
}) })
this.list.push({ url: res.data }) this.list = fileList
// this.imgDialogVisible = true; }
}, },
cleanForm() { cleanForm() {
this.form = { this.form = {
......
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