From e84c5e92533e677778cb3eef9923cd62d5e82935 Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期二, 18 六月 2024 23:11:17 +0800
Subject: [PATCH] update
---
src/views/mdc/processParam/index.vue | 85 ++++++++++++++++++++++++++----------------
1 files changed, 53 insertions(+), 32 deletions(-)
diff --git a/src/views/mdc/processParam/index.vue b/src/views/mdc/processParam/index.vue
index 476f28c..379c2f3 100644
--- a/src/views/mdc/processParam/index.vue
+++ b/src/views/mdc/processParam/index.vue
@@ -158,7 +158,6 @@
time: [moment().format('YYYY-MM-DD'), moment().format('YYYY-MM-DD')],
disabledDate: Date => {
if (!this.timeStart) return false
- console.log(this.timeStart, '????????')
let max = moment(this.timeStart, 'YYYY-MM-DD').add(3, 'd').format('YYYY-MM-DD')
let min = moment(this.timeStart, 'YYYY-MM-DD').subtract(3, 'd').format('YYYY-MM-DD')
return !moment(Date).isBetween(min, max);
@@ -199,14 +198,20 @@
}).then(res => {
if (res.code === 200) {
if (item.name !== 'DeviceStatus') {
- this.tableData = res.data.records
+ this.tableData = res.data.records.map(v => {
+ return {
+ ...v,
+ }
+ })
+ } else {
+ this.tableData = res.data.records.map(item => {
+ return {
+ ...item,
+ value: this.legend.find(v => v.code === item.value)?.name
+ }
+ })
}
- this.tableData = res.data.records.map(item => {
- return {
- ...item,
- value: this.legend.find(v => v.code === item.value)?.name
- }
- })
+
this.drawer = true
}
})
@@ -258,11 +263,12 @@
})
},
setLineOptions(data, myname) {
- console.log(data, myname)
- let xAxis = data.map(item => {
+ if (!data) return
+ // console.log(data, myname)
+ let xAxis = data?.map(item => {
return item.time
})
- let yAxisData = data.map(item => {
+ let yAxisData = data?.map(item => {
return item.value
})
let dayCharts = {
@@ -297,7 +303,6 @@
dayCharts: {}
})
} else {
- console.log(myname, '>>>>>>???????????>>>>>>', yAxisData)
let index = this.list.findIndex(item => item.name === myname)
this.list[index] = Object.assign({
...this.list[index],
@@ -331,34 +336,48 @@
stack: 'total',
barWidth: '20px',
data: [current / total],
- label: {
+ // label: {
+ // show: true,
+ // position: 'insideLeft',
+ // color: '#FFF',
+ // formatter: params => {
+ // if (i == 0 || current === 0) return ''
+ // return `${name}:寮�濮嬫椂闂�${moment(data.data[i - 1].time).format('HH:mm')}-${moment(item.time).format('HH:mm')}`
+ // }
+ // },
+ // itemStyle: {
+ // // color, // 杩欎竴琛屽浐瀹氱殑棰滆壊鍊奸渶瑕佸垹闄ゆ垨娉ㄩ噴
+ // borderColor: '#FFF',
+ // borderWidth: 1
+ // },
+ tooltip: {
show: true,
- position: 'insideLeft',
- color: '#FFF',
- formatter: params => {
+ trigger: 'item',
+ // position: 'dom',
+ triggerOn: 'click',
+ formatter: (value, ticket) => {
+ // console.log('----------1111')
+ // let add = Math.abs(moment(this.timeRange.startTime).diff(moment(this.timeRange.endTime))) * value
+ // let current = moment(this.timeRange.startTime).add(add, 'ms')
+ // console.log('--11111111------------', current)
+ // return current.format('HH:mm')
+ // return value
if (i == 0 || current === 0) return ''
return `${name}:寮�濮嬫椂闂�${moment(data.data[i - 1].time).format('HH:mm')}-${moment(item.time).format('HH:mm')}`
}
},
- itemStyle: {
- // color, // 杩欎竴琛屽浐瀹氱殑棰滆壊鍊奸渶瑕佸垹闄ゆ垨娉ㄩ噴
- borderColor: '#FFF',
- borderWidth: 1
- },
}
})
let dayCharts = {
- // tooltip: {
- // position: ['50%', '50%'],
- // formatter: (value, ticket) => {
- // console.log('>>>>>>>>>>>>____________', value, ticket)
- // let add = Math.abs(moment(this.timeRange.startTime).diff(moment(this.timeRange.endTime))) * value
- // let current = moment(this.timeRange.startTime).add(add, 'ms')
- // return current.format('HH:mm')
- // }
- // },
- legend: [
- ],
+ tooltip: {
+ position: ['50%', '50%'],
+ // formatter: (value, ticket) => {
+ // // console.log('>>>>>>>>>>>>____________', value, ticket)
+ // let add = Math.abs(moment(this.timeRange.startTime).diff(moment(this.timeRange.endTime))) * value
+ // let current = moment(this.timeRange.startTime).add(add, 'ms')
+ // return current.format('HH:mm')
+ // }
+ },
title: {
text: '',
subtext: '',
@@ -380,6 +399,7 @@
},
},
}
+ console.log(dayCharts, '>>>>>>>???')
let index = this.list.findIndex(item => item.name === myname)
this.list[index] = Object.assign({
...this.list[index],
@@ -388,6 +408,7 @@
},
change(e) {
this.timeStart = e[0] || moment().format('YYYY-MM-DD')
+ if (e[1]) this.timeStart = ''
}
},
}
--
Gitblit v1.9.3