修改方案数据&设备补召
This commit is contained in:
@@ -22,8 +22,12 @@
|
||||
<p>测试项信息</p>
|
||||
</div> -->
|
||||
<el-tabs v-model="activeName" type="border-card" @click="handleClickTabs">
|
||||
<el-tab-pane v-for="(item, index) in deviceData.records" :label="item.itemName"
|
||||
:name="item.id" :key="index">
|
||||
<el-tab-pane
|
||||
v-for="(item, index) in deviceData.records"
|
||||
:label="item.itemName"
|
||||
:name="item.id"
|
||||
:key="index"
|
||||
>
|
||||
<template #label>
|
||||
<span class="custom-tabs-label">
|
||||
<el-icon>
|
||||
@@ -101,10 +105,20 @@
|
||||
<div class="history_header">
|
||||
<el-form :model="searchForm" class="history_select" id="history_select">
|
||||
<el-form-item label="统计指标" label-width="80px">
|
||||
<el-select collapse-tags collapse-tags-tooltip v-model="searchForm.index"
|
||||
placeholder="请选择统计指标" multiple :multiple-limit="3">
|
||||
<el-option v-for="item in indexOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
<el-select
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
v-model="searchForm.index"
|
||||
placeholder="请选择统计指标"
|
||||
multiple
|
||||
:multiple-limit="3"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in indexOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="值类型">
|
||||
@@ -114,20 +128,36 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<div v-for="(item, index) in countData" :key="index">
|
||||
<el-form-item :label="item.name + '谐波次数'" label-width="180px"
|
||||
v-if="item.countOptions.length != 0">
|
||||
<el-form-item
|
||||
:label="item.name + '谐波次数'"
|
||||
label-width="180px"
|
||||
v-if="item.countOptions.length != 0"
|
||||
>
|
||||
<!-- multiple -->
|
||||
<el-select v-model="item.count" collapse-tags collapse-tags-tooltip
|
||||
placeholder="请选择谐波次数" style="width: 100px">
|
||||
<el-option v-for="vv in item.countOptions" :key="vv" :label="vv"
|
||||
:value="vv"></el-option>
|
||||
<el-select
|
||||
v-model="item.count"
|
||||
collapse-tags
|
||||
collapse-tags-tooltip
|
||||
placeholder="请选择谐波次数"
|
||||
style="width: 100px"
|
||||
>
|
||||
<el-option
|
||||
v-for="vv in item.countOptions"
|
||||
:key="vv"
|
||||
:label="vv"
|
||||
:value="vv"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item label="统计类型" label-width="80px">
|
||||
<el-select v-model="searchForm.type" placeholder="请选择值类型">
|
||||
<el-option v-for="item in typeOptions" :key="item.id" :label="item.name"
|
||||
:value="item.id"></el-option>
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
@@ -493,9 +523,9 @@ const init = (flag: boolean) => {
|
||||
list[i].seriesName +
|
||||
' ' +
|
||||
`<div style="width:16px;height:16px;float:left;background:${list[i].color};border-radius:50%;margin:0 15px"></div>` +
|
||||
`<div style='float:right;padding-left:20px;'>${list[i].value[1].toFixed(
|
||||
2
|
||||
)} </div><br/>`
|
||||
`<div style='float:right;padding-left:20px;'>${
|
||||
list[i].value[1] == null ? '' : list[i].value[1].toFixed(2)
|
||||
} </div><br/>`
|
||||
}
|
||||
return res
|
||||
}
|
||||
@@ -506,7 +536,7 @@ const init = (flag: boolean) => {
|
||||
formatter: {
|
||||
day: '{MM}-{dd}',
|
||||
month: '{MM}',
|
||||
year: '{yyyy}',
|
||||
year: '{yyyy}'
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -586,7 +616,7 @@ const init = (flag: boolean) => {
|
||||
chartsList
|
||||
.map((kk: any, kks: any) => {
|
||||
if (kk.statisticalName == vv.name) {
|
||||
return Array.from(new Set([xAxis[kks], kk.statisticalData]))
|
||||
return [xAxis[kks], kk.statisticalData]
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
@@ -600,7 +630,7 @@ const init = (flag: boolean) => {
|
||||
})
|
||||
})
|
||||
//处理多y轴
|
||||
if (unitList.length != 0 && unitList.length > 1) {
|
||||
// if (unitList.length != 0 && unitList.length > 1) {
|
||||
console.log(max, min)
|
||||
// echartsData.value.options.yAxis[0].yAxisIndex = 0
|
||||
unitList.map((item: any, index: any) => {
|
||||
@@ -641,7 +671,7 @@ const init = (flag: boolean) => {
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
// }
|
||||
//设置数据项颜色
|
||||
echartsData.value.options.series.map((item: any, index: any) => {
|
||||
item.itemStyle = {
|
||||
@@ -726,7 +756,7 @@ const handleExport = async () => {
|
||||
xAxis = timeList.sort((a: any, b: any) => {
|
||||
new Date(a).getTime() - new Date(b).getTime()
|
||||
})
|
||||
xAxis = Array.from(new Set(xAxis))
|
||||
// xAxis = Array.from(new Set(xAxis))
|
||||
// 使用这个函数转换数据为CSV格式
|
||||
let csv: any = ''
|
||||
const list = echartsData.value.options.series
|
||||
@@ -750,13 +780,12 @@ const handleExport = async () => {
|
||||
count = index
|
||||
}
|
||||
let itemList: any = list[index].data[indexs]
|
||||
console.log(itemList);
|
||||
if(itemList&&itemList.length!=0){
|
||||
console.log(itemList)
|
||||
if (itemList && itemList.length != 0) {
|
||||
index == list.length - 1 ? (strs += itemList[1]) : (strs += itemList[1] + ',')
|
||||
}else{
|
||||
index == list.length - 1 ? strs += '/' :strs += '/,'
|
||||
} else {
|
||||
index == list.length - 1 ? (strs += '/') : (strs += '/,')
|
||||
}
|
||||
|
||||
})
|
||||
if (count == 0 && xAxis[indexs]) {
|
||||
csv += `${xAxis[indexs]},` + strs + '\n'
|
||||
|
||||
Reference in New Issue
Block a user