|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div>
|
|
|
|
|
<div class="cardTitle">活动管理</div>
|
|
|
|
|
<searchForm :formItem="formItem" @getSearch="getData($event)" @changeTime='changeTime'></searchForm>
|
|
|
|
|
<searchForm :formItem="formItem" @getSearch="search($event)"></searchForm>
|
|
|
|
|
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
|
|
|
|
|
>新增活动</a-button
|
|
|
|
|
>
|
|
|
|
@ -39,7 +39,8 @@
|
|
|
|
|
</span>
|
|
|
|
|
<span slot="switch" slot-scope="switchV, row">
|
|
|
|
|
<a-switch
|
|
|
|
|
checked-children="开" un-checked-children="关"
|
|
|
|
|
checked-children="开"
|
|
|
|
|
un-checked-children="关"
|
|
|
|
|
:checked="switchV === 1"
|
|
|
|
|
@change="handleEnable(row)"
|
|
|
|
|
></a-switch>
|
|
|
|
@ -64,7 +65,11 @@
|
|
|
|
|
@addClose="addClose"
|
|
|
|
|
:editId="editId"
|
|
|
|
|
></addForm>
|
|
|
|
|
<detailForm :detailId="detailId" :show="drawer.detail" @detailClose="detailClose"></detailForm>
|
|
|
|
|
<detailForm
|
|
|
|
|
:detailId="detailId"
|
|
|
|
|
:show="drawer.detail"
|
|
|
|
|
@detailClose="detailClose"
|
|
|
|
|
></detailForm>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -76,16 +81,16 @@ import detailForm from "./depend/detail.vue";
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
addForm,
|
|
|
|
|
detailForm
|
|
|
|
|
detailForm,
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
drawer: {
|
|
|
|
|
show: false,
|
|
|
|
|
detail:false
|
|
|
|
|
detail: false,
|
|
|
|
|
},
|
|
|
|
|
editId: null,
|
|
|
|
|
detailId:null,
|
|
|
|
|
detailId: null,
|
|
|
|
|
tableData: [],
|
|
|
|
|
searchForm: {
|
|
|
|
|
activityAddress: undefined,
|
|
|
|
@ -110,27 +115,53 @@ export default {
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
async getData(data) {
|
|
|
|
|
if (data !== undefined) {
|
|
|
|
|
console.log(data);
|
|
|
|
|
this.searchForm = data;
|
|
|
|
|
console.log(this.searchForm);
|
|
|
|
|
search(data,type) {
|
|
|
|
|
if(type ==='clear'){
|
|
|
|
|
this.searchForm = {
|
|
|
|
|
activityAddress: undefined,
|
|
|
|
|
organizerName: undefined,
|
|
|
|
|
activityContact: undefined,
|
|
|
|
|
activityTel: undefined,
|
|
|
|
|
title: undefined,
|
|
|
|
|
status: undefined,
|
|
|
|
|
registrationStartTime: undefined,
|
|
|
|
|
registrationEndTime: undefined,
|
|
|
|
|
activityStartTime: undefined,
|
|
|
|
|
activityEndTime: undefined,
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
let obj = {}
|
|
|
|
|
for(let k in data) {
|
|
|
|
|
if(Array.isArray(data[k])) {
|
|
|
|
|
console.log(data[k]);
|
|
|
|
|
let start = k + 'StartTime'
|
|
|
|
|
obj[start] = data[k][0]
|
|
|
|
|
let end = k + 'EndTime'
|
|
|
|
|
obj[end] = data[k][1]
|
|
|
|
|
}else{
|
|
|
|
|
obj[k] = data[k]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
console.log(obj);
|
|
|
|
|
this.searchForm = obj;
|
|
|
|
|
}
|
|
|
|
|
this.getData()
|
|
|
|
|
},
|
|
|
|
|
async getData() {
|
|
|
|
|
let res = await activityList({
|
|
|
|
|
pageNum: this.pagination.current,
|
|
|
|
|
size: this.pagination.pageSize,
|
|
|
|
|
...this.searchForm
|
|
|
|
|
...this.searchForm,
|
|
|
|
|
});
|
|
|
|
|
this.tableData = res.data.rows;
|
|
|
|
|
this.pagination.total = res.data.total;
|
|
|
|
|
this.selectedRowKeys=[]
|
|
|
|
|
},
|
|
|
|
|
changeTime(data,start,end){
|
|
|
|
|
console.log(start);
|
|
|
|
|
this.searchForm[start] = data[0]
|
|
|
|
|
this.searchForm[end] = data[1]
|
|
|
|
|
console.log(this.searchForm);
|
|
|
|
|
this.selectedRowKeys = [];
|
|
|
|
|
},
|
|
|
|
|
// changeTime(data,start,end){
|
|
|
|
|
// this.searchForm[start] = data[0]
|
|
|
|
|
// this.searchForm[end] = data[1]
|
|
|
|
|
// console.log(this.searchForm);
|
|
|
|
|
// },
|
|
|
|
|
edit(id) {
|
|
|
|
|
this.editId = id;
|
|
|
|
|
this.drawer.show = true;
|
|
|
|
@ -177,14 +208,14 @@ export default {
|
|
|
|
|
success() {
|
|
|
|
|
this.getData();
|
|
|
|
|
},
|
|
|
|
|
detail(id){
|
|
|
|
|
detail(id) {
|
|
|
|
|
this.drawer.detail = true;
|
|
|
|
|
this.detailId = id;
|
|
|
|
|
},
|
|
|
|
|
detailClose(){
|
|
|
|
|
detailClose() {
|
|
|
|
|
this.detailId = null;
|
|
|
|
|
this.drawer.detail = false;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
hasSelected() {
|
|
|
|
|