Commit a1eefbd9 authored by guoyou's avatar guoyou

峰会回顾图片删除

parent 1549e381
...@@ -39,3 +39,10 @@ export function activityIds() { ...@@ -39,3 +39,10 @@ export function activityIds() {
method: 'get' method: 'get'
}) })
} }
export function remove(id) {
return fetch({
url: '/api/summit/activity/remove/' + id,
method: 'delete'
})
}
\ No newline at end of file
...@@ -17,12 +17,7 @@ ...@@ -17,12 +17,7 @@
</el-form-item> </el-form-item>
<el-form-item label="峰会状态"> <el-form-item label="峰会状态">
<el-select class="filter-item" v-model="query.status" placeholder="状态"> <el-select class="filter-item" v-model="query.status" placeholder="状态">
<el-option <el-option v-for="(val,index) in status" :key="index" :label="val.name" :value="val.id"></el-option>
v-for="(val,index) in status"
:key="index"
:label="val.name"
:value="val.id"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-row> </el-row>
...@@ -84,7 +79,7 @@ ...@@ -84,7 +79,7 @@
size="small" size="small"
class="el-button el-button--text el-button--small" class="el-button el-button--text el-button--small"
@click="applyPage(scope.row)" @click="applyPage(scope.row)"
>报名页面</el-button> --> >报名页面</el-button>-->
<el-button <el-button
class="el-button el-button--text el-button--small" class="el-button el-button--text el-button--small"
size="small" size="small"
...@@ -128,44 +123,40 @@ ...@@ -128,44 +123,40 @@
:enrollRow="enrollRow" :enrollRow="enrollRow"
v-on:enrollDialogEvent="enrollDialogEvent" v-on:enrollDialogEvent="enrollDialogEvent"
/> />
<reviewPopup <reviewPopup v-if="reviewShow" :reviewRow="reviewRow" v-on:reviewDialogEvent="reviewDialogEvent" />
v-if="reviewShow"
:reviewRow="reviewRow"
v-on:reviewDialogEvent="reviewDialogEvent"
/>
<!-- <applyPage :applyInfo='applyInfo'></applyPage> --> <!-- <applyPage :applyInfo='applyInfo'></applyPage> -->
</div> </div>
</template> </template>
<script> <script>
import { mapGetters } from "vuex"; import { mapGetters } from 'vuex'
import { timestamp2Date } from "src/utils/dateUtils"; import { timestamp2Date } from 'src/utils/dateUtils'
import { page, update } from "src/api/summit/activity"; import { page, update, remove } from 'src/api/summit/activity'
import summitPopup from "src/views/summit/model/summitPopup"; import summitPopup from 'src/views/summit/model/summitPopup'
import enrollDataPopup from "src/views/summit/model/enrollDataPopup"; import enrollDataPopup from 'src/views/summit/model/enrollDataPopup'
import reviewPopup from "src/views/summit/model/reviewPopup"; import reviewPopup from 'src/views/summit/model/reviewPopup'
// import applyPage from "src/views/summit/model/applyPage"; // import applyPage from "src/views/summit/model/applyPage";
import { getToken } from "src/utils/auth"; import { getToken } from 'src/utils/auth'
export default { export default {
name: "summitList", name: 'summitList',
components: { components: {
summitPopup, summitPopup,
enrollDataPopup, enrollDataPopup,
reviewPopup, reviewPopup
// applyPage // applyPage
}, },
data() { data() {
return { return {
applyInfo:{ applyInfo: {
dialogVisible:false, dialogVisible: false
}, },
query: { query: {
page: 1, page: 1,
limit: 10, limit: 10,
title: "", title: '',
startTime: "", startTime: '',
status: undefined, status: undefined,
type: 1 type: 1
}, },
...@@ -173,15 +164,15 @@ export default { ...@@ -173,15 +164,15 @@ export default {
list: [], list: [],
listLoading: true, listLoading: true,
status: [ status: [
{ id: 0, name: "全部" }, { id: 0, name: '全部' },
{ id: 1, name: "报名中" }, { id: 1, name: '报名中' },
{ id: 2, name: "进行中" }, { id: 2, name: '进行中' },
{ id: 3, name: "已结束" } { id: 3, name: '已结束' }
], ],
total: 0, total: 0,
inline: true, inline: true,
popupShow: false, popupShow: false,
titleNme: "创建峰会", titleNme: '创建峰会',
popupRow: undefined, popupRow: undefined,
enrollRow: undefined, enrollRow: undefined,
enrollShow: false, enrollShow: false,
...@@ -189,21 +180,21 @@ export default { ...@@ -189,21 +180,21 @@ export default {
reviewShow: false, reviewShow: false,
statusNameList: { statusNameList: {
1: "默认", 1: '默认',
2: "报名中", 2: '报名中',
3: "进行中", 3: '进行中',
4: "已结束" 4: '已结束'
}
} }
};
}, },
created() { created() {
this.getList(); this.getList()
}, },
computed: { computed: {
...mapGetters(["elements"]), ...mapGetters(['elements']),
getHeaderWithToken() { getHeaderWithToken() {
return { Authorization: getToken() }; return { Authorization: getToken() }
} }
}, },
methods: { methods: {
...@@ -212,86 +203,106 @@ export default { ...@@ -212,86 +203,106 @@ export default {
// this.applyInfo.dialogVisible = true; // this.applyInfo.dialogVisible = true;
// }, // },
getList() { getList() {
this.listLoading = true; this.listLoading = true
page(this.query).then(res => { page(this.query).then(res => {
this.list = res.data.list; this.list = res.data.list
this.total = res.data.total; this.total = res.data.total
}); })
setTimeout(() => { setTimeout(() => {
this.listLoading = false; this.listLoading = false
}, 500); }, 500)
}, },
changeTime(val) { changeTime(val) {
!!val !!val
? (this.query.startTime = Date.now(val)) ? (this.query.startTime = Date.now(val))
: this.query.startTime == ""; : this.query.startTime == ''
}, },
handleFilter() { handleFilter() {
this.getList(); this.getList()
}, },
viewDetails(row) { viewDetails(row) {
update(row).then(res => { update(row).then(res => {
if (res.rel) { if (res.rel) {
this.$notify.success({ this.$notify.success({
title: "编辑成功", title: '编辑成功',
message: `success` message: `success`
}); })
this.getList(); this.getList()
} else { } else {
this.$notify.warning({ this.$notify.warning({
title: "编辑失败", title: '编辑失败',
message: `failed` message: `failed`
}); })
} }
}); })
}, },
handleSizeChange(val) { handleSizeChange(val) {
this.query.limit = val; this.query.limit = val
this.getList(); this.getList()
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.query.page = val; this.query.page = val
this.getList(); this.getList()
}, },
timestamp2Date(timeStamp) { timestamp2Date(timeStamp) {
return timestamp2Date(timeStamp); return timestamp2Date(timeStamp)
}, },
enrollData(row) { enrollData(row) {
this.enrollRow = row; this.enrollRow = row
this.enrollShow = true; this.enrollShow = true
}, },
edit(row) { edit(row) {
// debugger; // debugger;
this.popupRow = row; this.popupRow = row
this.titleNme = "编辑峰会"; this.titleNme = '编辑峰会'
this.popupShow = true; this.popupShow = true
}, },
createSummit() { createSummit() {
this.popupRow = {}; this.popupRow = {}
this.titleNme = "创建峰会"; this.titleNme = '创建峰会'
this.popupShow = true; this.popupShow = true
}, },
review(row) { review(row) {
this.reviewRow = row; this.reviewRow = row
this.reviewShow = true; this.reviewShow = true
console.log(this.reviewRow); },
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
})
}
})
})
}, },
deleteSummit() {},
getStatusName(status) { getStatusName(status) {
return status + 1 ? this.statusNameList[status + 1] : ""; return status + 1 ? this.statusNameList[status + 1] : ''
}, },
summitDialogEvent(e) { summitDialogEvent(e) {
this.popupShow = false; this.popupShow = false
if (e) { if (e) {
this.getList(); this.getList()
} }
}, },
enrollDialogEvent(e) { enrollDialogEvent(e) {
this.enrollShow = false; this.enrollShow = false
}, },
reviewDialogEvent(e) { reviewDialogEvent(e) {
this.reviewShow = false; this.reviewShow = false
} }
} }
}; }
</script> </script>
...@@ -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) {
if (res.status == 200) {
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: res.message, message: res.message,
type: 'success', type: 'success',
duration: 2000 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) {
if (res.status == 200) {
this.$notify({ this.$notify({
title: '提示', title: '提示',
message: res.message, message: '上传成功',
type: 'success', type: 'success'
duration: 2000
}) })
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