修改bug
This commit is contained in:
@@ -239,4 +239,7 @@ defineExpose({ open })
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
.el-form--inline .el-form-item {
|
||||||
|
margin-bottom: 10px !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -285,15 +285,15 @@ const init = () => {
|
|||||||
left: '3%',
|
left: '3%',
|
||||||
right: '5%'
|
right: '5%'
|
||||||
},
|
},
|
||||||
tooltip: {
|
// tooltip: {
|
||||||
trigger: 'axis',
|
// trigger: 'axis',
|
||||||
axisPointer: {
|
// axisPointer: {
|
||||||
type: 'cross',
|
// type: 'cross',
|
||||||
label: {
|
// label: {
|
||||||
show: false
|
// show: false
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
},
|
// },
|
||||||
legend: {
|
legend: {
|
||||||
data: [],
|
data: [],
|
||||||
itemGap: 15,
|
itemGap: 15,
|
||||||
@@ -359,7 +359,7 @@ const init = () => {
|
|||||||
list.push({ phase: item.phase, title: item.title, list: item.phaseList })
|
list.push({ phase: item.phase, title: item.title, list: item.phaseList })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
const colorList = ['#00CC99', '#FF9900', '#1DD0CE', 'cadetblue']
|
const colorList = ['#0e8780', '#FFCC00', '#009900', '#CC0000', ]
|
||||||
list.map((item: any, index: any) => {
|
list.map((item: any, index: any) => {
|
||||||
echartsData.value.options.legend.data.push(item.title)
|
echartsData.value.options.legend.data.push(item.title)
|
||||||
echartsData.value.options.series.push({
|
echartsData.value.options.series.push({
|
||||||
|
|||||||
@@ -313,21 +313,21 @@ const initRadioCharts = () => {
|
|||||||
value: 160,
|
value: 160,
|
||||||
name: 'A相',
|
name: 'A相',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#A5292A'
|
color: '#FFCC00'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 70,
|
value: 70,
|
||||||
name: 'B相',
|
name: 'B相',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#DAA521'
|
color: '#009900'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: 40,
|
value: 40,
|
||||||
name: 'C相',
|
name: 'C相',
|
||||||
itemStyle: {
|
itemStyle: {
|
||||||
color: '#2F8A57'
|
color: '#CC0000'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -431,6 +431,7 @@ const columnsData: any = ref([])
|
|||||||
const getColumns = () => {
|
const getColumns = () => {
|
||||||
getRealTimeTableList().then(res => {
|
getRealTimeTableList().then(res => {
|
||||||
columnsData.value = res.data
|
columnsData.value = res.data
|
||||||
|
getTableData(dataList.value)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
//处理表格数据
|
//处理表格数据
|
||||||
@@ -441,6 +442,8 @@ const getTableData = (list: any) => {
|
|||||||
tableData.value = list
|
tableData.value = list
|
||||||
columnsDataTop.value = []
|
columnsDataTop.value = []
|
||||||
columnsDataBot.value = []
|
columnsDataBot.value = []
|
||||||
|
console.log('🚀 ~ columnsData.value.map ~ columnsData.value:', columnsData.value)
|
||||||
|
|
||||||
columnsData.value.map((item: any, index: any) => {
|
columnsData.value.map((item: any, index: any) => {
|
||||||
item.map((vv: any) => {
|
item.map((vv: any) => {
|
||||||
vv.statisticalData = list.find((kk: any) => {
|
vv.statisticalData = list.find((kk: any) => {
|
||||||
@@ -448,7 +451,7 @@ const getTableData = (list: any) => {
|
|||||||
})?.statisticalData
|
})?.statisticalData
|
||||||
})
|
})
|
||||||
if (index < 4) {
|
if (index < 4) {
|
||||||
columnsDataTop.value.push(item)
|
columnsDataTop.value.push(item)
|
||||||
}
|
}
|
||||||
if (index >= 4) {
|
if (index >= 4) {
|
||||||
columnsDataBot.value.push(item)
|
columnsDataBot.value.push(item)
|
||||||
@@ -460,7 +463,7 @@ const getTableData = (list: any) => {
|
|||||||
const iRadioList: any = ref([]),
|
const iRadioList: any = ref([]),
|
||||||
vRadioList: any = ref([])
|
vRadioList: any = ref([])
|
||||||
//获取实时数据
|
//获取实时数据
|
||||||
const getRealTimeData = (val: any) => {
|
const getRealTimeData = async (val: any) => {
|
||||||
iRadioList.value = []
|
iRadioList.value = []
|
||||||
vRadioList.value = []
|
vRadioList.value = []
|
||||||
val.map((item: any) => {
|
val.map((item: any) => {
|
||||||
@@ -476,9 +479,9 @@ const getRealTimeData = (val: any) => {
|
|||||||
initRadioCharts()
|
initRadioCharts()
|
||||||
loading.value = true
|
loading.value = true
|
||||||
if (val.length != 0) {
|
if (val.length != 0) {
|
||||||
getColumns()
|
|
||||||
getTableData(val)
|
|
||||||
dataList.value = val
|
dataList.value = val
|
||||||
|
await getColumns()
|
||||||
|
|
||||||
dataList.value.map((item: any, index: any) => {
|
dataList.value.map((item: any, index: any) => {
|
||||||
if (item.anotherName == '相电压总有效值') {
|
if (item.anotherName == '相电压总有效值') {
|
||||||
listV.value.push(item)
|
listV.value.push(item)
|
||||||
@@ -490,73 +493,62 @@ const getRealTimeData = (val: any) => {
|
|||||||
|
|
||||||
echartsDataV1.value.options.series[0].data = [
|
echartsDataV1.value.options.series[0].data = [
|
||||||
{
|
{
|
||||||
name:
|
name: 'A相',
|
||||||
|
value:
|
||||||
listV.value.find((item: any) => {
|
listV.value.find((item: any) => {
|
||||||
return item.phase == 'A'
|
return item.phase == 'A'
|
||||||
})?.phase + '相',
|
})?.statisticalData || 0
|
||||||
value: listV.value.find((item: any) => {
|
|
||||||
return item.phase == 'A'
|
|
||||||
})?.statisticalData
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
pieChart1.value.initChart()
|
pieChart1.value.initChart()
|
||||||
|
|
||||||
echartsDataV2.value.options.series[0].data = [
|
echartsDataV2.value.options.series[0].data = [
|
||||||
{
|
{
|
||||||
name:
|
name: 'B相',
|
||||||
|
value:
|
||||||
listV.value.find((item: any) => {
|
listV.value.find((item: any) => {
|
||||||
return item.phase == 'B'
|
return item.phase == 'B'
|
||||||
})?.phase + '相',
|
})?.statisticalData || 0
|
||||||
value: listV.value.find((item: any) => {
|
|
||||||
return item.phase == 'B'
|
|
||||||
})?.statisticalData
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
pieChart2.value.initChart()
|
pieChart2.value.initChart()
|
||||||
echartsDataV3.value.options.series[0].data = [
|
echartsDataV3.value.options.series[0].data = [
|
||||||
{
|
{
|
||||||
name:
|
name: 'C相',
|
||||||
|
value:
|
||||||
listV.value.find((item: any) => {
|
listV.value.find((item: any) => {
|
||||||
return item.phase == 'C'
|
return item.phase == 'C'
|
||||||
})?.phase + '相',
|
})?.statisticalData || 0
|
||||||
value: listV.value.find((item: any) => {
|
|
||||||
return item.phase == 'C'
|
|
||||||
})?.statisticalData
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
pieChart3.value.initChart()
|
pieChart3.value.initChart()
|
||||||
echartsDataA1.value.options.series[0].data = [
|
echartsDataA1.value.options.series[0].data = [
|
||||||
{
|
{
|
||||||
name:
|
name: 'AB相',
|
||||||
|
value:
|
||||||
listA.value.find((item: any) => {
|
listA.value.find((item: any) => {
|
||||||
return item.phase == 'AB'
|
return item.phase == 'AB'
|
||||||
})?.phase + '相',
|
})?.statisticalData || 0
|
||||||
value: listA.value.find((item: any) => {
|
|
||||||
return item.phase == 'AB'
|
|
||||||
})?.statisticalData
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
pieChart4.value.initChart()
|
pieChart4.value.initChart()
|
||||||
echartsDataA2.value.options.series[0].data = [
|
echartsDataA2.value.options.series[0].data = [
|
||||||
{
|
{
|
||||||
name:
|
name: 'BC相',
|
||||||
|
value:
|
||||||
listA.value.find((item: any) => {
|
listA.value.find((item: any) => {
|
||||||
return item.phase == 'BC'
|
return item.phase == 'BC'
|
||||||
})?.phase + '相',
|
})?.statisticalData || 0
|
||||||
value: listA.value.find((item: any) => {
|
|
||||||
return item.phase == 'BC'
|
|
||||||
})?.statisticalData
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
pieChart5.value.initChart()
|
pieChart5.value.initChart()
|
||||||
echartsDataA3.value.options.series[0].data = [
|
echartsDataA3.value.options.series[0].data = [
|
||||||
{
|
{
|
||||||
name:
|
name: 'CA相',
|
||||||
|
value:
|
||||||
listA.value.find((item: any) => {
|
listA.value.find((item: any) => {
|
||||||
return item.phase == 'CA'
|
return item.phase == 'CA'
|
||||||
})?.phase + '相',
|
})?.statisticalData || 0
|
||||||
value: listA.value.find((item: any) => {
|
|
||||||
return item.phase == 'CA'
|
|
||||||
})?.statisticalData
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
pieChart6.value.initChart()
|
pieChart6.value.initChart()
|
||||||
|
|||||||
Reference in New Issue
Block a user