From 5158d9a315339f99daaad06c5029ef1974f4b4ff Mon Sep 17 00:00:00 2001 From: g7hoo Date: Wed, 21 Sep 2022 10:59:35 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=AE=BE=E5=A4=87=E6=95=88=E7=8E=87?= =?UTF-8?q?=E5=88=86=E6=9E=90=E6=8E=A5=E5=8F=A3=E8=81=94=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/equipmentEfficiency.vue | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/src/views/modules/monitoring/equipmentEfficiency.vue b/src/views/modules/monitoring/equipmentEfficiency.vue index 6559606..e7a190b 100644 --- a/src/views/modules/monitoring/equipmentEfficiency.vue +++ b/src/views/modules/monitoring/equipmentEfficiency.vue @@ -213,12 +213,12 @@ export default { getTimeRange() { let startTime let endTime - if (this.headFormValue.timeValue instanceof Array) { - startTime = this.headFormValue.timeValue[0] ? moment(this.headFormValue.timeValue[0]).format('YYYY-MM-DDTHH:mm:ss') : '' // 强制axios使用北京时间 - endTime = this.headFormValue.timeValue[1] ? moment(this.headFormValue.timeValue[1]).format('YYYY-MM-DDTHH:mm:ss') : '' + if (this.rawTime instanceof Array) { + startTime = this.rawTime[0] ? moment(this.rawTime[0]).format('YYYY-MM-DDTHH:mm:ss') : '' // 强制axios使用北京时间 + endTime = this.rawTime[1] ? moment(this.rawTime[1]).format('YYYY-MM-DDTHH:mm:ss') : '' } else { - if (this.headFormValue.timeValue) { - startTime = moment(this.headFormValue.timeValue).format('YYYY-MM-DDTHH:mm:ss') + if (this.rawTime) { + startTime = moment(this.rawTime).format('YYYY-MM-DDTHH:mm:ss') endTime = moment(startTime) .add(1, 'd') .format('YYYY-MM-DDTHH:mm:ss') @@ -232,24 +232,23 @@ export default { // 获取数据列表 getDataList() { + const { startTime, endTime } = this.getTimeRange() + this.dataListLoading = true this.$http({ - url: this.$http.adornUrl('/monitoring/equipment/page'), - method: 'get', - params: this.$http.adornParams({ - page: this.pageIndex, - limit: this.pageSize, - key: this.dataForm.key - }) - }).then(({ data }) => { - if (data && data.code === 0) { - this.dataList = data.data.list - this.totalPage = data.data.total - } else { - this.dataList = [] - this.totalPage = 0 + url: this.$http.adornUrl('/monitoring/eqAnalysis/oee'), + method: 'post', + data: { + startTime, + endTime, + ftId: this.dataForm.ftId, + productlines: this.dataForm.productlines, + limit: this.pageIndex, + page: this.pageSize, + type: 1 } - this.dataListLoading = false + }).then(({ data: res }) => { + console.log('oee data:', res) }) }, // 每页数