<template>
    <!-- 综合评估详情 -->
    <el-dialog draggable title="指标合格率统计" v-model="dialogVisible" width="1500px">
        <div>
            <vxe-table v-bind="defaultAttribute" ref="vxeRef" height="600px" :data="tableData">
                <vxe-column field="substationName" title="变电站名称" />
                <vxe-column field="lineName" title="监测点名称" />
                <vxe-colgroup title="各指标合格率">
                    <vxe-column field="freqDev" sortable title="	频率偏差" :formatter="formatter" />
                    <vxe-column field="vdev" sortable title="电压偏差"  :formatter="formatter" />
                    <vxe-column field="vthd" sortable title="电压总谐波畸变率" width="180" :formatter="formatter" />
                    <vxe-column field="ubalance" sortable title="三相电压不平衡度" width="180" :formatter="formatter" />
                    <vxe-column field="plt" sortable title="闪变" :formatter="formatter" />
                    <vxe-column field="uharm" sortable title="谐波电压(%)" :formatter="formatter" />
                    <vxe-column field="iharm" sortable title="谐波电流(%)" :formatter="formatter" />
                    <vxe-column field="inuHarm" sortable title="间谐波电压(%)" width="180" :formatter="formatter" />
                    <vxe-column field="ineg" sortable title="负序电流(A)" :formatter="formatter" />
                </vxe-colgroup>
            </vxe-table>
        </div>
    </el-dialog>
</template>
<script setup lang="ts">
import { ref } from 'vue'
import MyEChart from '@/components/echarts/MyEchart.vue'
import { defaultAttribute } from '@/components/table/defaultAttribute'
import { qualifiedDetail } from '@/api/device-boot/panorama'
const dialogVisible: any = ref(false)

const tableData: any = ref([])

const open = async (row: any) => {
    qualifiedDetail(row).then(res => {
        tableData.value = res.data
    })
    dialogVisible.value = true
}
const formatter = (row: any) => {
    if (row.cellValue == 3.14159) {
        return '/'
    } else {
        return row.cellValue
    }
}

defineExpose({ open })
</script>
<style lang="scss" scoped></style>
