Files
admin-govern/src/views/dashboard/index.vue

87 lines
2.6 KiB
Vue
Raw Normal View History

2023-12-21 16:42:39 +08:00
<template>
2023-12-27 16:32:31 +08:00
<div class="default-main">
<el-form :inline="true" :model="formInline" class="demo-form-inline">
<el-form-item label="区域">
2024-01-02 16:34:56 +08:00
<Area v-model="formInline.deptIndex" />
2023-12-27 16:32:31 +08:00
</el-form-item>
<el-form-item label="时间">
<el-date-picker v-model="formInline.searchBeginTime" type="date" placeholder="请选择时间" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">查询</el-button>
</el-form-item>
</el-form>
2024-01-03 11:37:21 +08:00
<el-tabs v-model="activeName" type="border-card" v-loading="loading">
2023-12-27 16:32:31 +08:00
<el-tab-pane label="图形" name="1">
<Echart :list="list" ref="echarts" />
</el-tab-pane>
2024-01-02 16:34:56 +08:00
<el-tab-pane label="表格" name="2"><Tableabove ref="table" /></el-tab-pane>
2023-12-27 16:32:31 +08:00
</el-tabs>
</div>
2023-12-22 10:22:22 +08:00
</template>
2023-12-26 14:15:05 +08:00
<script setup lang="ts">
2024-01-02 16:34:56 +08:00
import Area from '@/components/form/area/index.vue'
import { useDictData } from '@/stores/dictData'
2023-12-26 14:15:05 +08:00
import Echart from '@/views/dashboard/components/echart.vue'
2023-12-27 16:32:31 +08:00
import Tableabove from '@/views/dashboard/components/Tableabove.vue'
2024-01-02 16:34:56 +08:00
import { onMounted, reactive, ref, onBeforeMount } from 'vue'
2023-12-27 15:06:23 +08:00
2024-01-02 16:34:56 +08:00
defineOptions({
name: 'Region/overview'
})
const activeName = ref('1')
2023-12-27 15:06:23 +08:00
import { getAreaCalculation } from '@/api/test'
const list = ref([])
const echarts = ref()
2023-12-27 16:32:31 +08:00
const table = ref()
2024-01-02 16:34:56 +08:00
const dictData = useDictData()
2024-01-03 11:37:21 +08:00
const loading = ref(true)
2023-12-27 15:06:23 +08:00
const formInline = reactive({
deptInd: '',
2024-01-02 16:34:56 +08:00
deptIndex: dictData.state.area[0].id,
2023-12-27 15:06:23 +08:00
monitorFlag: 2,
powerFlag: 2,
serverName: 'event-boot',
searchBeginTime: '2023-12-01',
searchEndTime: '2023-12-26',
statisticalType: {
name: '电网拓扑',
id: 'cc28974d259ad22642f6a1bff708f967',
code: 'Power_Network',
value: 'cc28974d259ad22642f6a1bff708f967',
gvalue: null,
label: '电网拓扑',
sort: 0
},
timeFlag: 1
})
// const locale=zhCn
const onSubmit = async () => {
2024-01-03 11:37:21 +08:00
loading.value = true
2023-12-27 15:06:23 +08:00
await getAreaCalculation(formInline).then(res => {
list.value = res.data
echarts.value.Processing(res.data.areaStatistics)
echarts.value.Grade(res.data.voltageStatistics)
echarts.value.Relation(res.data.monthlyStatistics)
2023-12-27 16:32:31 +08:00
table.value.info(res.data)
2024-01-03 11:37:21 +08:00
loading.value = false
2023-12-27 15:06:23 +08:00
})
}
onMounted(() => {
onSubmit()
})
2023-12-22 10:22:22 +08:00
</script>
2023-12-26 14:15:05 +08:00
<style lang="scss" scoped>
.bars_w {
width: 100%;
height: 500px;
}
2023-12-26 14:51:03 +08:00
::v-deep(.el-tabs__content) {
2023-12-27 15:06:23 +08:00
height: calc(100vh - 161px);
2023-12-26 14:51:03 +08:00
overflow-y: auto;
}
2023-12-26 14:15:05 +08:00
</style>