实时数据页面绘制

This commit is contained in:
zhujiyan
2024-07-03 19:31:43 +08:00
parent 8f1290111e
commit fbe6d6fae1
9 changed files with 1556 additions and 26 deletions

View File

@@ -0,0 +1,146 @@
<template>
<div>
<vxe-table
border
show-footer
ref="tableRef"
v-bind="defaultAttribute"
height="70"
align="center"
stripe
:loading="loading"
:print-config="{}"
:column-config="{ resizable: false, width: 90 }"
:data="tableData"
style="width: 100%; margin-top: 10px"
>
<div v-if="tableIndex == 0">
<vxe-colgroup title="电压有效值(kV)">
<vxe-column field="a" title="AB相"></vxe-column>
<vxe-column field="b" title="BC相"></vxe-column>
<vxe-column field="c" title="CA相"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="电流有效值(A)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="B相"></vxe-column>
<vxe-column field="c" title="C相"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="基波电压幅值(kV)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="B相"></vxe-column>
<vxe-column field="c" title="C相"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="基波电压相位(°)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="B相"></vxe-column>
<vxe-column field="c" title="C相"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="基波电流幅值(A)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="B相"></vxe-column>
<vxe-column field="c" title="C相"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="基波电流相位(°)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="B相"></vxe-column>
<vxe-column field="c" title="C相"></vxe-column>
</vxe-colgroup>
</div>
<div v-if="tableIndex == 1">
<vxe-colgroup title="电压偏差(%)">
<vxe-column field="a" title="AB相"></vxe-column>
<vxe-column field="b" title="BC相"></vxe-column>
<vxe-column field="c" title="CA相"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="电压总谐波畸变率(%)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="BC相"></vxe-column>
<vxe-column field="c" title="CA相"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="电流总谐波畸变率(%)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="BC相"></vxe-column>
<vxe-column field="c" title="CA相"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="电压不平衡度(%)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="BC相"></vxe-column>
<vxe-column field="c" title="CA相"></vxe-column>
</vxe-colgroup>
<vxe-column field="a" width="170" title="电流不平衡度(%)"></vxe-column>
<vxe-column field="b" width="170" title="频率(Hz)"></vxe-column>
<vxe-column field="c" width="170" title="基波电流相位(°)"></vxe-column>
</div>
<div v-if="tableIndex == 2">
<vxe-colgroup title="有功功率(kV)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="B相"></vxe-column>
<vxe-column field="c" title="C相"></vxe-column>
<vxe-column field="c" title="总有功功率"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="无功功率(kV)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="B相"></vxe-column>
<vxe-column field="c" title="C相"></vxe-column>
<vxe-column field="c" title="总无功功率"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="视在功率(kV)">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="B相"></vxe-column>
<vxe-column field="c" title="C相"></vxe-column>
<vxe-column field="c" title="总视在功率"></vxe-column>
</vxe-colgroup>
<vxe-colgroup title="功率因数">
<vxe-column field="a" title="A相"></vxe-column>
<vxe-column field="b" title="B相"></vxe-column>
<vxe-column field="c" title="C相"></vxe-column>
<vxe-column field="c" title="总功率因数"></vxe-column>
</vxe-colgroup>
</div>
</vxe-table>
</div>
</template>
<script lang="ts" setup>
import { ref, nextTick, onMounted } from 'vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { VxeTablePropTypes, VxeTableInstance, VxeToolbarInstance } from 'vxe-table'
interface RowVO {
a: string
b: string
c: string
}
const loading = ref(false)
const tableData = ref<RowVO[]>([])
const tableRef = ref<VxeTableInstance<RowVO>>()
const toolbarRef = ref<VxeToolbarInstance>()
loading.value = true
nextTick(() => {
// 将表格和工具栏进行关联
const $table = tableRef.value
const $toolbar = toolbarRef.value
if ($table && $toolbar) {
$table.connect($toolbar)
}
})
onMounted(() => {
loading.value = false
})
const tableIndex: any = ref(null)
const getTableData = (val: any, list: any) => {
tableIndex.value = val
tableData.value = list
loading.value = false
}
defineExpose({ getTableData })
</script>
<style lang="scss" scoped>
// ::v-deep .vxe-table--empty-content{
// display: none !important;
// }
</style>