|
@@ -101,6 +101,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 () => {
|
|
|
const tempRes = await request.get('/wind/avg/speed', {
|
|
@@ -118,15 +121,21 @@ const funSubmit = async () => {
|
|
|
return new Date(a.time).getTime() - new Date(b.time).getTime()
|
|
|
})
|
|
|
const xAxisData = [], barData1 = [], barData2 = [], lineData1 = [], lineData2 = []
|
|
|
+ let avgSpeedSum = 0, avgMrxsSum = 0
|
|
|
for(const current of chart.currentData){
|
|
|
xAxisData.push(current.time)
|
|
|
barData1.push(current.avgspeed)
|
|
|
+ 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*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
|
|
@@ -168,7 +177,7 @@ const lineyAxis = reactive({
|
|
|
}
|
|
|
})
|
|
|
const lineSeries = reactive([{
|
|
|
- name: "每月NCF(最新)",
|
|
|
+ name: "最新",
|
|
|
type: "line",
|
|
|
data: [],
|
|
|
symbol: "line", //设定为实心点
|
|
@@ -176,7 +185,7 @@ const lineSeries = reactive([{
|
|
|
markLine: {
|
|
|
symbol: 'none',
|
|
|
label: {
|
|
|
- show: false,
|
|
|
+ show: true,
|
|
|
},
|
|
|
lineStyle: {
|
|
|
color: '#F72C5B'
|
|
@@ -184,7 +193,7 @@ const lineSeries = reactive([{
|
|
|
data: []
|
|
|
}
|
|
|
},{
|
|
|
- name: "每月NCF(历史)",
|
|
|
+ name: "历史",
|
|
|
type: "line",
|
|
|
data: [],
|
|
|
symbol: "line", //设定为实心点
|
|
@@ -286,7 +295,7 @@ const barSeries = reactive([{
|
|
|
markLine: {
|
|
|
symbol: 'none',
|
|
|
label: {
|
|
|
- show: false,
|
|
|
+ show: true,
|
|
|
},
|
|
|
lineStyle: {
|
|
|
color: '#F72C5B'
|
|
@@ -351,7 +360,7 @@ const funActCop = (obj, type) => {
|
|
|
case 'barChartCop':
|
|
|
actChartName.value = 'barChartCop'
|
|
|
obj.actCop = shallowRef(barChartCop)
|
|
|
- actDiaTitle.value = '月平均风速'
|
|
|
+ actDiaTitle.value = '风速'
|
|
|
break
|
|
|
case 'lineChartCop':
|
|
|
actChartName.value = 'lineChartCop'
|
|
@@ -405,22 +414,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
|
|
@@ -441,8 +456,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
|
|
@@ -543,14 +558,14 @@ 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="`${windName} 平均风速 ${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="`${windName} 平均毛容量系数 ${avgMrxs}`" :xAxis="linexAxis" :yAxis="lineyAxis" :series="lineSeries"></bar-chart-cop>
|
|
|
</div>
|
|
|
</div>
|
|
|
</el-col>
|