From 762861a922611c87936bf1c8b24df79cec4e6dcb Mon Sep 17 00:00:00 2001 From: lb Date: Fri, 14 Oct 2022 14:03:00 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E6=95=B0=E6=8D=AE=E5=88=86=E6=9E=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/equipmentEfficiency.vue | 69 ++++++++++--------- .../modules/monitoring/equipmentException.vue | 11 +-- .../monitoring/equipmentTimesequence.vue | 53 +++++++------- 3 files changed, 69 insertions(+), 64 deletions(-) diff --git a/src/views/modules/monitoring/equipmentEfficiency.vue b/src/views/modules/monitoring/equipmentEfficiency.vue index 1db061e..3e24c7f 100644 --- a/src/views/modules/monitoring/equipmentEfficiency.vue +++ b/src/views/modules/monitoring/equipmentEfficiency.vue @@ -5,14 +5,15 @@ - + - + @@ -29,15 +30,8 @@ - + @@ -48,7 +42,8 @@ - + - + @@ -30,14 +31,8 @@
-
+
请先查询数据
@@ -107,7 +102,7 @@ class ChartOption { } } this.tooltip = { - formatter: function(params) { + formatter: function (params) { return moment(params.value[1]).format('YYYY-MM-DD HH:mm:ss') + ' - ' + moment(params.value[2]).format('YYYY-MM-DD HH:mm:ss') + ' : ' + params.name } } @@ -132,7 +127,7 @@ class ChartOption { show: true }, axisLabel: { - formatter: function(val) { + formatter: function (val) { const time = new Date(val) const hour = time.getHours() const minute = time.getMinutes() @@ -223,17 +218,14 @@ export default { BaseTable }, computed: { - autoHeight: function() { + autoHeight: function () { return Object.keys(this.equipments).length * 100 || 500 }, - equipmentCount: function() { + equipmentCount: function () { return Object.keys(this.equipments).length } }, created() { - this.getProductLineList().then(() => { - this.getWorksetionList() - }) this.getEqList() }, mounted() { @@ -241,6 +233,11 @@ export default { this.initChart() }) }, + activated() { + this.getProductLineList().then(() => { + this.getWorksetionList() + }) + }, updated() { if (this.chart) this.chart.resize() }, @@ -259,11 +256,11 @@ export default { // 获取产线列表 getProductLineList() { return this.$http({ - url: this.$http.adornUrl('/monitoring/productionLine/page'), + url: this.$http.adornUrl('/monitoring/productionLine/list'), method: 'get' - }).then(({ data }) => { - if (data && data.code === 0) { - this.productLineList = data.data.list + }).then(({ data: res }) => { + if (res && res.code === 0) { + this.productLineList = res.data /** set default */ if (this.productLineList.length) { this.dataForm.productlines = this.productLineList[0].id @@ -354,13 +351,13 @@ export default { getDataList() { let startTime = this.rawTime ? moment(this.rawTime) - .set({ hour: 0, minute: 0, second: 0, millisecond: 0 }) - .format('YYYY-MM-DDTHH:mm:ss') + .set({ hour: 0, minute: 0, second: 0, millisecond: 0 }) + .format('YYYY-MM-DDTHH:mm:ss') : '' let endTime = startTime ? moment(startTime) - .add(1, 'd') - .format('YYYY-MM-DDTHH:mm:ss') + .add(1, 'd') + .format('YYYY-MM-DDTHH:mm:ss') : '' // this.dataListLoading = true @@ -471,13 +468,13 @@ export default { dialogConfirm() { let startTime = this.rawTime ? moment(this.rawTime) - .set({ hour: 0, minute: 0, second: 0, millisecond: 0 }) - .format('YYYY-MM-DDTHH:mm:ss') + .set({ hour: 0, minute: 0, second: 0, millisecond: 0 }) + .format('YYYY-MM-DDTHH:mm:ss') : '' let endTime = startTime ? moment(startTime) - .add(1, 'd') - .format('YYYY-MM-DDTHH:mm:ss') + .add(1, 'd') + .format('YYYY-MM-DDTHH:mm:ss') : '' const condition = { -- 2.45.2