Commit 85e7f91d by 张杰

v1.7.1版本需求

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