Commit 85bfe6b2 authored by hezhen's avatar hezhen

Merge branch 'base-modify' of http://113.105.137.151:22280/youjj/cloud-platform-ui into base-modify

parents 1e1f183c b4cf00fa
......@@ -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
......@@ -398,8 +398,9 @@
<span class="label-text">拍照取证*:</span>
<br />
<img
v-for="item in otherImg"
v-for="(item,index) in otherImg"
:src="item"
:key="index"
style="width: 100px; height: 100px;margin-left:110px;"
/>
<!-- <img src="../../../../dist/static/img/success.8304acb.png" style="width: 100px; height: 100px;margin-left:110px;"/>
......
<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>
......@@ -64,11 +64,11 @@
>
<i class="el-icon-plus"></i>
</el-upload>
<video
<!-- <video
v-if="$utils.isString(form.videoPath) && !$utils.isEmpty(form.videoPath) && !imgFlag"
:src="form.videoPath"
style="width:300px;max-height:300px;"
/>
/>-->
<!-- <i
v-else-if="!imgFlag"
class="el-icon-plus avatar-uploader-icon"
......@@ -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,74 @@ 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
var index = file.name.lastIndexOf('.')
var ext = file.name.substr(index + 1)
if (ext != 'zip') {
this.$message.error('上传压缩包只能是 zip 格式!')
return false
}
return true
},
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.response.data)
})
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(',')
}
// console.log(params);
save(params).then(res => {
this.responseResult(res)
})
},
......@@ -241,20 +273,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 = {
......
......@@ -105,12 +105,7 @@
<el-form-item label="活动id:">
<!-- <el-input v-model="form.rid" placeholder="请输入签到/抽奖活动的id"></el-input> -->
<el-select v-model="form.rid" placeholder="请选择签到/抽奖活动id">
<el-option
v-for="(item,index) in optionsId"
:key="index"
:label="item"
:value="item"
></el-option>
<el-option v-for="(item,index) in optionsId" :key="index" :label="item" :value="item"></el-option>
</el-select>
</el-form-item>
</el-col>
......@@ -151,20 +146,16 @@
<div>
<el-row>
<el-col>
<el-form-item label="房车介绍:">
<el-form-item label="房车介绍:" style="margin-top:20px">
<el-upload
class="upload-demo"
:headers="getHeaderWithToken"
:action="BASE_API+'/api/universal/file/app/unauth/admin/upload'"
:on-remove="handleRemove"
list-type="picture-card"
:file-list="fileList2"
:on-success="handleBannerSuccess"
list-type="picture"
:on-remove="handleRemove"
:headers="getHeaderWithToken"
>
<div slot="tip" class="el-upload__tip">
<span style="color: red;">建议尺寸:1080*644px</span>
</div>
<el-button size="small" type="primary">点击上传</el-button>
<i class="el-icon-plus"></i>
</el-upload>
</el-form-item>
<el-form-item label="峰会流程:">
......@@ -205,8 +196,8 @@
<el-row>
<el-col>
<el-button class="button" @click="cancelHandel">取 消</el-button>
<el-button class="button" type="primary" v-if="titleNme=='创建峰会'" @click="create('form')"> </el-button>
<el-button class="button" type="primary" v-if="titleNme=='编辑峰会'" @click="update1()"> </el-button>
<el-button class="button" type="primary" v-if="titleNme=='创建峰会'" @click="create('form')">确定</el-button>
<el-button class="button" type="primary" v-if="titleNme=='编辑峰会'" @click="update1()">确定</el-button>
</el-col>
</el-row>
</el-form>
......@@ -287,7 +278,7 @@ export default {
created() {
activityIds().then(data => {
if (data.status == 200) {
this.optionsId = data.data;
this.optionsId = data.data
}
})
},
......@@ -306,11 +297,14 @@ export default {
}
},
methods: {
handleBannerSuccess(res, file) {
this.fileList2.push({ url: res.data })
this.form.vehicleImgs = this.fileList2
handleBannerSuccess(res, file, fileList) {
console.log(fileList);
this.fileList2 = fileList
// this.form.vehicleImgs = this.fileList2
},
handleRemove(res, file, fileList) {
this.fileList2 = file
},
handleRemove() {},
getOrderInfo() {
this.title = this.titleNme
if (this.title === '编辑峰会') {
......@@ -384,7 +378,7 @@ export default {
},
getState(status) {
if (this.$utils.isInteger(status)) {
console.log(status);
console.log(status)
if (status == 0) {
return '默认'
} else {
......@@ -450,10 +444,17 @@ export default {
? (this.form.bmCloseTime = this.form.bmCloseTime)
: (this.form.bmCloseTime = this.form.bmCloseTime.getTime())
let pic = []
if (!!this.form.vehicleImgs) {
this.form.vehicleImgs.forEach(element => {
pic.push(element.url)
})
if (this.fileList2 != '') {
console.log(this.fileList2);
this.fileList2.forEach(element => {
if (!!element.response) {
pic.push(element.response.data)
}else{
pic.push(element.url);
}
});
console.log(pic);
this.form.vehicleImgs = pic.join(',')
}
......@@ -501,12 +502,18 @@ export default {
this.form.startTime = this.form.startTime.getTime()
this.form.bmCloseTime = this.form.bmCloseTime.getTime()
let pic = []
if (!!this.form.vehicleImgs) {
this.form.vehicleImgs.forEach(element => {
pic.push(element.url)
})
if (this.fileList2 != '') {
this.fileList2.forEach(element => {
pic.push(element.response.data);
});
this.form.vehicleImgs = pic.join(',')
}
// if (!!this.form.vehicleImgs) {
// this.form.vehicleImgs.forEach(element => {
// pic.push(element.url)
// })
// this.form.vehicleImgs = pic.join(',')
// }
this.dataProcessing()
add(this.form).then(res => {
this.responseResult(res)
......@@ -516,7 +523,7 @@ export default {
dataProcessing() {
if (this.form.state === '默认') {
this.form.status = '0'
}else{
} else {
this.form.status = this.statusRadio
}
this.form.processJson = JSON.stringify(this.processJson)
......
......@@ -1458,11 +1458,11 @@
},
queryVehicleModelSearch(queryString, cb) {
let selectArry = [];
let iitem = {
value: "全部",
name: "全部"
};
selectArry.push(iitem);
// let iitem = {
// value: "全部",
// name: "全部"
// };
// selectArry.push(iitem);
this.allVehicleList.map(function (item) {
item.value = item.name;
selectArry.push(item);
......
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