Skip to content

Commit dedb83f

Browse files
committed
运维中心耗时排行增加shortcut
1 parent 1a62acd commit dedb83f

File tree

1 file changed

+45
-2
lines changed
  • web/src/apps/workflows/module/dispatch/dashboard

1 file changed

+45
-2
lines changed

web/src/apps/workflows/module/dispatch/dashboard/index.vue

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@
6868
<div class="time-model">
6969
<template>
7070
<Date-picker
71-
style="width: 430px"
71+
style="width: 520px"
7272
v-model="consumptionTime"
7373
type="datetimerange"
7474
@on-change="changeTime"
7575
range-separator="-"
76+
:options="options1"
7677
format="yyyy-MM-dd HH:mm:ss">
7778
</Date-picker>
7879
</template>
@@ -146,7 +147,49 @@ export default {
146147
147148
consumptionList: [],
148149
consumptionTime: [],
149-
consumptionParams: {}
150+
consumptionParams: {},
151+
options1: {
152+
shortcuts: [
153+
{
154+
text: '今天',
155+
value () {
156+
const start = new Date();
157+
start.setHours(0)
158+
start.setMinutes(0)
159+
start.setSeconds(0)
160+
const end = new Date();
161+
return [start, end];
162+
}
163+
},
164+
{
165+
text: '昨天',
166+
value () {
167+
const end = new Date();
168+
end.setHours(0)
169+
end.setMinutes(0)
170+
end.setSeconds(0)
171+
const start = new Date();
172+
start.setTime(start.getTime() - 3600 * 1000 * 24);
173+
start.setHours(0)
174+
start.setMinutes(0)
175+
start.setSeconds(0)
176+
return [start, end];
177+
}
178+
},
179+
{
180+
text: '最近一周',
181+
value () {
182+
const end = new Date();
183+
const start = new Date();
184+
start.setHours(0)
185+
start.setMinutes(0)
186+
start.setSeconds(0)
187+
start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
188+
return [start, end];
189+
}
190+
}
191+
]
192+
}
150193
}
151194
},
152195
props: {

0 commit comments

Comments
 (0)