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