feat--时间筛选器增加筛选维度

qianming 1 year ago
parent 392777c188
commit 15fa5d77c4

@ -20,6 +20,7 @@ import {
targetWidgetLinkageLogic, targetWidgetLinkageLogic,
} from "@/views/bigscreenDesigner/designer/linkageLogic"; } from "@/views/bigscreenDesigner/designer/linkageLogic";
import miment from 'miment' import miment from 'miment'
export default { export default {
name: "WidgetFormTime", name: "WidgetFormTime",
props: { props: {
@ -79,6 +80,24 @@ export default {
new Date(start.setHours(0, 0, 0, 0)); new Date(start.setHours(0, 0, 0, 0));
picker.$emit('pick', [start, end]); picker.$emit('pick', [start, end]);
} }
}, {
text: '最近半年',
onClick(picker) {
const end = new Date(new Date(new Date().getTime()).setHours(23, 59, 59, 999));
const start = new Date();
start.setTime(miment().add(-6, 'MM').stamp());
new Date(start.setHours(0, 0, 0, 0));
picker.$emit('pick', [start, end]);
}
}, {
text: '最近一年',
onClick(picker) {
const end = new Date(new Date(new Date().getTime()).setHours(23, 59, 59, 999));
const start = new Date();
start.setTime(miment().add(-1, 'YY').stamp());
new Date(start.setHours(0, 0, 0, 0));
picker.$emit('pick', [start, end]);
}
}], }],
// disabledDate(time){ // disabledDate(time){
// return time.getTime() > Date.now() // return time.getTime() > Date.now()
@ -144,6 +163,7 @@ export default {
height: 100%; height: 100%;
background: inherit; background: inherit;
color: inherit; color: inherit;
&::placeholder { &::placeholder {
color: inherit; color: inherit;
} }

Loading…
Cancel
Save