单体电池数据点击可以查看表格
This commit is contained in:
@ -46,6 +46,7 @@ export default {
|
|||||||
siteId:'',
|
siteId:'',
|
||||||
deviceId:'',
|
deviceId:'',
|
||||||
clusterDeviceId:'',
|
clusterDeviceId:'',
|
||||||
|
dataType:'',//展示的数据类型 空值展示所有数据
|
||||||
pickerOptions:{
|
pickerOptions:{
|
||||||
disabledDate(time) {
|
disabledDate(time) {
|
||||||
return time.getTime() > Date.now();
|
return time.getTime() > Date.now();
|
||||||
@ -82,10 +83,11 @@ export default {
|
|||||||
this.dateRange=[]
|
this.dateRange=[]
|
||||||
this.getData()
|
this.getData()
|
||||||
},
|
},
|
||||||
initChart({siteId, clusterDeviceId, deviceId}) {
|
initChart({siteId, clusterDeviceId, deviceId},dataType) {
|
||||||
this.siteId=siteId
|
this.siteId=siteId
|
||||||
this.clusterDeviceId=clusterDeviceId
|
this.clusterDeviceId=clusterDeviceId
|
||||||
this.deviceId=deviceId
|
this.deviceId=deviceId
|
||||||
|
this.dataType=dataType
|
||||||
this.dateRange=[]
|
this.dateRange=[]
|
||||||
this.dialogTableVisible = true
|
this.dialogTableVisible = true
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
@ -94,10 +96,47 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
setOption(data) {
|
setOption(data) {
|
||||||
const source = [['日期','电压','温度','SOC','SOH']]
|
const obj = {
|
||||||
|
voltage:'电压',
|
||||||
|
temperature:'温度',
|
||||||
|
soc:'SOC',
|
||||||
|
soh:'SOH',
|
||||||
|
}
|
||||||
|
let source,series,{dataType} = this
|
||||||
|
if(dataType){
|
||||||
|
source = [['日期',obj[dataType]]]
|
||||||
|
data.forEach(item => {
|
||||||
|
source.push([item.dataTimestamp,item[dataType]])
|
||||||
|
})
|
||||||
|
series=[{
|
||||||
|
name:obj[dataType],
|
||||||
|
type: 'line',
|
||||||
|
}]
|
||||||
|
}else{
|
||||||
|
source = [['日期','电压','温度','SOC','SOH']]
|
||||||
data.forEach(item => {
|
data.forEach(item => {
|
||||||
source.push([item.dataTimestamp,item.voltage,item.temperature,item.soc,item.soh])
|
source.push([item.dataTimestamp,item.voltage,item.temperature,item.soc,item.soh])
|
||||||
})
|
})
|
||||||
|
series=[
|
||||||
|
{
|
||||||
|
name:'电压',
|
||||||
|
type: 'line',
|
||||||
|
|
||||||
|
},{
|
||||||
|
name:'温度',
|
||||||
|
type: 'line',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:'SOC',
|
||||||
|
type: 'line',
|
||||||
|
|
||||||
|
},{
|
||||||
|
name:'SOH',
|
||||||
|
type: 'line',
|
||||||
|
}]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
this.chart && this.chart.setOption({
|
this.chart && this.chart.setOption({
|
||||||
color:['#FFBD00','#3C81FF','#05AEA3','#F86F70'],
|
color:['#FFBD00','#3C81FF','#05AEA3','#F86F70'],
|
||||||
legend: {
|
legend: {
|
||||||
@ -121,23 +160,7 @@ export default {
|
|||||||
dataset:{
|
dataset:{
|
||||||
source
|
source
|
||||||
},
|
},
|
||||||
series: [
|
series
|
||||||
{
|
|
||||||
name:'电压',
|
|
||||||
type: 'line',
|
|
||||||
|
|
||||||
},{
|
|
||||||
name:'温度',
|
|
||||||
type: 'line',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name:'SOC',
|
|
||||||
type: 'line',
|
|
||||||
|
|
||||||
},{
|
|
||||||
name:'SOH',
|
|
||||||
type: 'line',
|
|
||||||
}]
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -48,18 +48,50 @@
|
|||||||
prop="voltage"
|
prop="voltage"
|
||||||
label="电压(V)"
|
label="电压(V)"
|
||||||
>
|
>
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
@click="chartDetail(scope.row,'voltage')"
|
||||||
|
type="text"
|
||||||
|
size="small">
|
||||||
|
{{scope.row.voltage}}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="temperature"
|
prop="temperature"
|
||||||
label="温度(℃)">
|
label="温度(℃)">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
@click="chartDetail(scope.row,'temperature')"
|
||||||
|
type="text"
|
||||||
|
size="small">
|
||||||
|
{{scope.row.temperature}}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="soc"
|
prop="soc"
|
||||||
label="SOC(%)">
|
label="SOC(%)">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
@click="chartDetail(scope.row,'soc')"
|
||||||
|
type="text"
|
||||||
|
size="small">
|
||||||
|
{{scope.row.soc}}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
prop="soh"
|
prop="soh"
|
||||||
label="SOH(%)">
|
label="SOH(%)">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
@click="chartDetail(scope.row,'soh')"
|
||||||
|
type="text"
|
||||||
|
size="small">
|
||||||
|
{{scope.row.soh}}
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="曲线图">
|
label="曲线图">
|
||||||
@ -115,9 +147,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
//查看表格行图表
|
//查看表格行图表
|
||||||
chartDetail(row){
|
chartDetail(row,dataType = ''){
|
||||||
const { clusterDeviceId, deviceId} = row,{siteId} = this
|
const { clusterDeviceId, deviceId} = row,{siteId} = this
|
||||||
this.$refs.chartDetail.initChart({siteId,clusterDeviceId,deviceId})
|
this.$refs.chartDetail.initChart({siteId,clusterDeviceId,deviceId},dataType)
|
||||||
},
|
},
|
||||||
// 分页
|
// 分页
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
|
|||||||
Reference in New Issue
Block a user