fix:测点原始记录改动查询条件-半个小时
This commit is contained in:
parent
5ca9fb5332
commit
3827d3ce86
|
@ -258,7 +258,13 @@
|
||||||
:size="1000"
|
:size="1000"
|
||||||
destroy-on-close
|
destroy-on-close
|
||||||
>
|
>
|
||||||
<scTable ref="tableMplog" row-key="id" :data="mplogRecord">
|
<scTable
|
||||||
|
ref="tableMplog"
|
||||||
|
row-key="id"
|
||||||
|
:apiObj="apiObjMplog"
|
||||||
|
:query="query1"
|
||||||
|
:params="params1"
|
||||||
|
>
|
||||||
<el-table-column type="selection" width="50" />
|
<el-table-column type="selection" width="50" />
|
||||||
<el-table-column label="采集时间" prop="timex"></el-table-column>
|
<el-table-column label="采集时间" prop="timex"></el-table-column>
|
||||||
<el-table-column label="采集数值">
|
<el-table-column label="采集数值">
|
||||||
|
@ -305,10 +311,12 @@ export default {
|
||||||
permission: false,
|
permission: false,
|
||||||
},
|
},
|
||||||
apiObj: this.$API.enm.mpoint.list,
|
apiObj: this.$API.enm.mpoint.list,
|
||||||
|
apiObjMplog: null,
|
||||||
params: {},
|
params: {},
|
||||||
|
params1: {},
|
||||||
query: {},
|
query: {},
|
||||||
|
query1: {},
|
||||||
selection: [],
|
selection: [],
|
||||||
mplogRecord: [],
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -329,40 +337,25 @@ export default {
|
||||||
//原始测点记录
|
//原始测点记录
|
||||||
mplog_record(row) {
|
mplog_record(row) {
|
||||||
let that = this;
|
let that = this;
|
||||||
that.mplogRecord = [];
|
that.apiObjMplog = null;
|
||||||
var nowDate = new Date();
|
var nowDate = new Date();
|
||||||
let year = nowDate.getFullYear();
|
let timers = nowDate.getTime() - 1000 * 60 * 30; //半小时
|
||||||
let month = nowDate.getMonth() + 1;
|
|
||||||
let day = nowDate.getDate();
|
|
||||||
let hour = nowDate.getHours();
|
|
||||||
month = month > 9 ? month : "0" + month;
|
|
||||||
day = day > 9 ? day : "0" + day;
|
|
||||||
if (hour > 0) {
|
|
||||||
hour = hour - 1;
|
|
||||||
hour = hour > 9 ? hour : "0" + hour;
|
|
||||||
} else {
|
|
||||||
hour = 23;
|
|
||||||
let timers = nowDate.getTime() - 1000 * 60 * 60; //上一小时
|
|
||||||
let useDate = new Date(timers);
|
let useDate = new Date(timers);
|
||||||
year = useDate.getFullYear();
|
let year = useDate.getFullYear();
|
||||||
month = useDate.getMonth() + 1;
|
let month = useDate.getMonth() + 1;
|
||||||
|
let day = useDate.getDate();
|
||||||
|
let hour = useDate.getHours();
|
||||||
|
let min = useDate.getMinutes();
|
||||||
month = month > 9 ? month : "0" + month;
|
month = month > 9 ? month : "0" + month;
|
||||||
day = nowDate.getDate();
|
|
||||||
day = day > 9 ? day : "0" + day;
|
day = day > 9 ? day : "0" + day;
|
||||||
}
|
hour = hour > 9 ? hour : "0" + hour;
|
||||||
|
min = min > 9 ? min : "0" + min;
|
||||||
let obj = {};
|
let obj = {};
|
||||||
obj.page = 0;
|
that.params1.mpoint = row.id;
|
||||||
obj.mpoint = row.id;
|
that.params1.timex__gte =
|
||||||
obj.timex__gte =
|
year + "-" + month + "-" + day + " " + hour + ":" + min + ":00";
|
||||||
year + "-" + month + "-" + day + " " + hour + ":00:00";
|
that.apiObjMplog = that.$API.enm.mplogx;
|
||||||
obj.timex__lte =
|
|
||||||
year + "-" + month + "-" + day + " " + hour + ":59:00";
|
|
||||||
that.$API.enm.mplogx.req(obj).then((res) => {
|
|
||||||
console.log("res", res);
|
|
||||||
that.mplogRecord = res;
|
|
||||||
that.logShow = true;
|
that.logShow = true;
|
||||||
});
|
|
||||||
},
|
},
|
||||||
//查看
|
//查看
|
||||||
table_show(row) {
|
table_show(row) {
|
||||||
|
|
Loading…
Reference in New Issue