Commit 85e7f91d by 张杰

v1.7.1版本需求

1 parent 27598af6
......@@ -118,20 +118,43 @@ export default {
};
},
created() {
let end = moment().format("YYYY-MM-DD") + " 23:59:59";
let start =
moment()
.day(moment().day() - 3)
.format("YYYY-MM-DD") + " 00:00:00";
console.log(start + "--" + end);
this.$set(this.searchForm, "offDate", [start, end]);
let query = this.$route.query;
let end = moment().format("YYYY-MM-DD HH:mm:ss");
let start = moment()
.day(moment().day() - 3)
.format("YYYY-MM-DD HH:mm:ss");
if (query.startTime) {
this.$set(this.searchForm, "offDate", [query.startTime, query.endTime]);
} else {
this.$set(this.searchForm, "offDate", [start, end]);
}
// 动态设置禁用日期
let disabledDate = function (e) {
let n = moment(e).format("x");
let max = moment().format("x");
if (query.endTime) {
max = moment(query.endTime).format("x");
}
if (n < max) {
return false;
} else {
return true;
}
};
this.$set(this.offPickerOptions, "disabledDate", disabledDate);
this.getList();
},
mounted() {},
methods: {
// 重置
rest() {
this.searchForm = { deviceTypeAndSource: "" };
let end = moment().format("YYYY-MM-DD HH:mm:ss");
let start = moment()
.day(moment().day() - 3)
.format("YYYY-MM-DD HH:mm:ss");
this.searchForm = { deviceTypeAndSource: "", offDate: [start, end] };
this.getList();
},
......@@ -223,10 +246,9 @@ export default {
//history.pushState(oParams, "报警位置点", path);
},
onChangeDate(e){
console.log(e)
}
onChangeDate(e) {
console.log(e);
},
},
};
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!