Commit 6b924cd1 by 张杰

修复bug

1 parent 2edba1cb
......@@ -97,7 +97,7 @@ export default {
},
data() {
return {
searchForm: {alarmStatus:1},
searchForm: {alarmStatus:1,alarmType:''},
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
......@@ -118,53 +118,48 @@ export default {
},
},
{
text: "昨日",
text: "今日",
onClick(picker) {
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
picker.$emit("pick", [start, end]);
},
},
{
text: "本周",
text: "昨日",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(1).format("YYYY-MM-DD");
const end = new Date();
const start = new Date();
start.setTime(start.getTime() - 3600 * 1000 * 24 * 1);
picker.$emit("pick", [start, end]);
},
},
{
text: "上周",
text: "近7天",
onClick(picker) {
let weekOfDay = parseInt(moment().format("E"));
const end = moment()
.subtract(weekOfDay, "days")
.format("YYYY-MM-DD");
const end = moment().format("YYYY-MM-DD");
const start = moment()
.subtract(weekOfDay + 7 - 1, "days")
.day(moment().day() - 7)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "本月",
text: "近15天",
onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
const start = moment()
.day(moment().day() - 15)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上月",
text: "近30天",
onClick(picker) {
const end = moment()
.month(moment().month() - 1)
.endOf("month")
.format("YYYY-MM-DD");
const end = moment().format("YYYY-MM-DD");
const start = moment()
.month(moment().month() - 1)
.startOf("month")
.day(moment().day() - 30)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
......@@ -189,7 +184,7 @@ export default {
methods: {
// 重置
rest() {
this.searchForm = {};
this.searchForm = {alarmType:''};
this.getList();
},
......@@ -233,6 +228,7 @@ export default {
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
......
......@@ -94,7 +94,7 @@ export default {
},
data() {
return {
searchForm: {},
searchForm: { deviceTypeAndSource: "" },
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
......@@ -189,14 +189,14 @@ export default {
let start = moment()
.day(moment().day() - 3)
.format("YYYY-MM-DD");
this.searchForm.offDate = [start, end];
this.$set(this.searchForm, "offDate", [start, end]);
this.getList();
},
mounted() {},
methods: {
// 重置
rest() {
this.searchForm = {};
this.searchForm = { deviceTypeAndSource: "" };
this.getList();
},
......@@ -248,6 +248,7 @@ export default {
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
......
......@@ -10,7 +10,7 @@
<div class="search_box">
<el-form :inline="true" size="small">
<el-form-item label="报警时间:">
<el-date-picker v-model="searchForm.timeDate" type="daterange" class="data_picker" unlink-panels range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions">
<el-date-picker v-model="searchForm.timeDate" type="daterange" class="data_picker" unlink-panels range-separator="~" start-placeholder="开始日期" end-placeholder="结束日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions" @change="changeDate">
</el-date-picker>
<p class="date_tips">单次查询日期的最长跨度为31天</p>
</el-form-item>
......@@ -98,7 +98,7 @@ export default {
},
data() {
return {
searchForm: { alarmStatus: 1 },
searchForm: { alarmStatus: 1, alarmType: "" },
currentPage: 1,
pageSizes: [10, 20, 30, 40],
pageSize: 10,
......@@ -111,10 +111,10 @@ export default {
pickerOptions: {
shortcuts: [
{
text: "全部",
text: "今日",
onClick(picker) {
const end = "";
const start = "";
const end = new Date();
const start = new Date();
picker.$emit("pick", [start, end]);
},
},
......@@ -128,51 +128,37 @@ export default {
},
},
{
text: "本周",
text: "最近7天",
onClick(picker) {
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(1).format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
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")
.day(moment().day() - 7)
.format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "本月",
text: "本周",
onClick(picker) {
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
const start = moment().weekday(1).format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
{
text: "上月",
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");
const start = moment().add("month", 0).format("YYYY-MM") + "-01";
const end = moment().format("YYYY-MM-DD");
picker.$emit("pick", [start, end]);
},
},
],
onPick: ({ maxDate, minDate }) => {
this.pickerMinDate = minDate.getTime();
if (maxDate) {
this.pickerMinDate = "";
}
},
disabledDate: (time) => {
if (this.pickerMinDate) {
......@@ -182,7 +168,7 @@ export default {
return (
time.getTime() > maxTime ||
time.getTime() < minTime ||
time.getTime() > Date.now() - 1 * 24 * 3600 * 1000
time.getTime() > Date.now()
);
} else {
return time.getTime() > Date.now() + 0 * 24 * 3600 * 1000;
......@@ -206,7 +192,7 @@ export default {
methods: {
// 重置
rest() {
this.searchForm = {};
this.searchForm = { alarmType: "" };
this.pickerMinDate = "";
this.getList();
},
......@@ -251,6 +237,7 @@ export default {
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
......@@ -282,6 +269,13 @@ export default {
let path = `/oEshield#/monitor/activeLocation`;
history.pushState(oParams, "报警位置点", path);
},
//
changeDate(e) {
if (!e) {
this.pickerMinDate = "";
}
},
},
};
</script>
......
......@@ -224,6 +224,7 @@ export default {
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
......
......@@ -275,6 +275,7 @@ export default {
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
......@@ -298,7 +299,7 @@ export default {
let oParams = { ...row };
oParams.lng = row.gpsLng;
oParams.lat = row.gpsLat;
oParams.address = row.activeDate;
oParams.address = row.lastGpsAddress;
oParams.name = row.ownerName;
oParams.standNo = row.vin;
oParams.time = row.finalGpsTime;
......
......@@ -195,6 +195,7 @@ export default {
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
......
......@@ -188,6 +188,7 @@ export default {
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
......
......@@ -113,6 +113,7 @@ export default {
if (e) {
this.orgInfo = e.origin;
this.searchForm.orgId = e.origin.orgId;
this.searchForm.orgType = e.origin.type;
this.searchForm.orgName = e.origin.orgName;
}
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!