index.js
5.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
import moment from '@/common/moment'
// 全部
let allDays = {
text: '全部',
onClick(picker) {
picker.$emit('pick', [])
},
}
// 本月
let currentMonth = {
text: '本月',
onClick(picker) {
const start = moment().add('month', 0).format('YYYY-MM') + '-01'
const end = moment().format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
}
// 今日
let currentDay = {
text: '今日',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
picker.$emit('pick', [end, end])
},
}
// 昨日
let yesterday = {
text: '昨日',
onClick(picker) {
const start = moment()
.day(moment().day() - 1)
.format('YYYY-MM-DD')
const end = moment()
.day(moment().day() - 1)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
}
}
// 近3天
let nearly3Days = {
text: '近3天',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment()
.day(moment().day() - 2)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
}
// 近7天
let nearly7Days = {
text: '近7天',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment()
.day(moment().day() - 6)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
}
}
// 近15天
let nearly15Days = {
text: '近15天',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment()
.day(moment().day() - 14)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
}
}
// 近30天
let nearly30Days = {
text: '近30天',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment()
.day(moment().day() - 29)
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
}
}
// 上月
let lastMonth = {
text: '上月',
onClick(picker) {
const end = moment()
.month(moment().month() - 1)
.endOf('month')
.format('YYYY-MM-DD')
const start = moment()
.month(moment().month() - 1)
.startOf('month')
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
}
// 上周
let lastWeek = {
text: '上周',
onClick(picker) {
let weekOfDay = parseInt(moment().format('E'))
const end = moment().subtract(weekOfDay, 'days').format('YYYY-MM-DD')
const start = moment()
.subtract(weekOfDay + 7 - 1, 'days')
.format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
}
// 本周
let currentWeek = {
text: '本周',
onClick(picker) {
const end = moment().format('YYYY-MM-DD')
const start = moment().weekday(0).format('YYYY-MM-DD')
picker.$emit('pick', [start, end])
},
}
// 前一天
let lastDay = {
text: '前一天',
onClick(picker) {
let value = moment(picker.date).subtract(1, 'day').format('YYYY-MM-DD')
picker.$emit('pick', value)
},
}
// 后一天
let nextDay = {
text: '后一天',
onClick(picker) {
let value = moment(picker.date).subtract(-1, 'day').format('YYYY-MM-DD')
picker.$emit('pick', value)
}
}
// 最近一天不在线
let latelyOneDay = {
text: "近1天不在线",
onClick(picker) {
const start = moment()
.day(moment().day() - 1)
.format("YYYY-MM-DD HH:mm:ss");
picker.$emit("pick", start);
},
}
// 最近三天不在线
let latelyThreeDay = {
text: "近3天不在线",
onClick(picker) {
const start = moment()
.day(moment().day() - 3)
.format("YYYY-MM-DD HH:mm:ss");
picker.$emit("pick", start);
},
}
// 最近7天不在线
let latelySevenDay = {
text: "近7天不在线",
onClick(picker) {
const start = moment()
.day(moment().day() - 7)
.format("YYYY-MM-DD HH:mm:ss");
picker.$emit("pick", start);
},
}
// 警情中心-围栏报警
export const fenceShortcuts = [
allDays,
currentDay,
yesterday,
nearly7Days,
nearly15Days,
nearly30Days
]
// 警情中心-停驶报警
export const shutDownShortcuts = [
allDays,
nearly3Days,
nearly7Days,
currentMonth,
]
// 里程统计详情
export const mileageDetailShortcuts = [
allDays,
yesterday,
currentWeek,
lastWeek,
currentMonth,
lastMonth
]
// 设备激活时间
export const deviceActivedShortcuts = [
allDays,
currentDay,
nearly7Days,
currentMonth,
lastMonth,
nearly30Days
]
// 超速报警
export const speedShortcuts = [
allDays,
yesterday,
lastWeek,
currentMonth,
lastMonth,
]
// 运营统计报表-车辆维度
export const staticReportCarShortcuts = [
allDays,
yesterday,
currentWeek,
lastWeek,
currentMonth,
lastMonth
]
// 警情研判
export const alarmShortcuts = [
lastDay,
nextDay
]
// 警情研判-处理日志
export const alarmLogShortcuts = [
currentDay,
yesterday,
nearly3Days,
nearly7Days,
nearly15Days
]
// 离线报警-离线时间
export const offlineShortcuts = [
latelyOneDay,
latelyThreeDay,
latelySevenDay
]
// 离线报警-激活时间
export const offlineActiveShortcuts = [
allDays,
nearly3Days,
nearly7Days,
currentMonth
]
//通用防拆报警-报警时间
export const tamperAlarmShortcuts = [
currentDay,
yesterday,
nearly7Days,
currentWeek,
currentMonth
]