Commit a1eefbd9 authored by guoyou's avatar guoyou

峰会回顾图片删除

parent 1549e381
......@@ -38,4 +38,11 @@ export function activityIds() {
url: '/api/summit/imxr/ids',
method: 'get'
})
}
export function remove(id) {
return fetch({
url: '/api/summit/activity/remove/' + id,
method: 'delete'
})
}
\ No newline at end of file
<template>
<div class="app-container calendar-list-container">
<div class="filter-container">
<el-form ref="queryForm" :inline="inline" :model="query" label-width="100px">
<el-row>
<el-form-item label="峰会名称">
<el-input v-model="query.title" placeholder="请输入峰会名称"></el-input>
</el-form-item>
<el-form-item label="开始时间">
<el-date-picker
v-model="query.startTime"
type="datetime"
format="yyyy-MM-dd HH"
placeholder="报名截止时间"
@change="changeTime"
></el-date-picker>
</el-form-item>
<el-form-item label="峰会状态">
<el-select class="filter-item" v-model="query.status" placeholder="状态">
<el-option
v-for="(val,index) in status"
:key="index"
:label="val.name"
:value="val.id"
></el-option>
</el-select>
</el-form-item>
</el-row>
</el-form>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="createSummit">创建峰会</el-button>
</div>
<el-table
:key="tableKey"
:data="list"
v-loading="listLoading"
border
fit
highlight-current-row
style="width: 100%"
>
<el-table-column align="center" width="150px" label="id">
<template scope="scope">
<span>{{scope.row.id}}</span>
</template>
</el-table-column>
<el-table-column align="center" width="500px" label="标题">
<template scope="scope">
<span>{{scope.row.title}}</span>
</template>
</el-table-column>
<el-table-column align="center" width="400" label="开始-结束时间">
<template scope="scope">
<span>{{timestamp2Date(scope.row.startTime)}}</span>
<span>-</span>
<span>{{timestamp2Date(scope.row.endTime)}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="当前状态">
<template scope="scope">
<span>{{getStatusName(scope.row.status)}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right">
<template scope="scope">
<el-button
size="small"
class="el-button el-button--text el-button--small"
v-if="scope.row.isPublish===1"
@click="viewDetails({id:scope.row.id,isPublish:0})"
>取消发布</el-button>
<el-button
size="small"
class="el-button el-button--text el-button--small"
v-if="scope.row.isPublish===0"
@click="viewDetails({id:scope.row.id,isPublish:1})"
>发布</el-button>
<el-button
size="small"
class="el-button el-button--text el-button--small"
@click="enrollData(scope.row)"
>报名信息</el-button>
<!-- <el-button
<div class="app-container calendar-list-container">
<div class="filter-container">
<el-form ref="queryForm" :inline="inline" :model="query" label-width="100px">
<el-row>
<el-form-item label="峰会名称">
<el-input v-model="query.title" placeholder="请输入峰会名称"></el-input>
</el-form-item>
<el-form-item label="开始时间">
<el-date-picker
v-model="query.startTime"
type="datetime"
format="yyyy-MM-dd HH"
placeholder="报名截止时间"
@change="changeTime"
></el-date-picker>
</el-form-item>
<el-form-item label="峰会状态">
<el-select class="filter-item" v-model="query.status" placeholder="状态">
<el-option v-for="(val,index) in status" :key="index" :label="val.name" :value="val.id"></el-option>
</el-select>
</el-form-item>
</el-row>
</el-form>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" v-waves icon="search" @click="createSummit">创建峰会</el-button>
</div>
<el-table
:key="tableKey"
:data="list"
v-loading="listLoading"
border
fit
highlight-current-row
style="width: 100%"
>
<el-table-column align="center" width="150px" label="id">
<template scope="scope">
<span>{{scope.row.id}}</span>
</template>
</el-table-column>
<el-table-column align="center" width="500px" label="标题">
<template scope="scope">
<span>{{scope.row.title}}</span>
</template>
</el-table-column>
<el-table-column align="center" width="400" label="开始-结束时间">
<template scope="scope">
<span>{{timestamp2Date(scope.row.startTime)}}</span>
<span>-</span>
<span>{{timestamp2Date(scope.row.endTime)}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="当前状态">
<template scope="scope">
<span>{{getStatusName(scope.row.status)}}</span>
</template>
</el-table-column>
<el-table-column align="center" label="操作" fixed="right">
<template scope="scope">
<el-button
size="small"
class="el-button el-button--text el-button--small"
v-if="scope.row.isPublish===1"
@click="viewDetails({id:scope.row.id,isPublish:0})"
>取消发布</el-button>
<el-button
size="small"
class="el-button el-button--text el-button--small"
v-if="scope.row.isPublish===0"
@click="viewDetails({id:scope.row.id,isPublish:1})"
>发布</el-button>
<el-button
size="small"
class="el-button el-button--text el-button--small"
@click="enrollData(scope.row)"
>报名信息</el-button>
<!-- <el-button
size="small"
class="el-button el-button--text el-button--small"
@click="applyPage(scope.row)"
>报名页面</el-button> -->
<el-button
class="el-button el-button--text el-button--small"
size="small"
@click="edit(scope.row)"
>编辑</el-button>
<el-button
size="small"
class="el-button el-button--text el-button--small"
@click="review(scope.row)"
>回顾页面</el-button>
<el-button
class="el-button el-button--text el-button--small"
style="color:red"
size="small"
v-if="scope.row.isPublish==0"
@click="deleteSummit(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
>报名页面</el-button>-->
<el-button
class="el-button el-button--text el-button--small"
size="small"
@click="edit(scope.row)"
>编辑</el-button>
<el-button
size="small"
class="el-button el-button--text el-button--small"
@click="review(scope.row)"
>回顾页面</el-button>
<el-button
class="el-button el-button--text el-button--small"
style="color:red"
size="small"
v-if="scope.row.isPublish==0"
@click="deleteSummit(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<div v-show="!listLoading" class="pagination-container">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="query.page"
:page-sizes="[10,20,30, 50]"
:page-size="query.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</div>
<summitPopup
v-if="popupShow"
:popupRow="popupRow"
:titleNme="titleNme"
v-on:summitDialogEvent="summitDialogEvent"
/>
<enrollDataPopup
v-if="enrollShow"
:enrollRow="enrollRow"
v-on:enrollDialogEvent="enrollDialogEvent"
/>
<reviewPopup
v-if="reviewShow"
:reviewRow="reviewRow"
v-on:reviewDialogEvent="reviewDialogEvent"
/>
<div v-show="!listLoading" class="pagination-container">
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="query.page"
:page-sizes="[10,20,30, 50]"
:page-size="query.limit"
layout="total, sizes, prev, pager, next, jumper"
:total="total"
></el-pagination>
</div>
<summitPopup
v-if="popupShow"
:popupRow="popupRow"
:titleNme="titleNme"
v-on:summitDialogEvent="summitDialogEvent"
/>
<enrollDataPopup
v-if="enrollShow"
:enrollRow="enrollRow"
v-on:enrollDialogEvent="enrollDialogEvent"
/>
<reviewPopup v-if="reviewShow" :reviewRow="reviewRow" v-on:reviewDialogEvent="reviewDialogEvent" />
<!-- <applyPage :applyInfo='applyInfo'></applyPage> -->
</div>
<!-- <applyPage :applyInfo='applyInfo'></applyPage> -->
</div>
</template>
<script>
import { mapGetters } from "vuex";
import { timestamp2Date } from "src/utils/dateUtils";
import { page, update } from "src/api/summit/activity";
import summitPopup from "src/views/summit/model/summitPopup";
import enrollDataPopup from "src/views/summit/model/enrollDataPopup";
import reviewPopup from "src/views/summit/model/reviewPopup";
import { mapGetters } from 'vuex'
import { timestamp2Date } from 'src/utils/dateUtils'
import { page, update, remove } from 'src/api/summit/activity'
import summitPopup from 'src/views/summit/model/summitPopup'
import enrollDataPopup from 'src/views/summit/model/enrollDataPopup'
import reviewPopup from 'src/views/summit/model/reviewPopup'
// import applyPage from "src/views/summit/model/applyPage";
import { getToken } from "src/utils/auth";
import { getToken } from 'src/utils/auth'
export default {
name: "summitList",
components: {
summitPopup,
enrollDataPopup,
reviewPopup,
// applyPage
},
data() {
return {
applyInfo:{
dialogVisible:false,
},
query: {
page: 1,
limit: 10,
title: "",
startTime: "",
status: undefined,
type: 1
},
tableKey: 0,
list: [],
listLoading: true,
status: [
{ id: 0, name: "全部" },
{ id: 1, name: "报名中" },
{ id: 2, name: "进行中" },
{ id: 3, name: "已结束" }
],
total: 0,
inline: true,
popupShow: false,
titleNme: "创建峰会",
popupRow: undefined,
enrollRow: undefined,
enrollShow: false,
reviewRow: undefined,
reviewShow: false,
name: 'summitList',
components: {
summitPopup,
enrollDataPopup,
reviewPopup
// applyPage
},
data() {
return {
applyInfo: {
dialogVisible: false
},
query: {
page: 1,
limit: 10,
title: '',
startTime: '',
status: undefined,
type: 1
},
tableKey: 0,
list: [],
listLoading: true,
status: [
{ id: 0, name: '全部' },
{ id: 1, name: '报名中' },
{ id: 2, name: '进行中' },
{ id: 3, name: '已结束' }
],
total: 0,
inline: true,
popupShow: false,
titleNme: '创建峰会',
popupRow: undefined,
enrollRow: undefined,
enrollShow: false,
reviewRow: undefined,
reviewShow: false,
statusNameList: {
1: "默认",
2: "报名中",
3: "进行中",
4: "已结束"
}
};
},
created() {
this.getList();
},
computed: {
...mapGetters(["elements"]),
statusNameList: {
1: '默认',
2: '报名中',
3: '进行中',
4: '已结束'
}
}
},
created() {
this.getList()
},
computed: {
...mapGetters(['elements']),
getHeaderWithToken() {
return { Authorization: getToken() };
}
},
methods: {
//报名页面
// applyPage(){
// this.applyInfo.dialogVisible = true;
// },
getList() {
this.listLoading = true;
page(this.query).then(res => {
this.list = res.data.list;
this.total = res.data.total;
});
setTimeout(() => {
this.listLoading = false;
}, 500);
},
changeTime(val) {
!!val
? (this.query.startTime = Date.now(val))
: this.query.startTime == "";
},
handleFilter() {
this.getList();
},
viewDetails(row) {
update(row).then(res => {
if (res.rel) {
this.$notify.success({
title: "编辑成功",
message: `success`
});
this.getList();
} else {
this.$notify.warning({
title: "编辑失败",
message: `failed`
});
}
});
},
handleSizeChange(val) {
this.query.limit = val;
this.getList();
},
handleCurrentChange(val) {
this.query.page = val;
this.getList();
},
timestamp2Date(timeStamp) {
return timestamp2Date(timeStamp);
},
enrollData(row) {
this.enrollRow = row;
this.enrollShow = true;
},
edit(row) {
// debugger;
this.popupRow = row;
this.titleNme = "编辑峰会";
this.popupShow = true;
},
createSummit() {
this.popupRow = {};
this.titleNme = "创建峰会";
this.popupShow = true;
},
review(row) {
this.reviewRow = row;
this.reviewShow = true;
console.log(this.reviewRow);
},
deleteSummit() {},
getStatusName(status) {
return status + 1 ? this.statusNameList[status + 1] : "";
},
summitDialogEvent(e) {
this.popupShow = false;
if (e) {
this.getList();
}
},
enrollDialogEvent(e) {
this.enrollShow = false;
},
reviewDialogEvent(e) {
this.reviewShow = false;
}
}
};
getHeaderWithToken() {
return { Authorization: getToken() }
}
},
methods: {
//报名页面
// applyPage(){
// this.applyInfo.dialogVisible = true;
// },
getList() {
this.listLoading = true
page(this.query).then(res => {
this.list = res.data.list
this.total = res.data.total
})
setTimeout(() => {
this.listLoading = false
}, 500)
},
changeTime(val) {
!!val
? (this.query.startTime = Date.now(val))
: this.query.startTime == ''
},
handleFilter() {
this.getList()
},
viewDetails(row) {
update(row).then(res => {
if (res.rel) {
this.$notify.success({
title: '编辑成功',
message: `success`
})
this.getList()
} else {
this.$notify.warning({
title: '编辑失败',
message: `failed`
})
}
})
},
handleSizeChange(val) {
this.query.limit = val
this.getList()
},
handleCurrentChange(val) {
this.query.page = val
this.getList()
},
timestamp2Date(timeStamp) {
return timestamp2Date(timeStamp)
},
enrollData(row) {
this.enrollRow = row
this.enrollShow = true
},
edit(row) {
// debugger;
this.popupRow = row
this.titleNme = '编辑峰会'
this.popupShow = true
},
createSummit() {
this.popupRow = {}
this.titleNme = '创建峰会'
this.popupShow = true
},
review(row) {
this.reviewRow = row
this.reviewShow = true
},
deleteSummit(row) {
this.$confirm('此操作将删除该峰会, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
remove(row.id).then(data => {
if (data.status == 200) {
this.getList()
this.$message({
type: 'success',
message: '删除成功!'
})
} else {
this.$message({
type: 'error',
message: data.message
})
}
})
})
},
getStatusName(status) {
return status + 1 ? this.statusNameList[status + 1] : ''
},
summitDialogEvent(e) {
this.popupShow = false
if (e) {
this.getList()
}
},
enrollDialogEvent(e) {
this.enrollShow = false
},
reviewDialogEvent(e) {
this.reviewShow = false
}
}
}
</script>
......@@ -41,7 +41,7 @@
list-type="picture-card"
:file-list="list"
:on-success="handlePictureCardPreview"
:on-remove="handleRemove"
:on-remove="handleRemoveZip"
:before-upload="beforeAvatarUpload"
>
<i class="el-icon-plus"></i>
......@@ -78,8 +78,8 @@
</el-col>
<el-col>
<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" type="primary" @click="cre">确 定</el-button> -->
</el-form-item>
</el-col>
</el-row>
......@@ -117,12 +117,14 @@ export default {
imgFlag: false,
BASE_API: process.env.BASE_API,
percent: 0, //上传进度
list: [],
list: [], //压缩包
oldList: '',
oldVadio: '',
vadio: [], //视频
activeId: '', //峰会id
form: {
id: undefined,
banner: undefined,
activityId: undefined,
banner: undefined,
videoPath: undefined,
picturePath: undefined
}
......@@ -151,44 +153,70 @@ export default {
// },
mounted() {
this.getOrderInfo()
console.log(this.reviewRow)
},
methods: {
vidioSuccess(res) {
this.$notify({
title: '提示',
message: res.message,
type: 'success',
duration: 2000
})
vidioSuccess(res, file, fileList) {
if (res.status == 200) {
this.$notify({
title: '提示',
message: res.message,
type: 'success',
duration: 2000
})
this.vadio = fileList
}
},
beforeAvatarUpload(file) {
// const zip = file.type === 'application/zip'
// if (!zip) {
// this.$message.error('上传头像图片只能是 zip 格式!')
// }
// return zip
const zip = file.type === 'application/zip'
if (!zip) {
this.$message.error('上传压缩包只能是 zip 格式!')
}
return zip
},
videoUpload(file) {
console.log(file.type)
const isJPG = file.type === 'video/mp4'
if (!isJPG) {
this.$message.error('上传头像图片只能是 mp4 格式!')
this.$message.error('上传压缩包只能是 mp4 格式!')
}
return isJPG
},
getOrderInfo() {
console.log(this.reviewRow.id)
one(this.reviewRow.id).then(res => {
this.form = res.data
this.activeId = res.data.id //峰会id
this.oldList = res.data.picturePath || '' //压缩包
this.oldVadio = res.data.videoPath || '' //视频
this.dialogVisible = true
this.imgDialogVisible = true
})
},
cre() {
console.log(this.form.picturePath)
save(this.form).then(res => {
let zipPic = []
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)
})
},
......@@ -241,20 +269,22 @@ export default {
this.form.videoPath = file.data
this.imgDialogVisible = true
},
handleRemoveZip(file, fileList) {
this.list = fileList
},
handleRemove(file, fileList) {
// console.log(file)
console.log(file, fileList)
this.vadio = fileList
},
handlePictureCardPreview(res, file) {
this.$notify({
title: '提示',
message: res.message,
type: 'success',
duration: 2000
})
this.list.push({ url: res.data })
// this.imgDialogVisible = true;
handlePictureCardPreview(res, file, fileList) {
if (res.status == 200) {
this.$notify({
title: '提示',
message: '上传成功',
type: 'success'
})
this.list = fileList
}
},
cleanForm() {
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