diff --git a/src/components/searchForm/index.vue b/src/components/searchForm/index.vue index 48acf33..05db067 100644 --- a/src/components/searchForm/index.vue +++ b/src/components/searchForm/index.vue @@ -21,7 +21,7 @@ >{{ option.name }} - +
查询 @@ -62,18 +62,17 @@ export default { }, methods: { getSearch() { - console.log(this.form); this.$emit('getSearch', this.form) }, resetForm() { this.$refs.ruleForm.resetFields(); - this.$emit('getSearch', this.form) + this.$emit('getSearch', this.form,'clear') }, - changeTime(data,start,end){ - this.$emit('changeTime', data,start,end) - this.form[start] = data[0] - this.form[end] = data[1] - } + // changeTime(data,start,end){ + // this.$emit('changeTime', data,start,end) + // this.form[start] = data[0] + // this.form[end] = data[1] + // } }, }; diff --git a/src/views/Operation/Activity/_activityManage/index.vue b/src/views/Operation/Activity/_activityManage/index.vue index c00e01c..26dfb81 100644 --- a/src/views/Operation/Activity/_activityManage/index.vue +++ b/src/views/Operation/Activity/_activityManage/index.vue @@ -1,7 +1,7 @@ @@ -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() { diff --git a/src/views/Operation/Activity/_organizers/index.vue b/src/views/Operation/Activity/_organizers/index.vue index a6d6544..e742ee1 100644 --- a/src/views/Operation/Activity/_organizers/index.vue +++ b/src/views/Operation/Activity/_organizers/index.vue @@ -1,7 +1,7 @@