Showing
1 changed file
with
29 additions
and
2 deletions
@@ -6,10 +6,15 @@ | @@ -6,10 +6,15 @@ | ||
6 | <Option :value="item.value" v-for="item in query.type" :key="item.value">{{item.label}}</Option> | 6 | <Option :value="item.value" v-for="item in query.type" :key="item.value">{{item.label}}</Option> |
7 | </Select> | 7 | </Select> |
8 | </filter-item> | 8 | </filter-item> |
9 | - <filter-item label="时间选择" v-if="filter.type == 4"> | 9 | + <filter-item label="时间区间" v-if="filter.type == 4"> |
10 | <DatePicker type="datetimerange" @on-change="timeRangeChange" format="yyyy-MM-dd HH:mm:ss" | 10 | <DatePicker type="datetimerange" @on-change="timeRangeChange" format="yyyy-MM-dd HH:mm:ss" |
11 | placeholder="开始时间-结束时间" | 11 | placeholder="开始时间-结束时间" |
12 | - style="width: 260px"></DatePicker> | 12 | + style="width: 300px"></DatePicker> |
13 | + </filter-item> | ||
14 | + <filter-item label="时间区间" v-if="filter.type == 1 || filter.type == 2 || filter.type == 3"> | ||
15 | + <DatePicker type="datetimerange" format="yyyy-MM-dd HH:mm:ss" | ||
16 | + placeholder="开始时间-结束时间" :value="typeRangeVal" | ||
17 | + style="width: 300px" disabled readonly></DatePicker> | ||
13 | </filter-item> | 18 | </filter-item> |
14 | </layout-filter> | 19 | </layout-filter> |
15 | <layout-list> | 20 | <layout-list> |
@@ -47,6 +52,7 @@ export default { | @@ -47,6 +52,7 @@ export default { | ||
47 | startTime: 0, | 52 | startTime: 0, |
48 | endTime: 0 | 53 | endTime: 0 |
49 | }, | 54 | }, |
55 | + typeRangeVal: [], | ||
50 | orderColumns: [ | 56 | orderColumns: [ |
51 | { | 57 | { |
52 | title: 'UID', | 58 | title: 'UID', |
@@ -99,6 +105,27 @@ export default { | @@ -99,6 +105,27 @@ export default { | ||
99 | getData() { | 105 | getData() { |
100 | //1: 全部 2: 今天 3: 昨天 4: 最近一周 5: 自定义 | 106 | //1: 全部 2: 今天 3: 昨天 4: 最近一周 5: 自定义 |
101 | let params = {type: this.filter.type}; | 107 | let params = {type: this.filter.type}; |
108 | + | ||
109 | + let todayStart = new Date(new Date().toLocaleDateString()).getTime(); | ||
110 | + | ||
111 | + | ||
112 | + console.log(todayStart) | ||
113 | + | ||
114 | + switch (+params.type) { | ||
115 | + case 1: | ||
116 | + this.typeRangeVal = [todayStart, todayStart + 24 * 60 * 60 * 1000 - 1000]; | ||
117 | + break; | ||
118 | + case 2: | ||
119 | + this.typeRangeVal = [todayStart - 24 * 60 * 60 * 1000, todayStart - 1000]; | ||
120 | + break; | ||
121 | + case 3: | ||
122 | + this.typeRangeVal = [todayStart - 6 * 24 * 60 * 60 * 1000, todayStart + 24 * 60 * 60 * 1000 - 1000]; | ||
123 | + break; | ||
124 | + default: | ||
125 | + break; | ||
126 | + } | ||
127 | + | ||
128 | + | ||
102 | if (params.type === 4) { | 129 | if (params.type === 4) { |
103 | let {startTime, endTime} = this.timeRange; | 130 | let {startTime, endTime} = this.timeRange; |
104 | 131 |
-
Please register or login to post a comment