diff --git a/src/views/em/mpoint.vue b/src/views/em/mpoint.vue index 85294d98..b6fd20a6 100644 --- a/src/views/em/mpoint.vue +++ b/src/views/em/mpoint.vue @@ -258,7 +258,13 @@ :size="1000" destroy-on-close > - + @@ -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) {