搜索时间重置

dev
luochenyi 3 years ago
parent 656666aab8
commit e34287e0cc

@ -1,24 +1 @@
# ansu-business 未开发功能:缴费计划、账单管理(暂无接口),工单管理(暂无接口)
## Project setup
```
yarn install
```
### Compiles and hot-reloads for development
```
yarn serve
```
### Compiles and minifies for production
```
yarn build
```
### Lints and fixes files
```
yarn lint
```
### Customize configuration
See [Configuration Reference](https://cli.vuejs.org/config/).

@ -21,7 +21,7 @@
>{{ option.name }}</a-select-option >{{ option.name }}</a-select-option
> >
</a-select> </a-select>
<a-range-picker v-else-if="item.type === 'time'" v-model="form[item.prop]" value-format="YYYY/MM/DD HH:mm:ss" /> <a-range-picker v-else-if="item.type === 'time'" v-model="form[item.prop]" value-format="YYYY/MM/DD HH:mm:ss" @change="changeTime($event,item.start,item.end)" />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
<div class="btn-box"><a-button type="primary" @click="getSearch"> </a-button> <div class="btn-box"><a-button type="primary" @click="getSearch"> </a-button>
@ -62,17 +62,31 @@ export default {
}, },
methods: { methods: {
getSearch() { getSearch() {
this.$emit('getSearch', this.form) let obj = {}
for(let k in this.form){
if (!Array.isArray(this.form[k])) {
obj[k] = this.form[k]
}else{
console.log(k);
let start = k + 'StartTime'
let end = k + 'EndTime'
obj[start] = this.form[k][0]
obj[end] = this.form[k][1]
}
}
let obj1 = Object.assign({}, obj)
console.log(obj1);
this.$emit('getSearch', obj1)
}, },
resetForm() { resetForm() {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
this.$emit('getSearch', this.form,'clear') this.getSearch()
}, },
// changeTime(data,start,end){ changeTime(data,start,end){
// this.$emit('changeTime', data,start,end) this.$emit('changeTime', data,start,end)
// this.form[start] = data[0] this.form[start] = data[0]
// this.form[end] = data[1] this.form[end] = data[1]
// } }
}, },
}; };
</script> </script>

