统计分析
This commit is contained in:
parent
10846b3a2e
commit
366f2332eb
@ -200,7 +200,7 @@ const pageSetting = reactive({
|
||||
current: 1,
|
||||
pageSize: 20,
|
||||
total: 0,
|
||||
pageSizes: [10, 20, 30],
|
||||
pageSizes: [20, 50, 100],
|
||||
})
|
||||
|
||||
const getcurrentPage = () => {
|
||||
|
@ -25,6 +25,7 @@
|
||||
v-model="statAnalysisTime"
|
||||
:type="statAnalysisInterval == '1d' ? 'daterange' : 'datetimerange'"
|
||||
:value-format="statAnalysisInterval == '1d' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]"
|
||||
:teleported="false"
|
||||
:shortcuts="shortcuts"
|
||||
/>
|
||||
|
@ -48,6 +48,7 @@
|
||||
:value-format="statAnalysisSelect.interval == '1d' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'"
|
||||
:teleported="false"
|
||||
:shortcuts="shortcuts"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]"
|
||||
@change="timechange(index)"
|
||||
/>
|
||||
</div>
|
||||
@ -98,7 +99,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref, onMounted } from 'vue'
|
||||
import { reactive, ref, onMounted, markRaw } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { queryWindTurbinesPages, historyReq } from '/@/api/backend/statAnalysis/request'
|
||||
import { ElMessage } from 'element-plus'
|
||||
@ -214,7 +215,7 @@ const chart: any = ref(null)
|
||||
|
||||
onMounted(() => {
|
||||
if (chartContainer.value) {
|
||||
chart.value = echarts.init(chartContainer.value)
|
||||
chart.value = markRaw(echarts.init(chartContainer.value))
|
||||
chart.value.setOption({
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
@ -388,10 +389,15 @@ const historyDataReq = (data: any, index: number) => {
|
||||
})
|
||||
option.tooltip = {
|
||||
show: true,
|
||||
trigger: 'axis',
|
||||
formatter: function (params: any) {
|
||||
const matchData = xDatas.filter((x: any) => x.series == params.seriesName)
|
||||
const x = timestampToTime(matchData[0]['data'][params.dataIndex])
|
||||
return `${params.marker} ${params.seriesName} <br/> ${x} <b>${params.data}</b>`
|
||||
return params
|
||||
.map((item: any) => {
|
||||
const matchData = xDatas.filter((x: any) => x.series == item.seriesName)
|
||||
const x = timestampToTime(matchData[0]['data'][item.dataIndex])
|
||||
return `${item.marker}${item.seriesName} (${x}): ${item.data}`
|
||||
})
|
||||
.join('<br/>')
|
||||
},
|
||||
}
|
||||
option.xAxis.data = Array.from({ length: xData.length }, (_, index) => index)
|
||||
|
@ -9,6 +9,7 @@
|
||||
v-model="statAnalysisTime"
|
||||
:type="statAnalysisInterval == '1d' ? 'daterange' : 'datetimerange'"
|
||||
:value-format="statAnalysisInterval == '1d' ? 'YYYY-MM-DD' : 'YYYY-MM-DD HH:mm:ss'"
|
||||
:default-time="[new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]"
|
||||
:teleported="false"
|
||||
:shortcuts="shortcuts"
|
||||
/>
|
||||
@ -104,7 +105,7 @@
|
||||
</div>
|
||||
</template>
|
||||
<script setup lang="ts">
|
||||
import { onUnmounted, reactive, ref, watch, nextTick, onMounted, computed } from 'vue'
|
||||
import { markRaw, reactive, ref, watch, nextTick, onMounted, computed } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { queryWindTurbinesPages, historyReq } from '/@/api/backend/statAnalysis/request'
|
||||
import { ElMessage, ElMenu } from 'element-plus'
|
||||
@ -216,7 +217,7 @@ const customName = reactive(['1'])
|
||||
const chart: any = ref(null)
|
||||
onMounted(() => {
|
||||
if (chartContainer.value) {
|
||||
chart.value = echarts.init(chartContainer.value)
|
||||
chart.value = markRaw(echarts.init(chartContainer.value))
|
||||
chart.value.setOption({
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
@ -366,6 +367,18 @@ const historyDataReq = (data: any) => {
|
||||
data: yData,
|
||||
}
|
||||
calculate[dataIndex] = calculateStats(yData)
|
||||
option.tooltip = {
|
||||
show: true,
|
||||
trigger: 'axis',
|
||||
formatter: function (params: any) {
|
||||
console.log(params)
|
||||
return params
|
||||
.map((item: any) => {
|
||||
return `${item.marker} ${item.seriesName} (${timestampToTime(xData[item.dataIndex])}): ${item.data}`
|
||||
})
|
||||
.join('<br/>')
|
||||
},
|
||||
}
|
||||
option.legend.data.push(customName[dataIndex])
|
||||
option.xAxis.data = xData.map((item: any) => timestampToTime(item))
|
||||
option.series.push(seriesData)
|
||||
|
Loading…
Reference in New Issue
Block a user