Commit bba89b48ced855a9c0c964789162bbc936141fce

Authored by 史婷婷
1 parent 1f130143

feat: 消息列表-默认筛选时间去除

Showing 1 changed file with 3 additions and 16 deletions
@@ -95,9 +95,9 @@ export default { @@ -95,9 +95,9 @@ export default {
95 } 95 }
96 }, 96 },
97 created() { 97 created() {
98 - const [start, end] = this.getDefaultDateRange()  
99 - this.filterForm.dateRange = [start, end]  
100 - this.query = { readed: this.filterForm.readed, dateRange: [start, end] } 98 + // 初始化时清空时间筛选,不设置默认值
  99 + this.filterForm.dateRange = []
  100 + this.query = { readed: this.filterForm.readed, dateRange: [] }
101 }, 101 },
102 onReachBottom() { 102 onReachBottom() {
103 if (this.$refs && this.$refs.cardRef && this.$refs.cardRef.onLoadMore) { 103 if (this.$refs && this.$refs.cardRef && this.$refs.cardRef.onLoadMore) {
@@ -111,19 +111,6 @@ export default { @@ -111,19 +111,6 @@ export default {
111 } 111 }
112 }, 112 },
113 methods: { 113 methods: {
114 - // 默认日期范围:当前日期前一个月到今日  
115 - getDefaultDateRange() {  
116 - const fmt = d => {  
117 - const y = d.getFullYear()  
118 - const m = String(d.getMonth() + 1).padStart(2, '0')  
119 - const dd = String(d.getDate()).padStart(2, '0')  
120 - return `${y}-${m}-${dd}`  
121 - }  
122 - const end = new Date()  
123 - const start = new Date(end)  
124 - start.setMonth(start.getMonth() - 1)  
125 - return [fmt(start), fmt(end)]  
126 - },  
127 onCardLoaded({ items }) { 114 onCardLoaded({ items }) {
128 this.currentItems = items 115 this.currentItems = items
129 }, 116 },