Commit a1eefbd9 authored by guoyou's avatar guoyou

峰会回顾图片删除

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