@ -115,36 +115,9 @@ export default {
this.getData(); this.getData();
}, },
methods: { methods: {
search(data,type) { search(data) {
if(type ==='clear'){ console.log(data);
this.searchForm = { this.searchForm = data;
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() this.getData()
}, },
async getData() { async getData() {
@ -157,11 +130,11 @@ export default {
this.pagination.total = res.data.total; this.pagination.total = res.data.total;
this.selectedRowKeys = []; this.selectedRowKeys = [];
}, },
// changeTime(data,start,end){ changeTime(data,start,end){
// this.searchForm[start] = data[0] this.searchForm[start] = data[0]
// this.searchForm[end] = data[1] this.searchForm[end] = data[1]
// console.log(this.searchForm); console.log(this.searchForm);
// }, },
edit(id) { edit(id) {
this.editId = id; this.editId = id;
this.drawer.show = true; this.drawer.show = true;

@ -22,6 +22,7 @@ export const formItem = [
{ {
type: 'time', type: 'time',
label: '更新时间', label: '更新时间',
prop:'modify',
start: 'modifyStartTime', start: 'modifyStartTime',
end:'modifyEndTime' end:'modifyEndTime'
}, },

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<div class="cardTitle">公告</div> <div class="cardTitle">公告</div>
<searchForm :formItem="formItem" @getSearch="search($event)"></searchForm> <searchForm :formItem="formItem" @getSearch="search($event)" @changeTime='changeTime'></searchForm>
<a-button style="margin: 10px" class="add-btn" @click="drawer.show = true" <a-button style="margin: 10px" class="add-btn" @click="drawer.show = true"
>新增公告</a-button >新增公告</a-button
> >
@ -87,6 +87,11 @@ export default {
this.searchForm = data; this.searchForm = data;
this.getData() this.getData()
}, },
changeTime(data,start,end){
this.searchForm[start] = data[0]
this.searchForm[end] = data[1]
console.log(this.searchForm);
},
async getData() { async getData() {
let res = await announcementList({ let res = await announcementList({
pageNum: this.pagination.current, pageNum: this.pagination.current,

@ -34,6 +34,7 @@ export const formItem = [
{ {
type: 'time', type: 'time',
label: '实际时间', label: '实际时间',
prop:'actualBeginDate',
start: 'actualBeginDateStart', start: 'actualBeginDateStart',
end:'actualBeginDateEnd' end:'actualBeginDateEnd'
}, },

@ -16,6 +16,7 @@ export const formItem = [
{ {
type: 'time', type: 'time',
label: '创建时间', label: '创建时间',
prop:'create',
start: 'createStartDate', start: 'createStartDate',
end:'createEndDate', end:'createEndDate',
}, },

@ -18,7 +18,10 @@
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="获取积分数额" prop="amount"> <a-form-model-item label="获取积分数额" prop="amount">
<a-input-number v-model.number="setForm.amount" :disabled='setForm.enableFirstLoginSetting===false'></a-input-number> <a-input-number
v-model.number="setForm.amount"
:disabled="setForm.enableFirstLoginSetting === false"
></a-input-number>
</a-form-model-item> </a-form-model-item>
<div class="title">签到奖励设置</div> <div class="title">签到奖励设置</div>
<a-form-model-item label="是否开启签到" prop="enableSignSetting"> <a-form-model-item label="是否开启签到" prop="enableSignSetting">
@ -29,7 +32,10 @@
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="签到方式" prop="signType"> <a-form-model-item label="签到方式" prop="signType">
<a-space> <a-space>
<span :class='[setForm.enableSignSetting===false?"disabled":""]'>{{ setForm.signType === 1 ? "一周每日签到模式" : "" }}</span> <span
:class="[setForm.enableSignSetting === false ? 'disabled' : '']"
>{{ setForm.signType === 1 ? "一周每日签到模式" : "" }}</span
>
<a-popover> <a-popover>
<template slot="content"> <template slot="content">
<p style="width: 300px"> <p style="width: 300px">
@ -47,7 +53,7 @@
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="活动时间" prop="signTime"> <a-form-model-item label="活动时间" prop="signTime">
<a-range-picker <a-range-picker
:disabled='setForm.enableSignSetting===false' :disabled="setForm.enableSignSetting === false"
style="width: 400px" style="width: 400px"
@change="changeTime" @change="changeTime"
v-model="time" v-model="time"
@ -55,10 +61,17 @@
/> />
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="签到奖励" prop="signReward"> <a-form-model-item label="签到奖励" prop="signReward">
<span :class='[setForm.enableSignSetting===false?"disabled":""]' >{{ setForm.signReward === 1 ? "商城积分" : "" }}</span> <span
:class="[setForm.enableSignSetting === false ? 'disabled' : '']"
>{{ setForm.signReward === 1 ? "商城积分" : "" }}</span
>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="签到活动名称" prop="signName"> <a-form-model-item label="签到活动名称" prop="signName">
<a-input v-model="setForm.signName" :disabled='setForm.enableSignSetting===false' style="width: 300px"></a-input> <a-input
v-model="setForm.signName"
:disabled="setForm.enableSignSetting === false"
style="width: 300px"
></a-input>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="签到奖励设置" prop="signRewardSetting"> <a-form-model-item label="签到奖励设置" prop="signRewardSetting">
<div v-for="(item, index) in dailyScore" :key="index"> <div v-for="(item, index) in dailyScore" :key="index">
@ -66,7 +79,7 @@
>{{ item.label >{{ item.label
}}<a-input }}<a-input
type="number" type="number"
:disabled='setForm.enableSignSetting===false' :disabled="setForm.enableSignSetting === false"
v-model.number="dailyScore[index].value" v-model.number="dailyScore[index].value"
addon-after="分" addon-after="分"
style="width: 100px" style="width: 100px"
@ -131,11 +144,11 @@ export default {
async getData() { async getData() {
let res = await getSetting(); let res = await getSetting();
this.setForm = res.data; this.setForm = res.data;
res.data.signRewardSetting.split(',').forEach((ele,index)=>{ res.data.signRewardSetting.split(",").forEach((ele, index) => {
this.dailyScore[index].value = ele this.dailyScore[index].value = ele;
}) });
this.time[0] = res.data.signBeginTime this.time[0] = res.data.signBeginTime;
this.time[1] = res.data.signEndTime this.time[1] = res.data.signEndTime;
}, },
async onSubmit() { async onSubmit() {
let res = await Setting(this.setForm); let res = await Setting(this.setForm);

Loading…
Cancel
Save