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