|
@@ -113,6 +113,9 @@ const funCurrentChange = ({ current, currentNode }) => {
|
|
|
/**chart */
|
|
|
let chartId = 1
|
|
|
const powerproductionNum = ref(0)
|
|
|
+const avgSpeed = ref('')
|
|
|
+const avgMrxs = ref('')
|
|
|
+const windName = ref('')
|
|
|
/**submit */
|
|
|
const funSubmit = async () => {
|
|
|
if (!excelCheckIds.value.length) {
|
|
@@ -126,27 +129,31 @@ const funSubmit = async () => {
|
|
|
}
|
|
|
})
|
|
|
if (tempRes.code === 200) {
|
|
|
- if (tempRes.data?.length) {
|
|
|
- const xAxisData = [], barData1 = [], barData2 = [], lineData1 = [], lineData2 = []
|
|
|
- for (const chart of tempRes.data) {
|
|
|
- xAxisData.push(chart.wtId)
|
|
|
- if (chart.currentData){
|
|
|
- barData1.push(chart.currentData.avgspeed)
|
|
|
- lineData1.push((chart.currentData.mrxs*100).toFixed(2))
|
|
|
- }
|
|
|
- if (chart.preData){
|
|
|
- barData2.push(chart.preData.avgspeed)
|
|
|
- lineData2.push((chart.preData.mrxs*100).toFixed(2))
|
|
|
- }
|
|
|
- barxAxis.data = xAxisData
|
|
|
- linexAxis.data = xAxisData
|
|
|
- barSeries[0].data = barData1
|
|
|
- barSeries[1].data = barData2
|
|
|
- chartId++
|
|
|
- lineSeries[0].data = lineData1
|
|
|
- lineSeries[1].data = lineData2
|
|
|
- chartId++
|
|
|
+ const xAxisData = [], barData1 = [], barData2 = [], lineData1 = [], lineData2 = []
|
|
|
+ let avgSpeedSum = 0, avgMrxsSum = 0
|
|
|
+ for (const chart of tempRes.data) {
|
|
|
+ xAxisData.push(chart.wtId)
|
|
|
+ if (chart.currentData) {
|
|
|
+ barData1.push(chart.currentData.avgspeed)
|
|
|
+ lineData1.push((chart.currentData.mrxs*100).toFixed(2))
|
|
|
+ avgSpeedSum += chart.currentData.avgspeed
|
|
|
+ avgMrxsSum += chart.currentData.mrxs
|
|
|
+ }
|
|
|
+ if (chart.preData){
|
|
|
+ barData2.push(chart.preData.avgspeed)
|
|
|
+ lineData2.push((chart.preData.mrxs*100).toFixed(2))
|
|
|
}
|
|
|
+ avgSpeed.value = (avgSpeedSum / barData1.length).toFixed(2)+' m/s'
|
|
|
+ avgMrxs.value = (avgMrxsSum / lineData1.length * 100).toFixed(2)+' %'
|
|
|
+ windName.value = chart.wtId
|
|
|
+ barxAxis.data = xAxisData
|
|
|
+ linexAxis.data = xAxisData
|
|
|
+ barSeries[0].data = barData1
|
|
|
+ barSeries[1].data = barData2
|
|
|
+ chartId++
|
|
|
+ lineSeries[0].data = lineData1
|
|
|
+ lineSeries[1].data = lineData2
|
|
|
+ chartId++
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -179,7 +186,7 @@ const lineyAxis = reactive({
|
|
|
}
|
|
|
})
|
|
|
const lineSeries = reactive([{
|
|
|
- name: "每月NCF(最新)",
|
|
|
+ name: "最新",
|
|
|
type: "line",
|
|
|
data: [],
|
|
|
symbol: "line", //设定为实心点
|
|
@@ -187,7 +194,7 @@ const lineSeries = reactive([{
|
|
|
markLine: {
|
|
|
symbol: 'none',
|
|
|
label: {
|
|
|
- show: false,
|
|
|
+ show: true,
|
|
|
},
|
|
|
lineStyle: {
|
|
|
color: '#F72C5B'
|
|
@@ -195,7 +202,7 @@ const lineSeries = reactive([{
|
|
|
data: []
|
|
|
}
|
|
|
},{
|
|
|
- name: "每月NCF(历史)",
|
|
|
+ name: "历史",
|
|
|
type: "line",
|
|
|
data: [],
|
|
|
symbol: "line", //设定为实心点
|
|
@@ -304,7 +311,7 @@ const barSeries = reactive([{
|
|
|
markLine: {
|
|
|
symbol: 'none',
|
|
|
label: {
|
|
|
- show: false,
|
|
|
+ show: true,
|
|
|
},
|
|
|
lineStyle: {
|
|
|
color: '#F72C5B'
|
|
@@ -376,7 +383,7 @@ const funActCop = (obj, type) => {
|
|
|
case 'barChartCop':
|
|
|
actChartName.value = 'barChartCop'
|
|
|
obj.actCop = shallowRef(barChartCop)
|
|
|
- actDiaTitle.value = '月平均风速'
|
|
|
+ actDiaTitle.value = '风速'
|
|
|
break
|
|
|
case 'lineChartCop':
|
|
|
actChartName.value = 'lineChartCop'
|
|
@@ -430,22 +437,28 @@ const funDiaSubmit = async () => {
|
|
|
return new Date(a.time).getTime() - new Date(b.time).getTime()
|
|
|
})
|
|
|
const xAxisData = [], barData1 = [], barData2 = [], lineData1 = [], lineData2 = []
|
|
|
+ let avgSpeedSum = 0, avgMrxsSum = 0
|
|
|
+ let avgSpeedDesc = '', avgMrxsDesc = ''
|
|
|
for(const current of chart.currentData){
|
|
|
xAxisData.push(current.time)
|
|
|
barData1.push(current.avgspeed)
|
|
|
- lineData1.push(current.mrxs)
|
|
|
+ avgSpeedSum += current.avgspeed
|
|
|
+ avgMrxsSum += current.mrxs
|
|
|
+ lineData1.push((current.mrxs*100).toFixed(2))
|
|
|
}
|
|
|
for(const current of chart.preData){
|
|
|
barData2.push(current.avgspeed)
|
|
|
- lineData2.push(current.mrxs)
|
|
|
+ lineData2.push((current.mrxs*100).toFixed(2))
|
|
|
}
|
|
|
+ avgSpeedDesc = (avgSpeedSum / barData1.length).toFixed(2)+' m/s'
|
|
|
+ avgMrxsDesc = (avgMrxsSum / lineData1.length * 100).toFixed(2)+' %'
|
|
|
if(actChartName.value==='barChartCop'){
|
|
|
actCopList.value.push({
|
|
|
id: chartId,
|
|
|
isBrush: false,
|
|
|
actCop: shallowRef(barChartCop),
|
|
|
- title: chart.windturbine,
|
|
|
- subtext: `月平均风速`,
|
|
|
+ // title: chart.windturbine,
|
|
|
+ subtext: `${chart.wtId} 平均风速 ${avgSpeedDesc}`,
|
|
|
xAxis: {
|
|
|
...barxAxis,
|
|
|
data: xAxisData
|
|
@@ -466,8 +479,8 @@ const funDiaSubmit = async () => {
|
|
|
id: chartId,
|
|
|
isBrush: false,
|
|
|
actCop: shallowRef(barChartCop),
|
|
|
- title: chart.windturbine,
|
|
|
- subtext: `毛容量系数`,
|
|
|
+ // title: chart.windturbine,
|
|
|
+ subtext: `${chart.wtId} 平均毛容量系数 ${avgMrxsDesc}`,
|
|
|
xAxis: {
|
|
|
...linexAxis,
|
|
|
data: xAxisData
|
|
@@ -568,14 +581,19 @@ onActivated(() => {
|
|
|
@click="funActCop({xAxis:barxAxis, yAxis:baryAxis, series: barSeries}, 'barChartCop')">
|
|
|
<ZoomIn />
|
|
|
</el-icon> -->
|
|
|
- <bar-chart-cop width="100%" height="100%" :subtext="`月平均风速`" :xAxis="barxAxis" :yAxis="baryAxis" :series="barSeries"></bar-chart-cop>
|
|
|
+ <!-- <bar-chart-cop width="100%" height="100%" :subtext="`月平均风速`" :xAxis="barxAxis" :yAxis="baryAxis" :series="barSeries"></bar-chart-cop> -->
|
|
|
+ <!-- </el-icon> -->
|
|
|
+ <bar-chart-cop width="100%" height="100%" :subtext="`平均风速 ${avgSpeed}`" :xAxis="barxAxis" :yAxis="baryAxis" :series="barSeries"></bar-chart-cop>
|
|
|
</div>
|
|
|
<div class="w-[100%] h-[49%] flex flex-col items-end shadow rounded-[6px] shadow-blue-500">
|
|
|
<!-- <el-icon class="mr-[10px] mt-[10px] cursor-pointer" size="18"
|
|
|
@click="funActCop({xAxis:linexAxis, yAxis:lineyAxis, series: lineSeries}, 'lineChartCop')">
|
|
|
<ZoomIn />
|
|
|
+
|
|
|
</el-icon> -->
|
|
|
- <bar-chart-cop width="100%" height="100%" :subtext="`毛容量系数`" :xAxis="linexAxis" :yAxis="lineyAxis" :series="lineSeries"></bar-chart-cop>
|
|
|
+ <!-- <bar-chart-cop width="100%" height="100%" :subtext="`毛容量系数`" :xAxis="linexAxis" :yAxis="lineyAxis" :series="lineSeries"></bar-chart-cop> -->
|
|
|
+ <!-- </el-icon> -->
|
|
|
+ <bar-chart-cop width="100%" height="100%" :subtext="`平均毛容量系数 ${avgMrxs}`" :xAxis="linexAxis" :yAxis="lineyAxis" :series="lineSeries"></bar-chart-cop>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-col>
|