<template>
    <div class="default-main">

        <TableHeader datePicker area>
            <template #select>
                <el-form-item label="统计类型:">
                    <el-select v-model="tableStore.table.params.statisticalType" placeholder="请选择统计类型" value-key="id">
                        <el-option v-for="item in classificationData" :key="item.id" :label="item.name" :value="item">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="电压等级:">
                    <el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
                        placeholder="请选择电压等级" value-key="id">
                        <el-option v-for="item in voltageleveloption" :key="item.id" :label="item.name" :value="item">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="终端厂家:">
                    <el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
                        clearable placeholder="请选择终端厂家" value-key="id">
                        <el-option v-for="item in terminaloption" :key="item.id" :label="item.name" :value="item">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="干扰源类型:">
                    <el-select v-model="tableStore.table.params.loadType" filterable multiple collapse-tags clearable
                        placeholder="请选择干扰源类型" value-key="id">
                        <el-option v-for="item in interfereoption" :key="item.id" :label="item.name" :value="item">
                        </el-option>
                    </el-select>
                </el-form-item>
            </template>

        </TableHeader>
        <Table ref="tableRef" isGroup />



    </div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { useDictData } from '@/stores/dictData'
import TableHeader from '@/components/table/header/index.vue'
const dictData = useDictData()
defineOptions({
    name: 'harmonic-boot/detailedAnalysis/details'
})
const view = ref(true)
const classificationData = dictData.getBasicData('Statistical_Type', ["Report_Type"])
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
const interfereoption = dictData.getBasicData('Interference_Source')


const tableStore = new TableStore({
    url: '/harmonic-boot/detailAnalysis/lineOverLimit',
    method: 'POST',

    column: [
        { field: 'index', title: '序号', width: '80', formatter: (row: any) => { return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1 } },
        { field: 'provinceCompany', title: '地级区', minWidth: "150px", },
        { field: 'cityCompany', title: '供电公司', minWidth: "150px", },
        { field: 'subName', title: '变电站', minWidth: "150px", },
        { field: 'lineScale', title: '电压等级', minWidth: "150px", },
        { field: 'lineName', title: '监测点名称', minWidth: "150px", },
        { field: 'loadType', title: '干扰源类型', minWidth: "150px", },
        { field: 'lineObjectName', title: '监测点对象名称', minWidth: "150px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue } },
        { field: 'overDay', title: '超标天数', minWidth: "150px", },
        { field: 'freqOverDay', title: '频率偏差超标天数', minWidth: "150px", },
        { field: 'volDevOverDay', title: '电压偏差超标天数', minWidth: "180px", },
        { field: 'volDisOverDay', title: '电压总畸变率超标天数', minWidth: "180px", },
        { field: 'volContainOverDay', title: '谐波电压含有率超标天数', minWidth: "180px", },
        { field: 'harmVolOverDay', title: '谐波电压超标天数', minWidth: "180px", },
        { field: 'harmCurOverDay', title: '谐波电流超标天数', minWidth: "180px", },
        {
            title: '各次谐波电压含有率(%)',
            children: [
                { field: 'overVolThreeTimes', title: '3次', minWidth: "80px", },
                { field: 'overVolFiveTimes', title: '5次', minWidth: "80px", },
                { field: 'overVolSevenTimes', title: '7次', minWidth: "80px", },
                { field: 'overVolElevenTimes', title: '11次', minWidth: "80px", },
                { field: 'overVolThirteenTimes', title: '13次', minWidth: "80px", },
                { field: 'overVolTwentyThreeTimes', title: '23次', minWidth: "80px", },
                { field: 'overVolTwentyFiveTimes', title: '25次', minWidth: "80px", },
                { field: 'overVolOtherTimes', title: '其他次', minWidth: "80px", },

            ],
        },
        {
            title: '各次谐波电流幅值(A)',
            children: [
                { field: 'overCurThreeTimes', title: '3次', minWidth: "80px", },
                { field: 'overCurFiveTimes', title: '5次', minWidth: "80px", },
                { field: 'overCurSevenTimes', title: '7次', minWidth: "80px", },
                { field: 'overCurElevenTimes', title: '11次', minWidth: "80px", },
                { field: 'overCurThirteenTimes', title: '13次', minWidth: "80px", },
                { field: 'overCurTwentyThreeTimes', title: '23次', minWidth: "80px", },
                { field: 'overCurTwentyFiveTimes', title: '25次', minWidth: "80px", },
                { field: 'overCurOtherTimes', title: '其他次', minWidth: "80px", },

            ],
        },
        { field: 'threeUnbalance', title: '三相电压不平衡度超标天数', minWidth: "180px", },
        { field: 'negativeOverDay', title: '负序电流超标天数', minWidth: "180px", },
        { field: 'flickerOverDay', title: '闪变超标天数', minWidth: "180px", },
        { field: 'monitorNumber', title: '监测点编号', minWidth: "180px", formatter: (row: any) => { return row.cellValue == null ? '/' : row.cellValue }  },





    ],
    beforeSearchFun: () => {
    },

})
tableStore.table.params.statisticalType = classificationData[0]
tableStore.table.params.serverName = "harmonic-boot"
tableStore.table.params.powerFlag = 2
tableStore.table.params.monitorFlag = 2
tableStore.table.params.scale = []
tableStore.table.params.manufacturer = []
tableStore.table.params.loadType = []
const wp = ref({})

provide('tableStore', tableStore)
onMounted(() => {
    tableStore.index()
})





</script>
